sm:technical_information:data_structures
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sm:technical_information:data_structures [2024/11/15 22:18] – Fixed: Tables: Block Types & BTS Values felixwright | sm:technical_information:data_structures [2024/11/16 08:12] (current) – felixwright | ||
---|---|---|---|
Line 421: | Line 421: | ||
Layer 3 types | Layer 3 types | ||
- | 0 None | + | |0|None | |
- | 2 Lava | + | |2|Lava | |
- | 4 Acid | + | |4|Acid | |
- | 6 Water | + | |6|Water | |
- | 8 Spores | + | |8|Spores |
- | Ah Rain | + | |Ah|Rain | |
- | Ch Fog | + | |Ch|Fog | |
- | 20h Scrolling sky | + | |20h|Scrolling sky | |
- | 22h Unused | + | |22h|Unused |
- | 24h Fireflea | + | |24h|Fireflea |
- | 26h Tourian entrance statue | + | |26h|Tourian entrance statue |
- | 28h Ceres Ridley | + | |28h|Ceres Ridley |
- | 2Ah Ceres elevator | + | |2Ah|Ceres elevator |
- | 2Ch Haze | + | |2Ch|Haze | |
Layer blending configurations | Layer blending configurations | ||
- | 2/ | + | |2/Eh/20h|Normal. BG1/ |
- | 4 Normal, but BG2 is disabled | + | |4|Normal, but BG2 is disabled|Used by Phantoon |
- | 6 Normal, but sprites aren't affected by BG3 and sprites are added to BG1/BG2 (instead of hidden) | + | |6|Normal, but sprites aren't affected by BG3 and sprites are added to BG1/BG2 (instead of hidden)|Unused |
- | 8 Normal, but BG1/sprites aren't affected by BG3 and sprites are added to BG2 (instead of hidden) | + | |8|Normal, but BG1/sprites aren't affected by BG3 and sprites are added to BG2 (instead of hidden)|Used in some power off Wrecked Ship rooms | |
- | Ah Normal, but BG1 isn't affected by BG3 Used with FX layer 3 type = spores | + | |Ah|Normal, but BG1 isn't affected by BG3|Used with FX layer 3 type = spores |
- | Ch Normal, but BG3 is disabled and colour math is subtractive | + | |Ch|Normal, but BG3 is disabled and colour math is subtractive|Used with FX layer 3 type = fireflea |
- | 10h/ | + | |10h/12h|Normal, but BG3 is disabled inside window 1|Used by morph ball eye and varia/ |
- | 14h/ | + | |14h/22h|Normal, but BG1 isn't affected by BG3 and colour math is subtractive|Sometimes use with FX layer 3 type = water | |
- | 16h BG1/sprites are drawn after the result of drawing BG2/BG3 is subtracted | + | |16h|BG1/sprites are drawn after the result of drawing BG2/BG3 is subtracted|Sometimes use with FX layer 3 type = water | |
- | 18h/ | + | |18h/1Eh/30h|BG3 is drawn with the result of drawing BG1/ |
- | 1Ah Normal, but BG2 and BG3 have reversed roles Used by Phantoon | + | |1Ah|Normal, but BG2 and BG3 have reversed roles|Used by Phantoon |
- | 1Ch Normal, but BG2 and BG3 have reversed roles, colour addition is halved and backdrop is disabled | + | |1Ch|Normal, but BG2 and BG3 have reversed roles, colour addition is halved and backdrop is disabled|Unused |
- | 24h BG1/ | + | |24h|BG1/ |
- | 26h Normal, but colour addition is halved | + | |26h|Normal, but colour addition is halved|Unused |
- | 28h Normal, but BG3 is disabled, colour math is subtractive, | + | |28h|Normal, but BG3 is disabled, colour math is subtractive, |
- | 2Ah Normal, but BG3 is disabled, colour math is subtractive, | + | |2Ah|Normal, but BG3 is disabled, colour math is subtractive, |
- | 2Ch Normal, but BG3 is disabled | + | |2Ch|Normal, but BG3 is disabled|Used by FX layer 3 type = haze and torizos |
- | 2Eh Normal, but colour math is subtractive | + | |2Eh|Normal, but colour math is subtractive|Unused |
- | 32h Normal, but BG1 isn't affected by BG3 and colour math is subtractive | + | |32h|Normal, but BG1 isn't affected by BG3 and colour math is subtractive|Unused |
- | 34h Normal, but power bombs don't affect BG2 Unused | + | |34h|Normal, but power bombs don't affect BG2|Unused |
Liquid options | Liquid options | ||
- | 1 Liquid flows (leftwards) | + | |1|Liquid flows (leftwards) |
- | 2 Layer 2 is wavy | + | |2|Layer 2 is wavy | |
- | 4 Liquid physics are disabled (used in n00b tube room) | + | |4|Liquid physics are disabled (used in n00b tube room) | |
- | 40h Big tide (liquid fluctuates up and down, a la the gauntlet) | + | |40h|Big tide (liquid fluctuates up and down, a la the gauntlet) |
- | 80h Small tide (liquid fluctuates up and down) | + | |80h|Small tide (liquid fluctuates up and down) | |
- | |||
==== Enemy population ==== | ==== Enemy population ==== | ||
Line 486: | Line 485: | ||
The properties are as follows: | The properties are as follows: | ||
- | 8000h Hitbox solid to Samus | + | |8000h|Hitbox solid to Samus | |
- | 4000h Respawns if killed | + | |4000h|Respawns if killed |
- | 2000h Process instructions | + | |2000h|Process instructions |
- | 1000h Block plasma beam | + | |1000h|Block plasma beam | |
- | 800h Process whilst off-screen | + | |800h|Process whilst off-screen |
- | 400h Intangible | + | |400h|Intangible |
- | 200h Delete | + | |200h|Delete |
- | 100h Invisible | + | |100h|Invisible |
The extra properties are as follows: | The extra properties are as follows: | ||
- | 4 Enable extended spritemap format | + | |4|Enable extended spritemap format |
- | 1 Disable enemy AI. Isn't disabled if intangible | + | |1|Disable enemy AI. Isn't disabled if intangible |
==== Enemy set ==== | ==== Enemy set ==== | ||
Line 523: | Line 521: | ||
Scroll values are as follows: | Scroll values are as follows: | ||
- | 0 Red. Cannot scroll into this area | + | |0|Red. Cannot scroll into this area | |
- | 1 Blue. Hides the bottom 2 rows of the area | + | |1|Blue. Hides the bottom 2 rows of the area | |
- | 2 Green. Unrestricted | + | |2|Green. Unrestricted |
==== Special X-Ray Blocks ==== | ==== Special X-Ray Blocks ==== | ||
Line 544: | Line 542: | ||
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 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. | ||
- | Note that flexglow uses this pointer for the flexglow table instead. | + | Note that [[https:// |
==== PLM population ==== | ==== PLM population ==== | ||
Line 573: | 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 | + | ^Type^Parameters^Description |
- | 2 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 | |
- | 4 ssssss dddd Decompress s to d in bank $7E | + | |4|ssssss dddd|Decompress s to d in bank $7E | |
- | 6 | + | |6| |Clear layer 3 | |
- | 8 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 | + | |Ah| |Clear layer 2 | |
- | Ch | + | |Ch| |Clear Kraid' |
- | 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 622: | Line 620: | ||
The draw instruction format is a list of: | The draw instruction format is a list of: | ||
- | 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 727: | 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: | ||
- | |||
- | | ||
- | | | ||
- | | | | ||
- | | | | | ||
- | | | | | | ||
- | | | | | | | ||
- | | | | | | | | ||
- | | | | | | | | ___ 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 (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.1731709092.txt.gz · Last modified: 2024/11/15 22:18 by felixwright