Closed TakuikaNinja closed 1 year ago
See if PR satisfies this requirement....
Awesome, but it might be worth checking the games which use the Sound RAM as a crude form of WRAM or SRAM. (Battle Fleet, Famista '90, Kaijuu Monogatari, Mindseeker)
it should not be necessary in this case, since audio ram init starts before Mesen-X' LoadBattery function, which treats _internalRAM as a battery save if battery flag is enabled.
update us if it indeed causes problems.
ok i do see the issue now. if rom has battery and ram init is not zero, then this will be saved as "saved data" which is suppose to be not.
re-adjusted and sent PR, which is crude (im not well familiar with C++ and object thingies) and ugly but should still work. Basically leave ram initialized with 00 when battery flag is enabled, else reinit ram based on ram initialization settings.
@TakuikaNinja let us know if this works now
I just made a save in both the current repo & latest stable versions at the earliest point I could in Kaijuu Monogatari. The save file data is identical. :+1:
After discovering that "Erika to Satoru no Yume Bouken" uses uninitialised N163 Sound RAM as wavetable data, I have been testing the Sound RAM initialisation in various emulators. The test ROM I am using and the spreadsheet of the results can be found in this NESdev forum thread: https://forums.nesdev.org/viewtopic.php?t=24349 Mesen and Mesen-X appear to always initialise the Sound RAM with zeroes regardless of the option chosen as the RAM initialisation option. This is (of course) inaccurate to real hardware, and caused a massive headache when debugging the patch I was making for this game. I was only able to verify the patch because FCEUX correctly initialises the Sound RAM based on the RAM initialisation setting.
Current Mesen-X behaviour (RAM init = random values):![n163_soundram_init_000](https://user-images.githubusercontent.com/43363447/211504808-ece366f0-68e2-46ee-a835-a9eb9278fa1d.png)
Correct behaviour (FCEUX, RAM init = random values):![n163_soundram_init-0](https://user-images.githubusercontent.com/43363447/211504512-fb0f63b8-5798-44c7-b259-284f90fe7e23.png)