comparison blastem.c @ 565:9324f721efa6

Add a separate flag/define for disabling the Z80 at compile time to ease refactoring
author Michael Pavone <pavone@retrodev.com>
date Sat, 01 Mar 2014 17:11:06 -0800
parents dc9f178085a0
children 9b7fcf748be0
comparison
equal deleted inserted replaced
564:316facea756d 565:9324f721efa6
180 180
181 #define Z80_VINT_DURATION 128 181 #define Z80_VINT_DURATION 128
182 182
183 void sync_z80(z80_context * z_context, uint32_t mclks) 183 void sync_z80(z80_context * z_context, uint32_t mclks)
184 { 184 {
185 #ifdef X86_64 185 #ifndef NO_Z80
186 if (z80_enabled && !reset && !busreq) { 186 if (z80_enabled && !reset && !busreq) {
187 genesis_context * gen = z_context->system; 187 genesis_context * gen = z_context->system;
188 z_context->sync_cycle = mclks / MCLKS_PER_Z80; 188 z_context->sync_cycle = mclks / MCLKS_PER_Z80;
189 if (z_context->current_cycle < z_context->sync_cycle) { 189 if (z_context->current_cycle < z_context->sync_cycle) {
190 if (need_reset) { 190 if (need_reset) {
470 } 470 }
471 if (!(busack || reset)) { 471 if (!(busack || reset)) {
472 location &= 0x7FFF; 472 location &= 0x7FFF;
473 if (location < 0x4000) { 473 if (location < 0x4000) {
474 z80_ram[location & 0x1FFF] = value; 474 z80_ram[location & 0x1FFF] = value;
475 #ifdef X86_64 475 #ifndef NO_Z80
476 z80_handle_code_write(location & 0x1FFF, gen->z80); 476 z80_handle_code_write(location & 0x1FFF, gen->z80);
477 #endif 477 #endif
478 } else if (location < 0x6000) { 478 } else if (location < 0x6000) {
479 sync_sound(gen, context->current_cycle * MCLKS_PER_68K); 479 sync_sound(gen, context->current_cycle * MCLKS_PER_68K);
480 if (location & 1) { 480 if (location & 1) {
989 printf("Loaded %s\n", statefile); 989 printf("Loaded %s\n", statefile);
990 if (debugger) { 990 if (debugger) {
991 insert_breakpoint(&context, pc, debugger); 991 insert_breakpoint(&context, pc, debugger);
992 } 992 }
993 adjust_int_cycle(gen->m68k, gen->vdp); 993 adjust_int_cycle(gen->m68k, gen->vdp);
994 #ifdef X86_64 994 #ifndef NO_Z80
995 gen->z80->native_pc = z80_get_native_address_trans(gen->z80, gen->z80->pc); 995 gen->z80->native_pc = z80_get_native_address_trans(gen->z80, gen->z80->pc);
996 #endif 996 #endif
997 start_68k_context(&context, pc); 997 start_68k_context(&context, pc);
998 } else { 998 } else {
999 if (debugger) { 999 if (debugger) {
1236 psg_context p_context; 1236 psg_context p_context;
1237 psg_init(&p_context, render_sample_rate(), gen.master_clock, MCLKS_PER_PSG, render_audio_buffer()); 1237 psg_init(&p_context, render_sample_rate(), gen.master_clock, MCLKS_PER_PSG, render_audio_buffer());
1238 1238
1239 z80_context z_context; 1239 z80_context z_context;
1240 x86_z80_options z_opts; 1240 x86_z80_options z_opts;
1241 #ifdef X86_64 1241 #ifndef NO_Z80
1242 init_x86_z80_opts(&z_opts); 1242 init_x86_z80_opts(&z_opts);
1243 init_z80_context(&z_context, &z_opts); 1243 init_z80_context(&z_context, &z_opts);
1244 #endif 1244 #endif
1245 1245
1246 z_context.system = &gen; 1246 z_context.system = &gen;