UNIF mappers

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

Thank you sir.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: UNIF mappers

Post by tokumaru »

Just want to point out that even though UNIF is supposed to describe ROMs/cartridges better than iNES, at least one file in this collection contains wrong information. Jurassic Boy 2 has the wrong mirroring configuration (it should be 4-screen), which causes a lot of name/attribute table corruption during gameplay.

In fact, this is the game that made me hate UNIF in the first place, several years ago. I noticed this mirroring problem and was trying to fix it, but found it hard to do it in that format for some reason (I really don't remember the details right now). In the end I managed to just extract the PRG and CHR and created an iNES file with the correct header.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

bodkinz wrote:Hope this helps.. would be a shame to see a format buried... just because it isn't used much... All those items we buy and throw away.. then later in life think... i wish i had kept that.....

anyway.... 56meg of unf/unif files

can dig up more if needed :D

https://mega.nz/#!op0RyRTB!HfPW2nr8Mk6Y ... 3YOCx4mXyU
@Bodkinz Thanks again for the UNIF files. If you have additional files, please provide a link. I have returned to exploring UNIF. Hopefully, I can integrate the format into my emulator.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

I plugged in some loading code per the wiki and the UNIF files read in as described. For instance:

Code: Select all

File name: Mario Bros. (E) [U][!].unf
Name: Mario Bros.
Mapper: NES-NROM-128
Mirroring: Horizontal
PRG ROM 0: length = 16384, CRC = 2AEC46C2
CHR ROM 0: length = 8192, CRC = 10F77435
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: PAL
Any TV System: no
Controllers: Gamepad
Minimum version: 7
Dump software: CopyNES BIOS V2.00 (c) Kevin Horton   Built on 11.06.2005
Dump writer: 
Dump author: piteta
Dump date: 2007-08-04
Read me:
For the mapper names, is it just a matter of mapping them to iNES mapper numbers? Or, are there really still UNIF mappers that were never converted?
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: UNIF mappers

Post by lidnariq »

It has not changed since you asked a year ago.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

I finally got one UNIF mapper working by studying the implementation in other emulators. I'll record some notes to this thread in case anyone is interested in updating the wiki.

--------------------

UNIF Mapper BMC-Super24in1SC03 represents the unlicensed "Super Game X-in-1" multicarts. It typically glues together 3 or 4 MMC3-compatible games in a single pak.

PRG ROM size: 512 KiB
CHR capacity: 512 KiB ROM
Nametable mirroring: Vertical

In addition to all the MMC3 registers ($8000-$FFFF), this mapper introduces the following:

$5FF0 - Bank Size
$5FF1 - PRG Bank
$5FF2 - CHR Bank

Since multiple games are stored sequentially in the ROMs, the MMC3 logic must be redirected to the segments associated with a particular game. This involves an offset to establish the start of the segment and a mask to establish the length of the segment.

When any of the registers above are updated:

1. Set the PRG Offset to (PRG Bank << 14).
2. Use the lower 3 bits of Bank Size as an index into the following list to obtain the PRG Mask: { $7FFFF, $3FFFF, $1FFFF, $3FFF, $7FFF, $1FFF, $1FFF, $1FFF }
3. If bit 5 of Bank Size is set, then set the CHR Offset to 0 and the CHR Mask to $1FFF.
4. Otherwise, set the CHR Offset to (CHR Bank << 13) and the CHR Mask to $3FFFF.

On initialization, set Bank Size to $24, PRG Bank to $9F and CHR Bank to 0, and carry out the above 4 steps.

Be sure to mask PRG and CHR ROM appropriately to restrict access to the 512K limits.
Last edited by zeroone on Sun May 01, 2016 5:36 pm, edited 1 time in total.
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: UNIF mappers

Post by lidnariq »

You should feel free to update &// create documentation on the wiki.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

lidnariq wrote:You should feel free to update &// create documentation on the wiki.
I'll start documenting there at some point. The wiki is mostly written from a hardware perspective. In contrast, any documentation I write will be based on reverse engineering the source code of other emulators. I maybe able to express how to emulate the boards, but I won't be able to explain why that logic is required.

Case in point, it took me a while to get the Super 4-in-1 games working for the BMC-Super24in1SC03 UNIF mapper. In fact, both FCEUX and Nestopia crash when it is loaded. I ultimately traced this down to a bad instruction being executed as a consequence of the mapper not starting up at the correct ROM address. However, Nintendulator loads and runs the game just fine. The only difference in the source came down to the MMC3 implementation. In Nintendulator, the CHR bank registers are initialized sequentially (i.e. 0, 1, 2, 3, 4, 5, 6, 7) and the PRG bank registers are initialized to point to the end of the ROM (i.e. -4, -3, -2, -1). The wiki says, "R6, R7, and $8000 are unspecified at power on". Perhaps the pirate UNIF carts are wired up to effectively initialize the registers in this way. Whatever the case, it wouldn't startup without those initial register values. I never saw any other pirate MMC3 with this requirement.
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: UNIF mappers

Post by lidnariq »

There are a few pirate ASICs (MMC3 variants or not) that have requirements on initial power-up values although the crap about linking to Firebug's original mapper documentation on the wiki has made it impractical to find them all
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

Another interesting thing that I found is that FCEUX already mapped a few of the UNIF boards to unused iNES mapper numbers. For instance:

Code: Select all

	{"MMC3 PIRATE H2288",	123, UNLH2288_Init},
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

Listed below is the subset of Bodkinz's UNIF files that are not supported by FCEUX and Nintendulator. Any idea on where I can get more information on these boards?

Code: Select all

-- FARID_SLROM_8-IN-1 -----------------------------

File name: [UNIF] farid slrom 8- in-1 (unl).unf
File format: UNIF
File CRC: 1AA55844 (unknown)
Name: FARID SLROM 8- in - 1  (Unl)
Mapper: FARID_SLROM_8-IN-1
Board: FARID_SLROM_8-IN-1
Mirroring: Vertical
PRG ROM 0: length = 1048576, CRC = 00000000
CHR ROM 0: length = 1048576, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: 56BDC3FB
CHR ROM size: 1048576 bytes
CHR ROM CRC: D944CB75
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

File name: [UNIF] nesbbs slrom 8- in-1 (unl).unf
File format: UNIF
File CRC: 267C31BE (unknown)
Name: NESBBS SLROM 8- in - 1 (Unl) 
Mapper: FARID_SLROM_8-IN-1
Board: FARID_SLROM_8-IN-1
Mirroring: Vertical
PRG ROM 0: length = 131072, CRC = 00000000
PRG ROM 1: length = 131072, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
PRG ROM 3: length = 131072, CRC = 00000000
PRG ROM 4: length = 131072, CRC = 00000000
PRG ROM 5: length = 131072, CRC = 00000000
PRG ROM 6: length = 131072, CRC = 00000000
PRG ROM 7: length = 131072, CRC = 00000000
CHR ROM 0: length = 131072, CRC = 00000000
CHR ROM 1: length = 131072, CRC = 00000000
CHR ROM 2: length = 131072, CRC = 00000000
CHR ROM 3: length = 131072, CRC = 00000000
CHR ROM 4: length = 131072, CRC = 00000000
CHR ROM 5: length = 131072, CRC = 00000000
CHR ROM 6: length = 131072, CRC = 00000000
CHR ROM 7: length = 131072, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: 4F2FE11D
CHR ROM size: 1048576 bytes
CHR ROM CRC: C83888EE
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- RESET-TXROM -----------------------------

File name: [UNIF] [JY-013] Mario Series 4in1 (Unl).unf
File format: UNIF
File CRC: 49D84ABD (unknown)
Name: [JY-013] Mario Series 4in1 (Unl)
Mapper: BMC-RESET-TXROM
Board: RESET-TXROM
Mirroring: Vertical
PRG ROM 0: length = 131072, CRC = 00000000
PRG ROM 1: length = 131072, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
PRG ROM 3: length = 131072, CRC = 00000000
CHR ROM 0: length = 131072, CRC = 00000000
CHR ROM 1: length = 131072, CRC = 00000000
CHR ROM 2: length = 131072, CRC = 00000000
CHR ROM 3: length = 131072, CRC = 00000000
PRG ROM size: 524288 bytes
PRG ROM CRC: 4558ACD5
CHR ROM size: 524288 bytes
CHR ROM CRC: C89F1E34
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- DRAGONFIGHTER -----------------------------

File name: [UNIF] Dragon Fighter (Unl)[U][!].unf
File format: UNIF
File CRC: A08632F8 (unknown)
Name: Dragon Fighter (Unl)[!]
Mapper: UNL-DRAGONFIGHTER
Board: DRAGONFIGHTER
Mirroring: Mapper Controlled
PRG ROM 0: length = 131072, CRC = 00000000
CHR ROM 0: length = 524288, CRC = 00000000
PRG ROM size: 131072 bytes
PRG ROM CRC: E43CB7A9
CHR ROM size: 524288 bytes
CHR ROM CRC: A62E97C9
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- 830425C-4391T -----------------------------

File name: [UNIF] Super Hik 6-in-1 A-030 (Unl).unf
File format: UNIF
File CRC: EE62AC32 (unknown)
Name: Super Hik 6-in-1 A-030(Unl)
Mapper: BMC-830425C-4391T
Board: 830425C-4391T
Mirroring: Vertical
PRG ROM 0: length = 262144, CRC = 00000000
PRG ROM 1: length = 262144, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
PRG ROM 3: length = 131072, CRC = 00000000
PRG ROM 4: length = 131072, CRC = 00000000
PRG ROM 5: length = 131072, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: EE62AC32
CHR ROM size: 0 bytes
CHR ROM CRC: 00000000
CHR RAM: yes
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- K-3088 -----------------------------

File name: [UNIF] 19-in-1 (k-3088) (810849-c) (unl).unf
File format: UNIF
File CRC: 775B8530 (unknown)
Name: 19-in-1(K-3088)(810849-C)(Unl)
Mapper: BMC-K-3088
Board: K-3088
Mirroring: Vertical
PRG ROM 0: length = 131072, CRC = 00000000
PRG ROM 1: length = 131072, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
PRG ROM 3: length = 131072, CRC = 00000000
PRG ROM 4: length = 131072, CRC = 00000000
PRG ROM 5: length = 131072, CRC = 00000000
PRG ROM 6: length = 131072, CRC = 00000000
PRG ROM 7: length = 131072, CRC = 00000000
CHR ROM 0: length = 131072, CRC = 00000000
CHR ROM 1: length = 131072, CRC = 00000000
CHR ROM 2: length = 131072, CRC = 00000000
CHR ROM 3: length = 131072, CRC = 00000000
CHR ROM 4: length = 131072, CRC = 00000000
CHR ROM 5: length = 131072, CRC = 00000000
CHR ROM 6: length = 131072, CRC = 00000000
CHR ROM 7: length = 131072, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: 0FCCB6F0
CHR ROM size: 1048576 bytes
CHR ROM CRC: 32B3D63F
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- CHINA_ER_SAN2 -----------------------------

File name: [UNIF] sgz2-bawangdedalu-unfv1.2-g.unf
File format: UNIF
File CRC: 92AA33C7 (unknown)
Name: 
Mapper: CHINA_ER_SAN2
Board: CHINA_ER_SAN2
Mirroring: Vertical
PRG ROM 0: length = 262144, CRC = 3F09F3C8
CHR ROM 0: length = 262144, CRC = C553A974
PRG ROM size: 262144 bytes
PRG ROM CRC: 279F78DA
CHR ROM size: 262144 bytes
CHR ROM CRC: C553A974
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 8
Dump software: 
Dump writer: uCON64;2.0.0;Win32 (MinGW)
Dump author: 
Dump date:
Read me: 

-- FARID_UNROM_8-IN-1 -----------------------------

File name: [UNIF] unrom 8-in-1 (unl).unf
File format: UNIF
File CRC: A731DBD9 (unknown)
Name: 
Mapper: FARID_UNROM_8-IN-1
Board: FARID_UNROM_8-IN-1
Mirroring: Vertical
PRG ROM 0: length = 1048576, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: A731DBD9
CHR ROM size: 0 bytes
CHR ROM CRC: 00000000
CHR RAM: yes
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 6
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- K-3033 -----------------------------

File name: [UNIF] 35-in-1 (k-3033) (6-15-c) (unl).unf
File format: UNIF
File CRC: D16E1D79 (unknown)
Name: 35-in-1(K-3033)(6-15-C)(Unl)
Mapper: BMC-K-3033
Board: K-3033
Mirroring: Vertical
PRG ROM 0: length = 131072, CRC = 00000000
PRG ROM 1: length = 131072, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
PRG ROM 3: length = 131072, CRC = 00000000
PRG ROM 4: length = 131072, CRC = 00000000
PRG ROM 5: length = 131072, CRC = 00000000
PRG ROM 6: length = 262144, CRC = 00000000
CHR ROM 0: length = 131072, CRC = 00000000
CHR ROM 1: length = 131072, CRC = 00000000
CHR ROM 2: length = 131072, CRC = 00000000
CHR ROM 3: length = 131072, CRC = 00000000
CHR ROM 4: length = 131072, CRC = 00000000
CHR ROM 5: length = 131072, CRC = 00000000
CHR ROM 6: length = 262144, CRC = 00000000
PRG ROM size: 1048576 bytes
PRG ROM CRC: 71C2171E
CHR ROM size: 1048576 bytes
CHR ROM CRC: BDED0AFD
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- STREETFIGTER-GAME4IN1 -----------------------------

File name: [UNIF] street fighter ii game 4-in-1 (unl)[p1].unf
File format: UNIF
File CRC: C3B06986 (unknown)
Name: Street Fighter II Game 4-in-1 (Unl)[p1]
Mapper: BMC-STREETFIGTER-GAME4IN1
Board: STREETFIGTER-GAME4IN1
Mirroring: Vertical
PRG ROM 0: length = 524288, CRC = 00000000
CHR ROM 0: length = 524288, CRC = 00000000
PRG ROM size: 524288 bytes
PRG ROM CRC: 408EA235
CHR ROM size: 524288 bytes
CHR ROM CRC: 9888ECFA
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- JC-016-2 -----------------------------

File name: [UNIF] 7-in-1 (JC_016_2) (Unl).unf
File format: UNIF
File CRC: B0ADB76B (unknown)
Name: 7-in-1(JC_016_2)(Unl)
Mapper: BMC-JC-016-2
Board: JC-016-2
Mirroring: Vertical
PRG ROM 0: length = 262144, CRC = 00000000
PRG ROM 1: length = 131072, CRC = 00000000
PRG ROM 2: length = 131072, CRC = 00000000
CHR ROM 0: length = 262144, CRC = 00000000
CHR ROM 1: length = 131072, CRC = 00000000
CHR ROM 2: length = 131072, CRC = 00000000
PRG ROM size: 524288 bytes
PRG ROM CRC: AC2EA298
CHR ROM size: 524288 bytes
CHR ROM CRC: 6D3B648B
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- 158B -----------------------------

File name: [UNIF] Blood Of Jurassic (GD-98)(Unl)[U][!].unf
File format: UNIF
File CRC: 1CA9C322 (unknown)
Name: Blood Of Jurassic (GD-98)(Unl)[!]
Mapper: UNL-158B
Board: 158B
Mirroring: Mapper Controlled
PRG ROM 0: length = 131072, CRC = 00000000
CHR ROM 0: length = 131072, CRC = 00000000
PRG ROM size: 131072 bytes
PRG ROM CRC: F22B14BF
CHR ROM size: 131072 bytes
CHR ROM CRC: D05443B2
CHR RAM: no
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 

-- LH51 -----------------------------

File name: [UNIF] ai senshi nicol (fds conversion,whirlwind manu)[u][!].unf
File format: UNIF
File CRC: ED3E1526 (unknown)
Name: Ai Senshi Nicol (FDS Conversion,Whirlwind Manu)[U][!]
Mapper: UNL-LH51
Board: LH51
Mirroring: Mapper Controlled
PRG ROM 0: length = 131072, CRC = 00000000
PRG ROM size: 131072 bytes
PRG ROM CRC: ED3E1526
CHR ROM size: 0 bytes
CHR ROM CRC: 00000000
CHR RAM: yes
Non-Volatile PRG RAM: no
TV System: NTSC
Any TV System: no
Controllers: 
Minimum version: 7
Dump software: 
Dump writer: 
Dump author: 
Dump date:
Read me: 
User avatar
freem
Posts: 176
Joined: Mon Oct 01, 2012 3:47 pm
Location: freemland (NTSC-U)
Contact:

Re: UNIF mappers

Post by freem »

zeroone wrote:Listed below is the subset of Bodkinz's UNIF files that are not supported by FCEUX and Nintendulator. Any idea on where I can get more information on these boards?
The FARID_* boards come from FARID's posts on this forum:
FARID_SLROM_8-IN-1
FARID_UNROM_8-IN-1

The following were dumped by CaH4e3, so your best bet is looking at FCEUmm source:
DRAGONFIGHTER
158B

I've only found mentions of these with NonGoodNES, so I have no idea who actually dumped them (possibly people on nesbbs?):
RESET-TXROM
830425C-4391T
K-3088
CHINA_ER_SAN2
K-3033
STREETFIGTER-GAME4IN1
JC-016-2
LH51
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

freem wrote: The FARID_* boards come from FARID's posts on this forum:
FARID_SLROM_8-IN-1
FARID_UNROM_8-IN-1
Thanks.

I managed to get FARID_UNROM_8-IN-1 working based on that link, but I can't understand FARID_SLROM_8-IN-1. What is that WRAM CE pin?
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: UNIF mappers

Post by lidnariq »

WRAM CE the PRG RAM positive enable from the MMC1.

Translate schematic as: If MMC1 PRG RAM access is allowed, any values written to MMC1's PRG RAM area with D3 low allow continued changing of bank; after a write with D3 high no further outer bank changes can happen until soft or hard reset.
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: UNIF mappers

Post by zeroone »

lidnariq wrote:WRAM CE the PRG RAM positive enable from the MMC1.

Translate schematic as: If MMC1 PRG RAM access is allowed, any values written to MMC1's PRG RAM area with D3 low allow continued changing of bank; after a write with D3 high no further outer bank changes can happen until soft or hard reset.
Thanks so much. That worked perfectly.
Post Reply