matbo87 / snes9x_3ds

SNES9x Port for 3DS / 2DS
30 stars 4 forks source link

ARM11 data abort on loading menu #2

Closed Anonymous941 closed 1 year ago

Anonymous941 commented 1 year ago

This is a test on abb7daa, hand-compiled by me and ran on my O2DS with Luma CFW.

Chrono Trigger and EarthBound boot, and sound and controls work. On the bottom screen, "Failed to load image sdmc:/.../game.png" is visible.

The reason that I didn't test these games beyond the title screen is because when I tap on the bottom screen to enter the menu, I get an ARM11 data abort. I've tried a few times on both games, and this happens with both games. Here is the crash dump.

This doesn't happen when I run the original bubble2k16 or Xeddius-Network (the one I'm currently using until this works) fork.

Also, thanks for making this fork! I'm excited to have better SNES emulation on my O2DS. :)

matbo87 commented 1 year ago

I'm late, i know :) I wasn't able to reproduce these crashes. Let me know, if this is still happening with the latest release (v1.50).

Anonymous941 commented 1 year ago

I'm late, i know :)

No worries! The other fork works in the meantime.

I wasn't able to reproduce these crashes. Let me know, if this is still happening with the latest release (v1.50).

Unfortunately yes, it's still happening, even when I rename 3ds/snes9x_3ds and the other SNES9x configuration files I could find: crash_dump_00000007.dmp.txt. Maybe it has something to do with my being an Old 2DS?

matbo87 commented 1 year ago

Yes, O2DS (and O3DS) might behave differently. I can only test on New2ds and new3ds here, so it makes it more difficult for me, to debug the actual problem. When you tap on the bottom screen the emulator saves the SRAM if necessary. You can try one of the following:

Anonymous941 commented 1 year ago

Uncomment this line for testing.

This worked, the culprit is line 991:

Memory.SaveSRAM (path.c_str());

Auto saving SRAM with either line commented out was working regardless.

if you haven't tried it already: hand-compile the Xeddius-Network version (v1.45) and check if the emulator doesn't crash. If its also crashing, it's probably due to newer libctru version I guess?

Still want me to do this?

matbo87 commented 1 year ago

if you comment out Memory.SaveSRAM (path.c_str()); no srm file should be created in saves directory as far as i know. Or did you mix it up with the "Automatically save state on exit..." option?

If line 991 caused the crash, it might be an invalid pointer. I'm still not sure, why this is no issue at all on my devices. Maybe file3dsGetAssociatedFilename(...) causes it. I will have a look at it.

You don't need to hand-compile the other version. But you could execute other saving-tasks like screenshot, applying cheats, save states, etc. - all these tasks make use of file3dsAssociatedFilename()

Anonymous941 commented 1 year ago

if you comment out Memory.SaveSRAM (path.c_str()); no srm file should be created in saves directory as far as i know. Or did you mix it up with the "Automatically save state on exit..." option?

What I meant is that in S9xAutoSaveSRAM, commenting out Memory.SaveSRAM (path.c_str()); stopped the segmentation fault from happening

You don't need to hand-compile the other version. But you could execute other saving-tasks like screenshot, applying cheats, save states, etc. - all these tasks make use of file3dsAssociatedFilename()

I've tried save states, and nothing I did caused the segmentation fault. Commenting out that line seemed to make this work, although obviously without save data

matbo87 commented 1 year ago

I've pushed some changes on a bugfixing branch. This may solve the crashes on your O2DS. best case: 02788b already works for you. If it doesn't crash, please also check, if the game related SRAM file has been created. If it still crashes or no SRAM file has been created, you can try 0e822f. Looking forward to your feedback.

Anonymous941 commented 1 year ago

02788b works, and the SRM file has been created. Thanks for your help!

Anonymous941 commented 1 year ago

Let me know if you want further testing to narrow down the error, I'd be happy to help

matbo87 commented 1 year ago

Let me know if you want further testing to narrow down the error, I'd be happy to help

I'll appreciate it. Just let me know if you find any other bugs. Current fix is already part of nightly build and will be included in upcoming release.