This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
return_of_samus:data_locations:ram_map [2017/02/26 17:19] – Big update (sorry if I reworded some existing variables, this is more-or-less a copy+paste) p.jboy | return_of_samus:data_locations:ram_map [2020/03/27 02:09] – kkzero | ||
---|---|---|---|
Line 46: | Line 46: | ||
+ 17: Source address of data for $DC00..FF (bank 8, 2 bytes) | + 17: Source address of data for $DC00..FF (bank 8, 2 bytes) | ||
+ 19: Bank for current room | + 19: Bank for current room | ||
- | + 1A: Samus solid block threshold | + | + 1A: Samus passable |
- | + 1B: Enemy solid block threshold | + | + 1B: Enemy passable |
- | + 1C: Projectile | + | + 1C: Projectile |
+ 1D: Samus' equipment | + 1D: Samus' equipment | ||
+ 1E: Samus' beam | + 1E: Samus' beam | ||
Line 112: | Line 112: | ||
C407: Set to [$D069] in $2:4000 | C407: Set to [$D069] in $2:4000 | ||
+ | |||
+ | C40F: bottom-most visible metatile row index in map * $10 (big-endian word). | ||
+ | C411: top-most visible metatile row index in map * $10 (big-endian word). | ||
+ | C413: right-most visible metatile column index in map * $10 (big-endian word). | ||
+ | C415: left-most visible metatile column index in map * $10 (big-endian word). | ||
C418: Set to [$D058] in $2:4000 | C418: Set to [$D058] in $2:4000 | ||
Line 132: | Line 137: | ||
C45C: Used as index for table at $1:729C, value for $FFEA | C45C: Used as index for table at $1:729C, value for $FFEA | ||
- | C500-FE: | + | C500-FE: |
- | C540-7F: | + | C500-C53F: Non-persistent object (e.g. enemy) spawn states |
+ | 01: Spawned in object table (" | ||
+ | 02: Dead/ | ||
+ | FF: Not spawned | ||
+ | C540-7F: | ||
C600..C7FF: Enemy data. 20h byte slots according to $30BB, current address is kept in $D05E | C600..C7FF: Enemy data. 20h byte slots according to $30BB, current address is kept in $D05E | ||
- | + 0: If bits 0-3 clear, $30BB executes $30EA on slot | + | + 0: Flags. |
- | + 1: Value for $FFB7 in $30EA | + | + 1: Y coordinate. |
- | + 2: Value for $FFB8 in $30EA | + | + 2: X coordinate. |
- | + 3: Value for $FFB9 in $30EA | + | + 3: Metasprite number. |
- | + 4: Value for $FFBF in $30EA | + | + 4: Priority bit ($80) for sprites. |
+ | + 5: Sprite flip flags ($20 for horizontal, $40 for vertical) | ||
+ | + 6: Low nibble is blink frames remaining. Bit 4 is sprite palette flag. | ||
+ | + A: Frozen frame counter. Increments by 2 every 4 frames. 0 is not frozen, 1-$C4 is frozen, $C5-$D0 is thawing. | ||
+ | + B: Health | ||
+ | + 1D: Map object slot index | ||
C900-CABF: Item/ | C900-CABF: Item/ | ||
Line 442: | Line 456: | ||
D027: Samus X position | D027: Samus X position | ||
D029: Samus Y position | D029: Samus Y position | ||
- | D02B: Direction Samus is facing | + | D02B: Direction Samus is facing, mirrored from $D81E at save load. |
0: Left | 0: Left | ||
1: Right | 1: Right | ||
Line 472: | Line 486: | ||
Eh: On meet of right-facing wall and floor | Eh: On meet of right-facing wall and floor | ||
- | D045: Samus' equipment | + | D045: Samus' equipment, mirrored from $D815 at save load. |
01: Bombs | 01: Bombs | ||
02: Hi-jump | 02: Hi-jump | ||
Line 483: | Line 497: | ||
D047: Tiles update flag (see $FFB1..B6, $2BA3, $27BA) | D047: Tiles update flag (see $FFB1..B6, $2BA3, $27BA) | ||
- | D04D: Weapon equipped. | + | D04D: Weapon equipped. |
0: Normal | 0: Normal | ||
1: Ice | 1: Ice | ||
Line 492: | Line 506: | ||
D04E: Bank | D04E: Bank | ||
- | D050: Samus' energy tanks, | + | D050: Samus' |
- | D051: Samus' health, | + | D051: Samus' health, |
- | D053: Samus' missiles, | + | D052: Samus' filled energy tanks, mirrored from $D819 at save load. |
- | D055: Samus' beam. Saved to SRAM, mirror of $D04D/$D816? | + | D053: Samus' missiles(upper nybble tens, lower nybble ones), mirrored from $D81C at save load. |
+ | D054: Samus' missiles(upper nybble thousands, lower nybble hundreds), mirrored from $D81D at save load. | ||
+ | D055: Samus' beam. Saved to SRAM, mirrored from $D816 at save load. | ||
0: Normal | 0: Normal | ||
1: Ice | 1: Ice | ||
Line 501: | Line 517: | ||
3: Spazer | 3: Spazer | ||
4: Plasma | 4: Plasma | ||
- | D056: Samus solid block threshold | + | D056: Samus passable |
D057: Room sprite priority | D057: Room sprite priority | ||
0: Sprites over BG | 0: Sprites over BG | ||
Line 513: | Line 529: | ||
D067: Used in title. Set to 01h by $0CA3 and game mode Ah | D067: Used in title. Set to 01h by $0CA3 and game mode Ah | ||
- | D069: Enemy solid block threshold | + | D069: Enemy passable |
D06E: Highest OAM stack pointer | D06E: Highest OAM stack pointer | ||
Line 532: | Line 548: | ||
D07F: Object 0 palette | D07F: Object 0 palette | ||
D080: Object 1 palette | D080: Object 1 palette | ||
- | D081: Samus' max missiles, | + | D081: Samus' max missiles(upper nybble tens, lower nybble ones), mirrored from $D81A at save load. |
+ | D082: Samus' max missiles(upper nybble thousands, lower nybble hundreds), mirrored from $D81B at save load. | ||
D083: Read in $1:7A34, adjusts sprite Y position in $1:4DDF | D083: Read in $1:7A34, adjusts sprite Y position in $1:4DDF | ||
D084: Samus' health for display, | D084: Samus' health for display, | ||
Line 538: | Line 555: | ||
D089: Real number of Metroids remaining | D089: Real number of Metroids remaining | ||
- | D08A: Projectile | + | D08A: Projectile |
D08B: Metroid Queen' | D08B: Metroid Queen' | ||
11h: In Metroid Queen' | 11h: In Metroid Queen' | ||
Line 577: | Line 594: | ||
D0A7: Metroids remaining in area | D0A7: Metroids remaining in area | ||
+ | |||
+ | D600-1F: OAM data for the starry background in the credits. | ||
D700-3F: Screen transition commands | D700-3F: Screen transition commands | ||
Line 591: | Line 610: | ||
D80F: Source address of data for $DC00-FF (bank 8, 2 bytes) | D80F: Source address of data for $DC00-FF (bank 8, 2 bytes) | ||
D811: Bank for current room | D811: Bank for current room | ||
- | D812: Samus solid block threshold | + | D812: Samus passable |
- | D813: Enemy solid block threshold | + | D813: Enemy passable |
- | D814: Projectile | + | D814: Projectile |
- | D815: Samus' equipment | + | D815: Samus' equipment |
- | D816: Samus' beam | + | D816: Samus' beam at save load. |
- | D817: Samus' energy tanks | + | D817: Samus' |
- | D818: Samus' health | + | D818: Samus' health |
- | D81A: Samus' max missiles | + | D819: Samus' filled energy tanks at save load. |
- | D81C: Samus' missiles | + | D81A: Samus' max missiles |
- | D81E: Direction Samus is facing | + | D81B: Samus' max missiles at save load. Upper nybble thousands, lower nybble hundreds. |
+ | D81C: Samus' missiles | ||
+ | D81D: Samus' missiles at save load. Upper nybble thousands, lower nybble hundreds. | ||
+ | D81E: Direction Samus is facing | ||
D81F: Acid damage | D81F: Acid damage | ||
D820: Spike damage | D820: Spike damage | ||
Line 611: | Line 633: | ||
D900-FF: 10h byte slots? The first byte of which each is cleared when saving | D900-FF: 10h byte slots? The first byte of which each is cleared when saving | ||
DA00-DBFF: Metatile definitions | DA00-DBFF: Metatile definitions | ||
- | DC00-FF: | + | DC00-FF: |
+ | 1: Viscous. Reduces jumping and detaches spider ball on movement. Also causes morph ball sound effect glitch. | ||
+ | 2: Jump-through block. Passable when jumping, impassable in all other states (in all directions). | ||
+ | 4: Fall-through block. Passable when falling, impassable in all other states (in all directions). | ||
+ | 8: Spike | ||
+ | 10h: Acid | ||
+ | 20h: Destructible by shot/bomb | ||
+ | 40h: Destructible by bomb | ||
+ | 80h: Save pillar | ||
DD00-FF: Projectile RAM | DD00-FF: Projectile RAM | ||
+ | Beams - Takes up three 16-byte rows for each shot on-screen. Spazer and Plasma take up all three immediately. | ||
+ | DD00, DD10, DD20: Beam state. | ||
+ | 0-4: On-screen, being fired. Value will match the currently-equipped beam's as stored at D055. | ||
+ | FFh: Not on-screen. | ||
+ | DD01, DD11, DD21: Direction of fire. | ||
+ | 1: To the right. | ||
+ | 2: to the left. | ||
+ | 4: Upwards. | ||
+ | 8: Downwards. | ||
+ | DD02, DD12, DD22: Shot Y position. | ||
+ | DD03, DD13, DD23: Shot X position. | ||
+ | DD04, DD14, DD24: Unknown, switches between 0 and 8 on a seemingly random interval between firings. | ||
+ | DD05, DD15, DD25: Displacement from position fired at, ends up differently for each direction. | ||
+ | | ||
+ | Missiles - Shares a 16-byte row with the third beam slot. | ||
+ | DD20: Missile state. | ||
+ | 8: On-screen, being fired. | ||
+ | FFh: Not on-screen. | ||
+ | DD21: Direction of fire. | ||
+ | 1: To the right. | ||
+ | 2: to the left. | ||
+ | 4: Upwards. | ||
+ | 8: Downwards. | ||
+ | DD22: Shot Y position. | ||
+ | DD23: Shot X position. | ||
+ | DD24: Unknown, switches between 0 and 8 on a seemingly random interval between firings. | ||
+ | DD25: Displacement from position fired at, ends up differently for each direction. | ||
+ | | ||
+ | Bombs - Takes up three 16-byte rows for each bomb on-screen. | ||
+ | DD30, DD40, DD50: Bomb state. | ||
+ | 1: Laid, waiting to explode. | ||
+ | 2: Exploding. | ||
+ | FFh: No bomb on-screen. | ||
+ | DD31, DD41, DD51: Bomb timer. Starts at the value it was set at and decreases to zero. | ||
+ | DD32, DD42, DD52: Bomb Y position. | ||
+ | DD33, DD43, DD53: Bomb X position. | ||
+ | | ||
DE00-FF: Metatile update entries | DE00-FF: Metatile update entries | ||
+ 0: Dest. address. $0000 terminates update | + 0: Dest. address. $0000 terminates update |