gracetveit / gb_emulator

0 stars 0 forks source link

Figure out how the Game Boy finds `tile_map addr` from an 8-bit value #24

Closed gracetveit closed 1 year ago

gracetveit commented 1 year ago

Looking at the tile map for Dragon Warrior I & II, the map uses 8-bit values to determine tile data addresses. Some of the background tiles can be found in the 0x8XX0 range, while others in the 0x9XX0 range (The data making up the middle two digits).

I'm unsure as to how the ppu knows which address to look up, will need to investigate and implement

gracetveit commented 1 year ago

When the PPU is using the "$8800 method", it uses a signed integer for indexing. This means that if i = -128, it indexes $8800, and if i = 127, it indexes $9000

https://gbdev.io/pandocs/Tile_Data.html#vram-tile-data