This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
super:technical_information:data_structures [2019/02/13 17:49] – PLMs p.jboy | super:technical_information:data_structures [2024/03/22 16:09] (current) – [Door header] p.jboy | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Room header ====== | ====== Room header ====== | ||
- | _______________________________________ | + | ____________________________________ |
- | | ____________________________________ | + | | _________________________________ |
- | | | _________________________________ | + | | | ______________________________ |
- | | | | ______________________________ | + | | | | ___________________________ |
- | | | | | ___________________________ | + | | | | | ________________________ |
- | | | | | | ________________________ | + | | | | | | _____________________ |
- | | | | | | | _____________________ | + | | | | | | | __________________ |
- | | | | | | | | __________________ | + | | | | | | | | _______________ |
- | | | | | | | | | _______________ | + | | | | | | | | | ____________ |
- | | | | | | | | | | ____________ | + | | | | | | | | | | _________ |
- | | | | | | | | | | | _______ Optional event headers | + | | | | | | | | | | | ____ State conditions list |
- | | | | | | | | | | | | _ Mandatory event header, specifies that the default state follows this room header | + | | | | | | | | | | | | |
- | | | | | | | | | | | | + | | | | | | | | | | | | |
- | ii aa xx yy ww hh uu dd cc dddd [...] E5E6 | + | ii aa xx yy ww hh uu dd cc dddd [...] |
Room headers define rooms, they exist in bank $8F and room header pointers are what SMILE displays as a dropdown box for room selection. | Room headers define rooms, they exist in bank $8F and room header pointers are what SMILE displays as a dropdown box for room selection. | ||
- | They are variable length (due to the optional | + | They are variable length (due to the event header list) with '' |
- | The **event headers** define | + | The **state conditions list** defines |
- | Due to this, event headers | + | Due to this, state conditions |
<hidden **Area indices**> | <hidden **Area indices**> | ||
Line 36: | Line 36: | ||
* The **room index** is almost unused, aside from some specific checks to do with atmospheric graphics in some areas. | * The **room index** is almost unused, aside from some specific checks to do with atmospheric graphics in some areas. | ||
* The **room width** may not exceed 15 due to the way block collision calculations are implemented | * The **room width** may not exceed 15 due to the way block collision calculations are implemented | ||
- | * **Room width** * **room height** may not exceed | + | * **Room width** * **room height** may not exceed |
- | * The **up scroller** defines the threshold Y position that Samus needs to exceed (relative to the screen) for the screen to start scolling | + | * The **up scroller** defines the threshold Y position that Samus needs to exceed (relative to the screen) for the screen to start scrolling |
- | * The **down scroller** defines the threshold Y position that Samus needs to exceed (relative to the screen) for the screen to start scolling | + | * The **down scroller** defines the threshold Y position that Samus needs to exceed (relative to the screen) for the screen to start scrolling |
* The **CRE bitset** defines some flags that affect how the CRE is loaded during door transitions: | * The **CRE bitset** defines some flags that affect how the CRE is loaded during door transitions: | ||
Line 45: | Line 45: | ||
| 4 | Load extra large tileset | | | 4 | Load extra large tileset | | ||
- | ===== Event header | + | ===== State conditions list ===== |
- | ____________ Event | + | ______________ State condition |
- | | _______ Event parameters | + | | _________ State condition |
- | | | | + | | | |
| | | | | | | | ||
- | eeee [...] ssss | + | eeee [...] ssss ; First state condition |
+ | eeee [...] ssss ; Second state condition | ||
+ | [...] ; Other state conditions | ||
+ | E5E6 ; Default state condition (terminator) | ||
- | **Events** are two-byte pointers to code in bank $8F that may have parameters | + | **State conditions** are two-byte pointers to code in bank $8F that may have parameters. |
- | If the check defined in the event is passed, the state header pointer | + | If the check defined in the **state conditions** |
- | The only exception is event $E5E6, the default | + | The only exception is state condition |
- | <hidden List of events | + | <hidden List of state conditions |
- | ^ Event ^ Event parameters | + | ^ Condition |
| $E5E6 | | Default | | | $E5E6 | | Default | | ||
| $E5EB | '' | | $E5EB | '' | ||
Line 86: | Line 89: | ||
| Eh | Zebes timebomb set | | | Eh | Zebes timebomb set | | ||
| Fh | Critters escaped | | | Fh | Critters escaped | | ||
- | | 10 | 1st Metroid hall cleared | | + | | 10h | 1st Metroid hall cleared | |
- | | 11 | 1st Metroid shaft cleared | | + | | 11h | 1st Metroid shaft cleared | |
- | | 12 | 2nd Metroid hall cleared | | + | | 12h | 2nd Metroid hall cleared | |
- | | 13 | 2nd Metroid shaft cleared | | + | | 13h | 2nd Metroid shaft cleared | |
- | | 14 | //Unused// | | + | | 14h | //Unused// | |
- | | 15 | Outran speed booster lavaquake | | + | | 15h | Outran speed booster lavaquake | |
Boss bits are given as follows: | Boss bits are given as follows: | ||
Line 103: | Line 106: | ||
| | ||
| | | | ||
- | | | | + | | | |
| | | | | | | | ||
aaaa bbbb [...] | aaaa bbbb [...] | ||
Line 116: | Line 119: | ||
| | ||
| | | | ||
- | | | | + | | | |
- | | | | | + | | | | |
- | | | | | | + | | | | | |
- | | | | | | | + | | | | | | |
- | | | | | | | | + | | | | | | | |
| | | | | | | | | | | | | | | | ||
| | | | | | | | _ Custom door ASM to execute (bank $8F) | | | | | | | | | _ Custom door ASM to execute (bank $8F) | ||
Line 128: | Line 131: | ||
Door headers define doors, they exist in bank $83 and have a fixed length of 12 bytes. | Door headers define doors, they exist in bank $83 and have a fixed length of 12 bytes. | ||
The **door ASM** can execute any arbitrary ASM and is often used to set scroll values for the new room where the door would normally be hidden inside a red scroll. | The **door ASM** can execute any arbitrary ASM and is often used to set scroll values for the new room where the door would normally be hidden inside a red scroll. | ||
+ | If the **distance from door to spawn Samus** is negative (8000h..FFFFh), | ||
The **elevator properties** are as follows: | The **elevator properties** are as follows: | ||
Line 133: | Line 137: | ||
| 0x80 | Door is an elevator | | | 0x80 | Door is an elevator | | ||
| 0x40 | Switch map to new area | | | 0x40 | Switch map to new area | | ||
- | | 0x0i | Marks elevator i as used | | + | | 0x0i | Marks elevator |
The **orientation** values are as follows: | The **orientation** values are as follows: | ||
Line 153: | Line 157: | ||
| | | | | | | | | | | | | | | | ||
| | | | | | | | | | | | | | | | | | ||
- | | | | | | | | | | ________________________ | + | | | | | | | | | | __________________________ |
- | | | | | | | | | | | | + | | | | | | | | | | | _____________________ |
- | | | | | | | | | | | | ______________ | + | | | | | | | | | | | | ________________ |
- | | | | | | | | | | | | | _________ | + | | | | | | | | | | | | | ___________ |
- | | | | | | | | | | | | | | ____ Library background | + | | | | | | | | | | | | | | ______ |
- | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | |
- | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | |
llllll tt MM mm ffff eeee EEEE xx yy ssss xxxx AAAA pppp bbbb aaaa | llllll tt MM mm ffff eeee EEEE xx yy ssss xxxx AAAA pppp bbbb aaaa | ||
Line 312: | Line 316: | ||
| ::: | ::: | 2 || Air only. Air spike (10h damage) | | | ::: | ::: | 2 || Air only. Air spike (10h damage) | | ||
| ::: | ::: | 3 || Solid only. Draygon' | | ::: | ::: | 3 || Solid only. Draygon' | ||
+ | | ::: | ::: | Eh || Solid only. X-rayable block (used in Blue Brinstar boulder room) | | ||
| ::: | ::: | Fh || Solid only. Enemy breakable block (used in Shaktool' | | ::: | ::: | Fh || Solid only. Enemy breakable block (used in Shaktool' | ||
| 3 / Bh | Special | 0 || 1x1 respawning crumble block | | | 3 / Bh | Special | 0 || 1x1 respawning crumble block | | ||
Line 342: | Line 347: | ||
| ::: | ::: | ::: | 82h | Respawning speed block, slower crumble animation | | | ::: | ::: | ::: | 82h | Respawning speed block, slower crumble animation | | ||
| ::: | ::: | ::: | 83h | Speed block, slower crumble animation | | | ::: | ::: | ::: | 83h | Speed block, slower crumble animation | | ||
- | | ::: | ::: | ::: | 84h | Respawning speed block (used by dechora | + | | ::: | ::: | ::: | 84h | Respawning speed block (used by dachora |
| ::: | ::: | ::: | 85h | Speed boost block | | | ::: | ::: | ::: | 85h | Speed boost block | | ||
| ::: | ::: | Norfair | 83h | Lower Norfair chozo hand trigger | | | ::: | ::: | Norfair | 83h | Lower Norfair chozo hand trigger | | ||
Line 371: | Line 376: | ||
| ::: | ::: | 9 || Power bomb block | | | ::: | ::: | 9 || Power bomb block | | ||
| ::: | ::: | Ah || Respawning super missile block | | | ::: | ::: | Ah || Respawning super missile block | | ||
- | | ::: | ::: | Bh || Super missile block | | + | | ::: | ::: | Bh || Super missile block | |
+ | | ::: | ::: | Ch || Fake super missile block (solid block but shows super missile block when x-rayed) | | ||
+ | | ::: | ::: | Dh || Fake super missile block | | ||
+ | | ::: | ::: | Eh || Fake super missile block | | ||
+ | | ::: | ::: | Fh || Fake super missile block | | ||
| ::: | ::: | 10h || Gate blocks | | | ::: | ::: | 10h || Gate blocks | | ||
| ::: | ::: | 40h || Blue door facing left | | | ::: | ::: | 40h || Blue door facing left | | ||
Line 388: | Line 397: | ||
| ::: | ::: | 4Dh || Right orange gate trigger | | | ::: | ::: | 4Dh || Right orange gate trigger | | ||
| ::: | ::: | 4Fh || Critters escape block | | | ::: | ::: | 4Fh || Critters escape block | | ||
+ | | Eh | Grapple block | 0 || Generic grapple block | | ||
+ | | ::: | ::: | 1 || Respawning crumbling grapple block | | ||
+ | | ::: | ::: | 2 || Non-respawning crumbling grapple block | | ||
+ | | ::: | ::: | 80h+ || Grapple-through block | | ||
</ | </ | ||
Line 469: | Line 482: | ||
| | | | ||
| | | | | | ||
- | | | | | + | | | | |
| | | | | | | | | | ||
- | | | | | | | + | | | | | | |
| | | | | | | | | | | | | | ||
- | | | | | | | | _ General purpose parameter (speed2 | + | | | | | | | | _ General purpose parameter (speed 2 in SMILE) |
| | | | | | | | | | | | | | | | | | ||
iiii xxxx yyyy oooo pppp gggg aaaa bbbb ; First enemy | iiii xxxx yyyy oooo pppp gggg aaaa bbbb ; First enemy | ||
Line 479: | Line 492: | ||
[...] ; Other enemies | [...] ; Other enemies | ||
FFFF ; Terminator | FFFF ; Terminator | ||
- | | + | |
Enemy population defines the placement of enemies, as well as some generic and enemy specific properties. | Enemy population defines the placement of enemies, as well as some generic and enemy specific properties. | ||
- | They' | + | They' |
The **initialisation parameter** is overwritten by generic enemy routines and so is often only used during enemy initialisation, | The **initialisation parameter** is overwritten by generic enemy routines and so is often only used during enemy initialisation, | ||
Line 549: | Line 562: | ||
The **X/Y position** is specified in (16px x 16px) block units. | The **X/Y position** is specified in (16px x 16px) block units. | ||
The **block** uses the level data block format, except that the block type is ignored. | The **block** uses the level data block format, except that the block type is ignored. | ||
+ | |||
+ | Note that [[http:// | ||
==== PLM population ==== | ==== PLM population ==== | ||
Line 596: | Line 611: | ||
Common **ASM instructions** include looping, conditional execution, setting the pre-instruction, | Common **ASM instructions** include looping, conditional execution, setting the pre-instruction, | ||
+ | The pre-instruction is a function that's executed before the object' | ||
Objects that are sleeping are suspended from handling until they are awakened (usually by a pre-instruction set earlier in the object instruction list). | Objects that are sleeping are suspended from handling until they are awakened (usually by a pre-instruction set earlier in the object instruction list). | ||
===== PLMs ===== | ===== PLMs ===== | ||
- | PLMs (post-load modifications) are objects that modify level data blocks. | + | PLMs (post-load modifications) are objects that modify level data blocks |
- | They exist in bank $84 and are typically loaded with a room from a room header or spawned as part of a block interaction (such as a shot block crumbling). | + | They exist in bank $84 and are typically loaded with a room from a room header |
PLM header: | PLM header: | ||
Line 619: | Line 635: | ||
The **special instructions** for PLMs have the format: | The **special instructions** for PLMs have the format: | ||
| | ||
- | | _ Pointer to **draw instruction** | + | | _ Pointer to draw instruction |
| | | | | | ||
tttt dddd | tttt dddd | ||
Line 635: | Line 651: | ||
If '' | If '' | ||
If '' | If '' | ||
+ | |||
+ | ===== Enemy projectiles ===== | ||
+ | Enemy projectiles exist in bank $86 and are typically spawned by enemies and can use their graphics and palette. | ||
+ | |||
+ | Enemy projectile header: | ||
+ | | ||
+ | | | ||
+ | | | | ||
+ | | | | | ||
+ | | | | | | ||
+ | | | | | | | ||
+ | | | | | | | | ||
+ | | | | | | | | ___ Shot AI | ||
+ | | | | | | | | | | ||
+ | iiii pppp IIII xx yy Pddd tttt ssss | ||
+ | |||
+ | The **properties** are as follows: | ||
+ | |||
+ | | 8000h | Detect collisions with projectiles | | ||
+ | | 4000h | Don't die on contact | | ||
+ | | 2000h | Disable collisions with Samus | | ||
+ | | 1000h | Low priority (drawn under enemies/ | ||
+ | |||
+ | The **special instructions** for enemy projectiles have the format: | ||
+ | | ||
+ | | _ Pointer to spritemap | ||
+ | | | | ||
+ | tttt ssss | ||
+ | |||
+ | The **spritemap timer** is how many frames to wait until the next instruction in the instruction list is proceeded to. | ||
+ | Within the spritemap, the tile numbers added to the base tile number set when the enemy projectile was spawned (so the projectile can access enemy graphics). | ||
+ | |||
+ | ===== Animated tiles objects ===== | ||
+ | Animated tiles objects are objects that modify tile graphics in real-time. | ||
+ | They exist in bank $87 and are loaded with a room from an FX header. | ||
+ | |||
+ | Animated tiles object header format: | ||
+ | | ||
+ | | | ||
+ | | | _ VRAM address | ||
+ | | | | | ||
+ | iiii ssss vvvv | ||
+ | |||
+ | The **special instructions** for animated tiles objects have the format: | ||
+ | | ||
+ | | _ Pointer to tile graphics | ||
+ | | | | ||
+ | tttt ssss | ||
+ | |||
+ | The **animation timer** is how many frames to wait until the next instruction in the instruction list is proceeded to. | ||
+ | |||
+ | ===== HDMA objects ===== | ||
+ | HDMA objects exist in bank $88 and are typically loaded with a room as part of FX or spawned by power bombs / x-ray. | ||
+ | |||
+ | HDMA object header format: | ||
+ | | ||
+ | | ____ PPU register index | ||
+ | | | _ Instruction list pointer | ||
+ | | | | | ||
+ | dd pp iiii | ||
+ | |||
+ | The **special instructions** for HDMA objects have the format: | ||
+ | | ||
+ | | _ Pointer to HDMA table | ||
+ | | | | ||
+ | tttt ssss | ||
+ | |||
+ | The **table timer** is how many frames to wait until the next instruction in the instruction list is proceeded to. | ||
+ | |||
+ | ===== Palette FX objects ===== | ||
+ | Palette FX objects are objects that modify palette data in real-time. | ||
+ | They exist in bank $8D and are loaded with a room from an FX header. | ||
+ | |||
+ | Palette FX object header format: | ||
+ | | ||
+ | | _ Instruction list pointer | ||
+ | | | | ||
+ | aaaa iiii | ||
+ | |||
+ | The **special instructions** for palette FX objects have the format: | ||
+ | | ||
+ | | _ Palette instruction list | ||
+ | | | | ||
+ | tttt [...] | ||
+ | |||
+ | The **palette timer** is how many frames to wait until the next instruction in the instruction list is proceeded to. | ||
+ | |||
+ | The ASM instructions are usually used for setting the initial colour index, | ||
+ | which is an index into CGRAM equal to '' | ||
+ | |||
+ | **Palette instructions** are a mix of colours (which are positive values) and ASM instructions (negative values). | ||
+ | Colours are written to successive positions in CGRAM starting from initial colour index. | ||
+ | ASM instructions can modify the colour index between listed colour values, | ||
+ | and the instruction $C595 is used to terminate the palette instruction list. | ||