MBC2: Compare addr instead of the value

This commit is contained in:
Kevin Hamacher 2016-06-01 15:29:38 +02:00
parent 8c6a6fa33c
commit 2057a06411

View File

@ -46,7 +46,7 @@ impl MBC for MBC2 {
match addr {
0x0000 ... 0x1FFF => {
// To enable the ram, the LSB of the higher byte must be 0
if val & 0x0100 == 0 {
if addr & 0x0100 == 0 {
match val {
0x0A => self.ram_enable = true,
0x00 => self.ram_enable = false,
@ -57,7 +57,7 @@ impl MBC for MBC2 {
}
},
0x2000 ... 0x3FFF => {
if val & 0x0100 == 1 {
if addr & 0x0100 == 1 {
self.rom_bank_no = val & 0x0F;
println!("MBC2: Selecting bank {:02X}", self.rom_bank_no);
} else {