Jump to content

Photo

OUTATIME (Dragster Hack)


29 replies to this topic

#1 keebz OFFLINE  

keebz

    Space Invader

  • 19 posts

Posted Sat Feb 10, 2018 4:22 PM

Built my first hack. Here is "OUTATIME"! It is a Back to the Future themed Dragster hack.

Hope you enjoy it and let me know what you think!

-Keebz

 

27748332_10154985621981086_4585182810067517924_o.jpg

Attached Files


Edited by keebz, Mon Feb 12, 2018 3:12 PM.


#2 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Tue Feb 13, 2018 8:23 AM

Shouldn't it disappear with a trail of fire once you hit 88mph?



#3 Arenafoot OFFLINE  

Arenafoot

    Stargunner

  • 1,013 posts
  • videogamestores.net/
  • Location:Watson, LA

Posted Tue Feb 13, 2018 7:14 PM

yeah it needs a MPH scale at the bottom along with the timer, then maybe the max is 88 MPH and the DeLorean disappears, or stays on the screen if the engine blows up



#4 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Wed Feb 14, 2018 10:01 AM

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



#5 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 9:15 AM

I'm still learning to hack. Right now using bit hacker and HOM3... anyone better than me want to help? I'm no Doc Brown and can't do it by myself yet.



#6 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 9:18 AM

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, Thu Feb 15, 2018 9:36 AM.


#7 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Thu Feb 15, 2018 9:47 AM

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.



#8 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 9:53 AM

 

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.

 



#9 stephena OFFLINE  

stephena

    River Patroller

  • 3,117 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Thu Feb 15, 2018 10:08 AM

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.

Attached File  Dragster_disassembly.zip   8.47KB   16 downloads



#10 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Thu Feb 15, 2018 10:22 AM

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



#11 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 11:17 AM

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

 



#12 stephena OFFLINE  

stephena

    River Patroller

  • 3,117 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Thu Feb 15, 2018 12:08 PM

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.



#13 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 2:46 PM

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, Thu Feb 15, 2018 2:58 PM.


#14 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Thu Feb 15, 2018 2:53 PM

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.

 

Attached File  OUTATIME (by Keebz) - Dragster hack.bin   4KB   20 downloads

 

 

Attached File  OUTATIME (by Keebz) - Dragster hack.asm   57.64KB   20 downloads



#15 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Thu Feb 15, 2018 4:16 PM

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, Thu Feb 15, 2018 4:32 PM.


#16 Arenafoot OFFLINE  

Arenafoot

    Stargunner

  • 1,013 posts
  • videogamestores.net/
  • Location:Watson, LA

Posted Fri Feb 16, 2018 1:23 AM

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"?



#17 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Fri Feb 16, 2018 9:06 AM

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.roadandtr...c-12-road-test/



#18 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Fri Feb 16, 2018 4:30 PM

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.

 

Attached Files



#19 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Fri Feb 16, 2018 8:23 PM

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.



#20 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Fri Feb 16, 2018 11:12 PM

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.

Attached File  OUTATIME (by Keebz) - Dragster hackMPH.asm   66.55KB   12 downloads


Edited by keebz, Sat Feb 17, 2018 12:15 AM.


#21 Arenafoot OFFLINE  

Arenafoot

    Stargunner

  • 1,013 posts
  • videogamestores.net/
  • Location:Watson, LA

Posted Sat Feb 17, 2018 1:24 AM

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:



#22 ZackAttack OFFLINE  

ZackAttack

    Dragonstomper

  • 653 posts
  • Location:Orlando, FL US

Posted Sat Feb 17, 2018 6:38 AM

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.

#23 stephena OFFLINE  

stephena

    River Patroller

  • 3,117 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Sat Feb 17, 2018 7:18 AM

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.



#24 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Sat Feb 17, 2018 10:00 AM

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?



#25 keebz OFFLINE  

keebz

    Space Invader

  • Topic Starter
  • 19 posts

Posted Sat Feb 17, 2018 4:02 PM

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.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users