2021-10-13 20:13:52 +00:00
|
|
|
; Test driver to exercise graphics routines.
|
|
|
|
|
|
|
|
REL
|
|
|
|
DSK MAINSEG
|
|
|
|
|
|
|
|
use Locator.Macs.s
|
|
|
|
use Misc.Macs.s
|
|
|
|
use EDS.GSOS.MACS.s
|
|
|
|
use Tool222.Macs.s
|
|
|
|
use Util.Macs.s
|
|
|
|
use CORE.MACS.s
|
|
|
|
use ../../src/GTE.s
|
|
|
|
use ../../src/Defs.s
|
|
|
|
|
|
|
|
mx %00
|
|
|
|
|
|
|
|
; Feature flags
|
|
|
|
NO_INTERRUPTS equ 0 ; turn off for crossrunner debugging
|
|
|
|
NO_MUSIC equ 1 ; turn music + tool loading off
|
|
|
|
|
|
|
|
; Keycodes
|
|
|
|
LEFT_ARROW equ $08
|
|
|
|
RIGHT_ARROW equ $15
|
|
|
|
UP_ARROW equ $0B
|
|
|
|
DOWN_ARROW equ $0A
|
|
|
|
|
|
|
|
; Typical init
|
|
|
|
phk
|
|
|
|
plb
|
|
|
|
|
|
|
|
jsl EngineStartUp
|
|
|
|
|
2021-10-13 22:45:25 +00:00
|
|
|
lda #^MyPalette ; Fill Palette #0 with our colors
|
2021-10-13 20:13:52 +00:00
|
|
|
ldx #MyPalette
|
|
|
|
ldy #0
|
|
|
|
jsl SetPalette
|
|
|
|
|
2021-10-13 22:45:25 +00:00
|
|
|
ldx #0 ; Mode 0 is full-screen
|
2021-10-13 20:13:52 +00:00
|
|
|
jsl SetScreenMode
|
|
|
|
|
|
|
|
; Set up our level data
|
|
|
|
jsr BG0SetUp
|
2021-10-22 05:56:12 +00:00
|
|
|
; jsr TileAnimInit
|
2021-10-13 20:13:52 +00:00
|
|
|
|
|
|
|
; Allocate room to load data
|
2021-10-22 05:56:12 +00:00
|
|
|
; jsr MovePlayerToOrigin ; Put the player at the beginning of the map
|
2021-10-13 20:13:52 +00:00
|
|
|
|
2021-10-21 13:46:26 +00:00
|
|
|
; Add a player sprite
|
2021-10-22 05:56:12 +00:00
|
|
|
lda #32 ; tile id
|
2021-10-21 13:46:26 +00:00
|
|
|
ldx #10 ; x-pos relative to playfield upper-left corner
|
|
|
|
ldy #10 ; y-pos relative to playfield upper-left corner
|
|
|
|
jsl AddSprite
|
|
|
|
|
2021-10-13 20:13:52 +00:00
|
|
|
lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render
|
|
|
|
tsb DirtyBits
|
|
|
|
|
2021-10-22 05:56:12 +00:00
|
|
|
; lda #$FFFF
|
2021-10-13 20:13:52 +00:00
|
|
|
jsl Render
|
2021-10-22 05:56:12 +00:00
|
|
|
|
|
|
|
brl Exit
|
2021-10-13 20:13:52 +00:00
|
|
|
EvtLoop
|
|
|
|
jsl DoTimers
|
|
|
|
jsl Render
|
|
|
|
|
|
|
|
jsl ReadControl
|
|
|
|
and #$007F ; Ignore the buttons for now
|
|
|
|
|
|
|
|
cmp #'q'
|
|
|
|
bne :7
|
|
|
|
brl Exit
|
|
|
|
|
|
|
|
:7 cmp #LEFT_ARROW
|
|
|
|
bne :8
|
|
|
|
brl EvtLoop
|
|
|
|
|
|
|
|
:8 cmp #RIGHT_ARROW
|
|
|
|
bne :9
|
|
|
|
brl EvtLoop
|
|
|
|
|
|
|
|
:9
|
|
|
|
brl EvtLoop
|
|
|
|
|
|
|
|
; Exit code
|
|
|
|
Exit
|
|
|
|
jsl EngineShutDown
|
|
|
|
|
|
|
|
_QuitGS qtRec
|
|
|
|
|
|
|
|
bcs Fatal
|
|
|
|
Fatal brk $00
|
|
|
|
|
|
|
|
MyPalette dw $0000,$0777,$0F31,$0E51,$00A0,$02E3,$0BF1,$0FA4,$0FD7,$0EE6,$0F59,$068F,$01CE,$09B9,$0EDA,$0EEE
|
|
|
|
|
|
|
|
; Position the screen with the botom-left corner of the tilemap visible
|
|
|
|
MovePlayerToOrigin
|
|
|
|
lda #0 ; Set the player's position
|
|
|
|
jsl SetBG0XPos
|
|
|
|
|
|
|
|
lda TileMapHeight
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
sec
|
|
|
|
sbc ScreenHeight
|
|
|
|
jsl SetBG0YPos
|
|
|
|
rts
|
|
|
|
|
|
|
|
qtRec adrl $0000
|
|
|
|
da $00
|
|
|
|
|
|
|
|
PUT gen/App.TileMapBG0.s
|
|
|
|
PUT gen/App.TileSetAnim.s
|
|
|
|
|
|
|
|
Overlay ENT
|
|
|
|
rtl
|
|
|
|
|
|
|
|
ANGLEBNK ENT
|