mirror of https://github.com/a2-4am/4cade.git
This commit is contained in:
parent
7e28ff5275
commit
abfa0261a9
23
Makefile
23
Makefile
|
@ -23,21 +23,24 @@ asm: md
|
|||
$(ACME) -r build/4cade.lst src/4cade.a
|
||||
|
||||
dsk: md asm
|
||||
$(CADIUS) CREATEVOLUME build/"$(DISK)" "${VOLUME}" 32766KB >/dev/null
|
||||
cp res/_FileInformation.txt build/
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/PRODOS" >/dev/null
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "build/LAUNCHER.SYSTEM" >/dev/null
|
||||
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >/dev/null
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/GAMES.CONF" >/dev/null
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER" >/dev/null
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER.A2FC" >/dev/null
|
||||
$(CADIUS) CREATEVOLUME build/"$(DISK)" "${VOLUME}" 32766KB >>build/log
|
||||
cp res/_FileInformation.txt build/ >>build/log
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/PRODOS" >>build/log
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "build/LAUNCHER.SYSTEM" >>build/log
|
||||
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/GAMES.CONF" >>build/log
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER" >>build/log
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER.A2FC" >>build/log
|
||||
rsync -aP res/hgr/* build/I >>build/log
|
||||
bin/buildfileinfo.py build/I >>build/log
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/I" "build/I" >>build/log
|
||||
# bin/do2po.py res/dsk/ build/po/
|
||||
# rsync -a res/dsk/*.po build/po/
|
||||
# bin/extract.py build/po/ | sh >/dev/null
|
||||
# bin/extract.py build/po/ | sh >build/log
|
||||
# rm -f build/X/**/.DS_Store
|
||||
# rm -f build/X/**/PRODOS
|
||||
# rm -f build/X/**/LOADER.SYSTEM
|
||||
# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/X" "build/X" >/dev/null
|
||||
# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/X" "build/X" >build/log
|
||||
|
||||
artwork: dsk
|
||||
# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/ARTWORK" "res/artwork"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
|
||||
indir = sys.argv[1]
|
||||
with open(os.path.join(indir, "_FileInformation.txt"), "w") as writer:
|
||||
writer.write("\r\n".join(["%s=Type(06),AuxType(2000),Access(C3)" % f for f in os.listdir(indir)]))
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
#
# 4cade master game list
#
# Format:
# AB,name=directory
#
# A=1 if game requires joystick, 0 if playable on keyboard
# B=1 if game requires 128K, 0 if playable on 64K
# all other values for A or B -> ignore entire line (like this one!)
#
00,Agent USA=AGENT.USA
11,Airheart=AIRHEART
00,Alcazar=ALCAZAR
00,Alien Downpour=ALIEN.DOWNPOUR
# TODO: Alien Rain volume name and executable filename do not match (one has period, one doesn't)
00,Alien Rain=ALIENRAIN
00,Ankh=ANKH
00,Apple Panic=APPLE.PANIC
00,Aquatron=AQUATRON
10,Arkanoid=ARKANOID
00,Battlezone=BATTLEZONE
10,BC's Quest For Tires=BCS.QUEST
00,Beer Run=BEER.RUN
00,Bellhop=BELLHOP
00,Bill Budge's Trilogy=BUDGETRILOGY
00,Blister Ball=BLISTER.BALL
00,Bolo=BOLO
00,Brainteaser Boulevard=BRAINTEASERBLVD
00,BurgerTime=BURGERTIME
00,Cannonball Blitz=CANNONBALL.BLTZ
00,Canyon Climber=CANYON.CLIMBER
00,Centipede=CENTIPEDE
10,Choplifter=CHOPLIFTER
00,Commando=COMMANDO
00,Conan=CONAN
10,Crisis Mountain=CRISIS.MOUNTAIN
00,Crossfire=CROSSFIRE
01,D-Generation=D.GENERATION
10,David's Midnight Magic=DAVIDS.MAGIC
10,Defender=DEFENDER
00,Dig Dug=DIG.DUG
10,Dino Eggs=DINO.EGGS
10,Donkey Kong=DONKEY.KONG
10,Drelbs=DRELBS
00,Drol=DROL
00,Epoch=EPOCH
00,Falcons=FALCONS
00,Flight Simulator I=FS1
00,Flip Out=FLIP.OUT
10,Formula 1 Racer=FORMULA.1
00,Frogger=FROGGER
10,Galaxian=GALAXIAN
10,The Goonies=GOONIES
00,Gremlins=GREMLINS
10,H.E.R.O.=HERO
00,Hard Hat Mack=HARD.HAT.MACK
00,Head On=HEAD.ON
00,High Rise=HIGH.RISE
00,Hungry Boy=HUNGRYBOY
10,Impossible Mission=IMPOSSIBLE.MISS
00,Joust=JOUST
00,Jungle Hunt=JUNGLE.HUNT
00,Karateka=KARATEKA
00,Lady Tut=LADY.TUT
10,Lost Tomb=LOST.TOMB
10,Mad Bomber=MAD.BOMBER
00,Mario Bros=MARIO.BROS
00,Montezuma's Revenge=MONTEZUMA
00,Moon Patrol=MOON.PATROL
00,Mr. Cool=MR.COOL
10,Mr. Do=MR.DO
00,Mr. Robot=MR.ROBOT
00,Ms. Pacman=MS.PACMAN
00,Nibbler=NIBBLER
00,Night Stalker=NIGHT.STALKER
00,Nightmare Gallery=NIGHTMARE
00,NORAD=NORAD
00,O'Riley's Mine=ORILEYS.MINE
00,Outpost=OUTPOST
00,Pac-Man=PAC.MAN
00,Paperboy=PAPERBOY
00,Pest Patrol=PEST.PATROL
00,Pie-Man=PIEMAN
00,Pit Stop II=PITSTOP.II
10,Pitfall II=PITFALL.II
00,Plasmania=PLASMANIA
00,Pooyan=POOYAN
01,Prince of Persia=PRINCEUNP
00,Puckman=PUCK.MAN
11,Qix=QIX
01,Radwarrior=RADWARRIOR
00,Repton=REPTON
00,Ribbit=RIBBIT
00,Robotron 2084=ROBOTRON.2084
00,Sabotage=SABOTAGE
00,Serpentine=SERPENTINE
10,Shamus=SHAMUS
00,Snack Attack=SNACK.ATTACK
00,Snake Byte=SNAKE.BYTE
00,Sneakers=SNEAKERS
00,Snoggle=SNOGGLE
00,Space Raiders=SPACE.RAIDERS
00,Spider Raid=SPIDER.RAID
01,Spiderbot=SPIDERBOT
00,Spy Hunter=SPY.HUNTER
00,Spy's Demise=SPYS.DEMISE
10,Starblaster=STARBLASTER
10,Stargate=STARGATE
00,Stellar 7=STELLAR.7
00,Succession=SUCCESSION
00,Swashbuckler=SWASHBUCKLER
00,Tag Team Wrestling=TAG.TEAM
00,Tapper=TAPPER
00,Thief=THIEF
00,Thunder Bombs=THUNDERBOMBS
10,Tomahawk=TOMAHAWK
00,Track N Field=TRACK.AND.FIELD
10,Tubeway ][=TUBEWAY
01,Victory Road=VICTORY.ROAD
00,Wavy Navy=WAVY.NAVY
[eof]
|
||||
#
# 4cade master game list
#
# Format:
# AB,name=directory
#
# A=1 if game requires joystick, 0 if playable on keyboard
# B=1 if game requires 128K, 0 if playable on 64K
# all other values for A or B -> ignore entire line (like this one!)
#
00,Agent USA=AGENT.USA
11,Airheart=AIRHEART
00,Alcazar=ALCAZAR
00,Alien Downpour=ALIEN.DOWNPOUR
# TODO: Alien Rain volume name and executable filename do not match (one has period, one doesn't)
00,Alien Rain=ALIENRAIN
00,Ankh=ANKH
00,Apple Panic=APPLE.PANIC
00,Aquatron=AQUATRON
10,Arkanoid=ARKANOID
00,Battlezone=BATTLEZONE
10,BC's Quest For Tires=BCS.QUEST
00,Beer Run=BEER.RUN
00,Bellhop=BELLHOP
00,Bill Budge's Trilogy=BUDGETRILOGY
00,Blister Ball=BLISTER.BALL
00,Bolo=BOLO
00,Brainteaser Boulevard=BRAINTEASERBLVD
00,BurgerTime=BURGERTIME
00,Cannonball Blitz=CANNONBALL.BLTZ
00,Canyon Climber=CANYON.CLIMBER
00,Centipede=CENTIPEDE
10,Choplifter=CHOPLIFTER
00,Commando=COMMANDO
00,Conan=CONAN
10,Crisis Mountain=CRISIS.MOUNTAIN
00,Crossfire=CROSSFIRE
01,D-Generation=D.GENERATION
10,David's Midnight Magic=DAVIDS.MAGIC
10,Defender=DEFENDER
00,Dig Dug=DIG.DUG
10,Dino Eggs=DINO.EGGS
10,Donkey Kong=DONKEY.KONG
10,Drelbs=DRELBS
00,Drol=DROL
00,Epoch=EPOCH
00,Falcons=FALCONS
00,Flight Simulator I=FS1
00,Flip Out=FLIP.OUT
10,Formula 1 Racer=FORMULA.1
00,Frogger=FROGGER
10,Galaxian=GALAXIAN
10,The Goonies=GOONIES
00,Gremlins=GREMLINS
10,H.E.R.O.=HERO
00,Hard Hat Mack=HARD.HAT.MACK
00,Head On=HEAD.ON
00,High Rise=HIGH.RISE
00,Hungry Boy=HUNGRYBOY
10,Impossible Mission=IMPOSSIBLE.MISS
00,Joust=JOUST
00,Juggler=JUGGLER
00,Jungle Hunt=JUNGLE.HUNT
00,Karateka=KARATEKA
00,Lady Tut=LADY.TUT
10,Lost Tomb=LOST.TOMB
10,Mad Bomber=MAD.BOMBER
00,Mario Bros=MARIO.BROS
00,Montezuma's Revenge=MONTEZUMA
00,Moon Patrol=MOON.PATROL
00,Mr. Cool=MR.COOL
10,Mr. Do=MR.DO
00,Mr. Robot=MR.ROBOT
00,Ms. Pacman=MS.PACMAN
00,Nibbler=NIBBLER
00,Night Stalker=NIGHT.STALKER
00,Nightmare Gallery=NIGHTMARE
00,NORAD=NORAD
00,O'Riley's Mine=ORILEYS.MINE
00,Outpost=OUTPOST
00,Pac-Man=PAC.MAN
00,Paperboy=PAPERBOY
00,Pest Patrol=PEST.PATROL
00,Pie-Man=PIEMAN
00,Pit Stop II=PITSTOP.II
10,Pitfall II=PITFALL.II
00,Plasmania=PLASMANIA
00,Pooyan=POOYAN
01,Prince of Persia=PRINCEUNP
00,Puckman=PUCK.MAN
11,Qix=QIX
01,Radwarrior=RADWARRIOR
00,Repton=REPTON
00,Ribbit=RIBBIT
00,Robotron 2084=ROBOTRON.2084
00,Sabotage=SABOTAGE
00,Serpentine=SERPENTINE
10,Shamus=SHAMUS
00,Snack Attack=SNACK.ATTACK
00,Snake Byte=SNAKE.BYTE
00,Sneakers=SNEAKERS
00,Snoggle=SNOGGLE
00,Space Raiders=SPACE.RAIDERS
00,Spider Raid=SPIDER.RAID
01,Spiderbot=SPIDERBOT
00,Spy Hunter=SPY.HUNTER
00,Spy's Demise=SPYS.DEMISE
10,Starblaster=STARBLASTER
10,Stargate=STARGATE
00,Stellar 7=STELLAR.7
00,Succession=SUCCESSION
00,Swashbuckler=SWASHBUCKLER
00,Tag Team Wrestling=TAG.TEAM
00,Tapper=TAPPER
00,Tetris=TETRIS
00,Thief=THIEF
00,Thunder Bombs=THUNDERBOMBS
10,Tomahawk=TOMAHAWK
00,Track N Field=TRACK.AND.FIELD
10,Tubeway ][=TUBEWAY
01,Victory Road=VICTORY.ROAD
00,Wavy Navy=WAVY.NAVY
[eof]
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,147 @@
|
|||
!cpu 6502
|
||||
!to "quick#061000",plain
|
||||
*=$1000
|
||||
|
||||
zpword = $0 ;and $1
|
||||
zpstring= $2 ;and $3
|
||||
runningscore= $4 ;and $5
|
||||
startat = $6
|
||||
i = $7
|
||||
tmp = $8
|
||||
|
||||
jsr quick
|
||||
tax
|
||||
lda #0
|
||||
jmp $ed24 ;hex to dec
|
||||
|
||||
quick
|
||||
|
||||
lda #<word
|
||||
sta zpword
|
||||
lda #>word
|
||||
sta zpword+1
|
||||
lda #<string
|
||||
sta zpstring
|
||||
lda #>string
|
||||
sta zpstring+1
|
||||
ldy word
|
||||
cpy string
|
||||
bne +
|
||||
- lda (zpword), y
|
||||
cmp (zpstring), y
|
||||
bne +
|
||||
dey
|
||||
bne -
|
||||
lda #100
|
||||
rts
|
||||
|
||||
+ lda #0
|
||||
sta runningscore
|
||||
sta runningscore+1
|
||||
ldy #1
|
||||
sty startat
|
||||
- sty i
|
||||
lda (zpword), y
|
||||
jsr tolower
|
||||
sta tmp
|
||||
ldy startat
|
||||
-- lda (zpstring), y
|
||||
jsr tolower
|
||||
cmp tmp
|
||||
beq +
|
||||
cpy string
|
||||
iny
|
||||
bcc --
|
||||
lda #0
|
||||
rts
|
||||
|
||||
+ ldx #80
|
||||
cpy startat
|
||||
beq +
|
||||
ldx #10
|
||||
cpy #1
|
||||
beq +
|
||||
dey
|
||||
lda (zpstring), y
|
||||
iny
|
||||
cmp ' '
|
||||
bne +
|
||||
ldx #90
|
||||
+ txa
|
||||
clc
|
||||
adc runningscore
|
||||
sta runningscore
|
||||
bcc +
|
||||
inc runningscore+1
|
||||
+ iny
|
||||
sty startat
|
||||
ldy i
|
||||
cpy word
|
||||
iny
|
||||
bcc -
|
||||
|
||||
lda runningscore
|
||||
ldx runningscore+1
|
||||
ldy string
|
||||
jsr div
|
||||
sta tmp
|
||||
lda runningscore
|
||||
ldx runningscore+1
|
||||
ldy word
|
||||
jsr div
|
||||
clc
|
||||
adc tmp
|
||||
lsr
|
||||
ldx word+1
|
||||
cpx string+1
|
||||
bne +
|
||||
cmp #85
|
||||
bcs +
|
||||
adc #15
|
||||
+ rts
|
||||
|
||||
tolower
|
||||
cmp #$41
|
||||
bcc +
|
||||
cmp #$5b
|
||||
bcs +
|
||||
ora #$20
|
||||
+ rts
|
||||
|
||||
div
|
||||
sta num1
|
||||
stx num1+1
|
||||
sty num2
|
||||
|
||||
lda #0
|
||||
sta rem
|
||||
sta rem+1
|
||||
ldx #16
|
||||
- asl num1
|
||||
rol num1+1
|
||||
rol rem
|
||||
rol rem+1
|
||||
lda rem
|
||||
sec
|
||||
sbc num2
|
||||
bcc +
|
||||
sta rem
|
||||
dec rem+1
|
||||
inc num1
|
||||
+ dex
|
||||
bne -
|
||||
lda num1
|
||||
rts
|
||||
|
||||
rem !byte 0,0
|
||||
num1 !byte 0,0
|
||||
num2 !byte 0
|
||||
|
||||
word !byte word_e-word_b
|
||||
word_b
|
||||
!text "HE"
|
||||
word_e
|
||||
string !byte string_e-string_b
|
||||
string_b
|
||||
!text "HELLO WORLD"
|
||||
string_e
|
|
@ -83,6 +83,7 @@ Xevious
|
|||
//4am has unreleased crack
|
||||
Black Magic
|
||||
Bop N Wrestle
|
||||
Congo
|
||||
County Fair
|
||||
Free Fall
|
||||
Galactic Attack
|
||||
|
@ -106,52 +107,47 @@ Injured Engine
|
|||
Jawbreaker ][
|
||||
Mating Zone
|
||||
Randamn
|
||||
Rescue Raiders [priority]
|
||||
Saracen
|
||||
Test Drive
|
||||
Tetris [priority]
|
||||
Thexder [DHGR]
|
||||
|
||||
//TODO(woz-imaged but uncracked)
|
||||
Alien Ambush
|
||||
Buzzard Bait [priority]
|
||||
Caverns of Callisto
|
||||
Cyber Strike [priority]
|
||||
The Dam Busters
|
||||
Fight Night
|
||||
Gorgon [priority]
|
||||
Hardball
|
||||
One on One
|
||||
Saracen
|
||||
Rescue Raiders [priority]
|
||||
Thexder [DHGR]
|
||||
Pulsar II [priority]
|
||||
Shuffleboard [priority]
|
||||
Space Eggs [priority]
|
||||
Zaxxon [priority]
|
||||
|
||||
//TODO(flux-imaged but not woz)
|
||||
The Bilestoad
|
||||
Borg
|
||||
Buzzard Bait
|
||||
Cyber Strike
|
||||
Copts and Robbers
|
||||
Flywars
|
||||
Gamma Goblins
|
||||
Gorgon
|
||||
Horizon V
|
||||
Lemmings
|
||||
Lode Runner [priority]
|
||||
Night Mission Pinball [priority]
|
||||
Orbitron
|
||||
Phantoms Five
|
||||
Phaser Fire
|
||||
Pulsar II
|
||||
Raster Blaster
|
||||
Space Eggs
|
||||
Spare Change [priority]
|
||||
Twerps
|
||||
Warp Destroyer
|
||||
Wayout
|
||||
|
||||
//TODO(unacquired)
|
||||
Ceiling Zero
|
||||
Congo
|
||||
Copts and Robbers
|
||||
Dung Beetles
|
||||
Eggs It
|
||||
Firebird
|
||||
Horizon V
|
||||
Ice Hockey
|
||||
International Hockey
|
||||
Lemmings
|
||||
Shuffleboard
|
||||
Super Zaxxon
|
||||
Tempest
|
||||
|
||||
|
|
53
src/4cade.a
53
src/4cade.a
|
@ -5,14 +5,14 @@
|
|||
!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
|
||||
ror MachineStatus ; now bit 6 = 1 if 128K
|
||||
; bit 7 = 1 if joystick
|
||||
|
||||
+READ_ROM_WRITE_RAM1
|
||||
ldx #$00 ; relocate rest of program to RAM bank 1 in language card
|
||||
|
@ -44,9 +44,9 @@ Init
|
|||
@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"
|
||||
!source "src/hw.memcheck.a"
|
||||
!source "src/hw.joystick.a"
|
||||
!source "src/hw.normfast.a"
|
||||
; ProRWTS2 has its own function to relocate itself
|
||||
!source "src/prorwts2.a"
|
||||
|
||||
|
@ -54,12 +54,43 @@ FirstMover
|
|||
!pseudopc $D000 {
|
||||
!zone
|
||||
Start
|
||||
jsr LoadFile
|
||||
- !word gamesconf
|
||||
|
||||
jsr ParseGamesList
|
||||
!word gGamesListStore
|
||||
!word -
|
||||
|
||||
jsr okvs_iter_values
|
||||
!word gGamesListStore
|
||||
!word HGRLoad
|
||||
brk
|
||||
|
||||
HGRLoad
|
||||
ldx $C000
|
||||
bmi @exit
|
||||
+STAY PTR
|
||||
jsr ResetPath
|
||||
+LDADDR kHGRScreenshotDirectory
|
||||
jsr AddToPath
|
||||
+LDADDR kPathSeparator
|
||||
jsr AddToPath
|
||||
+LDAY PTR
|
||||
jsr AddToPath
|
||||
jsr LoadFile
|
||||
!word gPathname
|
||||
jsr FizzleHGR
|
||||
@exit rts
|
||||
|
||||
ShowCover
|
||||
bit MachineStatus
|
||||
bvs @Load128
|
||||
|
||||
jsr LoadFile
|
||||
!word cover64
|
||||
clc
|
||||
bcc @Show
|
||||
|
||||
@Load128
|
||||
jsr LoadDHRFile
|
||||
!word cover128
|
||||
|
@ -67,23 +98,18 @@ Start
|
|||
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
|
||||
rts
|
||||
|
||||
gamesconf
|
||||
!byte gamesconf_e-gamesconf_b
|
||||
|
@ -101,9 +127,12 @@ cover128_b
|
|||
!text "COVER.A2FC"
|
||||
cover128_e
|
||||
; these routines will only be called after relocating to language card
|
||||
!source "src/prodos.path.a"
|
||||
!source "src/glue.prorwts2.a"
|
||||
!source "src/okvs.a"
|
||||
!source "src/parse.games.a"
|
||||
!source "src/fx.hgr.fizzle.a"
|
||||
!source "src/fx.dhgr.fizzle.a"
|
||||
gGamesListStore
|
||||
!word *+2 ; address of first okvs store
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ MachineStatus =$F0 ; bit 7 = 1 if machine has joystick
|
|||
; $FF ; used by ParseGamesList
|
||||
|
||||
; main memory
|
||||
gPathname = $1F00 ; used by ResetPath/AddToPath
|
||||
gKeyLen = $1F00 ; used by ParseGamesList
|
||||
gKey = $1F01
|
||||
gValLen = $1F80
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
;license:MIT
|
||||
;(c) 2017-2018 by qkumba
|
||||
;
|
||||
; NOTE: must be run from language card, or caller must ensure that
|
||||
; this code is in an identical location in auxmem
|
||||
;
|
||||
FizzleDHGR
|
||||
;init RNG
|
||||
|
||||
ldx #1
|
||||
stx @rnd1+1
|
||||
dex
|
||||
stx @rnd2+1
|
||||
|
||||
;iterate
|
||||
|
||||
@loop
|
||||
ldy @rnd1+1
|
||||
ldx @rnd2+1
|
||||
lsr @rnd2+1
|
||||
ror @rnd1+1
|
||||
bcc +
|
||||
|
||||
;feedback polynomial forms #$2015 for period of 16383
|
||||
|
||||
lda @rnd1+1
|
||||
eor #$15
|
||||
sta @rnd1+1
|
||||
lda @rnd2+1
|
||||
eor #$20
|
||||
sta @rnd2+1
|
||||
|
||||
;little hack to avoid missing offset zero
|
||||
;screen hole at $xxFF is missed instead
|
||||
|
||||
+ tya
|
||||
eor #$ff
|
||||
sta $26
|
||||
sta $3c
|
||||
txa
|
||||
and #$1f
|
||||
|
||||
;target page 1
|
||||
|
||||
ora #$20
|
||||
sta $27
|
||||
eor #$60
|
||||
sta $3d
|
||||
|
||||
;copy pixel from other page to this page
|
||||
|
||||
ldy #0
|
||||
cpx #$20
|
||||
bcc +
|
||||
sta $c003
|
||||
sta $c005
|
||||
+ lda ($3c),y
|
||||
sta ($26),y
|
||||
sta $c002
|
||||
sta $c004
|
||||
|
||||
;check for keypress
|
||||
|
||||
lda $c000
|
||||
bmi @exit
|
||||
|
||||
;and exit condition
|
||||
|
||||
@rnd2 lda #0
|
||||
bne @loop
|
||||
@rnd1 lda #0
|
||||
cmp #1
|
||||
bne @loop
|
||||
|
||||
;graphics mode
|
||||
|
||||
sta $c00d
|
||||
sta $c057
|
||||
sta $c054
|
||||
sta $c052
|
||||
sta $c050
|
||||
sta $c05e
|
||||
|
||||
@exit
|
||||
rts
|
|
@ -0,0 +1,73 @@
|
|||
;license:MIT
|
||||
;(c) 2017-2018 by qkumba
|
||||
|
||||
FizzleHGR
|
||||
;init RNG
|
||||
|
||||
ldx #1
|
||||
stx @rnd1+1
|
||||
dex
|
||||
stx @rnd2+1
|
||||
|
||||
;iterate
|
||||
|
||||
@loop
|
||||
ldy @rnd1+1
|
||||
ldx @rnd2+1
|
||||
lsr @rnd2+1
|
||||
ror @rnd1+1
|
||||
bcc +
|
||||
|
||||
;feedback polynomial forms #$100D for period of 8191
|
||||
|
||||
lda @rnd1+1
|
||||
eor #$0d
|
||||
sta @rnd1+1
|
||||
lda @rnd2+1
|
||||
eor #$10
|
||||
sta @rnd2+1
|
||||
|
||||
;little hack to avoid missing offset zero
|
||||
;screen hole at $xxFF is missed instead
|
||||
|
||||
+ tya
|
||||
eor #$ff
|
||||
sta $26
|
||||
sta $3c
|
||||
txa
|
||||
|
||||
;target page 1
|
||||
|
||||
ora #$20
|
||||
sta $27
|
||||
eor #$60
|
||||
sta $3d
|
||||
|
||||
;copy pixel from other page to this page
|
||||
|
||||
ldy #0
|
||||
lda ($3c),y
|
||||
sta ($26),y
|
||||
|
||||
;check for keypress
|
||||
|
||||
lda $c000
|
||||
bmi @exit
|
||||
|
||||
;and exit condition
|
||||
|
||||
@rnd2 lda #0
|
||||
bne @loop
|
||||
@rnd1 lda #0
|
||||
cmp #1
|
||||
bne @loop
|
||||
|
||||
;graphics mode
|
||||
|
||||
lda $c057
|
||||
lda $c054
|
||||
lda $c052
|
||||
lda $c050
|
||||
|
||||
@exit
|
||||
rts
|
24
src/okvs.a
24
src/okvs.a
|
@ -14,8 +14,6 @@
|
|||
; - okvs_iter_values(address, callback) iterate through values
|
||||
; - okvs_as_boolean(value) set Z flag based on value
|
||||
;
|
||||
; Used for global preferences, per-game options, and per-game version lists
|
||||
;
|
||||
; Call init() once. Call it again to reset the store to 0 keys.
|
||||
;
|
||||
; Keys are maintained in a singly linked list, so most functions are O(n).
|
||||
|
@ -441,28 +439,6 @@ okvs_iter_values
|
|||
bne @loop
|
||||
@exit rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; okvs_as_boolean
|
||||
;
|
||||
; in: A = address of value [lo]
|
||||
; Y = address of value [hi]
|
||||
; out: Z clear if value is a 1-byte string with value #$00 or the digit '0'
|
||||
; Z set otherwise
|
||||
; X preserved, A/Y clobbered
|
||||
;------------------------------------------------------------------------------
|
||||
okvs_as_boolean
|
||||
+STAY PTR
|
||||
ldy #0
|
||||
lda (PTR),y
|
||||
cmp #1
|
||||
bne +
|
||||
iny
|
||||
lda (PTR),y
|
||||
beq +
|
||||
ora #$80
|
||||
cmp #$B0
|
||||
+ rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; internal functions
|
||||
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
;license:MIT
|
||||
;(c) 2018 by 4am
|
||||
;
|
||||
; ProDOS - functions for constructing and passing around ProDOS pathnames
|
||||
;
|
||||
; Public functions
|
||||
; - ResetPath
|
||||
; - AddToPath
|
||||
;
|
||||
; Public constants
|
||||
; - kPathSeparator
|
||||
|
||||
kPathSeparator
|
||||
!byte 1
|
||||
!raw "/"
|
||||
|
||||
kHGRScreenshotDirectory
|
||||
!byte 1
|
||||
!raw "I"
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ResetPath
|
||||
; reset gPathname to length 0
|
||||
;
|
||||
; in: none
|
||||
; out: X = 0
|
||||
; A/Y preserved
|
||||
;------------------------------------------------------------------------------
|
||||
ResetPath
|
||||
ldx #0
|
||||
stx gPathname
|
||||
rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; AddToPath
|
||||
; append a length-prefixed string to gPathname
|
||||
;
|
||||
; in: A contains low byte of address of length-prefixed string to append
|
||||
; Y contains high byte of address of length-prefixed string to append
|
||||
; out: all registers and flags clobbered
|
||||
; $00/$01 clobbered
|
||||
; gPathname updated with concatenated length-prefixed string
|
||||
;------------------------------------------------------------------------------
|
||||
AddToPath
|
||||
+STAY $00
|
||||
ldx gPathname ; current pathname length
|
||||
ldy #0
|
||||
lda ($00),y ; length of this segment
|
||||
tay
|
||||
iny
|
||||
sty @len
|
||||
ldy #$01
|
||||
- lda ($00),y
|
||||
sta gPathname+1,x
|
||||
inx
|
||||
iny
|
||||
@len=*+1
|
||||
cpy #$FD ; SMC
|
||||
bcc -
|
||||
stx gPathname
|
||||
rts
|
Loading…
Reference in New Issue