Just wanted to say hi :)

Page 2 of 2 Previous  1, 2

Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Mon 29 Jul 2013 - 16:21

Great Smile
First 40 of custom code must match to all 4 above. But I think the beginning song is hardcoded to always play at the beginning regardless.

No, only 3 tables: rain is an exception in my code, so you can leave the first table as it is. However, you should equalize table 2,3,4 with 11/a300-11a33f. I find it kind of sad that kakariko and lost woods music turn into overworld anyways.
table 5 (dark world) must be equalized with 11/a340-11a37f (of course).

The final 20 bytes extra table is only used in zophar, master sword, under bridge. Since the music will not change with overlay these values there won't count I think (which is a 02 -overworld); like Rain overlay is also 02, but the 03 in the first table gives the music. Triforce shrine is in the table 02 as well, but ending theme 20 is played here.
If you want different music in Zophar/master sword, you need to add these 20 bytes to 11/a380-11/a39f

One problem is the area 80 (master sword/bridge) it is located at   01/4443: 05 (lost woods music).
I traced how it gets a 02: the code actively looks for your sword if it is a master sword 7E/F359-02 or higher, the value 05 gets rewritten to 02- And I think you cannot access under bridge without master sword... or?
If you want in the master sword screen a specific music you must change
snes: $02/C468 A9 02       LDA #$02  (after master sword draw) to your music theme and
snes: $02/C485 A9 05       LDA #$05 (before master sword draw) to your music theme
e.g. you want kakariko theme played in this area: change both to LDA #$07 (a9 07). The LDA #$05 is only executed in case you still have sword Level 1.

I sent Seph a new code where I set all 4 tables to the same value. There is no such things as rain and the music in his overworld is stabled all time. I also set the 20 extra rooms all to 06 to better distinguish them from the rest. I think they are unused so it doesn't matter. And if he uses them, only music from accessable rooms count (which only are zophar/master sword. If they are used in his rom, we can easily change this later Smile


Last edited by Conn on Mon 29 Jul 2013 - 18:25; edited 1 time in total
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Mon 29 Jul 2013 - 18:37

That's great SePH (great in the sense no complicated coding needed), and it means that no more adjustments are needed for the music patch for your game.

If you have some time though and can access all areas yet, you can do a small playtest with invincibility on to test for bugs on sensible places. I dunno how your game works, but sensible places are: (1) music trigger events (rain, zelda, master sword, aghanim), where the table switches; (2) dark world (which you obviously not have); (3) special rooms. Zophar and MasterSword/bridge are not part, but for safety reasons you could look whether the other special rooms Puzzle listed and you may use are affected by the music patch (clouds, fog, rain, sunset, triforce shrine...).
I assume everything is alright, because the main room's music you're in seems to have priority over the "special room" music: when rain layer is used which is theme 02 nevertheless 03 is played, triforce shrine is 02 as well but ending theme is played, sunset is also 02 but dark world 09 is played... and so on.
But it's always better to know for sure Wink
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Mon 29 Jul 2013 - 19:33

hm, can you send me a latest rom with all latest patches (also those by me) applied? I lost little bit the overview and use to hack on one that even not has all tilesets included.

Then you need to tell me how I get access to area 00 - I know it is girl, but I can only go up until (I think 20).
I do not know what to imagine with fog background sound but it surely isn't caused by my patch since it isn't the music but a sfx.
If you send me a rom, and a video and tell me at which time the sound appears I surely can fix it away Smile

Can Euclid help you with the other problem if he yet was able to implement similar in PW?

With Agahnim, watch maybe what 7E/008a does - here the immediate screen number is saved. In the end there is no difference between dark/lightworld, they only differ in screennumbers and some values (music/rabbit, that stuff).
Cheat with e.g., 7e008a-70 in the light world, go one screen further and you fing yourself in screen 70 of dark world.
Another (and maybe better) address you need to check is 7e/f3ca. 7ef3ca00 is light world, 7ef3ca40 is dark world. Cheat with 7ef3ca40 in the light world, go one screen and you are immediately in the dark world as well. Maybe Aghanim changes 7ef3ca to 40 when you defeat him? Wink
Cheat in your game 7ef3ca00, defeat Agahnim while this cheat is on and look whether you end up in dark world.
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Tue 30 Jul 2013 - 12:19

I've tested some more. It seems like the first byte of the new table affects not only the area 00, but also the starting srm 00 music (when you start from the house). In the third line one of the bytes also change the indoor music of entrance 01.
 
So I guess somesort of the test if you're in the overworld is necessary, so that the code does't affect any indoor music. I added the overworld test as it is in the icerod code, but then everything resets to Alttp music.
 
