We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

SMW Resource Memory Map

From SnesLab
Revision as of 11:14, 30 September 2019 by Vitor Vilela (talk | contribs) (Vitor Vilela moved page SMW Resource RAM-ROM Map to SMW Memory Map: More fitting name)
Jump to: navigation, search

Organization comes later. Feel free to add major patches here as well.
Also feel free to suggest a good way to represent SA-1 addresses (if applicable).

Lunar Magic

RAM

Most of these addresses were acquired from Lunar Magic's help file and files floating around the internet.

Address Size Description
$7E0BF5 0x1 ExLevel flags (to be filled later).

Used on Lunar Magic 3.00+

$7E0BF6 0x100 ExLevel RAM (to be filled later).

Used on Lunar Magic 3.00+

$7E13D7 0x2 Screen vertical size.

Used on Lunar Magic 3.00+

$7E1936 0x2 Screen vertical size - #$0010. Used to adjust smkdan's patch

Used on Lunar Magic 3.00+

$7FC004 0x1 Legacy ExAnimations frame counter. Used to be the frame counter for every ExAnimation slot, now it's only accurate for slots 0, 8, 10 and 18.
$7FC060 0x10 Conditional Direct Map16 flags.
$7FC070 0x10 Manual ExAnimation triggers.

Each byte corresponds to one manual ExAnimation slot. This block of RAM addresses isn't initialized unless you use the Trigger Init button in the ExAnimation dialog.

$7FC080 0x20 Level ExAnimations frame counter. Each byte corresponds to one slot.
$7FC0A0 0x20 Global ExAnimations frame counter. Each byte corresponds to one slot.
$7FC0F8 0x4 One Shot Exanimation triggers.
$7FC0FC 0x2 Custom ExAnimation triggers.

Each bit corresponds to each custom ExAnimation slot. If a bit is on it means the trigger is enabled. This block of RAM addresses isn't initialized unless you use the Trigger Init button in the ExAnimation dialog.

$7FC00B 0x2? Purpose unknown. Used in $0EFD00 to perform a bit 2 check.
$7F8183 0x1A4? Used for VRAM modification.
  • $7F8185 holds a 16-bit value. Written to on $0FB054.
  • $7F8327 is used on $0FB054 to store either 0x01B0 or 0x200. Maybe it's related to Layer 2 BG height?
$000000 0x0 To be edited later.

ROM/Routines

SNES Address Description
$0FF900 GFX decompression routine.

It can't decompress GFX files 32 or 33.
On entry:

  • A should contain the 16-bit GFX/ExGFX file number you want to decompress.
  • $00-$02 should contain the 24-bit address of where to decompress the data to.

On exit:

  • Processor bits are preserved.
  • Contents of X are preserved.
  • Contents of Y are preserved.
  • A is not preserved.
$0EFD00 LM Routine? Does something related to Layer 2 tilemaps. Returns the value of $7E1928 in A.
$000000 To be edited later.

AddMusicK

RAM

Note: AddMusicK's RAM addresses ($7FB000-$7FB00A) are reset during the SPC Program upload.

Address Size Description
$7E1DFA 0x1 Command list.
  • $01 - Jump SFX. Sounds glitched due to it overwritting part of arpeggio's RAM with unexpected data. See L_0A14 for more details.
  • $02 - Turns on Yoshi Drums.
  • $03 - Turns off Yoshi Drums.
  • $04 - Grinder SFX. Potentially glitched.
  • $05 - Disables echo effect on SFXs.
  • $06 - Enables echo effect on SFXs.
  • $07 - Pauses music.
  • $08 - Unpauses music.
  • $09-$FE - Unused
  • $FF - Jumps to L_099C. It seems to prepare the SPC700 to receive data. Disables echo, sets delay to 0, turns off channels, resets the song number (SPC Output 2 = 0). Needs testing.
$7FB000 0x1 Current song playing.
$7FB001 0x1 Flag used to disable sample upload when switching to a new song.

Reset when a song finishes being uploaded to ARAM.

$7FB002 0x2 Unused. Meant to be:

ARAM/DSP Address.

  • To write to ARAM: Set $7FB002 to the address, and $7FB004 to the value to write. Note that the address cannot be $FFxx.
  • To write to the S-DSP: Set $7FB002 to the address, $7FB003 to #$FF, and $7FB004 to the value to write.
$7FB004 0x4 SPC Output.
  • $F4 $05 will reset $7FB004 and $7FB005.
  • $F9 $XX $YY will send $XX and $YY to $7FB004 and $7FB005 respectively. (Needs verification)
  • $7FB006 and $7FB007 are unused and most likely have garbage sent by the program.
$7FB008 0x1 Unused. Meant to have the same purpose as $7E0DDA.
$7FB009 0x1 Sample count in the current song.
$7FB00A 0x400 ARAM SRCN table.

Used as a buffer for the sample pointer/loop table. Could be up to 1024 bytes long, but this is unlikely (4 bytes per sample; do the math).

ROM/Routines

SNES Address Description
$008079 UploadSPCData.

This is an ever-so-slightly modified version of SMW's SPC upload routine. You can jump here at any time to upload data to the SPC.
Input:

  • $00-$02 - Address of the block to upload to ARAM
  • $03-$04 - Position in ARAM to jump to upon completion
  • $05-$06 - Clobbered. Unused on entry; will be the size of the transferred data when finished.
$008135 UploadSPCDataDynamic. This address needs to be checked.

This is an alternate version of the upload routine. Call this if it is impossible to determine ahead of time where data will go. This routine is used to upload samples by default, but it can upload anything.
Input:

  • $00-$02 - Address of the block to upload to ARAM
  • $03-$04 - Position in ARAM to jump to upon completion
  • $05-$06 - Size of the data to upload (this address is NOT clobbered).
  • $07-$08 - Address in ARAM to upload to (recommended to increment it by ($05) when you finish to upload consecutive data)

PIXI

RAM

Address Size Description
$000000 0x0 To be edited later.

ROM/Routines

SNES Address Description
$000000 To be edited later.

GPS

RAM

Address Size Description
$000000 0x0 To be edited later.

ROM/Routines

SNES Address Description
$000000 To be edited later.

Custom Powerups

RAM

Address Size Description
$7E2000 0x800 RAM with different purposes. Only uses 0x1D4 bytes at the moment.
$7E2800 0x2000 Reserved as a decompression buffer for the 5th tile GFX.
$7E4800 0x2000 Reserved as a decompression buffer for dynamic items GFX.
$7E6800 0x800 Reserved as a copy of the first 2KiB of the latest decompresed GFX file.
$7E7000 0xCFF Free to use.
$000000 0x0 To be edited later.

ROM/Routines

SNES Address Description
$000000 To be edited later.