BizHawk
BizHawk copied to clipboard
Playing Sega CD data track leads to BizHawk crash
Remember the bug in Sega CD BIOS that causes out of bounds data to be read and interpreted as audio? This is done by playing track 02, then using Search to rewind the track into 01. You will then hear ear-deafening noises. What's weird is that these noises do not appear in upstream, but I have no idea if this happens on hardware. However, towards the end of the data track (around 12:14), BizHawk crashes with System.InvalidOperationException. Either a waterbox issue, audio processing issue or FFMPEG issue.
System.InvalidOperationException: Unsupported scenario: reading 2048 bytes from an unhandled sector type
w BizHawk.Emulation.DiscSystem.DiscSectorReader.ReadLBA_2048(Int32 lba, Byte[] buffer, Int32 offset)
w BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.CDRead(Int32 lba, IntPtr dest, Boolean audio)
w Bizhawk.BizInvokeProxyLibGPGX.gpgx_advance()
w BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.FrameAdvance(IController controller, Boolean render, Boolean renderSound)
w BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
w BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
w BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
BizHawk crashes somewhere around here.
Tested in BizHawk 2.7 It seems that 2.3.2 bypasses BizHawk's crash handler.
To actually fix this we'd need to know what the real hardware does in these scenarios. Maybe we should just ignore the exception here.
It seems that 2.3.2 bypasses BizHawk's crash handler.
Yes, this is known and was fixed in later versions.
We should ignore this exception here. The upstream uses CD decoding method that differs from BizHawk.
Yeah, no guarantee it's doing the right thing either though.
Although we can fix the crash, we cannot change the CD decoding system as this will break other CD cores.
This was probably fixed already by the GPGX core update (which changed CD handling to always do 2352 byte sector reads for both data and audio)