Play custom music

Go down

Play custom music Empty Play custom music

Post by Puzzledude Wed 31 Jul 2013 - 11:32

This ASM was written by Conn.
 
The goal of this ASM:
To load (play) custom overworld music, without the reseting when exiting any entrance.
 
(Original Alttp always resets it to Overworld music, plus it has some special entrances, which are reseting to something else. All resets are independent from the actual music set on the overworld).
 
Download (UPS PATCH UPDATE)
http://dl.dropbox.com/s/k2ef37n73aoe6ek/Play%20custom%20music%20%28UPS%20patch%20Update%29.zip


Last edited by Puzzledude on Tue 25 Feb 2014 - 15:10; edited 2 times in total
Puzzledude
Puzzledude

Play custom music Image213

Since : 2012-06-20

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Conn Wed 31 Jul 2013 - 12:08

Again, great :p

Could you post this as well to the single hacks collection?

I added the overworld/dungeon check to the asm:
http://bszelda.zeldalegends.net/stuff/Con/Play%20custom%20music%20ASM2.txt

Please use this instead the old one.
Conn
Conn

Play custom music Image212

Since : 2013-06-30

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Puzzledude Wed 31 Jul 2013 - 12:17

I have the new version in the Hex code, but I left the Asm in 2 parts. Will use the new Asm2 in single hacks (but this is only for the ones who wish to study the actual Asm - disassembly, it is ok in assembled hex form).
Puzzledude
Puzzledude

Play custom music Image213

Since : 2012-06-20

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Conn Wed 31 Jul 2013 - 12:47

ok Smile
One last thing needs to be mentioned...
While I found out for SePH a code to not let Aghanim hijack you into Dark World, here's the code for the music
set to dark world (hardcoded like Lost Woods) pc 01/1e4c:09 -> 02
I tested it and actually the code at 11/a200 will be read later, so even if first at given address the dw theme is loaded, the table code will be executed later and thus the correct music from the table is played. So no problem here Smile
Conn
Conn

Play custom music Image212

Since : 2013-06-30

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Conn Wed 31 Jul 2013 - 14:11

Thanks for posting the music patch... could you edit it that way to display the asm as code rather than the link to the text at bszelda? I use to delete files from my bszelda folder if obsolete... the code below should do it (added also the dungeon check into the code Wink
In the description you may change avoid reseting music when "exiting entrances to "changing screens". Exiting entrances confuses since people may think it works only when leaving a cave/dungeon.



Code:

;CUSTOM MUSIC, ASM BY CONN


;Goal: load custom overworld music, without the reseting when changing screens. (Original Alttp always resets it to Overworld music).


lorom

org $008100
jsr $89d5  ;pc: 00/09d5 (after your sword charge no move)

org $0089d5
jsl $23a200
RTS

org $23a200
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.
Conn
Conn

Play custom music Image212

Since : 2013-06-30

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Puzzledude Wed 31 Jul 2013 - 14:19

Edited. Smile  However the goal of the patch is to take care of the music problem when exiting. With the reset I meant play the overworld music (rather then town music for instance). I did change it to "changing screens". I hope this will not confuse either, so I added later that "Alttp always resets it to Overworld music when exiting most entrances".
Puzzledude
Puzzledude

Play custom music Image213

Since : 2012-06-20

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Erockbrox Wed 31 Jul 2013 - 14:28

Nice work!
Erockbrox
Erockbrox

Play custom music Image211

Since : 2013-02-05

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Conn Wed 31 Jul 2013 - 15:41

Thanks Smile
Ah I see now what you mean. Essentially however, this patch allows you to have any music in any screen, independent from whether you exit somewhere a cave or simply change screen from area a to area b.
I hope you're aware of that this is possible. You can give Link's house area (2c) the value 02 (in all 3 tables + in the edited table at 11/a300) and this screen will always play 02 while all other screens will play 05 in your rom.

You have total control of any music in any screen in the OW using this hack, not only in dependence on the exits Smile
Conn
Conn

Play custom music Image212

Since : 2013-06-30

Back to top Go down

Play custom music Empty Re: Play custom music

Post by Puzzledude Wed 31 Jul 2013 - 16:03

Exactly. Of course having any music in any screen can actually be achieved with HM. So everything can normally be edited (screen resets and no resets work just fine), but once you enter a cave and exit this cave, the overworld music is loaded in original Alttp, despite the fact, that you defined the area to have town or forest with HM.
 
For instance, go to area 18 on original Alttp and select the dark world music Mountain with HM. When you transit into village, it will actually play the dark world Mountain song (this is 0D in hex), but if you enter a standard house which is set to any indoor music except Lower volume, it will play Overworld music when you exit the house. Special village entrances (like the upper left cave) will play village song when you exit the cave, but if you enter the area by another area it will play dark world mountain (total mess).
 
I've tested all this with this patch (always custom music 0D is played), which is a relief.
 
So it is a strange move by original authors to make 3 different parameters here. Should be just one (like now). Most likely they had a problem with ambient sound - it can not play when exited from entrance, but can if transited normally by areas. So this is why I've removed ambient sounds (there's no actual difference really), so all the first values of bytes must start with 0. So 05 and never 55, for the forest for instance.
Puzzledude
Puzzledude

Play custom music Image213

Since : 2012-06-20

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum