#56396 - Nacho - Sat Oct 08, 2005 1:19 pm
Hello there! I have a set of data structures (which is computed offline) for my game levels located in ROM memory. Nonetheless, I?m still unsure about the approach I should take whenever I need to use that data: is it better to use it directly from ROM or to allocate memory in EWRAM and copy the data in the initialization stage? I?ve been reading CowBite?s specs and it saids that both transfers are 16 bits wide and -I?m guessing here- EWRAM transfers should be faster. What do you suggest?
Thanks for your help!
--Nacho
#56405 - tepples - Sat Oct 08, 2005 4:24 pm
If you're doing a straight copy (CpuFastSet or DMA), then copying from ROM should be faster, as it has 1 wait state sustained, compared to EWRAM's 2 wait states sustained.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#56426 - Nacho - Sat Oct 08, 2005 5:51 pm
I think I won?t be performing straight copies so should I allocate memory in the heap and work from there?
--Nacho
#56438 - poslundc - Sat Oct 08, 2005 7:21 pm
While EWRAM is faster for random access than ROM, if you use the standard waitstate settings on most manufactured cartridges it's not going to be a whole lot faster (in fact, shouldn't individual 32-bit word-loads take the same number of cycles from EWRAM as ROM, given the 16-bit bus width?). And ROM will still be faster for sequential copying.
The main advantage to EWRAM is that it's writeable, unlike ROM, so it's useful for doing things like decompressing data and storing larger aspects of the game state. I don't think it really performs well enough to behave effectively as a simple speed cache for data from the ROM.
Dan.
#56553 - Nacho - Sun Oct 09, 2005 6:28 pm
Then I?ll go for the ROM route. Thanks for your help!!
--Nacho