Screen Size vs VRAM Bank Size

Post Reply
Tron
Posts: 15
Joined: Wed Jan 20, 2010 1:01 pm
Location: USA
Contact:

Screen Size vs VRAM Bank Size

Post by Tron » Fri Jan 22, 2010 9:47 am

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.)

Legolas
Posts: 10
Joined: Fri May 09, 2008 1:16 am

Re: Screen Size vs VRAM Bank Size

Post by Legolas » Fri Jan 22, 2010 10:36 am

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

Tron
Posts: 15
Joined: Wed Jan 20, 2010 1:01 pm
Location: USA
Contact:

Re: Screen Size vs VRAM Bank Size

Post by Tron » Fri Jan 22, 2010 11:23 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests