c03: removed test code.

This commit is contained in:
Martin Preuss
2026-04-06 01:56:54 +02:00
parent 5c2f7496c3
commit 0e501274eb

View File

@@ -285,235 +285,6 @@ Debug_Style:
mkTestWindow:
bigcall GuiApp_GetRootWindow
brcc mkTestWindow_ret
mov xl, r18 ; use root window as parent for main window
mov xh, r19
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_LIVINGROOM) ; TODO: use "Room Climate"
ldi r21, HIGH(RESSSOURCE_TXT_LIVINGROOM)
bigcall MainWindow_new
brcc mkTestWindow_ret
; Y=MainWindow
push yl
push yh
bigcall MainWindow_GetContentWidget ; r19:r18=content window
brcc mkTestWindow_popRet
mov xl, r18 ; use content window as parent
mov xh, r19
push xl ; content window
push xh
rcall mkTestWidgets
; rcall mkSimpleTestWidgets
pop xh
pop xl
mkTestWindow_popRet:
pop yh
pop yl
ldi r16, LOW(Debug_Style*2)
std Y+WIDGET_OFFS_STYLE_LO, r16
ldi r16, HIGH(Debug_Style*2)
std Y+WIDGET_OFFS_STYLE_HI, r16
mkTestWindow_ret:
ret
; @end
; ---------------------------------------------------------------------------
; @routine mkTestWidgets
;
; @param X pointer to MainWindow content window (becomes parent)
; @return CFLAG set of okay, cleared otherwise
; @return Y address of newly created object
mkTestWidgets:
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT) ; OPT
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, MLAYOUT_MODE_COLUMNS
ldi r21, 3
bigcall MLayout_new
sts mLayoutWidget, yl
sts mLayoutWidget+1, yh
; brcc mkTestWidgets_ret
push yl
push yh
mov xl, yl ; use HLayout as parent
mov xh, yh
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_KITCHEN)
ldi r21, HIGH(RESSSOURCE_TXT_KITCHEN)
bigcall Label_new
sts widget1, yl
sts widget1+1, yh
pop xh
pop xl
; brcc mkTestWidgets_popRet
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_CORRIDOR)
ldi r21, HIGH(RESSSOURCE_TXT_CORRIDOR)
bigcall Label_new
sts widget2, yl
sts widget2+1, yh
pop xh
pop xl
brcc mkTestWidgets_popRet
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_TEMP_S)
ldi r21, HIGH(RESSSOURCE_TXT_TEMP_S)
bigcall Label_new
sts widget3, yl
sts widget3+1, yh
pop xh
pop xl
brcc mkTestWidgets_popRet
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_BATHROOM)
ldi r21, HIGH(RESSSOURCE_TXT_BATHROOM)
bigcall Label_new
sts widget4, yl
sts widget4+1, yh
pop xh
pop xl
brcc mkTestWidgets_popRet
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_CELLAR)
ldi r21, HIGH(RESSSOURCE_TXT_CELLAR)
bigcall Label_new
sts widget5, yl
sts widget5+1, yh
pop xh
pop xl
brcc mkTestWidgets_popRet
push xl ; MLayout
push xh
ldi r16, (1<<WIDGET_OPTS_BORDER_BIT)
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_CO2_S)
ldi r21, HIGH(RESSSOURCE_TXT_CO2_S)
bigcall Label_new
sts widget6, yl
sts widget6+1, yh
pop xh
pop xl
brcc mkTestWidgets_popRet
; rcall testMLayout
; sec
mkTestWidgets_popRet:
pop yh
pop yl
mkTestWidgets_ret:
ret
; @end
mkSimpleTestWidgets:
push xl ; Contentwindow
push xh
ldi r16, 0
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_IMG_HUMIDITY96)
ldi r21, HIGH(RESSSOURCE_IMG_HUMIDITY96)
bigcall ImageView_new
pop xh
pop xl
brcc mkSimpleTestWidgets_ret
push xl ; HLayout
push xh
ldi r16, 0
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_IMG_CLOUD96)
ldi r21, HIGH(RESSSOURCE_IMG_CLOUD96)
bigcall ImageView_new
pop xh
pop xl
brcc mkSimpleTestWidgets_ret
mkSimpleTestWidgets_ret:
ret
; @end
testMLayout:
lds yl, widget1
lds yh, widget1+1
clr r20
ldi r25, 3
ldi zl, LOW(testMLayout_cb)
ldi zh, HIGH(testMLayout_cb)
bigcall mLayoutForEveryObjectSkipped
; bigcall mLayoutForEveryObjectContiguous
ret
testMLayout_cb:
cpi r20, 0
breq testMLayout_cb0
cpi r20, 1
breq testMLayout_cb1
rjmp testMLayout_end
bigjmp DEBUG3
testMLayout_cb0:
lds r18, widget1
lds r19, widget1+1
cp yl, r18
brne testMLayout_error1
cp yh, r19
brne testMLayout_error1
rjmp testMLayout_end
testMLayout_cb1:
lds r18, widget4
lds r19, widget4+1
cp yl, r18
brne testMLayout_error2
cp yh, r19
brne testMLayout_error2
rjmp testMLayout_end
testMLayout_error1:
bigjmp DEBUG1
testMLayout_error2:
bigjmp DEBUG4
testMLayout_end:
inc r20
clc
ret
; *************************************************************************** ; ***************************************************************************
; includes ; includes
@@ -592,16 +363,8 @@ deviceCodeEnd:
.dseg .dseg
guiApp: .byte 2 guiApp: .byte 2
; debug
rootWindow: .byte 2
mainWin1: .byte 2
mLayoutWidget: .byte 2
widget1: .byte 2
widget2: .byte 2
widget3: .byte 2
widget4: .byte 2
widget5: .byte 2
widget6: .byte 2
heapStart: heapStart: