avr: add CDialog_GetChildValue/CDialog_SetChildValue (more code sharing).
This commit is contained in:
@@ -129,7 +129,58 @@ CDialog_GetChildBySelector_ret:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Dialog_OnCreate @global
|
||||
; @routine CDialog_SetChildValue
|
||||
;
|
||||
; @param Y pointer to dialog
|
||||
; @param X new value
|
||||
; @param R16 selector of child to set value to
|
||||
; @clobbers any, !Y, !Z
|
||||
|
||||
CDialog_SetChildValue:
|
||||
rcall CDialog_GetChildBySelector ; r19:r18=result (R16-R19)
|
||||
brcc CDialog_SetChildValue_ret
|
||||
push yl
|
||||
push yh
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall Widget_SetCurrentValue
|
||||
pop yh
|
||||
pop yl
|
||||
CDialog_SetChildValue_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine CDialog_GetChildValue
|
||||
;
|
||||
; @param Y pointer to dialog
|
||||
; @param R16 selector of child to set value to
|
||||
; @clobbers any, !Y, !Z
|
||||
|
||||
CDialog_GetChildValue:
|
||||
rcall CDialog_GetChildBySelector ; r19:r18=result (R16-R19)
|
||||
brcc CDialog_GetChildValue_retZero
|
||||
push yl
|
||||
push yh
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall Widget_GetCurrentValue
|
||||
pop yh
|
||||
pop yl
|
||||
brcs CDialog_GetChildValue_ret
|
||||
CDialog_GetChildValue_retZero:
|
||||
clr r18
|
||||
clr r19
|
||||
CDialog_GetChildValue_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Dialog_OnMkContent @global
|
||||
;
|
||||
; @param Y pointer to dialog
|
||||
; @clobbers any, !Y
|
||||
|
||||
Reference in New Issue
Block a user