jojobear13 / shinpokered

Mostly-vanilla hack of Pokémon Red/Blue focused on bugfixes and trainer ai
215 stars 42 forks source link

Bug: Music not changing after start screen, a battle or using the Pokemon Center #344

Open wandering-souru opened 2 months ago

wandering-souru commented 2 months ago

What emulator and/or hardware are you are using? As is relevant, please give the name and/or model number along with the software/firmware version. If possible, include the PCB revision for any hardware. I am using the gameyob emulator that comes in TWiLight Menu++ on my Nintendo 3DS, however I tried testing a little in VisualBoyAdvanceM-2.1.6 and the bug was still there (it even gives me a screen telling me as follows: image

Which patch are you using? I am using the japanese Pokemon Red 1.24.3M version, at least that's what the rom says in the start screen. I don't know exactly when it was released, but the creation date on my rom file says it was made in January 28 of this year.

What ROM base are you using? I'm not really sure if I get what this is referring to, but as I said, I'm using the Japanese Shin patch for Pokemon Red (USA). I used a site to generate the MD5 hash, so I guess it's this one: 259ea1f3282bab5b915a0eaeeaf782ac.

How are you utilizing the patch? I'm using gameyob on TWiLightMenu++ to emulate it and that's it.

What version of this project are you using? 1.24.3M version.

What is the problem you encountered? This is a problem particular to my save, since it does not affect any new game I open for testing. When continuing in my playthrough, the start music will not change until I walk into another area in the overworld (entering a Pokemon Center will not change the music unless I heal my Pokemon there, which in turn will lock the Pokemon Center theme in the overworld) or after a battle, which then will cause that theme (battle victory theme when if it's after a battle) to accompany the overworld. There have been cases where using the PC will cause all the music to stop, leaving only the sound effects like walking against a wall or opening the menu, however music comes back again if you walk to another area. I noticed this problem around the time I beat the Elite 4.

SAV file or Save States rom and save file.zip

Please, if you could help me with this I would be very grateful.

jojobear13 commented 2 months ago

Found the cause of the issue. WRAM address D733 has bit 1 incorrectly set.

image

You can use the gameshark code 010033d7 to fix it. Just toggle the code on then off again and save the game. Alternately I changed the ram value in my debugger and attached the fixed save file to this comment.

Shin Pocket Monsters - Red Version.zip

I'm going to leave this issue open for a bit and try to find out how this bit got stuck.

jojobear13 commented 2 months ago

Figured out what went wrong. That bit flag that prevents the music from changing? It only gets set in a select few places. The most common one is that it gets set when the battle engine detects that you're fighting the Rival3 trainer class (the champion rival) so that the victory music keeps playing as the rival laments his loss.

The problem here is that you can fight Rival3 in other ways like the SS Anne tournament or the random battle trainer. The battle engine automatically assumes you're at the final boss, so that bit gets set but there is nothing to clear it.

This problem was fixed in a more recent version of Shin Pokered. Please update to 1.24.5. Your save will still work fine.