Converted &GET to integer

This commit is contained in:
Quinn Dunki 2015-02-01 18:22:05 -08:00
parent 3fee6ac066
commit 766072a3c2
3 changed files with 21 additions and 11 deletions

View File

@ -179,9 +179,10 @@ Here's a sample Applesoft run loop using these techniques:
1 PRINT CHR$ (4)"brun weegui"
70 REM Run Loop
80 &PDACT
85 &GET(A$)
90 IF A$ = "q" THEN END
100 GOTO 80
90 &GET(A%)
99 REM 113 is the ASCII code for 'q' (to quit)
100 IF A% = 113 THEN END
110 GOTO 80
You can omit &PDACT if you have no desire to support the mouse.
@ -909,13 +910,13 @@ Not available
####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%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td>
Not available
</pre></td><td><pre>
&GET(A$)
&GET(A%)
</pre></td></tr>
</table>

View File

@ -879,23 +879,32 @@ WGAmpersand_GET:
sta KBDSTRB ; Clear strobe and high bit
and #%01111111
pha
bra WGAmpersand_GETstore
WGAmpersand_GETnone:
lda #0
pha
WGAmpersand_GETstore:
ldy #0
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
lda #0
sta (VARPNT),y
iny
lda #>WG_KEYBUFFER
pla
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
rts

Binary file not shown.