Keen: Modding Forum Index Keen: Modding
All the modding info you'll ever need
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Complete menu modification!

 
Post new topic   Reply to topic    Keen: Modding Forum Index -> Patches: Marooned on Mars
View previous topic :: View next topic  
Author Message
Dr. Kylstein



Joined: 16 Dec 2009
Posts: 117

PostPosted: Wed Jun 23, 2010 11:59 pm    Post subject: Complete menu modification! Reply with quote

Working from Levellord's patch, I've figured out how to modify several properties of the cursor:
Code:
#first frame of cursor idle animation
%patch $92FB $09 $00
#number of frames in cursor idle animation minus one
%patch $9316 $02 $00

# top menu item
# when moving up
%patch $9331 $00
# when wrapping around from bottom
%patch $9472 $00 $00

# bottom menu item
# when moving down
%patch $9414 $07
# when wrapping from top
%patch $938F $07 $00

#first frame of cursor animation for moving up
%patch $933E $09 $00
#Tile the cursor leaves behind when moving up [blank space]
%patch $9361 $20 $00
#number of frames in cursor animation for moving up minus one
%patch $937E $02 $00
#tile to draw when done sliding upwards
%patch $93B5 $09 $00

#first frame of cursor animation for moving down
%patch $9421 $09 $00
#Tile the cursor leaves behind when moving down [blank space]
%patch $9444 $20 $00
#number of frames in cursor animation for moving down minus one
%patch $9461 $02 $00
#tile to draw when done sliding down
%patch $9498 $09 $00


I've also figured out how to prevent items of the menu from being displayed:
Code:

#disable drawing of menu items
#%patch $9628 $90 $90 $90   #New Game
#%patch $9631 $90 $90 $90   #Continue Game
#%patch $963A $90 $90 $90   #Story
#%patch $9643 $90 $90 $90   #About Id
#%patch $964C $90 $90 $90   #High Scores
#%patch $9655 $90 $90 $90   #Ordering Info
#%patch $965E $90 $90 $90   #Previews!
#%patch $9667 $90 $90 $90   #Restart Demo

which can be combined with Levellord's info and the patch above to shorten the menu:
Code:
%ext ck1
%version 1.31
#Menu box height in lines of text
%patch $9601 $07 $00

# top menu item
# when moving up
%patch $9331 $00
# when wrapping around from bottom
%patch $9472 $00 $00

# bottom menu item
# when moving down
%patch $9414 $04
# when wrapping from top
%patch $938F $04 $00

%patch $9655 $90 $90 $90   #Ordering Info
%patch $965E $90 $90 $90   #Previews!
%patch $9667 $90 $90 $90   #Restart Demo

%end

Note that removing an item from the middle causes the labels to shift up, but not the functions.

I can change the functions of the menu items and even make a new game start after any of them. (with the limitation that the function replaced may become inaccessible.) Unlike Levellord's attempt, which only worked through the benevolence of the computer pixies, my way is reliable and works for nearly anything. However, it's a different patch for every item pair, so I will only post particular replacements by request.
Back to top
View user's profile Send private message
levellass



Joined: 11 Oct 2006
Posts: 2044
Location: Ngaruawahia New Zealand

PostPosted: Wed Jul 28, 2010 4:07 am    Post subject: Reply with quote

How does your method work? I am working on adding menu support to Startext, so a modder could start with a blank menu and add the items and only the items they wanted, as well as resizing the menu to their liking.

Currently of course I can only stop items, not remove them entirely so I am interested in your methods. I would have assumed it would simply be a case of changing the pointers to various menu functions, making say the New Game pointer point to Story instead, which should be a simple two-byte patch.
Back to top
View user's profile Send private message
Dr. Kylstein



Joined: 16 Dec 2009
Posts: 117

PostPosted: Wed Jul 28, 2010 6:51 pm    Post subject: Reply with quote

I actually haven't been able to track down the pointer table, which would be the ideal way to do it. I just insert a jump at the destination to change the function and modify the return value to make it start a new game.

Edit: Breaking news! I have found the jump table! The reason this was so hard to find was that it was addressed with a negative value:
Code:

jmp  near word cs:[bx-6A13]

bx is the current menu item times two, so item 0 makes the pointer equal to -6A13, which is not a valid address. However, in two's compliment that is equal to 95ED, which turns out to be the actual address of the table. Here's the patch, just swap the values around to re-arrange things:
Code:

%patch $95ED
  $9570W # New Game
  $9577W # Continue Game
  $957FW # Story
  $9589W # About ID...
  $9596W # High Scores
  $95A3W # Ordering Info
  $95B5W # Previews!
  $95C2W # Restart Demo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Keen: Modding Forum Index -> Patches: Marooned on Mars All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group