CUSTOM MUSIC, ASM BY CONN ------------------------- Goal: load custom overworld music, without the reseting when exiting any entrance. (Original Alttp always resets it to Overworld music). INITIAL CODE The coding: pc: 00/0100: jsr to pc: 00/09d5 (after your sword charge no move) pc: 00/095d: jsl to pc 11/a200, 60 (return jsr) pc: 11/a200 TAX ; transfer native value to X SBC #$0F ; check if theme is in range 00-0F (overworld themes) BCC $04 ; continue if yes STZ $012C ; if no, set 012c to 00 and return to game RTL LDA $008c ; check overworld cmp #$00 BNE $0b LDA $008a cmp #$00 BNE $04 STZ $012C ; if you are in dungeon/cave, set 012c to 00 and return to game RTL TXA ; regain native value X transfer to A ; now a comparison starts of themes you want to have replaced, this is overworld 02, lost woods 05, kakariko 07, dark world 09, skull woods 0d. This is necessary to not replace title screen, introduction, minigame, character selection, rabbit, rain, which is not on the map! CMP #$02 ; if overworld theme is about to play jump to $A231 and replace, if not check if it is 05 and so forth. BNE $03 JMP $A243 CMP #$05 BNE $03 JMP $A243 CMP #$07 BNE $03 JMP $A243 CMP #$09 BNE $03 JMP $A243 CMP #$0D BNE $03 JMP $A243 STZ $012C ; if it is another theme (introduction, title screen -> return to game) RTL LDA $012C ; if theme is already loaded return to game (address is loaded twice) CMP $0131 BNE $04 STZ $012C RTL LDX $040A ; load screen number to X LDA $23A300,x ; select theme from table, in dependence of screen in X STA $012C ; play theme STA $2140 STA $0132 RTL The table at 11/a300 contains all 07 (kakariko). You simply need to replace these number by the number you like to have played. The table beginning at 01/4343 needs to be an exact copy of the table 11/a300 to avoid a music reset everytime you switch screens. ------------------------------------- ADDITIONAL FIX AD 8C 00 C9 00 D0 0B AD 8A 00 C9 00 D0 04 9C 2C 01 6B Load address 008C, compare to 00, if not 00 (so if 01= on overworld), branch 0B forward to code, the same for the other, but branch only 4 bytes; but an old 9C 2C 01 if it is 00 (so if indoors, remain as it was). This fix implements the code only if you are in the overworld (but not indoors). It must be so. Conn wrote: I made a check 11/a209: ad 8c 00 c9 00 and ad 8a 00 9c 00. If both values (7e/008c and 7e/008a are 00) you are indoors.