Skip to content

GB: Fix serial clocking regression.#30

Merged
Fiskbit merged 1 commit intomasterfrom
fiskbit-gb-serial-clocking-fix
Apr 13, 2026
Merged

GB: Fix serial clocking regression.#30
Fiskbit merged 1 commit intomasterfrom
fiskbit-gb-serial-clocking-fix

Conversation

@Fiskbit
Copy link
Copy Markdown
Member

@Fiskbit Fiskbit commented Apr 12, 2026

Commit 36d23cc inverted the condition for calling ExecTimerDmaSerial, swapping the cycle parity so that ExecTimerDmaSerial could no longer handle serial data. This broke Shin Megami Tensei: Devil Children: Kuro no Sho in GB and SGB modes.

Tested with automated tests (no change) and Shin Megami Tensei: Devil Children: Kuro no Sho (no longer broken).

Thanks to paulb_nl for finding the cause of this issue and Sour for reviewing the commit that introduced the issue.

Commit 36d23cc inverted the condition for calling ExecTimerDmaSerial, swapping the cycle parity so that ExecTimerDmaSerial could no longer handle serial data. This broke Shin Megami Tensei: Devil Children: Kuro no Sho in GB and SGB modes.

Tested with automated tests (no change) and Shin Megami Tensei: Devil Children: Kuro no Sho (no longer broken).

Thanks to paulb_nl for finding the cause of this issue and Sour for reviewing the commit that introduced the issue.
@TakuikaNinja
Copy link
Copy Markdown

Forum post from paulb_nl reporting the regression, for reference: https://forums.nesdev.org/viewtopic.php?p=308144&sid=50d111a130df9c018d8327dc3e29ea67#p308144

I realise the regression tripped up this game because it constantly attempts serial communication and runs a halt instruction to wait for multiple IRQ sources - it just so happened that it was sometimes disabling everything except serial IRQs and thus expected a serial IRQ to wake it up from a halt.

I'll note here that cross-system serial communication (i.e. link cable) support isn't implemented (writes go nowhere and reads always shift in 1s, i.e. always disconnected), so it's currently impossible to fully test the serial implementation. I've also noticed the GBC-exclusive serial clock speed bit ($FF02.D1 write, can be combined with double-speed mode) is also missing an implementation.

Otherwise, the fix LGTM.

@Fiskbit Fiskbit merged commit 8ff4b13 into master Apr 13, 2026
15 checks passed
@Fiskbit Fiskbit deleted the fiskbit-gb-serial-clocking-fix branch April 13, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants