- Fixed callbacks on machine language buttons

- Fixed AppleSoft flag not getting set properly on buttons and checkboxes
- Added macros for 16 and 32 bit function calls
- Some code cleanup
This commit is contained in:
Quinn Dunki 2014-09-21 13:08:41 -07:00
parent 477fb59c75
commit 58deae7241
6 changed files with 51 additions and 94 deletions

View File

@ -336,10 +336,7 @@ WGAmpersandStructArguments_cleanup:
WGAmpersandStructArguments_done: WGAmpersandStructArguments_done:
ply ply
lda #<WGAmpersandCommandBuffer PARAM16 WGAmpersandCommandBuffer
sta PARAM0
lda #>WGAmpersandCommandBuffer
sta PARAM1
RESTORE_AXY RESTORE_AXY
rts rts
@ -413,12 +410,8 @@ WGAmpersand_WINDOW:
jsr WGAmpersandEndArguments jsr WGAmpersandEndArguments
lda #<WGAmpersandCommandBuffer CALL16 WGCreateView,WGAmpersandCommandBuffer
sta PARAM0
lda #>WGAmpersandCommandBuffer
sta PARAM1
jsr WGCreateView
jsr WGEraseView jsr WGEraseView
jsr WGPaintView jsr WGPaintView
jsr WGBottomCursor jsr WGBottomCursor
@ -445,16 +438,12 @@ WGAmpersand_CHKBOX:
jsr WGAmpersandEndArguments jsr WGAmpersandEndArguments
lda #<WGAmpersandCommandBuffer CALL16 WGCreateCheckbox,WGAmpersandCommandBuffer
sta PARAM0
lda #>WGAmpersandCommandBuffer
sta PARAM1
jsr WGCreateCheckbox
LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view
lda #VIEW_STYLE_APPLESOFT lda #VIEW_STYLE_APPLESOFT
ora WG_VIEWRECORDS+4,y ora WG_VIEWRECORDS+4,y
sta WG_VIEWRECORDS+4,y
jsr WGPaintView jsr WGPaintView
jsr WGBottomCursor jsr WGBottomCursor
@ -496,15 +485,12 @@ WGAmpersand_BUTTN:
jsr WGAmpersandEndArguments jsr WGAmpersandEndArguments
lda #<WGAmpersandCommandBuffer CALL16 WGCreateButton,WGAmpersandCommandBuffer
sta PARAM0
lda #>WGAmpersandCommandBuffer
sta PARAM1
jsr WGCreateButton
LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view
lda #VIEW_STYLE_APPLESOFT lda #VIEW_STYLE_APPLESOFT
ora WG_VIEWRECORDS+4,y ora WG_VIEWRECORDS+4,y
sta WG_VIEWRECORDS+4,y
lda WGAmpersandCommandBuffer+6 ; Set the button text lda WGAmpersandCommandBuffer+6 ; Set the button text
sta PARAM0 sta PARAM0

71
gui.s
View File

