;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; OW Music Change Sprite, By Iceguy ; ; This sprite will cause the music on the overworld to change depending on where ; Mario is. You can also use it with custom music. The values for the music are ; the same as those when you insert music normally. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Defines NewOWMusic = $05 ;/ set this to the new music you want, using the list in LM's music window PrevOWMusic = $04 ;\ Set this to the previous OW music that was going on xPOS = $0058 ;\ The X and Y position in the OW for the music to change yPOS = $0080 ;/ Use the Snes9x debugger to get the right values PrevXPOS = $0060 ;\ Again use the Snes9x debugger and get the previous PrevYPOS = $007C ;/ X/Y positions so the old music goes on when Mario goes back PHB PHK PLB JSR Main PLB RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; org $04FAF1 ;; main sprite routine ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Main LDA $1DFB CMP #NewOWMusic ;/ if new music is already on.. BEQ Return01 ;\ return.. (so it doesn't loop) REP #$20 ;/ 16 bit processing mode (X/Y Pos are sometimes xxxx) LDA $1F17 CMP #xPOS ;/ if the X position doesn't match.. BNE Return01 ;\ return.. LDA $1F19 ;\ if the y position doesn't match.. CMP #yPOS ;/ return.. BNE Return01 SEP #$20 ;/ return back to 8-bit processing mode LDA #NewOWMusic ;/ set new OW music.. STA $1DFB RTS Return01 SEP #$20 LDA $1DFB CMP #PrevOWMusic ;/ if the previous music is already on.. BNE Return02 ;\ return REP #$20 LDA $1F17 CMP #PrevXPOS BNE Return02 LDA $1F19 CMP #PrevYPOS BNE Return02 LDA #PrevOWMusic STA $1DFB Return02: SEP #$20 RTS