EDIT
Some more testing revealed that the indoor music starts at 1582E (block is 85 for 85 entrances and their indoor music). So the indoor music for entrance 01 is at 1582F, but the default is 07 for Town, however music town indoors doesn't work when the code is in. Other music (like cave, church, fairy fountain etc works). The last bank of music is at 15C4E (block is 7). These are the 7 music bytes for starting SRM locations, however 07 for Town also doesn't work anyomore.
 
Maybe hijacking all 3 tables is needed (overworld, indoor, srm save music). Or maybe just make it, so that the indoors remain intact, while having new table affect the overworld only.
 
-----------------------
 
Checked the Parallel Worlds rom. I don't know how Euclid managed this, but the music is ok everywhere. Specially interesting is the entrance 0A (this one always plays overworld music when exited), but in PW it is in the forest and when exited plays the forest music, the same with some village entrances.
 
-----------------------
 
Some more testing revealed that the code does not allow Town music indoors (value 07). I copied town to shop music, which is 0E. If I change 07 to 0E, it works. I don't know why the value 07 is no longer acceptable once the overworld code is in (since this is all indoor music). Maybe that's the problem, since in Alttp Town music is indoors and outdoors.


Last edited by Puzzledude on Tue 30 Jul 2013 - 13:46; edited 1 time in total
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 13:44

Check this out;

http://bszelda.zeldalegends.net/stuff/Con/musicfix.zip

Apply it on your rom (that already has the music). 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. So Link's house is now correct music.
Please check master sword area if it works fine (it is area 00 and extra area). Since my in either of both areas either 8a or 8c is not 00 it should work.
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Tue 30 Jul 2013 - 14:13

Perfect Very Happy . I can now make any combination of music. Indoors and srm music remains and is still compatible with HM, while overworld is set with the new table. And the new code allows town, forest music, while the entrances in such areas will not reset it back to overworld music when exited.
 
Regarding area 80, it just takes the music from area 00 regardless. I've set all to town, but only area 00 to forest, then area 00 had forest music, but also area 80 (master sword). While under the bridge has the same as area, which brings you under the bridge.
 
Special case entrances are 2C and 3C (these are in the forest), which always play forest music when exited regardless of everything set. And the entrance 39 (the cave entrance in kakariko), which plays town music regardless. These 3 are special, since in music part1 they are forest/town, but in music part2,3 they change to overworld music.
 
EDIT
Tested some more. The code automatically bring all the special Village entrances to normal (they react on the table). Only 2 forest entrances 2C and 3C will react on no-master sword. So they will become compatible with the table only if the master sword is present, otherwise they will play forest music when exited regardless.

It also seems like area 80 (which is at block 81 in the table) will only play in the short amount of time when the master sword is pulled, once you leave the screen it is compatible to area 00 again.


Last edited by Puzzledude on Tue 30 Jul 2013 - 14:44; edited 1 time in total
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 14:37

Great Smile

