more work on images on ili9341
- reading images from predefined ressources (stored at 0x8000+) works - drawing IDX2 images within widgets works - added some image ressources in IDX2 format
This commit is contained in:
@@ -31,6 +31,10 @@ testWin_ramdata:
|
||||
testWinHeader_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
testWinBody_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
@@ -96,7 +100,7 @@ testWin_signalmap:
|
||||
|
||||
testWinHeader_flashdata:
|
||||
; OBJECT
|
||||
.dw 0 ; next
|
||||
.dw testWinBody_flashdata*2 ; next
|
||||
.dw testWin_flashdata*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
@@ -124,6 +128,77 @@ testWinHeader_signalmap:
|
||||
|
||||
|
||||
|
||||
testWinBody_flashdata:
|
||||
; OBJECT
|
||||
.dw 0 ; next
|
||||
.dw testWin_flashdata*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw testWinBody_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
; .dw DISPLAY_COLOR_YELLOW
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw testWinBody_ramdata ; ptr to SDRAM
|
||||
|
||||
testWinBody_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(ImageViewer_OnDraw), HIGH(ImageViewer_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
ImageViewer_OnDraw:
|
||||
bigcall Widget_GetSdramPtr ; (none)
|
||||
ldd r16, Y+WIDGET_SD_OFFS_FLAGS
|
||||
andi r16, (1<<WIDGET_FLAGS_DIRTY_BIT)
|
||||
breq ImageViewer_OnDraw_ret
|
||||
|
||||
rcall Widget_Clear
|
||||
|
||||
push zl
|
||||
push zh
|
||||
ldi zl, LOW(RESSOURCE_ADDR*2)
|
||||
ldi zh, HIGH(RESSOURCE_ADDR*2)
|
||||
ldi r16, LOW(RESSSOURCE_IMG_CLOUD)
|
||||
ldi r17, HIGH(RESSSOURCE_IMG_CLOUD)
|
||||
rcall RES_GetRessource
|
||||
mov r12, zl
|
||||
mov r13, zh
|
||||
pop zh
|
||||
pop zl
|
||||
brcc ImageViewer_OnDraw_done
|
||||
|
||||
ldi r16, LOW(DISPLAY_COLOR_DARKGREEN) ; background color
|
||||
mov r0, r16
|
||||
ldi r16, HIGH(DISPLAY_COLOR_DARKGREEN)
|
||||
mov r1, r16
|
||||
ldi r16, 4 ; X
|
||||
mov r4, r16
|
||||
clr r5
|
||||
ldi r16, 4
|
||||
mov r6, r16 ; Y
|
||||
clr r7
|
||||
|
||||
bigcall Widget_DrawImage
|
||||
|
||||
ImageViewer_OnDraw_done:
|
||||
bigcall Widget_GetSdramPtr ; (none)
|
||||
ldd r16, Y+WIDGET_SD_OFFS_FLAGS
|
||||
cbr r16, (1<<WIDGET_FLAGS_DIRTY_BIT)
|
||||
std Y+WIDGET_SD_OFFS_FLAGS, r16
|
||||
|
||||
ImageViewer_OnDraw_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user