User Tools

Site Tools


sm: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
sm:technical_information:data_structures [2024/11/15 22:43] – [Special X-Ray Blocks] felixwrightsm:technical_information:data_structures [2024/11/16 08:12] (current) felixwright
Line 571: Line 571:
  
 The list of commands used in Super Metroid is as follows: The list of commands used in Super Metroid is as follows:
-Type  Parameters  Description +^Type^Parameters^Description                                                                    ^ 
- ssssss dddd nnnn  Transfer n bytes from s to d in VRAM +|2|ssssss dddd nnnn|Transfer n bytes from s to d in VRAM                                        | 
- ssssss dddd  Decompress s to d in bank $7E +|4|ssssss dddd|Decompress s to d in bank $7E                                                    | 
-  Clear layer 3 +|6| |Clear layer 3                                                                              | 
- ssssss dddd nnnn  Transfer n bytes from s to d in VRAM and set BG3 tiles base address = $2000 +|8|ssssss dddd nnnn|Transfer n bytes from s to d in VRAM and set BG3 tiles base address = $2000 | 
-Ah   Clear layer 2 +|Ah| |Clear layer 2                                                                             | 
-Ch   Clear Kraid's layer 2 +|Ch| |Clear Kraid's layer 2                                                                     | 
-Eh  DDDD ssssss dddd nnnn  Transfer n bytes from s to d in VRAM if the current door pointer = D+|Eh|DDDD ssssss dddd nnnn|Transfer n bytes from s to d in VRAM if the current door pointer = D  |
  
 ===== Object formats ===== ===== Object formats =====
Line 620: Line 620:
 The draw instruction format is a list of: The draw instruction format is a list of:
  
-nnnn       ; Number of blocks +  nnnn       ; Number of blocks 
-bbbb [...] ; Blocks +  bbbb [...] ; Blocks 
-xx yy      ; X and Y offsets from origin to start drawing from+  xx yy      ; X and Y offsets from origin to start drawing from
  
 where the list is terminated by xx yy = 00 00. where the list is terminated by xx yy = 00 00.
Line 725: Line 725:
  
 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. 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.
- 
-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. 
- 
sm/technical_information/data_structures.1731710610.txt.gz · Last modified: 2024/11/15 22:43 by felixwright