It is currently Sat Dec 16, 2017 11:31 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Tue Nov 10, 2015 4:55 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
So it seems NestopiaUE doesn't do something relating to VRC2 (mapper 23) H/V mirroring selection ($9000-9003) correctly. This becomes readily apparent in Konami Wai Wai World during the vertically-scrolling part of the game. (Said part of game is also shown during one of the demo phases, so can be tested there too). I still haven't figured out what the root cause of the final ending screen + sound select being garbled is, but gut feeling is it's probably related.

I've tried digging through the source to see if the problem was easily fixable, but the amount of abstraction is making it difficult. Was hoping someone else (lidnariq?) might have insights or know what's busted:

* https://github.com/rdanbrook/nestopia/b ... miVrc2.cpp
* https://github.com/rdanbrook/nestopia/b ... miVrc2.hpp

References for the NmtSwap stuff:

* https://github.com/rdanbrook/nestopia/b ... tBoard.cpp
* https://github.com/rdanbrook/nestopia/b ... tBoard.hpp

I've looked through commits between October 2014 and present and don't see anything relevant to fixing this. On the other hand, I do see other issues with NestopiaUE and VRC2 discussed but that's CHR page swapping and not mirroring.

I'm happy to file a ticket/Issues request with rdanbrook for getting this fixed, but like I said, it's convoluted (for me anyway).

