summaryrefslogtreecommitdiff
path: root/sms.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-01-03 20:42:15 -0800
committerMichael Pavone <pavone@retrodev.com>2017-01-03 20:42:15 -0800
commitc562554ca59360448c10c6e3e9444d35dd464e47 (patch)
tree6738bea3e904884aeb6ee249e347f60c756ae716 /sms.c
parentdd774975c0ba188b8d18d97e931a625f4e491f21 (diff)
Fix handling of IO control writes in SMS mode
Diffstat (limited to 'sms.c')
-rw-r--r--sms.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sms.c b/sms.c
index cb1805b..e9fff74 100644
--- a/sms.c
+++ b/sms.c
@@ -12,8 +12,8 @@ static void *memory_io_write(uint32_t location, void *vcontext, uint8_t value)
z80_context *z80 = vcontext;
sms_context *sms = z80->system;
if (location & 1) {
- sms->io.ports[0].control = ~(value << 5 & 0x60);
- sms->io.ports[1].control = ~(value << 3 & 0x60);
+ sms->io.ports[0].control = (~value) << 5 & 0x60;
+ sms->io.ports[1].control = (~value) << 3 & 0x60;
io_data_write(sms->io.ports, value << 1, z80->current_cycle);
io_data_write(sms->io.ports + 1, value >> 1, z80->current_cycle);
} else {