Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when loading Digital Devil Story: Megami Tensei #4186

Open
LuridSorcerer opened this issue Jan 14, 2025 · 3 comments · May be fixed by TASEmulators/quickerNES#1
Open

Crash when loading Digital Devil Story: Megami Tensei #4186

LuridSorcerer opened this issue Jan 14, 2025 · 3 comments · May be fixed by TASEmulators/quickerNES#1
Labels
Core: QuickNes (Alt.) Nintendo Entertainment System (NES) / Famicom / Famicom Disk System (FDS) core Repro: Affects 2.10 Repro: Regression from 2.9.1 Reproducible bug Should only be added to issues with a `Repro: Affects` label.

Comments

@LuridSorcerer
Copy link

Summary

Bizhawk instantly closes when loading the Famicom game Digital Devil Story: Megami Tensei. This is a ROM I dumped myself using an OSCR, the MD5 hash (99FBA6D02D110914C09A16E13F488CB5) matches a known verified dump in no-intro.org's database.

Repro

  1. Launch BizHawk
  2. File -> Open ROM..., select "Digital Devil Story - Megami Tensei (Japan).nes"

Output

On Windows, no error message is presented. On Linux, the following is logged to the console:

ROM was not a multiple of 1024 bytes, and not a recognized header size: 16. Assume it's purely ROM data.
Game was not in DB. CRC: 682C4603 MD5: 99FBA6D02D110914C09A16E13F488CB5
D012E60C1C706FE60187A9DFA6A3CC5B071A348F
Could not find mapper for code: 12

It is worth noting that the ROM does in fact have a 16-byte iNES header, and is 262160 bytes in size (16 byte header plus 256 * 1024 bytes).

Host env.

  • BizHawk 2.10 on Windows 11 23H2
  • BizHawk 2.10 on antiX Linux (Debian-based)
  • Current dev build dated Jan 7, 2025 exhibits the same behavior

This same ROM works in BizHawk 2.9.1. The emulator shows a green check mark for ROM verification status and shows this output when the check mark is clicked:

Identified from BootGod's database

------
BEGIN NES rom analysis:
Found iNES header:
pr=128,ch=128,wr=8,vr=0,ba=0,pa=1|0,brd=MAPPER076,sys=
Found iNES V2 header:
pr=128,ch=128,wr=0,vr=0,ba=0,pa=1|0,brd=MAPPER0076-00,sys=NES-NTSC
Since this is iNES we can (somewhat) confidently parse PRG/CHR banks to hash.
headerless rom hash: SHA1:F60102AB3B1470ECFBB7FE31FD9392E6B4BFBFBA
headerless rom hash:  MD5:D99BDC0B1E6D146D593E933F74BBE4D3
Could not locate game in bizhawk gamedb
Chose board from nescartdb:
pr=128,ch=128,wr=0,vr=0,ba=0,pa=1|0,brd=NAMCOT-3446,sys=Famicom
Final game detection results:
pr=128,ch=128,wr=0,vr=0,ba=0,pa=1|0,brd=NAMCOT-3446,sys=Famicom
"Megami Tensei: Digital Devil Story"
Implemented by: class Mapper076
END NES rom analysis
------
@YoshiRulz YoshiRulz added Repro: Regression from 2.9.1 Repro: Affects 2.10 Core: QuickNes (Alt.) Nintendo Entertainment System (NES) / Famicom / Famicom Disk System (FDS) core labels Jan 14, 2025
@YoshiRulz
Copy link
Member

Workaround: Change your preference for NES core to NesHawk.

@YoshiRulz YoshiRulz added the Reproducible bug Should only be added to issues with a `Repro: Affects` label. label Jan 14, 2025
@YoshiRulz
Copy link
Member

This checks for an error:

LibQuickNES.ThrowStringError(QN.qn_loadines(Context, file, file.Length));

but the function can only succeed or throw, there's no safe error mechanism:
QN_EXPORT const char *qn_loadines(quickerNES::Emu *e, const void *data, int length)
{
e->load_ines((const uint8_t*)data);
return 0;
}

The failure comes from:
https://github.com/TASEmulators/quickerNES/blob/61ff28710c44b75c170dff1ee8f89831296e34b5/source/quickerNES/core/core.hpp#L149-L157

(The managed-side blocklist is applied on line 60, after the call to qn_loadines.)

@CasualPokePlayer
Copy link
Member

Pre-QuickerNES code actually returned an error here, so this is a QuickerNES regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: QuickNes (Alt.) Nintendo Entertainment System (NES) / Famicom / Famicom Disk System (FDS) core Repro: Affects 2.10 Repro: Regression from 2.9.1 Reproducible bug Should only be added to issues with a `Repro: Affects` label.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants