Jump to content
Atarius Maximus

Montezuma's Revenge Hack Question - Answered! :)

Recommended Posts

Help!

 

I set out to make a simple "unlimited lives" hack of Montezuma's Revenge, as I see there's something already listed in the commented source code (see below) that allows for this. See the line "Change second byte ... for immortality mode"? I don't understand exactly what needs to be changed -- and it also seems that any changes I do make to this source results in an unplayable bin. :( I'm guess I'm just having bad luck with this one, and thought someone else might have an idea of how to implement this change. Any help would be appreciated!

 

LB5DF	LDX	#$0C
DEC	Z00BA; decrement number of lives
LDA	Z00BA; redundant load?
BPL	LB5ED; branch if lives left
INC	Z00BA; keep number of lives positive?
LDA	#$06; next Z0082 state = 5 (game over)
BNE	LB5EF; <-- CHANGE SECOND BYTE ($05EC) TO $00 FOR IMMORTALITY MODE

LB5ED	LDA	#$02; next Z0082 state = 2
LB5EF	STA	Z00E4
STX	Z00B7
LDA	#$06; set Z0082 state = 6
BNE	LB5BA; branch always taken

 

Thanks!

 

AM

Montezuma__s_Revenge_Source.zip

Edited by Atarius Maximus

Share this post


Link to post
Share on other sites
Help!

 

I set out to make a simple "unlimited lives" hack of Montezuma's Revenge, as I see there's something already listed in the commented source code (see below) that allows for this.  See the line "Change second byte ... for immortality mode"?  I don't understand exactly what needs to be changed -- and it also seems that any changes I do make to this source results in an unplayable bin. :(  I'm guess I'm just having bad luck with this one, and thought someone else might have an idea of how to implement this change.  Any help would be appreciated!

 

LB5DF	LDX	#$0C
DEC	Z00BA; decrement number of lives
LDA	Z00BA; redundant load?
BPL	LB5ED; branch if lives left
INC	Z00BA; keep number of lives positive?
LDA	#$06; next Z0082 state = 5 (game over)
BNE	LB5EF; <-- CHANGE SECOND BYTE ($05EC) TO $00 FOR IMMORTALITY MODE

LB5ED	LDA	#$02; next Z0082 state = 2
LB5EF	STA	Z00E4
STX	Z00B7
LDA	#$06; set Z0082 state = 6
BNE	LB5BA; branch always taken

 

Thanks!

 

AM

991436[/snapback]

 

On source that perhaps isn't fully disassembled and/or tight on room, you can make a game unplayable by not having the exact number of bytes in the generated bin file. This happens where code is using indirect addressing to look up something in a table for instance and the address isn't using a label. If the table address moves the code will be loading from the wrong location.

 

Adding or subtracting code can also shift around the code can cause problems if some cycle sensitive code is moved so that it 'wraps' around a 256 byte boundary, which can cause branches to take an extra cycle.

 

