[BUG] Donkey Kong Country 2

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
JAPPsmash
Rookie
Posts: 34
Joined: Mon Nov 22, 2004 3:31 pm

[BUG] Donkey Kong Country 2

Post by JAPPsmash »

I have been playing with the Gameboy Advance version on this game and I have notice that the barrel rotation controls has a bug in the SNES version. I tried with Snes9X and it worked fine...

In ZSNES, those barrels won't stop to spin; it should spin manually.

Image
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

This bug sucks. Mainly because I have no idea what could be causing it. Has it ever worked properly before?
JAPPsmash
Rookie
Posts: 34
Joined: Mon Nov 22, 2004 3:31 pm

Post by JAPPsmash »

No, It never worked properly in any version of ZSNES...
Butters
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

pagefault wrote:This bug sucks. Mainly because I have no idea what could be causing it. Has it ever worked properly before?
I remember this bug was reported ~3 years back, and if I'm not mistaken, Overload said it was because we're not accessing a certain register correctly.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
JAPPsmash
Rookie
Posts: 34
Joined: Mon Nov 22, 2004 3:31 pm

Post by JAPPsmash »

But is there a way to fix it until next release?
Butters
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

I have no way of fixing it right now since I have no idea what is going on with it. I will have to debug it.
Agozer
16-bit Corpse | Nyoron~
Posts: 3534
Joined: Sun Aug 01, 2004 7:14 pm
Location: Nokia Land

Post by Agozer »

I'm sure you'll tackle it eventually pagefault.
whicker: franpa is grammatically correct, and he still gets ripped on?
sweener2001: Grammatically correct this one time? sure. every other time? no. does that give him a right? not really.
Image
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: [BUG] Donkey Kong Country 2

Post by kode54 »

JAPPsmash wrote:I have been playing with the Gameboy Advance version on this game and I have notice that the barrel rotation controls has a bug in the SNES version. I tried with Snes9X and it worked fine...

In ZSNES, those barrels won't stop to spin; it should spin manually.

Image
Off-topic, use this and enable the LCD colors filter, your eyes will thank you for it. (And it's handy to disable with games that were made before developers started compensating for the display's color range.)

