[channelf] Re: Cart dumper

  • From: "Sean Riddle" <seanriddle@xxxxxxx>
  • To: <channelf@xxxxxxxxxxxxx>
  • Date: Fri, 29 Jun 2007 21:12:11 -0500

Ian-

 

                I can't find any schematics, but it's not that complicated.
The cart/PSU needs ground, +5 and +12 for power, so I used a 15V "wall wart"
along with 7812 and 7805 voltage regulators.  To reduce heat, the 7812
connects to 15V, and the 7805 connects to the 7812's output.  The PIC is
going to toggle the signals WRITE, PHI, and ROMC3, and it's going to read
the 8-bit data bus.  So I connected PHI to PORTA.1, WRITE to PORTA.2, ROMC3
to PORTA.3 and the data bus to PORTB.  I grounded ROMC0, ROMC1, ROMC2 and
ROMC4.  So I can only generate ROMC states 00 and 08, but that's all I need;
08 clears program counter 0 and 00 is instruction fetch ("the device whose
address space includes the contents of program counter 0 must place on the
data bus the op code addressed by program counter 0; then all devices
increment the contents of program counter 0").  So I clear program counter
0, then do many instruction fetches in a loop.  After each instruction
fetch, I read the data bus and save that into a buffer.

 

                Of course the PIC needs all the normal stuff- I used a 20MHz
resonator for the clock, and you need the MCLR resistor.  I also used
PORTA.0 as serial output, and I connected an LED to PORTA.3 so I could tell
when the program was done dumping the cart.  Since you won't be sending the
dumper out to other people, the serial port should be fine and you won't
need to add the SEEPROM like I did.  I cut down an ISA slot for the carts to
plug into, and used a 40-pin socket for the PSUs.  Since they use different
address ranges, you should be able to plug both a PSU and a cart in at the
same time, but I never tried it.

 

                This code is in Pic BASIC Pro.  If you don't have their
compiler, I think you can compile it for free on their web site.  If not,
let me know and I can send you the HEX file the compiler created.

 

                The Channel F games start at 0x0800, so the first 2,048
bytes of carts will be blank (0xFFs).  The PSUs will start at 0x0000 and
0x0400.  This code will read 256x16=4,096 bytes, which is enough for all
PSUs and most of the carts.  You'll need a hex-editor to strip off the
blanks at the end of the file.

 

;Fairchild Channel F cart dumper version 2

;2/10/2004 Sean Riddle seanriddle@xxxxxxx

 

INCLUDE "modedefs.bas"

@ device pic16f84, hs_osc, wdt_off

 

DEFINE      OSC   20                ;20 MHz oscillator

 

DEFINE NO_CLRWDT 1                  ;watchdog is off

 

DEFINE DEBUG_REG PORTA        ;serial output on A.0

DEFINE DEBUG_BIT 0

DEFINE DEBUG_BAUD 4800

 

BUFSIZE CON 16                      ;16-byte buffer

 

i           VAR BYTE                ;general register

j           VAR BYTE                ;2nd general reg

k           VAR WORD                ;another

 

buf         VAR BYTE                ;buffer pointer

rom         VAR BYTE[BUFSIZE] ;buffer to store ROM

 

f8phi VAR     PORTA.1         ;clock signal

f8write VAR       PORTA.2           ;write signal

f8romc3 VAR       PORTA.3           ;ROMC3 signal

 

;CMCON=7                                  ;turn off comparators

OPTION_REG.7=0                      ;weak pull ups on port B

TRISB=$FF                           ;port B is all input

 

Low f8phi

Low f8write

Low f8romc3

 

;Debug "start..."

Pause 2000                          ;wait a couple of seconds after reset

 

 

;what I do:

;clear PC0 with ROMC state 8

;loop 256 times

;     fetch 16 bytes into buffer with ROMC state 0

;     dump buffer to serial port

 

 

                                          ; clear PC0

      f8phi=1

      f8write=1

      @ nop                         ;NOPs used to create square waves

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8write=0

 

      f8phi=1

      f8romc3=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8romc3=0

            

      f8phi=1

      f8romc3=1                     ; this puts us in ROMC state 8 - clear
PC0

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8romc3=1

 

      f8phi=1

      f8romc3=1

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      

;;;

 

      f8phi=1

      f8write=1

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8write=0

 

      f8phi=1

      f8romc3=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8write=0

 

      f8phi=1

      f8romc3=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8write=0

 

      f8phi=1

      f8romc3=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8phi=0

      @ nop

      @ nop

      @ nop

      @ nop

      f8write=0

 

 For k=1 TO 256

      For i=0 TO BUFSIZE-1

            f8phi=1

            f8write=1

            @ nop

            @ nop

            @ nop

            @ nop

            f8phi=0

            @ nop

            @ nop

            @ nop

            @ nop

            f8write=0

      

            f8phi=1

            f8romc3=0

            @ nop

            @ nop

            @ nop

            @ nop

            f8phi=0

            @ nop

            @ nop

            @ nop

            @ nop

            f8write=0

 

            f8phi=1

            f8romc3=0               ;ROMC state 0, fetch instruction

            @ nop

            @ nop

            @ nop

            @ nop

            f8phi=0

            @ nop

            @ nop

            @ nop

 

            @nop

            f8write=0

            f8phi=1

            rom[i]=PORTB            ;read databus into buffer

            f8phi=0

      Next i                        

 

    For i=0 TO BUFSIZE-1            ;dump the buffer to the serial port

      Debug rom[i]

    Next i

 Next k

 

End

 

 

                While I was doing a Google search I came across some
pictures of "prototype Channel F Carts".  Anyone have any?
http://www.retrogamingradio.com/cge/2005/ClassicGamingExpo2005/photos/photo1
77.html

 

Sean

 

From: channelf-bounce@xxxxxxxxxxxxx [mailto:channelf-bounce@xxxxxxxxxxxxx]
On Behalf Of Knowles, Ian
Sent: Friday, June 29, 2007 2:56 PM
To: channelf@xxxxxxxxxxxxx
Subject: [channelf] Cart dumper

 

 

Sorry for the delay in replying, but yes I'd like to build my own dumper,
schematics and the PIC source code would be great if you can provide them.
Thanks Sean.

Ian Knowles 

Other related posts: