User Tools

Site Tools


super:technical_information:data_structures

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
super:technical_information:data_structures [2019/02/13 17:49] – PLMs p.jboysuper:technical_information:data_structures [2019/03/21 20:43] – [Event header] h suffices p.jboy
Line 86: Line 86:
 | 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 549: Line 549:
 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://metroidconstruction.com/resource.php?id=54|flexglow]] uses this pointer for the flexglow table instead.
  
 ==== PLM population ==== ==== PLM population ====
Line 596: Line 598:
  
 Common **ASM instructions** include looping, conditional execution, setting the pre-instruction, deleting the object and sleeping. Common **ASM instructions** include looping, conditional execution, setting the pre-instruction, deleting the object and sleeping.
 +The pre-instruction is a function that's executed before the object's instruction list is processed for the current frame.
 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 in real-time
-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 (e.g. items, doors) or spawned as part of a block interaction (e.g. shot block crumbling).
  
 PLM header: PLM header:
Line 619: Line 622:
 The **special instructions** for PLMs have the format: The **special instructions** for PLMs have the format:
    ______ Draw timer    ______ Draw timer
-  |     _ Pointer to **draw instruction**+  |     _ Pointer to draw instruction
   |    |   |    |
   tttt dddd   tttt dddd
Line 635: Line 638:
 If ''n'' < 8000h, the blocks are drawn in a horizontal line to the right. If ''n'' < 8000h, the blocks are drawn in a horizontal line to the right.
 If ''n'' >= 8000h, ''n'' & 7FFFh blocks are drawn in a vertical line downwards. If ''n'' >= 8000h, ''n'' & 7FFFh blocks are drawn in a vertical line downwards.
 +
 +===== Enemy projectiles =====
 +Enemy projectiles exist in bank $86 and are typically spawned by enemies and can use their graphics and palette.
 +
 +Enemy projectile header:
 +   __________________________________ Initialisation AI
 +  |     _____________________________ (Initial) pre-instruction
 +  |    |     ________________________ Instruction list pointer
 +  |    |    |     ___________________ X radius
 +  |    |    |    |   ________________ Y radius
 +  |    |    |    |  |   _____________ Damage/properties
 +  |    |    |    |  |  |     ________ Touch AI
 +  |    |    |    |  |  |    |     ___ 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/Samus/projectiles) |
 +
 +The **special instructions** for enemy projectiles have the format:
 +   ______ Spritemap timer
 +  |     _ 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:
 +   ___________ Instruction list pointer
 +  |     ______ Size
 +  |    |     _ VRAM address
 +  |    |    |
 +  iiii ssss vvvv
 +
 +The **special instructions** for animated tiles objects have the format:
 +   ______ Animation timer
 +  |     _ 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:
 +   _______ HDMA options
 +  |   ____ PPU register index
 +  |  |   _ Instruction list pointer
 +  |  |  |
 +  dd pp iiii
 +
 +The **special instructions** for HDMA objects have the format:
 +   ______ Table timer
 +  |     _ 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:
 +   ______ Initialisation ASM pointer
 +  |     _ Instruction list pointer
 +  |    |
 +  aaaa iiii
 +
 +The **special instructions** for palette FX objects have the format:
 +   ______ Palette timer
 +  |     _ 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 ''(p * 10h + c) * 2'' where ''p'' is the palette number and ''c'' is the colour index within the palette.
 +
 +**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.
  
super/technical_information/data_structures.txt · Last modified: 2024/03/22 16:09 by p.jboy