# HG changeset patch # User Michael Pavone # Date 1752714081 25200 # Node ID f817aedf5e53062c8b194fe1aa4b70cf6401359f # Parent 8ce5d1a7ef540113b3c7f5a7e92a31d2365aafd1 Fix base address mode calculation diff -r 8ce5d1a7ef54 -r f817aedf5e53 upd78k2.cpu --- a/upd78k2.cpu Wed Jul 16 12:32:28 2025 -0700 +++ b/upd78k2.cpu Wed Jul 16 18:01:21 2025 -0700 @@ -559,20 +559,21 @@ arg regpair 8 local tmp 16 upd78k2_op_fetch + adst = scratch1 & 0xFF switch regpair case 0 #[de+byte] tmp = d << 8 tmp |= e - adst += tmp + add tmp adst adst 1 case 1 #[sp+byte] - adst += sp + add sp adst adst 1 case 2 #[hl+byte] tmp = h << 8 tmp |= l - adst += tmp + add tmp adst adst 1 end read_base_mode