again, awesome !
Based on this and some others google search, i found 7 ways to add hardware on a cart.
Let me know if I made a mistake and jump to my questions on the end
1/ the Xin1 way :
using a counter, each reset give access to a dedicated address range
for ex:
http://blog.naver.com/mami0071/80204397043 (B27 is /RESET)
2/ the SRAM-for-less-than-16M way :
between (rom size) and 0x3FFFFF, address is decoded using some 74xxx to toggle between ROM and SRAM
for ex :
?? did I read NBA Jam used this way ??
3/ the bad way :
same than 2/ but using the reserved address too
0x400000 - 0x7FFFFF => MCD/32X won't work anymore
0x800000 - 0x9FFFFF => 32X definitly out
for ex :
?? I remember I read on this forum some chineses games are mapped this way ??
4/ the dtack-missing way
using the reserved but never used address range
Charles found (
viewtopic.php?t=1283) 0xBxxxxx to be the only address range not used.
But it need DTACK signal and I clearly don't know how to achieve this
for ex:
none example known
5/ the time-is-ce way
Like Mike told me on twitter yesterday, you can use /TIME like a Chip Enable signal
With a nand gate, simply disable CE on ROM at the same time
using this way give you own 256 addresses (from $A13000 to $A130FF) to write a byte
(see below for question about byte / word)
it's up to you to combine /TIME with addresses and, thanks to some logic gates, set an memory mapper (see 7)
Ex:
See Charles first sample on this same thread
6/ the time-data way
When writing to 0xA130xx, D0-D7 is the ID of the hardware you want to talk with
the classic way to handle SRAM uses this since you have to write
0 - to enable ROM
1 - to enable SRAM
we will avoid 2 and 3,because of the WriteProtect bit but you could use 4 to 0xF to define access to another hardware
Ex:
every SRAM based game ! when remap 0x200000 to SRAM / ROM according TIME & DO value
(see
http://forums.nesdev.com/viewtopic.php?f=23&t=11615 for Tiido's way)
7/ the time-address way
Like 6 but it's not D0-D7 which define the hardware ID but A7-A1
Ex:
Sega Mapper (SSF2)
Extended everdrive mapper (
http://krikzz.com/pub/support/mega-ed/d ... ssf-v2.txt)
32X
SVP
Sega Channel (
https://github.com/ekeeke/Genesis-Plus- ... rt.c#L1865)
Time 101
Code: Select all
volatile uint8 *hw_address = (volatile uint8 *)0xA130F1;
*hw_address = 0x2F;
- set /TIME to low (does anything append to /CE at the same time ?)
- set A7-A1 to 0xF1
- set /LWR to low (we write a byte)
- set D7-D0 to 0x2F
Code: Select all
volatile uint8 *hw_address = (volatile uint8 *)0xA130F1;
data = *hw_address;
- set /TIME to low (does anything append to /CE at the same time ?)
- set A7-A1 to 0xF1
- set /CAS0 to low (we write a byte)
- get data from D7-D0
Questions
- how is it possible to generate DTACK ? I understood it means address is available on the address bus but who defined it (when it's ready) ?
- you need to use /UWR and /LWR for write, /CAS0 for read.... does it mean you could write byte/word but read word only ?
- how to you set /UWR to low ? using
uint16 *hw_address = (volatile uint8 *)0xA130F2; *hw_address = 0xDEAD;
? but it will set /LWR to low too no ?
- I found several several cart pinouts. Can you confirm /CAS0 is B16 (and not B21) ?
- on every info I read about SRAM, I never found detail about the D1 (WriteProtect) bit .... Does even one game use it (I mean on the cart, not on the code) to really avoid write error ?
- how do you know which 74xxx to use based on a truth or Karnaugh table ( like on
http://blog.naver.com/mami0071/80204397301) ? it's perhaps a stupid question because the table define the nor/nand/and/... rules but how do you a 74138 or 74139 will handle these with just one chip ? a perhaps the question is "what the most used 74xxx ?"
- I didn't see a mention of the battery saving chip (or what ever it must be called), I see some reference like the BA6162 on
http://jazz-disassemblies.blogspot.fr/2 ... g.html?m=1 or the MM1026 on PStar2 at
http://blog.naver.com/mami0071/220335772170 but I never see someone adding it on a schematic ?
- could I use nvsram to avoid the additional chip and battery ? or similar since it costs a lot again, even a 8x8bit one
- to finish with additional chip, I assume buffers should be used (like on dual comm defined on previous post). What is the rule ? buffer on 2 ways line (like VD) ? or shared lines (every!) ?
Thanks
To Charles every important thread on this subject is flooded by his very useful info
(
viewtopic.php?p=12650#p12650 is the best)
To Tiido because he add useful info (like on this old post
viewtopic.php?t=235) and draw easy to read schematic (!!)