RE: How to design non-trivial cartridges for c-64?

From: Scott McDonnell (netsamurai_at_comcast.net)
Date: 2007-05-22 01:44:16

ATT,

No schematic, but I can offer a simple description that might help you
get going:

IO1 and IO2 are address decoded outputs. This means that if you read or
write to $DE00-DEFF (any of those locations...yeah, the address decoding
on the C64 is VERY wasted) it will assert the IO1 line. You would use
this line as an enable for some form of "register" you provide in your
cartridge. You could connect a 4 bit latch to the data lines for example
and use the IO1 line as the latch enable. The output of the latch would
connect to the select lines  of something like a 1-of-4, 1-of-8 or
1-of-16 decoder such as a 74FCT138 (1-of-8 decoder.) The outputs of the
decoder would connect to the Chip Enable/Output Enable/etc.. of your
RAM/ROM/Flash/Peripheral. So, in this example, if you wrote $00 to
address $DE00, the d0 line of the decoder will remain asserted and will
be selecting one bank. If you wrote $01 to address $DE00, then the d1
line on the decoder would be asserted, selecting another bank. And so
on, up to the number of decoded outputs you have (based on the decoder
and latch you choose.) This method is good for selecting one of several
different peripherals you want to control.

You mentioned selecting banks WITHIN one larger eeprom. To do this, you
wouldn't need the decoder above (but could still use it to have this
option AND other peripherals.) If you use the latch (let's say 4 bits)
and connect the outputs to the 3 MSBs of the Address bus (A14,A13,A12)
on a 32K EEPROM, you could select 4 banks of 8K. A $00 on the latch
would give you access to $0000-1FFF of the eeprom for example, a $01 on
the latch would give you access to $2000-3FFF, and so on ($02 =
$4000-5FFF, $03 = $6000-7FFF.)You are using only 3 bits of the 4 bit
latch in this example. If you have a 64K EEPROM, you would use the
fourth bit to get 8 8K pages. You probably get the idea.

This is just two examples that can be pretty simple. There are, of
course, several ways to map or bank memory, that can go from simple like
these to very complex (you could technically connect up to 256 different
peripherals or more just on IO1 if you really wanted to go crazy.) The
nice thing about the cart port on the C64 is that you have access to all
the important bus signals, and can technically take over the entire
computer from this bus. You can even provide a different processor (like
the superCPU) by using these lines. Just about the only thing you don't
have access to is the peripheral port on the 6510, which is used to swap
the memory/IO configuration of the C64. Even then, you can create code
to make the 6510 write to that port.

Basically, the idea is to create a register that you write to (and read
from with a little extra circuitry) to select a circuit you want to pay
attention to the bus and de-select the stuff you don't want to pay
attention. Make sure your circuitry is tri-state -able when you want
them to ignore so that they do not interefere with the bus transactions.
You can use a tri-state buffer if you must.

Some reading material:
http://www.onsemi.com/pub/Collateral/MC14514B-D.PDF (Cool chip that can
just about all you need in the example above)
http://www.zimmers.net/anonftp/pub/cbm/documents/chipdata/programming.re
u
"memory paging", "Bank switching", "address decoding", or "memory
mapping" in google for some examples.

You might also want to look at how the 6522, 6526, or a 8255 works with
its data direction registers, etc... You are sort of creating a limited
section of those chips.

Keep in mind any schematics you find will probably assume you need to
decode the address bus. You don't need to do that because IO1 and IO2 is
decoded for you at either $DE00 or $DF00, respectively. And keep in mind
you are only writing to or reading from these addresses to control the
register to set things up, not your peripherals.

I might have (probably did) missed a few details, but this should give
you some ideas of how to do what you want. Hope that helps!

Scott McDonnell

> -----Original Message-----
> From: owner-cbm-hackers@ling.gu.se 
> [mailto:owner-cbm-hackers@ling.gu.se] On Behalf Of 
> Antitrack@networld.at
> Sent: Monday, May 21, 2007 3:30 PM
> To: cbm-hackers@ling.gu.se
> Subject: How to design non-trivial cartridges for c-64?
> 
> 
> 
> Hello World! :-)
> 
> Since I actually successfully made my 
> 8kernal/8modules-switchboard, I thought 
> it would be a great idea to be able to make more complicated 
> cartridge hardware 
> for the c-64. However, I haven't found any sort of good 
> "manual" of how to 
> design cartridges that are above "trivial". 
> For example, I still don't know how to actually design a 
> cartridge that would 
> use just a single memory location like $df00, for example for 
> selecting the 
> right $8000-bank from a (larger) eprom on the cartridge. 
> (Such was being used 
> by Ocean to distribute some games on cart.)
> What I actually plan to do is to design a real cheap TCP-IP 
> Interface using an 
> Atmel AVR for handling all the TCPIP communication. I plan to 
> use some 
> registers like $df00-$df0a much in the way the REU (commodore 
> ram expansion) 
> does, for transfering the data from the c64 memory via DMA to 
> the Atmel AVR, 
> who should then transfer the data over TCPIP to PC etc. 
> However, as mentioned before, I'm at a complete loss of how 
> to design such a 
> thing, and I don't know how to use these lines from the cart 
> port: I/O1 , /I/O2, BA, DMA, Phi2.... Anyone has any 
> documentation on these lines or how to use them when building 
> your own complex cartdrige?
> Anyone has a schematic with an eprom and a 
> $df00-bank-switch-cartridge so as to 
> start with an example?
> 
> Yours
> ATT
> 
> 
> --------------------------------------
> Ein Service von http://www.networld.at
> 
>        Message was sent through the cbm-hackers mailing list
> 

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.