- Initialization now clears string allocator

- Changed some AppleSoft APIs to be more keyword-friendly
- Fixed button string pointers being wrong endian in AppleSoft API
- Fixed incorrect endian in return value of string allocator
This commit is contained in:
Quinn Dunki 2014-09-18 16:24:17 -07:00
parent 1c9d9a7bdd
commit 72bab2ba8f
4 changed files with 54 additions and 17 deletions

View File

@ -342,6 +342,17 @@ WGAmpersandStrArguments_done:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_WEEGUI
; Initializes WeeGUI
; &WEEGUI
WGAmpersand_WEEGUI:
jsr WGInit
jsr WG80
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_HOME
; Clears the screen
@ -370,6 +381,7 @@ WGAmpersand_DESK:
WGAmpersand_WINDOW:
jsr WGAmpersandStructArgument
jsr WGCreateView
jsr WGEraseView
jsr WGPaintView
jsr WGBottomCursor
@ -377,10 +389,10 @@ WGAmpersand_WINDOW:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_CHECKBOX
; WGAmpersand_CHKBOX
; Create a checkbox
; &CHECKBOX(id,x,y)
WGAmpersand_CHECKBOX:
; &CHKBOX(id,x,y)
WGAmpersand_CHKBOX:
jsr WGAmpersandStructArgument
jsr WGCreateCheckbox
jsr WGPaintView
@ -390,17 +402,18 @@ WGAmpersand_CHECKBOX:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_BUTTON
; WGAmpersand_BUTTN
; Create a button
; &BUTTON(id,x,y,width,"title")
WGAmpersand_BUTTON:
; &BUTTN(id,x,y,width,"title")
WGAmpersand_BUTTN:
jsr WGAmpersandStructArgument
jsr WGCreateButton
lda WGAmpersandCommandBuffer+4
sta PARAM0
lda WGAmpersandCommandBuffer+5
sta PARAM0
lda WGAmpersandCommandBuffer+4
sta PARAM1
jsr WGViewSetTitle
jsr WGPaintView
@ -454,6 +467,9 @@ WGAmpersandCommandBufferEnd:
;
WGAmpersandCommandTable:
.byte "WEEGUI",0,0,0,0,0,0,0,0
.addr WGAmpersand_WEEGUI
.byte $97,0,0,0,0,0,0,0,0,0,0,0,0,0 ; HOME
.addr WGAmpersand_HOME
@ -463,11 +479,11 @@ WGAmpersandCommandTable:
.byte "WINDOW",0,0,0,0,0,0,0,0
.addr WGAmpersand_WINDOW
.byte "CHECKBOX",0,0,0,0,0,0
.addr WGAmpersand_CHECKBOX
.byte "CHKBOX",0,0,0,0,0,0,0,0
.addr WGAmpersand_CHKBOX
.byte "BUT",$c1,"N",0,0,0,0,0,0,0,0,0 ; BUTTON
.addr WGAmpersand_BUTTON
.byte "BUTTN",0,0,0,0,0,0,0,0,0 ; BUTTON
.addr WGAmpersand_BUTTN
WGAmpersandCommandTableEnd:

27
gui.s
View File

@ -20,7 +20,15 @@
main:
jsr WGInit
jsr WG80
;jsr WG80
; lda #0
; lda #<testTitle1
; sta PARAM0
; lda #>testTitle1
; sta PARAM1
; jsr WGStoreStr
rts
;jmp tortureTestPrint
;jmp tortureTestRects
@ -214,11 +222,24 @@ testCallback:
; WGInit
; Initialization. Should be called once at app startup
WGInit:
pha
SAVE_AXY
jsr WGInitApplesoft
pla
ldy #15 ; Clear our block allocators
WGInit_clearMemLoop:
tya
asl
asl
asl
asl
tax
lda #0
sta WG_STRINGS,x
dey
bpl WGInit_clearMemLoop
RESTORE_AXY
rts

Binary file not shown.

View File

@ -190,10 +190,10 @@ WGStoreStr_terminate:
pla ; Return pointer to the start of the block
clc
adc #>WG_STRINGS
adc #<WG_STRINGS
sta PARAM0
lda #0
adc #<WG_STRINGS
adc #>WG_STRINGS
sta PARAM1
WGStoreStr_done: