We're looking for your comments on how to best organize the wiki's content.

LEM1802 Display

(Difference between revisions)
Jump to: navigation, search
(Font: rewording, grammar)
m (Font)
Line 133: Line 133:
 
0000
 
0000
 
1110
 
1110
 +
1000
 
1000
 
1000
 
1100
 
1100
 +
1000
 
1000
 
1000
 
1110
 
1110

Revision as of 23:13, 11 June 2012

Built in font

The LEM1802 (LEM stands for "Low Energy Monitor") is a 128x96 pixel color display compatible with the DCPU-16. It was developed and manufactured by Nya Elektriska, and is fully backwards compatible with the LEM1801. The display is made up of 32x12 16 bit cells. Each cell displays one monochrome 4x8 pixel character out of 128 available. Each cell has its own foreground and background color out of a palette of 16 colors. The official specification can be read here: http://dcpu.com/highnerd/rc_1/lem1802.txt

Contents

Hardware info

Name LEM1802
ID 0x7349f615
Version 0x1802
Manufacturer 0x1c6c8b36 (NYA_ELEKTRISKA)
Colors 4,096 (RGB, 4 bits per channel)
Palette size 16 different colors

Interrupts

A Name Behavior
0 MEM_MAP_SCREEN Reads the B register, and maps the video RAM to DCPU-16 RAM starting at address B. See below for a description of video RAM. If B is 0, the screen is disconnected.

When the screen goes from 0 to any other value, the the LEM1802 takesabout one second to start up. Other interrupts sent during this time are still processed.

1 MEM_MAP_FONT Reads the B register, and maps the font RAM to DCPU-16 RAM starting at address B. See below for a description of font RAM.

If B is 0, the default font is used instead.

2 MEM_MAP_PALETTE Reads the B register, and maps the color palette RAM to DCPU-16 RAM starting at address B. See below for a description of color palette RAM.

If B is 0, the default color palette is used instead.

3 SET_BORDER_COLOR Reads the B register, and sets the border color to palette index B&0xF
4 MEM_DUMP_FONT Reads the B register, and writes the default font data to DCPU-16 RAM starting at address B.

Halts the DCPU-16 for 256 cycles

5 MEM_DUMP_PALETTE Reads the B register, and writes the default color palette data to DCPU-16 RAM starting at address B.

Halts the DCPU-16 for 16 cycles

Video RAM

The LEM1802 has no internal video RAM, but rather relies on being assigned an area of the DCPU-16 RAM. The size of this area is 386 words, and is made up of 32x12 cells of the following bit format (in LSB-0):

   ffffbbbbBccccccc

The lowest 7 bits (ccccccc) select define the character to display. ffff and bbbb select which foreground and background color to use. If B (bit 7) is set, the character color will blink slowly.

Palette

The display can store 16 different colors in its palette. It has a built in palette but it is also customizable. A 16 word region can be mapped to the display with one word per palette entry. Each palette entry has the following bit format:

   0000rrrrggggbbbb

where r is red, g is green and b is blue. Higher values mean lighter colors. So for example 0000-1111-1111-1111 would be white.

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 #ff55555   
d 1101 #ff55ff   
e 1110 #ffff55   
f 1111 #ffffff   

Font

The LEM1802 also features a built in font, shown above. The font contains 128 characters, all of which can be customized.

As every character bitmap contains two words, mapping all characters requires a 256-word space. In each character bitmap, bits can be set to indicate the foreground color, or cleared to indicate the background. The bits are counted from the bottom-left to the top. For example, a capital E would look like this on the screen:

0000
1110
1000
1000
1100
1000
1000
1110

Note the room left on the top and side for spacing between the characters. In bitmap data for this would be:

word1: 111110 101010
word2: 100010 000000
Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox