libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
XRAM

LCD Framebuffer pixel + icon format.

XRAM a special region of memory at the end of the RAM address space which is divided into three banks. Two XRAM banks combine to serve as the framebuffer for the screen, while the third bank drives the 4 icons at the bottom of the screen.

Banks 0-1: Framebuffer

The first two XRAM banks represent the framebuffer. It is stored from top-to-bottom order, with each 48 pixel row being a sequence of 6 bytes. Each pixel is a single bit moving from left-to-right in the order of MSB to LSB. There are two important things to note about its layout:

  • It's banked: so the top half of the screen uses bank 0 while the bottom half uses bank 1 of the same 0x180-0x1FB address range.
  • It's disjoint: data are only stored consecutively for two rows at a time, then a 4 byte skip occurs in the address range before continuing on to the next two rows.

The following table shows the byte addresses corresponding to each each 1x8 pixel region of the display.

Row/Col 0-7 8-15 16-23 24-31 32-39 40-47
0, 16 180 181 182 183 184 185
1, 17 186 187 188 189 18A 18B
Skip 4 Bytes
2, 18 190 191 192 193 194 195
3, 19 196 197 198 199 19A 19B
Skip 4 Bytes
4, 20 1A0 1A1 1A2 1A3 1A4 1A5
5, 21 1A6 1A7 1A8 1A9 1AA 1AB
Skip 4 Bytes
6, 22 1B0 1B1 1B2 1B3 1B4 1B5
7, 23 1B6 1B7 1B8 1B9 1BA 1BB
Skip 4 Bytes
8, 24 1C0 1C1 1C2 1C3 1C4 1C5
9, 25 1C6 1C7 1C8 1C9 1CA 1CB
Skip 4 Bytes
10, 26 1D0 1D1 1D2 1D3 1D4 1D5
11, 27 1D6 1D7 1D8 1D9 1DA 1DB
Skip 4 Bytes
12, 28 1E0 1E1 1E2 1E3 1E4 1E5
13, 29 1E6 1E7 1E8 1E9 1EA 1EB
Skip 4 Bytes
14, 30 1F0 1F1 1F2 1F3 1F4 1F5
15, 31 1F6 1F7 1F8 1F9 1FA 1FB
Note
Since the top and bottom halves of the screen share the same address range, using different banks, the same address can refer to two different rows, offset by 16.

Bank 2: Icons

Bank 2 of XRAM is used to drive the icons at the bottom of the screen. Again, we have a disjoint layout, where, starting at bit 6 of address 0x181, each icon is assigned two bits lower of the next byte.

7 6 5 4 3 2 1 0
0x181 FILE
0x182 GAME
0x183 CLOCK
0x184 FLASH

Holes and Extra RAM

The 4-byte skips don't seem to decode RAM, writes are not effective and reads return 0xFF, this pattern persists across all of the framebuffer regions and also in the icon bank. Additionally there are 32 bytes of icon RAM bytes, in which 4 are used to display the icons you normally see and the remaining 28 just being unused RAM in which you can freely write and read from

The icon RAM bytes are distibuted around Bank 2 in this order

Row/Col 0-7 8-15 16-23 24-31 32-39 40-47
0, 16 180 181 182 183 184 185
1, 17 186 187 188 189 18A 18B
Skip 4 Bytes
2, 18 190 191 192 193 194 195
3, 19 196 197 198 199 19A 19B
Skip 4 Bytes
4, 20 1A0 1A1 1A2 1A3
Skip 12 Bytes
6, 22 1B0 1B1 1B2 1B3
remaining is empty Bytes