Level

From ZAMN Hacking
Revision as of 23:42, 18 October 2023 by Piranhaplant (talk | contribs) (Created page with "The number of regular levels is located at $9F:8000. This count includes level 0 and the credit level, but not any of the bonus levels. The level data pointers are located at $9F:8002. In a regular ROM, these are 16-bit pointers relative to bank $9F. In a Necrofy built ROM, these are 24-bit pointers padded to 4 bytes each. == Level data structure == === Header === {| class="wikitable" |- ! Offset !! Length !! Type !! Description |- | 0x00 || 4 || pointer24 ||...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The number of regular levels is located at $9F:8000. This count includes level 0 and the credit level, but not any of the bonus levels. The level data pointers are located at $9F:8002. In a regular ROM, these are 16-bit pointers relative to bank $9F. In a Necrofy built ROM, these are 24-bit pointers padded to 4 bytes each.

Level data structure

Header

Offset Length Type Description
0x00 4 pointer24 Pointer to the tileset tilemap
0x04 4 pointer24 Pointer to the level background data
0x08 4 pointer24 Pointer to the tileset collision data
0x0C 4 pointer24 Pointer to the tileset graphics
0x10 4 pointer24 Pointer to the tileset palette
0x14 4 pointer24 Pointer to the sprite palette
0x18 4 pointer24 Pointer to the palette animation entity
0x1C 2 pointer16 Pointer to the respawning monster data
0x1E 2 pointer16 Pointer to the victim and one-shot monster data
0x20 2 pointer16 Pointer to the item pickup data
0x22 2 uint16 Level background width
0x24 2 uint16 Level background height
0x26 2 uint16 Priority tile count
0x28 2 uint16 Visible tiles end
0x2A 2 int16 Player 1 start X position
0x2C 2 int16 Player 1 start Y position
0x2E 2 int16 Player 2 start X position
0x30 2 int16 Player 2 start Y position
0x32 2 uint16 Music ID
0x34 2 uint16 Extra sounds ID
0x36 2 pointer16 Pointer to the first level title page
0x38 2 pointer16 Pointer to the second level title page
0x3A 2 optional pointer16 Pointer to the bonus data
0x3C 2 pointer16 Necrofy ROMs only. Pointer to the secret item bonus subroutine
0x3E 2 uint16 Necrofy ROMs only. Bonus level number

Immediately following the header is the boss monster data

Boss monster data