From d4ad6844e3bd0cfdeff9c0312a0515fd379d5362 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 2 Jun 2025 01:03:23 +0200 Subject: [PATCH] ili9341: save X --- avr/modules/lcd2/ili9341/text.asm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/avr/modules/lcd2/ili9341/text.asm b/avr/modules/lcd2/ili9341/text.asm index 5345247..5950906 100644 --- a/avr/modules/lcd2/ili9341/text.asm +++ b/avr/modules/lcd2/ili9341/text.asm @@ -29,11 +29,15 @@ ; @clobbers r16 (r17, r20, r21, r22, r23, r24, r25, X) ili9341_WriteCharacterX1At: - 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 - adc r5, r9 + push xl + push xh + 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 + adc r5, r9 + pop xh + pop xl ret ; @end @@ -111,7 +115,7 @@ ili9341FontRenderChar: 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, z) + rcall ili9341JumpToFontRenderFn ; (r17, r24, r25, x) pop xh pop xl