merge
[dcpu16] / docs / lem1802.txt
1 NE_LEM1802 v1.0
2
3 \ | ___
4 |\ \| ___
5 | \
6
7 NYA ELEKTRISKA
8 innovation information
9
10
11
12
13 DCPU-16 Hardware Info:
14 Name: LEM1802 - Low Energy Monitor
15 ID: 0x7349f615, version: 0x1802
16 Manufacturer: 0x1c6c8b36 (NYA_ELEKTRISKA)
17
18
19 Description:
20 The LEM1802 is a 128x96 pixel color display compatible with the DCPU-16.
21 The display is made up of 32x12 16 bit cells. Each cell displays one
22 monochrome 4x8 pixel character out of 128 available. Each cell has its own
23 foreground and background color out of a palette of 16 colors.
24
25 The LEM1802 is fully backwards compatible with LEM1801 (0x7349f615/0x1801),
26 and adds support for custom palettes and fixes the double buffer color
27 bleed bug.
28
29
30 Interrupt behavior:
31 When a HWI is received by the LEM1802, it reads the A register and does one
32 of the following actions:
33
34 0: MEM_MAP_SCREEN
35 Reads the B register, and maps the video ram to DCPU-16 ram starting
36 at address B. See below for a description of video ram.
37 If B is 0, the screen is disconnected.
38 When the screen goes from 0 to any other value, the the LEM1802 takes
39 about one second to start up. Other interrupts sent during this time
40 are still processed.
41 1: MEM_MAP_FONT
42 Reads the B register, and maps the font ram to DCPU-16 ram starting
43 at address B. See below for a description of font ram.
44 If B is 0, the default font is used instead.
45 2: MEM_MAP_PALETTE
46 Reads the B register, and maps the palette ram to DCPU-16 ram starting
47 at address B. See below for a description of palette ram.
48 If B is 0, the default palette is used instead.
49 3: SET_BORDER_COLOR
50 Reads the B register, and sets the border color to palette index B&0xF
51 4: MEM_DUMP_FONT
52 Reads the B register, and writes the default font data to DCPU-16 ram
53 starting at address B.
54 Halts the DCPU-16 for 256 cycles
55 5: MEM_DUMP_PALETTE
56 Reads the B register, and writes the default palette data to DCPU-16
57 ram starting at address B.
58 Halts the DCPU-16 for 16 cycles
59
60
61 Video ram:
62 The LEM1802 has no internal video ram, but rather relies on being assigned
63 an area of the DCPU-16 ram. The size of this area is 386 words, and is
64 made up of 32x12 cells of the following bit format (in LSB-0):
65 ffffbbbbBccccccc
66 The lowest 7 bits (ccccccc) select define character to display.
67 ffff and bbbb select which foreground and background color to use.
68 If B (bit 7) is set the character color will blink slowly.
69
70
71 Font ram:
72 The LEM1802 has a default built in font. If the user chooses, they may
73 supply their own font by mapping a 256 word memory region with two words
74 per character in the 128 character font.
75 By setting bits in these words, different characters and graphics can be
76 achieved. For example, the character F looks like this:
77 word0 = 1111111100001001
78 word1 = 0000100100000000
79 Or, split into octets:
80 word0 = 11111111 /
81 00001001
82 word1 = 00001001 /
83 00000000
84
85
86 Palette ram:
87 The LEM1802 has a default built in palette. If the user chooses, they may
88 supply their own palette by mapping a 16 word memory region with one word
89 per palette entry in the 16 color palette.
90 Each color entry has the following bit format (in LSB-0):
91 0000rrrrggggbbbb
92 Where r, g, b are the red, green and blue channels. A higher value means a
93 lighter color.
94
95
96 A message from Ola:
97 Hello!
98
99 It is fun to see that so many people use our products. When I was a small
100 boy, my dad used to tell me "Ola, take care of those who understand less
101 than you. Lack of knowledge is dangerous, but too much is worse".
102 Here at Nya Elektriska have we always tried to improve mankind by showing
103 them the tools required to improve and reach their true potential.
104 Together, you will wake up in time.
105
106 - Ola Kristian Carlsson