From 872d2c2766536a372af5d1048bed7514078f9d31 Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 3 Oct 2022 00:31:53 +0300 Subject: Impl vblank irq --- emulator.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'emulator.cpp') diff --git a/emulator.cpp b/emulator.cpp index b5ad031..de9be02 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -328,8 +328,8 @@ int m68k_irq_ack(int level) { (void) level; // TODO - exit_error("IRQ ack"); - return M68K_INT_ACK_SPURIOUS; + printf("IRQ ack\n"); + return level; } static void make_hex(char* buff, unsigned int pc, unsigned int length) @@ -480,17 +480,19 @@ int emulator(M68KDebuggingControl& m68k_debug) break; } if (m68k_debug.IsRunning()) { - m68k_execute(10000); + do { + m68k_execute(100000); + } while(!g_vdp.Scanline()); } if (m68k_debug.HasBreakpoint()) { m68k_debug.SetRunning(false); m68k_debug.ResetPendingBreakpoint(); - const auto response = - exchange_ctx.WrapDataToSend("S05"); - if (DEBUG_TRACE_GDB_REMOTE) - printf("-> \"%s\"\n", response.c_str()); - if (send(conn_fd, &response[0], response.length(), 0) == -1) - perror("Send failed (response)"); + const auto response = + exchange_ctx.WrapDataToSend("S05"); + if (DEBUG_TRACE_GDB_REMOTE) + printf("-> \"%s\"\n", response.c_str()); + if (send(conn_fd, &response[0], response.length(), 0) == -1) + perror("Send failed (response)"); } // TODO turn off O_NONBLOCK and poll instead of sleep, only use // nonlock when freerunning -- cgit v1.2.3