--- generator/main/cpuz80-mz80.c 2020/03/04 04:46:43 1.1.1.1 +++ generator/main/cpuz80-mz80.c 2020/03/04 04:46:53 1.1.1.2 @@ -27,23 +27,23 @@ static unsigned int cpuz80_lastsync = 0; static unsigned int cpuz80_resetting = 0; static struct MemoryReadByte cpuz80_read[] = { - { 0x0000, 0xFFFF, cpuz80_read_actual, NULL }, - { -1, -1, NULL, NULL } + {0x0000, 0xFFFF, cpuz80_read_actual, NULL}, + {-1, -1, NULL, NULL} }; static struct MemoryWriteByte cpuz80_write[] = { - { 0x0000, 0xFFFF, cpuz80_write_actual, NULL }, - { -1, -1, NULL, NULL } + {0x0000, 0xFFFF, cpuz80_write_actual, NULL}, + {-1, -1, NULL, NULL} }; static struct z80PortRead cpuz80_ioread[] = { - { 0x0000, 0x00FF, cpuz80_ioread_actual, NULL }, - { -1, -1, NULL, NULL } + {0x0000, 0x00FF, cpuz80_ioread_actual, NULL}, + {-1, -1, NULL, NULL} }; static struct z80PortWrite cpuz80_iowrite[] = { - { 0x0000, 0x00FF, cpuz80_iowrite_actual, NULL }, - { -1, -1, NULL, NULL } + {0x0000, 0x00FF, cpuz80_iowrite_actual, NULL}, + {-1, -1, NULL, NULL} }; UINT8 cpuz80_read_actual(UINT32 addr, struct MemoryReadByte *me) @@ -116,21 +116,21 @@ void cpuz80_updatecontext(void) void cpuz80_resetcpu(void) { mz80reset(); - cpuz80_resetting = 1; /* suspends execution */ + cpuz80_resetting = 1; /* suspends execution */ } /*** cpuz80_unresetcpu - unreset z80 cpu ***/ void cpuz80_unresetcpu(void) { - cpuz80_resetting = 0; /* un-suspends execution */ + cpuz80_resetting = 0; /* un-suspends execution */ } /*** cpuz80_bankwrite - data is being written to latch ***/ void cpuz80_bankwrite(uint8 data) { - cpuz80_bank = (((cpuz80_bank >> 1) | ((data & 1) <<23)) & 0xff8000); + cpuz80_bank = (((cpuz80_bank >> 1) | ((data & 1) << 23)) & 0xff8000); } /*** cpuz80_stop - stop the processor ***/ @@ -161,7 +161,7 @@ void cpuz80_endfield(void) void cpuz80_sync(void) { int cpu68k_wanted = cpu68k_clocks - cpuz80_lastsync; - int wanted = (cpu68k_wanted<0?0:cpu68k_wanted)*7/15; + int wanted = (cpu68k_wanted < 0 ? 0 : cpu68k_wanted) * 7 / 15; int acheived; if (cpuz80_active && !cpuz80_resetting) { @@ -169,7 +169,7 @@ void cpuz80_sync(void) cpuz80_z80.z80pc); */ mz80exec(wanted); acheived = mz80GetElapsedTicks(1); - cpuz80_lastsync = cpuz80_lastsync + acheived*15/7; + cpuz80_lastsync = cpuz80_lastsync + acheived * 15 / 7; } else { cpuz80_lastsync = cpu68k_clocks; }