Jump to content
IGNORED

help with dumping FE carts for clone project


drzaiusx11

Recommended Posts

Hey Folks,

 

Some background: For the past few weeks I've been working on a small hobby project to implement my own 2600 clone using a raspberry pi computer that plays actual 2600 carts through an adapter board tied to its GPIO pins (I've been tentatively calling it the "pitari.") The pi boots into my application which dumps the rom and then loads stella. I basically wanted a retron5 for my 2600 carts since my heavy sixer finally died and my 7800 is on the fritz after a svideo mod gone wrong (plus my tv sucks at upscaling.) Anyways...

 

I've been having a lot of fun learning how carts, roms and mappers work. I have 2K, 4K, E0, E7, F6, and F8 carts loading fine now but I'm having some trouble with FE carts. I'm using this doc as my reference for implementing my mapper detection and dumping routines. The few (2 dozen-ish?) carts I own seem to work now with the exception of Decathlon (which is an FE cart.)

 

TL;DR: I can't for the life of me come up with a simple method for dumping FE carts since the code on the ROM itself is apparently used to switch the banks. Anyone have any clever ideas on how to dump these carts? It has obviously been done before, so I'm clearly missing something. Maybe just test a range of addresses after each read to see if I've swapped banks? Ideally, I'd like to come up with something that would work in the general case and not just the few commercial carts out there as FE (Decathlon & Robot Tank?)

 

Any help would be appreciated. If there is any interest I can release my code and/or schematics as well. At the moment the adapter board is literally just a 24pin card-connector and a 74LVC245 chip to do 5V -> 3.3V conversions on the data line to make it compatible with the pi's 3.3v inputs.

 

Thanks,

Jeff

 

 

 

  • Like 1
Link to comment
Share on other sites

I always assumed that FE bankswitching would trigger on address changes in the stack area. If you look at the internal structure of the JSR and RTS instruction, you'll notice that in both cases there are two consecutive accesses to the stack before the high byte of the destination address will be on the data bus after the next address change. Since one bank resides in $fxxx, while the other is in $dxxx, that means that D5 could be used to select the bank. So if you feed addresses $01fd, $01fe and $01ff directly one after the other into the cartridge while bit D5 on the data bus is set to the bank number you want to switch to, that should allow your cartridge reader to access both banks in a FE game.

Edited by Eckhard Stolberg
  • Like 1
Link to comment
Share on other sites

Thanks Eckhard! So my first source is more correct since it still depends on the data bus for choosing the bank (Not just hot spot address reads.)

 

Do you think I can safely set the D5 pin from my GPIO without damaging the cart (or my GPIO port)? Naturally it would be in contention with the output of the ROM chip.

 

Presumably I should also avoid reading $01fd, $01fe and $01ff in that order when dumping the cart as well?

 

As for pictures:

http://imgur.com/a/B1MMM

 

Its not much to look at right now, but I have some boards on order through batchpc that should be in soon so I can ditch this rats nest of wires.

 

I'll take a video of decathlon playing once I get this issue sorted!

Edited by drzaiusx11
  • Like 1
Link to comment
Share on other sites

If my boards on order work out I can put some up on tindie.

 

I do plan on adding bw/difficulty/reset switches and joystick ports to the design though, which may not be wanted in a dumper. My final goal was something like a better fb3 (ie full console.)

 

But as-is the design works fine for a simple cart dumper. It'd even be trivial to write a script to dump straight to a USB drive or some other media.

Link to comment
Share on other sites

Just put the ROM mapper auto detection and dumping code up on github:

https://github.com/drzaiusx11/pitari

 

The board plans and Raspberry Pi SD card image will come next, but for now if someone is interested its fairly easy to figure out the wiring by looking at my address and data assignments in the code. Just don't hook the data lines from the carts directly to the RPI since it needs to go through a buffer to convert from 5v -> 3v (otherwise you'll fry your pi.)

Link to comment
Share on other sites

I just received my harmony cart! Stardust4ever, thanks for the tip on development mode; I got it up and running with my dumper in less than 5 mins. Works great! Now I just need to test every rom for compatibility...

When you get this dumper out the door, I would love to have one, even if it's just a kit with pcb and parts bag. I've got the Retrode with GB + N64 plugins and a CopyUSB board on my NES. All that is left is something to dump Ataris with.

Link to comment
Share on other sites

