struct OAMSprite
Represents a Sprite in OAM memory.
| OAMSprite | Represents a Sprite in OAM memory. |
| Variables | |
| attributes | The actual sprite data. |
| Functions | |
| GetY | The Y-coordinate of the sprite. |
| GetX | The X-coordinate of the sprite. |
| GetRSFlag | Returns true if rotation/scale are used. |
| GetA0B9 | Gets bit 9. |
| GetObjMode | 0=Normal, 1=Semi-Transparent, 2=Obj-Window |
| GetMosaic | True if Mosaic Effect is enabled for this sprite. |
| GetCP | True if 8bit tiles shall be used, False if 4 bit tiles shall be used. |
| GetObjShape | 0=square, 1=horizontal, 2=vertical |
| GetRSGroup | There are 32 transform groups for 128 sprites. |
| GetFlipX | True if the sprite has to be flipped horizontally. |
| GetFlipY | True if the sprite has to be flipped vertically. |
| GetObjSizeID | Returns the size ID. |
| GetTileID | The id of the upper-left tile. |
| GetPriority | The priority relative to backgrounds. |
| GetPaletteID | The ID of the palette that has to be used in Tile4 mode. |
| OAMTransformGroup | OAM (Object Attribute Memory) contains both sprite attributes and transformation groups. |
| Variables | |
| PA | Pointer to the PA register (you might know it as dx ... |
| PB | Pointer to the PB register (you might know it as dmx ... |
| PC | Pointer to the PC register (you might know it as dy ... |
| PD | Pointer to the PD register (you might know it as dmy ... |
| OAMSprites | Builds and handles all OAMSprites and OAMTransformGroups contained in OAM memory. |
| Variables | |
| oamMemory | Pointer to oam memory. |
| transforms | Transformation groups. |
| Functions | |
| GetTransformationGroupPart | Every part is located at 0x8 offset starting at 0x6. |
| OAMSprites | Builds our oamsprites object. |
| GetSprite | |
| GetTransformGroup |
inline int GetPaletteID()
The ID of the palette that has to be used in Tile4 mode. In Tile8 mode it is ignored. See GetCP.
struct OAMTransformGroup
OAM (Object Attribute Memory) contains both sprite attributes and transformation groups. Each sprite as you can see above points a transform group. Here we have translation, rotations and scale info (that might be used to build a transform matrix for gpu accelerated rendering) or computed manually, which is better for an accurate emulation (since today’s gpus might be too much accurate for this task).
class OAMSprites
Builds and handles all OAMSprites and OAMTransformGroups contained in OAM memory.
| Variables | |
| oamMemory | Pointer to oam memory. |
| transforms | Transformation groups. |
| Functions | |
| GetTransformationGroupPart | Every part is located at 0x8 offset starting at 0x6. |
| OAMSprites | Builds our oamsprites object. |
| GetSprite | |
| GetTransformGroup |
inline uint16_t* GetTransformationGroupPart( int id )
Every part is located at 0x8 offset starting at 0x6. OAM. A full transformation group is defined by 4 parts. This gets one Used only internally for initialization
| id | The id of the group. |
The address of the part.
inline OAMSprite* GetSprite( int id )
| id | The id of the sprite. |
A pointer to the OAMSprite object.
inline OAMTransformGroup* GetTransformGroup( int id )
| id | The id of the group. |
A pointer to the OAMTransformGroup object.
Represents a Sprite in OAM memory.
struct OAMSprite
The actual sprite data.
uint16_t attributes[3]
The Y-coordinate of the sprite.
inline int GetY()
The X-coordinate of the sprite.
inline int GetX()
Returns true if rotation/scale are used.
inline bool GetRSFlag()
Gets bit 9.
inline bool GetA0B9()
0=Normal, 1=Semi-Transparent, 2=Obj-Window
inline int GetObjMode()
True if 8bit tiles shall be used, False if 4 bit tiles shall be used.
inline bool GetCP()
0=square, 1=horizontal, 2=vertical
inline int GetObjShape()
There are 32 transform groups for 128 sprites.
inline int GetRSGroup()
True if the sprite has to be flipped horizontally.
inline int GetFlipX()
True if the sprite has to be flipped vertically.
inline int GetFlipY()
Returns the size ID.
inline int GetObjSizeID()
The id of the upper-left tile.
inline int GetTileID()
The priority relative to backgrounds.
inline int GetPriority()
The ID of the palette that has to be used in Tile4 mode.
inline int GetPaletteID()
OAM (Object Attribute Memory) contains both sprite attributes and transformation groups.
struct OAMTransformGroup
Pointer to the PA register (you might know it as dx ...
uint16_t* PA
Pointer to the PB register (you might know it as dmx ...
uint16_t* PB
Pointer to the PC register (you might know it as dy ...
uint16_t* PC
Pointer to the PD register (you might know it as dmy ...
uint16_t* PD
Builds and handles all OAMSprites and OAMTransformGroups contained in OAM memory.
class OAMSprites
Pointer to oam memory.
int8_t* oamMemory
Transformation groups.
OAMTransformGroup transforms[32]
Every part is located at 0x8 offset starting at 0x6.
inline uint16_t* GetTransformationGroupPart( int id )
Builds our oamsprites object.
OAMSprites( Memory * mem )
inline OAMSprite* GetSprite( int id )
inline OAMTransformGroup* GetTransformGroup( int id )