It is currently Sun Dec 10, 2017 10:58 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Mar 15, 2014 3:26 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Making this multicartridge was a little tough, because I had to convert the NROM menu (CHR-ROM) to UNROM (CHR-RAM)
Also there is no WRAM, so I couldn't use my usual trick for generating the clock signal (STA 6000 ~ 7FFF), Instead of that I found out that I can expand the original mapper register and use the free line of original 74HC161 of UNROM to generate the clock signal :

Menu :
Image

Test on Breadboard :
Image

Front :
Image

Back :
Image

Cover :
Image

Mapper Schematic :
Image

Chips :
27C080 --> PRG-ROM
6264 --> CHR-RAM
74HC32 --> UNROM Mapper
74HC161 --> UNROM Mapper
74HC161 --> Latch

Download Multicartridge Menu Patch
Patch it to the original "Rush'n Attack (U) [!].nes"

PRG Structure :
PRG1 --> Rush'n Attack (U) [!].prg (Patched)
PRG2 --> Castlevania (U) (PRG1) [!].prg
PRG3 --> Metal Gear (U) [!].prg
PRG4 --> Jackal (U) [!].prg
PRG5 --> Rygar (U) (PRG1) [!].prg
PRG6 --> Megaman (U) [!].prg
PRG7 --> Duck Tales (U) [!].prg
PRG8 --> Duck Tales 2 (U) [!].prg

Register Bits (FFF0 ~ FFF7) :
D7........D0
ABCD EFGH
A --> D7 --> Clock Generator
B --> D6 --> PRG A19
C --> D5 --> PRG A18
D --> D4 --> PRG A17
E --> D3 --> Latch [0:EN 1:DIS]
F --> D2 --> X
G --> D1 --> X
H --> D0 --> X

Registers' Value :
GAME1 --> 1000 1XXX --> 1000 1111 --> 8F --> FFF0 --> Rush'n Attack (U) [!].nes [+Menu]
GAME2 --> 1001 1XXX --> 1001 1111 --> 9F --> FFF1 --> Castlevania (U) (PRG1) [!].nes
GAME3 --> 1010 1XXX --> 1010 1111 --> AF --> FFF2 --> Metal Gear (U) [!].nes
GAME4 --> 1011 1XXX --> 1011 1111 --> BF --> FFF3 --> Jackal (U) [!].nes
GAME5 --> 1100 1XXX --> 1100 1111 --> CF --> FFF4 --> Rygar (U) (PRG1) [!].nes
GAME6 --> 1101 1XXX --> 1101 1111 --> DF --> FFF5 --> Megaman (U) [!].nes
GAME7 --> 1110 1XXX --> 1110 1111 --> EF --> FFF6 --> Duck Tales (U) [!].nes
GAME8 --> 1111 1XXX --> 1111 1111 --> FF --> FFF7 --> Duck Tales 2 (U) [!].nes

It would be nice if someone can emulate this cartridge.


Last edited by FARID on Sat Mar 15, 2014 8:24 pm, edited 6 times in total.

Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 10:38 am 
Offline

Joined: Fri Oct 26, 2012 5:27 pm
Posts: 76
FARID wrote:
It would be nice if someone can emulate this cartridge.


Taking a look over this, I could easily add it to Bizhawk. It would be UNIF only though.


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 10:45 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
I really appreciate you, thanks.


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 11:59 am 
Offline

Joined: Fri Oct 26, 2012 5:27 pm
Posts: 76
Does the second 74'161 clear on the reset button or just on hard power?


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 12:36 pm 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
natt wrote:
Does the second 74'161 clear on the reset button or just on hard power?


What do you mean by "second"?
Do you mean the Latch 161?
The reset circuit (D1, R1, C1) clears the latch 161 by pushing the reset button
But nothing can clear the UNROM 161 because it is originally tied to 5V


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 1:04 pm 
Offline

Joined: Fri Oct 26, 2012 5:27 pm
Posts: 76
Yeah, that's what I needed.

The board is supported in Bizhawk as of r6204.

Here's a UNIF header that should work:
http://www.mediafire.com/download/xt2c9 ... header.unf

Concatenate the exactly 1MiB of PRG rom on the end of that, and it works in Bizhawk.


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 1:25 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
Just for anyone else's reference, natt gave this the UNIF MAPR FARID_UNROM_8-IN-1.


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 1:42 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
Oh, unrelated question, not important: Why not just connect the multicart latch to /ROMSEL as normal? You've already got the self-disable bit on Q3, so it's not like it'll be accidentally triggered afterwards...

For ease of wiring, you can use A0 (like Maxi 15) instead of M2 (like most other multicarts)—at worst, it toggles at 1/10th the frequency so a difference choice of R·C might be necessary.


Top
 Profile  
 
PostPosted: Sat Mar 15, 2014 8:11 pm 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
@ natt
Great, thank you very much :D