So in the above example you could replace the DEC Z00BA with NOP NOP (each on it's own line) or you could follow the author's advice and replace the BNE with .byte $D0, $00. The machine code for BNE is $D0 and $00 would be the branch offset.

 

You could also do this (use a label for the BNE that's on the next line)

 

       BNE LB5ED; <-- CHANGE SECOND BYTE ($05EC) TO $00 FOR IMMORTALITY MODE
LB5ED   LDA #$02       ; next Z0082 state = 2

 

In general if you are hacking with source, you are best to replace the bytes you remove with NOP but keep in mind that this could increase the # of cycles and cause graphical glitches.

Edited by djmips

Share this post


Link to post
Share on other sites

Oh and also, since Montezuma's revenge uses E0 (8K Parker Brothers) bankswitching, you'll have to set up a stella.pro for your modified binary. In Z26 you will need to run with -g3 (8K Parker Brothers)

 

That's probably your real problem... :D

Share this post


Link to post
Share on other sites
Oh and also, since Montezuma's revenge uses E0 (8K Parker Brothers) bankswitching, you'll have to set up a stella.pro for your modified binary. In Z26 you will need to run with -g3 (8K Parker Brothers)

 

That's probably your real problem...  :D

991516[/snapback]

Or you can use the '-type' commandline argument for Stella. So doing 'stella -type e0 ROM_NAME' would work. Of course you can create a new stella.pro entry if you want, but that would be extra, unnecessary work. And even if you want to, it can be done directly within Stella.

 

There's absolutely no reason whatsoever to create a stella.pro entry from scratch again. There are commandline arguments to set each property entry, and when you are finally ready to create a .pro entry (when a ROM is to be distributed to the general public), it can be done with the GUI in Stella.

Share this post


Link to post
Share on other sites
Oh and also, since Montezuma's revenge uses E0 (8K Parker Brothers) bankswitching, you'll have to set up a stella.pro for your modified binary. In Z26 you will need to run with -g3 (8K Parker Brothers)

 

That's probably your real problem...  :D

991516[/snapback]

 

I had the same problem. I forget which byte I changed, but a single byte hack will allow unlimited lives quite easily; without the proper bank-switch option, though, the cart won't work.

 

BTW, idea for future Z26 enhancement: when selecting something a bank-switch scheme based upon a cartridge's MD5sum, output the fact to STDOUT (e.g. "Auto-selecting -g3 bankswitching".

 

Additional idea: Don't bother trying to run zero-byte .bin files. :)

Share this post


Link to post
Share on other sites
Help!

 

I set out to make a simple "unlimited lives" hack of Montezuma's Revenge, as I see there's something already listed in the commented source code (see below) that allows for this.  See the line "Change second byte ... for immortality mode"?  I don't understand exactly what needs to be changed -- and it also seems that any changes I do make to this source results in an unplayable bin. :(  I'm guess I'm just having bad luck with this one, and thought someone else might have an idea of how to implement this change.  Any help would be appreciated!

Oh, and one other thing I forgot to mention. If you're just editing a single byte, you could have done it from directly within the Stella debugger. Just load the ROM, enter the debugger and go the RomWidget (disassembly view). Find the line of code you want to change, and double click on it. Then you can type in hex code (sorry, you can't currently use equates, since there's no built-in assembler). Then right-click on the disassembly and choose 'Save ROM'.

Share this post


Link to post
Share on other sites

Thank you to everyone who commented. I got it to work by changing the DEC Z00BA to a NOP NOP, and then running it in Stella 2.0.1 using the "-type e0" option (stella.exe -type e0 romname.bin). It won't work unless you launch it with that option from the command line, which I think was my problem from the beginning.

 

AM

Montezuma_Trainer__use__type_e0_.bin

Share this post


Link to post
Share on other sites
Thank you to everyone who commented.  I got it to work by changing the DEC Z00BA to a NOP NOP, and then running it in Stella 2.0.1 using the "-type e0" option (stella.exe -type e0 romname.bin).  It won't work unless you launch it with that option from the command line, which I think was my problem from the beginning.

 

AM

993213[/snapback]

And in that case, once you've finished hacking the ROM, you can create/add an entry to your properties file. Just use the above commandline, and once into the game enter the options menu and click 'Game Properties'. Then change anything you like (perhaps give the ROM a new name), then click 'OK'. If you exit Stella and start again (without using the '-type e0' setting), it should still work fine, and automatically use the E0 type.

 

Incidentally, all of this could have been accomplished directly within Stella (if you didn't happen to have source code) by making use of the RAM searcher, 'trapwrite' command, and RomWidget patcher.

 

Edit: And in the next version of Stella, you'll have two other alternatives to accomplish the same thing, without having to edit the ROM at all:

 

1) Ability to add RAM-based per-frame cheats, which are cheats that are evaluated each frame and modify RAM in some way. So you could add the cheat 'ba05', which means put a '5' in address 0xba each frame.

 

2) Use a 'cheetah' cheat (http://members.cox.net/rcolbert/chtdox.htm). The relevant cheat would be 'XXXea1', where XXX is the address of where the 'DEC 00ba' command was located. This would insert two NOP's, starting from the given address.

Edited by stephena

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...