Hey Startdust4Ever, no problem! Once I get the boards in after my latest revisions I can send you one at cost to play around with if you want.

 

You can wait till it's "done"--However, I'm fairly certain the hardware for dumping is pretty solid at this point.

 

Here's the items next on my todo list

- vcs compatible joystick ports

- difficulty switches

- tv type switches

- reset button

- acrylic laser cut case

 

If you only want the final product and just use it for dumping, I'll make sure the board can be populated with just the hardware needed for dumping and nothing else (to keep costs down)

Edited by drzaiusx11
Link to comment
Share on other sites

Hey Startdust4Ever, no problem! Once I get the boards in after my latest revisions I can send you one at cost to play around with if you want.

 

You can wait till it's "done"--However, I'm fairly certain the hardware for dumping is pretty solid at this point.

 

Here's the items next on my todo list

- vcs compatible joystick ports

- difficulty switches

- tv type switches

- reset button

- acrylic laser cut case

 

If you only want the final product and just use it for dumping, I'll make sure the board can be populated with just the hardware needed for dumping and nothing else (to keep costs down)

This is sweet! I'll probably need to get a second Raspberry Pi 2 to tinker with considering my first one is tied up inside my Porta Pi bartop arcade and I don't feel like dismantling it or tampering with the OS for the purpose of "tinkering."

raspberry_pi_arcade__dk_playing_dk_by_st

Link to comment
Share on other sites

  • 3 weeks later...

So I finally got around to exporting the schematics / layout files. I've also moved the joystick ports / switches to an expansion board that will attach via the JP3 port (controlled by a $0.99 PIC microcontroller) However, the controller port board is still WIP.

 

I finally ordered a new set of boards today, so in the coming weeks I should have something to send out for testing.

 

PS Awesome mini arcade cabinet!

 

post-6572-0-70040900-1444358102_thumb.png

post-6572-0-55172300-1444358168_thumb.png

post-6572-0-17306900-1444358183_thumb.png

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
UPDATE: boards are in and work great! I found a few more bugs in my dumper software though, so I'll be updating that soon. So far all my carts work with the exceptions of River Raid II and Pitfall II, but I'm fairly certain those issues are software related and not the actual hardware.
Here's an assembled unit:
post-6572-0-25701200-1447121067_thumb.png
post-6572-0-45645900-1447121166_thumb.png

 

I'm currently toying with the idea of adding colecovision and possibly intellivision ports to the board as well. Looking at the cart pinouts, colecovision should be dead simple since there isn't any bankswitching--the intv's pinouts seem a bit more complicated though (and I have less intv carts to test.)
I still need to design an enclosure as well...

post-6572-0-45645900-1447121166_thumb.png

Edited by drzaiusx11
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

@drzaiusx11:

I was looking for FE bankswitching for a my own project and Eckhard pointed me here. Your findings were really helpful but I found out that it was incomplete.

Although it does work, your code does too much. The actual bankswitch is much simpler.

All what is needed is to keep D5 high (or low for bank 0) while you set the address lines to $01FE.

This while keeping CS low ofcourse, its an address below $1000.

I hope this helps you optimise your code.

Link to comment
Share on other sites

Yes, an arduino based one that connects to a PC.

 

Most works fine, but I'm having slight problems when it comes to detecting CE RAM.

An accidental read to a CE RAM write address will write garbage to it. So when changing the address lines for a read or write, you have to avoid selecting the CE RAM range along the way.

That isn't much of a problem if you set the CS line low first, but since my reader supports MDMC aswell, this might trigger a bankswitch in MDMC. But at the moment that's only a problem with MDMC which you won't normaly find anyway ;)

CE RAM detection is not supported yet in most bank switch methods. But adding it now should not be too hard.

 

I did notice some other errors in your bankswitching code though. But its hard for me to be sure since I don't have any supported games.

Your E7 was based on an older document that had some errors in it.

this one is more recent: http://blog.kevtris.org/blogfiles/Atari%202600%20Mappers.txt

 

If you want I can share the Arduino sketch, but it's a work in progress.

Link to comment
Share on other sites

Cool! My dumper started out as an arduino uno with a couple of shift registers to get the io ports needed. That's why I'm using the wiringpi library, so I didn't have to rewrite my code when I switched to the PI ;-)

 

I could refactor out the pi specific parts of my dumper and make a tiny shared lib with detect and dump routines if there's any interest in combining efforts.

 

I'm down for at least taking a look at what you've done so far.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...