FCEUX 2.2.3 (devel/svn build, date 2015/10/13) gets this right (at least the vertically-scrolling gameplay portion, haven't tested the ending), so it's definitely specific to at least NestopiaUE.


Top
 Profile  
 
PostPosted: Tue Nov 10, 2015 5:24 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
I can reproduce in Nintendulator.

All three emulators use the same mapping of 0,1,2,3 to "VH01".

The NMI handler of Wai Wai World always copies the byte at $07FF to $9000.
For the vertically scrolling portion in the demo there, the chunk of code at $8064 through $8068 writes $FF to $07FF, which is parsed as 1-screen mirroring by Nintedulator and Nestopia.

FCEUX, on the other hand, contains this gem:
Code:
                case 0x9000:
                case 0x9001: if (V != 0xFF) mirr = V; Sync(); break;

Without someone to test on the original hardware, it's hard to say if that's a bug in the game that FCEUX is working around, or previously-undocumented behavior.


(P.S. to anyone else: if you have a Wai Wai World cartridge, would you mind testing?)


Top
 Profile  
 
PostPosted: Sat Mar 26, 2016 7:20 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Sorry about the longevity of reply/delay. This subject came up today when talking to deadbody.

FYI, I do have a a Wai Wai World cartridge and original Famicom hardware, but I'm not exactly sure how to go about testing anything related to what's been posted. I can assure you the game visually looks like what FCEUX shows, but what's going on hardware-wise is a different question.

We do have VRC2 documentation now (all in Japanese), but I can get that translated by my neighbour. $9000/$9001 does have special handling according to the VRC2 docs (see file 0012.jpg, bottom) pertaining to H/V mirroring (docs seem to imply only bit 0 is honoured, and 0 = H, 1 = V). I don't know what V or mirr are in FCEUX code. There's no mention of a special $FF value in the docs, but maybe there's something in native Japanese I'm missing. The $07FF write may be what's most relevant though (same document), as there's some kind of correlation between those two things.

Really need to get that VRC2 document translated. I'll ask my neighbour.


Top
 Profile  
 
PostPosted: Sat Mar 26, 2016 7:48 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
koitsu wrote:
FYI, I do have a a Wai Wai World cartridge and original Famicom hardware, but I'm not exactly sure how to go about testing anything related to what's been posted. I can assure you the game visually looks like what FCEUX shows, but what's going on hardware-wise is a different question.
The trivial test is wait for the vertical-scrolling shmup section of the attract mode. If it looks correct, then writing $FF has to do something funny. If there's an obvious seam as in Nestopia, then it's a game bug.

... Oooh, or maybe the VRC2 only supports H/V, and the VRC4 is what supports H/V/0/1, and this entire bug is another instance of the conflation of the VRC2 and VRC4?Nope, the VRC2 definitely supports 1-screen layouts; the scientist-person talking at you in attract mode is missing his computer if you disable 0/1 as options. (edit: errāvī)


Last edited by lidnariq on Sat Sep 02, 2017 1:46 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Mar 26, 2016 11:18 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
I'm having some of the VRC2 documentation (the bits relevant to this) translated to English, mainly the pages relating to CHR page mapping and H/V.

It's interesting that all the documentation available (Disch vs. Goroh vs. the Wiki vs. Firebug vs. emulator code) have somewhat conflicting information about how mapper 23 behaves in this regard. The wiki is, well... the way I'd describe it is "all fucked up" for the H/V bits (for both VRC2 and VRC4). You'll just have to look to see what I mean. It looks like someone half-assed something.

Possibly this confusion stems from multiple revisions (2a vs. 2b) and the fact that VRC2/VRC4 were considered in early days to be the exact same? Not really sure.

Spoke with deadbody some more and I mentioned that this may be a good opportunity to have someone like Tepples make a test/exploration ROM for these types of features. There is obviously behaviour of this chip which we either don't understand, aren't documented, or stem from different revision behaviours. Possibly the official documentation we have doesn't match the exact revision of chip used in the cart? If you look at Goroh's document, you'll see that he ended up testing the behaviour on a per-game basis and the behaviour changes.


Top
 Profile  
 
PostPosted: Sat Mar 26, 2016 11:30 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
I wouldn't expect to find anything useful in that ancient documentation like Goroh's or the others you mentioned. They're always inadequate in cases like this. Disch's documents are just based on emulators available at the time of their writing, for example.

What's the documentation you're translating, though?

Just get somebody to do a hardware test. You can hotswap some test code in RAM, no need to do any hardware mods. All a tester needs is a famicom, a relevant cartridge, and something to run the test program from. (I don't have any VRC2/4 games, personally, so I can't help as a tester at the moment.)


Top
 Profile  
 
PostPosted: Sat Mar 26, 2016 11:44 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
VRC2 documentation being translated: viewtopic.php?f=2&t=10611


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 1:53 pm 
Offline

Joined: Sat Jul 20, 2013 10:14 pm
Posts: 38
This is also present in puNES:

Image

and the issue have been reported on GitHub.

As for the ending + sound select in puNES I'm not sure about that but I can definitely say that this is not occurring on original hardware at all as I own both a Famicom and a copy of the game.


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 3:06 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
Here is a simple hot-swappable test.

* It'll beep when it's ready to remove the original cartridge.

* Press A to start the test

* It'll play a 30-second long "song", corresponding to
- The 32 different values that can be written to the mirroring control register (the VRC2 isn't connected to CPU D5,6,7 so those cannot change things)
- Each of which consist of five notes, each 183ms long, which are Upper Left, Upper Right, Lower Left, Lower Right, Spacer.
+ 874 Hz = nametable A
+ 437 Hz = nametable B
+ 218 Hz = spacer


Attachments:
vrc24mir_hotswap_test.zip [2.87 KiB]
Downloaded 82 times
Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 3:34 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
How exactly would this hot-swap methodology work? Use a NES/Famicom cartridge adapter (so a Famicom cart can be used on a NES), load ROM via PowerPak, once loaded/running yank cart, insert VRC2 cart + adapter, press A? Sorry if this seems like a stupid question, but...


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 3:43 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
On a front-loading NES you'll need to somehow bypass/disable the CIC. Otherwise, yes.


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 4:29 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
Hotswaps often crash during the insertion/removal, so you might have to try 2 or 3 times before it works (try to pull out straight and swift).

Otherwise, yeah, you got it.


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 4:44 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10169
Location: Rio de Janeiro - Brazil
rainwarrior wrote:
Hotswaps often crash during the insertion/removal

I remember someone saying that executing OAM DMAs repeatedly helps with preventing crashes, because that means the CPU spends most of the time doing something that doesn't involve reading opcodes from memory, I believe. Can anyone confirm this?


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 4:45 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
Either way I forgot to add that <_<


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 5:51 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
I've a front-loader, a top-loader, and a Famicom AV (but no NES cart->Famicom adapter, only Famicom cart->NES). Looks like the top-loader is the best choice for this given its lack of 10NES/CIC. And yeah, what rainwarrior said was another level of concern I had. I'll try to give it a try Tuesday or after, as I've too much stuff tonight and Monday to take care of first.

English translation of a couple pages from the VRC2 docs will be coming later tonight.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], thefox and 5 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