It is currently Mon Aug 19, 2019 3:53 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jul 18, 2019 7:09 pm 
Offline

Joined: Fri Mar 23, 2018 8:58 pm
Posts: 37
Hello guys! I'm currently studying Namco 163 for a mapper hack project. But now I'm stucked on the Nametable mirroring.
Unlike VRC4/MMC3/Sunsoft5/Bandai FCG and other mappers, which write some value to some specific register to set mirroring, N163 has no such registers. From what I've learned, it seems I should map some banks directly to PPU $2000~$2FFF.
So I wrote the following code trying to set Vertical Mirroring:
Code:
lda #$E0
sta $C000
sta $D000
lda #$E1
sta $C800
sta $D800


However when running on emulator (Mesen 0.9.8) it does not set to V-Mirroring but single screen B! I don't know why this happens. Did I misunderstand something? or is it because I forgot to initialize some registers?
Could anyone please give me some hints? Thanks in advance!


Top
 Profile  
 
PostPosted: Thu Jul 18, 2019 7:52 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8532
Location: Seattle
Mesen's implementation of Namco 163 has the run-time heuristics mentioned in the old version of our Mapper 210 documentation. Write to any register exclusive to the Namco 163 first and it should do the right thing.

Its implementation of the heuristics is fragile; it interprets my original
if the game ever writes to $C000 and this isn't a Namcot 163, this is probably a Namcot 175 with external RAM.
to mean "that if it writes to $C000 and we haven't made our mind up, it's a Namco 175", which I probably should have phrased as "if it writes &c, then it's not a Namco 340"


Top
 Profile  
 
PostPosted: Thu Jul 18, 2019 10:15 pm 
Offline

Joined: Fri Mar 23, 2018 8:58 pm
Posts: 37
Thank you very much lidnariq! I tried your solution.

First I added
Code:
lda #$00
sta $4800

near RST handler, forcing the game write to internal RAM once, making emulator believe this is N163.
And then I modified
Code:
...
ora #$C0
sta $E000

to
Code:
...
ora #$40
sta $E000

so that E000.7 won't be set, preventing emulator from thinking the game is N340.

But it still displays abnormally.
Attachment:
nametable mirroring.png
nametable mirroring.png [ 33.21 KiB | Viewed 455 times ]

As you can see, the layout of nametable is indeed Vertical Mirroring, but it displays "Horizontal"!

EDIT:
I also modified the iNES header to mapper 19, submapper 2 (which means I'm using iNES 2.0, which is supported by Mesen), still a big nope.


Top
 Profile  
 
PostPosted: Thu Jul 18, 2019 11:54 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8532
Location: Seattle
If I'm reading Mesen's source correctly, I think that text (but only the text) will be incorrect on MMC5 and N163 and anything else that supports things outside the set of {H,V,1a,1b,4}.

(edit: entertainingly, this means that mapper 150 games will update the text for three of the four possible values (H,V,1a), but should be stale for the final option of the four (L-shaped))


Top
 Profile  
 
PostPosted: Fri Jul 19, 2019 1:08 am 
Offline

Joined: Fri Mar 23, 2018 8:58 pm
Posts: 37
So that's the emulator's fault, not mine, right? Phew, that's a relief.
Thank you very much for your help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

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