It is currently Thu Dec 14, 2017 6:23 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: UNIF UNL-SA-9602B
PostPosted: Sun Feb 05, 2017 9:53 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
I am attempting to understand how the UNIF UNL-SA-9602B mapper works by studying the code in FCEUX (sa-9602b.cpp). Here is the function that sets the PRG bank:

Code:
static void SA9602BPW(uint32 A, uint8 V) {
   setprg8r(EXPREGS[1], A, V & 0x3F);
   if (MMC3_cmd & 0x40)
      setprg8r(0, 0x8000, ~(1));
   else
      setprg8r(0, 0xc000, ~(1));
   setprg8r(0, 0xe000, ~(0));
}


In the setprg8r function, what does the first parameter mean? I noticed that when it's 0, it appears to refer to cartridge PRG ROM. A value of 0x10 is typically used for WRAM.

In unif.cpp, the mapper is marked with the following flag:

Code:
{ "SA-9602B", SA9602B_Init, BMCFLAG_32KCHRR },

...

else if (bmap[x].flags & BMCFLAG_32KCHRR)
               CHRRAMSize = 32;


The mapper appears to have 32K CHR RAM; however, no where in sa-9602b.cpp is a call to set the CHR RAM bank. I suspect that line in the code above where setprg8r takes EXPREGS[1] as an argument has something to do with it. Can anyone familiar with FCEUX's code base shed some light on this.


Top
 Profile  
 
 Post subject: Re: UNIF UNL-SA-9602B
PostPosted: Sun Feb 05, 2017 11:31 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6520
Location: Seattle
zeroone wrote:
In the setprg8r function, what does the first parameter mean? I noticed that when it's 0, it appears to refer to cartridge PRG ROM. A value of 0x10 is typically used for WRAM.
The "memory number". Possibly inherited from UNIF (where there can be up to 16 PRG ROMs)? So numbers 0-15 are ROMs 0-15, and 16 is RAM.

Quote:
The mapper appears to have 32K CHR RAM; however, no where in sa-9602b.cpp is a call to set the CHR RAM bank.
The important lines you missed were
Code:
#include "mmc3.h"
[...]
        MMC3_CMDWrite(A, V);
[...]
        GenMMC3Power();
[...]
        GenMMC3_Init(info, 512, 0, 0, 0);
        pwrap = SA9602BPW;


This is an MMC3-class pirate/unlicensed mapper that selects between two (or four?) 512 KiB PRG ROM chips depending on values written to the CHR banks.


Top
 Profile  
 
 Post subject: Re: UNIF UNL-SA-9602B
PostPosted: Sun Feb 05, 2017 12:23 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
Thanks. You are correct. This mapper depends on three 512K PRG ROM chips. That first parameter refers to which of the 3 chips to access.

And, I did fail to notice that this is a pirate-MMC3 mapper that uses extra CHR RAM.

On a side note, this mapper also depends on the Subor Mouse for input. And, the FCEUX implementation of the mouse doesn't fully work for this game either (the mouse cursor only moves downwards).


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

All times are UTC - 7 hours


Who is online

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