It is currently Wed Oct 18, 2017 10:37 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Tue Sep 19, 2017 2:54 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
Actually, I haven't - I don't own an FDS (or even a Famicom for that matter).
But, as far as I know, all 4 games are licensed games, so it seems unlikely that they would contain these obvious bugs that can be noticed within seconds of loading up the game?

And yes, the Wiki is pretty lacking in terms of information (I had to scavenge information from a lot of different emulators to implement FDS support in Mesen originally). But I'm also hesitant to update the wiki with information that may or may not be correct. Writing tests for the FDS would be ideal to validate some of its behavior, but FDS test roms is currently far beyond my (almost nonexistent) NES coding skills.


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 3:52 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
I made an example template, if you need one:
https://forums.nesdev.com/viewtopic.php?p=193241#p193241

Sour wrote:
But, as far as I know, all 4 games are licensed games, so it seems unlikely that they would contain these obvious bugs that can be noticed within seconds of loading up the game?

It's a red flag, for sure, but usually worth verifying by whatever reasonable measures you can take. I think a lot of people here could provide a whole library of examples of "I thought it was an emulator bug, but it's actually in the game."


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 4:35 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
Just to verify, though, I found FDS files of the 4 games in question and spent some time playing them to test. They did not appear to have any of the problems listed:

Druid Kyoufu no Tobira seemed to have a lot of single frame glitches at transition points, like a lot of NES games do, but the status bar stays correctly in one place (though with the usual jittery line of transition).

Lutter I could only find an En translation patched version, but it also played fine. Some minor/brief visual attribute problems, but I would assume these are normal.

Kaettekita Mario Bros appeared normal.

Putt Putt Golf appeared normal.


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 4:48 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Sour wrote:
Its source code implies that bit 0 of $4022 is not an irq reload flag, it's an irq repeat flag.

Same of Konami's VRC IRQs. ^_^;;
Quote:
(...)The IRQ's timer is always reloaded with the reload value once it triggers.

What do you mean??? Is the IRQ counter always decrementing? or only if $4022:$02 is true? Plus, what happens when the IRQ counter is zero? A reload + IRQ trigger?


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 5:20 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
That template should be enough to get me started on writing some very basic tests when I get the chance.

Thanks for testing the games, too.
Druid does have a number of glitches in Mesen as well, but for the most part looks alright (except for the jitter on the first line of the status bar, like you said).
A note on Kaettekita Mario Bros: there are 3 random opening animations before the game asks to switch to side B. 1 of the 3 openings works correctly whether or not the IRQ logic in the emulator is correct, while the other 2 will display a glitchy screen.
Only the one that has 「お茶づけ海苔」 written (vertically) works. The ones written 「五目チャーハンの素」 and 「スーパーマリオブラザーズふりかけTM」 are the ones that start glitching on the following black screen that is supposed to ask for side B.

Zepper wrote:
Is the IRQ counter always decrementing? or only if $4022:$02 is true? Plus, what happens when the IRQ counter is zero? A reload + IRQ trigger?
Assuming VirtuaNES is correct:
The counter only decrements when $4022.1 (bit 1, e.g $02) is enabled. When the IRQ fires, the IRQ's timer is always reset to the value stored in $4020 & $4021. Then if $4022.0 is set, the irqEnabled flag ($4022.1) remains on. If $4022.0 is NOT set when the IRQ fires, the irqEnabled flag is disabled.
The reload value in $4020/$4021 is apparently never cleared (unlike what a lot of emulators currently implement)
Additionally, writing to $4023.0 with bit 0 clear (enable disk reg) also appears to clear the irqEnabled flag.

And yes, it's actually pretty similar to the VRC IRQs now that you mention it (except the FDS disables the IRQ enabled flag on its own after the irq is fired, rather than waiting for the code to acknowledge it manually by writing to a register)


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 5:53 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
What about the IRQ counter reload value? Can it be zero?


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 7:03 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
Sour wrote:
A note on Kaettekita Mario Bros: there are 3 random opening animations before the game asks to switch to side B. 1 of the 3 openings works correctly whether or not the IRQ logic in the emulator is correct, while the other 2 will display a glitchy screen.

Testing for this, all three appear to proceed to the game without issue.


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 7:21 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Let me know now... please. I've updated my emulator.


Attachments:
rnes554.zip [1.74 MiB]
Downloaded 15 times
Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 7:53 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
I ended up making a handful of very primitive IRQ-related tests.

Test #1 - Validate that IRQ doesn't repeat when $4022.0 is cleared
Test #2 - Validate that IRQ repeats when $4022.0 is set
Test #3 - Validate that IRQ reload value is kept even when $4022.0 is cleared
Test #4 - Validate that writing $00 to $4023 clears IRQ enabled flag
Test #5 - Validate that writing $01 to $4023 acknowledges the IRQ
Test #6 - Validate that writing to $4020 acknowledges the IRQ
Test #7 - Validate that writing to $4021 acknowledges the IRQ
Test #8 - Validate that writing $00 to $4022 acknowledges the IRQ
Test #9 - Validate that writing $02 to $4022 acknowledges the IRQ

