Stuff Keen has at game start and difficulty

Request patches for Keens 4-6.
Post Reply
User avatar
Bubzrulz
Posts: 208
Joined: Thu Dec 22, 2016 12:37 pm
Location: N.S.W AUSTRAILA

Stuff Keen has at game start and difficulty

Post by Bubzrulz »

so i have found the patches for new games and what keen starts with, used in my demo but thats general (same for every difficulty) can u patch it so each difficulty has different stuff at start for keen 4 5 6
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Stuff Keen has at game start and difficulty

Post by levellass »

This patch sacrifices the F10-V cheat (Come on now, who uses that?) to allow you to set many, many variables for each difficulty.

The first thing to notice is that there are three variables you can set for *all* games of *any* difficulty. By default these are the Extra Keen At and lives. If you change these in the New Game section then the 'global' values will be overwritten.

The New Game code has four sections. The first checks the difficulty and sends the game to one of three sections. Each of the three sections is made up of six-byte commands that get a value, then set it. In this example ammo is set to 10, 5 or 2 depending on difficulty. In this example only one variable differs between difficulties. To add more simply add another $B8 $xxxxW $A3 $yyyyW to each section. When you do this the value after $74 will increase by 6 and the value after $77 must increase by $C (12) An example of this is shown in the Keen 5 and Keen 6 versions, which change more variables.

Code: Select all

#Disable Add VBLs (Free $76DB-$7760)
%patch $76D8 $E9 $0086W

#Stuff all games will have
%patch $5CBB $7A56W $0000W #Extra Keen at score (High word)
%patch $5CC1 $7A54W $4E20W #Extra Keen at score (Low word)
%patch $5CC7 $7A6AW $0003W #Lives (3)

#Call new game code
%patch $5CCB $9A $06BD0B0BRL $5D $CB

#New game code -check difficulty
%patch $76DB $55 $8B $EC $83 $3E $474AW  $02 $74 $0A $77 $10

#First section, easy stuff
             $B8 $000AW  $A3 $7A58W  $5D $CB

#Second section, normal stuff
             $B8 $0005W  $A3 $7A58W  $5D $CB

#Third section, hard stuff
             $B8 $0002W  $A3 $7A58W  $5D $CB

Code: Select all

#Disable Add VBLs (Free $7690-$7715)
%patch $768D $E9 $0086W

#Stuff all games will have
%patch $5C8F $6F54W $0000W #Extra Keen at score (High word)
%patch $5C95 $6F52W $4E20W #Extra Keen at score (Low word)
%patch $5C9B $6F6AW $0003W #Lives (3)

#Call new game code
%patch $5C9F $9A $06B90B00RL $5D $CB

#New game code -check difficulty
%patch $7690 $55 $8B $EC $83 $3E $3D66W  $02 $74 $10 $77 $1C

#First section, easy stuff
             $B8 $000AW  $A3 $6F56W  $B8 $0050W  $A3 $6F58W  $5D $CB

#Second section, normal stuff
             $B8 $0005W  $A3 $6F56W  $B8 $0028W  $A3 $6F58W  $5D $CB

#Third section, hard stuff
             $B8 $0002W  $A3 $6F56W  $B8 $000AW  $A3 $6F58W  $5D $CB

Code: Select all

#Disable Add VBLs (Free $74B0-$7535)
%patch $74AD $E9 $0086W

#Stuff all games will have
%patch $5A8F $758EW $0000W #Extra Keen at score (High word)
%patch $5A95 $758CW $4E20W #Extra Keen at score (Low word)
%patch $5A9B $75A6W $0003W #Lives (3)
%patch $5AA1 $7590W $0005W #Ammo (5)

#Call new game code
%patch $5A9F $9A $069A0B10RL $5D $CB

#New game code -check difficulty
%patch $74B0 $55 $8B $EC $83 $3E $414AW  $02 $74 $10 $77 $1C

#First section, easy stuff
             $B8 $000AW  $A3 $7590W  $B8 $0050W  $A3 $7592W  $5D $CB

#Second section, normal stuff
             $B8 $0005W  $A3 $7590W  $B8 $0028W  $A3 $7592W  $5D $CB

#Third section, hard stuff
             $B8 $0002W  $A3 $7590W  $B8 $000AW  $A3 $7592W  $5D $CB
Last edited by levellass on Sun Mar 26, 2017 4:50 am, edited 1 time in total.
User avatar
Bubzrulz
Posts: 208
Joined: Thu Dec 22, 2016 12:37 pm
Location: N.S.W AUSTRAILA

Re: Stuff Keen has at game start and difficulty

Post by Bubzrulz »

so if i get that right lives are set for all games the same ? any way to change that too on each difficulty also it only changes the value of ammo u collect from each item all start at 0? this is just for the k4 one k6 works well for the ammo at start
User avatar
Bubzrulz
Posts: 208
Joined: Thu Dec 22, 2016 12:37 pm
Location: N.S.W AUSTRAILA

Re: Stuff Keen has at game start and difficulty

Post by Bubzrulz »

i was making new patchfile/bat file so i can go straight to test level and no matter what i changed the game start patch that i had to add to new patch file

Code: Select all

#Keen starts game in the test (11)
%patch $5CBB $7A68W $000BW  
so i deleted this whole what keen has at new game patch and it worked am i able to fix this or is this just something i will have to deal with if i wanta go straight to another level instead of 0 not a big issue with this mod tho
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Stuff Keen has at game start and difficulty

Post by levellass »

The patch overwrites the 'start in level x' test patch since a lot of 'permanent' patches will ignore testing stuff. However you can add it to the patch like this:

Code: Select all

#TEST: Keen starts in Level 11 (OVERWRITES LIVES!)
%patch $5CB7 $7A68W $000BW  

That lets you use the test, but stops Keen's lives being set.
Post Reply