Initialize the graphics screen via the toolset

This commit is contained in:
Lucas Scharenbroich 2022-04-25 17:11:48 -05:00
parent 1522922abe
commit 4d6f11a9ba
3 changed files with 64 additions and 5 deletions

View File

@ -11,6 +11,9 @@
mx %00 mx %00
ScreenX equ 0
ScreenY equ 2
; Typical init ; Typical init
phk phk
plb plb
@ -20,6 +23,23 @@
jsr GTEStartUp ; Load and install the GTE User Tool jsr GTEStartUp ; Load and install the GTE User Tool
; Initialize the graphics screen to a 256x160 playfield
pea #256
pea #160
_GTESetScreenMode
; Load a tileset in from an uncompressed $C1 picture. The top-left 256x128 rectangle is used
; to populate the 512 tiles.
; Manually fill in the 41x26 tiles of the TileStore with a test pattern.
; Set the origin of the screen
stz ScreenX
stz ScreenY
; Very simple actions ; Very simple actions
:loop :loop
pha ; space for result, with pattern pha ; space for result, with pattern
@ -27,9 +47,19 @@
pla pla
and #$00FF and #$00FF
cmp #'q' cmp #'q'
bne :loop beq :exit
; Shut down eveything ; pei ScreenX
; pei ScreenY
; _GTESetBG0Origin
; _GTERender
inc ScreenX ; Just keep incrementing, it's OK
bra :loop
; Shut down everything
:exit
_GTEShutDown _GTEShutDown
_QuitGS qtRec _QuitGS qtRec
qtRec adrl $0000 qtRec adrl $0000

View File

@ -13,7 +13,9 @@
"scripts": { "scripts": {
"test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%", "test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%",
"debug": "%npm_package_config_crossrunner% GTEToolDemo -Source MAINSEG_Output.txt -Debug -CompatibilityLayer", "debug": "%npm_package_config_crossrunner% GTEToolDemo -Source MAINSEG_Output.txt -Debug -CompatibilityLayer",
"build": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s" "build": "npm run build:tool && npm run build:sys16",
"build:sys16": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s",
"build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% ../../src/Master.s"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -46,8 +46,11 @@ _CallTable
adrl _TSReserved-1 adrl _TSReserved-1
adrl _TSReserved-1 adrl _TSReserved-1
adrl _TSReadControl-1 ; Function 9 adrl _TSReadControl-1
adrl _TSSetScreenMode-1 ; Function 10 adrl _TSSetScreenMode-1
adrl _TSSetTile-1
adrl _TSSetBG0Origin-1
adrl _TSRender-1
_CTEnd _CTEnd
; Do nothing when the tool set is installed ; Do nothing when the tool set is installed
@ -175,6 +178,7 @@ width equ FirstParam+2
_TSExit #0;#4 _TSExit #0;#4
; ReadControl()
_TSReadControl _TSReadControl
output equ FirstParam output equ FirstParam
@ -183,8 +187,31 @@ output equ FirstParam
jsr _ReadControl jsr _ReadControl
sta output,s sta output,s
_TSExit #0;#0
; SetTile(xTile, yTile, tileId)
_TSSetTile
tileId equ FirstParam
yTile equ FirstParam+2
xTile equ FirstParam+4
_TSEntry
_TSExit #0;#6
; SetBG0Origin(x, y)
_TSSetBG0Origin
yPos equ FirstParam
xPos equ FirstParam+2
_TSEntry
_TSExit #0;#4
; Render()
_TSRender
_TSEntry
_TSExit #0;#0 _TSExit #0;#0
; Insert the GTE code ; Insert the GTE code
put Math.s put Math.s