From 15b397aed71323e3f6a08d91a490ebca1dfc4087 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Sun, 6 Apr 2025 22:10:48 +0200 Subject: [PATCH] also intercept PWriteB --- PDP11/pdp11_cpu.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index 439fbb85..c5c9e5de 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -281,7 +281,7 @@ typedef struct { struct __mem_writes { int32_t addr; - uint16_t data; + uint8_t data; } *mem_writes; int n_mem_writes = 0; @@ -290,6 +290,24 @@ void init_mem_writes() mem_writes = (struct __mem_writes *)malloc(sizeof(struct __mem_writes) * 256); } +void put_mem_write(uint8_t data, uint32_t pa) +{ + int i = 0; + int found = 0; + for(i=0; i 0xffff) - printf("FAIL %x\n", data); - - for(i=0; i> 8, pa + 1); WrMemW (pa, data); return; @@ -2873,6 +2876,8 @@ return; void PWriteB (int32 data, int32 pa) { if (ADDR_IS_MEM (pa)) { /* memory address? */ + put_mem_write(data, pa); + WrMemB (pa, data); return; }