comparison genesis.c @ 1753:33ec5df77fac

Integration of new Z80 core is sort of working now
author Michael Pavone <pavone@retrodev.com>
date Tue, 12 Feb 2019 09:58:04 -0800
parents d6d4c006a7b3
children 1dc718581aac
comparison
equal deleted inserted replaced
1752:d6d4c006a7b3 1753:33ec5df77fac
153 if (gen->z80_bank_reg < 0x140) { 153 if (gen->z80_bank_reg < 0x140) {
154 gen->z80->mem_pointers[1] = get_native_pointer(gen->z80_bank_reg << 15, (void **)gen->m68k->mem_pointers, &gen->m68k->options->gen); 154 gen->z80->mem_pointers[1] = get_native_pointer(gen->z80_bank_reg << 15, (void **)gen->m68k->mem_pointers, &gen->m68k->options->gen);
155 } else { 155 } else {
156 gen->z80->mem_pointers[1] = NULL; 156 gen->z80->mem_pointers[1] = NULL;
157 } 157 }
158 z80_invalidate_code_range(gen->z80, 0x8000, 0xFFFF);
158 } 159 }
159 160
160 static void bus_arbiter_deserialize(deserialize_buffer *buf, void *vgen) 161 static void bus_arbiter_deserialize(deserialize_buffer *buf, void *vgen)
161 { 162 {
162 genesis_context *gen = vgen; 163 genesis_context *gen = vgen;
291 #else 292 #else
292 #define dprintf 293 #define dprintf
293 #define dputs 294 #define dputs
294 #endif 295 #endif
295 296
296 #ifndef NEW_CORE
297 static void z80_next_int_pulse(z80_context * z_context) 297 static void z80_next_int_pulse(z80_context * z_context)
298 { 298 {
299 genesis_context * gen = z_context->system; 299 genesis_context * gen = z_context->system;
300 #ifdef NEW_CORE
301 z_context->int_cycle = vdp_next_vint_z80(gen->vdp);
302 z_context->int_end_cycle = z_context->int_cycle + Z80_INT_PULSE_MCLKS;
303 z_context->int_value = 0xFF;
304 #else
300 z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp); 305 z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp);
301 z_context->int_pulse_end = z_context->int_pulse_start + Z80_INT_PULSE_MCLKS; 306 z_context->int_pulse_end = z_context->int_pulse_start + Z80_INT_PULSE_MCLKS;
302 z_context->im2_vector = 0xFF; 307 z_context->im2_vector = 0xFF;
303 } 308 #endif
304 #endif 309 }
305 310
306 static void sync_z80(z80_context * z_context, uint32_t mclks) 311 static void sync_z80(z80_context * z_context, uint32_t mclks)
307 { 312 {
308 #ifndef NO_Z80 313 #ifndef NO_Z80
309 if (z80_enabled) { 314 if (z80_enabled) {
315 #ifdef NEW_CORE
316 z80_next_int_pulse(z_context);
317 #endif
310 z80_run(z_context, mclks); 318 z80_run(z_context, mclks);
311 } else 319 } else
312 #endif 320 #endif
313 { 321 {
314 z_context->Z80_CYCLE = mclks; 322 z_context->Z80_CYCLE = mclks;