@ -22,66 +22,23 @@ main:
jsr WGInit jsr WGInit
jsr WG80 jsr WG80
; lda #0
; lda #<testTitle1
; sta PARAM0
; lda #>testTitle1
; sta PARAM1
; jsr WGStoreStr
rts rts
;jmp tortureTestPrint ;jmp tortureTestPrint
;jmp tortureTestRects ;jmp tortureTestRects
jsr WGDesktop jsr WGDesktop
lda #<testView CALL16 WGCreateView,testView
sta PARAM0 CALL16 WGViewSetTitle,testTitle0
lda #>testView
sta PARAM1
jsr WGCreateView
lda #<testTitle0 CALL16 WGCreateCheckbox,testCheck
sta PARAM0
lda #>testTitle0
sta PARAM1
jsr WGViewSetTitle
lda #<testCheck CALL16 WGCreateButton,testButton1
sta PARAM0 CALL16 WGViewSetTitle,testTitle1
lda #>testCheck CALL16 WGViewSetAction,testCallback
sta PARAM1
jsr WGCreateCheckbox
lda #<testButton1 CALL16 WGCreateButton,testButton2
sta PARAM0 CALL16 WGViewSetTitle,testTitle2
lda #>testButton1
sta PARAM1
jsr WGCreateButton
lda #<testTitle1
sta PARAM0
lda #>testTitle1
sta PARAM1
jsr WGViewSetTitle
lda #<testCallback
sta PARAM0
lda #>testCallback
sta PARAM1
jsr WGViewSetAction
lda #<testButton2
sta PARAM0
lda #>testButton2
sta PARAM1
jsr WGCreateButton
lda #<testTitle2
sta PARAM0
lda #>testTitle2
sta PARAM1
jsr WGViewSetTitle
jsr WGViewPaintAll jsr WGViewPaintAll
; jsr testPaintContents ; jsr testPaintContents
@ -180,11 +137,7 @@ testPaintContents:
ldx #0 ldx #0
ldy #4 ldy #4
jsr WGSetCursor jsr WGSetCursor
lda #<testStr CALL16 WGPrint,testStr
sta PARAM0
lda #>testStr
sta PARAM1
jsr WGPrint
bra testPaintContents_done bra testPaintContents_done
;; ;;
@ -199,11 +152,7 @@ testPaintContents_loop:
adc #'A' adc #'A'
sta testStr3 sta testStr3
lda #<testStr3 CALL16 WGPrint,testStr3
sta PARAM0
lda #>testStr3
sta PARAM1
jsr WGPrint
iny iny
cpy #25 cpy #25

Binary file not shown.

View File

@ -100,6 +100,36 @@
.endmacro .endmacro
.macro PARAM16 addr
lda #<addr
sta PARAM0
lda #>addr
sta PARAM1
.endmacro
.macro CALL16 func,addr
PARAM16 addr
jsr func
.endmacro
.macro PARAMQUAD p0,p1,p2,p3
lda #p0
sta PARAM0
lda #p1
sta PARAM1
lda #p2
sta PARAM2
lda #p3
sta PARAM3
.endmacro
.macro CALLQUAD func,p0,p1,p2,p3
PARAMQUAD p0,p1,p2,p3
jsr func
.endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Rendering macros ; Rendering macros
; ;

View File

@ -26,11 +26,7 @@ tortureTestPrint:
jsr WGScrollY jsr WGScrollY
tortureTestPrint_init: tortureTestPrint_init:
lda #<testPrintView CALL16 WGCreateView,testPrintView
sta PARAM0
lda #>testPrintView
sta PARAM1
jsr WGCreateView
lda #0 lda #0
jsr WGSelectView jsr WGSelectView
@ -113,13 +109,9 @@ tortureTestPrint_print:
VBL_SYNC VBL_SYNC
jsr WGEraseViewContents jsr WGEraseViewContents
lda #<unitTestStr CALL16 WGPrint,unitTestStr
sta PARAM0
lda #>unitTestStr
sta PARAM1
jsr WGPrint jsr WGPrint ; Do it again
jsr WGPrint
; jmp tortureTestPrint_lock ; jmp tortureTestPrint_lock
jsr delayShort jsr delayShort

View File

@ -745,7 +745,7 @@ WGViewFocusAction_toggleCheckbox:
WGViewFocusAction_buttonClick: WGViewFocusAction_buttonClick:
lda WG_VIEWRECORDS+4,y ; Are we an Applesoft button? lda WG_VIEWRECORDS+4,y ; Are we an Applesoft button?
and #VIEW_STYLE_APPLESOFT and #VIEW_STYLE_APPLESOFT
beq WGViewFocusAction_buttonClickApplesoft bne WGViewFocusAction_buttonClickApplesoft
lda WG_VIEWRECORDS+10,y ; Do we have a callback? lda WG_VIEWRECORDS+10,y ; Do we have a callback?
beq WGViewFocusAction_done beq WGViewFocusAction_done