avr: started working on xpt2046 module.
This commit is contained in:
@@ -11,6 +11,24 @@
|
||||
#define AQH_AVR_GUI_WINDOW_ASM
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Window_Init @global
|
||||
;
|
||||
; @param Y pointer to screen object in SDRAM
|
||||
; @clobbers R16, R17, X
|
||||
|
||||
Window_Init:
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
ldi r17, WIN_SIZE
|
||||
clr r16
|
||||
bigcall Utils_FillSram ; (R17, X)
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Window_Clear @global
|
||||
;
|
||||
@@ -34,6 +52,32 @@ Window_Clear:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Window_FillRect @global
|
||||
;
|
||||
; @param Y pointer to screen object in SDRAM
|
||||
; @param r3:r2 color
|
||||
; @param r5:r4 X0
|
||||
; @param r7:r6 Y0
|
||||
; @param r9:r8 X1/W
|
||||
; @param r11:r10 Y1/H
|
||||
; @clobbers any, !Y
|
||||
|
||||
Window_FillRect:
|
||||
ldd r16, Y+WIN_OFFS_X_LO ; make absolute coords
|
||||
ldd r17, Y+WIN_OFFS_X_HI
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
ldd r16, Y+WIN_OFFS_Y_LO
|
||||
ldd r17, Y+WIN_OFFS_Y_HI
|
||||
add r6, r16
|
||||
adc r7, r17
|
||||
bigcall Display_FillRect ; directly call graphics function
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Window_DrawTextFlash @global
|
||||
;
|
||||
@@ -41,25 +85,43 @@ Window_Clear:
|
||||
; @param R5:R4 X (dest)
|
||||
; @param R7:R6 Y (dest)
|
||||
; @return R5:R4 X pos behind string
|
||||
|
||||
; @clobbers any, !Y, !R6, !R7
|
||||
|
||||
Window_DrawTextFlash:
|
||||
rcall winCalcAbsPosAndBorders ; (R18, R19)
|
||||
|
||||
ldd r0, Y+WIN_OFFS_BG_COL_LO
|
||||
ldd r1, Y+WIN_OFFS_BG_COL_HI
|
||||
ldd r2, Y+WIN_OFFS_FG_COL_LO
|
||||
ldd r3, Y+WIN_OFFS_FG_COL_HI
|
||||
|
||||
Window_DrawTextFlash_loop:
|
||||
rjmp Window_DrawColorTextFlash
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Window_DrawColorTextFlash @global
|
||||
;
|
||||
; @param Y pointer to screen object in SDRAM
|
||||
; @param R1:R0 background color
|
||||
; @param R3:R2 foreground color
|
||||
; @param R5:R4 X (dest)
|
||||
; @param R7:R6 Y (dest)
|
||||
; @return R5:R4 X pos behind string
|
||||
|
||||
; @clobbers any, !Y, !R6, !R7
|
||||
|
||||
Window_DrawColorTextFlash:
|
||||
rcall winCalcAbsPosAndBorders ; (R18, R19)
|
||||
Window_DrawColorTextFlash_loop:
|
||||
lpm r16, Z
|
||||
tst r16
|
||||
breq Window_DrawTextFlash_loopEnd
|
||||
breq Window_DrawColorTextFlash_loopEnd
|
||||
rcall winDrawChar
|
||||
brcc Window_DrawTextFlash_loopEnd
|
||||
brcc Window_DrawColorTextFlash_loopEnd
|
||||
adiw zh:zl, 1 ; next char
|
||||
rjmp Window_DrawTextFlash_loop
|
||||
Window_DrawTextFlash_loopEnd:
|
||||
rjmp Window_DrawColorTextFlash_loop
|
||||
Window_DrawColorTextFlash_loopEnd:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user