diff --git a/applesoft.s b/applesoft.s index 976e69b..db3915e 100644 --- a/applesoft.s +++ b/applesoft.s @@ -336,10 +336,7 @@ WGAmpersandStructArguments_cleanup: WGAmpersandStructArguments_done: ply - lda #WGAmpersandCommandBuffer - sta PARAM1 + PARAM16 WGAmpersandCommandBuffer RESTORE_AXY rts @@ -413,12 +410,8 @@ WGAmpersand_WINDOW: jsr WGAmpersandEndArguments - lda #WGAmpersandCommandBuffer - sta PARAM1 + CALL16 WGCreateView,WGAmpersandCommandBuffer - jsr WGCreateView jsr WGEraseView jsr WGPaintView jsr WGBottomCursor @@ -445,17 +438,13 @@ WGAmpersand_CHKBOX: jsr WGAmpersandEndArguments - lda #WGAmpersandCommandBuffer - sta PARAM1 - - jsr WGCreateCheckbox + CALL16 WGCreateCheckbox,WGAmpersandCommandBuffer LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view lda #VIEW_STYLE_APPLESOFT ora WG_VIEWRECORDS+4,y - + sta WG_VIEWRECORDS+4,y + jsr WGPaintView jsr WGBottomCursor @@ -496,15 +485,12 @@ WGAmpersand_BUTTN: jsr WGAmpersandEndArguments - lda #WGAmpersandCommandBuffer - sta PARAM1 - jsr WGCreateButton + CALL16 WGCreateButton,WGAmpersandCommandBuffer LDY_ACTIVEVIEW ; Flag this as an Applesoft-created view lda #VIEW_STYLE_APPLESOFT ora WG_VIEWRECORDS+4,y + sta WG_VIEWRECORDS+4,y lda WGAmpersandCommandBuffer+6 ; Set the button text sta PARAM0 diff --git a/gui.s b/gui.s index 5f2e786..c630656 100644 --- a/gui.s +++ b/gui.s @@ -22,66 +22,23 @@ main: jsr WGInit jsr WG80 -; lda #0 -; lda #testTitle1 -; sta PARAM1 -; jsr WGStoreStr - rts ;jmp tortureTestPrint ;jmp tortureTestRects jsr WGDesktop - lda #testView - sta PARAM1 - jsr WGCreateView + CALL16 WGCreateView,testView + CALL16 WGViewSetTitle,testTitle0 - lda #testTitle0 - sta PARAM1 - jsr WGViewSetTitle + CALL16 WGCreateCheckbox,testCheck - lda #testCheck - sta PARAM1 - jsr WGCreateCheckbox + CALL16 WGCreateButton,testButton1 + CALL16 WGViewSetTitle,testTitle1 + CALL16 WGViewSetAction,testCallback - lda #testButton1 - sta PARAM1 - jsr WGCreateButton - - lda #testTitle1 - sta PARAM1 - jsr WGViewSetTitle - - lda #testCallback - sta PARAM1 - jsr WGViewSetAction - - lda #testButton2 - sta PARAM1 - jsr WGCreateButton - - lda #testTitle2 - sta PARAM1 - jsr WGViewSetTitle + CALL16 WGCreateButton,testButton2 + CALL16 WGViewSetTitle,testTitle2 jsr WGViewPaintAll ; jsr testPaintContents @@ -180,11 +137,7 @@ testPaintContents: ldx #0 ldy #4 jsr WGSetCursor - lda #testStr - sta PARAM1 - jsr WGPrint + CALL16 WGPrint,testStr bra testPaintContents_done ;; @@ -199,11 +152,7 @@ testPaintContents_loop: adc #'A' sta testStr3 - lda #testStr3 - sta PARAM1 - jsr WGPrint + CALL16 WGPrint,testStr3 iny cpy #25 diff --git a/guidemo.dsk b/guidemo.dsk index 2a63faa..c0892f4 100644 Binary files a/guidemo.dsk and b/guidemo.dsk differ diff --git a/macros.s b/macros.s index 9097464..c8d8a7e 100644 --- a/macros.s +++ b/macros.s @@ -100,6 +100,36 @@ .endmacro +.macro PARAM16 addr + 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 ; diff --git a/unit_test.s b/unit_test.s index 18b5b73..4bc998b 100644 --- a/unit_test.s +++ b/unit_test.s @@ -26,11 +26,7 @@ tortureTestPrint: jsr WGScrollY tortureTestPrint_init: - lda #testPrintView - sta PARAM1 - jsr WGCreateView + CALL16 WGCreateView,testPrintView lda #0 jsr WGSelectView @@ -113,13 +109,9 @@ tortureTestPrint_print: VBL_SYNC jsr WGEraseViewContents - lda #unitTestStr - sta PARAM1 + CALL16 WGPrint,unitTestStr - jsr WGPrint - jsr WGPrint + jsr WGPrint ; Do it again ; jmp tortureTestPrint_lock jsr delayShort diff --git a/views.s b/views.s index a46f20c..07ff99f 100644 --- a/views.s +++ b/views.s @@ -745,7 +745,7 @@ WGViewFocusAction_toggleCheckbox: WGViewFocusAction_buttonClick: lda WG_VIEWRECORDS+4,y ; Are we an Applesoft button? and #VIEW_STYLE_APPLESOFT - beq WGViewFocusAction_buttonClickApplesoft + bne WGViewFocusAction_buttonClickApplesoft lda WG_VIEWRECORDS+10,y ; Do we have a callback? beq WGViewFocusAction_done