Code: Select all
RAM
struct Object ; 7 bytes?
{
.byte sprites_start ; sprite # in OAM
.byte tile_start ; tile start in CHR-RAM
.byte frame_counter ; for frame duration
.byte health ; health, duh
.byte damage ; damage dealt
.byte X
.byte Y
}
ROM
struct Header ; potential 20 bytes of overhead
{
.word animation_pointers ; for sake of argument, this = {@idle, @walk, @run, @jump, @attack, @hit, @death }
.byte sprites_reserved ; sprites to reserve in OAM
.byte number_of_tiles ; number of tiles to jam into CHR-RAM
.word tile_pointer
.byte health ; starting health
.byte damage
}
struct Animation ; 3 byte overhead per animation
{
.byte number_of_frames
.word first_frame
}
struct Frame ; 11 bytes overhead at least per frame (ouch)
{
.byte duration
.byte tile_number ; number of tiles to process
.byte[] tile_offsets ; where tile is located in stored CHR-RAM
.byte attributes ; associated attribute with all tiles (flip, etc)
.byte[] collision ; 4 bytes associated with collision rectangle
.word size ; width and height
.word next_frame ; next frame to jump to if counter = duration
}
Any suggestions to help me out on this, improvements, better setup?