void y8950GetDebugInfo(Y8950* y8950, DbgDevice* dbgDevice) { DbgRegisterBank* regBank; // Add YM2413 registers int c = 1; int r; for (r = 0; r < sizeof(regsAvailAY8950); r++) { c += regsAvailAY8950[r]; } regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsAy8950(), c); c = 0; dbgRegisterBankAddRegister(regBank, c++, "SR", 8, (UInt8)OPLRead(y8950->opl, 0)); for (r = 0; r < sizeof(regsAvailAY8950); r++) { if (regsAvailAY8950[r]) { dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, y8950->opl->regs[r]); } } dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemAy8950(), 0, 0, y8950->opl->deltat->memory_size, (UInt8*)y8950->opl->deltat->memory); }
static void getDebugInfo(R800Debug* dbg, DbgDevice* dbgDevice) { static UInt8 mappedRAM[0x10000]; DbgRegisterBank* regBank; int freqAdjust; int i; for (i = 0; i < 0x10000; i++) { mappedRAM[i] = slotPeek(NULL, i); } dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemVisible(), 0, 0, 0x10000, mappedRAM); if (dbg->r800->callstackSize > 255) { static UInt16 callstack[0x100]; int beginning = dbg->r800->callstackSize & 0xff; int reminder = 256 - beginning; memcpy(callstack, dbg->r800->callstack + beginning, reminder * sizeof(UInt16)); memcpy(callstack + reminder, dbg->r800->callstack, beginning * sizeof(UInt16)); dbgDeviceAddCallstack(dbgDevice, langDbgCallstack(), callstack, 256); } else { dbgDeviceAddCallstack(dbgDevice, langDbgCallstack(), dbg->r800->callstack, dbg->r800->callstackSize); } regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsCpu(), 20); dbgRegisterBankAddRegister(regBank, 0, "AF", 16, dbg->r800->regs.AF.W); dbgRegisterBankAddRegister(regBank, 1, "BC", 16, dbg->r800->regs.BC.W); dbgRegisterBankAddRegister(regBank, 2, "DE", 16, dbg->r800->regs.DE.W); dbgRegisterBankAddRegister(regBank, 3, "HL", 16, dbg->r800->regs.HL.W); dbgRegisterBankAddRegister(regBank, 4, "AF1", 16, dbg->r800->regs.AF1.W); dbgRegisterBankAddRegister(regBank, 5, "BC1", 16, dbg->r800->regs.BC1.W); dbgRegisterBankAddRegister(regBank, 6, "DE1", 16, dbg->r800->regs.DE1.W); dbgRegisterBankAddRegister(regBank, 7, "HL1", 16, dbg->r800->regs.HL1.W); dbgRegisterBankAddRegister(regBank, 8, "IX", 16, dbg->r800->regs.IX.W); dbgRegisterBankAddRegister(regBank, 9, "IY", 16, dbg->r800->regs.IY.W); dbgRegisterBankAddRegister(regBank, 10, "SP", 16, dbg->r800->regs.SP.W); dbgRegisterBankAddRegister(regBank, 11, "PC", 16, dbg->r800->regs.PC.W); dbgRegisterBankAddRegister(regBank, 12, "I", 8, dbg->r800->regs.I); dbgRegisterBankAddRegister(regBank, 13, "R", 8, dbg->r800->regs.R); dbgRegisterBankAddRegister(regBank, 14, "IM", 8, dbg->r800->regs.im); dbgRegisterBankAddRegister(regBank, 15, "IFF1",8, dbg->r800->regs.iff1); dbgRegisterBankAddRegister(regBank, 16, "IFF2",8, dbg->r800->regs.iff2); switch (dbg->r800->cpuMode) { default: case CPU_Z80: freqAdjust = R800_MASTER_FREQUENCY / (dbg->r800->frequencyZ80 - 1); break; case CPU_R800: freqAdjust = R800_MASTER_FREQUENCY / (dbg->r800->frequencyR800 - 1); break; } dbgRegisterBankAddRegister(regBank, 17, "CLKH",16, (UInt16)(dbg->r800->systemTime / freqAdjust / 0x10000)); dbgRegisterBankAddRegister(regBank, 18, "CLKL",16, (UInt16)(dbg->r800->systemTime / freqAdjust)); dbgRegisterBankAddRegister(regBank, 19, "CNT",16, (UInt16)dbg->r800->instCnt); }
void moonsoundGetDebugInfo(Moonsound* moonsound, DbgDevice* dbgDevice) { UInt32 systemTime = boardSystemTime(); DbgRegisterBank* regBank; int r; // Add YMF262 registers int c = 1; for (r = 0; r < sizeof(regsAvailYMF262); r++) { c += regsAvailYMF262[r]; } regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsYmf262(), c); c = 0; dbgRegisterBankAddRegister(regBank, c++, "SR", 8, moonsound->ymf262->peekStatus()); for (r = 0; r < sizeof(regsAvailYMF262); r++) { if (regsAvailYMF262[r]) { if (r <= 8) { dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf262->peekReg(r|0x100)); } else { dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf262->peekReg(r)); } } } // Add YMF278 registers c = 1 + 7 + 2 + 10 * 10; regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsYmf278(), c); c = 0; dbgRegisterBankAddRegister(regBank, c++, "SR", 8, moonsound->ymf278->peekStatus(systemTime)); r=0x00; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x01; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x02; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x03; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x04; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x05; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0x06; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0xf8; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); r=0xf9; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { int r = 8 + i * 24 + j; dbgRegisterBankAddRegister(regBank, c++, slotRegText(i,j), 8, moonsound->ymf278->peekRegOPL4(r, systemTime)); } } dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemYmf278(), 0, 0, moonsound->ymf278->getRamSize(), (UInt8*)moonsound->ymf278->getRam()); }
static void getDebugInfo(RomMapperOpcodeMegaRam* rm, DbgDevice* dbgDevice) { DbgIoPorts* ioPorts; ioPorts = dbgDeviceAddIoPorts(dbgDevice, "MEGARAM", 4); dbgIoPortsAddPort(ioPorts, 0, 0x48, DBG_IO_READWRITE, peek(rm, 0x48)); dbgIoPortsAddPort(ioPorts, 1, 0x49, DBG_IO_READWRITE, peek(rm, 0x49)); dbgIoPortsAddPort(ioPorts, 2, 0x4a, DBG_IO_READWRITE, peek(rm, 0x4a)); dbgIoPortsAddPort(ioPorts, 3, 0x4b, DBG_IO_READWRITE, peek(rm, 0x4b)); dbgDeviceAddMemoryBlock(dbgDevice, "Mega Ram", 0, 0, sizeof(rm->megaRam), rm->megaRam); }
static void getDebugInfo(Ram1kBMirrored* rm, DbgDevice* dbgDevice) { dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemRamNormal(), 0, 0, rm->mask + 1, rm->ramData); }
static void getDebugInfo(RamNormal* rm, DbgDevice* dbgDevice) { dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemRamNormal(), 0, 0, rm->pages * 0x2000, rm->ramData); }
static void getDebugInfo(RomMapperOpcodeSaveRam* rm, DbgDevice* dbgDevice) { dbgDeviceAddMemoryBlock(dbgDevice, "Save Ram", 0, 0, sizeof(rm->saveRam), rm->saveRam); }