4cade/src/4cade.a

111 lines
2.7 KiB
Plaintext

!cpu 6502
!to "build/LAUNCHER.SYSTEM",plain
*=$2000
!source "src/constants.a"
!source "src/macros.a"
Init
jsr Has64K ; check for 64K (required)
bcs @no64K
jsr DisableAccelerator ; set to 1 MHz
jsr Has128K ; check for 128K (absence is OK, we just filter out some games)
ror MachineStatus
jsr HasJoystick ; check for joystick (absence is OK, we just filter out some games)
ror MachineStatus
+READ_ROM_WRITE_RAM1
ldx #$00 ; relocate rest of program to RAM bank 1 in language card
@FM lda FirstMover,x
sta $D000,x
inx
bne @FM
lda @FM+2
cmp #>LastMover
bcs +
inc @FM+2
inc @FM+5
bne @FM
+
jsr init ; initialize ProRWTS2 (bye bye ProDOS)
+READ_RAM1_WRITE_RAM1
jmp Start
@no64K
jsr $FB2F
jsr $FC58
ldy #@no64Klen
- lda @s_no64K,y
sta $6B6,y
dey
bpl -
@hang bmi @hang
@s_no64K !raw "REQUIRES 64K"
@no64Klen=*-@s_no64K
; these routines will only be called once, from main memory, before relocating to language card
!source "src/memcheck.a"
!source "src/joystick.a"
!source "src/normfast.a"
; ProRWTS2 has its own function to relocate itself
!source "src/prorwts2.a"
FirstMover
!pseudopc $D000 {
!zone
Start
bit MachineStatus
bvs @Load128
jsr LoadFile
!word cover64
clc
bcc @Show
@Load128
jsr LoadDHRFile
!word cover128
sta $C000 ; double hi-res mode
sta $C00D
sta $C05E
sta $C001
@Show
sta $C057 ; show graphics page 1 (HGR or DHGR)
sta $C052
sta $C054
sta $C050
jsr LoadFile
- !word gamesconf
jsr ParseGamesList
!word gGamesListStore
!word -
bit $C010
- lda $C000
bpl -
bit $C010
brk
gamesconf
!byte gamesconf_e-gamesconf_b
gamesconf_b
!text "GAMES.CONF"
gamesconf_e
cover64
!byte cover64_e-cover64_b
cover64_b
!text "COVER"
cover64_e
cover128
!byte cover128_e-cover128_b
cover128_b
!text "COVER.A2FC"
cover128_e
; these routines will only be called after relocating to language card
!source "src/glue.prorwts2.a"
!source "src/okvs.a"
!source "src/parse.games.a"
gGamesListStore
!word *+2 ; address of first okvs store
}
LastMover