9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] games/gb: fix timer divider for input clock 0
@ 2021-02-03  8:46 Michael Forney
  0 siblings, 0 replies; only message in thread
From: Michael Forney @ 2021-02-03  8:46 UTC (permalink / raw)
  To: 9front


According to [0], input clock 0 should divide by 1024=2¹⁰, not 2¹².
This caused audio to run at quarter-speed in one game I tried.

[0] https://gbdev.io/pandocs/#ff07-tac-timer-control-r-w
---
diff 07a27ca966dafa2cf22d97ccb2519d16604bdc81 7d37c636636253b74d3d2260e991cd78664ce1e9
--- a/sys/src/games/gb/ev.c	Fri Jan 29 01:31:59 2021
+++ b/sys/src/games/gb/ev.c	Wed Feb  3 00:46:52 2021
@@ -8,7 +8,7 @@
 extern Event evsamp, chev[4];
 Event *events[NEVENT] = {&evhblank, &evtimer, &evenv, &evsamp, &chev[0], &chev[1], &chev[2], &chev[3]};
 Event *elist;
-static int timshtab[4] = {12, 4, 6, 8}, timsh;
+static int timshtab[4] = {10, 4, 6, 8}, timsh;
 ulong timclock;
 Var evvars[] = {VAR(timsh), VAR(timclock), {nil, 0, 0}};
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-03 10:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  8:46 [9front] [PATCH] games/gb: fix timer divider for input clock 0 Michael Forney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).