We're looking for your comments on how to best organize the wiki's content.
Video RAM
| This article contains speculation about 0x10c Discuss Several aspects of this article are based on rumors about the game or from evidence from screenshots. Specifics may vary from what's described here.
|
Video RAM is storage used by the display system of DCPU-16 computers to provide a visual interface for the user. All aspects of video hardware are controlled by the same memory-mapped addresses.
Contents |
[edit] Known information
Notch posted a screenshot of DCPU assembly instructions and a hello world screen; from this we can infer:- Text VRAM starts at a user defined location (Register B when an interrupt is sent to the screen) and is word-based (16bits per address cell) like other memory and is in the same address space as the rest of the processor uses.
- The low 7 bits determine the character shown.
- The 8th bit from the right sets whether or not the character should blink on the screen.
- The high 8 bits determine the color; the highest 4 are the foreground and the lowest 4 are the background.
- The color nibbles use (from LSB to MSB) blue, green, red, highlight. (Normal 16color from PCs, though probably with darkyellow instead of brown) -- maybe, see below
- The screen appears to be 32 characters by 12 lines, with a character cell of 4x8 pixels, suggesting possible graphics modes of 128x96 pixels at that resolution. This matches the expected 4:3 aspect ratio.
[edit] Color table
The RGB values here and the resulting colors are approximations that may vary before release. In particular, Notch's screenshots look lighter and slightly desaturated, perhaps pre-emphasizing blue to compensate for human perceptual biases. See below for comments on color 6.
| Value | RGB hex | Result | |
|---|---|---|---|
| Hex | Bin | ||
| 0 | 0000 | #000000 | |
| 1 | 0001 | #0000aa | |
| 2 | 0010 | #00aa00 | |
| 3 | 0011 | #00aaaa | |
| 4 | 0100 | #aa0000 | |
| 5 | 0101 | #aa00aa | |
| 6 | 0110 | #aa5500 | |
| 7 | 0111 | #aaaaaa | |
| Value | RGB hex | Result | |
|---|---|---|---|
| Hex | Bin | ||
| 8 | 1000 | #555555 | |
| 9 | 1001 | #5555ff | |
| a | 1010 | #55ff55 | |
| b | 1011 | #55ffff | |
| c | 1100 | #ff5555 | |
| d | 1101 | #ff55ff | |
| e | 1110 | #ffff55 | |
| f | 1111 | #ffffff | |
[edit] Leaked .jar specification
Recently, a specification of a leaked .jar appeared describing a number of details about the display system that were previously only speculation.
- Immediately after the text page (or more accurately, the tile page), 256 words define the bits of the characters. It's not clear what the power-on status of this memory should be, though Notch definitely has a font in mind.
- 128 characters are possible, as each character takes two words to define. The bits fill top to bottom, then left to right, from Most Significant Bit to Least Significant Bit in each word. (The leaked spec has a nice ASCII diagram.)
- The word just beyond the character definition table sets the text "background" -- most likely the screen border.
- The color model is such that each channel is driven as above, with 0xAA as the default level, and all levels +0x55 when highlight is present.
- There is a comment about overdriving green when red+green is set without highlight. This is similar to the traditional CGA/EGA "brown" instead of "dark yellow" but in reverse. The normal CGA/EGA brown would use the highlight drive level of 0x55 for a diminished green, e.g. 0b0110 should be ARGB 0xFFAA5500 , but this spec describes 0xFFAAFF00 instead, making a horrific fluorescent green thing.[1]
- A decompile of the .jar[2] shows g += 85, matching this spec and confirms Notch intended to do something with color 6, but likely this is a bug and the code should read g -= 85 for the above reasons.
[edit] Sprites and scrolling
Notch commented [3] that he intends for "hardware sprites and scrolling on the display." Given the position of the character definition table adjacent to the page table, it's not clear where the scrolling background pages might reside or how they might connect to each other visually.
[edit] References
- ↑ http://en.wikipedia.org/wiki/Color_Graphics_Adapter#Color_palette
- ↑ http://pastie.org/private/v75tsmzuaotcsmnbwyvhnq
- ↑ https://twitter.com/#!/notch/status/187448902314762240
| ||||||||

