-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect speed switch implementation in CGB mode #31
Comments
Sorry, my bad. |
But, if we handle a interrupt in the cpu Lines 1677 to 1689 in e64757f
|
To be honest, I don't know why I wrote this code a few years ago, it looks completely wrong now. |
I think what I want to do is |
Emm, I think there should be something here. Line 1019 in e64757f
Maybe 0x10 => {
self.mem.switch_speed(); // It will need the CPU struct receive `Mmunit` type, instead of a `dyn Memory`.
if self.mem.speed == Speed::Double {
// Incr the timer's div register.
// self.mem.timer.
// And more
}
} |
Hello, the speed switch code should get the value in the address that the PC register pointed instead of the value of in register.
gameboy/src/motherboard.rs
Line 21 in ff9c35b
Reference: https://gbdev.gg8.se/wiki/articles/CGB_Registers#FF4D_-_KEY1_-_CGB_Mode_Only_-_Prepare_Speed_Switch
The text was updated successfully, but these errors were encountered: