From 29afc1a71cdd2579badca37e467add392a150b0a Mon Sep 17 00:00:00 2001 From: Staacks Date: Sat, 14 Jan 2023 17:29:12 +0100 Subject: [PATCH] Increase lead in time for gathering clock statistics, fixing incorrect clocks an error in many games on the Game Boy Pocket. --- firmware/cpubus.c | 3 ++- firmware/main.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/cpubus.c b/firmware/cpubus.c index 940883d..3ae17cf 100644 --- a/firmware/cpubus.c +++ b/firmware/cpubus.c @@ -14,6 +14,7 @@ #include "hardware/structs/systick.h" uint32_t cycleRatio; //Ratio of rp2040 cycles to Game Boy cycles. +#define CYCLE_RATIO_STATISTIC_SKIP 250 //How many cycles to skip before building the statistic #define CYCLE_RATIO_STATISTIC_SIZE 1000 //How many cycles to capture as a statistic for cycleRatio PIO busPIO; @@ -231,7 +232,7 @@ void handleMemoryBus() { //To be executed on second core reset(); //Wait for game to actually start and use this to determine the cycleRatio - uint leadIn = 100; //Skip first cycles in case something funny triggered a few extras while turning on. + uint leadIn = CYCLE_RATIO_STATISTIC_SKIP; //Skip first cycles in case something funny triggered a few extras while turning on. uint count = CYCLE_RATIO_STATISTIC_SIZE; systick_hw->rvr = 0x00FFFFFF; systick_hw->csr = 0x4; diff --git a/firmware/main.h b/firmware/main.h index 3f7e6a0..ea298c2 100644 --- a/firmware/main.h +++ b/firmware/main.h @@ -6,6 +6,6 @@ #define LED_SWITCH_PIN 1 #define LED_PIN_MASK 0x02 -#define VERSION "1.0.4-alpha1" +#define VERSION "1.0.4-alpha2" #endif \ No newline at end of file