Super Mario All-Stars - Get Area Music?

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
SMB2J-2Q
Posts: 154
Joined: Thu Jul 27, 2017 5:13 pm

Super Mario All-Stars - Get Area Music?

Post by SMB2J-2Q »

For those of you interested in wanting to learn how the area music is coded into Super Mario Bros. within Super Mario All-Stars, please check out the code below:

Code: Select all

DATA_05C8F5:
db $03,$02,$06,$08,$01,$13

CODE_05C8FB:
PHB                     ; $05:C8FB: 8B
PHK                     ; $05:C8FC: 4B
PLB                     ; $05:C8FD: AB
PHX                     ; $05:C8FE: DA
LDA $0770               ; $05:C8FF: AD 70 07
BEQ CODE_05C94D         ; $05:C902: F0 49
LDA $0752               ; $05:C904: AD 52 07
CMP #$02                ; $05:C907: C9 02
BEQ CODE_05C91C         ; $05:C909: F0 11
LDY #$05                ; $05:C90B: A0 05
LDA $0710               ; $05:C90D: AD 10 07
CMP #$06                ; $05:C910: C9 06
BEQ CODE_05C918         ; $05:C912: F0 04
CMP #$07                ; $05:C914: C9 07
BNE CODE_05C91C         ; $05:C916: D0 04

CODE_05C918:
LDY #$05                ; $05:C918: A0 05
BRA CODE_05C925         ; $05:C91A: 80 09

CODE_05C91C:
LDY $BA                 ; $05:C91C: A4 BA
LDA $0743               ; $05:C91E: AD 43 07
BEQ CODE_05C925         ; $05:C921: F0 02
LDY #$04                ; $05:C923: A0 04

CODE_05C925:
LDA $0F                 ; $05:C925: A5 0F
CMP #$04                ; $05:C927: C9 04
BEQ CODE_05C944         ; $05:C929: F0 19
CMP #$05                ; $05:C92B: C9 05
BEQ CODE_05C944         ; $05:C92D: F0 15
LDA $DB                 ; $05:C92F: A5 DB
CMP #$1B                ; $05:C931: C9 1B
BNE CODE_05C939         ; $05:C933: D0 04
LDA #$01                ; $05:C935: A9 01
BRA CODE_05C93C         ; $05:C937: 80 03

CODE_05C939:
LDA DATA_05C8F5,y       ; $05:C939: B9 F5 C8

CODE_05C93C:
LDX $0EDF               ; $05:C93C: AE DF 0E
BNE CODE_05C944         ; $05:C93F: D0 03
STA $1602               ; $05:C941: 8D 02 16

CODE_05C944:
LDX $DB                 ; $05:C944: A6 DB
CPX #$21                ; $05:C946: E0 21
BNE CODE_05C94D         ; $05:C948: D0 03
STA $0EDF               ; $05:C94A: 8D DF 0E

CODE_05C94D:
PLX                     ; $05:C94D: FA
PLB                     ; $05:C94E: AB
RTL                     ; $05:C94F: 6B
LDA $7FFB06             ; $05:C950: AF 06 FB 7F
BPL CODE_05C958         ; $05:C954: 10 02
LDA #$00                ; $05:C956: A9 00

CODE_05C958:
STA $077A               ; $05:C958: 8D 7A 07
That way, we'd know what to do if we want to convert this to 6502-type to convert it to the original NES SMB1 and the FDS SMB2J. For example, I would like to change the music for the underground coin room to selection number $04 of the MusicSelectData ($10, or CloudMusic).

~Ben
Post Reply