Keen 5 Main Menu

Request patches for Keens 4-6.
Post Reply
Dave216
Posts: 19
Joined: Thu Apr 14, 2022 8:33 am

Keen 5 Main Menu

Post by Dave216 »

I've been trying to make a black main menu background in Keen 5 with the usual light green letters to work by making a copycat patches out of the existing ones found on the wiki. So far, I did manage to achieve a certain result, but not without issues... Moving the cursor switches menu sections back to black. I am aware that this is mentioned on the wiki, but I can't seem to fix the problem. Altering the colors doesn't seem to help much. Anyway, here's the patches I dug out. Am I missing something?

################################################
#COPYCAT PATCHES
################################################


########
#MAIN MENU
#######
%patch $1B964 $B0 $10 $50 #Background 1
$B0 $10 $50 #Background 2
$B0 $9F $50 #Width of background box

%patch $1B9A4 $02 # SelectedText Color

%patch $1B9AB $0A #Unselected Text Color
%patch $1B9D1 $0F #Unknown Text Color
%patch $1BAB2 $0A #Top line color
%patch $1BA5F $0A #Bottom line color
%patch $1B9DE $02 #Menu bottom text color



#Save & Load Box Color
%patch $1CE45 $0000W #Box Color


########
#FIXING PADDLE WAR(from Valentine Bash)

%patch $1D598 $0000W #B background color

%patch $1D5D3 $0000W #PP background color


%patch $1D60B $0000W #CP background color

%patch $1D160 $0000W #background color C

%patch $1D1A2 $0000W #background color P

%patch $1D2EE $0000W #background color 2(Only seen when you score a goal)

#################

#OPTION MENU CONTROLS
%patch $1C4AC $B0 $10 $50 #Background 1
$B0 $10 $50 #Background 2
$B0 $9F $50 #Width of background

#################
Dave216
Posts: 19
Joined: Thu Apr 14, 2022 8:33 am

Re: Keen 5 Main Menu

Post by Dave216 »

Any chance anyone can help me with this? If not I'll just use regular colors instead.
nwe74
Posts: 11
Joined: Mon Jul 18, 2022 7:46 pm

Re: Keen 5 Main Menu

Post by nwe74 »

The menu color values (background color, highlighted and non-highlighted text) are used at several locations in the code. Apparently, some of them are missing from the Patches section of KeenWiki (I assume that you have collected the patches from there.)

With the help of K1n9_Duk3's excellent source code reconstruction (https://pckf.com/viewtopic.php?t=11505) I created a complete list of the addresses in the executable file where the menu color values are used. The list also includes the patches found in your previous post (but in a different order).

Code: Select all

# ** Highlighted text color **

# Note: the color that will appear in the game menu is the following
# value XOR (exclusive OR) the color of the background.
# By default, $2 (value) XOR $8 (background) = $A i.e. light green.

%patch $1B9A4  $02  # Text, in USL_DrawItem
%patch $1BE0A  $02  # Text, in USL_CtlDialog
%patch $1C2D9  $02  # Text, in USL_CKSetKey
%patch $1C4E1  $02  # Text, in USL_KeyCustom
%patch $1C60E  $02  # Text, in USL_CJDraw
%patch $1CB29  $02  # Text, in USL_JoyGCustom
%patch $1CB3A  $02  # Text, in USL_JoyGCustom
%patch $1CC11  $02  # Text, in USL_DrawFileIcon
%patch $1CF4D  $02  # Text, in USL_DoSaveGame
%patch $1D14F  $02  # Text, in USL_DrawPongScore

# ** Non-highlighted text color **

# Similar to the non highlighted text color.
# By default, $A XOR $8 = $2 i.e. dark green.

%patch $1B9AB  $0A  # Text, in USL_DrawItem
%patch $1B9DE  $0A  # Text, in USL_DrawBottom
%patch $1BE66  $0A  # Text, in USL_CtlDialog
%patch $1C294  $0A  # Text, in USL_CtlDialog
%patch $1C4E5  $0A  # Text, in USL_KeyCustom
%patch $1CC15  $0A  # Text, in USL_DrawFileIcon

# ** Line and rectangle border colors **

# XOR not used here, color will be $A i.e. light green by default.

%patch $1BA5F  $000Aw  # Bottom line, in USL_DrawBottom
%patch $1BAB2  $000Aw  # Top line, in USL_DrawCtlPanelContents

%patch $1BC13  $000Aw  # Border, in USL_DialogSetup
%patch $1BC2E  $000Aw  # Border, in USL_DialogSetup
%patch $1BC4C  $000Aw  # Border, in USL_DialogSetup
%patch $1BC67  $000Aw  # Border, in USL_DialogSetup
%patch $1BE41  $000Aw  # Line, in USL_DialogSetup

%patch $1D694  $000Aw  # Line, in USL_PongCustom
%patch $1D6AC  $000Aw  # Line, in USL_PongCustom

# ** Background color **

# Note: The "Background color" patches are not required if the default 
# background color (dark gray, $8) is used.

# Note: The comment is incorrect in the original patch.
# The first $08 is the background color, the second is the
# height of the rectangle.
# (Rectangle fill, in USL_DrawItem)
%patch $1B964 $B0 $08 $50 $B0 $08 $50 $B0 $9F $50

%patch $1BBF9  $0008w  # Rectangle fill, in USL_DialogSetup
%patch $1C31F  $0008w  # Rectangle fill, in USL_CKSetKey

# Note: The first $08 in the following patch is the 
# background color, see above
# (Rectangle fill, in USL_KeyCustom)
%patch $1C4AC $B0 $08 $50 $B0 $08 $50 $B0 $9F $50

%patch $1C533  $0008w  # Rectangle fill, in USL_CKSetKey
%patch $1C5ED  $0008w  # Rectangle fill, in USL_CJDraw
%patch $1C925  $0008w  # Rectangle fill, in USL_CGDraw
%patch $1CE45  $0008w  # Rectangle fill, in USL_LoadCustom
%patch $1CF4F  $0008w  # Rectangle fill, in USL_DoSaveGame

%patch $1D160  $0008w  # Rectangle fill, in USL_DrawPongScore
%patch $1D1A2  $0008w  # Rectangle fill, in USL_DrawPongScore
%patch $1D2EE  $0008w  # Rectangle fill, in USL_PlayPong
%patch $1D598  $0008w  # Rectangle fill, in USL_PlayPong
%patch $1D5D3  $0008w  # Rectangle fill, in USL_PlayPong
%patch $1D60B  $0008w  # Rectangle fill, in USL_PlayPong

# Note: At the following 3 locations, the code calculates the current value 
# of font color variable XOR the background color is used. A different patch 
# may be required depending on the colors used. By default, this is the 
# same as the background color ($8).

%patch $1C2FC  $0008w  # Rectangle border, in USL_CKSetKey
%patch $1C510  $0008w  # Rectangle border, in USL_KeyCustom
%patch $1CC1C  $0008w  # Rectangle border, in USL_DrawFileIcon
I hope this will help. I can also help you finding the values for some of the patches, but I need to know what colors you want to use.
Dave216
Posts: 19
Joined: Thu Apr 14, 2022 8:33 am

Re: Keen 5 Main Menu

Post by Dave216 »

Yes!! Thank you!!! I've changed all the values to preferred colors and I got the wanted result! I really thought I could figure it out, but after seeing your patch, I can see I wasn't even close. Thank you!
Post Reply