comparison sms.c @ 1379:65f1d6558e9e

Update SMS code for changes supporting slow rise time emulation in IO code
author Michael Pavone <pavone@retrodev.com>
date Mon, 29 May 2017 18:25:11 -0700
parents e587f16e7d3d
children 1df16f5985f3
comparison
equal deleted inserted replaced
1378:71c8b97eb962 1379:65f1d6558e9e
11 { 11 {
12 z80_context *z80 = vcontext; 12 z80_context *z80 = vcontext;
13 sms_context *sms = z80->system; 13 sms_context *sms = z80->system;
14 if (location & 1) { 14 if (location & 1) {
15 uint8_t fuzzy_ctrl_0 = sms->io.ports[0].control, fuzzy_ctrl_1 = sms->io.ports[1].control; 15 uint8_t fuzzy_ctrl_0 = sms->io.ports[0].control, fuzzy_ctrl_1 = sms->io.ports[1].control;
16 sms->io.ports[0].control = (~value) << 5 & 0x60; 16 io_control_write(sms->io.ports, (~value) << 5 & 0x60, z80->current_cycle);
17 fuzzy_ctrl_0 |= sms->io.ports[0].control; 17 fuzzy_ctrl_0 |= sms->io.ports[0].control;
18 sms->io.ports[1].control = (~value) << 3 & 0x60; 18 io_control_write(sms->io.ports+1, (~value) << 3 & 0x60, z80->current_cycle);
19 fuzzy_ctrl_1 |= sms->io.ports[1].control; 19 fuzzy_ctrl_1 |= sms->io.ports[1].control;
20 if ( 20 if (
21 (fuzzy_ctrl_0 & 0x40 & (sms->io.ports[0].output ^ (value << 1)) & (value << 1)) 21 (fuzzy_ctrl_0 & 0x40 & (sms->io.ports[0].output ^ (value << 1)) & (value << 1))
22 || (fuzzy_ctrl_0 & 0x40 & (sms->io.ports[1].output ^ (value >> 1)) & (value >> 1)) 22 || (fuzzy_ctrl_0 & 0x40 & (sms->io.ports[1].output ^ (value >> 1)) & (value >> 1))
23 ) { 23 ) {