diff options
author | Oxore <oxore@protonmail.com> | 2022-10-03 00:31:53 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-10-03 00:31:53 +0300 |
commit | 872d2c2766536a372af5d1048bed7514078f9d31 (patch) | |
tree | 7d4071d664214d500d1be710add46b1f7486c350 /emulator.cpp | |
parent | 897c498b543f88d9b97f39e7a8f3aa691d11cc37 (diff) |
Impl vblank irq
Diffstat (limited to 'emulator.cpp')
-rw-r--r-- | emulator.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
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 |