From 9b2bb72213621cd3b664f648a72fae9cb764cb27 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 29 May 2017 18:25:11 -0700 Subject: Update SMS code for changes supporting slow rise time emulation in IO code --- io.c | 1 + sms.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/io.c b/io.c index 64b5424..1fd6b12 100644 --- a/io.c +++ b/io.c @@ -1841,6 +1841,7 @@ uint8_t io_data_read(io_port * port, uint32_t current_cycle) { case IO_GAMEPAD2: input = ~port->input[GAMEPAD_TH1]; + device_driven = 0x3F; break; case IO_GAMEPAD3: { diff --git a/sms.c b/sms.c index 1ba6902..fdfe31d 100644 --- a/sms.c +++ b/sms.c @@ -13,9 +13,9 @@ static void *memory_io_write(uint32_t location, void *vcontext, uint8_t value) sms_context *sms = z80->system; if (location & 1) { uint8_t fuzzy_ctrl_0 = sms->io.ports[0].control, fuzzy_ctrl_1 = sms->io.ports[1].control; - sms->io.ports[0].control = (~value) << 5 & 0x60; + io_control_write(sms->io.ports, (~value) << 5 & 0x60, z80->current_cycle); fuzzy_ctrl_0 |= sms->io.ports[0].control; - sms->io.ports[1].control = (~value) << 3 & 0x60; + io_control_write(sms->io.ports+1, (~value) << 3 & 0x60, z80->current_cycle); fuzzy_ctrl_1 |= sms->io.ports[1].control; if ( (fuzzy_ctrl_0 & 0x40 & (sms->io.ports[0].output ^ (value << 1)) & (value << 1)) -- cgit v1.2.3