From bf145516322df242b6279ba739f8faaa609a2584 Mon Sep 17 00:00:00 2001 From: goyuken Date: Fri, 8 Aug 2014 04:15:57 +0000 Subject: [PATCH] vba-next: frame timing wizardry --- output/dll/libvbanext.dll | Bin 427008 -> 427008 bytes vbanext/instance.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/output/dll/libvbanext.dll b/output/dll/libvbanext.dll index 3455288c6e4fcc7392258a6d019ea2b8ec841055..4c70fc058747e5efe1673ba78555f1afce3b54b2 100644 GIT binary patch delta 1962 zcmY+D4^ULc9mjXy-JTL4cO-BUKsn;^Phte$yZ7GRG4@GDoeGYM~f1pShUiY0N)9%df zZ-1ZN_kF+LZ+AVlah}?^h6$=U|G?xtxZVE(T%>t^Sm)1!N8#JS`_M_jtYEQr4Fzun zkLlLNz@x#5c-L%b3vMxgK*2-)>6An8gugL$Dg4-fJGF>1cKLUu&Gi?irNdtT&a_-8 zl5w7YC~YlV@6SqK2vhu<$v6?LOCN#oIsZEuFToLi6B%2A-)5ZE!sWrb%vUtT`;K0q zhkO0g%j3ARlL%Cuix~e>>oz)p7J$0I<-btC1=h)hPnTw^OCAX7#MY)+lnWHdtbc7z z9E`7Ws0)oGpGYRLJtAS&iRA;Kh2N`WDny*OLu9Ws-HpZ}Y`|mR zpv9{<%~z9D%lc{SL^xHnLC%{YqFQL8ZVi!*6iK{Mh?&el1KsawV`vJ1?a7|D{S2A7XURKSrj=178(vqGns$Bl zxo`lyjf3RWMk9T_@>X2dhs<;Sn9<>rz4a>gHZCO+-ZFD+-D=$2hnB$SrF(ry1EC&2 zyn@69wM2K7SG;zH0>XKH&AY_aOX5NDJFj?|z&pPrMf% z#aG^m2_ere^BmyTy(TYvS5bU{b`U}NdX-Ci#G53RL8A9L2?vyhHNHv+3PbyVyAd9GNH+b5*GRed}%XdM( zNfyS%fQ14}-3hqi1~TeKwLbN@KfZzHKb?2qK!tHuveg>W_}wJfiZa1Fj@$A;EG{1FSezEoX`q$g#6z3WY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--- a/vbanext/instance.cpp +++ b/vbanext/instance.cpp @@ -12505,7 +12505,7 @@ void CPUInterrupt(void) void CPULoop (void) { bus.busPrefetchCount = 0; - int ticks = 50000; + int ticks = 300000; int timerOverflow = 0; // variable used by the CPU core cpuTotalTicks = 0; @@ -12514,6 +12514,7 @@ void CPULoop (void) if(cpuNextEvent > ticks) cpuNextEvent = ticks; + bool framedone = false; do { @@ -12641,6 +12642,7 @@ updateLoop: systemDrawScreen(); process_sound_tick_fn(); + framedone = true; } UPDATE_REG(0x04, io_registers[REG_DISPSTAT]); @@ -12916,7 +12918,7 @@ updateLoop: if(cpuNextEvent > ticks) cpuNextEvent = ticks; - if(ticks <= 0) + if(ticks <= 0 || framedone) break; }