Author Topic: Donkey Kong Junior Code Analysis  (Read 18958 times)

0 Members and 2 Guests are viewing this topic.

Donkey Kong Genius

  • Guest
Donkey Kong Junior Code Analysis
« on: July 15, 2014, 02:41:12 pm »
I am making this post because I wanted to compile some information concerning the Junior code. I do not have the code nor do I know how to obtain it. I have windows 8, and MAME .106. What programs, and files will I need to even see the code. If there are others who have links and files, and programs that could assist me in looking at the code, please post it here. I know that some of the code for Junior was borrowed from DK, that that helps a bit. Ultimately, I want to fully understand the bird patterns on the springboard. After looking at Chris' initial post on the DK code, it seems too complicated for me to analyze on my own. Maybe there is a way for me to play with the code and try to narrow down its use. Scott, you were using another program that gave you values as well. Please help me in this regard when you have time.

Offline Monstabonza

  • Senior Member
  • *
  • Posts: 237
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #1 on: July 15, 2014, 03:57:29 pm »
Start with the mame debugger Corey,
Research how to use that properly then you can start playing with memory locations.
Dk PB 391800
Dk jr PB 42000
CK 481400 lvl 19-1
CK On CC 567100 KS

Twitch =
Member for 11 Years IGBY 2014 DKF Team Member CK Killscreener Blogger Twitch Streamer

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #2 on: July 15, 2014, 03:59:30 pm »
Excellent! Now. I just downloaded the newest version of MAME. How does one use the debugger? And by memory locations do you mean the specific location in the code that is being referenced?

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #3 on: July 15, 2014, 04:03:07 pm »
If it looks anything like this, I have got nothing to look like that yet: http://www.jeffsromhack.com/toolbox/mamedebug.htm

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #4 on: July 15, 2014, 04:34:05 pm »
I did a breakdown of the springboard code in this thread: https://donkeykongforum.net/index.php?topic=495.msg9418#msg9418

As far as I know that is the only analysis of the Jr. code that's been done.

There are some memory locations and commented code to get you started at least.

Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

WCopeland

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #5 on: July 15, 2014, 04:41:00 pm »
Do you have any experience with programming?

Here is a guide on how to use the MAME debugger: http://www.dorkbotpdx.org/blog/skinny/use_mames_debugger_to_reverse_engineer_and_extend_old_games
It's probably worth a read.

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #6 on: July 15, 2014, 06:21:15 pm »
Thanks Jeff, I am sure that info will be helpful in finding the code that relates to the birds on the springboard. Do you have the code or how to get access to it?

Wes, I have no programming experience. I am an idiot when it comes to this stuff. But I do have good logical skills. If there is sufficient info, then I can reason out a conclusion even if it is obscure. I have your link open from earlier to read, your support of the article will come in handy. I have glanced through it but still can find out how to use the information.

Right now I want to learn how to use the debugger for mame such as it is shown in the link I shared: http://www.jeffsromhack.com/toolbox/mamedebug.htm

Still have not yet accessed this debugger, not sure how to use it either.

Next I want to be able to get the code for the game. Does anyone have it? If not, how do I get the code from the roms, and how to do this in Z80 assembler/disassembler.

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #7 on: July 15, 2014, 06:53:04 pm »


Next I want to be able to get the code for the game. Does anyone have it? If not, how do I get the code from the roms, and how to do this in Z80 assembler/disassembler.

Here's the complete disassembled code.
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #8 on: July 15, 2014, 06:59:49 pm »
Thanks, Jeff!

A lot of the lines say: 6A8B: 00            nop

I thought that if I found the 6A8B that correlates to your locations that I would find the same infor but all I found was this empty line.

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #9 on: July 15, 2014, 07:11:44 pm »
Thanks, Jeff!

A lot of the lines say: 6A8B: 00            nop

I thought that if I found the 6A8B that correlates to your locations that I would find the same infor but all I found was this empty line.

Those memory locations are used as storage for variables, so initially they will have no value. If you monitor those locations with the MAME debugger while stepping through the program , you will see the values changing.

The actual code for the game ends at $5FD9. Everything above that is variable storage.
« Last Edit: July 15, 2014, 07:21:22 pm by JCHarrist »
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #10 on: July 15, 2014, 07:21:56 pm »
Great. Hey, how do I use the MAME Debugger? I have the newest version of MAME downloaded. Just wasn't sure how to use that feature.

Offline Monstabonza

  • Senior Member
  • *
  • Posts: 237
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #11 on: July 15, 2014, 07:28:15 pm »
mame -window -debug dkjnr


Should run the debugger for you Corey
Swap the dkjnr for whatever roms you are using.
Dk PB 391800
Dk jr PB 42000
CK 481400 lvl 19-1
CK On CC 567100 KS

Twitch =
Member for 11 Years IGBY 2014 DKF Team Member CK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Donkey Kong Junior Code Analysis
« Reply #12 on: July 15, 2014, 07:30:49 pm »
You need a version of MAME that supports debugging and then from the command line use:

mame dkongjr -window -debug

You are familiar with command line , right? :P
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #13 on: July 15, 2014, 07:32:18 pm »
Yup, thanks guys.

Donkey Kong Genius

  • Guest
Re: Donkey Kong Junior Code Analysis
« Reply #14 on: July 15, 2014, 11:26:08 pm »
mame dkongjr -window -debug does not work in the command prompt

More instructions please. Pretend that I am an idoit, only pretend right, lol