mirror of
https://github.com/blondie7575/WeeGUI.git
synced 2024-12-14 06:31:06 +00:00
&PRINT now supports Applesoft string variables
This commit is contained in:
parent
3702d0c50d
commit
9600b99d81
23
applesoft.s
23
applesoft.s
@ -285,7 +285,7 @@ WGAmpersandStrArgument_loop_inc1:
|
|||||||
WGAmpersandStrArgument_done:
|
WGAmpersandStrArgument_done:
|
||||||
lda #'"' ; Expect closing quote
|
lda #'"' ; Expect closing quote
|
||||||
cmp (TXTPTRL),y ; Can't use SYNERR here because it skips whitespace
|
cmp (TXTPTRL),y ; Can't use SYNERR here because it skips whitespace
|
||||||
bne WGAmpersandTempStrArgument_error
|
bne WGAmpersandStrArgument_error
|
||||||
|
|
||||||
inc TXTPTRL ; Can't use CHRGET here, because it skips leading whitespace (among other issues)
|
inc TXTPTRL ; Can't use CHRGET here, because it skips leading whitespace (among other issues)
|
||||||
bne WGAmpersandStrArgument_loop_inc2
|
bne WGAmpersandStrArgument_loop_inc2
|
||||||
@ -713,13 +713,14 @@ WGAmpersand_PRINT:
|
|||||||
|
|
||||||
jsr CHRGOT ; Experimental alternate parameter support
|
jsr CHRGOT ; Experimental alternate parameter support
|
||||||
cmp #'"'
|
cmp #'"'
|
||||||
bne WGAmpersand_PRINTint
|
bne WGAmpersand_NotLiteral
|
||||||
|
|
||||||
jsr WGAmpersandTempStrArgument
|
jsr WGAmpersandTempStrArgument
|
||||||
stx PARAM0
|
stx PARAM0
|
||||||
sty PARAM1
|
sty PARAM1
|
||||||
pha
|
pha
|
||||||
|
|
||||||
|
WGAmpersand_PrintStrPtrAndLen:
|
||||||
jsr WGAmpersandEndArguments
|
jsr WGAmpersandEndArguments
|
||||||
|
|
||||||
; We're pointing to the string directly in the Applesoft
|
; We're pointing to the string directly in the Applesoft
|
||||||
@ -741,8 +742,24 @@ WGAmpersand_PRINT:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
WGAmpersand_NotLiteral:
|
||||||
|
cmp #'A'
|
||||||
|
bmi WGAmpersand_PRINTint
|
||||||
|
|
||||||
|
jsr PTRGET ; Non-numeric, so assume string variable
|
||||||
|
ldy #0
|
||||||
|
lda (VARPNT),y
|
||||||
|
pha ; Length goes on stack
|
||||||
|
iny
|
||||||
|
lda (VARPNT),y ; Get string pointer out of Applesoft record
|
||||||
|
sta PARAM0
|
||||||
|
iny
|
||||||
|
lda (VARPNT),y
|
||||||
|
sta PARAM1
|
||||||
|
bra WGAmpersand_PrintStrPtrAndLen
|
||||||
|
|
||||||
WGAmpersand_PRINTint:
|
WGAmpersand_PRINTint:
|
||||||
; User passed a non-string, so interpret as an ASCII code
|
; User passed numeric value, so interpret as an ASCII code
|
||||||
jsr WGAmpersandIntArgument
|
jsr WGAmpersandIntArgument
|
||||||
sta WGAmpersand_PRINTintBuffer
|
sta WGAmpersand_PRINTintBuffer
|
||||||
jsr WGAmpersandEndArguments
|
jsr WGAmpersandEndArguments
|
||||||
|
Loading…
Reference in New Issue
Block a user