gui2: fixed an important bug (was decrementing r25!)
This commit is contained in:
@@ -19,6 +19,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.macro M_MLAYOUT_FOREVERY_CONT
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
ldi zl, LOW(@0)
|
||||||
|
ldi zh, HIGH(@0)
|
||||||
|
rcall mLayoutForEveryObjectContiguous
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.macro M_MLAYOUT_FOREVERY_SKIPPED
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
ldi zl, LOW(@0)
|
||||||
|
ldi zh, HIGH(@0)
|
||||||
|
rcall mLayoutForEveryObjectSkipped
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
; defines
|
; defines
|
||||||
|
|
||||||
@@ -266,9 +290,9 @@ mLayoutCallbackPositionY:
|
|||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||||
sbrs r16, WIDGET_FLAGS_VISIBLE_BIT
|
sbrs r16, WIDGET_FLAGS_VISIBLE_BIT
|
||||||
rjmp mLayoutCallbackPositionY_ret
|
rjmp mLayoutCallbackPositionY_ret
|
||||||
ldd r18, Y+WIDGET_OFFS_TMP_LO ; calculated cell width
|
ldd r18, Y+WIDGET_OFFS_TMP_LO ; calculated cell width
|
||||||
ldd r19, Y+WIDGET_OFFS_TMP_HI
|
ldd r19, Y+WIDGET_OFFS_TMP_HI
|
||||||
ldd r12, Y+WIDGET_OFFS_HEIGHT_LO ; default width
|
ldd r12, Y+WIDGET_OFFS_HEIGHT_LO ; default height
|
||||||
ldd r13, Y+WIDGET_OFFS_HEIGHT_HI
|
ldd r13, Y+WIDGET_OFFS_HEIGHT_HI
|
||||||
ldd r17, Y+WIDGET_OFFS_PACK
|
ldd r17, Y+WIDGET_OFFS_PACK
|
||||||
lsr r17 ; WIDGET_PACK_VSELF0_BIT = 2 -> shift 2 times right
|
lsr r17 ; WIDGET_PACK_VSELF0_BIT = 2 -> shift 2 times right
|
||||||
@@ -283,8 +307,8 @@ mLayoutCallbackPositionY:
|
|||||||
adc r21, xh
|
adc r21, xh
|
||||||
std Y+WIDGET_OFFS_Y_LO, r20 ; set new Y
|
std Y+WIDGET_OFFS_Y_LO, r20 ; set new Y
|
||||||
std Y+WIDGET_OFFS_Y_HI, r21
|
std Y+WIDGET_OFFS_Y_HI, r21
|
||||||
std Y+WIDGET_OFFS_HEIGHT_LO, r18 ; set new width
|
; std Y+WIDGET_OFFS_HEIGHT_LO, r12 ; set new height
|
||||||
std Y+WIDGET_OFFS_HEIGHT_HI, r19
|
; std Y+WIDGET_OFFS_HEIGHT_HI, r13
|
||||||
add xl, r18 ; advance Y
|
add xl, r18 ; advance Y
|
||||||
adc xh, r19
|
adc xh, r19
|
||||||
add xl, r22 ; add spacing
|
add xl, r22 ; add spacing
|
||||||
@@ -380,7 +404,7 @@ mLayoutSetupFirstSkipped:
|
|||||||
;
|
;
|
||||||
; @param Y object to start with
|
; @param Y object to start with
|
||||||
; @param r25 number of widgets to skip
|
; @param r25 number of widgets to skip
|
||||||
; @clobbers r18, r19, r25
|
; @clobbers r18, r19
|
||||||
|
|
||||||
mLayoutCallbackSetupFirstSkipped:
|
mLayoutCallbackSetupFirstSkipped:
|
||||||
push zl
|
push zl
|
||||||
@@ -406,7 +430,7 @@ mLayoutCallbackSetupFirstSkipped:
|
|||||||
; @param Y object to start with
|
; @param Y object to start with
|
||||||
; @param r25 number of widgets to handle
|
; @param r25 number of widgets to handle
|
||||||
; @return r21:r20 maximum TMP value encountered
|
; @return r21:r20 maximum TMP value encountered
|
||||||
; @clobbers r18, r19, r25, Z
|
; @clobbers r18, r19, Z
|
||||||
|
|
||||||
mLayoutGetMaxTmpContiguous:
|
mLayoutGetMaxTmpContiguous:
|
||||||
push yl
|
push yl
|
||||||
@@ -752,7 +776,7 @@ mLayoutCopyTmpToHeight:
|
|||||||
push yh
|
push yh
|
||||||
ldi zl, LOW(mLayoutCallbackCopyTmpToHeight)
|
ldi zl, LOW(mLayoutCallbackCopyTmpToHeight)
|
||||||
ldi zh, HIGH(mLayoutCallbackCopyTmpToHeight)
|
ldi zh, HIGH(mLayoutCallbackCopyTmpToHeight)
|
||||||
rcall mLayoutForEveryObjectContiguous ; (r18, r19, r25, Y)
|
rcall mLayoutForEveryObjectContiguous ; (r18, r19, Y)
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
ret
|
ret
|
||||||
@@ -781,7 +805,7 @@ mLayoutCallbackCopyTmpToHeight:
|
|||||||
; @routine mLayoutSumContiguous
|
; @routine mLayoutSumContiguous
|
||||||
;
|
;
|
||||||
; @param Y object to start with
|
; @param Y object to start with
|
||||||
; @param r25 number of widgets to handle
|
; @param r25 widgets per column/row
|
||||||
; @param r22 spacing between widgets
|
; @param r22 spacing between widgets
|
||||||
; @param r23 border at beginning and and
|
; @param r23 border at beginning and and
|
||||||
; @return r21:r20 total size in the given dimension including borders and inter-widget spacing
|
; @return r21:r20 total size in the given dimension including borders and inter-widget spacing
|
||||||
@@ -792,7 +816,6 @@ mLayoutSumContiguous:
|
|||||||
push yh
|
push yh
|
||||||
mov r20, r23 ; start with border
|
mov r20, r23 ; start with border
|
||||||
clr r21
|
clr r21
|
||||||
clr r25
|
|
||||||
ldi zl, LOW(mLayoutCallbackAddToSum)
|
ldi zl, LOW(mLayoutCallbackAddToSum)
|
||||||
ldi zh, HIGH(mLayoutCallbackAddToSum)
|
ldi zh, HIGH(mLayoutCallbackAddToSum)
|
||||||
rcall mLayoutForEveryObjectContiguous ; (r18, r19, r25, Y)
|
rcall mLayoutForEveryObjectContiguous ; (r18, r19, r25, Y)
|
||||||
@@ -886,25 +909,33 @@ mLayoutCallbackAddToSum:
|
|||||||
|
|
||||||
mLayoutForEveryObjectContiguous:
|
mLayoutForEveryObjectContiguous:
|
||||||
push r25
|
push r25
|
||||||
|
mov r18, r25
|
||||||
mLayoutForEveryObjectContiguous_loop:
|
mLayoutForEveryObjectContiguous_loop:
|
||||||
push r25
|
push r18
|
||||||
push yl
|
push r25
|
||||||
push yh
|
push yl
|
||||||
icall
|
push yh
|
||||||
pop yh
|
icall
|
||||||
pop yl
|
pop yh
|
||||||
pop r25
|
pop yl
|
||||||
|
pop r25
|
||||||
|
pop r18
|
||||||
brcs mLayoutForEveryObjectContiguous_ret
|
brcs mLayoutForEveryObjectContiguous_ret
|
||||||
tst r25
|
tst r18
|
||||||
breq mLayoutForEveryObjectContiguous_next
|
breq mLayoutForEveryObjectContiguous_next
|
||||||
dec r25
|
dec r18
|
||||||
clc
|
clc
|
||||||
breq mLayoutForEveryObjectContiguous_ret
|
breq mLayoutForEveryObjectContiguous_ret
|
||||||
mLayoutForEveryObjectContiguous_next:
|
mLayoutForEveryObjectContiguous_next:
|
||||||
bigcall OBJ_GetNext
|
push r18
|
||||||
brcc mLayoutForEveryObjectContiguous_ret
|
bigcall OBJ_GetNext
|
||||||
mov yl, r18
|
brcs mLayoutForEveryObjectContiguous_loopEnd
|
||||||
mov yh, r19
|
pop r18
|
||||||
|
rjmp mLayoutForEveryObjectContiguous_ret
|
||||||
|
mLayoutForEveryObjectContiguous_loopEnd:
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
pop r18
|
||||||
rjmp mLayoutForEveryObjectContiguous_loop
|
rjmp mLayoutForEveryObjectContiguous_loop
|
||||||
mLayoutForEveryObjectContiguous_ret:
|
mLayoutForEveryObjectContiguous_ret:
|
||||||
pop r25
|
pop r25
|
||||||
@@ -934,6 +965,10 @@ mLayoutForEveryObjectContiguous_ret:
|
|||||||
; @clobbers r18, r19, Y {any}
|
; @clobbers r18, r19, Y {any}
|
||||||
|
|
||||||
mLayoutForEveryObjectSkipped:
|
mLayoutForEveryObjectSkipped:
|
||||||
|
tst r25
|
||||||
|
brne mLayoutForEveryObjectSkipped_loop
|
||||||
|
bigjmp DEBUG2
|
||||||
|
|
||||||
mLayoutForEveryObjectSkipped_loop:
|
mLayoutForEveryObjectSkipped_loop:
|
||||||
push r25
|
push r25
|
||||||
push yl
|
push yl
|
||||||
|
|||||||
1151
avr/modules/lcd2/gui2/base/mlayout2.asm
Normal file
1151
avr/modules/lcd2/gui2/base/mlayout2.asm
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user