This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
return_of_samus:technical_information:screen_transitions [2023/05/29 20:51] – rt-55j | return_of_samus:technical_information:screen_transitions [2023/07/02 17:34] – [0* - VRAM/data Block Transfer] rt-55j | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Screen Transitions ====== | ====== Screen Transitions ====== | ||
- | {{..: | + | {{..: |
- | Now, as discussed | + | It is recommended that you have a basic understanding of [[return_of_samus: |
- | ===== The Language | + | ===== Internal Workings |
- | Once the game identifies | + | Each screen on each map has a screen transition index associated with it. As long as the index is not zero, the screen transition corresponding |
- | First it checks if it has reached | + | Once the game identifies the script to use, it copies |
- | Scripts are limited to 64 (0x40) bytes in length, but you'll literally never hit that limit. | + | The interpreter first checks if it has reached the end of the script |
(Note that all 16-bit values (pointers, etc.) are assumed to be little-endian, | (Note that all 16-bit values (pointers, etc.) are assumed to be little-endian, | ||
+ | |||
+ | ===== Tokens/ | ||
+ | |||
+ | Here is a list of valid tokens/ | ||
==== FF - Terminating Operator ==== | ==== FF - Terminating Operator ==== | ||
Line 22: | Line 26: | ||
Copies a block of data starting at a specified bank and address to somewhere in RAM. | Copies a block of data starting at a specified bank and address to somewhere in RAM. | ||
- | Cases: | + | Syntax: |
- | * 01 bb ssss dddd llll - Saves bb:ssss as the source of a BG tileset (necessary for saving properly) | + | |
- | * 02 bb ssss dddd llll - Saves ssss as the source of a sprite tileset (necessary for saving properly) | + | |
- | * 0* bb ssss dddd llll - Just copies the data. | + | |
Operands: | Operands: | ||
Line 40: | Line 44: | ||
Copies the desired metatile table to $DA00-$DBFF in WRAM. | Copies the desired metatile table to $DA00-$DBFF in WRAM. | ||
- | |||
- | The metatile table pointer list begins at 0x23F1A in ROM. | ||
< | < | ||
Line 56: | Line 58: | ||
</ | </ | ||
- | (For some reason, these pointers slightly out of order compared to how the data is stored in the rom.) | + | The lava caves adjust their lava levels by changing their metatiles to sets with more or fewer lava tiles during door transitions. |
+ | |||
+ | The metatile table pointer list begins at '' | ||
==== 2x - Select collision table ==== | ==== 2x - Select collision table ==== | ||
Copies the desired collision table to $DC00-$DCFF in WRAM. | Copies the desired collision table to $DC00-$DCFF in WRAM. | ||
- | |||
- | The collision table pointer list begins at 0x23EEA in ROM. | ||
< | < | ||
Line 72: | Line 75: | ||
6 - ruinsExt | 6 - ruinsExt | ||
7 - finalLab</ | 7 - finalLab</ | ||
- | ==== 3x - Select solidity indexes ==== | ||
- | Copies the desired solidity indexes to WRAM. | + | The collision table pointer list begins at 0x23EEA in ROM. |
- | The solidity indexes | + | ==== 3x - Select |
- | The bytes are copied | + | Copies the desired solidity indexes |
- | * $D056 & $D812 - Samus' solidity index | + | Basically, the way it works is that if an 8x8 tile is less than the specified index, then it is treated as a solid. |
- | * $D056 & $D813 - Enemy solidity index | + | |
- | * $D08A & $D814 - Projectile solidity index | + | |
- | + | ||
- | Basically, for Samus, the way it works is that if an 8x8 tile is less than the specified index, then it is treated as a solid. | + | |
< | < | ||
Line 97: | Line 95: | ||
Note that (by default) these match up perfectly with the collision values previously. | Note that (by default) these match up perfectly with the collision values previously. | ||
+ | |||
+ | The solidity indexes are stored in a table starting at 0x23EFA. Each entry row is four bytes wide, though only three are used. | ||
+ | |||
+ | The bytes are copied to these locations: | ||
+ | |||
+ | * $D056 & $D812 - Samus' solidity index | ||
+ | * $D056 & $D813 - Enemy solidity index | ||
+ | * $D08A & $D814 - Projectile solidity index | ||
+ | |||
==== 4* - Warp ==== | ==== 4* - Warp ==== | ||
Warps Samus to the specified map and screen. | Warps Samus to the specified map and screen. | ||
- | Form: 4byx | + | Syntax: '' |
Operands: | Operands: | ||
Line 121: | Line 128: | ||
==== 6* - Change acid & spike damage ==== | ==== 6* - Change acid & spike damage ==== | ||
- | Form: 6* xx yy | + | Syntax: '' |
Operands: | Operands: | ||
Line 128: | Line 135: | ||
* yy - spike damage | * yy - spike damage | ||
- | I'm not sure if this is ever used, but it's cool at least. | + | This is used towards the end of the game to increase the acid damage from $02 to $06. |
- | For reference, the default starting values are $02 and $08. | + | For reference, the default starting values are $02 and $08. (Note that damage values for Samus in this game are binary-coded decimal.) |
==== 7* - Exit Room After Last Boss Death ==== | ==== 7* - Exit Room After Last Boss Death ==== | ||
Line 139: | Line 146: | ||
- Disables LCD interrupt from last boss fight | - Disables LCD interrupt from last boss fight | ||
- Reloads the status bar into the window | - Reloads the status bar into the window | ||
+ | |||
==== 8* - Transition to the Queen Fight ==== | ==== 8* - Transition to the Queen Fight ==== | ||
Handles a lot of special stuff regarding the queen fight, but not everything. | Handles a lot of special stuff regarding the queen fight, but not everything. | ||
- | Form: 8a bbbb cccc dddd eeee | + | Form: '' |
* a: Bank for current room ($F) | * a: Bank for current room ($F) | ||
* b: Scroll Y position ($F48) | * b: Scroll Y position ($F48) | ||
Line 149: | Line 157: | ||
* d: Samus Y position ($F02) | * d: Samus Y position ($F02) | ||
* e: Samus X position ($EDE) | * e: Samus X position ($EDE) | ||
+ | |||
==== 9* - Conditional Operator ==== | ==== 9* - Conditional Operator ==== | ||
- | Form: 9* nn xxxx | + | Syntax: '' |
Operands: | Operands: | ||
Line 171: | Line 180: | ||
Forms: | Forms: | ||
- | - B1 bb xxxx - Load BG graphics page (128 tiles) to $9000 in VRAM. | + | |
- | - B2 bb xxxx - Load Sprite graphics page (64 tiles) to $8B00 in VRAM. | + | |
Operators: | Operators: | ||
Line 274: | Line 283: | ||
For reference, the macros the disassembly uses are as follows: | For reference, the macros the disassembly uses are as follows: | ||
- | | Opcode | + | ^ Opcode |
| 00 bb ssss dddd llll | COPY_DATA | | | 00 bb ssss dddd llll | COPY_DATA | | ||
| 01 bb ssss dddd llll | COPY_BG | | | 01 bb ssss dddd llll | COPY_BG | |