avr: more work on gui2
- decreased complexitiy by removing guicntl - changed fonts to allow for storing bitmaps in ressource segment - add fonts to ressources for display node c03 - added some safety features (check pointers, add magic field to objects etc) - moved style.asm to device folder
This commit is contained in:
@@ -49,11 +49,7 @@ ili9341Font6x8MonoHandlerFn:
|
||||
ili9341Font6x8WriteChar:
|
||||
push zl
|
||||
push zh
|
||||
adiw zh:zl, FONT_OFFS_WIDTH
|
||||
lpm r18, Z+ ; char width in pixels
|
||||
lpm r19, Z ; char height in pixels
|
||||
sbiw zh:zl, FONT_OFFS_WIDTH+1
|
||||
rcall ili9341Font6x8GetCharPosInFont ; (r16, r24, r25, z)
|
||||
rcall ili9341Font6x8GetCharPosInFont ; (r16, r17, r18, r24, r25)
|
||||
mov r25, r19 ; height in pixels
|
||||
ili9341Font6x8WriteChar_loop1:
|
||||
mov r24, r18 ; width in pixels
|
||||
@@ -78,6 +74,8 @@ ili9341Font6x8WriteChar_loop2end:
|
||||
dec r25
|
||||
brne ili9341Font6x8WriteChar_loop1
|
||||
ili9341Font6x8WriteChar_end:
|
||||
ldi r18, 6
|
||||
ldi r19, 8
|
||||
pop zh
|
||||
pop zl
|
||||
ret
|
||||
@@ -91,13 +89,14 @@ ili9341Font6x8WriteChar_end:
|
||||
; @param R16 character to write
|
||||
; @param Z pointer to font
|
||||
; @return Z pointer to begin of char data
|
||||
; @clobbers r16, r24, r25, z
|
||||
; @clobbers r16, r17, r18, r24, r25
|
||||
|
||||
ili9341Font6x8GetCharPosInFont:
|
||||
adiw zh:zl, FONT_OFFS_FIRSTCHAR
|
||||
lpm r24, Z+ ; first char num
|
||||
lpm r25, Z+ ; num of chars
|
||||
; Z now points to begin of font data
|
||||
lpm r25, Z ; num of chars
|
||||
sbiw zh:zl, FONT_OFFS_FIRSTCHAR+1
|
||||
|
||||
sub r16, r24
|
||||
brcs ili9341Font6x8GetCharPosInFont_ret
|
||||
cp r16, r25
|
||||
@@ -110,6 +109,15 @@ ili9341Font6x8GetCharPosInFont:
|
||||
rol r25
|
||||
lsl r24 ; x8
|
||||
rol r25
|
||||
|
||||
adiw zh:zl, FONT_OFFS_RESSOURCEID_LO
|
||||
lpm r16, Z+
|
||||
lpm r17, Z
|
||||
ldi zl, LOW(RESSOURCE_ADDR*2)
|
||||
ldi zh, HIGH(RESSOURCE_ADDR*2)
|
||||
bigcall RES_GetRessource ; (r16, r17, r18)
|
||||
; ignore error here
|
||||
|
||||
add zl, r24
|
||||
adc zh, r25
|
||||
ili9341Font6x8GetCharPosInFont_ret:
|
||||
|
||||
Reference in New Issue
Block a user