It is currently Mon Dec 18, 2017 4:08 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Sat Jul 16, 2011 10:55 am 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I have no Idea where is the problem, i think somewhere else, that part asm code are located in few places, so we should trace the code little bit earlier. I don't think is this bad dump, no way that NNNesterJ can emulate bad dumped fds image, but how - it skips this op code? So if I put NOP (EA) to UNDEFINED and BRK it may help?

...and yes it looks the same to Nestopia, FCE Ultra or even NesDS.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2011 12:03 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
Yea I would start by giving that a try. Who knows what oddities this may fix if any. Could be the issue. :). Ill be back in town on monday and ill be messing with this too. Let us know soon plasturion. :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2011 10:37 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
You should try making a CPU log of the instructions *leading* to that place. Maybe make a movie until the point it crashes, then seek to a couple of frames before the crash and start logging. My money is on a bad dump.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 3:39 am 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
Code:
$8F18:A2 01     LDX #$01                   A:04 X:02 Y:00 S:FE P:nvUBdizC
$8F1A:E4 5D     CPX $005D = #$02           A:04 X:01 Y:00 S:FE P:nvUBdizC
$8F1C:B0 29     BCS $8F47                  A:04 X:01 Y:00 S:FE P:NvUBdizc
$8F1E:BD D8 04  LDA $04D8,X @ $04D9 = #$13 A:04 X:01 Y:00 S:FE P:NvUBdizc
$8F21:30 21     BMI $8F44                  A:13 X:01 Y:00 S:FE P:nvUBdizc
$8F23:A8        TAY                        A:13 X:01 Y:00 S:FE P:nvUBdizc
$8F24:BD 0E 05  LDA $050E,X @ $050F = #$FF A:13 X:01 Y:13 S:FE P:nvUBdizc
$8F27:C9 FE     CMP #$FE                   A:FF X:01 Y:13 S:FE P:NvUBdizc
$8F29:F0 39     BEQ $8F64                  A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F2B:C9 FD     CMP #$FD                   A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F2D:F0 1C     BEQ $8F4B                  A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F2F:C9 F7     CMP #$F7                   A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F31:F0 1E     BEQ $8F51                  A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F33:B9 40 DB  LDA $DB40,Y @ $DB53 = #$64 A:FF X:01 Y:13 S:FE P:nvUBdizC
$8F36:85 B0     STA $00B0 = #$56           A:64 X:01 Y:13 S:FE P:nvUBdizC
$8F38:B9 78 DB  LDA $DB78,Y @ $DB8B = #$73 A:64 X:01 Y:13 S:FE P:nvUBdizC
$8F3B:85 B1     STA $00B1 = #$67           A:73 X:01 Y:13 S:FE P:nvUBdizC
$8F3D:86 AB     STX $00AB = #$04           A:73 X:01 Y:13 S:FE P:nvUBdizC
$8F3F:20 48 8F  JSR $8F48                  A:73 X:01 Y:13 S:FE P:nvUBdizC
$8F48:6C B0 00  JMP ($00B0) = $7364        A:73 X:01 Y:13 S:FC P:nvUBdizC
$7364:7F        UNDEFINED                  A:73 X:01 Y:13 S:FC P:nvUBdizC
$7367:FF        UNDEFINED                  A:47 X:01 Y:13 S:FC P:nvUBdizC
$736A:18        CLC                        A:46 X:01 Y:13 S:FC P:nvUBdizC
$736B:20 40 80  JSR $8040                  A:46 X:01 Y:13 S:FC P:nvUBdizc
$8040:F0 00     BEQ $8042                  A:46 X:01 Y:13 S:FA P:nvUBdizc
$8042:00        BRK

This is log and the clue why the code is going outside is instruction $8F48:6C B0 00 JMP ($00B0) = $7364, and this is good. I noticed is needed while 2 sprites or more are displayed. Accumulator and $00B0 register value are deciding, so looks like this is some calculating issue.

[Here] is little more of them.

Maybe loading from disk to ram in most common emus are not perfect, so at $7364 should be some code loaded from the disk, and maybe only NNNesterJ can do it. In that case it would be nice to compare logs from NNNesterJ, but it hasn't debugger/logger.

Someone said before that can be something with CPU so in that case this is bad dump and illegal changing something in RAM. Bad working CPU in NNNesterJ don't change something important in RAM, so "bad" instruction is omitted and then works fine. Sounds fun.

