![]() |
libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
|
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.
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:
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 |
2, 18 | 190 | 191 | 192 | 193 | 194 | 195 |
3, 19 | 196 | 197 | 198 | 199 | 19A | 19B |
4, 20 | 1A0 | 1A1 | 1A2 | 1A3 | 1A4 | 1A5 |
5, 21 | 1A6 | 1A7 | 1A8 | 1A9 | 1AA | 1AB |
6, 22 | 1B0 | 1B1 | 1B2 | 1B3 | 1B4 | 1B5 |
7, 23 | 1B6 | 1B7 | 1B8 | 1B9 | 1BA | 1BB |
8, 24 | 1C0 | 1C1 | 1C2 | 1C3 | 1C4 | 1C5 |
9, 25 | 1C6 | 1C7 | 1C8 | 1C9 | 1CA | 1CB |
10, 26 | 1D0 | 1D1 | 1D2 | 1D3 | 1D4 | 1D5 |
11, 27 | 1D6 | 1D7 | 1D8 | 1D9 | 1DA | 1DB |
12, 28 | 1E0 | 1E1 | 1E2 | 1E3 | 1E4 | 1E5 |
13, 29 | 1E6 | 1E7 | 1E8 | 1E9 | 1EA | 1EB |
14, 30 | 1F0 | 1F1 | 1F2 | 1F3 | 1F4 | 1F5 |
15, 31 | 1F6 | 1F7 | 1F8 | 1F9 | 1FA | 1FB |
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 |
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 |
2, 18 | 190 | 191 | 192 | 193 | 194 | 195 |
3, 19 | 196 | 197 | 198 | 199 | 19A | 19B |
4, 20 | 1A0 | 1A1 | 1A2 | 1A3 | ||
6, 22 | 1B0 | 1B1 | 1B2 | 1B3 | ||