mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2025-03-02 10:29:01 +00:00
Initialize the graphics screen via the toolset
This commit is contained in:
parent
1522922abe
commit
4d6f11a9ba
@ -11,6 +11,9 @@
|
||||
|
||||
mx %00
|
||||
|
||||
ScreenX equ 0
|
||||
ScreenY equ 2
|
||||
|
||||
; Typical init
|
||||
phk
|
||||
plb
|
||||
@ -20,6 +23,23 @@
|
||||
|
||||
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
|
||||
:loop
|
||||
pha ; space for result, with pattern
|
||||
@ -27,9 +47,19 @@
|
||||
pla
|
||||
and #$00FF
|
||||
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
|
||||
_QuitGS qtRec
|
||||
qtRec adrl $0000
|
||||
|
@ -13,7 +13,9 @@
|
||||
"scripts": {
|
||||
"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",
|
||||
"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": {
|
||||
"type": "git",
|
||||
|
31
src/Tool.s
31
src/Tool.s
@ -46,8 +46,11 @@ _CallTable
|
||||
adrl _TSReserved-1
|
||||
adrl _TSReserved-1
|
||||
|
||||
adrl _TSReadControl-1 ; Function 9
|
||||
adrl _TSSetScreenMode-1 ; Function 10
|
||||
adrl _TSReadControl-1
|
||||
adrl _TSSetScreenMode-1
|
||||
adrl _TSSetTile-1
|
||||
adrl _TSSetBG0Origin-1
|
||||
adrl _TSRender-1
|
||||
_CTEnd
|
||||
|
||||
; Do nothing when the tool set is installed
|
||||
@ -175,6 +178,7 @@ width equ FirstParam+2
|
||||
|
||||
_TSExit #0;#4
|
||||
|
||||
; ReadControl()
|
||||
_TSReadControl
|
||||
output equ FirstParam
|
||||
|
||||
@ -183,8 +187,31 @@ output equ FirstParam
|
||||
jsr _ReadControl
|
||||
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
|
||||
|
||||
|
||||
; Insert the GTE code
|
||||
|
||||
put Math.s
|
||||
|
Loading…
x
Reference in New Issue
Block a user