Any other ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 11:15 am 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
Is it possible to omit the instruction? Or maybe add the exception?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 11:47 am 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I should said "Maybe", I just suggest loud what it can be and I think is rather impossible what i wrote, I still don't know where and what is wrong (emu, dump, CPU, FDS), maybe others can find it.

Hey, I didn't check it wisely, NNNesterJ has some tools after all like memory viewer, it should be enough to compare with logs. lets see....

Heres the memory page of FCEUX where it try to code execute but there's nothing (too much of 00 and FF, maybe data from disk wasn't transfered to this area?)
Image

------------
and the 2nd one - correct one of NNNesterJ - nice and fluffy...
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 4:07 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
edit*


Last edited by *Spitfire_NES* on Sun Jan 08, 2017 4:30 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 4:55 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
What's the byte before it jumps to the crap code?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 8:57 pm 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
3gengames wrote:
What's the byte before it jumps to the crap code?


U on to something 3gen? :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 9:03 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Just wondering if the byte before it could could make it seem like code, looks trashed from what you gave us though.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 10:20 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Well, it does indeed seem like NNNesterJ has some valid code where other emulators don't. Here's short snippet of disassembly from NNNesterJ's $7364 (ignore the label):
Code:
L0027           := $0027
        lda     $050E,x
        cmp     #$FF
        bne     L0027
        lda     #$20
        sta     $072A,x


I don't know anything about FDS though to speculate why this could happen.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 10:22 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
Since it's RAM, log where it changes that piece of RAM I guess?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 17, 2011 10:59 pm 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
3gengames wrote:
What's the byte before it jumps to the crap code?

You can check it in logs that i've posted before
Code:
 $8F3F:20 48 8F  JSR $8F48                  A:73 X:01 Y:13 S:FE P:nvUBdizC
 $8F48:6C B0 00  JMP ($00B0) = $7364        A:73 X:01 Y:13 S:FC P:nvUBdizC

So the answer is 8F, is it helpful?
I think this part is correct (about instruction) is using many times and if it don't game should crashed at the start.
I bet that's because of FDS wrong emulation (maybe).

... I'll try to find logs when RAM is changing...

at first I checked how it looks loading 2nd stage of Kiki Kaikai and give some screens of NNNesterJ.
Image
0 - its old data
1 - after 1st procedure - loaded some data that filled all $7300 - $7400
2 - after 2nd loading - it ends exactly on $7363
3 - after 3rd loading - starts from $7364, and this stage not happen in FCEUX, so there are old data from 1st procedure.

I can send you some logs from FCEUX when it ending 2nd procedure, and some more until the game starts rendering (loading is over)... but I think it's useless.
[Here] is the big one 320M log compressed to 1.5M
It takes some time (few seconds) when 2nd loading procedure ends and starts 3rd.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2011 7:07 am 
Offline
User avatar

Joined: Fri May 21, 2010 4:10 pm
Posts: 279
Nice work plasturion! Seems like everytime ya think ya got the nes emus figured out ya find another snag. Lol. Looks like the person who coded that was in the know! :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2011 4:39 pm 
Offline
User avatar

Joined: Thu Jun 02, 2011 2:05 am
Posts: 63
I found maybe another step to make sure is this really FDS issue.
Let's talk about 2 other previous Nester releases that runs FDS:

1. unofficial release of original Nester emu (public beta4) made by Toshiya Takeda. There was the first additional FDS feature that runs Kiki KaiKai correctly. FDS support is inside Mapper/020.cpp

2. NesterJ emu by Mikami Kana, which is slightly different to T.Takeda FDS version and this change exist utill NesterJ 0.503 as Nes_Mapper_FDS.cpp. With this version FDS works bad (Kiki KaiKai hangs when you meet the boss, exactly the same how all other popular emus: Nestopia, FCE, Virtuanes, etc), then he for some reason put the files - Mapper/020.cpp of T.Takeda (or Takeda takes Mikami files to enhance previous release, so it could be Mikami work (didn't checked)) with NesterJ 0.51 and Kiki KaiKai works here good again.


Looks like is it FDS, isn't it? And because of that both of files are very similar, comparing this files maybe you can simply find something interesting.


Last edited by plasturion on Wed Jul 20, 2011 5:34 am, edited 1 time in total.

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

All times are UTC - 7 hours


Who is online

Users browsing this forum: zxbdragon and 2 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