- 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:
ply
lda #<WGAmpersandCommandBuffer
sta PARAM0
lda #>WGAmpersandCommandBuffer
sta PARAM1
PARAM16 WGAmpersandCommandBuffer
RESTORE_AXY
rts
@ -413,12 +410,8 @@ WGAmpersand_WINDOW:
jsr WGAmpersandEndArguments
lda #<WGAmpersandCommandBuffer
sta PARAM0
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 PARAM0
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 PARAM0
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

71
gui.s
View File

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

Binary file not shown.

View File

@ -100,6 +100,36 @@
.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
;

View File

@ -26,11 +26,7 @@ tortureTestPrint:
jsr WGScrollY
tortureTestPrint_init:
lda #<testPrintView
sta PARAM0
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 PARAM0
lda #>unitTestStr
sta PARAM1
CALL16 WGPrint,unitTestStr
jsr WGPrint
jsr WGPrint
jsr WGPrint ; Do it again
; jmp tortureTestPrint_lock
jsr delayShort

View File

@ -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