Skip to content

Commit

Permalink
n64: fix Joybus RTC read/write status byte (#1814)
Browse files Browse the repository at this point in the history
As documented in the N64brew wiki:
https://n64brew.dev/wiki/Joybus_Protocol#0x07_-_Read_Real-Time_Clock_Block

The final output byte of Joybus RTC read/write commands should be the
RTC status.

This intended behavior has been confirmed with Mateusz Faderewski, the
creator of SummerCart.
  • Loading branch information
meeq authored Feb 5, 2025
1 parent 04c608a commit 7640e15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ares/n64/cartridge/joybus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ auto Cartridge::joybusComm(n8 send, n8 recv, n8 input[], n8 output[]) -> n2 {
if(input[0] == 0x07 && send >= 2 && recv >= 9) {
if(cartridge.rtc.present) {
rtc.read(input[1], &output[0]);
output[8] = 0x00;
output[8] = rtc.status;
valid = 1;
}
}
Expand All @@ -63,7 +63,7 @@ auto Cartridge::joybusComm(n8 send, n8 recv, n8 input[], n8 output[]) -> n2 {
if(input[0] == 0x08 && send >= 10 && recv >= 1) {
if(cartridge.rtc.present) {
rtc.write(input[1], &input[2]);
output[0] = 0x00;
output[0] = rtc.status;
valid = 1;
}
}
Expand Down

0 comments on commit 7640e15

Please sign in to comment.