@ lidnariq
Quote:
connect the multicart latch to /ROMSEL as normal

What do you mean by "multicart latch"?

Quote:
you can use A0 (like Maxi 15) instead of M2 (like most other multicarts)—at worst, it toggles at 1/10th the frequency so a difference choice of R·C might be necessary


Can you please explain how can I calculate the correct value of them?
Digital logic is easy for me to understand, but I don't know how to design a precise analog circuit.
Please introduce me a good resource for learning this subject. Thanks


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 1:23 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
FARID wrote:
lidnariq wrote:
connect the multicart latch to /ROMSEL as normal
What do you mean by "multicart latch"?
The 74161 that you added, the one selects a 128KiB slice.
Quote:
Quote:
you can use A0 (like Maxi 15) instead of M2 (like most other multicarts)—at worst, it toggles at 1/10th the frequency so a difference choice of R·C might be necessary
Can you please explain how can I calculate the correct value of them?
Currently you're using 2.2kΩ and 100nF. 2.2kΩ · 100nF = 220µs. That's so much bigger than the low time of M2 (which is only 210ns) that the capacitor is guaranteed to stay charged so long as M2 continues oscillating. (Even if A0 is going at 1/10th the rate of M2 in the worst case, a factor of 100 is still adequate)

The other bound here is that it needs to be less time than a person might plausibly hit the reset button for. Generally we assume that a person won't be able to hit a button for less than about 5-10ms, and we've got a factor of 20-40 here, which is plenty. (A factor of 3 should be good enough).

There's one last factor: you're using a 74161 (no letters), rather than 74S, 74LS, 74HC, or anything else. This means that there's a different amount of current requires to drive a pin high or low than for other technologies. The 74161 will source up to 1.6mA of current into an input that's at 0.4V. This affects the choice of resistor: it must be able to sink more current than the gate will source such that the system of just gate and resistor will still read as low logic level. Throwing the reference stage from the SN7406 datasheet into a simulator, it looks like any resistor smaller than 2.4kΩ should work.

Meanwhile, 74LS gates only need to have .36mA drawn out of them to represent a logic low, and 74HC gates are entirely voltage-based.
Quote:
Please introduce me a good resource for learning this subject.
Can you get a copy of Horowitz & Hill's The Art of Electronics? It's more or less the go-to for analog EE. Practical Electronics for Inventors is a nice hands-on guide. I haven't really looked around on the internet for good sources, unfortunately. I like Falstad's circuit simulator (requires java), but it's not clear how well that will teach theory.


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 5:46 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Quote:
The 74161 that you added, the one selects a 128KiB slice.

I know you are referring to it but the main question is how to connect it to /ROMSEL?!

Analog Circuit seems very complicated!
Thank you for introducing the books.
I found both of them.
But they are really bulky :
The Art of Electronics - 2nd Edition - Paul Horowitz - 1041 Pages
Practical Electronics for Inventors - Paul Scherz - 625 Pages
I think reading them will take my whole life! :mrgreen:


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 11:30 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
FARID wrote:
lidnariq wrote:
The 74161 that you added, the one selects a 128KiB slice.
I know you are referring to it but the main question is how to connect it to /ROMSEL?!
Oh! sorry. I meant why not connect /ROMSEL instead of Q7 to its ↑CLK input? Right now you have to write $00 followed by $88|(bank), but I don't why the circuit couldn't be made such that the first write were unnecessary.
Quote:
I think reading them will take my whole life! :mrgreen:
Have fun! :D


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 11:52 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Quote:
I meant why not connect /ROMSEL instead of Q7 to its ↑CLK input?

Are you sure /ROMSEL remains stable enough to serve as a clock signal?
There is at least one necessary bank switch at the start up for loading the menu bank
The bank number is 06 (0000 0110) so at that point D7 will remain 0 and won't generate any unwanted clock signal

Quote:
but I don't why the circuit couldn't be made such that the first write were unnecessary.

There are too many negative verbs, I can't understand it :shock:


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 12:11 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
FARID wrote:
Quote:
I meant why not connect /ROMSEL instead of Q7 to its ↑CLK input?
Are you sure /ROMSEL remains stable enough to serve as a clock signal?
Well, the original UNROM hardware uses it.
Quote:
The bank number is 06 (0000 0110) so at that point D7 will remain 0 and won't generate any unwanted clock signal
Sure, but it's the process of writing $08 that prevents further writes to the outer bank select, so that shouldn't matter. As long as the values written have that bit clear, it should be fine...
FARID wrote:
There are too many negative verbs, I can't understand it
Er. "A different layout seems to make this extra write unnecessary. Why not do it that way?"


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 12:34 pm 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Quote:
Well, the original UNROM hardware uses it.

Yes the original UNROM 161 uses /ROMSEL as the clock signal, but it uses another important signal too, CPU R/W --> Load
I don't think /ROMSEL can handle the Latch 161 just by itself


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Gilbert and 7 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