Hello. I'm doing my screen refreshing routine, and I'm not sure of a good way to handle wrap around when scrolling. My current idea is to duplicate prerendered nametables in a layout like this:
That way, I won't have to deal with edge case when scroll x/y is bigger than 256/240. I would assume that would be more efficient as it'll remove a few ifs, the drawback of course is that'll take more memory.
Is that a good idea?
Code:
+-----+-----+-----+
|$2000|$2400|$2000|
+-----+-----+-----+
|$2800|$2c00|$2800|
+-----+-----+-----+
|$2000|$2400|$2000|
+-----+-----+-----+
|$2000|$2400|$2000|
+-----+-----+-----+
|$2800|$2c00|$2800|
+-----+-----+-----+
|$2000|$2400|$2000|
+-----+-----+-----+
That way, I won't have to deal with edge case when scroll x/y is bigger than 256/240. I would assume that would be more efficient as it'll remove a few ifs, the drawback of course is that'll take more memory.
Is that a good idea?