iNes mapper 163 vhdl code for XC9536???

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

mightydidz
Posts: 99
Joined: Wed Jan 24, 2018 12:04 pm

iNes mapper 163 vhdl code for XC9536???

Post by mightydidz »

I've come across a mapper163 pcb online
http://www.jinhongpcb.cn/jinshouzhi/16912848.html

I was wondering if anyone have the mapper code.
I think this board uses a XC9536.

Thanks
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by aquasnake »

i dont think XC9536 can fit mapper163, even though XC9572
mightydidz
Posts: 99
Joined: Wed Jan 24, 2018 12:04 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by mightydidz »

Isnt it a XC9536 on this pcb?
https://fr.aliexpress.com/item/40006395 ... 6c373VSN7z

How many macrocell a mapper163 requires?
It can probably be ported to another CPLD?
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by aquasnake »

mightydidz wrote: Thu Oct 01, 2020 6:55 am Isnt it a XC9536 on this pcb?
https://fr.aliexpress.com/item/40006395 ... 6c373VSN7z

How many macrocell a mapper163 requires?
It can probably be ported to another CPLD?
according to this picture, the cpld has 64 pins, i guess it's a 5M160.

i compared with XC9572XL, from the VCC and GND pin assignments, it is a XC9572.
Last edited by aquasnake on Thu Oct 01, 2020 7:51 pm, edited 2 times in total.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: iNes mapper 163 vhdl code for XC9536???

Post by lidnariq »

aquasnake, why do you believe that mapper 163 is comparable in complexity to MMC3?

I don't see anything on our wiki documentation that would imply needing anywhere near 72 macrocells...
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by aquasnake »

mapper163 shall take almost 128 LEs, including its dirty protections: bit reverse, read back checking, unique prg and chr bank-switching modes
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: iNes mapper 163 vhdl code for XC9536???

Post by krzysiobal »

This is that PCB rev-en. CPLD chip indeed is XC9536 (or XC9572) in VQ44 package.

It inputs:
* CPU-D0..D7,CPU-A14,13,12,9,8, R/W, /ROMSEL, M2
* PPU-A13..A10, PPU /RD

Code: Select all

-----CPU-A------
111111
5432109876543210
****  **

0101000000000000 $5000
0101000100000000 $5100
0101001000000000 $5200
0101001100000000 $5300
It has enough input address lines for mapper 163.

But because it does not take PPU-A9 into account for automatic mid-screen pattern table switch, either it produces garbage title screen (what I doubt) or it counts scanlines, either by PPU-A13 or PPU-A12 (which is more probable because of the cap at PPU-A12) to find out the exact moment when to switch. That way it require few more macrocells for counter, but it should fit into 64 without problem - this mapper needs really little bits to store.
Attachments
sch.png
pcb-bottom-labels.jpg
pcb-top-labels.jpg
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by aquasnake »

if no supporting several fetures mentioned below:

no 4KB cram auto-switching(no ppu scanline counter register)
no default prg bank(#3) shifting(no 8bit temp register)
no bit reverse selecting(no 1bit register)
no read back checking(no 4x8bits+1bit temp registers)
and related logic modules

without these functions, a stripped-down version of mapper163 could be hacked into mapper241(very simple).

wiki's description still misses something important. please refer to fceux
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: iNes mapper 163 vhdl code for XC9536???

Post by NewRisingSun »

aquasnake wrote:wiki's description still misses something important. please refer to fceux
That complaint is sufficiently vague to be useless.
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by aquasnake »

Nanjing's mapper163 originated from Xi'an Mars(aka YanCheng). After the dissolution of Mars, some people joined the WaiXing technology(aka ESC), while others established Nanjing. Although the I2C EEPROM interface is reserved in mapper163, the SRAM is used in the save circuit instead.

However, the read address of the I2C EEPROM port is used for read back detection (hardware protection). In this case, unlike mapper164, the running program will continuously detect the value read on the $5100 / $5500 address as some kind of copy protection.

There will be some temporary registers on each write address ($5000, $5001, $5100, $5200, $5300) to temporarily store the written values, and read back those temporary registers after a certain logic operation at the I2C EEPROM read port ($5100 / $5500).
mightydidz
Posts: 99
Joined: Wed Jan 24, 2018 12:04 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by mightydidz »

I decided to order it for reverse engineering.
Received it on friday.
Its definitely a XC9536 and Krysiobal schematic is good, except for "Reset"
C6 goes to GND and R3 goes to VCC.
I can check for some resistance or capacitance if it can help.

I was wondering if anyone have a vhdl code so I may use this board to make other games?
making pokemon, harvest moon or diablo out of this board would be nice ;)
User avatar
Ben Boldt
Posts: 1149
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: iNes mapper 163 vhdl code for XC9536???

Post by Ben Boldt »

Is this board set up properly for 5V tolerant logic levels? Can it support Namco-163 audio expansion?
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: iNes mapper 163 vhdl code for XC9536???

Post by krzysiobal »

Ben Boldt wrote: Sun Oct 04, 2020 10:24 am Is this board set up properly for 5V tolerant logic levels? Can it support Namco-163 audio expansion?
CPLD: XC9536XL / 9572XL has 5V tolerant I/Os but must be powered with 3.3V - this is ok here
ROM: If they used 29F016, it has 5V power/IO - this is ok
SRAM - all 62256 are 5V power+IO - this is ok
mightydidz wrote: Sun Oct 04, 2020 5:53 am Its definitely a XC9536 and Krysiobal schematic is good, except for "Reset"
C6 goes to GND and R3 goes to VCC.
Really? Maybe if you exchange the places for resistor and capacitor, but C1 seems to be used for capacitor (my schematic does not follow the original names from that PCB)
Attachments
foo.png
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: iNes mapper 163 vhdl code for XC9536???

Post by lidnariq »

Ben Boldt wrote: Sun Oct 04, 2020 10:24 am Can it support Namco-163 audio expansion?
Mapper 163 ≠ Namco 163. Unfortunately.
mightydidz
Posts: 99
Joined: Wed Jan 24, 2018 12:04 pm

Re: iNes mapper 163 vhdl code for XC9536???

Post by mightydidz »

Here's a closeup of the Reset circuit.
11.jpg
Post Reply