2022-04-23 05:47:13 +00:00
|
|
|
REL
|
|
|
|
DSK MAINSEG
|
|
|
|
|
|
|
|
use Locator.Macs
|
|
|
|
use Load.Macs
|
|
|
|
use Mem.Macs
|
|
|
|
use Misc.Macs
|
|
|
|
use Util.Macs
|
|
|
|
use EDS.GSOS.Macs
|
2022-04-24 19:45:07 +00:00
|
|
|
use GTE.Macs
|
2022-04-23 05:47:13 +00:00
|
|
|
|
2022-04-23 20:41:25 +00:00
|
|
|
mx %00
|
|
|
|
|
2022-04-23 05:47:13 +00:00
|
|
|
; Typical init
|
|
|
|
phk
|
|
|
|
plb
|
|
|
|
|
2022-04-24 19:45:07 +00:00
|
|
|
sta UserId ; GS/OS passes the memory manager user ID for the aoplication into the program
|
|
|
|
_MTStartUp ; GTE requires the miscellaneous toolset to be running
|
2022-04-23 20:41:25 +00:00
|
|
|
|
2022-04-24 19:45:07 +00:00
|
|
|
jsr GTEStartUp ; Load and install the GTE User Tool
|
2022-04-23 05:47:13 +00:00
|
|
|
|
2022-04-24 19:45:07 +00:00
|
|
|
; Very simple actions
|
|
|
|
:loop
|
|
|
|
pha ; space for result, with pattern
|
|
|
|
_GTEReadControl
|
|
|
|
pla
|
|
|
|
and #$00FF
|
|
|
|
cmp #'q'
|
|
|
|
bne :loop
|
2022-04-23 05:47:13 +00:00
|
|
|
|
2022-04-24 19:45:07 +00:00
|
|
|
; Shut down eveything
|
|
|
|
_GTEShutDown
|
|
|
|
_QuitGS qtRec
|
2022-04-23 05:47:13 +00:00
|
|
|
qtRec adrl $0000
|
|
|
|
da $00
|
|
|
|
|
2022-04-24 19:45:07 +00:00
|
|
|
; Load the GTE User Tool and install it
|
2022-04-23 05:47:13 +00:00
|
|
|
GTEStartUp
|
2022-04-23 20:41:25 +00:00
|
|
|
pea $0000
|
|
|
|
_LoaderStatus
|
|
|
|
pla
|
|
|
|
|
2022-04-23 05:47:13 +00:00
|
|
|
pea $0000
|
|
|
|
pea $0000
|
|
|
|
pea $0000
|
|
|
|
pea $0000
|
|
|
|
pea $0000 ; result space
|
|
|
|
|
|
|
|
lda UserId
|
|
|
|
pha
|
|
|
|
|
|
|
|
pea #^ToolPath
|
|
|
|
pea #ToolPath
|
|
|
|
pea $0001 ; do not load into special memory
|
2022-04-23 20:41:25 +00:00
|
|
|
_InitialLoad
|
|
|
|
bcc :ok1
|
|
|
|
brk $01
|
|
|
|
|
|
|
|
:ok1
|
2022-04-23 05:47:13 +00:00
|
|
|
ply
|
|
|
|
pla ; Address of the loaded tool
|
|
|
|
plx
|
|
|
|
ply
|
|
|
|
ply
|
|
|
|
|
|
|
|
pea $8000 ; User toolset
|
|
|
|
pea $00A0 ; Set the tool set number
|
|
|
|
phx
|
|
|
|
pha ; Address of function pointer table
|
|
|
|
_SetTSPtr
|
2022-04-23 20:41:25 +00:00
|
|
|
bcc :ok2
|
|
|
|
brk $02
|
2022-04-23 05:47:13 +00:00
|
|
|
|
2022-04-23 20:41:25 +00:00
|
|
|
:ok2
|
2022-04-23 05:47:13 +00:00
|
|
|
clc ; Give GTE a page of direct page memory
|
|
|
|
tdc
|
|
|
|
adc #$0100
|
|
|
|
pha
|
2022-04-24 19:45:07 +00:00
|
|
|
pea $0000 ; No extra capabilities
|
|
|
|
lda UserId ; Pass the userId for memory allocation
|
2022-04-23 05:47:13 +00:00
|
|
|
pha
|
|
|
|
_GTEStartUp
|
2022-04-23 20:41:25 +00:00
|
|
|
bcc :ok3
|
|
|
|
brk $03
|
2022-04-23 05:47:13 +00:00
|
|
|
|
2022-04-23 20:41:25 +00:00
|
|
|
:ok3
|
2022-04-23 05:47:13 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
MasterId ds 2
|
|
|
|
UserId ds 2
|
2022-04-23 20:41:25 +00:00
|
|
|
ToolPath str '1/GTETool'
|