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

GBHawk + CDL crashes on Cart RAM access #3497

Closed
StanHash opened this issue Dec 18, 2022 · 0 comments
Closed

GBHawk + CDL crashes on Cart RAM access #3497

StanHash opened this issue Dec 18, 2022 · 0 comments

Comments

@StanHash
Copy link

Summary

BizHawk crashes on GBHawk when the game accesses Cart RAM with Code Data Logger (CDL) tool active.

Repro

  1. Open Final Fantasy Legend, The (USA) (My hypothesis is that this is an issue with any GB game that writes to cart SRAM, but this is the one I tested on). Make sure you are using the GBHawk core.
  2. Open CDL tool, make sure Active is checked.
  3. Play for a bit until the game accesses cart RAM (typically: save/load). Alternatively, play a movie (this is how I encountered this in the first place).

Output

System.Collections.Generic.KeyNotFoundException
  HResult=0x80131577
  Message=The given key was not present in the dictionary.
  Source=mscorlib
  StackTrace:
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.GBHawk.SetCDL(eCDLogMemFlags flags, String type, Int32 cdladdr) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\GBHawk.ICodeDataLog.cs:line 42
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.MapperBase.SetCDLRAM(eCDLogMemFlags flags, Int32 cdladdr) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\Mappers\MapperBase.cs:line 69
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.MapperMBC2.MapCDL(UInt16 addr, eCDLogMemFlags flags) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\Mappers\Mapper_MBC2.cs:line 64
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.GBHawk.CDLCpuCallback(UInt16 addr, eCDLogMemFlags flags) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\GBHawk.ICodeDataLog.cs:line 137
   at BizHawk.Emulation.Cores.Components.LR35902.LR35902.Read_Func(UInt16 dest, UInt16 src_l, UInt16 src_h) in [...]\BizHawk.Emulation.Cores\CPUs\LR35902\Operations.cs:line 19
   at BizHawk.Emulation.Cores.Components.LR35902.LR35902.ExecuteOne(Boolean useRGBDSSyntax) in [...]\BizHawk.Emulation.Cores\CPUs\LR35902\LR35902.cs:line 184
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.GBHawk.do_frame(IController controller) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\GBHawk.IEmulator.cs:line 134
   at BizHawk.Emulation.Cores.Nintendo.GBHawk.GBHawk.FrameAdvance(IController controller, Boolean render, Boolean rendersound) in [...]\BizHawk.Emulation.Cores\Consoles\Nintendo\GBHawk\GBHawk.IEmulator.cs:line 66
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force) in [...]\BizHawk.Client.EmuHawk\MainForm.cs:line 3163
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop() in [...]\BizHawk.Client.EmuHawk\MainForm.cs:line 805
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args) in [...]\BizHawk.Client.EmuHawk\Program.cs:line 292
   at BizHawk.Client.EmuHawk.Program.Main(String[] args) in [...]\BizHawk.Client.EmuHawk\Program.cs:line 97

Host env.

  • BizHawk 2.8; Win10 Pro 21H2; Intel/NVIDIA
  • BizHawk dev build at 837592c; Win10 Pro 21H2; Intel/NVIDIA
  • BizHawk built off latest git as of writing; Win10 Pro 21H2; Intel/NVIDIA

I managed to fix this locally by changing "Cart RAM" to "CartRAM" at line 27 of GBHawk.ICodeDataLogger.cs. There might not be much more to it than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants