K. Rool's Last Stand glitch (DKL3)

Talk about the Donkey Kong Land trilogy for Game Boy.

K. Rool's Last Stand glitch (DKL3)

Postby Blaziken257 » December 2nd, 2012, 9:12 am

I recently discovered a glitch that can occur after beating K. Rool's Last Stand. Basically, if you turn the game off or press A+B+Select+Start on the screen where K. Rool admits defeat and gives you his six watches, unpredictable results occur with your save file.

When I pressed A+B+Select+Start on this screen, the file select screen was bugged -- Dixie was facing RIGHT, and her sprite position is similar to where it would be when the third file is selected, but it's a bit higher than normal. Weird. Not to mention, the file that I used was the second one! In addition, pressing Up and Down do nothing.

Image
Image

When pressing A, the second file was still selected (because it was the one that I used last). Instead of going to the Time Attack screen like it should, K. Rool was going from Tin Can Valley to The Lost World. But instead of seeing the cast list, the game started me on Miller Instinct!

Things went back to normal after I either quit the level or lost a life, although I STILL wasn't able to reach Time Attack until I beat K. Rool again. Only then could I access it.

When I turned the game off (instead of pressing A+B+Select+Start), the file select screen was normal, but Time Attack was still inaccessible until I beat K. Rool a second time.

This occurred in all versions of DKL3 -- the two retail English versions, the prototype English version, and the Japanese version. How the heck did Rare miss this across so many versions?

So, bottom line: If you're on the screen where K. Rool is defeated, wait until the Time Attack screen appears before turning the game off or resetting it!

Here are some save files for you to try:

All retail versions:
http://www.mediafire.com/download.php?oe21z523qk7pq34

English prototype version (the above file is not 100% compatible with the prototype version -- the Time Attack data uses a slightly modified checksum algorithm):
http://www.mediafire.com/download.php?e215qt6hlh4d9iu (Note: Link updated)

In both these files, you should pick the middle save file -- it's right before fighting K. Rool's Last Stand. What other unpredictable things can occur from doing this glitch?
Treasure Hunter
Bananas received 108
Posts: 333
Joined: 2008

Re: K. Rool's Last Stand glitch (DKL3)

Postby Simion32 » December 2nd, 2012, 9:22 am

They basically forgot to program a resilient save system. Most early games (heck, even modern games) complain about you turning off the power during an attempt to save the game, with little to no (often none) recourse if it does happen. This is one issue I cannot believe that is even still around. It's not that hard to do an incremental save system (write data then modify save data pointer - if power goes off at least you are able to revert to the last known good save).

I believe the "turn power off" shortcut combo might be part of the hardware, not the game.

As a developer, one must assume the console/handheld/PC/whatever may loose power at any time and without warning.
Sage of Discovery
Bananas received 260
Posts: 2670
Joined: 2008

Re: K. Rool's Last Stand glitch (DKL3)

Postby Kingizor » December 2nd, 2012, 10:05 am

Simion32 wrote:I believe the "turn power off" shortcut combo might be part of the hardware, not the game.

I don't think so; I seem to recall Link's Awakening using the soft reset combination to save the game. I'm sure I've played games that don't respond to the reset combo at certain times either.

I remember DKL3 being particularly problematic with saves; removing the cartridge while the power was on would instantly wipe all saves on the cartridge. I think most other games were more resilient than that...
Trailblazer
Bananas received 61
Posts: 207
Joined: 2010

Re: K. Rool's Last Stand glitch (DKL3)

Postby Blaziken257 » December 2nd, 2012, 10:30 am

Pressing A+B+Select+Start is definitely part of the software if that's what you're talking about. To the hardware, it's not any more significant than any other button combination. The software recognizes the A+B+Select+Start button combination and decides to branch based on that -- basically going to the first screen of the game and initializing necessary memory, in general. (Except it's not perfect in DKL3 because the star/enemy counter in bonus stages isn't reset to 0, among other things.) I guess Nintendo required developers to program the game to reset when recognizing this button combination, hence why it's in a large percentage of Game Boy games.

Careful developers should program the game so that it ignores button presses while saving. Pokémon, for example, takes a long time to save, but while it's saving, pressing A+B+Select+Start doesn't do anything. This is a good thing, as this prevents possible save corruption.

But in DKL3's case, the screen where K. Rool admits defeat lasts many seconds, yet pressing A+B+Select+Start or turning the game off always seems to trigger the glitch, no matter when it occurs. I haven't looked too deeply in the code yet, but it does write some data BEFORE the screen appears (I presume one of these is the last bonus coin that you get when beating K. Rool), and then it writes more data AFTER the screen is finished (which I believe is the flag that enables Time Attack, and a checksum value). That's all that I can explain for now.

With better planning, the data should all been written to external RAM at the same time. Also, there should definitely be a backup save or some other mechanism to safeguard saved data, especially when DKL3's SRAM is 8KB, yet it doesn't even use 2KB. So, this is embarrassing if you ask me.

I really feel sorry for anyone who plays DKL3 on a Super Game Boy or a Game Boy Player, beats K. Rool, only to find that a power failure occurs at the most inconvenient time.

Spoiler!
Here are all the writes to external RAM before and after the screen, at least for file 2. These are similar for other files, just the write addresses (and probably some read addresses) are different.

Addresses are based on the Japanese version of the game.

Before the screen:

- Read from [FFE8], and set bit 0 (rightmost) to 1. Write to [A345].
- Read from [A312], and set bit 0 to 1. Write back to [A312].
- Read from [C650-C6BF], write array to: [A050-A0BF], [A150-A1BF], and [A250-A2BF].
(No idea what any of this does yet.)

After the screen:

- Read from [A3B4], and set bit 0 to 1. Write back to [A3B4]. I think this is a flag to enable Time Attack.
- Perform checksum routine by adding bytes from [A383-A3B4] (result is an 8-bit number), then invert bits (essentially, subtract this from 0xFF). Add 0x58 to this. Write byte to [A3B5].

The Game Boy's external RAM is mapped to [A000-BFFF]. Therefore, to get the offset for a .sav file from the Game Boy's RAM, take the GB RAM offset and subtract 0xA000. This is useful to edit .sav files with a hex editor.


Treasure Hunter
Bananas received 108
Posts: 333
Joined: 2008

Re: K. Rool's Last Stand glitch (DKL3)

Postby Geno » December 14th, 2012, 11:43 pm

This is a strange glitch. Good thing I didn't run into it!

But,
kingizor wrote:removing the cartridge while the power was on

who would do such a thing?
Treasure Hunter
Bananas received 55
Posts: 418
Joined: 2012

Re: K. Rool's Last Stand glitch (DKL3)

Postby Simion32 » December 15th, 2012, 4:44 am

Old people that think it's totally OK to just spontaneously unplug an SNES cart from the deck before turning it off or unplugging the power (or alternately pulling the power during a save that has no do-not-unplug warning). I've seen it before. :rant:
Sage of Discovery
Bananas received 260
Posts: 2670
Joined: 2008


Return to Donkey Kong Land

Who is online

Users browsing this forum: No registered users and 1 guest