On-topic, this is a seriously lame bug. :[
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Ok I need a savestate of this level.
JAPPsmash
Rookie
Posts: 34
Joined: Mon Nov 22, 2004 3:31 pm

Post by JAPPsmash »

Donkey Kong Country 2 SaveState file

It only works with the 1.1 ROM version...
Butters
anomie
Lurker
Posts: 151
Joined: Tue Dec 07, 2004 1:40 am

Post by anomie »

pagefault knows this already (from IRC), but for the rest of you...

The problem is that the game reads an open bus register, at $2000-$2001, and expects certain bits to be set in the result. It only works on the real SNES accidentally, while zsnes returns 0 for these unmapped registers and breaks the game.

A quick fix would be to return 0x20 from both registers, since they're most likely to be accessed as "LDX $2000" (rather than say "LDA $002000" or "PEA $2000 / PLD / LDX $00"). A real fix would involve implementing open bus, at least for the commonest case of data reads like this (opcode fetch from open bus is much more involved and much less common).

BTW, history: This worked for a long time in snes9x due to an uninitialized stack variable. Then we started initializing it (to 0, like zsnes), and the game broke. Then we hacked it much as above, then we fixed it...
Esturk
Lurker
Posts: 114
Joined: Wed Jul 28, 2004 7:07 pm
Location: Edmonton, Alberta, Canada

Post by Esturk »

Just a quick update... this bug has still not been fixed. I am playing through DKC2 right now on the level Klobber Karnage. Try playing that level with this bug.:P
Sith
Lurker
Posts: 100
Joined: Tue Jul 19, 2005 12:32 pm
Location: Belgium

Post by Sith »

Coul this bug have something to do with control input detection routines
of the game.
Or the routine barrel start ->barrel spin ->barrel STOP doesn't work
properly with Zsnes... :?
[url=http://zsnes.ipherswipsite.com/]Zsnes WIP[/url]
[url=http://byuu.cinnamonpirate.com/?page=bsnes]Bsnes[/url] by Byuu
[url=http://www.eidolons-inn.net/tiki-index.php?page=Kega]Kega Fusion[/url] by SteveSnake
[url=http://www.viceteam.org/]Vice[/url] by Viceteam
Richard C.
Lurker
Posts: 151
Joined: Wed Oct 06, 2004 9:09 pm
Location: Georgia, USA
Contact:

Post by Richard C. »

anomie wrote:pagefault knows this already (from IRC), but for the rest of you...

The problem is that the game reads an open bus register, at $2000-$2001, and expects certain bits to be set in the result. It only works on the real SNES accidentally, while zsnes returns 0 for these unmapped registers and breaks the game.

A quick fix would be to return 0x20 from both registers, since they're most likely to be accessed as "LDX $2000" (rather than say "LDA $002000" or "PEA $2000 / PLD / LDX $00"). A real fix would involve implementing open bus, at least for the commonest case of data reads like this (opcode fetch from open bus is much more involved and much less common).

BTW, history: This worked for a long time in snes9x due to an uninitialized stack variable. Then we started initializing it (to 0, like zsnes), and the game broke. Then we hacked it much as above, then we fixed it...
sith-smasher: READ DAMNIT!
Latest ZSNES release: [url=http://zsnes.ipherswipsite.com]ZSNES 11/12/06 WIP[/url]
Latest NSRT release: [url=http://nsrt.edgeemu.com/]NSRT 3.3 Final[/url]
Sith
Lurker
Posts: 100
Joined: Tue Jul 19, 2005 12:32 pm
Location: Belgium

Post by Sith »

oops,sorry
I just hope you won't be forced to rewrite too much to fix this bugger and
put it into oblivion soon :wink:
[url=http://zsnes.ipherswipsite.com/]Zsnes WIP[/url]
[url=http://byuu.cinnamonpirate.com/?page=bsnes]Bsnes[/url] by Byuu
[url=http://www.eidolons-inn.net/tiki-index.php?page=Kega]Kega Fusion[/url] by SteveSnake
[url=http://www.viceteam.org/]Vice[/url] by Viceteam
DarkStarSword
New Member
Posts: 4
Joined: Sun Sep 09, 2012 3:21 am

Re: [BUG] Donkey Kong Country 2

Post by DarkStarSword »

Thanks for the explanation of the bug anomie, here's a simple patch that
implements the quick fix you suggested of returning 0x20 for registers at
addresses 0x2000 and 0x2001. The assembly really isn't all that scary, I'm not
sure why no one else has done this:

https://raw.github.com/DarkStarSword/ju ... ound.patch

I've just done a 102% playthrough of US v1.1 of this ROM and confirmed that it
behaves the same as my cartridge. This doesn't bother checking that the game is
DKC2, so it could possibly affect other games accessing those registers (but if
zsnes doesn't implement open bus properly they may not be expected to work
anyway).

Is anyone maintaining a stable branch for bug fixes while the dev's work on 2.0
behind closed doors?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: [BUG] Donkey Kong Country 2

Post by grinvader »

We're rewriting all that, so it's moot. :/
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
DarkStarSword
New Member
Posts: 4
Joined: Sun Sep 09, 2012 3:21 am

Re: [BUG] Donkey Kong Country 2

Post by DarkStarSword »

I know it's moot for the big 2.0 c++ rewrite, but that's not out yet, for
better or worse the SVN is closed to the public, and from what I gather it's
probably still a while away...

When it comes out that will be great, but In the meantime, is anyone
maintaining a stable/bug fix branch (or fork) based on the 1.52 code that could
take this?
paulguy
Zealot
Posts: 1076
Joined: Sat Jul 02, 2005 2:01 am
Contact:

Re: [BUG] Donkey Kong Country 2

Post by paulguy »

Most linux distributions maintain patch sets, but they probably don't cover the emulation core at all. Probably also patches specific to the SDL portions.
Maybe these people were born without that part of their brain that lets you try different things to see if they work better. --Retsupurae
Post Reply