ice climber (fds) strange emu behavior in later bonus stages

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

ice climber (fds) strange emu behavior in later bonus stages

Post by *Spitfire_NES* »

I was recently watching videos on the fds version of ice climber and came across this video:

https://www.youtube.com/watch?v=bpC0V_G-mc4

Apparently, some emus, namely nestopia and virtuaNES exhibit some strange behavior in later bonus stages, (crashing on nestopia, cpu jam) sprite garbage with virtuaNES.

At around 35:42 the game starts glitching and the video uploader even makes a comment about it. Not sure if any other emus do this but figured id ask here as other emus could be having this issue. Why would re-using sprites on the bonus stages cause nestopia to crash?

Is this an emulator issue or something else with the game itself?
User avatar
Hamtaro126
Posts: 818
Joined: Thu Jan 19, 2006 5:08 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by Hamtaro126 »

Could this be something similar to what happened to Kiki Kaikai - Doutou Hen?

In that sense, as far as I know according to the above link, the game itself could be the issue!
AKA SmilyMZX/AtariHacker.
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by *Spitfire_NES* »

Do you mean where some files upon startup where missing? If that's the case, then why would the game jam up or crash or have garbled sprites after re-using the vegetable graphics?
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: ice climber (fds) strange emu behavior in later bonus st

Post by Dwedit »

Ice Climber FDS loads the initial CHR RAM from a file, then overwrites the graphic for the vegetable with a new sprite every bonus stage. (Graphics data is stored in PRG-RAM at 613F, loaded from the disk and unchanged)
But that alone isn't enough to account for the game picking garbage data to write in there.

Edit: Set RAM address 0056 to 13 to get the last valid vegetable, then 14 to get the first glitch.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by *Spitfire_NES* »

Thanks for the info Dwedit! So apparently it is a game bug then or is it something wrong with nestopia's fds emulation? (and virtuanes and others)
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: ice climber (fds) strange emu behavior in later bonus st

Post by Dwedit »

Seems to be a game bug. $0056 is incremented at the end of every level (increments game difficulty and vegetable number), to a maximum value of 255.
When they multiply the level number by 2 and add to a pointer table to find the address of the vegetable graphics, they don't do any checks or limits there, so it reads garbage data as graphics.

Seems like they just didn't think you'd make it that far.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by *Spitfire_NES* »

thanks dwedit for the informative info and posts. So, is there any way to fix this through a bug fix patch or is out of the realm of possibility and too messsed up? Weird they thought we would never make it past a certain point. haha. :lol:
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: ice climber (fds) strange emu behavior in later bonus st

Post by rainwarrior »

*Spitfire_NES* wrote:Weird they thought we would never make it past a certain point.
I thought that was shorthand for "nobody tested it that far before it shipped".
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: ice climber (fds) strange emu behavior in later bonus st

Post by Dwedit »

Don't like the bug? ASM hack the code:

Code: Select all

>  :6667:A5 56     LDA $0056 = #$00
<- Insert fix here: while A >= 0x14, subtract 0x14
   :6669:0A        ASL
   :666A:AA        TAX
   :666B:BD 3F 66  LDA $663F,X @ $663F = #$3F
   :666E:85 02     STA $0002 = #$2E
   :6670:BD 40 66  LDA $6640,X @ $6640 = #$61
   :6673:85 03     STA $0003 = #$61
   :6675:AD 02 20  LDA PPU_STATUS = #$00
   :6678:A5 10     LDA $0010 = #$1A
   :667A:29 FB     AND #$FB
   :667C:8D 00 20  STA PPU_CTRL = #$1A
   :667F:A9 05     LDA #$05
   :6681:8D 06 20  STA PPU_ADDRESS = #$18
   :6684:A9 20     LDA #$20
   :6686:8D 06 20  STA PPU_ADDRESS = #$18
   :6689:A0 00     LDY #$00
   :668B:B1 02     LDA ($02),Y @ $6132 = #$67
   :668D:8D 07 20  STA PPU_DATA = #$00
   :6690:C8        INY
   :6691:C0 40     CPY #$40
   :6693:D0 F6     BNE $668B
   :6695:60        RTS -----------------------------------------
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by *Spitfire_NES* »

:mrgreen: Thanks for the info again dwedit. I have no idea how to code in assembly or what hack to even put in that place. Are there graphics that are supposed to be in place of the garbage graphics?

Perhaps someone who knows assembly could help here maybe. :D
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: ice climber (fds) strange emu behavior in later bonus st

Post by oRBIT2002 »

Tried doing a fix for this, but FCEUX seems to ignore my breakpoints with FDS-games. :/
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: ice climber (fds) strange emu behavior in later bonus st

Post by *Spitfire_NES* »

oRBIT2002 wrote:Tried doing a fix for this, but FCEUX seems to ignore my breakpoints with FDS-games. :/
What fix did you have in mind oRBIT? Also great work on all the patches you have done thus far! I hope a solution presents itself. :beer:

Was wondering exactly what kind of fix you had in mind?
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: ice climber (fds) strange emu behavior in later bonus st

Post by rainwarrior »

oRBIT2002 wrote:Tried doing a fix for this, but FCEUX seems to ignore my breakpoints with FDS-games. :/
FCEUX breakpoints seem to work for me with FDS games. Can you give a specific example of the problem? If we can reproduce it, someone might be able to fix it.
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: ice climber (fds) strange emu behavior in later bonus st

Post by oRBIT2002 »

Perhaps I'm doing something wrong but I've played alot with the FCEUX debugger earlier..
I set a breakpoint at $6667 but it is never triggered.
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: ice climber (fds) strange emu behavior in later bonus st

Post by oRBIT2002 »

*Spitfire_NES* wrote:
oRBIT2002 wrote:Tried doing a fix for this, but FCEUX seems to ignore my breakpoints with FDS-games. :/
What fix did you have in mind oRBIT? Also great work on all the patches you have done thus far! I hope a solution presents itself. :beer:

Was wondering exactly what kind of fix you had in mind?
The .fds could probably be patched with a fix quite easily (in theory), however FCEUX isn't cooperating at the moment..
Post Reply