Jump to content
IGNORED

OUTATIME (Dragster Hack)


keebz

Recommended Posts

Patch $f357 to be $c0 instead of $b3 to make the timer display the speed in place of seconds

Can you help me understand this better. My assembly knowledge is non-existent.

 

UPDATE:

 

Never mind I figured out what you said. It's way to early without coffee for me.

 

I'd love to get to a place where it vanished in a flash at 88mph but I have no idea how to alter game play like that. For instance, how did you know that f357 did that when changed to b3?

 

Ideally, I'd like to slow the car down and make it hard to get to 88mph without blowing. Take out the decimal read out. And make the vehicle flash out if hit 88mph. But I have no idea even where to start.

 

I'd be happy to just get the car to slow the car down and make it hard to get to 88mph without blowing. Take out the decimal read out.

Edited by keebz
Link to comment
Share on other sites

how did you know that f357 did that when changed to b3?

 

First I used ~ to open the stella debugger at different times during play. Watching the RAM values change as I did allowed me to spot $b3 as the variable for 1st player time in seconds and $c0 as the speed of the 1st player. Then I used "trapread $b3" to find the places where the time in seconds is read from. The assumption here is that the code which displays the time must first read its value from RAM. Sure enough it breaks around $f357. Looking at the disassembly in the debugger it's easy to spot the $b3 used to indicate where it's reading from. Then it's just a matter of changing that to the speed variable instead.

 

I think the next step would be to find the code that loads the subsecond portion of the timer and then hardcode it to point to graphics data for "mph". To make things easier, you probably would want to disassemble the rom to an asm file so you can make changes in assembly instead of patching bytes in the bin file. I'd also bump it up to a 4k game so you don't have to worry about squeezing in new graphic data. There are several tools you can use to generate the asm file. Just search for 6502 disassembler and find one you like. Then you'll need dasm to assemble it back into a bin. Make sure you have disassemble and reassemble working before you make any changes.

Link to comment
Share on other sites

 

First I used ~ to open the stella debugger at different times during play. Watching the RAM values change as I did allowed me to spot $b3 as the variable for 1st player time in seconds and $c0 as the speed of the 1st player. Then I used "trapread $b3" to find the places where the time in seconds is read from. The assumption here is that the code which displays the time must first read its value from RAM. Sure enough it breaks around $f357. Looking at the disassembly in the debugger it's easy to spot the $b3 used to indicate where it's reading from. Then it's just a matter of changing that to the speed variable instead.

 

I think the next step would be to find the code that loads the subsecond portion of the timer and then hardcode it to point to graphics data for "mph". To make things easier, you probably would want to disassemble the rom to an asm file so you can make changes in assembly instead of patching bytes in the bin file. I'd also bump it up to a 4k game so you don't have to worry about squeezing in new graphic data. There are several tools you can use to generate the asm file. Just search for 6502 disassembler and find one you like. Then you'll need dasm to assemble it back into a bin. Make sure you have disassemble and reassemble working before you make any changes.

 

I have so much to learn. I only understood about 1/5 of this but I'll keep digging. Maybe I can start by finding the decimal times and whatever sets the rate of speed. Hopefully without getting into assembly... I looked at the asm with distella and it's not even greek... it's wingdings to me.

 

 

Link to comment
Share on other sites

To make things easier, you probably would want to disassemble the rom to an asm file so you can make changes in assembly instead of patching bytes in the bin file. I'd also bump it up to a 4k game so you don't have to worry about squeezing in new graphic data. There are several tools you can use to generate the asm file. Just search for 6502 disassembler and find one you like. Then you'll need dasm to assemble it back into a bin. Make sure you have disassemble and reassemble working before you make any changes.

 

If the ROM is 4K or less (which it obviously is), then you can save the disassembly directly from Stella itself. It will generate a more detailed ASM file than Distella ever could, since it takes runtime info into account. Make sure to use the latest release (5.1) for even more improvements in the disassembly output.

 

EDIT: Here's the output from Stella 5.1 after playing for a little while.

Dragster_disassembly.zip

  • Like 1
Link to comment
Share on other sites

6502 assembly isn't as bad as it first looks. Give this a read and it should be enough to get you started. http://www.atariage.com/2600/programming/2600_101/03first.html

 

When you get stuck just post the asm file and explain what you're trying to do, what you've done, and what you can't get to work.

 

Btw, a lot of the variables are outlined here but you have to add $80 to them to get the actual address because he's listed them as offsets from $0080.

 

Don't forget you can change RAM values directly in stella. So an easy way to verify a variable is to change it's value and see if it effects the game as expected. Just don't forget that the game may overwrite your changed value.

Link to comment
Share on other sites

