avr: added titled windows

This commit is contained in:
Martin Preuss
2025-11-03 21:02:25 +01:00
parent e58e9b846c
commit 5b72686904
9 changed files with 352 additions and 89 deletions

View File

@@ -15,9 +15,30 @@
; FEDCBA9876543210
; 0bRRRRRGGGGGGBBBBB
#define DISPLAY_COLOR_FROM_RGB(r, g, b) ((r<<11) | (g<<5) | (b & 0x1f))
;#define DISPLAY_COLOR_FROM_RGB(r, g, b) ((r<<11) | (g<<5) | (b & 0x1f))
.equ DISPLAY_COLOR_BLACK = 0x0000 ; 0, 0, 0
.equ DISPLAY_COLOR_NAVY = 0x000F ; 0, 0, 128
.equ DISPLAY_COLOR_DARKGREEN = 0x03E0 ; 0, 128, 0
.equ DISPLAY_COLOR_DARKCYAN = 0x03EF ; 0, 128, 128
.equ DISPLAY_COLOR_MAROON = 0x7800 ; 128, 0, 0
.equ DISPLAY_COLOR_PURPLE = 0x780F ; 128, 0, 128
.equ DISPLAY_COLOR_OLIVE = 0x7BE0 ; 128, 128, 0
.equ DISPLAY_COLOR_LIGHTGREY = 0xC618 ; 192, 192, 192
.equ DISPLAY_COLOR_DARKGREY = 0x7BEF ; 128, 128, 128
.equ DISPLAY_COLOR_BLUE = 0x001F ; 0, 0, 255
.equ DISPLAY_COLOR_GREEN = 0x07E0 ; 0, 255, 0
.equ DISPLAY_COLOR_CYAN = 0x07FF ; 0, 255, 255
.equ DISPLAY_COLOR_RED = 0xF800 ; 255, 0, 0
.equ DISPLAY_COLOR_MAGENTA = 0xF81F ; 255, 0, 255
.equ DISPLAY_COLOR_YELLOW = 0xFFE0 ; 255, 255, 0
.equ DISPLAY_COLOR_WHITE = 0xFFFF ; 255, 255, 255
.equ DISPLAY_COLOR_ORANGE = 0xFD20 ; 255, 165, 0
.equ DISPLAY_COLOR_GREENYELLOW = 0xAFE5 ; 173, 255, 47
.equ DISPLAY_COLOR_PINK = 0xF81F
#endif

View File

@@ -47,7 +47,7 @@ ili9341Font12x20MonoHandlerFn:
ili9341Font12x20MonoRenderChar:
push zl
push zh
rcall ili9341Font12x20GetCharPosInFont ; (r17, r24, r25, z)
rcall ili9341Font12x20GetCharPosInFont ; (r24, r25, z)
ldi r25, 20 ; 20 bytes height
ili9341Font12x20MonoRenderChar_loop1:
ldi r24, 12 ; 16 bits
@@ -68,10 +68,10 @@ ili9341Font12x20MonoRenderChar_writeForeground:
mov r18, r2
mov r19, r3
ili9341Font12x20MonoRenderChar_sendToDisplay:
mov r16, r18
rcall SPIHW_MasterTransfer ; (R16)
mov r16, r19
rcall SPIHW_MasterTransfer ; (R16)
mov r16, r18
rcall SPIHW_MasterTransfer ; (R16)
ili9341Font12x20MonoRenderChar_loop2end:
dec r24
brne ili9341Font12x20MonoRenderChar_loop2
@@ -92,7 +92,7 @@ ili9341Font12x20MonoRenderChar_loop2end:
; @param R16 character to write
; @param Z pointer to font
; @return Z pointer to begin of char data
; @clobbers r17, r24, r25, z
; @clobbers r24, r25, z
ili9341Font12x20GetCharPosInFont:
mov r24, r16