add Captain Goodnight cheat

This commit is contained in:
Peter Ferrie 2022-05-06 21:57:43 -07:00
parent 91189cfd99
commit 2d8e9f274a
4 changed files with 100 additions and 9 deletions

View File

@ -93,7 +93,7 @@
0000,CALI.RAISINS=California Raisins
0001,CB=Cannonball Blitz
0001,CANYON.CLIMBER=Canyon Climber
0000,CG=Captain Goodnight
0004,CG=Captain Goodnight
0001,CAPTAIN.POWER=Captain Power
0002,CS=Castle Smurfenstein
0002,CW=Castle Wolfenstein

View File

@ -2,5 +2,6 @@
BERZAP.MB=Type(06),AuxType(0200),Access(C3)
CAVRN.CHEAT=Type(06),AuxType(0200),Access(C3)
CG.CHEAT=Type(06),AuxType(0300),Access(C3)
KAMUNGAS.MB=Type(06),AuxType(0200),Access(C3)
RESQ.RAIDERS.MB=Type(06),AuxType(0300),Access(C3)

View File

@ -0,0 +1,87 @@
;license:MIT
;(c) 2022 by qkumba
!cpu 6502
!to "build/PRELAUNCH/CG.CHEAT",plain
*=$300
!source "src/constants.a" ; no code in these
!source "src/macros.a"
+READ_RAM2_NO_WRITE
jsr DisableAccelerator
lda MachineStatus
and #CHEATS_ENABLED
php
+READ_ROM_NO_WRITE
lda #$60
sta $9E4
jsr $800 ; decompress
+LC_REBOOT
plp
beq +
lda #$AD
sta $1CFA ; patch - don't decrease time
lda #<callback
sta $D02D
lda #>callback
sta $D02E
+
jmp $6300
callback
pla
pla
jsr $D032
jsr $D02F
lda $D141
cmp #'A'
beq hook_A
cmp #'B'
beq hook_B
cmp #'C'
beq hook_C
cmp #'D'
beq hook_D
cmp #'E'
beq hook_E
cmp #'F'
bne no_hook
dec $765E ; patch - don't decrease time
dec $7751 ; patch - don't decrease time
dec $8A89 ; patch - don't decrease time
beq no_hook ; always
hook_E
dec $6D12 ; patch - don't decrease time
dec $8B7D ; patch - don't decrease time
dec $8EA1 ; patch - don't decrease time
beq no_hook ; always
hook_D
lda #0
sta $768A ; patch - don't decrease time
sta $867B ; patch - don't decrease time
sta $9098 ; patch - don't decrease time
beq no_hook ; always
hook_C
dec $6E93 ; patch - don't decrease time
dec $8C7A ; patch - don't decrease time
beq no_hook ; always
hook_B
dec $798E ; patch - don't decrease time
beq no_hook ; always
hook_A
dec $6DCD ; patch - don't decrease time
no_hook
rts
!if * > $3F0 {
!error "code is too large, ends at ", *
}

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2019 by Frank M.
;(c) 2019, 2022 by Frank M., qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/CG",plain
@ -7,14 +7,17 @@
!source "src/prelaunch/common.a"
lda #$60
sta $9DE
jsr $800 ; decompress
+READ_RAM2_WRITE_RAM2
jsr EnableAccelerator
+LOAD_FILE_AT goodnight_cheat, 0
+READ_ROM_NO_WRITE
jmp $300
+LC_REBOOT
lda #8 ; x=45, y=1 here
jmp $B800
goodnight_cheat
!byte goodnight_cheat_e-goodnight_cheat_b
goodnight_cheat_b
!text "PRELAUNCH/CG.CHEAT"
goodnight_cheat_e
!if * > $1C0 {
!error "code is too large, ends at ", *