While reading about framebuffer mode graphics from this tutorial, the following question arose:
How can just one main VRAM bank be used to render an entire DS screen, when the number of pixels far exceeds the number of uint16 values that can be stored in one bank?
((SCREEN_WIDTH * SCREEN_HEIGHT) / (8192 / 16) = 49152 / 512 != 1.)
Screen Size vs VRAM Bank Size
Re: Screen Size vs VRAM Bank Size
SCREEN_WIDTH * SCREEN_HEIGHT = 256 * 192 = 49152 pixels
Each pixel is 16 bit = 2 Byte wide, so:
49152 * 2 = 98304 Bytes = 98304 / 1024 = 96 KBytes
Each main bank is 128 KB wide, the screen requires 96 KB, so it fits just fine, if I understood your question
Each pixel is 16 bit = 2 Byte wide, so:
49152 * 2 = 98304 Bytes = 98304 / 1024 = 96 KBytes
Each main bank is 128 KB wide, the screen requires 96 KB, so it fits just fine, if I understood your question
Re: Screen Size vs VRAM Bank Size
Ok, I calculated the wrong number of bits. Instead of 8192 (way too small), there are 1048576, so 1048576 / 16 = 65536 or 2^16 uint16 values (or from bytes, 131072 / 2 = 65536, so there are more than enough to fill the screen, as you said.
Who is online
Users browsing this forum: No registered users and 0 guests