mirror of
https://github.com/blondie7575/WeeGUI.git
synced 2024-06-26 18:29:47 +00:00
Converted &GET to integer
This commit is contained in:
parent
3fee6ac066
commit
766072a3c2
|
@ -179,9 +179,10 @@ Here's a sample Applesoft run loop using these techniques:
|
||||||
1 PRINT CHR$ (4)"brun weegui"
|
1 PRINT CHR$ (4)"brun weegui"
|
||||||
70 REM Run Loop
|
70 REM Run Loop
|
||||||
80 &PDACT
|
80 &PDACT
|
||||||
85 &GET(A$)
|
90 &GET(A%)
|
||||||
90 IF A$ = "q" THEN END
|
99 REM 113 is the ASCII code for 'q' (to quit)
|
||||||
100 GOTO 80
|
100 IF A% = 113 THEN END
|
||||||
|
110 GOTO 80
|
||||||
|
|
||||||
You can omit &PDACT if you have no desire to support the mouse.
|
You can omit &PDACT if you have no desire to support the mouse.
|
||||||
|
|
||||||
|
@ -909,13 +910,13 @@ Not available
|
||||||
|
|
||||||
|
|
||||||
####WGGet
|
####WGGet
|
||||||
A non-blocking version of Applesoft's GET. This allows you to easily create run-loops for GUI programming in Applesoft. The key read is returned in the Applesoft string variable you specify. If no keypress is pending, the value will be an empty string.
|
A non-blocking version of Applesoft's GET. This allows you to easily create run-loops for GUI programming in Applesoft. The key read is returned in the Applesoft integer variable you specify. If no keypress is pending, the value will be zero.
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td>
|
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td>
|
||||||
Not available
|
Not available
|
||||||
</pre></td><td><pre>
|
</pre></td><td><pre>
|
||||||
&GET(A$)
|
&GET(A%)
|
||||||
</pre></td></tr>
|
</pre></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
21
applesoft.s
21
applesoft.s
|
@ -879,23 +879,32 @@ WGAmpersand_GET:
|
||||||
|
|
||||||
sta KBDSTRB ; Clear strobe and high bit
|
sta KBDSTRB ; Clear strobe and high bit
|
||||||
and #%01111111
|
and #%01111111
|
||||||
|
pha
|
||||||
bra WGAmpersand_GETstore
|
bra WGAmpersand_GETstore
|
||||||
|
|
||||||
WGAmpersand_GETnone:
|
WGAmpersand_GETnone:
|
||||||
lda #0
|
lda #0
|
||||||
|
pha
|
||||||
|
|
||||||
WGAmpersand_GETstore:
|
WGAmpersand_GETstore:
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
sta WG_KEYBUFFER ; Store the key
|
lda #0
|
||||||
lda #1 ; Create an Applesoft string record in the
|
|
||||||
sta (VARPNT),y ; variable's location
|
|
||||||
iny
|
|
||||||
lda #<WG_KEYBUFFER
|
|
||||||
sta (VARPNT),y
|
sta (VARPNT),y
|
||||||
iny
|
iny
|
||||||
lda #>WG_KEYBUFFER
|
pla
|
||||||
sta (VARPNT),y
|
sta (VARPNT),y
|
||||||
|
|
||||||
|
; String version:
|
||||||
|
; sta WG_KEYBUFFER ; Store the key
|
||||||
|
; lda #1 ; Create an Applesoft string record in the
|
||||||
|
; sta (VARPNT),y ; variable's location
|
||||||
|
; iny
|
||||||
|
; lda #<WG_KEYBUFFER
|
||||||
|
; sta (VARPNT),y
|
||||||
|
; iny
|
||||||
|
; lda #>WG_KEYBUFFER
|
||||||
|
; sta (VARPNT),y
|
||||||
|
|
||||||
jsr WGAmpersandEndArguments
|
jsr WGAmpersandEndArguments
|
||||||
rts
|
rts
|
||||||
|
|
BIN
weegui.dsk
BIN
weegui.dsk
Binary file not shown.
Loading…
Reference in New Issue
Block a user