The results are displayed as a sequence of 9 "X" or "O" characters.

An actual FDS probably fails some of these (I wouldn't be surprised if some of the IRQ acks failed). If VirtuaNES is correct, tests 1, 2, 3, 4 and 8 should pass, the rest should fail.
I tested this on FCEUX, puNES, Nestopia UE, Nintendulator & Mesen - they pretty much all get different results, but the result screen does show up properly, so the test itself should be working correctly.

The test relies on being able to acknowledge the IRQ by reading $4030, which I assume should work on the FDS too.
If it doesn't, you'll get a blank screen.

Looking forward to seeing the results!


Attachments:
FdsIrqTestsV1.fds [63.98 KiB]
Downloaded 20 times
Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 8:39 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
My FDS + Famicom gives the result: OOXOXXXOX


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 9:24 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
Thanks for testing!
I expected #3 to pass (this is needed to fix all 4 games) - I think I might know why it didn't, though.
I wrote $00 to $4022 before writing $02 to $4022 for the 2nd time to trigger a 2nd IRQ - writing $00 might have cleared the reload value.

I fixed the tests that failed so that they pass based on the results you gave and added test 10:
Test #1 - Validate that IRQ doesn't repeat when $4022.0 is cleared
Test #2 - Validate that IRQ repeats when $4022.0 is set
Test #3 - Validate that IRQ reload value is kept even when $4022.0 is cleared
Test #4 - Validate that writing $00 to $4023 clears IRQ enabled flag
Test #5 - Validate that writing $01 to $4023 doesn't acknowledge the IRQ
Test #6 - Validate that writing to $4020 doesn't acknowledge the IRQ
Test #7 - Validate that writing to $4021 doesn't acknowledge the IRQ
Test #8 - Validate that writing $00 to $4022 acknowledges the IRQ
Test #9 - Validate that writing $02 to $4022 doesn't acknowledge the IRQ
Test #10 - Validate that writing $00 to $4022 clears the reload value

Hopefully this gets all Os this time.


Attachments:
FdsIrqTestsV2.fds [63.98 KiB]
Downloaded 13 times
Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 9:29 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5718
Location: Canada
On my FDS + Famicom
FdsIrqTestsV2 result: OOXOOOOOOX

Edit: sometimes after power on that X in the third position is an O? after reset it always becomes an X. (This happened 4 times out of maybe 15)

Not sure if that difference could be cause by when specifically i trigger the "insert disk" from the FDSstick, but it seems to happen on both early and late inserts after power on, randomly.


Top
 Profile  
 
PostPosted: Wed Sep 20, 2017 3:29 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 802
Location: Sweden
My RAM Adapter with FDSStick produces the same results as Rainwarrior on both test programs. The third test of FdsIrqTestsV2 passes sometimes but never after a reset.

rainwarrior wrote:
Sour wrote:
A note on Kaettekita Mario Bros: there are 3 random opening animations before the game asks to switch to side B. 1 of the 3 openings works correctly whether or not the IRQ logic in the emulator is correct, while the other 2 will display a glitchy screen.

Testing for this, all three appear to proceed to the game without issue.
Note that there are many bad disk images on the internet. For example there is a Zelda 2 one that appears to be missing treasures even though you start a new game (this happens on real hardware as well as emulators). I think it's the no-intro dumped disk image that's missing items in Zelda 2. Try TOSEC dumps for hopefully better results.


Top
 Profile  
 
PostPosted: Wed Sep 20, 2017 4:32 am 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
Thanks for testing.
This is odd since test #3 in V1 is essentially the opposite of test #10 in V2 - I'm not sure how both could fail.

Since the results are a bit hard to debug, I made another version that draws the number of IRQs that are triggered by each test. That should give us a bit more info on what's happening when #3 fails/passes.
Attachment:
example_000.png
example_000.png [ 4.65 KiB | Viewed 215 times ]

I also added test #11, which should be identical to test #3 in V1.


Attachments:
FdsIrqTestsV3.fds [63.98 KiB]
Downloaded 17 times
Top
 Profile  
 
PostPosted: Wed Sep 20, 2017 6:12 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 802
Location: Sweden
OK now it looks like this (if test 3 passes):

Code:
○○○○○○○○○×○

♥♥♥ ♥♥♥♥♥♥♥
 ♥♥ ♥♥♥ ♥♥♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥
 ♥
 ♥
 ♥
 ♥


And the cases where the third test fails, the heart pattern is a bit different:
Code:
○○×○○○○○○×○

♥♥♥ ♥♥♥♥♥♥♥
 ♥♥ ♥♥♥ ♥♥♥
 ♥♥ ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥  ♥♥♥ ♥
 ♥
 ♥
 ♥
 ♥
 ♥



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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 12 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