Skip to content

Commit

Permalink
Simplify CGB bank read in MB getitem
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Sep 16, 2024
1 parent db00efa commit bfac26f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pyboy/core/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ def getitem(self, i):
bank_offset = 0
if self.cgb and 0xD000 <= i:
# Find which bank to read from at FF70
bank = self.getitem(0xFF70)
bank &= 0b111
bank = self.ram.non_io_internal_ram1[0xFF70 - 0xFF4C] & 0b111
if bank == 0x0:
bank = 0x01
bank_offset = (bank-1) * 0x1000
Expand Down

0 comments on commit bfac26f

Please sign in to comment.