From 5565c096c7f0028b2f6680a7576e9ec88df38e7a Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 30 Sep 2016 01:09:44 +0300 Subject: [PATCH] Misc optimizations, especially for the tester --- Core/debugger.c | 2 ++ Core/display.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/debugger.c b/Core/debugger.c index c4b5ef5..418a254 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -1393,6 +1393,7 @@ static bool _GB_debugger_test_write_watchpoint(GB_gameboy_t *gb, value_t addr, u void GB_debugger_test_write_watchpoint(GB_gameboy_t *gb, uint16_t addr, uint8_t value) { if (gb->debug_stopped) return; + if (!gb->n_watchpoints) return; /* Try any-bank breakpoint */ value_t full_addr = (VALUE_16(addr)); @@ -1438,6 +1439,7 @@ static bool _GB_debugger_test_read_watchpoint(GB_gameboy_t *gb, value_t addr) void GB_debugger_test_read_watchpoint(GB_gameboy_t *gb, uint16_t addr) { if (gb->debug_stopped) return; + if (!gb->n_watchpoints) return; /* Try any-bank breakpoint */ value_t full_addr = (VALUE_16(addr)); diff --git a/Core/display.c b/Core/display.c index 580ea90..b5ca847 100755 --- a/Core/display.c +++ b/Core/display.c @@ -216,9 +216,9 @@ static void nsleep(uint64_t nanoseconds) void display_vblank(GB_gameboy_t *gb) { /* Called every Gameboy vblank. Does FPS-capping and calls user's vblank callback if Turbo Mode allows. */ - if (gb->turbo) { + if (gb->turbo && !gb->turbo_dont_skip) { int64_t nanoseconds = get_nanoseconds(); - if (!gb->turbo_dont_skip && nanoseconds <= gb->last_vblank + FRAME_LENGTH) { + if (nanoseconds <= gb->last_vblank + FRAME_LENGTH) { return; } gb->last_vblank = nanoseconds;