It is currently Wed Dec 13, 2017 10:02 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Thu Jun 17, 2010 1:15 pm 
Offline

Joined: Thu Jun 17, 2010 12:57 pm
Posts: 1
Hi everyone. I began to write a guide on how to play this FDS port of the Taito arcade game Kiki Kaikai (the series that came to be known as Pocky & Rocky on the SNES), but I have come across a strange problem. There are two boss fights that crash just about every modern NES emulator that I have tried, including FCEUX, Nestopia, Nintendulator, Mednafen, and VirtuaNES. The _only_ emulator that the game works properly on is the "old" emulator NNNesterJ. It's very strange, where those five other emulators hang, NNNesterJ goes swimmingly right along. (Interesting to note, for those of you who can read Japanese, a warning to this effect is present on this page: http://www25.atwiki.jp/famicomall/pages/244.html which you can run through Google Translator if need be.)

It's not too hard to get to the crash point, although it takes a few minutes of walking (if you avoid all of the enemies.) The ROM that I'm using (and the only one that seems to be available) is from the TOSEC set with a CRC of 4C791779. From the start point, walk straight up. Keep following the path north until you get the first chance to travel east (you'll cross a few bridges just before that point.) Head east as soon as you are able, and then take the very next path south. This will lead you down and around to the entrance of a cave. You need 50 Ofuda cards to enter the cave, which is what you start with (you earn Ofuda cards by defeating enemies with your wand). Once inside, the path to the boss never branches. You travel north, then east, and the north. At the top of the second north path is the boss room. The expected result (and the one which NNNesterJ produces) is that the room scrolls into view, turns blue, and a large boss starts to attack you. The actual result in the rest of the emulators I've tried is that they hang before the room turns blue, stuck playing one note.

I know this is the sort of thing that is incredibly low priority in the grand scheme of things, but I thought it might be interesting for some of the more active emulator developers to look at and try to figure out what NNNesterJ is doing differently (correctly or perhaps incorrectly) that allows the game to play in this one particular emulator. I would love to know myself. Thanks for taking a look!

Procyon


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 13, 2011 8:25 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
no to raise the dead but thats interesting. just tried this game out and i wonder what the problem could be....


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2011 7:39 pm 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
Does it actually crash the emulator into closing itself, or does the game just freeze?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2011 7:59 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
Drag wrote:
Does it actually crash the emulator into closing itself, or does the game just freeze?


the emulator neither freezes nor crashes, the game hangs when you enter the boss's room. Weird how nesterj could play this right but no others...seems like something blocks the boss from appearing or something...

Give it a try in nestopia, when you reach one of the boss's rooms it just kinda hangs, and nothing happens, the music freezes on one note, i used rewind to leave the room, but i know the emu does not crash.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2011 8:05 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Illegal opcodes maybe? Maybe one not documented very well? Weird thing. And you can't track it down?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2011 8:09 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
3gengames wrote:
Illegal opcodes maybe? Maybe one not documented very well? Weird thing. And you can't track it down?


i have no clue whats causing it, i always thought fds was pretty much 100 percent working and great. i came across this thread yesterday and since then it has peaked my interest. comparing code from NNNnesterj to nestopia is hard to do lol, :shock:


***update. My mistake the game does in fact crash.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 9:48 am 
Offline
User avatar

Joined: Sun Dec 12, 2010 10:27 pm
Posts: 298
Location: Hong Kong
The linked page indeed said that VirtuaNES reported an illegal opcode error.
Maybe someone who have time would try to trace the code there with a debugger enabled emulator (Nintendulator, FCE*whatever* or even No$NES).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 1:26 pm 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I walked to the 1st boss with Nestopia debug mode and it throws illegal opcodes BRK and JAM causing CPU JAM! At titlescreen throws Expression: modulator.writing with Fds::Sound::WriteReg7.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 1:31 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
plasturion wrote:
I walked to the 1st boss with Nestopia debug mode and it throws illegal opcodes BRK and JAM causing CPU JAM! At titlescreen throws Expression: modulator.writing with Fds::Sound::WriteReg7.


so we need to erase/modify the illegal opcodes then... so it threw an error with sound, writereg7...hmm.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 3:05 pm 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I think maybe something cause that this opcodes appears. So best way is try to find out if WriteReg7 don't make any mess.

Let's see what is doing - Nestopia NstFds.cpp

Code:
      NES_POKE_D(Fds,4088)
      {
         sound.WriteReg7( data );
      }
      
      void Fds::Sound::WriteReg7(uint data)
      {
         NST_VERIFY( modulator.writing );

         if (modulator.writing)
         {
            Update();
            std::memmove( modulator.table, modulator.table + 1, Modulator::SIZE-1 );
            modulator.table[Modulator::SIZE-1] = Modulator::steps[data & REG8_MOD_DATA];
         }
      }


and NNNesterJ 0.23 in fdssnd.c
Code:
static void FDSSoundWrite(uint32 address, uint8 value)
{
   if (0x4040 <= address && address <= 0x407F)
   {
      apu->fdssound.op[1].wave[address - 0x4040] = LinearToLog(((int32)value & 0x3f) - 0x20);
   }
   else if (0x4080 <= address && address <= 0x408F)
   {
      int ch = (address < 0x4084);
      FDS_FMOP *pop = &apu->fdssound.op[ch];
      apu->fdssound.reg[address - 0x4080] = value;
      switch (address & 15)
      {
...
         case 8:
            {
               static int8 lfotbl[8] = { 0,1,2,3,-4,-3,-2,-1 };
               uint32 v = LinearToLog(lfotbl[value & 7]);
               apu->fdssound.op[0].wave[apu->fdssound.waveaddr++] = v;
               apu->fdssound.op[0].wave[apu->fdssound.waveaddr++] = v;
               if (apu->fdssound.waveaddr == 0x40)
               {
                  apu->fdssound.waveaddr = 0;
               }
            }
            break;

that's only suggest, I'm not sure it can be somehow connected with this issue, however the soundtrack is changing while the boss appears. It takes only last hex digit of address, so we're looking case 8?

Damn... I need to register if I want using VC++ express. The time trial has expired. Maybe this time someone else wants to have fun ;).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 3:22 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Is it running code from RAM? Maybe your CPU is causing something in RAM to be changed wrong and crash?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2011 3:36 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
3gengames wrote:
Is it running code from RAM? Maybe your CPU is causing something in RAM to be changed wrong and crash?


whatever it is, 5 diff emus are all proving to do the same thing including nestopia, virtuanes and others....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2011 1:24 am 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
Perhaps the image really seriously is broken (bad "dump", I guess), and the fact that nesterj allowed the game to run was due to a bug?

It could also be the result of copy protection of some kind; I know disk-based c64 software had some hardware-implemented copy protections, such as purposefully unreadable sectors.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2011 5:26 am 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I've checked where fce ultra debug tool stuck when the boss seems to appear and...
Code:
00:803B:03        UNDEFINED
00:803C:01 03     ORA ($03,X) @ $02F3 = #$72
00:803E:61 62     ADC ($62,X) @ $0000 = #$D3
00:8040:F0 00     BEQ $8042
00:8042:00        BRK
00:8043:00        BRK
00:8044:92        UNDEFINED // Here debug trace stuck
00:8045:24 49     BIT $0049 = #$00
00:8047:92        UNDEFINED
00:8048:24 49     BIT $0049 = #$00
00:804A:DB        UNDEFINED
00:804B:B6 6D     LDX $006D,Y @ $0080 = #$FE
00:804D:DB        UNDEFINED
00:804E:B6 6D     LDX $006D,Y @ $0080 = #$FE
00:8050:04        UNDEFINED

looks like this is not so good place to code execute.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2011 8:37 am 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
So looks like something needs to be added or modified...maybe an exception to address while boss appears and music changing. Isn't fce issue the same as nestopia?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group