TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.11k stars 380 forks source link

Code Data Logging (CDL) support in PicoDrive (MD/32X) #2233

Open ehw opened 4 years ago

ehw commented 4 years ago

Currently, Code Data Logging is only supported with GenesisPlusGX, but not PicoDrive. It would be great if PicoDrive had CDL support as well, since it can also emulate 32X games. Having a code/data logger for 32x games would be immensely useful, as it can label data that's accessed by either the 68K, Z80, or the twin SH2 processors, as well as the two VDPs (the Mega Drive's and the 32X's). It would help with creating disassemblies, as data and code can be accurately marked as to what part of the ROM correlates to a specific CPU. Prototype research (or just research for TCRF/rom hacking in general) would greatly benefit from it as well.

zeromus commented 4 years ago

Read the docs on tasvideos.org for the other systems, and then create hypothetical docs in the same style for picodrive. And what game do you plan to study?

ehw commented 4 years ago

Sure, I'll give it a shot. (basing it off of this: http://tasvideos.org/Bizhawk/CodeDataLogger.html)

Since PicoDrive supports MD/SMS, the flags used for GenesisPlusGX can be resused for both systems. Here's what I propose for the 32x:


Sega 32X SRAM may or may not be present. Of course MD Cart will vary in size.

Blocknames: MD Cart, 68k RAM, 32x RAM, Z80 RAM, SRAM

Flags:

Exec68k = 0x01 Data68k = 0x04 ExecZ80First = 0x08 ExecZ80Operand = 0x10 DataZ80 = 0x20 DMASource = 0x40 -- Should be useful for identifying the origin of graphics data on the cart ROM. ExecSH2 = 0x DataSH2 = 0x

Hopefully this is good enough. The blockname could be 32X Cart, but BizHawk already gives this region the name MD Cart in BizHawk's Hex Editor. The 32x RAM block will always be 0x20000 bytes big. I'm not particular on what value is used to represent the particular flag, so I'll leave it up for you to decide. ExecSH2 can represent bytes that are executed by either the slave or master SH2 cpu. DataSH2 represent bytes that are read by either the slave or master SH2. I'm not sure if there are any other generic flags that can be added specifically for the 32x, but since most 32x games do everything in software covering at least the SH2 cpus should be enough.

I'm currently looking into some Knuckles Chaotix prototypes for unused content and for looking for the general locations of where data is stored in the ROM. They've been looked at with whatever was available over a decade a go, but a CDL combined with an extensive playthrough would help find what might've been missed.

zeromus commented 4 years ago

There aren't enough bytes for two 0x**

ehw commented 4 years ago

Ah, I see. I forgot that BizHawk can represent one byte with two flags (like 0x44 for both DMASource and Data68k)...

Maybe just leave out DMASource? Or treat DMASource as Data68k? That way you could make it:

Exec68k = 0x01 Data68k = 0x04 ExecZ80First = 0x08 ExecZ80Operand = 0x10 DataZ80 = 0x20 ExecSH2 = 0x40 DataSH2 = 0x80

Would this work? I'm not sure if other values may work that can allow more than those flags...

zeromus commented 4 years ago

Well, 0x02 wasnt used for anything. It may be better to save it for later if you can get rid of something useless.