avr: more general approach to fonts.

This commit is contained in:
Martin Preuss
2025-06-02 21:13:44 +02:00
parent cd1fce313e
commit b82e0d02df
18 changed files with 1214 additions and 238 deletions

View File

@@ -31,7 +31,7 @@
ili9341_WriteCharacterX1At:
push xl
push xh
rcall ili9341FontRenderChar ; (r16, r17, r24, r25, z)
rcall ili9341FontRenderChar ; (r16, r17, r24, r25, z)
rcall ili9341BitBlit ; (r16, r17, r20, r21, r22, r23, r24, r25, X)
; advance X (add char width to X)
add r4, r8
@@ -58,7 +58,7 @@ ili9341_WriteCharacterX1At:
; @clobbers r16 (r17, r18, r19, r20, r21, r22, r23, r24, r25, X)
ili9341_WriteCharacterX2At:
rcall ili9341FontRenderChar ; (r16, r17, r24, r25, z)
rcall ili9341FontRenderChar ; (r16, r17, r24, r25, z)
rcall ili9341BitBlitStretch2 ; (r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, X)
; advance X (add double char width to X)
lsl r8 ; Wx2
@@ -114,8 +114,7 @@ ili9341FontRenderChar:
; render character
push xl
push xh
; call render function of the selected font (first word of font is jmp to render function)
rcall ili9341JumpToFontRenderFn ; (r17, r24, r25, x)
rcall FONT_RenderChar
pop xh
pop xl
@@ -129,24 +128,6 @@ ili9341FontRenderChar:
; ---------------------------------------------------------------------------
; @routine ili9341JumpToFontRenderFn
;
; helper function to call function at the beginning of the given font
; @clobbers r17
ili9341JumpToFontRenderFn:
lpm r17, Z+
push r17
lpm r17, Z
push r17
sbiw zh:zl, 1
ret
; @end
; ---------------------------------------------------------------------------
; @routine textNibbleToAscii
;
@@ -169,7 +150,7 @@ textNibbleToAscii_l1:
#if 0
; ---------------------------------------------------------------------------
; @routine ili9341_WriteCharacterX4At
@@ -272,6 +253,7 @@ Debug_WriteHexBuffer_loop:
brne Debug_WriteHexBuffer_loop
ret
#endif