Jump to content
IGNORED

Donkey Kong 2: Lost Levels


CDS Games

Recommended Posts

Donkey Kong 2: Lost Levels


This is a hack of Garry Kitchen's Donkey Kong. The ramp and rivet screens of the original have been converted into the elevator and conveyor screens respectively:

 

post-31389-0-76178000-1411136129_thumb.pngpost-31389-0-47851900-1411136136_thumb.png

donkeykong2lostlevels.bin

So why even bother with a 4k Donkey Kong hack, now that we have such great looking homebrew versions out there? Because I always liked Garry's port, notwithstanding the missing screens. Garry said in an interview he would have done all four levels if Coleco had given him more time and an 8k cart. In any case, he put out a great version of DK within the framework he was given, and I hope this will be a fitting tribute to his accomplishment. I was also inspired by batari's great work on this thread; without his disassembly and example none of this would have been possible.

There are still a few remaining bugs. The elevators have no platforms, the conveyors will take you right off the screen, and the whole game often crashes completely after restart. But it's playable straight through, so this is a good time to open it up for testing and feedback. Just bear in mind that I still have only 4k to work with.

 

_____________________

 

Edit 10/18/2014

 

Nukey combined the above hack and the original game into a playable 4-level Donkey Kong. The sequence goes: ramps, rivets, elevators, and conveyors, and then repeats.

 

The latest version of the 4 level game can be found here:

 

 

Edited by CDS Games
  • Like 20
  • Thanks 1
Link to comment
Share on other sites

Thanks! Learning how to bank switch is on my wish list, but I'm not there yet. Lots of other folks could do it easily I'm sure.

 

Best thing about that is if you mashed the original and this version onto an 8k cart, you could get rid of one of the kernels and have loads of extra room to add a moving elevator like batari's and redo the stationary platforms to look more like the arcade.

Link to comment
Share on other sites

Very cool, I have often thought about how cool it would be to make "the lost levels" but my skills are no where near this level. I would love to learn how to program the 2600.

 

EDIT: I just played this and its awesome, I hope you can figure out a way to add the elevators.

Edited by SalemFrost7800
  • Like 1
Link to comment
Share on other sites

This is really great, CDS! I'm also a fan of the original 2600 version. Any chance you could add these levels to the others to make a "what could have been" Donkey Kong 8k?

The simplest way would be to make sure that the rom address where the program switches from the second level back to the first is the same in both 4k roms (the original and this hack)...and hit a bankswitch hotspot right there. STA $1FF9 for the 4k rom that is going to be the first bank, STA $1FF8 for the 4k rom that is going to be the second bank. Then paste the two 4k roms together.

  • Like 1
Link to comment
Share on other sites

It doesn't matter where most everything else resides in the 2 banks...so you can move subroutines or certain data tables around a bit to make the address where the bankswitch occurs the same. Note that I put "most everything"...since a data table that references something which will not be used immediately may be affected. Subroutines are almost always movable. Also, the program in either bank cannot use rom hotspot addresses for anything else. Also, it would be better to hit $1FF8 in both banks' startup code...so you always begin with the barrel stage instead of being random.

Edited by Nukey Shay
  • Like 1
Link to comment
Share on other sites

This is what I'm referring to...notice that the added banking instructions are the only additions which differ between the 2 banks. Everything else (aside from the changes you made) is identical. The program used a similar ram clear loop in the program to the one at cold start, so I reused it to save the romspace needed for the banking instructions (you'll need to press game reset when you first power up, however). When ram clear is done, it flips to the first bank to start on barrels. When passing a level @LF3F1, ram $90 is flipped from 0 to 1 (and visa-versa), so I put the complimentary bankswitches there. There's a stretch of 5 unused bytes @$FBFB, so I moved data table LFFE4 there to clear the banking hotspots.

 

Keep in mind that this is a quick'n'dirty solution where an entire bank is redundant to the one you are playing. It would be better to use all of the display code in a separate bank than the offscreen code so that you have much more romspace free. Fortunately, the level counter $90 is currently only using that single bit (and dedicated minikernels are arrived via indirect jumping ($EE) and ($F0)...so it's possible to do this with a more-complete disassembly.

DonkeyKong4levels.zip

Edited by Nukey Shay
  • Like 1
Link to comment
Share on other sites

Ok so LDA $1FF9 at line F403...that single instruction is flipping the bank? Is that a dedicated "bankswitching hotspot" that will work everywhere, or did you set that up to be a hotspot with additional banking instructions elsewhere in the code? What is that address?

 

3 bytes to flip a bank....if that's the case, you ain't kidding about quick'n'dirty.

Link to comment
Share on other sites

This is using the "standard" F8 banking scheme (it should be default if you load it in an emulator), where the entire 4k ROM area is swapped when banking.

Rom addresses $xFF8 and $xFF9 are the "hotspots" (x=any odd-numbered hex digit). Use address $xFF8 to call the first 4k bank, and $xFF9 for the second. *Any* access to those addresses will cause corresponding hotspots to be triggered (even using an undocumented triple-NOP instruction). You can place bankswitching instructions wherever you need to. Program flow will continue at the next immediate address in the target bank.

 

If the program executes LDA $1FF9 @$x000, for example, the next instruction is expected to be @$x003 in the second bank.

 

The two other "standard" bankswitch schemes are F6 (16k, 4 hotspots $xFF6-$xFF9) and F4 (32k, 8 hotspots $xFF4-$xFFB).

 

BTW you might want to look at Kevin Horton's cart document for more information about the various known bankswitching schemes.

  • Like 1
Link to comment
Share on other sites

That is an extremely powerful and useful tool, thanks for explaining it so clearly.

 

*Any* access to those addresses will cause corresponding hotspots to be triggered (even using an undocumented triple-NOP instruction).

 

 

 

Aha!!! I was wondering why you said STA above and then coded LDA!

 

Will definitely check out Kevin's doc.

Edited by CDS Games
Link to comment
Share on other sites

If you're playing in Stella you can top up your lives as needed...just go into the debugger and A3 stores the number of lives--you can change it to whatever.

 

Otherwise, I just got better at it by playing the 4k version. That just flips back and forth between the elevators and conveyors.

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