6502 assembly isn't as bad as it first looks. Give this a read and it should be enough to get you started. http://www.atariage.com/2600/programming/2600_101/03first.html

 

When you get stuck just post the asm file and explain what you're trying to do, what you've done, and what you can't get to work.

 

Btw, a lot of the variables are outlined here but you have to add $80 to them to get the actual address because he's listed them as offsets from $0080.

 

Don't forget you can change RAM values directly in stella. So an easy way to verify a variable is to change it's value and see if it effects the game as expected. Just don't forget that the game may overwrite your changed value.

Using stella I can see that B5 and B6 are what is writing the milliseconds to player 1 and player 2. This reads as Ram_b5/b6 but I can't find that for the life of me. Not that it isn't there, I just don't know what to do next with this information.

 

I'm reading the stella debugger manual now, not getting very far. But ill keep going

 

 

Link to comment
Share on other sites

If you're reading the debugger manual to understand how the debugger itself works, then great. But TBH, if you're reading it to understand the debugging process, then it won't help very much (the manual is written assuming you already have this knowledge). So better to concentrate for now on general programming and debugging process, as indicated in the links by ZackAttack above.

Link to comment
Share on other sites

I've spent a huge chunk of my day trying to understand this and research and googling... Gotta admit it's way over my head. What I have found, I know that it is on Ram_B5,B6 and located at F354.

What I don't know... How to increase from 2k to 4 k

Take that space and make the bites available as MPH

and point F354 to it and just turn off the decimals.

Sorry, if this is too newb for everyone. I'd love to make this project work but I'm just not tracking with these tutorials.

Edit: I was able to get the miliseconds to read 00 by setting Ram_b5 to $ea $ea

Now it just shows .00 with no change at the moment.

Edited by keebz
Link to comment
Share on other sites

Graphic pointers are derived from ram_b3 and ram_b5. Values outside the range 00-99 produce other parts of the display such as blown and early. Fortunately there was enough room for two more tiles in that ROM page. So I was able to hardcode b5 to $fe and put some place holder graphic data there for you to turn into MPH. (Search the ASM file for MPH to find the spot to edit)

 

It still needs some tweaking to fix the speed. Right now the speed variable counts in binary but displays in BCD, so it jumps all over the place. The speed climbs too fast too, causing you to hit 88MPH way too soon.

 

OUTATIME (by Keebz) - Dragster hack.bin

 

 

OUTATIME (by Keebz) - Dragster hack.asm

  • Like 1
Link to comment
Share on other sites

Graphic pointers are derived from ram_b3 and ram_b5. Values outside the range 00-99 produce other parts of the display such as blown and early. Fortunately there was enough room for two more tiles in that ROM page. So I was able to hardcode b5 to $fe and put some place holder graphic data there for you to turn into MPH. (Search the ASM file for MPH to find the spot to edit)

 

It still needs some tweaking to fix the speed. Right now the speed variable counts in binary but displays in BCD, so it jumps all over the place. The speed climbs too fast too, causing you to hit 88MPH way too soon.

 

attachicon.gifOUTATIME (by Keebz) - Dragster hack.bin

 

 

attachicon.gifOUTATIME (by Keebz) - Dragster hack.asm

I have to much to learn... this is amazing. I spent all day just figuring out how to get the counter to not turn over.

 

Edit: I can't thank you enough for this. Its really helpful to have something to compare.

Edited by keebz
Link to comment
Share on other sites

Graphic pointers are derived from ram_b3 and ram_b5. Values outside the range 00-99 produce other parts of the display such as blown and early. Fortunately there was enough room for two more tiles in that ROM page. So I was able to hardcode b5 to $fe and put some place holder graphic data there for you to turn into MPH. (Search the ASM file for MPH to find the spot to edit)

 

It still needs some tweaking to fix the speed. Right now the speed variable counts in binary but displays in BCD, so it jumps all over the place. The speed climbs too fast too, causing you to hit 88MPH way too soon.

 

attachicon.gifOUTATIME (by Keebz) - Dragster hack.bin

 

 

attachicon.gifOUTATIME (by Keebz) - Dragster hack.asm

Whoa! Thats heavy! I ask for it and it becomes real! ;-) ;)

 

Can the parts that are blacked out be changed to "MPH"?

Link to comment
Share on other sites

Yeah, the blacked out part just needs some mph graphics. I figured I'd leave that up to keebz to do.

 

I wonder if it would take much to add a 5th gear and adjust the max speed in each gear to match the actual delorean: http://www.roadandtrack.com/car-culture/classic-cars/reviews/a27099/1982-delorean-dmc-12-road-test/

Link to comment
Share on other sites

MPH Graphics... Here you go!

