Package libsidplay.components.mos656x
Klasse Sprite
java.lang.Object
libsidplay.common.Event
libsidplay.components.mos656x.Sprite
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
FelderModifizierer und TypFeldBeschreibungprivate booleanAllow display to be enabled.private final int[]Sprite colors: 0, 1, and our own color.protected intprivate int(Package privat) booleanIs sprite pixel pipeline active?private intPosition sprite start within character cellprivate booleanIs display enabledprivate booleanIs the sprite current enabledprivate booleanIs the sprite expanded horizontally?private booleanprivate booleanIs the sprite expanded vertically?private booleanThis is the first read of multicolor pixel?private booleanThis is the first read of a pixel for an X-expanded sprite?private booleanThis is the first read of a line for an Y-expanded sprite?protected final intSprite indexprotected final intprivate int32 bits of sprite data in reversed bit order (LSB = first out)private final SpriteMOS656X instance this sprite belongs toprivate intData byte at DMAprivate intData byte to fetch nextprivate booleanMulticolor mode on?private booleanRead the color number of the next pixel of the current sprite line.protected SpriteVisible sprites in linked list; highest priority sprite firstprivate byteSprite address byteprivate intprivate intprivate intThe masking to be used for migrating color 1 as foreground color during sprite priority bit handlingprivate booleanDoes the sprite have priority over the screen background?private intSprite positionprivate intSprite positionVon Klasse geerbte Felder libsidplay.common.Event
name, next, triggerTime -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidbeginDMA()Reset current DMA byte and expansion/multicolor flip-flops.intGenerate graphics data for the next 8 pixels for the sprite Foreground pixels are identified by having any bit set.voidevent()Event code to be executed.voidToggle sprite Y expansion flagvoidIncrement sprite read pointer during Y expansionintgetColor(int idx) intintintgetX()Get the X-coordinate of the spriteintgetY()Get the Y-coordinate of the spritevoidBegin rendering sprite on a linebooleanisDMA()booleanCheck whether the sprite is currently enabledvoidDamage the sprite display around the pointer fetch region.voidsetAllowDisplay(boolean allowDisplay) voidsetColor(int idx, int val) voidsetDisplay(boolean display) protected voidsetDisplayStart(int delayPixels) Delay sprite data appearance by given count of pixels.voidsetEnabled(boolean enabled) Set whether the sprite is currently enabledvoidsetExpandX(boolean expandX) Set expandX flag for horizontal expansionvoidsetExpandY(boolean expandY, boolean crunchCycle) Set expandY flag for vertical expansionvoidsetMulticolor(boolean multiColor) Change multicolor flag.voidsetPointerByte(byte pointerByte) Set the address we read the sprite data fromvoidsetPriorityOverForegroundGraphics(boolean priority) Set whether the sprite has priority over the screen backgroundvoidsetSpriteByte(int idx, byte value) Store a sprite byte into sprite shift register for use.voidsetX(int x) Set the X-coordinate of the spritevoidsetY(int y) Set the Y-coordinate of the sprite
-
Felddetails
-
index
protected final int indexSprite index -
linkedListHead
MOS656X instance this sprite belongs to -
nextVisibleSprite
Visible sprites in linked list; highest priority sprite first -
delayPixels
private int delayPixelsPosition sprite start within character cell -
display
private boolean displayIs display enabled -
consuming
boolean consumingIs sprite pixel pipeline active? -
firstMultiColorRead
private boolean firstMultiColorReadThis is the first read of multicolor pixel? (consuming read) -
lineData
private int lineData32 bits of sprite data in reversed bit order (LSB = first out) -
pointerByte
private byte pointerByteSprite address byte -
mcBase
private int mcBaseData byte to fetch next -
mc
private int mcData byte at DMA -
firstYRead
private boolean firstYReadThis is the first read of a line for an Y-expanded sprite? (no pointer increment) -
firstXRead
private boolean firstXReadThis is the first read of a pixel for an X-expanded sprite? (consuming read) -
x
private int xSprite position -
y
private int ySprite position -
enabled
private boolean enabledIs the sprite current enabled -
expandX
private boolean expandXIs the sprite expanded horizontally? -
expandY
private boolean expandYIs the sprite expanded vertically? -
multiColor
private boolean multiColorMulticolor mode on? -
priorityOverForegroundGraphics
private boolean priorityOverForegroundGraphicsDoes the sprite have priority over the screen background? -
priorityMask
private int priorityMaskThe masking to be used for migrating color 1 as foreground color during sprite priority bit handling -
multiColorLatched
private boolean multiColorLatchedRead 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 allowDisplayAllow display to be enabled. -
color
private final int[] colorSprite colors: 0, 1, and our own color. -
prevPriority
private int prevPriority -
colorBuffer
protected int colorBuffer -
indexBits
protected final int indexBits
-
-
Konstruktordetails
-
Sprite
-
-
Methodendetails
-
event
public void event()Beschreibung aus Klasse kopiert:EventEvent code to be executed. Events are allowed to safely reschedule themselves with the EventScheduler during invocations. -
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 expandedcrunchCycle- 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)
-