From fa445d8614acb628f6ef310a78cc1bacbe871afb Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 9 Jun 2021 02:17:04 -0500 Subject: [PATCH] GB: reduce CPU usage SameBoy works faster if you do multiple runs in the acquire function --- src/engine/platform/gb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 2ebe7199c..36e234f52 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -8,7 +8,7 @@ #define FREQ_BASE 8015.85f void DivPlatformGB::acquire(int& l, int& r) { - GB_advance_cycles(gb,2); + GB_advance_cycles(gb,16); l=gb->apu_output.final_sample.left<<2; r=gb->apu_output.final_sample.right<<2; } @@ -270,7 +270,7 @@ int DivPlatformGB::dispatch(DivCommand c) { int DivPlatformGB::init(DivEngine* p, int channels, int sugRate) { parent=p; - rate=2097152; + rate=262144; gb=new GB_gameboy_t; memset(gb,0,sizeof(GB_gameboy_t)); gb->model=GB_MODEL_DMG_B;