Also, I saw you bumped it up to 4K!

If you could help me understand how to point that to a title screen at launch I'd could make a awesome title screen.

There a lot I think could be done with this. The game play needs some tweaking because hitting 88mph basically just means "go into 4th gear and wait"

But its really a great wip!

Hopefully I can work on it some this weekend as well.

OUTATIME (by Keebz) - Dragster hackMPH.bin

  • Like 1
Link to comment
Share on other sites

MPH Graphics... Here you go!

 

Also, I saw you bumped it up to 4K!

 

If you could help me understand how to point that to a title screen at launch I'd could make a awesome title screen.

 

There a lot I think could be done with this. The game play needs some tweaking because hitting 88mph basically just means "go into 4th gear and wait"

 

But its really a great wip!

 

Hopefully I can work on it some this weekend as well.

 

 

Dropping a title screen in should be straight forward. If you want you can just provide a separate asm file for that and I'll stitch them together. What if you have to hit 88pmh before the car travels too far to the right. MPH looks good, but you didn't attach the source file too.

Link to comment
Share on other sites

Dropping a title screen in should be straight forward. If you want you can just provide a separate asm file for that and I'll stitch them together. What if you have to hit 88pmh before the car travels too far to the right. MPH looks good, but you didn't attach the source file too.

Again forgive me for I know not what I do lol.

 

I tried to save the assembly file in stella using savedis in the debugger but I only get an asm file for the current state of the game. I then tried to use distella in the command prompt but it didn't output what I think you are looking for. The format seemed really wrong.

 

Google as I may, and reading the Stella docs... I can't find any explanation as to how I would export the entire assembly file... Still looking

 

update: I have attached what distella is outputting but it isn't right. I think it isn't showing the GFX because I didn't use it properly. Stella's "savedis" exports correctly but only exports the current frame, not the whole game.

 

Is there any documentation on how to do this?

 

 

Update2: I didn't know you had to play the game a bit for it to decode all the GFX and data in order to get the assembly file to correctly save. I don't know if there is a better way to do this, if so I'd appreciate any guidance. But needless to say the new asm file does look a lot better.

 

OUTATIME (by Keebz) - Dragster hackMPH.asm

Edited by keebz
Link to comment
Share on other sites

MPH Graphics... Here you go!

 

There a lot I think could be done with this. The game play needs some tweaking because hitting 88mph basically just means "go into 4th gear and wait"

 

But its really a great wip!

 

Hopefully I can work on it some this weekend as well.

Awesome!!! :thumbsup: :thumbsup: :thumbsup:

Link to comment
Share on other sites

Modifying the bin directly is fine for graphic and very basic hacks. For more complex hacks you should disassemble once and then make changes in the ask file and build a new bin using dasm.

 

That way you can add comments and rename labels as you discover what the code does. It also makes it possible to insert new code and data like I did for MPH.

Link to comment
Share on other sites

Stella's "savedis" exports correctly but only exports the current frame, not the whole game.

 

This makes no sense whatsoever. A disassembly file is for an entire 4K bank, not for a current frame??

 

 

Update2: I didn't know you had to play the game a bit for it to decode all the GFX and data in order to get the assembly file to correctly save. I don't know if there is a better way to do this, if so I'd appreciate any guidance. But needless to say the new asm file does look a lot better.

 

Yes, this is the whole point of using Stella instead of a standalone disassembler. The standalone disassembler has no chance whatsoever, beyond a certain point, of determining what is graphics and what is data. Playing the game in Stella for a while improves the disassembly output, since it finds what is graphics 'on-the-fly'. Its dynamic/runtime approach is better than a static approach you would get when using a standalone disassembler.

 

There is no way around this; this is the whole point of dynamic disassembly. At some point you could create distella 'config' files to more properly inform the built-in disassembler in Stella, but TBH this is getting quite complex, and you'd have to read up a little more on how Distella works.

Link to comment
Share on other sites

What if you have to hit 88pmh before the car travels too far to the right.

I've been thinking about this. Since the data is there and the space is bumped up, I kinda wonder if maybe we don't do a title screen and instead show both the time and speed and it becomes the fastest to 88MPH, Using the extra space to create a GFX for a time travel effect?

Link to comment
Share on other sites

Modifying the bin directly is fine for graphic and very basic hacks. For more complex hacks you should disassemble once and then make changes in the ask file and build a new bin using dasm.

 

That way you can add comments and rename labels as you discover what the code does. It also makes it possible to insert new code and data like I did for MPH.

I agree, I'm trying to decipher assembly but man it's still functionally greek to me. I've read and am re-reading the posted tutorials but it's just really cloudy.

 

Not giving up though.

  • Like 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...