Skip to content

Commit cbd3f63

Browse files
committed
ROM: add notes about which address lines are and aren't latched
1 parent 7ec134d commit cbd3f63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/nba/include/nba/rom/rom.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ struct ROM {
133133
u16 data;
134134

135135
if(!sequential) {
136+
// According to Reiner Ziegler official GBA cartridges latch A0 to A23 (not just A0 to A15)
137+
// "In theory, you can read an entire GBA ROM with just one non-sequential read (address 0) and all of the other
138+
// reads as sequential so address counters must be used on most address lines to exactly emulate a GBA ROM.
139+
// However, you only need to use address latch / counters on A0-A15 in order to satisfy the GBA since A16-A23 are always accurate."
140+
// Source: https://reinerziegler.de.mirrors.gg8.se/GBA/gba.htm#GBA%20cartridges
136141
rom_address_latch = address & rom_mask;
137142
}
138143

0 commit comments

Comments
 (0)