void MemWatcher::Update() { for (int i = 0; i < m_watches.size(); i++) { Watch& watch = m_watches[i]; u32 value = 0; switch (watch.size) { case 1: value = MEM_getByte(watch.address); break; case 2: value = MEM_getWord(watch.address); break; case 4: value = MEM_getLong(watch.address); break; } if (value != watch.cache) { watch.cache = value; watch.callback(watch.address, watch.size, value); } } }
void DecodeCopper(int cpReg,int offs) { u_int32_t copperAddress; int a; if (cpReg==0) copperAddress = CST_GETLNGU(CST_COP1LCH,CUSTOM_CHIP_RAM_MASK); else copperAddress = CST_GETLNGU(CST_COP2LCH,CUSTOM_CHIP_RAM_MASK); DisplayWindow(0,0,14*8+1,31+34); copperAddress+=4*offs; for (a=0;a<32+31;a++) { u_int16_t ins1 = MEM_getWord(copperAddress); u_int16_t ins2 = MEM_getWord(copperAddress+2); if (ins1&0x0001) { if (ins2&0x0001) { // Skip PrintAt(0x0F,0xFF,1, a+1, "%08X Skip : %04X:%04X\n",copperAddress,ins1,ins2); } else { // Wait u_int8_t maskv=0x80|((ins2>>8)&0x7F); u_int8_t maskh=(ins2&0xFE); u_int8_t vpos=ins1>>8; u_int8_t hpos=ins1&0xFE; PrintAt(0x0F,0xFF,1, a+1, "%08X Wait : %04X:%04X\n -- VPOS&%02X >= %02X -- HPOS&%02X >= %02X",copperAddress,ins1,ins2,maskv,vpos,maskh,hpos); } } else { // Move PrintAt(0x0F,0xFF,1, a+1, "%08X Move : %04X:%04X = %04X -> %08X (%s)\n",copperAddress,ins1,ins2,ins2,0xDFF000 + (ins1&0x01FE),MEM_GetHardwareName((ins1&0x01FE)/2)); } copperAddress+=4; }
u_int32_t GetOpcodeLength(u_int32_t address) { u_int16_t opcode; u_int16_t operands[8]; u_int32_t insCount; int32_t a; opcode = MEM_getWord(address); if (CPU_Information[opcode]) { for (a=0;a<CPU_Information[opcode]->numOperands;a++) { operands[a] = (opcode & CPU_Information[opcode]->operandMask[a]) >> CPU_Information[opcode]->operandShift[a]; } } insCount=CPU_DisTable[opcode](address+2,operands[0],operands[1],operands[2], operands[3],operands[4],operands[5],operands[6],operands[7]); return insCount; }