Mocking up a Sega CD
Posted: Tue Jul 28, 2015 2:04 am
I'm trying to "wire up" a system in Exodus to help with disassembling/analyzing the Sega CD BIOS. For now I'm just wanting to mock up the main parts; I'll worry about accuracy later.
Just to get started, I'm trying to hook up the 4 Mbit PRG-RAM, the two 1 Mbit Word RAM banks, and a fake set of Gate Array "registers" directly to the 68k. I've looked at the Mega Drive configurations that Exodus ships with, and given the current lack of documentation this is what I've got so far:
This doesn't work in Exodus, though - it complains that "ValidateDevice failed for Sub 68000".
Also, I'd like to have a "dumb" ASIC to work with at some point. Again, accuracy is less important to me right now than just having something that acts right. I don't care about the cycle timing, I don't even really need the graphics processing - just something to keep the communication registers synced up and swap RAM banks between the two 68Ks as necessary. I've got a strong programming background, so I'd be fine with coding this up myself. I'm just not sure where to start.
So two questions, I guess. What do I need to get this super-basic version actually running, and how much time/effort am I looking at to implement a really stupid mock-up of the ASIC?
EDIT: I realized I forgot to attach the 68k to its bus. Added this line to the configuration and now it loads correctly in Exodus:
But when I load in a memory snapshot with the sub-CPU program, it doesn't come in right; seems like it's only getting every other byte for some reason. Now I'm curious as to what all the other BusInterface.MapDevice options I'm seeing in the Mega Drive configs (CELineConditions, AddressLineFilter, etc.) do, and what the different InterfaceNumbers are for...
Just to get started, I'm trying to hook up the 4 Mbit PRG-RAM, the two 1 Mbit Word RAM banks, and a fake set of Gate Array "registers" directly to the 68k. I've looked at the Mega Drive configurations that Exodus ships with, and given the current lack of documentation this is what I've got so far:
Code: Select all
<Module xmlns="http://www.exodusemulator.com/Schema/ExodusSchema.xsd" SystemClassName="SegaMegaCD" ModuleClassName="SegaMegaCD" ModuleInstanceName="MCD2" ModuleDisplayName="Mega-CD II" ManufacturerCode="SEGA" ManufacturerDisplayName="Sega" ProductionYear="1993">
<!-- Devices -->
<Device DeviceName="M68000" InstanceName="Sub 68000" />
<Device DeviceName="RAM16Variable" InstanceName="PRG-RAM" MemoryEntryCount="0x40000" />
<Device DeviceName="RAM16Variable" InstanceName="Word RAM 0" MemoryEntryCount="0x10000" />
<Device DeviceName="RAM16Variable" InstanceName="Word RAM 1" MemoryEntryCount="0x10000" />
<!-- "Dummy" devices until I can actually get things in -->
<Device DeviceName="RAM8" InstanceName="Gate Array" MemoryEntryCount="0x200" />
<!-- Clocks -->
<ClockSource Name="CLK12M" ClockType="Direct" InitialValue="12500000" />
<!-- Busses -->
<BusInterface Name="SubCpuBus" AddressBusWidth="20" DataBusWidth="16" />
<!-- Clock Mapping -->
<BusInterface.MapClockSource BusInterfaceName="SubCpuBus" ClockSourceName="CLK12M" DeviceInstanceName="Sub 68000" TargetClockLine="CLK" />
<!-- Device/Bus Mapping -->
<BusInterface.MapDevice BusInterfaceName="SubCpuBus" DeviceInstanceName="PRG-RAM" InterfaceNumber="2" MemoryMapBase="0x0" MemoryMapSize="0x80000" />
<BusInterface.MapDevice BusInterfaceName="SubCpuBus" DeviceInstanceName="Word RAM 0" InterfaceNumber="2" MemoryMapBase="0x80000" MemoryMapSize="0x20000" />
<BusInterface.MapDevice BusInterfaceName="SubCpuBus" DeviceInstanceName="Word RAM 1" InterfaceNumber="2" MemoryMapBase="0xA0000" MemoryMapSize="0x20000" />
<BusInterface.MapDevice BusInterfaceName="SubCpuBus" DeviceInstanceName="Gate Array" InterfaceNumber="1" MemoryMapBase="0xFF8000" MemoryMapSize="0x200" />
</Module>
Also, I'd like to have a "dumb" ASIC to work with at some point. Again, accuracy is less important to me right now than just having something that acts right. I don't care about the cycle timing, I don't even really need the graphics processing - just something to keep the communication registers synced up and swap RAM banks between the two 68Ks as necessary. I've got a strong programming background, so I'd be fine with coding this up myself. I'm just not sure where to start.
So two questions, I guess. What do I need to get this super-basic version actually running, and how much time/effort am I looking at to implement a really stupid mock-up of the ASIC?
EDIT: I realized I forgot to attach the 68k to its bus. Added this line to the configuration and now it loads correctly in Exodus:
Code: Select all
<Device.ReferenceBus DeviceInstanceName="Sub 68000" BusInterfaceName="SubCpuBus" ReferenceName="BusInterface" />