public final class Sprite extends Event
Event.Phase
Modifier and Type | Field and Description |
---|---|
protected int |
colorBuffer |
protected int |
index
Sprite index
|
protected int |
indexBits |
protected Sprite |
nextVisibleSprite
Visible sprites in linked list; highest priority sprite first
|
name, next, triggerTime
Constructor and Description |
---|
Sprite(Sprite linkedListHead,
int index) |
Modifier and Type | Method and Description |
---|---|
void |
beginDMA()
Reset current DMA byte and expansion/multicolor flip-flops.
|
int |
calculateNext8Pixels()
Generate graphics data for the next 8 pixels for the sprite
Foreground pixels are identified by having any bit set.
|
void |
event()
Event code to be executed.
|
void |
expandYFlipFlop()
Toggle sprite Y expansion flag
|
void |
finishDmaAccess()
Increment sprite read pointer during Y expansion
|
int |
getColor(int idx) |
int |
getCurrentByteAddress() |
int |
getNextPriorityMask() |
int |
getX()
Get the X-coordinate of the sprite
|
int |
getY()
Get the Y-coordinate of the sprite
|
void |
initDmaAccess()
Begin rendering sprite on a line
|
boolean |
isDMA() |
boolean |
isEnabled()
Check whether the sprite is currently enabled
|
void |
repeatPixels()
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 |
setPriorityOverForegroundGraphics(boolean priority)
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
|
protected final int index
protected Sprite nextVisibleSprite
protected int colorBuffer
protected final int indexBits
public Sprite(Sprite linkedListHead, int index)
public void event()
Event
protected void setDisplayStart(int delayPixels)
delayPixels
- public final int getX()
public final void setX(int x)
x
- new X-coordinatepublic final int getY()
public final void setY(int y)
y
- new Y-coordinatepublic final void setPriorityOverForegroundGraphics(boolean priority)
priority
- true if the sprite has priority over the screen contentpublic final boolean isEnabled()
public final void setEnabled(boolean enabled)
enabled
- true if enabledpublic final void setExpandX(boolean expandX)
expandX
- true if expandedpublic final void setExpandY(boolean expandY, boolean crunchCycle)
expandY
- true if expandedcrunchCycle
- whether to do sprite crunchpublic final void setMulticolor(boolean multiColor)
multiColor
- true if multicolorpublic final void beginDMA()
public final boolean isDMA()
public void setDisplay(boolean display)
public final void setPointerByte(byte pointerByte)
pointerByte
- address to read frompublic int getCurrentByteAddress()
public final void setSpriteByte(int idx, byte value)
public void initDmaAccess()
public final void finishDmaAccess()
public final void expandYFlipFlop()
public final void setColor(int idx, int val)
public final int getColor(int idx)
public final int calculateNext8Pixels()
public void repeatPixels()
public int getNextPriorityMask()
public void setAllowDisplay(boolean allowDisplay)
Copyright © 2018 Ken Händel. All rights reserved.