summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2014-02-18 21:37:31 -0800
committerMichael Pavone <pavone@retrodev.com>2014-02-18 21:37:31 -0800
commitc2366d61ff6e228cb3242993d457ff115cd98c91 (patch)
treed14bfc4716ac2579100486649b087884b8cc9aba /blastem.c
parent9b5ed199e364fb84165a2616434849f63226b8d0 (diff)
Initial work on the x86-32 target
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/blastem.c b/blastem.c
index c4072e3..d3b48d2 100644
--- a/blastem.c
+++ b/blastem.c
@@ -182,6 +182,7 @@ uint8_t new_busack = 0;
void sync_z80(z80_context * z_context, uint32_t mclks)
{
+#ifdef X86_64
if (z80_enabled && !reset && !busreq) {
genesis_context * gen = z_context->system;
z_context->sync_cycle = mclks / MCLKS_PER_Z80;
@@ -201,7 +202,9 @@ void sync_z80(z80_context * z_context, uint32_t mclks)
dprintf("Z80 ran to cycle %d\n", z_context->current_cycle);
}
}
- } else {
+ } else
+#endif
+ {
z_context->current_cycle = mclks / MCLKS_PER_Z80;
}
}
@@ -469,7 +472,9 @@ m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value
location &= 0x7FFF;
if (location < 0x4000) {
z80_ram[location & 0x1FFF] = value;
+#ifdef X86_64
z80_handle_code_write(location & 0x1FFF, gen->z80);
+#endif
} else if (location < 0x6000) {
sync_sound(gen, context->current_cycle * MCLKS_PER_68K);
if (location & 1) {
@@ -986,7 +991,9 @@ void init_run_cpu(genesis_context * gen, FILE * address_log, char * statefile, u
insert_breakpoint(&context, pc, debugger);
}
adjust_int_cycle(gen->m68k, gen->vdp);
+#ifdef X86_64
gen->z80->native_pc = z80_get_native_address_trans(gen->z80, gen->z80->pc);
+#endif
start_68k_context(&context, pc);
} else {
if (debugger) {
@@ -1231,8 +1238,10 @@ int main(int argc, char ** argv)
z80_context z_context;
x86_z80_options z_opts;
+#ifdef X86_64
init_x86_z80_opts(&z_opts);
init_z80_context(&z_context, &z_opts);
+#endif
z_context.system = &gen;
z_context.mem_pointers[0] = z80_ram;