Mimic 8-bit overflow manually in SCBRR2_write #1729
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes MUSHIKING cannot insert card with macOS arm64. (Issue reported from Discord)
Details:
In macOS arm64, the
SCIFSerialPort::schedCallback
would stop calling after theNow Loading...
screen.This happens when
SCIFSerialPort::SCBRR2_write
is trying to write a-94
, overflowing to become4294967202
, making cyclesPerBit become0
.(But on the debug build, it is writing
162
, the 8-bit overflow value for-94
)Since
static_cast<signed char>(data)
orstatic_cast<u8>(static_cast<signed char>(data)>
does not work, so I just add 256 directly to mimic the 8-bit overflowQuestion: