Added Applesoft API to get selected view

- Also combined WIPE/ERASE APIs into one
This commit is contained in:
blondie7575 2017-12-31 14:23:58 -08:00
parent f9e2c1b173
commit f72a85e802
4 changed files with 46 additions and 19 deletions

View File

@ -621,7 +621,7 @@ Erases the content area of the selected view. The frame is not touched.
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGEraseViewContents
</pre></td><td><pre>
&ERASE
&ERASE(0)
</pre></td></tr>
</table>
@ -633,7 +633,7 @@ Erases the content area and frame of the selected view.
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGEraseView
</pre></td><td><pre>
&WIPE
&ERASE(1)
</pre></td></tr>
</table>

View File

@ -878,9 +878,22 @@ WGAmpersand_GOSUB:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_ERASE
; Erases the contents of the selected view
; &ERASE
; Erases the contents of the selected view (with frame if 1)
; &ERASE(0 or 1)
WGAmpersand_ERASE:
jsr WGAmpersandBeginArguments
jsr WGAmpersandIntArgument
pha
jsr WGAmpersandEndArguments
pla
beq WGAmpersand_ERASEcontents
jsr WGEraseView
jsr WGBottomCursor
rts
WGAmpersand_ERASEcontents:
jsr WGEraseViewContents
jsr WGBottomCursor
rts
@ -1097,16 +1110,6 @@ WGAmpersand_KILL:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_WIPE
; Erases all of the selected view
; &WIPE
WGAmpersand_WIPE:
jsr WGEraseView
jsr WGBottomCursor
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_EXIT
; Shuts down WeeGUI
@ -1141,6 +1144,30 @@ WGBottomCursor:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_GTSEL
; Returns ID of selected view
; &GTSEL(A%)
WGAmpersand_GTSEL:
jsr WGAmpersandBeginArguments
jsr PTRGET
lda WG_ACTIVEVIEW
pha
ldy #0
lda #0
sta (VARPNT),y
iny
pla
sta (VARPNT),y
jsr WGAmpersandEndArguments
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGGosub
; Performs an Applesoft GOSUB to a line number
@ -1297,9 +1324,6 @@ WGAmpersandCommandTable:
.byte "KILL",0,0
.addr WGAmpersand_KILL
.byte "WIPE",0,0
.addr WGAmpersand_WIPE
.byte "EXIT",0,0
.addr WGAmpersand_EXIT
@ -1312,6 +1336,9 @@ WGAmpersandCommandTable:
.byte "STRW",0,0
.addr WGAmpersand_STRW
.byte "GTSEL",0
.addr WGAmpersand_GTSEL
;.byte TOKEN_GOSUB,0,0,0,0,0,0,0,0,0,0,0,0,0 ; For internal testing of the procedural gosub
;.addr WGAmpersand_GOSUB

Binary file not shown.

View File

@ -110,9 +110,9 @@ WGInit:
; tsb MEMBITMAP + $12
; Protect us from Applesoft by setting up HIMEM
; lda #$77 ; 7800 (really 77ff)
; lda #$78 ; 7800 (really 77ff)
; sta LINNUMH
; lda #$ff
; lda #$00
; sta LINNUML
; jsr SETHI