From 260ac09c01a8390fcd16a721b70d752b2791ea94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Wed, 28 Mar 2018 13:46:06 +0200 Subject: [PATCH] Emulate zero page wrap for zp,x addressing. --- src/instruction.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/instruction.c b/src/instruction.c index 8554062..4ee12da 100644 --- a/src/instruction.c +++ b/src/instruction.c @@ -283,8 +283,7 @@ instruction_data_write_1(rk65c02emu_t *e, instrdef_t *id, instruction_t *i, uint bus_write_1(e->bus, i->op1, val); break; case ZPX: - /* XXX: wraps around zero page? */ - bus_write_1(e->bus, i->op1 + e->regs.X, val); + bus_write_1(e->bus, (uint8_t) (i->op1 + e->regs.X), val); break; case ZPY: bus_write_1(e->bus, i->op1 + e->regs.Y, val);