Skip to content

Commit

Permalink
Made MBC1 ram address wrap when banking mode is simple
Browse files Browse the repository at this point in the history
  • Loading branch information
velllu committed Sep 22, 2024
1 parent c9bec9c commit 5250169
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bus/mbc1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Mbc1 {
fn calculate_ram_address(&self, address: u16) -> usize {
match self.banking_mode {
// If it's simple we just use bank 0
BankingMode::Simple => address as usize,
BankingMode::Simple => address as usize % self.ram_size,

// Otherwise we use the ram bank number
BankingMode::Advanced => {
Expand Down

0 comments on commit 5250169

Please sign in to comment.