Code: Select all
%ext ck1
%version 1.31
################ Tuner Patch ###############
#-Alters a word variable in the code segment when the up/down arrows are pressed.
#-To alter something in another segment replace '$2E' in the base patch
#-To invert up/down keys, swap $7F in the third row and $7C in the fourth row,
# and swap the min/maxvalues/deltas
#BASE PATCH - place this before CONSTANTS
#Skip diagonal-key checking
%patch $55EF $EB $4A #jmp short 0x563B
#Disable vorticon border flash
%patch $4A45 $C3
#tuning code
%patch $55F1
$2E $A1 $00 $00 $8B $1E $CA $7F
$D1 $E3 $2E $FF $A7 $00 $00 $3D
$00 $00 $7F $16 $05 $00 $00 $EB
$0D $3D $00 $00 $7C $0C $05 $00
$00 $EB $03 $B8 $00 $00 $2E $A3
$00 $00 $E9 $00 $00
#jump table
%patch $4A48
$00 $56 $00 $56 $14 $56 $0A $56
$0A $56 $0A $56 $14 $56 $00 $56
$14 $56
#CONSTANTS - Pick one block to tune a value in game (A jmp to $55F1 is required, they are included in these examples)
#1. Pogo Jetpack
%patch $55F3 $5B $3F #VALUE_W (word in memory to be altered)
%patch $5619 $5B $3F
%patch $55FE $48 $4A #JUMPTABL_W (offset of jump table in code segment)
%patch $5601 $20 $00 #MAXVAL_W (maximum value; when up arrow pressed)
%patch $5606 $04 $00 #UPDELTA_W (rate of upwards change)
%patch $560B $C0 $FF #MINVAL_W (minimum value; when down arrow pressed)
%patch $5610 $FC $FF #DOWNDELTA_W (rate of downward change)
%patch $5615 $F2 $FF #DEFAULT_W (default vlaue; when no up or down pressed)
%patch $561C $32 $E9 #EXIT_W (jmp near at end of tuner patch)
#This is the jump to $55F1
%patch $3F49 $E9 $A5 $16
##############################################
#2. Adjustable Raygun Angle
%patch $55F3 $EE $46 #VALUE_W
%patch $5619 $EE $46
%patch $55FE $48 $4A #JUMPTABL_W
%patch $5601 $40 $00 #MAXVAL_W
%patch $5606 $40 $00 #UPDELTA_W
%patch $560B $C0 $FF #MINVAL_W
%patch $5610 $C0 $FF #DOWNDELTA_W
%patch $5615 $00 $00 #DEFAULT_W
%patch $561C $1D $00 #EXIT_W
#This constitutes the jump to $55F1
%patch $55EF $90 $90
%end