2021-08-25 14:38:02 +00:00
|
|
|
use Util.Macs.s
|
2022-02-02 16:21:31 +00:00
|
|
|
use Load.Macs.s
|
2021-08-25 14:38:02 +00:00
|
|
|
use Locator.Macs.s
|
|
|
|
use Mem.Macs.s
|
|
|
|
use Misc.Macs.s
|
|
|
|
use Tool222.MACS.s
|
|
|
|
use Core.MACS.s
|
|
|
|
|
|
|
|
use .\Defs.s
|
|
|
|
|
|
|
|
; Feature flags
|
2021-11-20 18:00:21 +00:00
|
|
|
NO_INTERRUPTS equ 1 ; turn off for crossrunner debugging
|
2021-08-25 14:38:02 +00:00
|
|
|
NO_MUSIC equ 1 ; turn music + tool loading off
|
|
|
|
|
2022-02-18 18:12:32 +00:00
|
|
|
; External data space provided by the main program segment
|
2021-08-25 14:38:02 +00:00
|
|
|
tiledata EXT
|
2022-02-18 18:12:32 +00:00
|
|
|
TileStore EXT
|
2021-08-25 14:38:02 +00:00
|
|
|
|
2021-10-21 13:50:07 +00:00
|
|
|
; Sprite plane data and mask banks are provided as an exteral segment
|
2022-02-18 18:12:32 +00:00
|
|
|
;
|
|
|
|
; The sprite data holds a set of pre-rendered sprites that are optimized to support the rendering pipeline. There
|
|
|
|
; are four copies of each sprite, along with the cooresponding mask laid out into 4x4 tile regions where the
|
|
|
|
; empty row and column is shared between adjacent blocks.
|
|
|
|
;
|
|
|
|
; Logically, the memory is laid out as 4 columns of sprites and 4 rows.
|
|
|
|
;
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | | | | | | | | | | | | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | 0 | 0 | | 1 | 1 | | 2 | 2 | | 3 | 3 | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | 0 | 0 | | 1 | 1 | | 2 | 2 | | 3 | 3 | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | | | | | | | | | | | | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | 4 | 4 | | 5 | 5 | | 6 | 6 | | 7 | 7 | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | 4 | 4 | | 5 | 5 | | 6 | 6 | | 7 | 7 | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
; | | | | | | | | | | | | | ...
|
|
|
|
; +---+---+---+---+---+---+---+---+---+---+---+---+-...
|
|
|
|
;
|
|
|
|
; For each sprite, when it needs to be copied into an on-screen tile, it could exist at any offset compared to its
|
|
|
|
; natural alignment. By having a buffer around the sprite data, an address pointer can be set to a different origin
|
|
|
|
; and a simple 8x8 block copy can cut out the appropriate bit of the sprite. For example, here is a zoomed-in look
|
|
|
|
; at a sprite with an offset, O, at (-2,-3). As shown, by selecting an appropriate origin, just the top corner
|
|
|
|
; of the sprite data will be copied.
|
|
|
|
;
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | || | || | | | || | | | |
|
|
|
|
; +---+-- O----------------+ --+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | | || | | | || | | | |
|
|
|
|
; +---+-- | | --+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | | || | | | || | | | |
|
|
|
|
; +---+-- | | --+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | | || | | | || | | | |
|
|
|
|
; +===+== | ++===+== | ==+===++===+===+===+===++===+===+===+===+..
|
|
|
|
; | | | || | S | S | S || S | S | S | || | | | |
|
|
|
|
; +---+-- +----------------+ --+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | || S | S S | S || S | S | S | S || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | || S | S | S | S || S | S | S | S || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | || S | S | S | S || S | S | S | S || | | | |
|
|
|
|
; +===+===+===+===++===+===+===+===++===+===+===+===++===+===+===+===+..
|
|
|
|
; | | | | || S | S | S | S || S | S | S | S || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | || S | S | S | S || S | S | S | S || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | || S | S | S | S || S | S | S | S || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; | | | | || | S | S | S || S | S | S | || | | | |
|
|
|
|
; +---+---+---+---++---+---+---+---++---+---+---+---++---+---+---+---+..
|
|
|
|
; . . . . . . . . . . . . . . . . .
|
|
|
|
;
|
|
|
|
; Each sprite will take up, effectively 9 tiles of storage space per
|
|
|
|
; instance (plus edges) and there are 4 instances for the H/V bits
|
|
|
|
; and 4 more for the masks. This results in a need for 43,264 bytes
|
|
|
|
; for all 16 sprites.
|
|
|
|
|
2021-10-21 13:50:07 +00:00
|
|
|
spritedata EXT
|
|
|
|
spritemask EXT
|
|
|
|
|
2022-02-18 18:12:32 +00:00
|
|
|
; If there are overlays, they are provided as an external
|
2021-10-11 19:09:38 +00:00
|
|
|
Overlay EXT
|
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
; Core engine functionality. The idea is that that source file can be PUT into
|
|
|
|
; a main source file and all of the functionality will be available.
|
|
|
|
;
|
|
|
|
; There are some constancts that must be externally defined that can affect how
|
|
|
|
; the GTE runtime works
|
|
|
|
;
|
|
|
|
; NO_MUSIC : Set to non-zero to avoid using any source
|
|
|
|
; NO_INTERRUPTS : Set to non-zero to avoid installing custom interrupt handlers
|
|
|
|
|
|
|
|
mx %00
|
|
|
|
|
|
|
|
; High-Level StartUp and ShutDown functions
|
|
|
|
EngineStartUp ENT
|
|
|
|
phb
|
|
|
|
phk
|
|
|
|
plb
|
|
|
|
|
|
|
|
jsr ToolStartUp ; Start up the toolbox tools we rely on
|
2022-02-02 16:21:31 +00:00
|
|
|
jsr _CoreStartUp
|
|
|
|
|
|
|
|
plb
|
|
|
|
rtl
|
|
|
|
|
|
|
|
_CoreStartUp
|
2021-08-25 14:38:02 +00:00
|
|
|
jsr SoundStartUp ; Start up any sound/music tools
|
|
|
|
jsr IntStartUp ; Enable certain iterrupts
|
|
|
|
|
|
|
|
jsr InitMemory ; Allocate and initialize memory for the engine
|
|
|
|
jsr EngineReset ; All of the resources are allocated, put the engine in a known state
|
|
|
|
|
2021-08-26 14:45:40 +00:00
|
|
|
jsr InitGraphics ; Initialize all of the graphics-related data
|
2021-10-29 02:41:01 +00:00
|
|
|
nop
|
2021-10-29 03:19:18 +00:00
|
|
|
jsr InitSprites ; Initialize the sprite subsystem
|
2021-10-24 03:31:38 +00:00
|
|
|
jsr InitTiles ; Initialize the tile subsystem
|
|
|
|
|
2021-08-26 14:45:40 +00:00
|
|
|
jsr InitTimers ; Initialize the timer subsystem
|
2022-02-02 16:21:31 +00:00
|
|
|
rts
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
EngineShutDown ENT
|
2021-08-26 21:12:08 +00:00
|
|
|
phb
|
|
|
|
phk
|
|
|
|
plb
|
|
|
|
|
2022-02-02 16:21:31 +00:00
|
|
|
jsr _CoreShutDown
|
2021-08-25 14:38:02 +00:00
|
|
|
jsr ToolShutDown
|
2021-08-26 21:12:08 +00:00
|
|
|
|
|
|
|
plb
|
2021-08-25 14:38:02 +00:00
|
|
|
rtl
|
|
|
|
|
2022-02-02 16:21:31 +00:00
|
|
|
_CoreShutDown
|
|
|
|
jsr IntShutDown
|
|
|
|
jsr SoundShutDown
|
|
|
|
rts
|
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
ToolStartUp
|
|
|
|
_TLStartUp ; normal tool initialization
|
|
|
|
pha
|
|
|
|
_MMStartUp
|
|
|
|
_Err ; should never happen
|
|
|
|
pla
|
|
|
|
sta MasterId ; our master handle references the memory allocated to us
|
|
|
|
ora #$0100 ; set auxID = $01 (valid values $01-0f)
|
|
|
|
sta UserId ; any memory we request must use our own id
|
|
|
|
|
|
|
|
_MTStartUp
|
|
|
|
rts
|
|
|
|
|
|
|
|
MasterId ds 2
|
|
|
|
UserId ds 2
|
|
|
|
|
|
|
|
; Fatal error handler invoked by the _Err macro
|
|
|
|
PgmDeath tax
|
|
|
|
pla
|
|
|
|
inc
|
|
|
|
phx
|
|
|
|
phk
|
|
|
|
pha
|
|
|
|
bra ContDeath
|
|
|
|
PgmDeath0 pha
|
|
|
|
pea $0000
|
|
|
|
pea $0000
|
|
|
|
ContDeath ldx #$1503
|
|
|
|
jsl $E10000
|
|
|
|
|
|
|
|
ToolShutDown
|
|
|
|
rts
|
|
|
|
|
|
|
|
; Use Tool222 (NinjaTrackerPlus) for music playback
|
|
|
|
SoundStartUp
|
|
|
|
lda #NO_MUSIC
|
|
|
|
bne :no_music
|
|
|
|
|
|
|
|
pea $00DE
|
|
|
|
pea $0000
|
|
|
|
_LoadOneTool
|
|
|
|
_Err
|
|
|
|
|
|
|
|
lda UserId
|
|
|
|
pha
|
|
|
|
_NTPStartUp
|
|
|
|
:no_music
|
|
|
|
rts
|
|
|
|
|
|
|
|
SoundShutDown
|
|
|
|
lda #NO_MUSIC
|
|
|
|
bne :no_music
|
|
|
|
_NTPShutDown
|
|
|
|
:no_music
|
|
|
|
rts
|
|
|
|
|
|
|
|
; Install interrupt handlers. We use the VBL interrupt to keep animations
|
|
|
|
; moving at a consistent rate, regarless of the rendered frame rate. The
|
|
|
|
; one-second timer is generally just used for counters and as a handy
|
|
|
|
; frames-per-second trigger.
|
|
|
|
IntStartUp
|
|
|
|
lda #NO_INTERRUPTS
|
|
|
|
bne :no_interrupts
|
|
|
|
PushLong #0
|
|
|
|
pea $0015 ; Get the existing 1-second interrupt handler and save
|
|
|
|
_GetVector
|
|
|
|
PullLong OldOneSecVec
|
|
|
|
|
|
|
|
pea $0015 ; Set the new handler and enable interrupts
|
|
|
|
PushLong #OneSecHandler
|
|
|
|
_SetVector
|
|
|
|
|
|
|
|
pea $0006
|
|
|
|
_IntSource
|
|
|
|
|
|
|
|
PushLong #VBLTASK ; Also register a Heart Beat Task
|
|
|
|
_SetHeartBeat
|
|
|
|
|
|
|
|
:no_interrupts
|
|
|
|
rts
|
|
|
|
|
|
|
|
IntShutDown
|
|
|
|
lda #NO_INTERRUPTS
|
|
|
|
bne :no_interrupts
|
|
|
|
|
|
|
|
pea $0007 ; disable 1-second interrupts
|
|
|
|
_IntSource
|
|
|
|
|
|
|
|
PushLong #VBLTASK ; Remove our heartbeat task
|
|
|
|
_DelHeartBeat
|
|
|
|
|
|
|
|
pea $0015
|
|
|
|
PushLong OldOneSecVec ; Reset the interrupt vector
|
|
|
|
_SetVector
|
|
|
|
|
|
|
|
:no_interrupts
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
; Interrupt handlers. We install a heartbeat (1/60th second and a 1-second timer)
|
|
|
|
OneSecHandler mx %11
|
|
|
|
phb
|
|
|
|
pha
|
|
|
|
phk
|
|
|
|
plb
|
|
|
|
|
|
|
|
rep #$20
|
|
|
|
inc OneSecondCounter
|
|
|
|
sep #$20
|
|
|
|
|
|
|
|
ldal $E0C032
|
|
|
|
and #%10111111 ;clear IRQ source
|
|
|
|
stal $E0C032
|
|
|
|
|
|
|
|
pla
|
|
|
|
plb
|
|
|
|
clc
|
|
|
|
rtl
|
|
|
|
mx %00
|
|
|
|
|
2021-08-26 13:52:43 +00:00
|
|
|
OneSecondCounter ENT
|
|
|
|
dw 0
|
2021-08-25 14:38:02 +00:00
|
|
|
OldOneSecVec ds 4
|
|
|
|
|
|
|
|
VBLTASK hex 00000000
|
|
|
|
dw 0
|
|
|
|
hex 5AA5
|
|
|
|
|
|
|
|
; Reset the engine to a known state
|
|
|
|
; Blitter initialization
|
|
|
|
EngineReset
|
|
|
|
stz ScreenHeight
|
|
|
|
stz ScreenWidth
|
|
|
|
stz ScreenY0
|
|
|
|
stz ScreenY1
|
|
|
|
stz ScreenX0
|
|
|
|
stz ScreenX1
|
|
|
|
stz ScreenTileHeight
|
|
|
|
stz ScreenTileWidth
|
|
|
|
stz StartX
|
|
|
|
stz OldStartX
|
|
|
|
stz StartXMod164
|
|
|
|
|
|
|
|
stz StartY
|
|
|
|
stz OldStartY
|
|
|
|
stz StartYMod208
|
|
|
|
|
|
|
|
stz EngineMode
|
|
|
|
stz DirtyBits
|
2022-02-04 05:44:46 +00:00
|
|
|
stz LastRender
|
2021-08-25 14:38:02 +00:00
|
|
|
stz LastPatchOffset
|
|
|
|
stz BG1StartX
|
|
|
|
stz BG1StartXMod164
|
|
|
|
stz BG1StartY
|
|
|
|
stz BG1StartYMod208
|
|
|
|
stz BG1OffsetIndex
|
|
|
|
|
|
|
|
stz BG0TileOriginX
|
|
|
|
stz BG0TileOriginY
|
|
|
|
stz OldBG0TileOriginX
|
|
|
|
stz OldBG0TileOriginY
|
|
|
|
|
|
|
|
stz BG1TileOriginX
|
|
|
|
stz BG1TileOriginY
|
|
|
|
stz OldBG1TileOriginX
|
|
|
|
stz OldBG1TileOriginY
|
|
|
|
|
|
|
|
stz TileMapWidth
|
|
|
|
stz TileMapHeight
|
|
|
|
stz TileMapPtr
|
|
|
|
stz TileMapPtr+2
|
2021-08-31 03:14:04 +00:00
|
|
|
stz FringeMapPtr
|
|
|
|
stz FringeMapPtr+2
|
2021-08-25 14:38:02 +00:00
|
|
|
|
2021-08-26 21:12:08 +00:00
|
|
|
stz BG1TileMapWidth
|
|
|
|
stz BG1TileMapHeight
|
|
|
|
stz BG1TileMapPtr
|
|
|
|
stz BG1TileMapPtr+2
|
|
|
|
|
2021-11-14 01:45:27 +00:00
|
|
|
stz SCBArrayPtr
|
|
|
|
stz SCBArrayPtr+2
|
|
|
|
|
2022-02-18 19:42:37 +00:00
|
|
|
stz SpriteBanks
|
|
|
|
stz SpriteMap
|
|
|
|
stz ActiveSpriteCount
|
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
stz OneSecondCounter
|
|
|
|
|
2022-02-18 19:42:37 +00:00
|
|
|
lda #13
|
|
|
|
sta tmp15
|
|
|
|
stz tmp14
|
|
|
|
|
|
|
|
:loop
|
2021-08-25 14:38:02 +00:00
|
|
|
ldx #BlitBuff
|
|
|
|
lda #^BlitBuff
|
2022-02-18 19:42:37 +00:00
|
|
|
ldy tmp14
|
2021-08-25 14:38:02 +00:00
|
|
|
jsr BuildBank
|
2022-02-18 19:42:37 +00:00
|
|
|
|
|
|
|
lda tmp14
|
|
|
|
clc
|
|
|
|
adc #4
|
|
|
|
sta tmp14
|
|
|
|
|
|
|
|
dec tmp15
|
|
|
|
bne :loop
|
2021-10-21 13:50:07 +00:00
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
; Allow the user to dynamically select one of the pre-configured screen sizes, or pass
|
|
|
|
; in a specific width and height. The screen is automatically centered. If this is
|
|
|
|
; not desired, then SetScreenRect should be used directly
|
|
|
|
;
|
|
|
|
; 0. Full Screen : 40 x 25 320 x 200 (32,000 bytes (100.0%))
|
|
|
|
; 1. Sword of Sodan : 34 x 24 272 x 192 (26,112 bytes ( 81.6%))
|
|
|
|
; 2. ~NES : 32 x 25 256 x 200 (25,600 bytes ( 80.0%))
|
|
|
|
; 3. Task Force : 32 x 22 256 x 176 (22,528 bytes ( 70.4%))
|
|
|
|
; 4. Defender of the World : 35 x 20 280 x 160 (22,400 bytes ( 70.0%))
|
|
|
|
; 5. Rastan : 32 x 20 256 x 160 (20,480 bytes ( 64.0%))
|
|
|
|
; 6. Game Boy Advanced : 30 x 20 240 x 160 (19,200 bytes ( 60.0%))
|
|
|
|
; 7. Ancient Land of Y's : 36 x 16 288 x 128 (18,432 bytes ( 57.6%))
|
|
|
|
; 8. Game Boy Color : 20 x 18 160 x 144 (11,520 bytes ( 36.0%))
|
2022-02-02 16:21:31 +00:00
|
|
|
; 9. Agony (Amiga) : 36 x 24 288 x 192 (27,648 bytes ( 86.4%))
|
2022-02-18 18:12:32 +00:00
|
|
|
; 10. Atari Lynx : 20 x 13 160 x 102 (8,160 bytes ( 25.5%))
|
2022-02-02 16:21:31 +00:00
|
|
|
;
|
2021-08-25 14:38:02 +00:00
|
|
|
; X = mode number OR width in pixels (must be multiple of 2)
|
2022-02-02 16:21:31 +00:00
|
|
|
; Y = height in pixels (if X > 8)
|
2021-08-25 14:38:02 +00:00
|
|
|
|
2022-02-18 18:12:32 +00:00
|
|
|
ScreenModeWidth dw 320,272,256,256,280,256,240,288,160,288,160,320
|
|
|
|
ScreenModeHeight dw 200,192,200,176,160,160,160,128,144,192,102,1
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
SetScreenMode ENT
|
|
|
|
phb
|
|
|
|
phk
|
|
|
|
plb
|
2022-02-02 16:21:31 +00:00
|
|
|
jsr _SetScreenMode
|
|
|
|
plb
|
|
|
|
rtl
|
2021-08-25 14:38:02 +00:00
|
|
|
|
2022-02-02 16:21:31 +00:00
|
|
|
_SetScreenMode
|
2022-02-18 18:12:32 +00:00
|
|
|
cpx #11
|
|
|
|
bcs :direct ; if x > 10, then assume X and Y are the dimensions
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
txa
|
|
|
|
asl
|
|
|
|
tax
|
|
|
|
|
|
|
|
ldy ScreenModeHeight,x
|
|
|
|
lda ScreenModeWidth,x
|
|
|
|
tax
|
|
|
|
|
|
|
|
:direct cpy #201
|
|
|
|
bcs :exit
|
|
|
|
|
|
|
|
cpx #321
|
|
|
|
bcs :exit
|
|
|
|
|
|
|
|
txa
|
|
|
|
lsr
|
|
|
|
pha ; Save X (width / 2) and Y (height)
|
|
|
|
phy
|
|
|
|
|
|
|
|
lda #160 ; Center the screen
|
|
|
|
sec
|
|
|
|
sbc 3,s
|
|
|
|
lsr
|
|
|
|
xba
|
|
|
|
pha ; Save half the origin coordinate
|
|
|
|
|
|
|
|
lda #200
|
|
|
|
sec
|
|
|
|
sbc 3,s ; This is now Y because of the PHA above
|
|
|
|
lsr
|
|
|
|
ora 1,s
|
|
|
|
|
|
|
|
plx ; Throw-away to pop the stack
|
|
|
|
ply
|
|
|
|
plx
|
|
|
|
|
|
|
|
jsr SetScreenRect
|
2022-02-02 16:21:31 +00:00
|
|
|
jmp FillScreen ; tail return
|
2021-08-25 14:38:02 +00:00
|
|
|
:exit
|
2022-02-02 16:21:31 +00:00
|
|
|
rts
|
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
WaitForKey sep #$20
|
|
|
|
stal KBD_STROBE_REG ; clear the strobe
|
|
|
|
:WFK ldal KBD_REG
|
|
|
|
bpl :WFK
|
|
|
|
rep #$20
|
|
|
|
and #$007F
|
|
|
|
rts
|
|
|
|
|
|
|
|
ClearKbdStrobe sep #$20
|
|
|
|
stal KBD_STROBE_REG
|
|
|
|
rep #$20
|
|
|
|
rts
|
|
|
|
|
2021-10-31 20:42:59 +00:00
|
|
|
; Read the keyboard and paddle controls and return in a game-controller-like format
|
2021-11-12 17:27:43 +00:00
|
|
|
LastKey db 0
|
2021-08-25 14:38:02 +00:00
|
|
|
ReadControl ENT
|
2022-02-02 16:21:31 +00:00
|
|
|
jsr _ReadControl
|
|
|
|
rtl
|
|
|
|
|
|
|
|
_ReadControl
|
2021-08-25 14:38:02 +00:00
|
|
|
pea $0000 ; low byte = key code, high byte = %------AB
|
|
|
|
|
|
|
|
sep #$20
|
|
|
|
ldal OPTION_KEY_REG ; 'B' button
|
|
|
|
and #$80
|
|
|
|
beq :BNotDown
|
|
|
|
|
2021-11-12 17:27:43 +00:00
|
|
|
lda #PAD_BUTTON_B
|
2021-10-31 20:42:59 +00:00
|
|
|
ora 2,s
|
|
|
|
sta 2,s
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
:BNotDown
|
|
|
|
ldal COMMAND_KEY_REG
|
|
|
|
and #$80
|
|
|
|
beq :ANotDown
|
|
|
|
|
2021-11-12 17:27:43 +00:00
|
|
|
lda #PAD_BUTTON_A
|
2021-10-31 20:42:59 +00:00
|
|
|
ora 2,s
|
|
|
|
sta 2,s
|
2021-08-25 14:38:02 +00:00
|
|
|
|
|
|
|
:ANotDown
|
|
|
|
ldal KBD_STROBE_REG ; read the keyboard
|
|
|
|
bit #$80
|
|
|
|
beq :KbdNotDwn ; check the key-down status
|
|
|
|
and #$7f
|
|
|
|
ora 1,s
|
|
|
|
sta 1,s
|
|
|
|
|
2021-11-12 17:27:43 +00:00
|
|
|
cmpl LastKey
|
|
|
|
beq :KbdDown
|
|
|
|
stal LastKey
|
|
|
|
|
|
|
|
lda #PAD_KEY_DOWN ; set the keydown flag
|
|
|
|
ora 2,s
|
|
|
|
sta 2,s
|
|
|
|
bra :KbdDown
|
|
|
|
|
2021-08-25 14:38:02 +00:00
|
|
|
:KbdNotDwn
|
2021-11-12 17:27:43 +00:00
|
|
|
lda #0
|
|
|
|
stal LastKey
|
|
|
|
:KbdDown
|
2021-08-25 14:38:02 +00:00
|
|
|
rep #$20
|
|
|
|
pla
|
2022-02-02 16:21:31 +00:00
|
|
|
rts
|
2021-08-25 14:38:02 +00:00
|
|
|
|
2022-02-18 19:42:37 +00:00
|
|
|
put blitter/Template.s
|
|
|
|
|
2021-08-26 21:45:23 +00:00
|
|
|
put Memory.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put Graphics.s
|
2021-10-21 13:50:07 +00:00
|
|
|
put Sprite.s
|
2021-11-11 23:06:38 +00:00
|
|
|
put Sprite2.s
|
2022-02-18 18:12:32 +00:00
|
|
|
put SpriteRender.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put Render.s
|
2021-08-26 13:52:43 +00:00
|
|
|
put Timer.s
|
|
|
|
put Script.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put blitter/Blitter.s
|
|
|
|
put blitter/Horz.s
|
|
|
|
put blitter/PEISlammer.s
|
|
|
|
put blitter/Tables.s
|
|
|
|
put blitter/Tiles.s
|
2021-11-14 01:45:27 +00:00
|
|
|
put blitter/Tiles00000.s ; normal tiles
|
|
|
|
put blitter/Tiles00001.s ; dynamic tiles
|
|
|
|
put blitter/Tiles00010.s ; normal masked tiles
|
|
|
|
put blitter/Tiles00011.s ; dynamic masked tiles
|
|
|
|
|
|
|
|
put blitter/Tiles10000.s ; normal tiles + sprites
|
2021-11-19 22:30:22 +00:00
|
|
|
put blitter/Tiles10001.s ; dynamic tiles + sprites
|
2021-11-16 03:23:15 +00:00
|
|
|
put blitter/Tiles10010.s ; normal masked tiles + sprites
|
2021-11-19 22:30:22 +00:00
|
|
|
put blitter/Tiles10011.s ; dynamic masked tiles + sprites
|
|
|
|
|
2021-11-19 21:07:43 +00:00
|
|
|
put blitter/Tiles11000.s ; normal high priority tiles + sprites
|
2021-11-19 22:30:22 +00:00
|
|
|
put blitter/Tiles11001.s ; dynamic high priority tiles + sprites
|
2021-11-19 21:07:43 +00:00
|
|
|
put blitter/Tiles11010.s ; normal high priority masked tiles + sprites
|
2021-11-19 22:48:39 +00:00
|
|
|
put blitter/Tiles11011.s ; dynamic high priority masked tiles + sprites
|
2021-11-19 22:30:22 +00:00
|
|
|
|
2021-10-22 05:56:12 +00:00
|
|
|
put blitter/TilesBG1.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put blitter/Vert.s
|
2021-08-26 13:52:43 +00:00
|
|
|
put blitter/BG0.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put blitter/BG1.s
|
2021-11-14 01:45:27 +00:00
|
|
|
put blitter/SCB.s
|
2021-08-25 14:38:02 +00:00
|
|
|
put TileMap.s
|