Author Topic: Attract mode code breakdown  (Read 25604 times)

0 Members and 8 Guests are viewing this topic.

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #30 on: July 19, 2013, 05:20:18 pm »
Yeah, I'm still playing around with it. I think I see a way to save one more move. That should get him up the ladder to the 6th girder. :D

Nice!  Of course, I could just tackle this myself, sparing you the annoyance of a backseat driver.   ;)

« Last Edit: July 19, 2013, 05:30:14 pm by stella_blue »
DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #31 on: July 19, 2013, 05:28:24 pm »
Fkn hell. So close! I need one more jump and one more climb!

DK attract mode reprogrammed 2
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

corey.chambers

  • Guest
Re: Attract mode code breakdown
« Reply #32 on: July 19, 2013, 05:37:42 pm »
Nice video, Jeff! Very cool stuff indeed.

Offline up2ng

  • Senior Member
  • *
  • Posts: 242
    • Awards
Re: Attract mode code breakdown
« Reply #33 on: July 19, 2013, 06:10:42 pm »
Perhaps try using some vertical jumps (80) which seems to require only one byte instead of two, so you can use more than 15 moves.

Of course, I assume that getting to the top Will hang the program like what happened to Corey.  I think the main loop of the software needs to detect a death to be able to exit out of this mode of assuming that subsequent program instructions are user inputs.  So, the program will run to the end of file trying to give inputs to Jumpman and when the end of file is reached the main program loop is caught in an infinite loop, resulting in a software hang.

Still a fun exercise though...
Donkey Kong:  1,206,800  Kill Screen
Donkey Kong:  898,600     16-5
D2K:                 380,200     L=9
Donkey Kong Junior:  In Progress
Member for 11 Years DK 1.2M Point Scorer Winner of a community event Wildcard Rematch Champion Blogger Former DK Level 1-1 World Record Holder Former DK No-Hammer World Record Holder DK 1.1M Point Scorer Former DK World Record Holder - MAME DK 1M Point Scorer DK Killscreener Individual Board Record Holder Twitch Streamer

Jeffw

  • Guest
Re: Attract mode code breakdown
« Reply #34 on: July 19, 2013, 06:28:03 pm »
Really? I post the code and the first thing you guys look at is attract mode?  ::)

I think the real challenge is to see how high you can make Mario climb without any kind of ROM modification. You can use the coin-insert button to manipulate the random number generator and produce any kind of randomness you want. Depending on how Mario behaves after overflowing out of the input table, there is a small chance that it's possible to finish the first screen given the right randomness, so someone might be able to make a TAS that consists only of coin-insert button presses in which Mario finishes the first screen in attract mode. Any takers?

Edit: Ah, never mind. It seems doing a coin-insert causes it to leave attract mode. It still could be possible to finish the first screen given the right randomness but I don't think there's a good way of manipulating the RNG.
« Last Edit: July 19, 2013, 06:32:02 pm by Jeffw »

Offline qnz

  • New Member
  • *
  • Posts: 7
    • Awards
Re: Attract mode code breakdown
« Reply #35 on: July 19, 2013, 06:59:35 pm »
Fkn hell. So close! I need one more jump and one more climb!

I assume you're modifying the ROM bytes that it normally reads to have some other values, so you're limited by space?

Instead, you can probably find an unused part of the ROM with more space available, put your new values there, and then modify the code to point there instead of the original place.


Todd
Member for 11 Years

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #36 on: July 19, 2013, 07:06:20 pm »

Nice!  Of course, I could just tackle this myself, sparing you the annoyance of a backseat driver.   ;)

Ok, give it a shot.

This is what I have:

Code: [Select]
21D1  01 CE ; run right(no duration)
21D3  01 39 ; run right for 206 frames
21D5  04 82 ; climb ladder for 57 frames
21D7  02 55 ; run left for 130 frames
21D9  04 10 ; climb ladder for 85 frames
21DB  81 C0 ; jump right for 16 frames
21DD  04 10 ; climb ladder for 192 frames(big pause at the top)
21DF  82 38 ; jump left for 16 frames
21E1  02 4F ; run left for 56 frames
21E3  04 30 ; climb ladder for 79 frames
21E5  81 74 ; jump right for 48 frames (2 jumps over 2 barrels)
21E7  01 10 ; run right for 116 frames
21E9  81 60 ; jump right for 16 frames
21EB  04 80 ; climb ladder for 96 frames
21ED  02 ; run left for 128 frames


I think it's gonna be very tough to get him all the way to the top with the number of moves available, but it is a neat challenge.
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #37 on: July 19, 2013, 07:08:26 pm »
Perhaps try using some vertical jumps (80) which seems to require only one byte instead of two, so you can use more than 15 moves.


