Author Topic: Donkey Kong Program Code  (Read 60515 times)

0 Members and 3 Guests are viewing this topic.

Offline xelnia

  • Administrator
  • Spring Jumper
  • *
  • Posts: 2869
  • Stop using 0.106
    • Twitch
    • Awards
Re: Donkey Kong Program Code
« Reply #45 on: January 06, 2014, 06:37:22 pm »
Tonight I finally found my Tutankham disassembly and I'm quite embarrassed to say that it's not quite as complete as I remembered.  :-[

I'm still very interested in taking a look!
"Do not criticize, question, suggest or opine anything about an upcoming CAG event, no matter how constructive or positive your intent may be. You will find nothing but pain and frustration, trust me. Just go, or don't go, and :-X either way!" -ChrisP, 3/29/15
Member for 11 Years snek CK Killscreener IGBY 2016 DKF Team Member IGBY 2015 DKF Team Member IGBY 2014 DKF Team Member DK Killscreener Blogger Twitch Streamer

georgie3

  • Guest
Re: Donkey Kong Program Code
« Reply #46 on: October 01, 2014, 06:31:10 pm »
Thanks Jeffw and others for your efforts, the commented disassembly code in reply #43 looks like very high quality. I teach computer architecture and assembly language programming and would like to show my students what real hand-crafted assembly code looks like.

Offline furrykef

  • Jr. Member
  • *
  • Posts: 25
    • Awards
Re: Donkey Kong Program Code
« Reply #47 on: October 04, 2014, 10:37:55 pm »
I think we should put this disassembly up on a wiki, so it will be easier to collaborate on it. I can do this myself if necessary.

I also suggest we move this thread into the General forum, since it doesn't have that much to do with strategy and it's more likely to be read there.
I might never make it to a kill screen, but I found Donkey Kong's hidden music!
Member for 10 Years

Donkey Kong Genius

  • Guest
Re: Donkey Kong Program Code
« Reply #48 on: October 05, 2014, 01:26:24 am »
Welcome to the Donkey Kong Forum! A page has been designed for exactly this purpose, feel free to contribute on the DK wiki code assembly page.
« Last Edit: October 05, 2014, 01:28:07 am by Donkey Kong Genius »

Offline furrykef

  • Jr. Member
  • *
  • Posts: 25
    • Awards
Re: Donkey Kong Program Code
« Reply #49 on: October 06, 2014, 01:13:32 am »
So there is! Thanks for pointing it out.

Man, some of the stuff in here is insane. The RST's with their "return to higher subroutine" trick, which also appears in some normal procedures... I'd never encountered that before, though I haven't done a whole lot of ASM in my life. But I wouldn't expect a subroutine to return to the caller's caller.
I might never make it to a kill screen, but I found Donkey Kong's hidden music!
Member for 10 Years

Donkey Kong Genius

  • Guest
Re: Donkey Kong Program Code
« Reply #50 on: October 06, 2014, 07:56:46 am »
Sure thing. I wish I knew more about this stuff myself but one must have the time and motivation and weigh the practical usage.

Donkey Kong Genius

  • Guest
Re: Donkey Kong Program Code
« Reply #51 on: October 07, 2014, 09:27:07 am »
So there is! Thanks for pointing it out.

Man, some of the stuff in here is insane. The RST's with their "return to higher subroutine" trick, which also appears in some normal procedures... I'd never encountered that before, though I haven't done a whole lot of ASM in my life. But I wouldn't expect a subroutine to return to the caller's caller.

I just realized that Jeff had posted a more recent version of the code a few posts earlier. This version of the text is now on the wiki as opposed to the text of the code that was previously posted by Jeff near the beginning of this thread. Update complete.

Donkey Kong Genius

  • Guest
Re: Donkey Kong Program Code
« Reply #52 on: October 07, 2014, 09:44:23 am »
In fact if anyone is presently interested in seeing the differences between the first file that Jeff posted and this most recent update can view this page. It will take about 45 seconds to load. I don't know if this will always be a live link especially if other edits are made on the page but for now it might be neat to see how Jeff altered his previous text.

http://wiki.donkeykonggenius.com/~donkeyko/mw/index.php?title=Donkey_Kong_Code&curid=14&diff=1099&oldid=27

SpiderWaffle

  • Guest
Re: Donkey Kong Program Code
« Reply #53 on: July 29, 2015, 12:44:10 am »
I wondering if anyone has looked into how wild and bomb barrels are handled. For instance, are they possible both possible ever barrel including blues (starting 3rd?) with equal 1/16 for wild and 1/? for bomb?

This could obviously help for general runs if say it was found bombs could only occur every other barrel, but I'm interested for purposes of making a 1-1.

currently the goal is to get the 8th barrel (blue) down to make a fireball ASAP via kong having no pauses, and then the blue being a bomb, but I'm not sure if the code even allows that to happen.

Offline Adam_Mon

  • Elite Member
  • *
  • Posts: 383
    • Awards
Re: Donkey Kong Program Code
« Reply #54 on: July 29, 2015, 12:57:27 am »
I wondering if anyone has looked into how wild and bomb barrels are handled. For instance, are they possible both possible ever barrel including blues (starting 3rd?) with equal 1/16 for wild and 1/? for bomb?

This could obviously help for general runs if say it was found bombs could only occur every other barrel, but I'm interested for purposes of making a 1-1.

currently the goal is to get the 8th barrel (blue) down to make a fireball ASAP via kong having no pauses, and then the blue being a bomb, but I'm not sure if the code even allows that to happen.

Welcome mate!

For those that aren't aware Spiderwaffle here is doing a TAS run for 1-1.
I don't know much about how the bombs and wilds occur so anyone in the know please chime in  8)
love it.

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 835
  • wht u mean
    • Awards
Re: Donkey Kong Program Code
« Reply #55 on: July 29, 2015, 07:39:31 am »
I wondering if anyone has looked into how wild and bomb barrels are handled. For instance, are they possible both possible ever barrel including blues (starting 3rd?) with equal 1/16 for wild and 1/? for bomb?

This could obviously help for general runs if say it was found bombs could only occur every other barrel, but I'm interested for purposes of making a 1-1.

currently the goal is to get the 8th barrel (blue) down to make a fireball ASAP via kong having no pauses, and then the blue being a bomb, but I'm not sure if the code even allows that to happen.

Bombs are made from Stork poop  Kappa

Any barrel can be a wild barrel (except the 2nd and 3rd at the start of a barrel board?)
Blue barrels are only released every 8th Barrel

In order for a "wild" to be a "bomb":

You need to get a "wild" first (1/16, excluding potential tiredness-WB-frequency-changes discussed on CAGDC ( <Pigger> )).  Each barrel has a "counter" that tracks vertical position on the screen (this is used to determine when to roll around the edges, off the screen and where wilds bounce next).  There are only so many barrel slots, and they get recycled as barrels leave the screen, however, the "height" value is not cleared. 

A barrel needs to be pulled as a "wild" AND its' "height" value needs to be equal to or less than the 6th girder; If both parameters are met, Kong will drop a "wild" and when the game tries to determine which girder it hit last (using the counter), it gets a value for something other than the 6th girder, so the barrel logic says that is the next girder it needs to hit and free-falls to that location, before transitioning to a wild.  A full bomb requires a y-counter value that is equal to or less than the 2nd girder.   <confused>

Bonus:  A bomb-wild, transitional barrel, can only occur if the barrels' internal counter is something other than the lowest girder; so you can only get a transitional bomb-wild if you smashed a barrel on a girder above you, or if a wild left the screen above you (basically you need the vertical counter to be somewhere in the middle of the screen).  Kong will drop a "bomb" that will fall to one girder lower than the y-counter and then transition to a regular wild barrel.

Below is a good example of the bomb-wild transition.  In the replay you can see a wild barrel bounce off of the 4th girder (left side) while I have the hammer, after the hammer runs out, Kong drops a "wild" that is expressed as a bomb, but changes to a wild when it reaches that "next" lowest girder, dependent on the barrel slots' conserved vertical height value (in this case its the 3rd girder). 

http://www.twitch.tv/f_symbols/c/5883357

Bombs are more common than bomb-wilds (barrels tend to leave on the bottom 2 girders, early in the screen).  Both types are more common later in the screen than in the beginning (bombs and transitionals), because y-positional values succumb to entropy.

Also, welcome sir!  Kreygasm

1-1 Hype
« Last Edit: July 29, 2015, 09:39:34 am by f_symbols »
Member for 11 Years IGBY 2016 DKF Team Member Winner of a community event Former DK Remix World Record Holder DK Remix Killscreener IGBY 2015 DKF Team Member DK 1M Point Scorer IGBY 2014 DKF Team Member Blogger DK Killscreener Twitch Streamer