Klasse Sprite

java.lang.Object
libsidplay.common.Event
libsidplay.components.mos656x.Sprite

public final class Sprite extends Event
Sprite class to handle all data for sprites.
Autor:
Jörg Jahnke (joergjahnke@users.sourceforge.net), Antti S. Lankila (alankila@bel.fi)
  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen libsidplay.common.Event

    Event.ConsumerThatThrows<T>, Event.Phase
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    private boolean
    Allow display to be enabled.
    private final int[]
    Sprite colors: 0, 1, and our own color.
    protected int
     
    private int
     
    (Package privat) boolean
    Is sprite pixel pipeline active?
    private int
    Position sprite start within character cell
    private boolean
    Is display enabled
    private boolean
    Is the sprite current enabled
    private boolean
    Is the sprite expanded horizontally?
    private boolean
     
    private boolean
    Is the sprite expanded vertically?
    private boolean
    This is the first read of multicolor pixel?
    private boolean
    This is the first read of a pixel for an X-expanded sprite?
    private boolean
    This is the first read of a line for an Y-expanded sprite?
    protected final int
    Sprite index
    protected final int
     
    private int
    32 bits of sprite data in reversed bit order (LSB = first out)
    private final Sprite
    MOS656X instance this sprite belongs to
    private int
    Data byte at DMA
    private int
    Data byte to fetch next
    private boolean
    Multicolor mode on?
    private boolean
    Read the color number of the next pixel of the current sprite line.
    protected Sprite
    Visible sprites in linked list; highest priority sprite first
    private byte
    Sprite address byte
    private int
     
    private int
     
    private int
    The masking to be used for migrating color 1 as foreground color during sprite priority bit handling
    private boolean
    Does the sprite have priority over the screen background?
    private int
    Sprite position
    private int
    Sprite position

    Von Klasse geerbte Felder libsidplay.common.Event

    name, next, triggerTime
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Sprite(Sprite linkedListHead, int index)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    Reset current DMA byte and expansion/multicolor flip-flops.
    int
    Generate graphics data for the next 8 pixels for the sprite Foreground pixels are identified by having any bit set.
    void
    Event code to be executed.
    void
    Toggle sprite Y expansion flag
    void
    Increment sprite read pointer during Y expansion
    int
    getColor(int idx)
     
    int
     
    int
     
    int
    Get the X-coordinate of the sprite
    int
    Get the Y-coordinate of the sprite
    void
    Begin rendering sprite on a line
    boolean
     
    boolean
    Check whether the sprite is currently enabled
    void
    Damage the sprite display around the pointer fetch region.
    void
    setAllowDisplay(boolean allowDisplay)
     
    void
    setColor(int idx, int val)
     
    void
    setDisplay(boolean display)
     
    protected void
    setDisplayStart(int delayPixels)
    Delay sprite data appearance by given count of pixels.
    void
    setEnabled(boolean enabled)
    Set whether the sprite is currently enabled
    void
    setExpandX(boolean expandX)
    Set expandX flag for horizontal expansion
    void
    setExpandY(boolean expandY, boolean crunchCycle)
    Set expandY flag for vertical expansion
    void
    setMulticolor(boolean multiColor)
    Change multicolor flag.
    void
    setPointerByte(byte pointerByte)
    Set the address we read the sprite data from
    void
    Set whether the sprite has priority over the screen background
    void
    setSpriteByte(int idx, byte value)
    Store a sprite byte into sprite shift register for use.
    void
    setX(int x)
    Set the X-coordinate of the sprite
    void
    setY(int y)
    Set the Y-coordinate of the sprite

    Von Klasse geerbte Methoden libsidplay.common.Event

    of, toString

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Felddetails

    • index

      protected final int index
      Sprite index
    • linkedListHead

      private final Sprite linkedListHead
      MOS656X instance this sprite belongs to
    • nextVisibleSprite

      protected Sprite nextVisibleSprite
      Visible sprites in linked list; highest priority sprite first
    • delayPixels

      private int delayPixels
      Position sprite start within character cell
    • display

      private boolean display
      Is display enabled
    • consuming

      boolean consuming
      Is sprite pixel pipeline active?
    • firstMultiColorRead

      private boolean firstMultiColorRead
      This is the first read of multicolor pixel? (consuming read)
    • lineData

      private int lineData
      32 bits of sprite data in reversed bit order (LSB = first out)
    • pointerByte

      private byte pointerByte
      Sprite address byte
    • mcBase

      private int mcBase
      Data byte to fetch next
    • mc

      private int mc
      Data byte at DMA
    • firstYRead

      private boolean firstYRead
      This is the first read of a line for an Y-expanded sprite? (no pointer increment)
    • firstXRead

      private boolean firstXRead
      This is the first read of a pixel for an X-expanded sprite? (consuming read)
    • x

      private int x
      Sprite position
    • y

      private int y
      Sprite position
    • enabled

      private boolean enabled
      Is the sprite current enabled
    • expandX

      private boolean expandX
      Is the sprite expanded horizontally?
    • expandY

      private boolean expandY
      Is the sprite expanded vertically?
    • multiColor

      private boolean multiColor
      Multicolor mode on?
    • priorityOverForegroundGraphics

      private boolean priorityOverForegroundGraphics
      Does the sprite have priority over the screen background?
    • priorityMask

      private int priorityMask
      The masking to be used for migrating color 1 as foreground color during sprite priority bit handling
    • multiColorLatched

      private boolean multiColorLatched
      Read the color number of the next pixel of the current sprite line. Colors 0, 1 are background colors, color 2 sprite color #2, colors 3-> sprite-specific colors.
    • prevPixel

      private int prevPixel
    • expandXLatched

      private boolean expandXLatched
    • consumedLineData

      private int consumedLineData
    • allowDisplay

      private boolean allowDisplay
      Allow display to be enabled.
    • color

      private final int[] color
      Sprite colors: 0, 1, and our own color.
    • prevPriority

      private int prevPriority
    • colorBuffer

      protected int colorBuffer
    • indexBits

      protected final int indexBits
  • Konstruktordetails

    • Sprite

      public Sprite(Sprite linkedListHead, int index)
  • Methodendetails

    • event

      public void event()
      Beschreibung aus Klasse kopiert: Event
      Event code to be executed. Events are allowed to safely reschedule themselves with the EventScheduler during invocations.
      Angegeben von:
      event in Klasse Event
    • setDisplayStart

      protected void setDisplayStart(int delayPixels)
      Delay sprite data appearance by given count of pixels.
      Parameter:
      delayPixels -
    • getX

      public int getX()
      Get the X-coordinate of the sprite
      Gibt zurück:
      X-coordinate
    • setX

      public void setX(int x)
      Set the X-coordinate of the sprite
      Parameter:
      x - new X-coordinate
    • getY

      public int getY()
      Get the Y-coordinate of the sprite
      Gibt zurück:
      Y-coordinate
    • setY

      public void setY(int y)
      Set the Y-coordinate of the sprite
      Parameter:
      y - new Y-coordinate
    • setPriorityOverForegroundGraphics

      public void setPriorityOverForegroundGraphics(boolean priority)
      Set whether the sprite has priority over the screen background
      Parameter:
      priority - true if the sprite has priority over the screen content
    • isEnabled

      public boolean isEnabled()
      Check whether the sprite is currently enabled
      Gibt zurück:
      true if enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Set whether the sprite is currently enabled
      Parameter:
      enabled - true if enabled
    • setExpandX

      public void setExpandX(boolean expandX)
      Set expandX flag for horizontal expansion
      Parameter:
      expandX - true if expanded
    • setExpandY

      public void setExpandY(boolean expandY, boolean crunchCycle)
      Set expandY flag for vertical expansion
      Parameter:
      expandY - true if expanded
      crunchCycle - whether to do sprite crunch
    • setMulticolor

      public void setMulticolor(boolean multiColor)
      Change multicolor flag.
      Parameter:
      multiColor - true if multicolor
    • beginDMA

      public void beginDMA()
      Reset current DMA byte and expansion/multicolor flip-flops.
    • isDMA

      public boolean isDMA()
    • setDisplay

      public void setDisplay(boolean display)
    • setPointerByte

      public void setPointerByte(byte pointerByte)
      Set the address we read the sprite data from
      Parameter:
      pointerByte - address to read from
    • getCurrentByteAddress

      public int getCurrentByteAddress()
    • setSpriteByte

      public void setSpriteByte(int idx, byte value)
      Store a sprite byte into sprite shift register for use.
    • initDmaAccess

      public void initDmaAccess()
      Begin rendering sprite on a line
    • finishDmaAccess

      public void finishDmaAccess()
      Increment sprite read pointer during Y expansion
    • expandYFlipFlop

      public void expandYFlipFlop()
      Toggle sprite Y expansion flag
    • setColor

      public void setColor(int idx, int val)
    • getColor

      public int getColor(int idx)
    • calculateNext8Pixels

      public int calculateNext8Pixels()
      Generate graphics data for the next 8 pixels for the sprite Foreground pixels are identified by having any bit set.
      Gibt zurück:
      packed pixel array with colors 0, 1, 2, 3+index
    • repeatPixels

      public void repeatPixels()
      Damage the sprite display around the pointer fetch region. The 3rd pixel into that region is duplicated 9 times, and nothing after that is shown.
    • getNextPriorityMask

      public int getNextPriorityMask()
    • setAllowDisplay

      public void setAllowDisplay(boolean allowDisplay)