Display_classic
160x120 color display. Compatible with programs intended for titokone display. It has a memory mapped framebuffer. This means that every pixel has a memory address. The first pixel (top left) is located at address 0x2000 (or 8192 in decimal). The three least significant bytes are mapped to the color values: 0x00000RGB
, so writing 0x00000F00
to the framebuffer would result in a red pixel. The framebuffer is both readable and writable, but note that the it only stores the RGB values. The 5 other bytes will be lost.
Interrupts
Cause an interrupt at every refresh (~60Hz). See PIC.
Examples
See the screen test program for an example on how to interact with the display:
screen equ 0x2000
spstash equ 0x0100
color_r dc 0x0f00
color_g dc 0x00f0
color_b dc 0x000f
color_c dc 0x00ff
color_m dc 0x0f0f
color_y dc 0x0ff0
color_bl dc 0x0000
color_w dc 0x0fff
load r5, =screen
sub r5, =1 ; because push increments before writing!
load r3, r5
load r4, =160 ; R4 determines how many pixels to write in fill
mul r4, =15
add r3, r4 ; R3 has the address where we stop
load r1, color_r
call sp, fill
add r5, r4
add r3, r4
load r1, color_g
call sp, fill
add r5, r4
add r3, r4
load r1, color_b
call sp, fill
add r5, r4
add r3, r4
load r1, color_c
call sp, fill
add r5, r4
add r3, r4
load r1, color_m
call sp, fill
add r5, r4
add r3, r4
load r1, color_y
call sp, fill
add r5, r4
add r3, r4
load r1, color_bl
call sp, fill
add r5, r4
add r3, r4
load r1, color_w
call sp, fill
hcf ; Stop the program
fill store sp, spstash
load sp, r5
loop comp sp, r3
jnles end
push sp, r1
jump loop
load sp, spstash
end exit sp, =0