git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 79179843760488515d8710641cf5b4231091a977
parent c580c44ad304eca46e1ee15dafec0a715771d4c6
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 11 Sep 2022 15:29:50 +0300

Comments

Diffstat:
MCore/apu.c7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Core/apu.c b/Core/apu.c @@ -337,7 +337,7 @@ static void _nrx2_glitch(uint8_t *volume, uint8_t value, uint8_t old_value, uint } if (should_invert) { - // The weird way and over-the-top way clocks for this counter are connected cause + // The weird and over-the-top way clocks for this counter are connected cause // some weird ways for it to invert if (value & 8) { if (!(old_value & 7) && !lock->locked) { @@ -385,6 +385,11 @@ static void _nrx2_glitch(uint8_t *volume, uint8_t value, uint8_t old_value, uint static void nrx2_glitch(GB_gameboy_t *gb, uint8_t *volume, uint8_t value, uint8_t old_value, uint8_t *countdown, GB_envelope_clock_t *lock) { + /* Note: on pre-CGB models *some* of these are non-deterministic. Specifically, + $x0 writes seem to be non-deterministic while $x8 always work as expected. + TODO: Might be useful to find which cases are non-deterministic, and allow + the debugger to issue warnings when they're used. I suspect writes to/from + $xF are guaranteed to be deterministic. */ if (gb->model <= GB_MODEL_CGB_C) { _nrx2_glitch(volume, 0xFF, old_value, countdown, lock); _nrx2_glitch(volume, value, 0xFF, countdown, lock);

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.