Dean, the long jumps and the straight jumps both only take one byte. The 2nd byte is the duration of the next input.
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #38 on: July 19, 2013, 07:09:44 pm »
Really? I post the code and the first thing you guys look at is attract mode?  ::)


Haha! At least I'm doing SOMETHING with it. ;)
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #39 on: July 19, 2013, 07:11:51 pm »
Fkn hell. So close! I need one more jump and one more climb!

I assume you're modifying the ROM bytes that it normally reads to have some other values, so you're limited by space?

Instead, you can probably find an unused part of the ROM with more space available, put your new values there, and then modify the code to point there instead of the original place.

Todd

Yeah, that will be plan B I guess, but let's see if anyone can fit it in the available space first. :D

Welcome to the forum! :)
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline up2ng

  • Senior Member
  • *
  • Posts: 242
    • Awards
Re: Attract mode code breakdown
« Reply #40 on: July 19, 2013, 07:31:53 pm »
Hmm, using your example, are you sure you can't say

21DB     80     ;
21DC . . .               (Not 21DD)

I'm not really sure if that works, just throwing it out there.
Donkey Kong:  1,206,800  Kill Screen
Donkey Kong:  898,600     16-5
D2K:                 380,200     L=9
Donkey Kong Junior:  In Progress
Member for 11 Years DK 1.2M Point Scorer Winner of a community event Wildcard Rematch Champion Blogger Former DK Level 1-1 World Record Holder Former DK No-Hammer World Record Holder DK 1.1M Point Scorer Former DK World Record Holder - MAME DK 1M Point Scorer DK Killscreener Individual Board Record Holder Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #41 on: July 19, 2013, 07:43:26 pm »
Really? I post the code and the first thing you guys look at is attract mode?  ::)

Yeah, isn't it great?

JC, Mitch and I were discussing our next assignment.  We plan to replace a few sprites, so that players will have more options when entering their initials.

Vincent specifically requested an "E", with an accent grave:

XÈR

It's an exciting project!   ;)

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #42 on: July 19, 2013, 07:44:56 pm »
Hmm, using your example, are you sure you can't say

21DB     80     ;
21DC . . .               (Not 21DD)

I'm not really sure if that works, just throwing it out there.

Not sure if I'm following you, but the 81 at 21DB is the right jump on the 3rd girder that clears a barrel AND puts jumpman right under the next ladder, so it's actually saving a move. The CO (decimal 192) at 21DC is the duration of the ladder climb at 21DD (04).

The way the code is written, the 2nd byte has to be used as a duration. It couldn't be used as another input.

« Last Edit: July 19, 2013, 07:53:28 pm by JCHarrist »
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline phantomdj

  • New Member
  • *
  • Posts: 2
    • Awards
Re: Attract mode code breakdown
« Reply #43 on: July 20, 2013, 12:13:52 am »
Another way to have fun with this is to make the attract mode playable.

You can do this using the MAME debugger console by adding the following lines:

Code: [Select]
bp 80,1,{pc=87 ; g}
bp 1977,1,{pc=197a ; g}

You can also enable sound in attract mode with this line:

Code: [Select]
bp e9,1,{pc=eb ; g}
I will see if I can find another hack to make it so the game doesn't freak out when jumpman makes it to the top in attract mode.

edit:  found it.  The following hack fixes attract mode if jumpman should finish the level:

Code: [Select]
bp 746,{b@600a==16},{b@600a=5; g}
More fun with attract mode.  Set the screen played:

Code: [Select]
bp 770,1,{b@6227=2 ; g}
The above code sets the screen to 2 [conveyors] during attract mode.  Change the 2 to 3 for elevators, or to 4 for rivets.



Don Hodges
« Last Edit: July 20, 2013, 09:27:35 am by phantomdj »
Member for 11 Years

Offline ChrisP

  • Spring Jumper
  • *
  • Posts: 1764
  • I'm going to jump next to your leg.
    • Donkey Blog
    • Awards
Re: Attract mode code breakdown
« Reply #44 on: July 20, 2013, 05:13:22 am »
This is too much fun.

If you thought demo-Jumpman was bad on barrels, check him out on rivets.

Though he's still not as bad as D2K demo-Jumpman.
http://donkeykongblog.blogspot.com

4 Quarters :-* - 800K Avg. Per Qtr. :o - No Restarts 8) - No Proof :'(

7/26/2013   Coin 35,946   710,800   18-1
7/28/2013   Coin 35,947   903,700   22-1
8/16/2013   Coin 35,948   694,100   17-6
8/17/2013   Coin 35,949   893,100   22-1

3,201,700: the $1 World Record?
Member for 11 Years DKJR Killscreener DK Masters - Rank D IGBY 2016 DKF Team Member IGBY 2015 DKF Team Member IGBY 2014 DKF Team Member Blogger Twitch Streamer DK Killscreener CK Killscreener