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:
@@ -47,7 +47,7 @@ ili9341Font12x16MonoHandlerFn:
|
||||
ili9341Font12x16MonoRenderChar:
|
||||
push zl
|
||||
push zh
|
||||
rcall ili9341Font12x16GetCharPosInFont ; (r24, r25, z)
|
||||
rcall ili9341Font12x16GetCharPosInFont ; (r16, r17, r18, r24, r25)
|
||||
ldi r25, 16 ; 16 bytes height
|
||||
ili9341Font12x16MonoRenderChar_loop1:
|
||||
ldi r24, 12 ; 12 bits
|
||||
@@ -92,13 +92,14 @@ ili9341Font12x16MonoRenderChar_loop2end:
|
||||
; @param R16 character to write
|
||||
; @param Z pointer to font
|
||||
; @return Z pointer to begin of char data
|
||||
; @clobbers r24, r25, z
|
||||
; @clobbers r16, r17, r18, r24, r25
|
||||
|
||||
ili9341Font12x16GetCharPosInFont:
|
||||
mov r24, r16
|
||||
adiw zh:zl, FONT_OFFS_FIRSTCHAR
|
||||
lpm r24, Z+ ; first char num
|
||||
lpm r25, Z+ ; num of chars
|
||||
lpm r25, Z ; num of chars
|
||||
sbiw zh:zl, FONT_OFFS_FIRSTCHAR+1
|
||||
sub r16, r24
|
||||
brcs ili9341Font12x16GetCharPosInFont_ret
|
||||
cp r16, r25
|
||||
@@ -116,6 +117,14 @@ ili9341Font12x16GetCharPosInFont:
|
||||
lsr r25 ; x32
|
||||
ror r24
|
||||
|
||||
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
|
||||
ili9341Font12x16GetCharPosInFont_ret:
|
||||
|
||||
Reference in New Issue
Block a user