From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH] games/gb: fix timer divider for input clock 0
Date: Wed, 03 Feb 2021 08:46:52 +0000 [thread overview]
Message-ID: <AC773303364DF5353D96192F58CCC84A@arrow.hsd1.ca.comcast.net> (raw)
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}};
reply other threads:[~2021-02-03 10:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AC773303364DF5353D96192F58CCC84A@arrow.hsd1.ca.comcast.net \
--to=mforney@mforney.org \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).