More than you ever wanted to know about the menu

Completed patches for Keen1.
Post Reply
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

More than you ever wanted to know about the menu

Post by levellord »

For too long have we been burdended by the limits of the short text sequences in the menu! We need a way to make text of any length! [Poor Djaser tried to translate the menu into German and ruined it.]

So here is a total breakdown of the menu box, first the size of the box and the pointer speed:

Code: Select all

#Menu pointer vertical speed upwards
%patch $9358 $01 $00
#Tile the pointer leaves behind when moving up [blank space]
%patch $9361 $20 $00
#Menu pointer vertical speed downwards
%patch $943B $01 $00
#Tile the pointer leaves behind when moving down [blank space]
%patch $9444 $20 $00

#Menu box height in lines of text
%patch $9601 $0A $00
#Menu box width in letters
%patch $9605 $12 $00
The box will automatically center itself on the screen. Now for where the text is read from:

Code: Select all

#Text read from: [Text must end in $0A $00]
#Text read relative to $13050, e.g New game text
# read from 13050 + 2E96 = $15EE6
%patch $9625 $96 $2E #New Game
%patch $962E $A3 $2E #Continue Game
%patch $9637 $B5 $2E #Story
%patch $9640 $BF $2E #About Id
%patch $9649 $CF $2E #High Scores
%patch $9652 $DF $2E #Ordering info
%patch $965B $F1 $2E #Previews!
%patch $9664 $FF $2E #Restart demo [Uses 2 $0A $0A in text!]
%patch $966D $11 $2F #Use the
%patch $9686 $1A $2F #Arrows [Using keyboard]
%patch $968B $21 $2F #Mouse [Using mouse]
%patch $9690 $27 $2F #Joystick [Using joystick]
If you increase the values by one, the game will look one ahead for the text and so on, this means you can go find a bit of spare space and use that for longer menu text. Now you can make the menu text as long as you want. This patch makes the box bigger, and uses the space near 'DISK ERROR!' that we're probbably not going to need:

Code: Select all

#Menu box width in letters
%patch $9605 $02 $00 #Make box wider
%patch $9625 $F5 $2A #Begin new game now!
%patch $15B44 "Begin new game now!" $0A $00
The last line we have relocated the text, however, we can also fiddle with the existing texts:

Code: Select all

#Menu text
#The $00 ends the text sequence, the $0A moves down a line
%patch $15EE6 "   New Game" $0A $00
%patch $15EF3 "   Continue Game" $0A $00
%patch $15F05 "   Story" $0A $00
%patch $15F0F "   About ID..." $0A $00
%patch $15F1F "   High Scores" $0A $00
%patch $15F2F "   Ordering Info" $0A $00
%patch $15F41 "   Previews!" $0A $00
%patch $15F4F "   Restart Demo" $0A $0A $00 #moves down two lines]
%patch $15F61 "Use the " $00
%patch $15F6A "arrows" $00
%patch $15F71 "mouse" $00
%patch $15F77 "joystick" $00
As you can see, and as it was in the above patch, each text sequence needs to end with $00 The $0A moves down a line, this is important or your menu will be a mess. With this you can rearrange the menu text, for example, if you replace 'Begin game' with 'start' you don't have to put in all that blank space, and the leftover code can be used for the next piece of text, say 'continue game' can be made into 'Load an old game'

If anyone wants help customizing a menu, just ask and I can construct it for you.
Last edited by levellord on Sat May 27, 2006 4:25 pm, edited 2 times in total.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Woah, this is excellent LL! Luckily for us the Keen code, once again, is pretty advanced, as it centers the window etc..

Anyways, glad to hear modifying menus is this easy, I'm definitely going to do so in my Keen 3 mod.

Just to note everyone, character $0A is dec 10, that is, the new-line character '\n'.
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Heh, I made a teeny mistake, put a 'F' when I mean a '6' fixed now.

Correct KR, those going down a lines are very important.

This is the translated menu for my upcoming mod, it makes the menu slightly wider and one row bigger. Firstly I fitted most of the menu text in where the text normally is, tweaking a few things to deal with the different line lengths. However I wanted to center the 'use the arrows etc' text, which didn't fit anyway, so I put most of it in the DISK ERROR! space. You will notice the 'use the' text has a $0A on it, because ' Benutzen Sie die Joystick' is too wide and makes the menu look odd, so I made the box 1 line higher.

Code: Select all

#Menu box height in lines of text
%patch $9601 $0B $00
#Menu box width in letters [two wider]
%patch $9605 $14 $00
#Menü
%patch $15EE6 "   Start Spiel" $0A $00
%patch $15EF6 "   Lad Status" $0A $00
%patch $15F05 "   Prolog" $0A $00
%patch $15F10 "   Verantwortung" $0A $00
%patch $15F22 "   Spitzeleistungen" $0A $00
%patch $15F37 "   Geschäft" $0A $00
%patch $15F44 "   Verdiensten" $0A $00
%patch $15F54 "   Titelschirm" $0A $0A $00
%patch $15B44 "  Benutzen Sie die " $0A $00 #[Relocated to disk error area]
%patch $15B59 "         " $00
%patch $15B65 "        Maus" $00
%patch $15F65 "      Joystick" $00 #[Uses arrows,mouse text space too]

#Menu text read from:
%patch $962E $A6 $2E #Continue Game [+3 ahead]
%patch $9640 $C0 $2E #About Id [+1 ahead]
%patch $9649 $D2 $2E #High Scores [+3 ahead]
%patch $9652 $E6 $2E #Ordering info [+5 ahead]
%patch $965B $F4 $2E #Previews! [+3 ahead]
%patch $9664 $04 $2F #Restart demo [+5 ahead]
%patch $966D $F4 $2A #Use the [1053 behind, in disk error area]
%patch $9686 $09 $2B #Arrows [1043 behind]
%patch $968B $15 $2B #Mouse [1036 behind]
%patch $9690 $15 $2F #Joystick
Finally, people have asked for help finding box widths, and especially for positioning the boxes in ending sequences. As such I have made a simple numbered grid you can overlay on say, a screenshot to help: http://img.photobucket.com/albums/v499/Nevad/grid.png
Benvolio
Posts: 228
Joined: Sun Aug 29, 2004 4:44 pm
Location: Ireland
Contact:

Post by Benvolio »

Again, pity I didn't have this while translating into Irish.
Post Reply