Posts for ehw

ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
I found a weird crash when the Code Data Logger is enabled and you play a certain sound in the sound test of a prototype of Panorama Cotton ("Panorama Cotton (Japan) (Beta) (1993-11-27)"). Play sound 6F in the sound test (in the option screen) while the Code Data Logger is enabled and the following error will appear:
System.IndexOutOfRangeException: Index was outside the bounds of the array. at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.CDCallbackProc(Int32 addr, CDLog_AddrType addrtype, CDLog_Flags flags) at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.LibGPGX.gpgx_advance() at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.FrameAdvance(Boolean render, Boolean rendersound) at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force) at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop() at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
This error doesn't appear if the Code Data Logger is not activated. I encountered this bug with 1.12.0. Also, a while back I mentioned another weird 'bug' with the CDL for Genesis games where the cdl doesn't seem to identify DAC samples for certain games for some reason. For instance, Golden Axe III doesn't identify the drum set DACs and the character/enemy death DAC samples. You can see for yourself by going into the OPTIONS and play SFX 69 to 74 while CDL is enabled that the only thing that seems to be identified are the pointers to the sample but not the sample itself. I have notes about the sound driver for this game that was written by ValleyBell if you'd like to read more on the game's sound driver: http://pastebin.com/SQaDAYzb This seems affect a lot of samples in Genesis games, like drum samples.
ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
Me again with another bug in the Code Data Logger for Genesis games. The cdl doesn't seem to identify DAC samples for certain games for some reason. This might be the result of an atypical sound driver. For instance, Golden Axe III doesn't identify the drum set DACs and the character/enemy death DAC samples. You can see for yourself by going into the OPTIONS and play SFX 69 to 74 while CDL is enabled that the only thing that seems to be identified are the pointers to the sample but not the sample itself. I have notes about the sound driver for this game that was written by ValleyBell if you'd like to read more on the game's sound driver: http://pastebin.com/SQaDAYzb This was tested with BizHawk 1.11.9 release.
ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
Ack, sorry for the double post. Couldn't edit the previous one because samsara got to it (sorry about that). But it looks like commit https://github.com/TASVideos/BizHawk/commit/111648cf98fe533bbd7a8d5d14afe475bc40878f might be culprit. The feature works fine before this commit.
ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
Here's a bug I seem to be getting with one of the latest commits (55bd2194705c7a1dfa46a5eb30bffc78054fbff7 I think). I don't know the precise commit that caused this problem, but it seems to have been sometime after the commit that fixed the Genesis CDL crashing bug. When I go to open up the Hex Editor while running a Megadrive game, Bizhawk crashes with the following message: MOD EDIT: http://pastebin.com/ec0X4fc0 please pastebin long error messages in the future, thank you. <3 samsara Upon clicking Continue, this error message appears.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: addr
   at BizHawk.Emulation.Common.MemoryDomainIntPtrSwap16.PeekByte(Int64 addr)
   at BizHawk.Client.EmuHawk.HexEditor.MakeValue(Int32 dataSize, Int64 address)
   at BizHawk.Client.EmuHawk.HexEditor.GenerateMemoryViewString(Boolean forWindow)
   at BizHawk.Client.EmuHawk.HexEditor.UpdateValues()
   at BizHawk.Client.EmuHawk.ToolManager.UpdateAfter()
   at BizHawk.Client.EmuHawk.ToolManager.UpdateToolsAfter(Boolean fromLua)
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
Does anyone else have this problem? This seems to occur regardless if CDL is enabled or not.
ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
Thanks for fixing the bug. :P Yep, that's what I meant. BizHawk identifies Z80 data in Z80 RAM understandably, but the actual sound data isn't being identified in the MD CART segment. Sound data seems to usually only be identified in games that use the 68k processor itself to play the sound data. I'm not really great in C#, so I do most of my stuff with Python. I can share the scripts I made for MD and SMS/GG .CDL files. Grab them here (excuse the bad code, never intended to share this so most of it is experimental but it does what it needs to do): http://pastebin.com/vTuFtUJT <- md_cdl2idc.py http://pastebin.com/23VjEGUW <- smsgg_cdl2idc.py The concept is pretty simple. I first start off the idc script with "init_idc", which adds the include and main function necessary for the idc script to work (I also add some lines that create the necessary segments in IDA, but some of this is not necessary). Then it calls "parse_cdl", which calculates the size of the first segment (the "MD CART" segment) by using the size of the CDL file header (which seems to be always fixed) as the start position of the loop and the string of the next segment as my stopper. After getting the size of the MD CART segment, I can just use the size of each segment header and the max size of the RAM segments to go through the other segments. For each segment, I compare each byte of the CDL file with the flags BizHawk uses to denote code/data and depending on what the flag is, adds a "MakeCode" or "MakeData" command in the output file idc script for the current address in the file. When I reach the end of the segment, I move on to the next. When I go through all the segments in the CDL file, I add the closing bracket to the idc output file stream and end the program. I added a counter just to see how many bytes were code/data/z80 etc. There are probably a million different ways that are better, but this was the most obvious one for me personally. Although I'm not sure if the SMSGG one is working correctly due to the fact I hadn't thought about how IDA Pro treats ROM banks. But I know the Megadrive one is working great. EDIT: I tested the new commit and BizHawk is still crashing in the same spots but without an error.
ehw
Other
Experienced Forum User
Joined: 4/22/2016
Posts: 6
Hope this is the right place to put this. I don't see many posts about BizHawk's CDL (Code Data Logger). But I found a few bugs with it, as far as Megadrive games go. All these bugs were caused with version 1.11.6. Certain Megadrive games crash BizHawk when CDL is Active. Here are some games that were giving me problems and the conditions for causing the crashes. Sonic the Hedgehog 3 (U): While in a level, press start to pause the game, then press start again to unpause. This will cause BizHawk to instantly crash with the following message:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.CDCallbackProc(Int32 addr, CDLog_AddrType addrtype, CDLog_Flags flags)
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.LibGPGX.gpgx_advance()
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.FrameAdvance(Boolean render, Boolean rendersound)
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
When CDL is deactivated, BizHawk will not crash if you pause/unpause. Sonic 3D Blast (UE): While in a level, pause and unpause the game with the start button and BizHawk will crash with the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.CDCallbackProc(Int32 addr, CDLog_AddrType addrtype, CDLog_Flags flags)
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.LibGPGX.gpgx_advance()
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.FrameAdvance(Boolean render, Boolean rendersound)
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
(coincidentally, these two games use the same sound driver) Mickey Mania: Activate CDL when the game is launched. As soon as the Title Screen appears and the music begins to play, BizHawk will crash with the following message:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.CDCallbackProc(Int32 addr, CDLog_AddrType addrtype, CDLog_Flags flags)
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.LibGPGX.gpgx_advance()
   at BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX.FrameAdvance(Boolean render, Boolean rendersound)
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)
Some other things about the CDL that I noticed weren't quite right: -Some games use Z80 sound drivers to play music and sound. In the event that they do, the CDL doesn't identify data that's parsed by the Z80 processor. Examples of games that use Z80 sound drivers are Castle of Illusion, World of Illusion, Quackshot, etc. Games that use 68k sound drivers like Sonic 1, Moonwalker, and Streets of Rage parse the sound data with the 68000 and will be identified by BizHawk when CDL is activated. BizHawk should attempt to identify any data that's accessed by the Z80 processor if possible. -The "Disassemble" option doesn't produce a working output for any system. I noticed the code for the feature was marked "TODO" in the source, so hopefully someone gets around to supporting this someday. A great feature would be to export CDL files right to .idc scripts for IDA Pro. I wrote a python script to do this for me, but it'd be a nice BizHawk feature too. -While on the topic of new features, it'd be great if BizHawk could "predict" possible code/data paths or when things are specifically used as offsets or jump tables like Exodus Emulator can.