diff --git a/res/DEMO/AC b/res/DEMO/AC index 1b55cefa5..4774ce5c3 100755 Binary files a/res/DEMO/AC and b/res/DEMO/AC differ diff --git a/res/DEMO/AGENT.U.S.A b/res/DEMO/AGENT.U.S.A index 844e47500..c5bbc2a0d 100644 Binary files a/res/DEMO/AGENT.U.S.A and b/res/DEMO/AGENT.U.S.A differ diff --git a/res/DEMO/ALIEN.AMBUSH b/res/DEMO/ALIEN.AMBUSH index 488768dfe..6c72964a1 100755 Binary files a/res/DEMO/ALIEN.AMBUSH and b/res/DEMO/ALIEN.AMBUSH differ diff --git a/res/DEMO/ALIEN.DOWNPOUR b/res/DEMO/ALIEN.DOWNPOUR index 959448655..f9392ea21 100755 Binary files a/res/DEMO/ALIEN.DOWNPOUR and b/res/DEMO/ALIEN.DOWNPOUR differ diff --git a/res/DEMO/ALIEN.MUNCHIES b/res/DEMO/ALIEN.MUNCHIES index 7d06cd3df..d09ebb7b7 100755 Binary files a/res/DEMO/ALIEN.MUNCHIES and b/res/DEMO/ALIEN.MUNCHIES differ diff --git a/res/DEMO/ALIEN.TYPHOON b/res/DEMO/ALIEN.TYPHOON index 9946c10ca..103553dd1 100755 Binary files a/res/DEMO/ALIEN.TYPHOON and b/res/DEMO/ALIEN.TYPHOON differ diff --git a/res/DEMO/AO b/res/DEMO/AO index c7c804d7f..1602303b6 100644 Binary files a/res/DEMO/AO and b/res/DEMO/AO differ diff --git a/res/DEMO/APPLE.INVADER b/res/DEMO/APPLE.INVADER index 415d5ace3..1b00c5f3d 100644 Binary files a/res/DEMO/APPLE.INVADER and b/res/DEMO/APPLE.INVADER differ diff --git a/res/DEMO/AQUATRON b/res/DEMO/AQUATRON index e45ab222b..58fab70cb 100755 Binary files a/res/DEMO/AQUATRON and b/res/DEMO/AQUATRON differ diff --git a/res/DEMO/AXIS.ASSASSIN b/res/DEMO/AXIS.ASSASSIN index 146079ad7..4241b095c 100755 Binary files a/res/DEMO/AXIS.ASSASSIN and b/res/DEMO/AXIS.ASSASSIN differ diff --git a/res/DEMO/BATTLEZONE b/res/DEMO/BATTLEZONE index 3cdf05d97..b0766ef11 100644 Binary files a/res/DEMO/BATTLEZONE and b/res/DEMO/BATTLEZONE differ diff --git a/res/DEMO/BB b/res/DEMO/BB index 96f2ceba9..0fe5ad666 100755 Binary files a/res/DEMO/BB and b/res/DEMO/BB differ diff --git a/res/DEMO/BEER.RUN b/res/DEMO/BEER.RUN index 7f19a4f26..a23786bbd 100755 Binary files a/res/DEMO/BEER.RUN and b/res/DEMO/BEER.RUN differ diff --git a/res/DEMO/BELLHOP b/res/DEMO/BELLHOP index 27a152940..f669c037a 100755 Binary files a/res/DEMO/BELLHOP and b/res/DEMO/BELLHOP differ diff --git a/res/DEMO/BK b/res/DEMO/BK index 6e2dceeca..0b7d5f0b3 100755 Binary files a/res/DEMO/BK and b/res/DEMO/BK differ diff --git a/res/DEMO/BOLO b/res/DEMO/BOLO index 55d7351b7..68461989a 100755 Binary files a/res/DEMO/BOLO and b/res/DEMO/BOLO differ diff --git a/res/DEMO/BORG b/res/DEMO/BORG index 261f6d34f..c8bf6d578 100644 Binary files a/res/DEMO/BORG and b/res/DEMO/BORG differ diff --git a/res/DEMO/BU b/res/DEMO/BU index 2b8147ace..8583837a4 100755 Binary files a/res/DEMO/BU and b/res/DEMO/BU differ diff --git a/res/DEMO/BUZZARD.BAIT b/res/DEMO/BUZZARD.BAIT index c2b369a3c..c5bd3a653 100755 Binary files a/res/DEMO/BUZZARD.BAIT and b/res/DEMO/BUZZARD.BAIT differ diff --git a/res/DEMO/CB b/res/DEMO/CB index 050e22ba7..8016a9921 100755 Binary files a/res/DEMO/CB and b/res/DEMO/CB differ diff --git a/res/DEMO/CEILING.ZERO b/res/DEMO/CEILING.ZERO index 259e51a18..75f785b22 100755 Binary files a/res/DEMO/CEILING.ZERO and b/res/DEMO/CEILING.ZERO differ diff --git a/res/DEMO/CHOPLIFTER b/res/DEMO/CHOPLIFTER index ca0323a40..3aee01744 100755 Binary files a/res/DEMO/CHOPLIFTER and b/res/DEMO/CHOPLIFTER differ diff --git a/res/DEMO/CL b/res/DEMO/CL index cd36535ea..1daaf79e2 100755 Binary files a/res/DEMO/CL and b/res/DEMO/CL differ diff --git a/res/DEMO/CONAN b/res/DEMO/CONAN index 259d737be..e255c3fae 100755 Binary files a/res/DEMO/CONAN and b/res/DEMO/CONAN differ diff --git a/res/DEMO/CRIME.WAVE b/res/DEMO/CRIME.WAVE index 225b88614..f69bd1c48 100755 Binary files a/res/DEMO/CRIME.WAVE and b/res/DEMO/CRIME.WAVE differ diff --git a/res/DEMO/CYCLOD b/res/DEMO/CYCLOD index 9f4ac356a..50f7fe154 100755 Binary files a/res/DEMO/CYCLOD and b/res/DEMO/CYCLOD differ diff --git a/res/DEMO/DIG.DUG b/res/DEMO/DIG.DUG index ccb133310..17938fa4c 100755 Binary files a/res/DEMO/DIG.DUG and b/res/DEMO/DIG.DUG differ diff --git a/res/DEMO/DINO.EGGS b/res/DEMO/DINO.EGGS index cb3d6c55a..426de1505 100755 Binary files a/res/DEMO/DINO.EGGS and b/res/DEMO/DINO.EGGS differ diff --git a/res/DEMO/DUNG.BEETLES b/res/DEMO/DUNG.BEETLES index 987bf80c9..21e5c823e 100755 Binary files a/res/DEMO/DUNG.BEETLES and b/res/DEMO/DUNG.BEETLES differ diff --git a/res/DEMO/FALCONS b/res/DEMO/FALCONS index 6df93bb94..66c585633 100755 Binary files a/res/DEMO/FALCONS and b/res/DEMO/FALCONS differ diff --git a/res/DEMO/FIREBIRD b/res/DEMO/FIREBIRD index 06d38e05e..74fccafd1 100755 Binary files a/res/DEMO/FIREBIRD and b/res/DEMO/FIREBIRD differ diff --git a/res/DEMO/FIREBUG b/res/DEMO/FIREBUG index 1bf4ddc19..7d5a3ffd9 100755 Binary files a/res/DEMO/FIREBUG and b/res/DEMO/FIREBUG differ diff --git a/res/DEMO/FLIP.OUT b/res/DEMO/FLIP.OUT index 5a0ccf606..d2d378c53 100755 Binary files a/res/DEMO/FLIP.OUT and b/res/DEMO/FLIP.OUT differ diff --git a/res/DEMO/GALAXIAN b/res/DEMO/GALAXIAN index f23f25168..2f996b5a5 100644 Binary files a/res/DEMO/GALAXIAN and b/res/DEMO/GALAXIAN differ diff --git a/res/DEMO/GAMMA.GOBLINS b/res/DEMO/GAMMA.GOBLINS index 8e15e8468..7f17b83ce 100755 Binary files a/res/DEMO/GAMMA.GOBLINS and b/res/DEMO/GAMMA.GOBLINS differ diff --git a/res/DEMO/GENETIC.DRIFT b/res/DEMO/GENETIC.DRIFT index 71b34e802..d6dbf0329 100644 Binary files a/res/DEMO/GENETIC.DRIFT and b/res/DEMO/GENETIC.DRIFT differ diff --git a/res/DEMO/GREMLINS b/res/DEMO/GREMLINS index debfa3e6b..02147c70e 100644 Binary files a/res/DEMO/GREMLINS and b/res/DEMO/GREMLINS differ diff --git a/res/DEMO/GUMBALL b/res/DEMO/GUMBALL index f37f7b561..841ecd50c 100755 Binary files a/res/DEMO/GUMBALL and b/res/DEMO/GUMBALL differ diff --git a/res/DEMO/HARD.HAT.MACK b/res/DEMO/HARD.HAT.MACK index fdafab64d..d1a398ac1 100755 Binary files a/res/DEMO/HARD.HAT.MACK and b/res/DEMO/HARD.HAT.MACK differ diff --git a/res/DEMO/HIGH.RISE b/res/DEMO/HIGH.RISE index 871cf79a6..5ad323908 100755 Binary files a/res/DEMO/HIGH.RISE and b/res/DEMO/HIGH.RISE differ diff --git a/res/DEMO/JUNGLE.HUNT b/res/DEMO/JUNGLE.HUNT index 16c1bdbd2..8e156de4c 100755 Binary files a/res/DEMO/JUNGLE.HUNT and b/res/DEMO/JUNGLE.HUNT differ diff --git a/res/DEMO/KAMIKAZE b/res/DEMO/KAMIKAZE index 0a54cfdb0..0db15f60e 100644 Binary files a/res/DEMO/KAMIKAZE and b/res/DEMO/KAMIKAZE differ diff --git a/res/DEMO/KARATEKA b/res/DEMO/KARATEKA index 31336ca04..38ead3751 100755 Binary files a/res/DEMO/KARATEKA and b/res/DEMO/KARATEKA differ diff --git a/res/DEMO/LABYRINTH b/res/DEMO/LABYRINTH index 859bfd091..1cddf88e1 100755 Binary files a/res/DEMO/LABYRINTH and b/res/DEMO/LABYRINTH differ diff --git a/res/DEMO/LADY.TUT b/res/DEMO/LADY.TUT index 2438064a9..deb8585a7 100755 Binary files a/res/DEMO/LADY.TUT and b/res/DEMO/LADY.TUT differ diff --git a/res/DEMO/LASER.BOUNCE b/res/DEMO/LASER.BOUNCE index 77f7257ad..05df38ece 100755 Binary files a/res/DEMO/LASER.BOUNCE and b/res/DEMO/LASER.BOUNCE differ diff --git a/res/DEMO/LAZER.SILK b/res/DEMO/LAZER.SILK index a31d0cfcb..82046b3d5 100755 Binary files a/res/DEMO/LAZER.SILK and b/res/DEMO/LAZER.SILK differ diff --git a/res/DEMO/LODE.RUNNER b/res/DEMO/LODE.RUNNER index e4211f014..27f2d1c15 100755 Binary files a/res/DEMO/LODE.RUNNER and b/res/DEMO/LODE.RUNNER differ diff --git a/res/DEMO/LOST.TOMB b/res/DEMO/LOST.TOMB index 22caea69c..79d7a1137 100755 Binary files a/res/DEMO/LOST.TOMB and b/res/DEMO/LOST.TOMB differ diff --git a/res/DEMO/MC b/res/DEMO/MC index 32c29a59c..56e341d6f 100755 Binary files a/res/DEMO/MC and b/res/DEMO/MC differ diff --git a/res/DEMO/MOON.PATROL b/res/DEMO/MOON.PATROL index d0b8a6b4f..d365df509 100755 Binary files a/res/DEMO/MOON.PATROL and b/res/DEMO/MOON.PATROL differ diff --git a/res/DEMO/N.O.R.A.D b/res/DEMO/N.O.R.A.D index c0ed8191f..148d50395 100755 Binary files a/res/DEMO/N.O.R.A.D and b/res/DEMO/N.O.R.A.D differ diff --git a/res/DEMO/NI b/res/DEMO/NI index a5eeac1cb..444e72e1d 100755 Binary files a/res/DEMO/NI and b/res/DEMO/NI differ diff --git a/res/DEMO/NIBBLER b/res/DEMO/NIBBLER index fac9f0bef..90c6eafc2 100755 Binary files a/res/DEMO/NIBBLER and b/res/DEMO/NIBBLER differ diff --git a/res/DEMO/NIGHT.STALKER b/res/DEMO/NIGHT.STALKER index b05aefcbc..de4053882 100755 Binary files a/res/DEMO/NIGHT.STALKER and b/res/DEMO/NIGHT.STALKER differ diff --git a/res/DEMO/OM b/res/DEMO/OM index 7da8c3f74..a7fd795c3 100755 Binary files a/res/DEMO/OM and b/res/DEMO/OM differ diff --git a/res/DEMO/PACMAN b/res/DEMO/PACMAN index a527d19ed..00132bdf6 100644 Binary files a/res/DEMO/PACMAN and b/res/DEMO/PACMAN differ diff --git a/res/DEMO/PEST.PATROL b/res/DEMO/PEST.PATROL index 8181f1098..c34d025f9 100755 Binary files a/res/DEMO/PEST.PATROL and b/res/DEMO/PEST.PATROL differ diff --git a/res/DEMO/PHASER.FIRE b/res/DEMO/PHASER.FIRE index 6e5c25719..064ef6bf5 100755 Binary files a/res/DEMO/PHASER.FIRE and b/res/DEMO/PHASER.FIRE differ diff --git a/res/DEMO/PITFALL.II b/res/DEMO/PITFALL.II index 732e83c15..e5bff0367 100755 Binary files a/res/DEMO/PITFALL.II and b/res/DEMO/PITFALL.II differ diff --git a/res/DEMO/PLASMANIA b/res/DEMO/PLASMANIA index 0876bbf2b..f60882c8b 100755 Binary files a/res/DEMO/PLASMANIA and b/res/DEMO/PLASMANIA differ diff --git a/res/DEMO/PM b/res/DEMO/PM index 6eae934cd..004514e9d 100755 Binary files a/res/DEMO/PM and b/res/DEMO/PM differ diff --git a/res/DEMO/POOYAN b/res/DEMO/POOYAN index c30ad8617..d66d05c0d 100755 Binary files a/res/DEMO/POOYAN and b/res/DEMO/POOYAN differ diff --git a/res/DEMO/REPTON b/res/DEMO/REPTON index 4f90f3f86..bde62eb20 100755 Binary files a/res/DEMO/REPTON and b/res/DEMO/REPTON differ diff --git a/res/DEMO/ROBOTRON.2084 b/res/DEMO/ROBOTRON.2084 index eb7626946..81cae70b9 100644 Binary files a/res/DEMO/ROBOTRON.2084 and b/res/DEMO/ROBOTRON.2084 differ diff --git a/res/DEMO/SAMMY.LIGHTFOOT b/res/DEMO/SAMMY.LIGHTFOOT index 5d834e027..fe02b30cd 100755 Binary files a/res/DEMO/SAMMY.LIGHTFOOT and b/res/DEMO/SAMMY.LIGHTFOOT differ diff --git a/res/DEMO/SD b/res/DEMO/SD index 7e01d6d14..9b31a2de9 100755 Binary files a/res/DEMO/SD and b/res/DEMO/SD differ diff --git a/res/DEMO/SERPENTINE b/res/DEMO/SERPENTINE index 5f686781d..15d68a175 100755 Binary files a/res/DEMO/SERPENTINE and b/res/DEMO/SERPENTINE differ diff --git a/res/DEMO/SHORT.CIRCUIT b/res/DEMO/SHORT.CIRCUIT index ff9ea4253..b9162a29d 100644 Binary files a/res/DEMO/SHORT.CIRCUIT and b/res/DEMO/SHORT.CIRCUIT differ diff --git a/res/DEMO/SNAKE.BYTE b/res/DEMO/SNAKE.BYTE index 135e94fbd..664335e2d 100755 Binary files a/res/DEMO/SNAKE.BYTE and b/res/DEMO/SNAKE.BYTE differ diff --git a/res/DEMO/SNEAKERS b/res/DEMO/SNEAKERS index 9869b8bcd..14816c9d6 100644 Binary files a/res/DEMO/SNEAKERS and b/res/DEMO/SNEAKERS differ diff --git a/res/DEMO/SPACE.EGGS b/res/DEMO/SPACE.EGGS index 536baf15e..d0126108f 100755 Binary files a/res/DEMO/SPACE.EGGS and b/res/DEMO/SPACE.EGGS differ diff --git a/res/DEMO/SPACE.QUARKS b/res/DEMO/SPACE.QUARKS index 54f1977ce..cb053d1b4 100755 Binary files a/res/DEMO/SPACE.QUARKS and b/res/DEMO/SPACE.QUARKS differ diff --git a/res/DEMO/SPARE.CHANGE b/res/DEMO/SPARE.CHANGE index 496061312..f96dcdf20 100755 Binary files a/res/DEMO/SPARE.CHANGE and b/res/DEMO/SPARE.CHANGE differ diff --git a/res/DEMO/SPIDER.RAID b/res/DEMO/SPIDER.RAID index 22f097d1e..73b766d3b 100755 Binary files a/res/DEMO/SPIDER.RAID and b/res/DEMO/SPIDER.RAID differ diff --git a/res/DEMO/SPY.HUNTER b/res/DEMO/SPY.HUNTER index 09c4e5d14..755e2ad26 100755 Binary files a/res/DEMO/SPY.HUNTER and b/res/DEMO/SPY.HUNTER differ diff --git a/res/DEMO/STAR.BLAZER b/res/DEMO/STAR.BLAZER index 212f3345e..c8444f4af 100755 Binary files a/res/DEMO/STAR.BLAZER and b/res/DEMO/STAR.BLAZER differ diff --git a/res/DEMO/STARGATE b/res/DEMO/STARGATE index a3756ea51..d37625408 100755 Binary files a/res/DEMO/STARGATE and b/res/DEMO/STARGATE differ diff --git a/res/DEMO/STELLAR.7 b/res/DEMO/STELLAR.7 index f3a0f4de9..99dca2412 100755 Binary files a/res/DEMO/STELLAR.7 and b/res/DEMO/STELLAR.7 differ diff --git a/res/DEMO/TB b/res/DEMO/TB index a49b418d0..d523240ff 100755 Binary files a/res/DEMO/TB and b/res/DEMO/TB differ diff --git a/res/DEMO/THE.GOONIES b/res/DEMO/THE.GOONIES index 50d547b2e..9fbf5bea3 100644 Binary files a/res/DEMO/THE.GOONIES and b/res/DEMO/THE.GOONIES differ diff --git a/res/DEMO/THUNDER.BOMBS b/res/DEMO/THUNDER.BOMBS index 68a5f807c..ef22bd58b 100755 Binary files a/res/DEMO/THUNDER.BOMBS and b/res/DEMO/THUNDER.BOMBS differ diff --git a/res/DEMO/TUNNEL.TERROR b/res/DEMO/TUNNEL.TERROR index ef9613295..706c0ca2f 100755 Binary files a/res/DEMO/TUNNEL.TERROR and b/res/DEMO/TUNNEL.TERROR differ diff --git a/res/DEMO/VINDICATOR b/res/DEMO/VINDICATOR index daa4aedcd..f09b06eba 100755 Binary files a/res/DEMO/VINDICATOR and b/res/DEMO/VINDICATOR differ diff --git a/res/DEMO/WARP.DESTROYER b/res/DEMO/WARP.DESTROYER index c5c953cd6..5501f2e70 100755 Binary files a/res/DEMO/WARP.DESTROYER and b/res/DEMO/WARP.DESTROYER differ diff --git a/res/DEMO/WAVY.NAVY b/res/DEMO/WAVY.NAVY index bbdf2469a..2142f2333 100644 Binary files a/res/DEMO/WAVY.NAVY and b/res/DEMO/WAVY.NAVY differ diff --git a/src/demo/agent.u.s.a.a b/src/demo/agent.u.s.a.a index eb4f1ee40..505e96383 100644 --- a/src/demo/agent.u.s.a.a +++ b/src/demo/agent.u.s.a.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/AGENT.U.S.A",plain @@ -23,26 +23,22 @@ rol $3F3 ; point to $300 instead jsr $FB6F - lda #$EA - sta $15DD - sta $15DD+1 - sta $15DD+2 ; disable button press on main menu - - lda #$4C - sta $0A06 - sta $1605 - inx - stx $0A06+1 - stx $1605+1 - inx - stx $0A06+2 - stx $1605+2 ; set exits + ldx #3-1 +- lda #$EA + sta $15DD,x ; disable button press on main menu + lda patch,x + sta $0A06,x + sta $1605,x ; set exits + dex + bpl - lda #$D0 sta $AC64 ; disable sound jmp $837 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "AGENT.U.S.A" x_e diff --git a/src/demo/alien.ambush.a b/src/demo/alien.ambush.a index eb98462d1..0af622ffa 100644 --- a/src/demo/alien.ambush.a +++ b/src/demo/alien.ambush.a @@ -8,24 +8,23 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title +NEW_RESET_VECTOR $3E0 ; overwrites $101 at end of demo cycle lda #$60 sta $81c jsr $800 ; decompress - lda #$4C - sta $60CA - sta $6040 - lda #$E0 - sta $60CB - sta $6041 - lda #3 - sta $60CC - sta $6042 + ldx #3-1 +- lda patch,x + sta $60CA,x + sta $6040,x + dex + bpl - +DISABLE_ACCEL jmp $4000 +patch !byte $4C,$E0,$03 + title !byte x_e-x_b x_b !text "ALIEN.AMBUSH" x_e diff --git a/src/demo/alien.downpour.a b/src/demo/alien.downpour.a index e47364d34..826e4e6f7 100644 --- a/src/demo/alien.downpour.a +++ b/src/demo/alien.downpour.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/ALIEN.DOWNPOUR",plain @@ -8,34 +8,27 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $201f jsr $2000 ; decompress - lda #$4C - sta $868C - sta $7B88 - sta $8FDF - sta $902F - sta $9078 - ldx #0 - stx $868D - stx $7B89 - stx $8FE0 - stx $9030 - stx $9079 - inx - stx $868E - stx $7B8A - stx $8FE1 - stx $9031 - stx $907A + ldx #3-1 +- lda patch,x + sta $868C,x + sta $7B88,x + sta $8FDF,x + sta $902F,x + sta $9078,x + dex + bpl - lda #$D0 sta $6E6D +DISABLE_ACCEL jmp $73a0 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "ALIEN.DOWNPOUR" x_e diff --git a/src/demo/alien.munchies.a b/src/demo/alien.munchies.a index 677367509..2be2f16b7 100644 --- a/src/demo/alien.munchies.a +++ b/src/demo/alien.munchies.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/ALIEN.MUNCHIES",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -29,7 +29,7 @@ bpl - ; exit on keypress at title screen & during demo ldx #3-1 -- lda patch1-3, x +- lda patch3, x sta $92F, x sta $139F, x sta $1392, x @@ -46,7 +46,8 @@ jmp $833 -patch1 !byte $30,$05,$AD,$00,$C0,$10,$29,$4C,$00,$01 +patch1 !byte $30,$05,$AD,$00,$C0,$10,$29 +patch3 !byte $4C,$00,$01 patch2 !byte $10,$0A diff --git a/src/demo/alien.typhoon.a b/src/demo/alien.typhoon.a index 41a568903..479b0cda1 100644 --- a/src/demo/alien.typhoon.a +++ b/src/demo/alien.typhoon.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M./qkumba +;(c) 2021-2022 by Frank M./qkumba !cpu 6502 !to "res/DEMO/ALIEN.TYPHOON",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$61 @@ -36,6 +36,8 @@ sta $8FD6,x sta $8FEF,x sta $92B1,x ; set exits + dex + bpl - +DISABLE_ACCEL diff --git a/src/demo/apple.invader.a b/src/demo/apple.invader.a index cabf6aa5d..e5c55d111 100644 --- a/src/demo/apple.invader.a +++ b/src/demo/apple.invader.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/APPLE.INVADER",plain @@ -12,7 +12,7 @@ lda $7fe pha - +ENABLE_ACCEL + +ENABLE_ACCEL_LC pla sta $7fe ; overwritten by GS acceleration diff --git a/src/demo/apple.oids.a b/src/demo/apple.oids.a index 72ae573fe..f84efca76 100644 --- a/src/demo/apple.oids.a +++ b/src/demo/apple.oids.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/AO",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 diff --git a/src/demo/aquatron.a b/src/demo/aquatron.a index 843cf2a92..be4884ffb 100644 --- a/src/demo/aquatron.a +++ b/src/demo/aquatron.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/AQUATRON",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #>(callback - 1) @@ -18,15 +18,12 @@ jmp $59C2 ; decompress callback - lda #$4C - sta $7AE1 - sta $7D1D - lda #0 - sta $7AE1+1 - sta $7D1D+1 - lda #1 - sta $7AE1+2 - sta $7D1D+2 ; set exits + ldx #3-1 +- lda patch,x + sta $7AE1,x + sta $7D1D,x ; set exits + dex + bpl - lda #$D0 sta $7E11 @@ -38,6 +35,8 @@ callback jmp $400 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "AQUATRON" x_e diff --git a/src/demo/axis.assassin.a b/src/demo/axis.assassin.a index 03ab620cc..83ccb49aa 100644 --- a/src/demo/axis.assassin.a +++ b/src/demo/axis.assassin.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$84 @@ -22,22 +22,22 @@ sta $3f06 jsr $3eb1 ; decompress - lda #$4C - sta $5B2E - sta $701C - sta $5D5B - ldx #0 - stx $5DF4 - stx $5CD8 - stx $5E09 - stx $701D - inx - stx $5B30 ; reset vector patch - stx $5DF5 - stx $5CD9 - stx $5E0A - stx $701E - stx $5D5D + ldx #3-1 +- lda patch,x + sta $5B2E,x ; reset vector patch + sta $701C,x + sta $5D5B,x + dex + bpl - + + ldx #2-1 +- lda patch+1,x + sta $5DF4,x + sta $5CD8,x + sta $5E09,x + dex + bpl - + lda #$24 sta $5D24 lda #$D0 @@ -57,9 +57,10 @@ counter !byte 5 callback sta $C010 dec counter - bpl + - jmp $100 -+ rts + bmi patch + rts + +patch !byte $4C,$00,$01 title !byte x_e-x_b x_b !text "AXIS.ASSASSIN" diff --git a/src/demo/battlezone.a b/src/demo/battlezone.a index 0ff2e8ad4..bc4579645 100644 --- a/src/demo/battlezone.a +++ b/src/demo/battlezone.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BATTLEZONE",plain @@ -15,51 +15,31 @@ sta $201e jsr $2000 ; decompress - lda #0 - sta $0811 - lda #1 - sta $0816 ; reset vector patch + ldx #0 + stx $0811 + inx + stx $0816 ; reset vector patch - lda #$EA - sta $1632 - sta $1632+1 - sta $1632+2 ; disable clearing keyboard strobe + ldx #3-1 +- lda #$EA + sta $1632,x ; disable clearing keyboard strobe + lda patch,x + sta $0872,x + sta $161A,x + sta $7661,x + sta $766C,x + sta $7693,x + sta $0B6A,x + sta $73A7,x + sta $168F+4,x + dex + bpl - - lda #$4C - sta $0872 - sta $161A - sta $7661 - sta $766C - sta $7693 - sta $0B6A - sta $73A7 - sta $168F+4 - lda #0 - sta $0872+1 - sta $161A+1 - sta $7661+1 - sta $766C+1 - sta $7693+1 - sta $0B6A+1 - sta $73A7+1 - sta $168F+5 - lda #1 - sta $0872+2 - sta $161A+2 - sta $7661+2 - sta $766C+2 - sta $7693+2 - sta $0B6A+2 - sta $73A7+2 - sta $168F+6 - lda #$C9 - sta $168F - lda #$FF - sta $168F+1 - lda #$F0 - sta $168F+2 - lda #$16 - sta $168F+3 ; set exits + ldx #4-1 + lda patch2,x + sta $168F,x ; set exits + dex + bpl - lda #$D0 sta $7733 @@ -75,6 +55,9 @@ jmp $810 +patch !byte $4C,$00,$01 +patch2 !byte $C9,$FF,$F0,$16 + title !byte x_e-x_b x_b !text "BATTLEZONE" x_e diff --git a/src/demo/beer.run.a b/src/demo/beer.run.a index 8c6015ef9..1362b01cc 100644 --- a/src/demo/beer.run.a +++ b/src/demo/beer.run.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BEER.RUN",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #11-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR beer_run, beer_run_dir_e-beer_run_dir_b lda #$60 sta $2065 jsr $2000 ; decompress1 @@ -32,24 +19,15 @@ sta $BB2C jsr $BB00 ; decompress2 - lda #$4C - sta $419C - sta $6C62 - sta $4085 - sta $4088 - lda #0 - sta $419C+1 - sta $6C62+1 - sta $4085+1 - lda #1 - sta $419C+2 - sta $6C62+2 - sta $4085+2 ; set exits - - lda #<(count+1) - sta $4088+1 - lda #>(count+1) - sta $4088+2 ; decrement custom counter after demo cycle and eventually exit + ldx #3-1 +- lda patch,x + sta $419C,x + sta $6C62,x + sta $4085,x ; set exits + lda patch2,x + sta $4088,x ; decrement custom counter after demo cycle and eventually exit + dex + bpl - lda #$D0 sta $67D1 ; disable sound @@ -60,17 +38,20 @@ count !byte $03 dec count - bpl + - jmp $100 -+ jmp $40C8 + bmi patch + jmp $40C8 -newpath - !byte 10 +patch !byte $4C,$00,$01 +patch2 !byte $4C,<(count+1),>(count+1) + +beer_run + !byte beer_run_e-beer_run_b +beer_run_b +beer_run_dir_b !text "X/BEER.RUN" - -title !byte x_e-x_b -x_b !text "X/BEER.RUN/BEER.RUN" -x_e +beer_run_dir_e + !text "/BEER.RUN" +beer_run_e !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/bellhop.a b/src/demo/bellhop.a index 7c331d1f7..6b9cca66c 100644 --- a/src/demo/bellhop.a +++ b/src/demo/bellhop.a @@ -8,33 +8,28 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $0813 jsr $0800 ; decompress - lda #$4C - sta $602F - sta $6BD4 - sta $66D2 - ldx #0 - stx $6030 - stx $6BD5 - inx - stx $6031 - stx $6BD6 - stx $66D4 - lda #$EE - sta $66CA - lda #counter - sta $66CC + ldx #3-1 +- lda patch,x + sta $602F,x + sta $6BD4,x + sta $66D2,x + lda patch2,x + sta $66CA,x + dex + bpl - +DISABLE_ACCEL jmp $6000 counter !byte $FD +patch !byte $4C,$00,$01 +patch2 !byte $EE,counter + title !byte x_e-x_b x_b !text "BELLHOP" x_e diff --git a/src/demo/bolo.a b/src/demo/bolo.a index e35835a9a..d7a21cf4e 100644 --- a/src/demo/bolo.a +++ b/src/demo/bolo.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BOLO",plain @@ -8,25 +8,20 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $8034 jsr $4ab0 ; decompress and show title - lda #$4C - sta $129A - sta $15F8 - sta $5D8A ; (later moved to $7D8A) - lda #0 - sta $129A+1 - sta $15F8+1 - sta $5D8A+1 - lda #1 - sta $129A+2 - sta $15F8+2 - sta $5D8A+2 ; set exits + ldx #3-1 +- lda patch,x + sta $129A,x + sta $15F8,x + sta $5D8A,x ; (later moved to $7D8A) + dex + bpl - ; set exits lda #$D0 sta $4E7A ; (later moved to $6E7A) @@ -37,6 +32,8 @@ jmp $1100 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "BOLO" x_e diff --git a/src/demo/borg.a b/src/demo/borg.a index 9b8fc357d..4dff612e5 100644 --- a/src/demo/borg.a +++ b/src/demo/borg.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BORG",plain @@ -11,18 +11,7 @@ +READ_RAM2_WRITE_RAM2 ;jsr EnableAccelerator ; can't because of animation -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #7-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - + +LOAD_FILE_KEEP_DIR borg, borg_dir_e-borg_dir_b +READ_ROM_NO_WRITE @@ -30,16 +19,13 @@ sta $609E jsr $6000 ; decompress and show animation - lda #$4C - sta $8C27 ; exit after 1 cycle - sta $ECA ; exit on keypress 1 (joysticks not polled) + ldx #3-1 +- lda patch2,x + sta $8C27,x ; exit after 1 cycle + sta $ECA,x ; exit on keypress 1 (joysticks not polled) + dex + bpl - sta $99 - lda #0 - sta $8C27+1 - sta $ECA+1 - lda #1 - sta $8C27+2 - sta $ECA+2 ldx #7-1 - lda patch, x @@ -51,14 +37,15 @@ jmp $EB0 patch !byte $30,$F8,$EA,$20,$00,$0F,$60 +patch2 !byte $4C,$00,$01 -newpath - !byte 6 +borg !byte borg_e-borg_b +borg_b +borg_dir_b !text "X/BORG" - -title !byte x_e-x_b -x_b !text "X/BORG/BORG" -x_e +borg_dir_e + !text "/BORG" +borg_e !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/bouncing.kmngas.a b/src/demo/bouncing.kmngas.a index aa0f047ec..a3fd7882a 100644 --- a/src/demo/bouncing.kmngas.a +++ b/src/demo/bouncing.kmngas.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BK",plain @@ -10,30 +10,16 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR kamungas, kamungas_dir_e-kamungas_dir_b lda #$60 sta $52DB jsr $527C ; decompress 1 - lda #$4C - sta $1B50 - lda #0 - sta $1B50+1 - lda #1 - sta $1B50+2 ; set exit + ldx #3-1 +- lda patch,x + sta $1B50,x + dex + bpl - lda #$D0 sta $1D00 @@ -54,28 +40,25 @@ +RESET_AND_IRQ_VECTOR $100 - lda #$4C - sta $7513 - sta $73BA - sta $7242 - lda #0 - sta $7513+1 - sta $73BA+1 - sta $7242+1 - lda #1 - sta $7513+2 - sta $73BA+2 - sta $7242+2 ; set exits + ldx #3-1 +- lda patch,x + sta $7513,x + sta $73BA,x + sta $7242,x ; set exits + dex + bpl - jmp $7218 ; show second title -newpath - !byte 4 - !text "X/BK" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/BK/BK" -x_e +kamungas !byte kamungas_e-kamungas_b +kamungas_b +kamungas_dir_b + !text "X/BK" +kamungas_dir_e + !text "/BK" +kamungas_e !if * > $A900 { !error "code is too large, ends at ", * diff --git a/src/demo/brainteaserblvd.a b/src/demo/brainteaserblvd.a index 146674e20..1e0a4406c 100644 --- a/src/demo/brainteaserblvd.a +++ b/src/demo/brainteaserblvd.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BB",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -30,18 +30,13 @@ sta $0C45 sta $0C48 ; skip inputs - lda #$4C - sta $15CC - sta $0ED2 - sta $159A - lda #0 - sta $15CC+1 - sta $0ED2+1 - sta $159A+1 - lda #1 - sta $15CC+2 - sta $0ED2+2 - sta $159A+2 ; set exits + ldx #3-1 +- lda patch,x + sta $15CC,x + sta $0ED2,x + sta $159A,x ; set exits + dex + bpl - lda #$D0 sta $170F @@ -59,6 +54,8 @@ jmp $0A00 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "BB" x_e diff --git a/src/demo/burgertime.a b/src/demo/burgertime.a index c4ef6d587..95f98b92f 100644 --- a/src/demo/burgertime.a +++ b/src/demo/burgertime.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BU",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -18,12 +18,11 @@ +DISABLE_ACCEL - lda #$4C - sta $653F - lda #$8D - sta $653F+1 - lda #$65 - sta $653F+2 ; skip joystick/keyboard selection + ldx #3-1 +- lda patch2,x + sta $653F,x ; skip joystick/keyboard selection + dex + bpl - lda #$b1 sta $646b @@ -33,34 +32,32 @@ jsr $811 - lda #0 - sta $A30A - lda #1 - sta $A30F ; reset vector patch + ldx #3-1 +- lda patch,x + sta $9FD3,x + sta $9FCF,x + sta $A497,x ; set exits + dex + bpl - - lda #$4C - sta $9FD3 - sta $9FCF - sta $A497 ; set exits + inx + stx $A30A - lda #0 - sta $9FD3+1 - sta $9FCF+1 - sta $A497+1 - sta $A15B - sta $A16A - sta $A17B - sta $A1D0 ; disable sound + stx $A15B + stx $A16A + stx $A17B + stx $A1D0 ; disable sound - lda #1 - sta $9FD3+2 - sta $9FCF+2 - sta $A497+2 + inx + stx $A30F ; reset vector patch +DISABLE_ACCEL jmp $a300 +patch !byte $4C,$00,$01 +patch2 !byte $4C,$8D,$65 + title !byte x_e-x_b x_b !text "BU" x_e diff --git a/src/demo/buzzard.bait.a b/src/demo/buzzard.bait.a index feac795ad..89d906a31 100644 --- a/src/demo/buzzard.bait.a +++ b/src/demo/buzzard.bait.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/BUZZARD.BAIT",plain @@ -8,36 +8,29 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $0827 jsr $0800 ; decompress - lda #$4C - sta $1067 - sta $1B31 - sta $7A6B - sta $80DD - sta $81FE - lda #0 - sta $1067+1 - sta $1B31+1 - sta $7A6B+1 - sta $80DD+1 - sta $81FE+1 - lda #1 - sta $1067+2 - sta $1B31+2 - sta $7A6B+2 - sta $80DD+2 - sta $81FE+2 ; set exits + ldx #3-1 +- lda patch,x + sta $1067,x + sta $1B31,x + sta $7A6B,x + sta $80DD,x + sta $81FE,x ; set exits + dex + bpl - +DISABLE_ACCEL jmp $8000 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "BUZZARD.BAIT" x_e diff --git a/src/demo/cannonball.bltz.a b/src/demo/cannonball.bltz.a index 233022ce7..43c29638a 100644 --- a/src/demo/cannonball.bltz.a +++ b/src/demo/cannonball.bltz.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/CB",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 diff --git a/src/demo/ceiling.zero.a b/src/demo/ceiling.zero.a index c20e1bf2e..dcc589830 100644 --- a/src/demo/ceiling.zero.a +++ b/src/demo/ceiling.zero.a @@ -8,31 +8,30 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $083A jsr $0800 ; decompress - lda #$4C - sta $7D9C - sta $7DE8 - sta $7DE3 + ldx #3-1 +- lda patch,x + sta $7D9C,x + sta $7DE8,x + sta $7DE3,x + dex + bpl - + sty $7D98 - sty $7D9D sty $8118 sty $7DD8 - sty $7DE9 sty $7E6A - sty $7DE4 - lda #1 - sta $7D9E - sta $7DEA - sta $7DE5 +DISABLE_ACCEL jmp $5FED +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "CEILING.ZERO" x_e diff --git a/src/demo/championship.lode.runner.a b/src/demo/championship.lode.runner.a index 4a2c0c5ca..44d1415f8 100644 --- a/src/demo/championship.lode.runner.a +++ b/src/demo/championship.lode.runner.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/CL",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR champ_lode, champ_lode_dir_e-champ_lode_dir_b lda #$60 sta $1F74 jsr $1F00 ; decompress @@ -32,33 +19,29 @@ sta $8AD3 lda #$08 sta $8AD3+1 - lda #$4C - sta $8AD3+2 - sta $7524 - sta $61FF - sta $626D - lda #0 - sta $8AD3+3 - sta $7524+1 - sta $61FF+1 - sta $626D+1 - lda #1 - sta $8AD3+4 - sta $7524+2 - sta $61FF+2 - sta $626D+2 ; set exits + ldx #3-1 +- lda patch,x + sta $8AD3+2,x + sta $7524,x + sta $61FF,x + sta $626D,x ; set exits + dex + bpl - +DISABLE_ACCEL jmp $6000 -newpath - !byte 4 - !text "X/CL" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/CL/CL" -x_e +champ_lode + !byte champ_lode_e-champ_lode_b +champ_lode_b +champ_lode_dir_b + !text "X/CL" +champ_lode_dir_e + !text "/CL" +champ_lode_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/choplifter.a b/src/demo/choplifter.a index 1ccdbbbaa..10e6ffd00 100644 --- a/src/demo/choplifter.a +++ b/src/demo/choplifter.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/CHOPLIFTER",plain @@ -9,25 +9,25 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $403F jsr $4000 ; decompress - lda #$4C - sta $0DAB - ldx #0 - stx $0DAC - stx $08F0 - inx - stx $0DAD - stx $08F1 + ldx #3-1 +- lda patch,x + sta $0DAB,x + sta $08EF,x + dex + bpl - lda #$18 sta $0DA9 +DISABLE_ACCEL ldy #0 jmp $400 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "CHOPLIFTER" x_e diff --git a/src/demo/cider.spider.a b/src/demo/cider.spider.a index 8fe31e122..0cb1ababc 100644 --- a/src/demo/cider.spider.a +++ b/src/demo/cider.spider.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/AC",plain @@ -10,50 +10,37 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR cider_spider, cider_spider_dir_e-cider_spider_dir_b lda #$60 sta $2076 jsr $1FFD ; decompress - lda #0 - sta $10AC - lda #1 - sta $10B1 ; reset vector patch + ldx #3-1 +- lda patch,x + sta $0C00,x + sta $1D27,x ; set exits + dex + bpl - - lda #$4C - sta $0C00 - sta $1D27 - lda #0 - sta $0C00+1 - sta $1D27+1 - lda #1 - sta $0C00+2 - sta $1D27+2 ; set exits + inx + stx $10AC + inx + stx $10B1 ; reset vector patch +DISABLE_ACCEL jmp $1000 -newpath - !byte 4 - !text "X/AC" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/AC/AC" -x_e +cider_spider + !byte cider_spider_e-cider_spider_b +cider_spider_b +cider_spider_dir_b + !text "X/AC" +cider_spider_dir_e + !text "/AC" +cider_spider_e !if * > $9BA0 { !error "code is too large, ends at ", * diff --git a/src/demo/conan.a b/src/demo/conan.a index c21bff2bb..1879d0e2c 100644 --- a/src/demo/conan.a +++ b/src/demo/conan.a @@ -35,33 +35,26 @@ lda #$6C sta $BD40 jsr $6BA5 - lda #$4C - sta $A4E2 - sta $A4D3 - ldx #0 - stx $A4E3 - stx $A4D4 - stx $A0D5 - inx - stx $A4E4 - stx $A4D5 - stx $A0D6 + ldx #3-1 +- lda patch,x + sta $A4E2,x + sta $A4D3,x + sta $A0D4,x + dex + bpl - lda $C057 lda $C052 lda $C050 +DISABLE_ACCEL jmp $A000 +patch !byte $4C,$00,$01 + conan !byte conan_e-conan_b conan_b conan_dir_b !text "X/CONAN" conan_dir_e -conan_main - !text "/" -conan_main_b - !text "CONAN" + !text "/CONAN" conan_e - !text ".MAIN" -conan_main_e diff --git a/src/demo/crime.wave.a b/src/demo/crime.wave.a index 2c0e948d9..5f0454512 100644 --- a/src/demo/crime.wave.a +++ b/src/demo/crime.wave.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/CRIME.WAVE",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #13-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR crime_wave, crime_wave_dir_e-crime_wave_dir_b lda #$60 sta $244B jsr $2400 ; decompress @@ -40,13 +27,14 @@ patch !byte $4C,$84,$9B,$4C,$00,$01,$CE,$8C,$9B,$F0,$F8,$4C,$48,$9B,$03 -newpath - !byte 12 +crime_wave + !byte crime_wave_e-crime_wave_b +crime_wave_b +crime_wave_dir_b !text "X/CRIME.WAVE" - -title !byte x_e-x_b -x_b !text "X/CRIME.WAVE/CRIME.WAVE" -x_e +crime_wave_dir_e + !text "/CRIME.WAVE" +crime_wave_e !if * > $BEFF { !error "code is too large, ends at ", * diff --git a/src/demo/cyclod.a b/src/demo/cyclod.a index e92c802dd..7f055601b 100644 --- a/src/demo/cyclod.a +++ b/src/demo/cyclod.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/CYCLOD",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -22,12 +22,11 @@ dex bpl - ; exit on keypress - lda #$4C - sta $89EF - lda #0 - sta $89EF+1 - lda #1 - sta $89EF+2 ; exit at end of demo cycle + ldx #3-1 +- lda patch2, x + sta $89EF,x ; exit at end of demo cycle + dex + bpl - lda #$D0 sta $7CED ; disable sound @@ -40,7 +39,8 @@ title !byte x_e-x_b x_b !text "CYCLOD" x_e -patch !byte $10,$03,$4C,$00,$01,$EA +patch !byte $10,$03 +patch2 !byte $4C,$00,$01,$EA !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/dig.dug.a b/src/demo/dig.dug.a index 5f5447ba2..df60ab6c9 100644 --- a/src/demo/dig.dug.a +++ b/src/demo/dig.dug.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/DIG.DUG",plain @@ -8,32 +8,29 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $826 jsr $800 ; decompress - lda #$4C - sta $A12E - sta $A3AE - sta $A3D4 - lda #0 - sta $A12E+1 - sta $A3D4+1 - lda #1 - sta $A12E+2 - sta $A3D4+2 ; set exits - lda #$B9 - sta $A3AE+1 - lda #$A3 - sta $A3AE+2 ; skip title screen and input selection + ldx #3-1 +- lda patch,x + sta $A12E,x + sta $A3D4,x ; set exits + lda patch2,x + sta $A3AE,x ; skip title screen and input selection + dex + bpl - +DISABLE_ACCEL jmp $8000 +patch !byte $4C,$00,$01 +patch2 !byte $4C,$B9,$A3 + title !byte x_e-x_b x_b !text "DIG.DUG" x_e diff --git a/src/demo/dino.eggs.a b/src/demo/dino.eggs.a index a615c6212..039ecda5e 100644 --- a/src/demo/dino.eggs.a +++ b/src/demo/dino.eggs.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/DINO.EGGS",plain @@ -10,46 +10,33 @@ +GAME_REQUIRES_JOYSTICK +READ_RAM2_WRITE_RAM2 - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - +READ_ROM_NO_WRITE - - ldx #12-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR dino_eggs, dino_eggs_dir_e-dino_eggs_dir_b lda #$60 sta $2186 jsr $2100 ; decompress - lda #$4C - sta $AD7A - sta $B29D - lda #1 - sta $AD7A+2 - sta $B29D+2 - lda #0 - sta $AD7A+1 - sta $B29D+1 ; set exits + ldx #3-1 +- lda patch,x + sta $AD7A,x + sta $B29D,x ; set exits + dex + bpl - - sta $0863 ; disable sound + inx + stx $0863 ; disable sound jmp $A892 -newpath - !byte 11 - !text "X/DINO.EGGS" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/DINO.EGGS/DINO.EGGS" -x_e +dino_eggs + !byte dino_eggs_e-dino_eggs_b +dino_eggs_b +dino_eggs_dir_b + !text "X/DINO.EGGS" +dino_eggs_dir_e + !text "/DINO.EGGS" +dino_eggs_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/dung.beetles.a b/src/demo/dung.beetles.a index 329cda314..7a55d2f59 100644 --- a/src/demo/dung.beetles.a +++ b/src/demo/dung.beetles.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/DUNG.BEETLES",plain @@ -8,21 +8,15 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $603A jsr $6000 ; decompress - lda #1 - sta $083E ; reset vector patch - lda #$4C - sta $847 - lda #0 - sta $848 - lda #$96 ; patch $847 - JMP ($3F2) - sta $849 ; to JMP $9600 + ldx #1 + stx $083E ; reset vector patch lda #$60 sta $847 @@ -34,15 +28,12 @@ dex bpl - ; disable button support on title screen - lda #$4C - sta $9B7D - sta $97D5 - lda #0 - sta $9B7D+1 - sta $97D5+1 - lda #1 - sta $9B7D+2 - sta $97D5+2 ; set exits + ldx #3-1 +- lda patch2,x + sta $9B7D,x + sta $97D5,x ; set exits + dex + bpl - lda #$D0 sta $1C17 @@ -55,6 +46,7 @@ jmp $9600 patch !byte $A9,$01,$EA,$EA,$EA,$EA +patch2 !byte $4C,$00,$01 title !byte x_e-x_b x_b !text "DUNG.BEETLES" diff --git a/src/demo/falcons.a b/src/demo/falcons.a index cc8f7437e..7e237888b 100644 --- a/src/demo/falcons.a +++ b/src/demo/falcons.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/FALCONS",plain @@ -17,18 +17,17 @@ lda #$2C sta $602A ; skip input selection - lda #$4C - sta $9FF7 - sta $9FDC - lda #0 - sta $9FF7+1 - sta $9FDC+1 - lda #1 - sta $9FF7+2 - sta $9FDC+2 ; set exits + ldx #3-1 +- lda patch,x + sta $9FF7,x + sta $9FDC,x ; set exits + dex + bpl - jmp $6000 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "FALCONS" x_e diff --git a/src/demo/firebird.a b/src/demo/firebird.a index 3e9456aca..c42e611d8 100644 --- a/src/demo/firebird.a +++ b/src/demo/firebird.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -25,25 +25,19 @@ sta $8CBD sta $8C7B sta $8C9D - lda #$4C - sta $3170 - sta $A370 - sta $7E48 - sta $18A5 - sta $198D - ldx #0 - stx $3171 - stx $A371 - stx $7E49 - stx $18A6 - stx $198E - inx - stx $3172 - stx $A372 - stx $7E4A - stx $18A7 - stx $198F - stx $7B2A + + ldx #3-1 +- lda patch,x + sta $3170,x + sta $A370,x + sta $7E48,x + sta $18A5,x + sta $198D,x + dex + bpl - + + lda #1 + sta $7B2A lda #$30 sta $A367 lda #7 @@ -56,6 +50,8 @@ jmp $30A0 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "FIREBIRD" x_e diff --git a/src/demo/firebug.a b/src/demo/firebug.a index 9a7a20cab..e71364ea7 100644 --- a/src/demo/firebug.a +++ b/src/demo/firebug.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/FIREBUG",plain @@ -19,29 +19,20 @@ sta $2076 jsr $2000 ; decompress - lda #0 - sta $83E - lda #1 - sta $849 ; reset vector fix + ldx #0 + stx $83E + inx + stx $849 ; reset vector fix - lda #$4C - sta $1105 - sta $151A - sta $5EA5 - sta $5F3B - sta $5F46 - lda #0 - sta $1105+1 - sta $151A+1 - sta $5EA5+1 - sta $5F3B+1 - sta $5F46+1 - lda #1 - sta $1105+2 - sta $151A+2 - sta $5EA5+2 - sta $5F3B+2 ; exit on keypress - sta $5F46+2 ; exit at end of demo cycle + ldx #3-1 +- lda patch,x + sta $1105,x + sta $151A,x + sta $5EA5,x + sta $5F3B,x ; exit on keypress + sta $5F46,x ; exit at end of demo cycle + dex + bpl - lda #$54 sta $086F ; disable sound @@ -50,6 +41,8 @@ jmp $810 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "X/FIREBUG/FIREBUG" x_e diff --git a/src/demo/flip.out.a b/src/demo/flip.out.a index 1a2df266e..3421f4a71 100644 --- a/src/demo/flip.out.a +++ b/src/demo/flip.out.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/FLIP.OUT",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -37,18 +37,14 @@ lda #$1C sta $6474+1 sta $685E+1 - lda #$4C - sta $6474+2 - sta $685E+2 - sta $78CD - lda #0 - sta $6474+3 - sta $685E+3 - sta $78CD+1 - lda #1 - sta $6474+4 - sta $685E+4 - sta $78CD+2 ; set exits + + ldx #3-1 +- lda patch3,x + sta $6474+2,x + sta $685E+2,x + sta $78CD,x ; set exits + dex + bpl - lda #$D0 sta $7716 @@ -63,8 +59,8 @@ x_b !text "FLIP.OUT" x_e patch1 !byte $B0,$08,$AD,$00,$C0,$10,$1F,$4C,$00,$01,$20,$69,$8B - -patch2 !byte $10,$03,$4C,$00,$01,$EA,$EA +patch2 !byte $10,$03 +patch3 !byte $4C,$00,$01,$EA,$EA !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/galaxian.a b/src/demo/galaxian.a index 66b20a479..b1cb9ff23 100644 --- a/src/demo/galaxian.a +++ b/src/demo/galaxian.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/GALAXIAN",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -26,15 +26,11 @@ ldx #5-1 - lda patch1, x - sta $8E5, x + sta $8E5, x ; exit on keypress during title screen + lda patch2, x + sta $E50, x ; exit on keypress during demo dex - bpl - ; exit on keypress during title screen - - ldx #5-1 -- lda patch2, x - sta $E50, x - dex - bpl - ; exit on keypress during demo + bpl - lda #callback1 - sta $B220 + ldx #3-1 +- lda patch2,x + sta $B21E,x + dex + bpl - +DISABLE_ACCEL jmp $B2F1 ; stage 1 (title screen and credits) callback1 - lda #$A5 ; restore original code so callback - sta $B21E ; won't be called more than once - lda #$5F - sta $B21F - lda #$0A - sta $B220 - - lda #$4C - sta $0DFB - lda #0 - sta $0DFB+1 - lda #1 - sta $0DFB+2 ; exit on button press or keypress - - lda #callback2 - sta $0FD0+2 ; continue to demo stage 2 after end of demo stage 1 + ldx #3-1 +- lda patch3,x ; restore original code so callback + sta $B21E,x ; won't be called more than once + lda patch4,x + sta $0DFB,x ; exit on button press or keypress + lda patch5,x + sta $0FD0,x ; continue to demo stage 2 after end of demo stage 1 + dex + bpl - lda $5F asl @@ -63,35 +40,38 @@ callback1 + rts callback2 - lda #$4C - sta $B22B - lda #callback3 - sta $B22B+2 + ldx #3-1 +- lda patch,x + sta $B22B,x + dex + bpl - jmp $E02 +patch !byte $4C,callback3 + callback3 - lda #$4C - sta $0DF6 - sta $12F6 - lda #0 - sta $0DF6+1 - sta $12F6+1 - lda #1 - sta $0DF6+2 - sta $12F6+2 ; stage 2 (demo play) - set exits + ldx #3-1 +- lda patch4,x + sta $0DF6,x + sta $12F6,x ; stage 2 (demo play) - set exits + dex + bpl - jmp $31F9 -newpath - !byte 9 - !text "X/GUMBALL" +patch2 !byte $20,callback1 +patch3 !byte $A5,$5F,$0A +patch4 !byte $4C,$00,$01 +patch5 !byte $4C,callback2 -title !byte x_e-x_b -x_b !text "X/GUMBALL/GUMBALL" -x_e +gumball !byte gumball_e-gumball_b +gumball_b +gumball_dir_b + !text "X/GUMBALL" +gumball_dir_e + !text "/GUMBALL" +gumball_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/hard.hat.mack.a b/src/demo/hard.hat.mack.a index b3c365873..3b5f43b1b 100644 --- a/src/demo/hard.hat.mack.a +++ b/src/demo/hard.hat.mack.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/HARD.HAT.MACK",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda # $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/high.rise.a b/src/demo/high.rise.a index 2c3ffbd7f..c5222dacb 100644 --- a/src/demo/high.rise.a +++ b/src/demo/high.rise.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/HIGH.RISE",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -20,20 +20,19 @@ sta $44AD sta $44B0 ; reset vector fix - lda #$4C - sta $455D - sta $4695 - lda #0 - sta $455D+1 - sta $4695+1 - lda #1 - sta $455D+2 - sta $4695+2 ; set exits + ldx #3-1 +- lda patch,x + sta $455D,x + sta $4695,x ; set exits + dex + bpl - +DISABLE_ACCEL jmp $449A +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "HIGH.RISE" x_e diff --git a/src/demo/jungle.hunt.a b/src/demo/jungle.hunt.a index 83067f3ca..45e4a18ca 100644 --- a/src/demo/jungle.hunt.a +++ b/src/demo/jungle.hunt.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/JUNGLE.HUNT",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #14-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR jungle_hunt, jungle_hunt_dir_e-jungle_hunt_dir_b lda #$60 sta $81E jsr $800 @@ -32,29 +19,22 @@ sta $BD44 jsr $BD00 - lda #1 - sta $0A6C - lda #0 - sta $0A67 ; reset vector patch + ldx #1 + stx $0A6C + dex + stx $0A67 ; reset vector patch lda #$60 sta $1501 ; reduce wait times while not playing sounds - lda #$4C - sta $676C - sta $0BD6 - sta $6553 - sta $0C28 - lda #0 - sta $676C+1 - sta $0BD6+1 - sta $6553+1 - sta $0C28+1 - lda #1 - sta $676C+2 - sta $0BD6+2 - sta $6553+2 - sta $0C28+2 ; set exits + ldx #3-1 +- lda patch,x + sta $676C,x + sta $0BD6,x + sta $6553,x + sta $0C28,x ; set exits + dex + bpl - lda #$D0 sta $14A0 @@ -65,13 +45,16 @@ jmp $A00 -newpath - !byte 13 - !text "X/JUNGLE.HUNT" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/JUNGLE.HUNT/JUNGLE.HUNT" -x_e +jungle_hunt + !byte jungle_hunt_e-jungle_hunt_b +jungle_hunt_b +jungle_hunt_dir_b + !text "X/JUNGLE.HUNT" +jungle_hunt_dir_e + !text "/JUNGLE.HUNT" +jungle_hunt_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/kamikaze.a b/src/demo/kamikaze.a index 7d480ffcf..76de73180 100644 --- a/src/demo/kamikaze.a +++ b/src/demo/kamikaze.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -21,20 +21,20 @@ sta $6A4E ; no sound sta $6A56 ; no sound sta $70A8 ; no sound - lda #$4C - sta $6158 - sta $6173 - ldx #0 - stx $61C1 - inx - stx $615A - stx $6175 - stx $61C2 + ldx #3-1 +- lda patch,x + sta $6158,x + sta $6173,x + sta $61C0,x + dex + bpl - +DISABLE_ACCEL jmp $9400 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "KAMIKAZE" x_e diff --git a/src/demo/karateka.a b/src/demo/karateka.a index c684f8e0f..ebb75d7bc 100644 --- a/src/demo/karateka.a +++ b/src/demo/karateka.a @@ -47,21 +47,14 @@ callback1 callback2 jsr $104 - lda #$A9 - sta $B7EA - sta $B7EF - sta $B80C - sta $B818 - lda #0 - sta $B7EB - sta $B7F0 - sta $B80D - sta $B819 - lda #$EA - sta $B7EC - sta $B7F1 - sta $B80E - sta $B81A + ldx #3-1 +- lda patch,x + sta $B7EA,x + sta $B7EF,x + sta $B80C,x + sta $B818,x + dex + bpl - lda #$AD sta $D0A sta $C59 @@ -74,23 +67,23 @@ callback2 sta $DDF lda #$60 sta $777F - lda #return - sta $B7FE - sta $D17 - sta $B5D9 - sta $3F3 - lda #$A6 - sta $3F4 + ldx #2-1 +- lda patch2,x + sta $B7FD,x + sta $D16,x + sta $B5D8,x + sta $3F2,x + dex + bpl - + jsr $FB6F +DISABLE_ACCEL lda #0 rts +patch !byte $A9,$00,$EA +patch2 !word return + return } callback_e diff --git a/src/demo/labyrinth.a b/src/demo/labyrinth.a index b129d2bf8..594cabb34 100644 --- a/src/demo/labyrinth.a +++ b/src/demo/labyrinth.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/LABYRINTH",plain @@ -10,21 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - +READ_ROM_NO_WRITE - - ldx #12-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR labyrinth, labyrinth_dir_e-labyrinth_dir_b lda #$60 sta $3874 jsr $37F6 ; decompress @@ -38,35 +24,29 @@ +DISABLE_ACCEL jsr $BC00 ; show title animation - lda #$EA - sta $1F00 - lda #$A9 - sta $1F00+1 - lda #$00 - sta $1F00+2 ; disable joystick button detection - - lda #$4C - sta $1E66 - sta $1EE9 - sta $8CAA - lda #0 - sta $1E66+1 - sta $1EE9+1 - sta $8CAA+1 - lda #1 - sta $1E66+2 - sta $1EE9+2 - sta $8CAA+2 ; set exits + ldx #3-1 +- lda patch,x + sta $1E66,x + sta $1EE9,x + sta $8CAA,x ; set exits + lda patch2,x + sta $1F00,x ; disable joystick button detection + dex + bpl - jmp $1E3E -newpath - !byte 11 - !text "X/LABYRINTH" +patch !byte $4C,$00,$01 +patch2 !byte $EA,$A9,$00 -title !byte x_e-x_b -x_b !text "X/LABYRINTH/LABYRINTH" -x_e +labyrinth + !byte labyrinth_e-labyrinth_b +labyrinth_b +labyrinth_dir_b + !text "X/LABYRINTH" +labyrinth_dir_e + !text "/LABYRINTH" +labyrinth_e !if * > $BFD0 { !error "code is too large, ends at ", * diff --git a/src/demo/lady.tut.a b/src/demo/lady.tut.a index 43fe6c1ab..81f1f3ded 100644 --- a/src/demo/lady.tut.a +++ b/src/demo/lady.tut.a @@ -38,19 +38,18 @@ callback sta $7B88 lda #$2C sta $7FEE - lda #$4C - sta $7D99 - sta $812F - lda #$70 - sta $7D9A - sta $8130 - lda #0 - sta $7D9B - sta $8131 + ldx #3-1 +- lda patch,x + sta $7D99,x + sta $812F,x + dex + bpl - jsr DisableAccelerator +READ_ROM_NO_WRITE jmp $8460 +patch !byte $4C,$70,$00 + title !byte x_e-x_b x_b !text "X/LADY.TUT/LADY.TUT" x_e diff --git a/src/demo/laser.bounce.a b/src/demo/laser.bounce.a index 51f365f43..1a9113a00 100644 --- a/src/demo/laser.bounce.a +++ b/src/demo/laser.bounce.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$2C @@ -20,28 +20,20 @@ sta $743F sta $7425 sta $888C - lda #$CE - sta $6006 - lda #counter - sta $6008 - lda #$4C - sta $600B - sta $6E41 - sta $6E98 - ldx #0 - stx $600C - stx $6E42 - stx $6E99 - inx - stx $600D - stx $6E43 - stx $6E9A + ldx #3-1 +- lda patch2,x + sta $6006,x + lda patch,x + sta $600B,x + sta $6E41,x + sta $6E98,x + dex + bpl - lda #4 sta $6E2B lda #$30 sta $6E95 + ldx #1 stx $6E96 asl sta $6E97 @@ -53,6 +45,9 @@ counter !byte 3 +patch !byte $4C,$00,$01 +patch2 !byte $CE,counter + title !byte x_e-x_b x_b !text "LASER.BOUNCE" x_e diff --git a/src/demo/lazer.silk.a b/src/demo/lazer.silk.a index b660eb9a9..ed0b89e52 100644 --- a/src/demo/lazer.silk.a +++ b/src/demo/lazer.silk.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/LAZER.SILK",plain @@ -8,37 +8,24 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $404B jsr $4000 ; decompress - lda #$4C - sta $14D5 - sta $14E5 - sta $1125 - sta $16E8 - sta $0C3D - sta $0C5B - sta $0D04 - lda #0 - sta $14D5+1 - sta $14E5+1 - sta $1125+1 - sta $16E8+1 - sta $0C3D+1 - sta $0C5B+1 - sta $0D04+1 - lda #1 - sta $14D5+2 - sta $14E5+2 - sta $1125+2 - sta $16E8+2 - sta $0C3D+2 - sta $0C5B+2 - sta $0D04+2 ; set exits + ldx #3-1 +- lda patch,x + sta $14D5,x + sta $14E5,x + sta $1125,x + sta $16E8,x + sta $0C3D,x + sta $0C5B,x + sta $0D04,x ; set exits + dex + bpl - lda #$1F sta $0D01 ; reduce time spent on final screen @@ -53,6 +40,8 @@ jmp ($0020) +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "LAZER.SILK" x_e diff --git a/src/demo/lode.runner.a b/src/demo/lode.runner.a index bf587d74e..f5f13edc5 100644 --- a/src/demo/lode.runner.a +++ b/src/demo/lode.runner.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/LODE.RUNNER",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #14-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR lode_runner, lode_runner_dir_e-lode_runner_dir_b lda #$60 sta $1F4E jsr $1F00 ; decompress @@ -32,19 +19,15 @@ sta $61FB ; ignore (would otherwise enter editor) sta $61FD ; ignore (would otherwise show high scores) - lda #$4C - sta $69CD - lda #$62 - sta $69CD+2 - lda #$01 - sta $69CD+1 ; exit after user presses button - - sta $61F4 - lda #$62 - sta $61F4+1 ; exit after demo player dies + ldx #3-1 +- lda patch,x + sta $69CD,x ; exit after user presses button + sta $61F3,x ; exit after demo player dies + dex + bpl - ldx #6-1 -- lda patch, x +- lda $100, x sta $6201, x dex bpl - ; exit after user presses any key @@ -53,15 +36,16 @@ jmp $9050 -patch !byte $AD,$88,$C0,$6C,$FC,$FF +patch !byte $4C,$01,$62 -newpath - !byte 13 +lode_runner + !byte lode_runner_e-lode_runner_b +lode_runner_b +lode_runner_dir_b !text "X/LODE.RUNNER" - -title !byte x_e-x_b -x_b !text "X/LODE.RUNNER/LODE.RUNNER" -x_e +lode_runner_dir_e + !text "/LODE.RUNNER" +lode_runner_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/lost.tomb.a b/src/demo/lost.tomb.a index a5ef471d8..6a2f73f6c 100644 --- a/src/demo/lost.tomb.a +++ b/src/demo/lost.tomb.a @@ -8,19 +8,26 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $82A jsr $800 ; decompress - lda #$4C - sta $2762 - sta $2780 - sta $80AF - sta $88D0 - sta $88B7 - sta $88E0 + ldx #3-1 +- lda patch,x + sta $2762,x + sta $2780,x + sta $80AF,x + sta $88D0,x + sta $88B7,x + sta $88E0,x + lda patch2,x + sta $896B,x + sta $317C,x + dex + bpl - + lda #$10 sta $277E sta $80AD @@ -30,29 +37,9 @@ sta $88B6 lda #$0A sta $80AE - lda #$A9 - sta $896B - sta $317C - ldx #0 - stx $2763 - stx $2781 - stx $80B0 - stx $88D1 - stx $88B8 - stx $8022 - stx $88E1 + inx - stx $2764 - stx $2782 - stx $896C - stx $317D - stx $80B1 - stx $88D2 - stx $88B9 - stx $88E2 - lda #$EA - sta $896D - sta $317E + stx $8022 lda #$20 sta $8032 lda #$1C @@ -65,6 +52,9 @@ +DISABLE_ACCEL jmp $84D +patch !byte $4C,$00,$01 +patch2 !byte $A9,$01,$EA + title !byte x_e-x_b x_b !text "LOST.TOMB" x_e diff --git a/src/demo/moon.patrol.a b/src/demo/moon.patrol.a index 44aded5df..248e0d482 100644 --- a/src/demo/moon.patrol.a +++ b/src/demo/moon.patrol.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/MOON.PATROL",plain @@ -8,33 +8,25 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $49DD jsr $800 - lda #$4C - sta $2A95 - sta $2A7E - sta $0C31 - sta $2E80 - lda #0 - sta $2A95+1 - sta $2A7E+1 - sta $0C31+1 - sta $2E80+1 - lda #1 - sta $2A95+2 - sta $2A7E+2 - sta $0C31+2 - sta $2E80+2 ; exit on keypress/end of demo + ldx #3-1 +- lda patch2,x + sta $2A95,x + sta $2A7E,x + sta $0C31,x + sta $2E80,x ; exit on keypress/end of demo + dex + bpl - lda #$A2 sta $0996 - lda #$FF - sta $0996+1 + stx $0996+1 lda #$9A sta $0996+2 ; prevent stack pointer from overwriting $100 @@ -56,7 +48,8 @@ title !byte x_e-x_b x_b !text "MOON.PATROL" x_e -patch !byte $20,$B8,$0A,$2C,$10,$C0,$A2,$41,$A9,$FF,$20,$A8,$FC,$AD,$00,$C0,$10,$05,$4C,$00,$01,$EA,$EA,$CA,$D0,$EE +patch !byte $20,$B8,$0A,$2C,$10,$C0,$A2,$41,$A9,$FF,$20,$A8,$FC,$AD,$00,$C0,$10,$05 +patch2 !byte $4C,$00,$01,$EA,$EA,$CA,$D0,$EE !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/mr.cool.a b/src/demo/mr.cool.a index 9f6d6f70c..78b91820c 100644 --- a/src/demo/mr.cool.a +++ b/src/demo/mr.cool.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/MC",plain @@ -10,40 +10,19 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR mr_cool, mr_cool_dir_e-mr_cool_dir_b lda #$60 sta $83C jsr $800 ; decompress - lda #$4C - sta $597F - sta $5A05 - lda #0 - sta $597F+1 - sta $5A05+1 - lda #1 - sta $597F+2 ; set exit on keypress - sta $5A05+2 ; set exit on button press - - lda #$20 - sta $7F37 - lda #callback - sta $7F37+2 ; exit at end of demo cycle + ldx #3-1 +- lda patch,x + sta $597F,x ; set exit on keypress + sta $5A05,x ; set exit on button press + lda patch2,x + sta $7F37,x ; exit at end of demo cycle + dex + bpl - +DISABLE_ACCEL @@ -53,17 +32,19 @@ callback sta $5E9B lda $5C04 cmp #$0C - beq exit + beq patch rts -exit jmp $0100 -newpath - !byte 4 +patch !byte $4C,$00,$01 +patch2 !byte $20,callback + +mr_cool !byte mr_cool_e-mr_cool_b +mr_cool_b +mr_cool_dir_b !text "X/MC" - -title !byte x_e-x_b -x_b !text "X/MC/MC" -x_e +mr_cool_dir_e + !text "/MC" +mr_cool_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/n.o.r.a.d.a b/src/demo/n.o.r.a.d.a index 89960309e..fb94f248c 100644 --- a/src/demo/n.o.r.a.d.a +++ b/src/demo/n.o.r.a.d.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/N.O.R.A.D",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -17,18 +17,13 @@ lda #$1D sta $0DB5+4 - lda #$4C - sta $0DD7 - sta $0E64 - sta $0E4C ; instead of $443D, this shows lores 'flash' at demo cycle end - lda #0 - sta $0DD7+1 - sta $0E64+1 - sta $0E4C+1 - lda #1 - sta $0DD7+2 - sta $0E64+2 - sta $0E4C+2 ; set exits + ldx #3-1 +- lda patch,x + sta $0DD7,x + sta $0E64,x + sta $0E4C,x ; instead of $443D, this shows lores 'flash' at demo cycle end + dex + bpl - lda #$D0 sta $0DE7+2 @@ -39,6 +34,8 @@ jmp $0EDD +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "N.O.R.A.D" x_e diff --git a/src/demo/nibbler.a b/src/demo/nibbler.a index ad5622705..95dd7524b 100644 --- a/src/demo/nibbler.a +++ b/src/demo/nibbler.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/NIBBLER",plain @@ -8,44 +8,35 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $8A19 jsr $6550 ; decompress and show title - lda #$A9 - sta $165C - lda #$EA - sta $165C+2 ; disable button detection - lda #$0A sta $1984 - lda #$4C - sta $1984+1 - sta $166D - sta $0981 - sta $11BC - lda #0 - sta $1984+2 - sta $166D+1 - sta $0981+1 - sta $11BC+1 - lda #1 - sta $165C+1 - sta $1984+3 - sta $166D+2 - sta $0981+2 - sta $11BC+2 ; set exits + ldx #3-1 +- lda patch,x + sta $1984+1,x + sta $166D,x + sta $0981,x + sta $11BC,x ; set exits + lda patch2,x + sta $165C,x ; disable button detection + dex + bpl - - lda #$FF - sta $0914 ; disable sound + stx $0914 ; disable sound +DISABLE_ACCEL jmp $900 +patch !byte $4C,$00,$01 +patch2 !byte $A9,$01,$EA + title !byte x_e-x_b x_b !text "NIBBLER" x_e diff --git a/src/demo/night.stalker.a b/src/demo/night.stalker.a index 0fd89779e..4cbc4ca6a 100644 --- a/src/demo/night.stalker.a +++ b/src/demo/night.stalker.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba/Frank M. +;(c) 2021-2022 by qkumba/Frank M. !cpu 6502 !to "res/DEMO/NIGHT.STALKER",plain @@ -9,17 +9,17 @@ !source "src/macros.a" - lda #0 - sta $618C ; fix reset - sta $6198 ; fix IRQ - lda #1 - sta $618D ; fix reset - sta $6199 ; fix IRQ - eor #$A5 + +ENABLE_ACCEL_LC + +LOAD_XSINGLE title + ldx #0 + stx $618C ; fix reset + stx $6198 ; fix IRQ + inx + stx $618D ; fix reset + stx $6199 ; fix IRQ + lda #$A4 sta $618E ; fix reset checksum ; (game picks up vectors from un-initialized memory) - +ENABLE_ACCEL - +LOAD_XSINGLE title lda #$60 sta $6017 sta $603F @@ -51,17 +51,13 @@ x_b !pseudopc $1C1 { sta $ABC9 sta $AC6E sta $B765 - lda #$4C - sta $BF00 - sta $BB6B - ldx #0 - stx $196E - stx $BF01 - stx $BB6C - inx - stx $196F - stx $BF02 - stx $BB6D + ldx #3-1 +- lda patch2,x + sta $196D,x + sta $BF00,x + sta $BB6B,x + dex + bpl - lda #$60 sta $1D67 lda #$A9 @@ -90,7 +86,8 @@ x_b !pseudopc $1C1 { +DISABLE_ACCEL jmp $6000 -patch !byte $20,$30,$AB,$CE,$24,$03,$D0,$03,$4C,$00,$01,$60,$AD,$6F,$03,$05,$EA,$60,$8D,$6F,$03,$A2,$FF,$60 +patch !byte $20,$30,$AB,$CE,$24,$03,$D0,$03 +patch2 !byte $4C,$00,$01,$60,$AD,$6F,$03,$05,$EA,$60,$8D,$6F,$03,$A2,$FF,$60 !if * > $282 { !error "code is too large, ends at ", * diff --git a/src/demo/nightmare.a b/src/demo/nightmare.a index ee08836ae..463661049 100644 --- a/src/demo/nightmare.a +++ b/src/demo/nightmare.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/NI",plain @@ -10,39 +10,19 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR nightmare, nightmare_dir_e-nightmare_dir_b lda #$60 sta $404B jsr $4000 ; decompress - lda #$4C - sta $8C24 - sta $8C35 - sta $1669 - lda #0 - sta $8C24+1 - sta $8C35+1 - lda #1 - sta $8C24+2 - sta $8C35+2 ; set exits - - lda #<(count+1) - sta $1669+1 - lda #>(count+1) - sta $1669+2 ; decrement custom counter after demo cycle and eventually exit + ldx #3-1 +- lda patch,x + sta $8C24,x + sta $8C35,x ; set exits + lda patch2,x + sta $1669,x ; decrement custom counter after demo cycle and eventually exit + dex + bpl - +DISABLE_ACCEL @@ -50,17 +30,20 @@ count !byte $03 dec count - beq + + beq patch jmp $128E -+ jmp $100 -newpath - !byte 4 +patch !byte $4C,$00,$01 +patch2 !byte $4C,<(count+1),>(count+1) + +nightmare + !byte nightmare_e-nightmare_b +nightmare_b +nightmare_dir_b !text "X/NI" - -title !byte x_e-x_b -x_b !text "X/NI/NI" -x_e +nightmare_dir_e + !text "/NI" +nightmare_e !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/orileys.mine.a b/src/demo/orileys.mine.a index 6529849c7..abda4f8c0 100644 --- a/src/demo/orileys.mine.a +++ b/src/demo/orileys.mine.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -39,43 +39,33 @@ sta $188D sta $90C2 sta $90CA - lda #$4C - sta $306D - sta $95C7 - sta $95D5 - sta $94F8 - sta $80F9 - sta $8324 - lda #$30 - sta $95CD - ldy #6 - sty $95CE + ldx #3-1 +- lda patch,x + sta $306D,x + sta $95C7,x + sta $95D5,x + sta $94F8,x + sta $80F9,x + sta $8324,x + lda patch2,x + sta $95CD,x + dex + bpl - + lda #$EA - sta $95CF sta $95D0 lda #$10 sta $80F7 - dey + ldy #5 sty $80F8 - ldx #0 - stx $306E - stx $95C8 - stx $95D6 - stx $94F9 - stx $80FA - stx $8325 - inx - stx $306F - stx $95C9 - stx $95D7 - stx $94FA - stx $80FB - stx $8326 +DISABLE_ACCEL jmp $8FD +patch !byte $4C,$00,$01 +patch2 !byte $30,$06,$EA + title !byte x_e-x_b x_b !text "OM" x_e diff --git a/src/demo/pacman.a b/src/demo/pacman.a index bea2a2e75..503d13270 100644 --- a/src/demo/pacman.a +++ b/src/demo/pacman.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/PACMAN",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title +NEW_RESET_VECTOR $280 @@ -22,38 +22,30 @@ lda #2 sta $104A ; reset vector patch - lda #$4C - sta $18A6 ; (later moved to $48A6) - sta $027C - sta $22F9 ; (later moved to $52F9) - sta $3F7C ; (later moved to $6F7C) - sta $5C0B ; (later moved to $8C0B) - lda #0 - sta $027C+1 - sta $22F9+1 - sta $3F7C+1 - sta $5C0B+1 - lda #1 - sta $027C+2 - sta $22F9+2 - sta $3F7C+2 - sta $5C0B+2 - lda #$CD - sta $18A6+1 - lda #$48 - sta $18A6+2 - lda #$30 - sta $22F1 ; (later moved to $52F1) - lda #6 - sta $22F1+1 + ldx #3-1 +- lda patch,x + sta $027C,x + sta $22F9,x ; (later moved to $52F9) + sta $3F7C,x ; (later moved to $6F7C) + sta $5C0B,x ; (later moved to $8C0B) + lda patch2,x + sta $18A6,x ; (later moved to $48A6) + lda patch3,x + sta $22F1,x ; (later moved to $52F1) + dex + bpl - + lda #$EA - sta $22F1+2 sta $22F1+3 ; set exits +DISABLE_ACCEL jmp $1000 +patch2 !byte $4C,$CD,$48 +patch !byte $4C,$00,$01 +patch3 !byte $30,$06,$EA + title !byte x_e-x_b x_b !text "PACMAN" x_e diff --git a/src/demo/pest.patrol.a b/src/demo/pest.patrol.a index fcd94df81..a7b43d339 100644 --- a/src/demo/pest.patrol.a +++ b/src/demo/pest.patrol.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/PEST.PATROL",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -21,22 +21,17 @@ dex bpl - ; exit when user presses a key during main menu - lda #$4C - sta $57C4 - sta $5589 - sta $B493 - lda #0 - sta $57C4+1 - sta $5589+1 - sta $485A ; disable sound - sta $48AE ; disable sound - lda #1 - sta $57C4+2 - sta $5589+2 - lda #$BD - sta $B493+1 - lda #$47 - sta $B493+2 ; set exits + ldx #3-1 +- lda patch,x + sta $57C4,x + sta $5589,x + lda patch2,x + sta $B493,x ; set exits + dex + bpl - + inx + stx $485A ; disable sound + stx $48AE ; disable sound +DISABLE_ACCEL @@ -47,7 +42,7 @@ x_b !text "PEST.PATROL" x_e patch !byte $4C,$00,$01,$AD,$00,$C0,$30,$F8,$4C,$90,$B3 - +patch2 !byte $4C,$BD,$47 !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/phaser.fire.a b/src/demo/phaser.fire.a index 5ea285e53..d106fcb03 100644 --- a/src/demo/phaser.fire.a +++ b/src/demo/phaser.fire.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -31,20 +31,19 @@ sta $439E sta $6546 sta $8B94 - lda #$4C - sta $54C0 - sta $980 - ldx #0 - stx $54C1 - stx $981 - inx - stx $54C2 - stx $982 + ldx #3-1 +- lda patch,x + sta $54C0,x + sta $980,x + dex + bpl - +DISABLE_ACCEL jmp ($20) +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "PHASER.FIRE" x_e diff --git a/src/demo/pieman.a b/src/demo/pieman.a index 35526bf24..d7e141ed0 100644 --- a/src/demo/pieman.a +++ b/src/demo/pieman.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/PM",plain @@ -10,20 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #5-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR pieman, pieman_dir_e-pieman_dir_b +ENABLE_ACCEL lda #$60 sta $3EA9 @@ -40,31 +27,27 @@ +RESET_AND_IRQ_VECTOR $100 - lda #$4C - sta $0EA6 - sta $13B7 - sta $09A1 - lda #0 - sta $0EA6+1 - sta $13B7+1 - lda #1 - sta $0EA6+2 - sta $13B7+2 ; set exits - - lda #$97 - sta $09A1+1 - lda #$0A - sta $09A1+2 ; start quiet demo immediately + ldx #3-1 +- lda patch,x + sta $0EA6,x + sta $13B7,x ; set exits + lda patch2,x + sta $09A1,x ; start quiet demo immediately + dex + bpl - jmp $0950 -newpath - !byte 4 - !text "X/PM" +patch !byte $4C,$00,$01 +patch2 !byte $4C,$97,$0A -title !byte x_e-x_b -x_b !text "X/PM/PM" -x_e +pieman !byte pieman_e-pieman_b +pieman_b +pieman_dir_b + !text "X/PM" +pieman_dir_e + !text "/PM" +pieman_e !if * > $2FF { !error "code is too large, ends at ", * diff --git a/src/demo/pitfall.ii.a b/src/demo/pitfall.ii.a index d8da4f0f1..68a0743cb 100644 --- a/src/demo/pitfall.ii.a +++ b/src/demo/pitfall.ii.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/PITFALL.II",plain @@ -9,7 +9,7 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -17,26 +17,24 @@ jsr $0800 ; decompress +RESET_VECTOR reset - lda #$4C - sta $2DF5 - sta $2E06 - lda #callback1 - sta $2DF7 - lda #callback2 - sta $2E08 - lda #callback3 - sta $6017 + ldx #3-1 +- lda patch,x + sta $2DF5,x + lda patch2,x + sta $2E06,x + lda patch3,x + sta $6015,x + dex + bpl - +DISABLE_ACCEL jmp $6000 ;612A copies pages 2E & 2F to AE & AF for final location +patch !byte $4C,callback1 +patch2 !byte $4C,callback2 +patch3 !byte $4C,callback3 + reset +READ_RAM2_NO_WRITE jmp ($FFFC) @@ -58,7 +56,7 @@ callback2 callback3 ldx #6-1 -p1 lda patch, x +p1 lda $100, x sta $6055, x sta $AB43, x dex @@ -71,8 +69,6 @@ p1 lda patch, x sta $6299 ; don't lose keypress on return jmp $ADE0 -patch !byte $AD,$88,$C0,$6C,$FC,$FF - title !byte x_e-x_b x_b !text "PITFALL.II" x_e diff --git a/src/demo/plasmania.a b/src/demo/plasmania.a index 016fcc49f..34514af83 100644 --- a/src/demo/plasmania.a +++ b/src/demo/plasmania.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/PLASMANIA",plain @@ -23,36 +23,29 @@ callback lda #$2C sta $7352 ; silence voice - lda #$4C - sta $609C - sta $6139 - sta $614C - sta $65B7 - sta $8C31 - sta $8C5B - lda #0 - sta $609C+1 - sta $6139+1 - sta $614C+1 - sta $65B7+1 - sta $8C31+1 - sta $8C5B+1 - sta $87BE - sta $87CC - sta $8AEE - sta $8B89 - sta $8B91 - sta $8C21 ; disable sound - lda #1 - sta $609C+2 - sta $6139+2 - sta $614C+2 - sta $65B7+2 - sta $8C31+2 - sta $8C5B+2 ; set exits + ldx #3-1 +- lda patch,x + sta $609C,x + sta $6139,x + sta $614C,x + sta $65B7,x + sta $8C31,x + sta $8C5B,x ; set exits + dex + bpl - + + inx + stx $87BE + stx $87CC + stx $8AEE + stx $8B89 + stx $8B91 + stx $8C21 ; disable sound jmp $6000 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "X/PLASMANIA/PLASMANIA" x_e diff --git a/src/demo/pooyan.a b/src/demo/pooyan.a index 8a55d72f6..c9d99d2ec 100644 --- a/src/demo/pooyan.a +++ b/src/demo/pooyan.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/POOYAN",plain @@ -8,28 +8,21 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $203A jsr $2000 ; decompress - lda #$4C - sta $6069 - sta $60C8 - sta $60EA - sta $7DB5 - lda #0 - sta $6069+1 - sta $60C8+1 - sta $60EA+1 - sta $7DB5+1 - lda #1 - sta $6069+2 - sta $60C8+2 - sta $60EA+2 - sta $7DB5+2 ; set exits + ldx #3-1 +- lda patch,x + sta $6069,x + sta $60C8,x + sta $60EA,x + sta $7DB5,x ; set exits + dex + bpl - lda #$D0 sta $A008 @@ -39,6 +32,8 @@ jmp $6000 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "POOYAN" x_e diff --git a/src/demo/repton.a b/src/demo/repton.a index 92ef4d4fe..81491d497 100644 --- a/src/demo/repton.a +++ b/src/demo/repton.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/REPTON",plain @@ -9,20 +9,7 @@ !source "src/macros.a" +READ_RAM2_WRITE_RAM2 - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #9-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR repton, repton_dir_e-repton_dir_b lda #$60 sta $086D jsr $0800 ; decompress1 @@ -45,17 +32,16 @@ jmp $0767 -patch1 !byte $10,$13,$4C,$00,$01 - +patch1 !byte $10,$13 patch2 !byte $4C,$00,$01 -newpath - !byte 8 +repton !byte repton_e-repton_b +repton_b +repton_dir_b !text "X/REPTON" - -title !byte x_e-x_b -x_b !text "X/REPTON/REPTON" -x_e +repton_dir_e + !text "/REPTON" +repton_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/robotron.a b/src/demo/robotron.a index e81c53b6f..9ca513081 100644 --- a/src/demo/robotron.a +++ b/src/demo/robotron.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/ROBOTRON.2084",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda # $BB00 { !error "code is too large, ends at ", * diff --git a/src/demo/serpentine.a b/src/demo/serpentine.a index c0efe91f0..3a2b466c0 100644 --- a/src/demo/serpentine.a +++ b/src/demo/serpentine.a @@ -28,35 +28,26 @@ callback1 rts callback2 - lda #$4C - sta $96AA - sta $8834 - lda #$A9 - sta $9702 - sta $9707 - sta $91B - sta $920 - lda #reset - sta $96AC - sta $8836 - lda #$EA - sta $9704 - sta $9709 - sta $91D - sta $922 + ldx #3-1 +- lda patch,x + sta $8834,x + sta $96AA,x + lda patch2,x + sta $9702,x + sta $9707,x + sta $91B,x + sta $920,x + dex + bpl - + lda #$D0 sta $962D +DISABLE_ACCEL jmp $800 +patch !byte $4C,reset +patch2 !byte $A9,$00,$EA + serpentine !byte serpentine_e-serpentine_b serpentine_b diff --git a/src/demo/short.circuit.a b/src/demo/short.circuit.a index 6b94da843..f88451fa5 100644 --- a/src/demo/short.circuit.a +++ b/src/demo/short.circuit.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/SHORT.CIRCUIT",plain @@ -10,32 +10,17 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #16-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - + +LOAD_FILE_KEEP_DIR short_circuit, short_circuit_dir_e-short_circuit_dir_b lda #$60 sta $207C jsr $2000 ; decompress - lda #$4C - sta $A248 - lda #0 - sta $A248+1 - sta $A7B4+1 - lda #1 - sta $A248+2 ; set exit on keypress - sta $A7B4+2 ; set exit at end of demo cycle + ldx #3-1 +- lda patch,x + sta $A248,x ; set exit on keypress + sta $A7B4,x ; set exit at end of demo cycle + dex + bpl - lda #$D0 sta $A654 @@ -50,13 +35,16 @@ jmp $A100 -newpath - !byte 15 - !text "X/SHORT.CIRCUIT" +patch !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/SHORT.CIRCUIT/SHORT.CIRCUIT" -x_e +short_circuit + !byte short_circuit_e-short_circuit_b +short_circuit_b +short_circuit_dir_b + !text "X/SHORT.CIRCUIT" +short_circuit_dir_e + !text "/SHORT.CIRCUIT" +short_circuit_e !if * > $300 { !error "code is too large, ends at ", * diff --git a/src/demo/snake.byte.a b/src/demo/snake.byte.a index fd92e8b23..ee5b41f4a 100644 --- a/src/demo/snake.byte.a +++ b/src/demo/snake.byte.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$B9 @@ -17,10 +17,13 @@ sta $0858 jsr $0800 ; decompress - lda #$4C - sta $621F - ldx #0 - stx $6220 + ldx #3-1 +- lda patch,x + sta $621F,x + dex + bpl - + + inx stx $7807 stx $78ae stx $7a11 @@ -32,7 +35,6 @@ stx $6C13 stx $7975 inx - stx $6221 stx $7808 stx $78af stx $7a19 @@ -45,6 +47,8 @@ jmp $7680 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "SNAKE.BYTE" x_e diff --git a/src/demo/sneakers.a b/src/demo/sneakers.a index 00dd6bccf..9387ca14c 100644 --- a/src/demo/sneakers.a +++ b/src/demo/sneakers.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/SNEAKERS",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 diff --git a/src/demo/space.eggs.a b/src/demo/space.eggs.a index 9eb07a389..49843d319 100644 --- a/src/demo/space.eggs.a +++ b/src/demo/space.eggs.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/SPACE.EGGS",plain @@ -9,7 +9,7 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title +NEW_RESET_VECTOR $280 @@ -18,28 +18,19 @@ sta $2056 jsr $2000 ; decompress + ldx #6-1 lda #$EA - sta $4821 - sta $4821+1 - sta $4821+2 - sta $4821+3 - sta $4821+4 - sta $4821+5 ; avoid clobbering stack +- sta $4821,x ; avoid clobbering stack + dex + bpl - - lda #$AD - sta $4B00 - lda #0 - sta $4B00+1 - lda #$C0 - sta $4B00+2 ; change button press detection to keypress detection - - - lda #$4C - sta $4B06 - lda #0 - sta $4B06+1 - lda #1 - sta $4B06+2 ; exit on keypress + ldx #3-1 +- lda patch2,x + sta $4B00,x ; change button press detection to keypress detection + lda patch3,x + sta $4B06,x ; exit on keypress + dex + bpl - ldx #11-1 - lda patch, x @@ -54,7 +45,9 @@ jmp $4880 -patch !byte $CE,$FF,$4B,$10,$03,$4C,$00,$01,$4C,$B0,$4B +patch !byte $CE,$FF,$4B,$10,$03 +patch3 !byte $4C,$00,$01,$4C,$B0,$4B +patch2 !byte $AD,$00,$C0 title !byte x_e-x_b x_b !text "SPACE.EGGS" diff --git a/src/demo/space.quarks.a b/src/demo/space.quarks.a index cd65de5f9..be64d4ef1 100644 --- a/src/demo/space.quarks.a +++ b/src/demo/space.quarks.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/SPACE.QUARKS",plain @@ -8,29 +8,22 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$4C sta $3EC9 jsr $3E65 ; decompress/set reset vector +RESET_AND_IRQ_VECTOR $100 - lda #$EA - sta $1C38 - sta $1C39 - sta $1C3A - sta $0D6F - sta $0D70 - sta $0D71 - lda #$4C - sta $1C3F - sta $0D76 - ldx #0 - stx $1C40 - stx $0D77 - inx - stx $1C41 - stx $0D78 + ldx #3-1 +- lda #$EA + sta $1C38,x + sta $0D6F,x + lda patch2,x + sta $1C3F,x + sta $0D76,x + dex + bpl - ldx #16 - lda patch, x sta $72BD, x @@ -45,4 +38,5 @@ title !byte x_e-x_b x_b !text "SPACE.QUARKS" x_e -patch !byte $F0,$08,$AD,$00,$C0,$10,$0D,$4C,$00,$01,$CE,$24,$02,$F0,$F8,$68,$68 +patch !byte $F0,$08,$AD,$00,$C0,$10,$0D +patch2 !byte $4C,$00,$01,$CE,$24,$02,$F0,$F8,$68,$68 diff --git a/src/demo/spare.change.a b/src/demo/spare.change.a index f8e9f3e1c..f0450854f 100644 --- a/src/demo/spare.change.a +++ b/src/demo/spare.change.a @@ -23,17 +23,17 @@ callback jsr $2000 lda #$44 sta $7A34 - lda #$4C - sta $8E1C - ldx #0 - stx $7F70 - stx $8E1D - inx - stx $7F71 - stx $8E1E + ldx #3-1 +- lda patch,x + sta $7F6F,x + sta $8E1C,x + dex + bpl - +DISABLE_ACCEL jmp $1832 +patch !byte $4C,$00,$01 + spare_change !byte spare_change_e-spare_change_b spare_change_b diff --git a/src/demo/spider.raid.a b/src/demo/spider.raid.a index bd0a4ab19..18604796d 100644 --- a/src/demo/spider.raid.a +++ b/src/demo/spider.raid.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -40,14 +40,12 @@ sta $160C sta $1643 sta $164B - lda #$4C - sta $49A9 - ldx #0 - stx $49AA - stx $99A6 - inx - stx $49AB - stx $99A7 + ldx #3-1 +- lda patch,x + sta $49A9,x + sta $99A5,x + dex + bpl - sec rol $976A @@ -55,6 +53,8 @@ jmp $4246 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "SPIDER.RAID" x_e diff --git a/src/demo/spy.hunter.a b/src/demo/spy.hunter.a index 58fc509d8..b469604ce 100644 --- a/src/demo/spy.hunter.a +++ b/src/demo/spy.hunter.a @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #<(callback - 1) diff --git a/src/demo/spys.demise.a b/src/demo/spys.demise.a index 049491c25..e29c91c68 100644 --- a/src/demo/spys.demise.a +++ b/src/demo/spys.demise.a @@ -14,18 +14,15 @@ lda #$60 sta $0853 jsr $0800 ; decompress - lda #$4C - sta $60D1 - sta $69B9 - ldx #0 - stx $60D2 - stx $69BA - stx $6D71 - stx $72F3 + ldx #3-1 +- lda patch,x + sta $60D1,x + sta $69B9,x + sta $6D70,x + dex + bpl - inx - stx $60D3 - stx $69BB - stx $6D72 + stx $72F3 asl $7324 inc $7325 lda #$15 @@ -35,6 +32,8 @@ +READ_ROM_NO_WRITE jmp $6000 +patch !byte $4C,$00,$01 + sd !byte sd_e-sd_b sd_b diff --git a/src/demo/star.blazer.a b/src/demo/star.blazer.a index dee648cc8..b35a8393a 100644 --- a/src/demo/star.blazer.a +++ b/src/demo/star.blazer.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/STAR.BLAZER",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -20,32 +20,26 @@ +ENABLE_ACCEL jsr $B4C6 ; decompress - lda #$4C - sta $17DB - sta $1760 - sta $17AD - sta $1705 - lda #0 - sta $17DB+1 - sta $1760+1 - sta $17AD+1 - lda #1 - sta $17DB+2 - sta $1760+2 - sta $17AD+2 ; set exits - lda #<(count + 1) - sta $1705+1 - lda #>(count + 1) - sta $1705+2 ; decrement custom counter after demo cycle and eventually exit + ldx #3 +- lda patch,x + sta $17DB,x + sta $1760,x + sta $17AD,x ; set exits + lda patch2,x + sta $1705,x ; decrement custom counter after demo cycle and eventually exit + dex + bpl - +DISABLE_ACCEL jmp ($20) count !byte $03 dec count - bpl + - jmp $100 -+ jmp $1750 + bmi patch + jmp $1750 + +patch !byte $4C,$00,$01 +patch2 !byte $4C,<(count + 1),>(count + 1) title !byte x_e-x_b x_b !text "STAR.BLAZER" diff --git a/src/demo/stargate.a b/src/demo/stargate.a index bf606dc73..ec2220349 100644 --- a/src/demo/stargate.a +++ b/src/demo/stargate.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/STARGATE",plain @@ -9,7 +9,7 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 @@ -24,25 +24,20 @@ sta $0933 lda #$1E sta $0933+1 - lda #$4C - sta $0933+2 - sta $0905 - sta $51C7 - sta $51D2 - lda #0 - sta $0933+3 - sta $0905+1 - sta $51C7+1 - sta $51D2+1 - sta $47F2 ; fix reset (moved to $3F2/$3F3/$3F4) - sta $47FE ; fix IRQ (moved to $3FE/$3FF) - lda #1 - sta $0933+4 - sta $0905+2 - sta $51C7+2 - sta $51D2+2 ; set exits - sta $47F2+1 - sta $47FE+1 + ldx #3-1 +- lda patch,x + sta $0933+2,x + sta $0905,x + sta $51C7,x + sta $51D2,x ; set exits + dex + bpl - + ldx #2-1 +- txa + sta $47F2,x ; fix reset (moved to $3F2/$3F3/$3F4) + sta $47FE,x ; fix IRQ (moved to $3FE/$3FF) + dex + bpl - lda #$A4 sta $47F2+2 ; fix reset checksum @@ -60,6 +55,8 @@ jmp $5000 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "STARGATE" x_e diff --git a/src/demo/stellar.7.a b/src/demo/stellar.7.a index 5ac55f213..39b776caa 100644 --- a/src/demo/stellar.7.a +++ b/src/demo/stellar.7.a @@ -17,10 +17,10 @@ sta $863 jsr $800 ; unpack - lda #0 - sta $AE2A - lda #1 - sta $AE2C + ldx #0 + stx $AE2A + inx + stx $AE2C lda #$A4 sta $AE28 ; reset vector patch diff --git a/src/demo/the.goonies.a b/src/demo/the.goonies.a index b849893f9..3cac14754 100644 --- a/src/demo/the.goonies.a +++ b/src/demo/the.goonies.a @@ -34,15 +34,14 @@ +DISABLE_ACCEL jsr $4000 ; title jsr $60F ; load level - ldx #0 - stx $87D - stx $12C4 - stx $12CC - inx - stx $87E - stx $12C5 - stx $12CD + ldx #2-1 stx $A0D +- txa + sta $87D,x + sta $12C4,x + sta $12CC,x + dex + bpl - lda #$4C sta $12CB lda #$D0 diff --git a/src/demo/thunder.bombs.a b/src/demo/thunder.bombs.a index 44a21c168..fff15ddba 100644 --- a/src/demo/thunder.bombs.a +++ b/src/demo/thunder.bombs.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/THUNDER.BOMBS",plain @@ -9,28 +9,15 @@ !source "src/macros.a" +READ_RAM2_WRITE_RAM2 -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect + +LOAD_FILE_KEEP_DIR thunder_bombs, thunder_bombs_dir_e-thunder_bombs_dir_b +READ_ROM_NO_WRITE - - ldx #16-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - lda #$60 sta $887F - lda #$4C - sta $8819 - lda #callback - sta $8819+2 + ldx #3-1 +- lda patch,x + sta $8819,x + dex + bpl - jsr $87F9 ; load, show title lda #$60 @@ -40,21 +27,14 @@ lda #0 sta $3F2 ; reset vector - lda #$4C - sta $789B - sta $78CB - sta $7A8C - sta $7837 - lda #0 - sta $789B+1 - sta $78CB+1 - sta $7A8C+1 - sta $7837+1 - lda #1 - sta $789B+2 - sta $78CB+2 - sta $7A8C+2 - sta $7837+2 ; set exits + ldx #3-1 +- lda patch2,x + sta $789B,x + sta $78CB,x + sta $7A8C,x + sta $7837,x ; set exits + dex + bpl - lda $323 jmp $781B @@ -63,10 +43,10 @@ callback bit $C000 ldx #$30 - bit $C055 lda #$0B - jsr fakewait + jsr $FCA8 bit $C054 lda #$0B - jsr fakewait + jsr $FCA8 bit $C000 bmi exit dey @@ -74,24 +54,19 @@ callback bit $C000 dex bne - jmp $8839 -exit jmp $100 +exit +patch2 !byte $4C,$00,$01 -fakewait sec -wait1 pha -wait2 sbc #$01 - bne wait2 - pla - sbc #$01 - bne wait1 - rts +patch !byte $4C,callback -newpath - !byte 15 +thunder_bombs + !byte thunder_bombs_e-thunder_bombs_b +thunder_bombs_b +thunder_bombs_dir_b !text "X/THUNDER.BOMBS" - -title !byte x_e-x_b -x_b !text "X/THUNDER.BOMBS/THUNDER.BOMBS" -x_e +thunder_bombs_dir_e + !text "/THUNDER.BOMBS" +thunder_bombs_e !if * > $B100 { !error "code is too large, ends at ", * diff --git a/src/demo/tubeway.a b/src/demo/tubeway.a index 3178abc23..aa1ed7e7c 100644 --- a/src/demo/tubeway.a +++ b/src/demo/tubeway.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/TB",plain @@ -9,32 +9,22 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +READ_RAM2_WRITE_RAM2 - jsr EnableAccelerator - +LOAD_FILE_AT tubeway, $00 + +ENABLE_ACCEL_LC + +LOAD_XSINGLE title lda #$4C sta $6BA8 sta $6C2D jsr $4EC6 ; decompress jsr $B2EC - lda #$4C - sta $4F46 - sta $AD44 - sta $AD2A - sta $AB86 - sta $AC64 - ldx #0 - stx $4F47 - stx $AD45 - stx $AD2B - stx $AB87 - stx $AC65 - inx - stx $4F48 - stx $AD46 - stx $AD2C - stx $AB88 - stx $AC66 + ldx #3-1 +- lda patch,x + sta $4F46,x + sta $AD44,x + sta $AD2A,x + sta $AB86,x + sta $AC64,x + dex + bpl - lda #$10 sta $AD28 sta $AB84 @@ -49,9 +39,11 @@ +DISABLE_ACCEL jmp $9000 -tubeway - !byte 7 - !text "X/TB/TB" +patch !byte $4C,$00,$01 + +title !byte x_e-x_b +x_b !text "TB" +x_e !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/tunnel.terror.a b/src/demo/tunnel.terror.a index 8adb9640b..a0e784995 100644 --- a/src/demo/tunnel.terror.a +++ b/src/demo/tunnel.terror.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/TUNNEL.TERROR",plain @@ -8,7 +8,7 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #1 ; reset vector fix @@ -20,27 +20,21 @@ sta $4026 jsr $4000 ; decompress and show title - lda #$4C - sta $0EFE - sta $06A4 - sta $AD10 - sta $0E66 - sta $1315+2 - lda #0 - sta $0EFE+1 - sta $06A4+1 - sta $AD10+1 - sta $0E66+1 - sta $1315+3 - sta $0F5D+1 - sta $0F72+1 - lda #1 - sta $03FF ; fix IRQ - sta $0EFE+2 - sta $06A4+2 - sta $AD10+2 - sta $0E66+2 - sta $1315+4 ; set exits + ldx #3-1 +- lda patch,x + sta $0EFE,x + sta $06A4,x + sta $AD10,x + sta $0E66,x + sta $1315+2,x ; set exits + dex + bpl - + + inx + stx $0F5D+1 + stx $0F72+1 + inx + stx $03FF ; fix IRQ lda #$10 sta $1315 @@ -54,12 +48,6 @@ sta $0F5D+2 sta $0F72+2 - lda #$AD - sta $8434 - sta $8441 - lda #$30 - sta $8434+1 - sta $8441+1 lda #$D0 sta $8434+2 sta $8441+2 ; disable sound @@ -68,6 +56,8 @@ jmp $E00 +patch !byte $4C,$00,$01 + title !byte x_e-x_b x_b !text "TUNNEL.TERROR" x_e diff --git a/src/demo/vindicator.a b/src/demo/vindicator.a index bbcf8224f..33427ab00 100644 --- a/src/demo/vindicator.a +++ b/src/demo/vindicator.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/VINDICATOR",plain @@ -18,16 +18,15 @@ sta $1867 jsr $180F ; decompress - lda #$4C - sta $56D9 - sta $4902 ; set exits + ldx #3-1 +- lda patch,x + sta $56D9,x + sta $4902,x ; set exits + dex + bpl - lda #$F0 - sta $56D9+1 - sta $4902+1 sta $4001 lda #$BF - sta $56D9+2 - sta $4902+2 sta $400F ; reset vector fix (overwrites $100) lda #$60 ; annunciator fix - kills Gizmo/joyport support @@ -43,14 +42,15 @@ jmp $4000 +patch !byte $4C,$F0,$BF + vindicator !byte vindicator_e-vindicator_b vindicator_b vindicator_dir_b !text "X/VINDICATOR" vindicator_dir_e - !text "/" - !text "VINDICATOR" + !text "/VINDICATOR" vindicator_e !if * > $3F0 { diff --git a/src/demo/warp.destroyer.a b/src/demo/warp.destroyer.a index d49a0e5ac..9fd5f3be8 100644 --- a/src/demo/warp.destroyer.a +++ b/src/demo/warp.destroyer.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by Frank M. +;(c) 2021-2022 by Frank M., qkumba !cpu 6502 !to "res/DEMO/WARP.DESTROYER",plain @@ -10,22 +10,7 @@ +READ_RAM2_WRITE_RAM2 jsr EnableAccelerator - -;+LOAD_FILE_KEEP_DIR - ldx #0 ; read to main memory - stx ldrhi - stx ldrlo - +LDADDR title - jsr iLoadFileDirect - - ldx #17-1 ; we also need to copy the length byte -- lda newpath,x - sta $BFD0,x - dex - bpl - - - +READ_ROM_NO_WRITE - + +LOAD_FILE_KEEP_DIR warp_destoyer, warp_destoyer_dir_e-warp_destoyer_dir_b lda #$4C sta $893 jsr $800 ; decompress, show title @@ -40,12 +25,11 @@ lda #$13 ; disable unknown hardware support sta $76D2 ; otherwise hangs on IIgs - lda #$A9 - sta $7AA6 - lda #$CB - sta $7AA6+1 - lda #$EA - sta $7AA6+2 ; auto-select keyboard control + ldx #3-1 +- lda patch,x + sta $7AA6,x ; auto-select keyboard control + dex + bpl - lda #$D0 sta $65D6 ; disable sound @@ -57,31 +41,28 @@ lda #0 jsr $896 ; memory move, show second title - lda #$4C - sta $8051 - sta $8107 - sta $8157 - sta $839D - lda #0 - sta $8051+1 - sta $8107+1 - sta $8157+1 - sta $839D+1 - lda #1 - sta $8051+2 - sta $8107+2 - sta $8157+2 - sta $839D+2 ; set exits + ldx #3-1 +- lda patch2,x + sta $8051,x + sta $8107,x + sta $8157,x + sta $839D,x ; set exits + dex + bpl - jmp $667D -newpath - !byte 16 - !text "X/WARP.DESTROYER" +patch !byte $A9,$CB,$EA +patch2 !byte $4C,$00,$01 -title !byte x_e-x_b -x_b !text "X/WARP.DESTROYER/WARP.DESTROYER" -x_e +warp_destoyer + !byte warp_destoyer_e-warp_destoyer_b +warp_destoyer_b +warp_destoyer_dir_b + !text "X/WARP.DESTROYER" +warp_destoyer_dir_e + !text "/WARP.DESTROYER" +warp_destoyer_e !if * > $3F0 { !error "code is too large, ends at ", * diff --git a/src/demo/wavy.navy.a b/src/demo/wavy.navy.a index 9e1914b06..20c699738 100644 --- a/src/demo/wavy.navy.a +++ b/src/demo/wavy.navy.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2021 by qkumba +;(c) 2021-2022 by qkumba !cpu 6502 !to "res/DEMO/WAVY.NAVY",plain @@ -8,14 +8,14 @@ !source "src/constants.a" ; no code in these !source "src/macros.a" - +ENABLE_ACCEL + +ENABLE_ACCEL_LC +LOAD_XSINGLE title lda #$60 sta $505d jsr $800 ; decompress ldx #5 -- lda patch, x +- lda $100, x sta $09E8, x sta $1547, x dex @@ -32,8 +32,6 @@ title !byte x_e-x_b x_b !text "WAVY.NAVY" x_e -patch !byte $AD,$88,$C0,$6C,$FC,$FF - !if * > $3F0 { !error "code is too large, ends at ", * } diff --git a/src/macros.a b/src/macros.a index a4c3339c6..dd81d7bd4 100755 --- a/src/macros.a +++ b/src/macros.a @@ -297,9 +297,14 @@ ; these are mostly for prelaunchers -- code in the main program should keep track of which bank is active to minimize code size !macro ENABLE_ACCEL { + +ENABLE_ACCEL_LC + +READ_ROM_NO_WRITE +} + +; leave LC active on exit +!macro ENABLE_ACCEL_LC { +READ_RAM2_NO_WRITE jsr EnableAccelerator - +READ_ROM_NO_WRITE } !macro DISABLE_ACCEL {