Jukebox

by elementaltem

Game: SMW

Description: Press select to move to next music track.

; Base ASM file - feel free to copy/paste this and use this for your own code.

	LDA $100	; \ only run in gamemode 14
	EOR #$14	; |
	ORA $9D		; | and when the game isn't paused
	BEQ +		; |
	RTL		; |
	+		; /

LDA $16
AND #$20
BNE music
RTL

music:
LDA $100
CMP #$0E
BEQ overworld
CMP #$14
BEQ level
RTL

overworld:
LDA $1DFB
CMP #$08
BCS reset
INC $1DFB
RTL

level:
LDA $1DFB
CMP #$1C
BCS reset
INC $1DFB
RTL

reset:
LDA #$01
STA $1DFB
RTL


back to listings