gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Is external WRAM slower even using THUMB?

#2780 - nitro2k01 - Wed Feb 12, 2003 4:09 pm

As we all know, you aren't supposed to use ARM code for ext WRAM, because the bus is 16-bit to it. But I heard something about wait states in ext WRAM. Does this mean that reading from/writing to ext. WRAM wont be at full speed, even using thumb?

#2781 - tepples - Wed Feb 12, 2003 4:21 pm

EWRAM is 2/2 wait state, meaning that random accesses take 2 extra cycles and sequential accesses also take two extra cycles. ROM is typically 3/1 wait state: 3 extra cycles random, 1 extra cycle sequential. Thus, running Thumb code from EWRAM is on average slightly slower than running Thumb code from ROM, but not by much, and the gap closes with more branches.

Another advantage of putting code in EWRAM is that ROM access is a battery hog. Often, even with BIOS vblank waiting turned on, my programs will run with a red battery light when compiled to run from ROM but with a green battery light when compiled as a multiboot (EWRAM based) program.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#2909 - nitro2k01 - Fri Feb 14, 2003 1:27 pm

Does that affect reading/writing too?

#2930 - tepples - Fri Feb 14, 2003 4:30 pm

Unfortunately, there are no write FIFOs in the GBA's memory controller. Thus, all wait states affect both reading and writing.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.