Thursday, February 25, 2016

An ugly hack but it seems to work for wpdata watchpoint reads


So I added this to device_debug::watchpoint_check()


if (type & WATCHPOINT_READ)
global->wpdata = debug_read_memory(space,address,1,false);
//UINT64 debug_read_memory(address_space &space, offs_t address, int size, int apply_translation)



I'm not sure what the values should be to properly pass to debug_read_memory but this seems to work for my purposes.

It's an ugly hack to be sure...


WP 9800,200,r,1,{tracelog " READ addr=%x data=%x \n", wpaddr,wpdata;g}
WP 9800,200,w,1,{tracelog " WRITE addr=%x data=%x \n", wpaddr,wpdata;g}
trace >>mytrace3.txt,0,{tracelog "A=%02X EA=%04X HL=%04X DE=%04X BC=%04X SKIP=%1X 9937=%02X | ",a,ea,hl,de,bc,(psw&0x20)!=0,pb@9937}


gives me this trace:

A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7AC4: ONIW VV:0F,$18
READ addr=980F data=80
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7AC7: RET
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7A2B: CALL $7A99
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7A99: OFFIW VV:0F,$69
READ addr=980F data=80
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=1 9937=76 | 7A9C: RET
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7A9D: CALL $7B1D
A=20 EA=0FFE HL=7CAC DE=0000 BC=00C7 SKIP=0 9937=76 | 7B1D: LXI HL,$9949
A=20 EA=0FFE HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 7B20: CALT ($00BE)
A=20 EA=0FFE HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 0041: LDEAX (HL)
READ addr=9949 data=38
READ addr=994A data=0
A=20 EA=0038 HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 0043: DCX EA
A=20 EA=0037 HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 0044: STEAX (HL)
WRITE addr=9949 data=37
WRITE addr=994A data=0
A=20 EA=0037 HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 0046: RET
A=20 EA=0037 HL=9949 DE=0000 BC=00C7 SKIP=0 9937=76 | 7B21: BIT 7,VV:00
READ addr=9800 data=5

that looks much better.

No comments:

Post a Comment