Regarding area 80, it just takes the music from area 00 regardless. I've set all to town, but only area 00 to forest, then area 00 had forest music, but also area 80 (master sword). While under the bridge has the same as area, which brings you under the bridge.
Really strange I traced:
pc 01/4468: A9 02      LDA #$02 (after master sword draw) to play overworld and
pc $01:4485 A9 05       LDA #$05 (before master sword draw) to play forest
normally you need to set your value here e.g., a9 07 (lda #$07) for kakariko but didn't help when I tested now... ah well it's one screen.

Special case entrances are 2C and 3C (these are in the forest), which always play forest music when exited regardless of everything set. And the entrance 39 (the cave entrance in kakariko), which plays town music regardless. These 3 are special, since in music part1 they are forest/town, but in music part2,3 they change to overworld music.
I was testing cave/kakariko and it played forest. Couldn't test the other in the forest because you set everything to forest. But doesn't matter, is the patch regardless these caves ok as it is, or are further adjustments needed for your project?

Edit:
Tested some more. If the new code is applied, entrance 2C and 3C will play forest in music part1 regardless, but once the master sword is pulled and later, it will become compatible with the table. I guess 3C and 2C react on master sword.
Maybe the given addresses above at pc 01/4468: A9 02 and pc $01:4485 A9 05 are responsible?
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Tue 30 Jul 2013 - 14:53

Quote
Is the patch regardless these caves ok as it is, or are further adjustments needed for your project?
 
This patch is now final. Nothing else is needed. I have 2C and 3C in the forest (the only logical thing to do anyway), so default and special match, while I've removed the area 80, so master sword is in GoT in area 00 (small area), which is a debug altogether.
 
Zora is not possible in GoT, since no area 0F, to make the transit. The other thing about Zora and master sword area is, that is accepts only sprites and can only have 1 entrance and 1 exit. I have the Zora king in a normal area also.
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 15:02

yay! FTW Smile Smile Smile
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Tue 30 Jul 2013 - 15:13

I will make the final version (hex, asm, etc) of Music patch and Moving Sprites patch shortly.
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 15:28

ok, you can post it below in the single hacks section if you like.
But it could get difficult to explain the thing with the tables and so forth... maybe people who want to implement different music must come back to you or me.
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Tue 30 Jul 2013 - 16:32

Yeah, I guess.
 
By the way this:
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 is a very smart solution. Smile
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 17:35

More or less, the native code where I hijacked is 9c 2c 01, which stores a 00 to $012c. It isn't necceassary to store it to 00 but it's always the best to restore the native values.
You see, the screen number is stored to 2 addresses $040a and $008a. 040a saves the latest overworld screen number you were, and keep it even when you're in a dungeon. $008a saves also the screen number but in contrast to 040a it will always set to 00 as soon as enter a cave/dungeon, so I used this ram address. The code compares now $008a if it is 00, if it is 00 you are inside a cave. But... you can also be in overworld area 00 (lost woods, top left=, and the value is 00 as well!
Therefore I made the double-check with 008c! This address will also set to 00 when you enter a dungeon/cave. So even if you are in overworld screen 00, 008c has a value greater than 00. However it will be 00 in Master Sword area, while 008a here gets the screen number 80. A double check is therefore needed!

So the code checks first if 008c is 00 if yes, check also if 0008a is 00 if yes (both values equal 00), you are definitively in a dungeon/cave and you need to return to the game.
If one of these differs from 00 you are definitively on the overworld, so run the next code to finally load the new music theme (bne 0b bytes, or respectively bne 04 bytes - you need to count), to branch over the 9c 2c 01 6b.
BNE = Branch if Not Equal, so you are e.g. in screen 4c and I compare with 00 it is not equal, so branch.
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Tue 30 Jul 2013 - 21:22

As for your bug with the lost woods: this one is really strange: I had it once that the overworld was played, but all times later it was (as correctly) lost woods. I traced it (but only one time since I couldn't reproduce any time later) and I think it was $0131 but I am not sure.

You can try following at
pc 11/a25f: 6b
write instead
pc 11/a25f: 8d 30 01 8d 31 01 8d 33 01 6b
This will also store the theme value also to $0130, $0131 and $0133  and should fix this issue! (It makes nothing if you store it also to $0130 and $0133 - it's more to be on the safe side since these will also set to the current theme some time later).

Edit:
if this doesn't help try to hardcode it with following:
pc: 01/043e: a2 05 (before sword draw)
pc: 01/0448: a2 02 (ldx overworld theme after sword draw)
change both to your desired theme (e.g. a2 07) for kakariko)

Same for kakariko cave
01/0418: a2 07 load village theme (before agahnim)
01/0422: a2 02 Load overworld theme (after agahnim)
change both to your desired theme (e.g. a2 05) for lost woods.


As for the zophar domain and master sword area not able to change music... there seems to be a weird code to disable the table. It makes sense since the area you are in always has priority. Otherwise you'd have overworld music in the triforce shrine, so Nintendo simply disabled this I guess and you get always the music from the screen area you are in (triforce shrine, rain layer) or come from (master sword, zophar).
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Puzzledude Wed 31 Jul 2013 - 7:27

pc: 01/043e: a2 05 (before sword draw)
 
This was needed to control the music of entrances 2C and 3C before sword draw Very Happy , all the rest is actually covered with the table itself. The village special caves for some reason follow the table normally and will not reset to village music (2 houses and 2 caves = 4 special entrances which reset to village music in Alttp, but are covered by the new table automatically to play custom music).
 
In new testing I've set all light world to 0D = dark world music, then tested the standard caves (covered), special village caves (covered in all music parts), but 2C and 3C (covered only after M. sword is out).
 
But 01/043e controls these 2 caves before the pull (default is 05).
 
These two forest caves would probably also be covered, if not for the special check for master sword2 and the event check if it was pulled.
 
This code now really is fledged to the final state. Smile 
So much work just to play the correct tune.
Puzzledude
Puzzledude

Just wanted to say hi :) - Page 2 Image213

Since : 2012-06-20

Back to top Go down

Just wanted to say hi :) - Page 2 Empty Re: Just wanted to say hi :)

Post by Conn Wed 31 Jul 2013 - 9:43

Perfect! 8) 

So much work just to play the correct tune.
Well, I opened a new thread how to insert your own midi music... Guess this was peanuts in comparison :lol!:

http://zeldix.forumotion.com/t154-the-music-tinkering-thread

I really can't do this on my own, so I posted my theory and research.
Somebody is needed to convert excel sheets and add the music I guess Smile
Conn
Conn

Just wanted to say hi :) - Page 2 Image212

Since : 2013-06-30

Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top


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