Stunts Forum

Stunts - the Game => Stunts Modification Projects => Topic started by: Daniel3D on May 30, 2021, 11:23:13 AM

Title: Menu buttons
Post by: Daniel3D on May 30, 2021, 11:23:13 AM
Yesterday I was going through the restunts data looking for the main menu.
I found the part that cycles through the button selection https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/asmorig/seg000.asm#lines-496 (https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/asmorig/seg000.asm#lines-496)

This part is difficult to edit right now.

But I also found the highlighted squares with their coordinates. That could be changed by CAS.
https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/asmorig/dseg.asm#lines-2141 (https://bitbucket.org/dreadnaut/restunts/src/master/src/restunts/asmorig/dseg.asm#lines-2141)

Also the default car selection was found. But not all checks for the file.
https://bitbucket.org/dreadnaut/restunts/src/aa1e714a66f8f9bd0d78bb1c0c3ab6b69252721d/src/restunts/asmorig/seg000.asm#lines-7329 (https://bitbucket.org/dreadnaut/restunts/src/aa1e714a66f8f9bd0d78bb1c0c3ab6b69252721d/src/restunts/asmorig/seg000.asm#lines-7329)

That together made the Ferrari edition possible.

@CAS. Can you give some explanation on the technical side of this?
Title: Re: Menu buttons
Post by: Cas on May 30, 2021, 11:15:33 PM
Sure!

Daniël found in the assembly code the section were the main menu buttons are, that is, where the rectangular borders are drawn and the mouse cursor is detected. He asked me if it was possible to change this so that the buttons would all be at the bottom of the screen with a certain size. I told him there was no need to recompile the source to do this. I looked up the integer sequence in the binary and quickly found it. Then I proceeded to change the values to the new ones following what Daniël needed. This worked very well!  We only had to exchange two of them, but it was OK.

Then the other problem was that the Countach was the default car and it's not a Ferrari, so we had to remove it, but Stunts refuses to run without it. So I looked up for "coun" in the binary and found it, but changing it didn't seem to work. Daniël found in the ReStunts code that there was a location where the letters are entered one by one. I had to make a small program to find this location in the binary, but it worked too. That set the Ferrari GTO as the default car, but the Countach was still required to be present.

Finally, after several ideas, I found that there was yet another instance of the text "carcoun" in the file that I had not seen. I realised because Daniël showed me another piece of the source and it had this text, but was different from the previous one. After changing that, all was fine.

Everything regarding graphics has been done by Daniël, who has been updating the original files to accommodate the new imagery. There isn't much software engineering here. It's mostly debugging. Imagine how much can be done when we have the ability to plug-in new code!