drzaiusx11 Posted September 1, 2015 Share Posted September 1, 2015 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 1 Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 3, 2015 Author Share Posted September 3, 2015 After more digging I found this: http://www.classic-games.com/atari2600/bankswitch.html Which says an FE cart's hot spots are just 01FE and 11FE (end of stack?) so I'll give this try. 'Not sure why there is seemingly contradictory descriptions of how FE bank switches work... Quote Link to comment Share on other sites More sharing options...
san-d-2000 Posted September 3, 2015 Share Posted September 3, 2015 Could you post some pictures of the project? Quote Link to comment Share on other sites More sharing options...
Eckhard Stolberg Posted September 3, 2015 Share Posted September 3, 2015 (edited) 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 September 3, 2015 by Eckhard Stolberg 1 Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 4, 2015 Author Share Posted September 4, 2015 (edited) 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 September 4, 2015 by drzaiusx11 1 Quote Link to comment Share on other sites More sharing options...
Eckhard Stolberg Posted September 4, 2015 Share Posted September 4, 2015 A12 is used as a chip select line for the cartridge ROM on the VCS. Therefore the cartridge shouldn't be driving the data bus when you feed it addresses below $1000. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 4, 2015 Author Share Posted September 4, 2015 Excellent! I can't wait to try this over the weekend. Thanks for all the help!! Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted September 5, 2015 Share Posted September 5, 2015 Hi. I think a Raspberry Pi cart dumper would be very useful since there is few products out there that can dump 2600 games. I own a Retrode but the 2600 adapter was never released and forum members who built one claim it didn't work. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 6, 2015 Author Share Posted September 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 7, 2015 Author Share Posted September 7, 2015 Confirmed decathlon works!! Now I just need to pickup a harmony cart to make sure it works with games outside my collection... Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted September 7, 2015 Share Posted September 7, 2015 Confirmed decathlon works!! Now I just need to pickup a harmony cart to make sure it works with games outside my collection... You will need to flash it in development mode because the ROM will need to be loaded at boot. Nice work... Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 12, 2015 Author Share Posted September 12, 2015 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.) Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 19, 2015 Author Share Posted September 19, 2015 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... 1 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted September 19, 2015 Share Posted September 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted September 19, 2015 Author Share Posted September 19, 2015 (edited) 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 September 19, 2015 by drzaiusx11 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted September 20, 2015 Share Posted September 20, 2015 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." Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted October 9, 2015 Author Share Posted October 9, 2015 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! 1 Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted November 10, 2015 Author Share Posted November 10, 2015 (edited) 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: 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... Edited November 10, 2015 by drzaiusx11 2 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted November 10, 2015 Share Posted November 10, 2015 Looking good! Quote Link to comment Share on other sites More sharing options...
DrWho198 Posted November 24, 2015 Share Posted November 24, 2015 @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. Quote Link to comment Share on other sites More sharing options...
DrWho198 Posted November 25, 2015 Share Posted November 25, 2015 A small error got into my findings, D5 high selects bank 0, D5 low selects bank 1. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted December 1, 2015 Author Share Posted December 1, 2015 Thanks for the heads up, I'll try your simplified method with my board later this week. PS. Are you working on a dumper as well? Quote Link to comment Share on other sites More sharing options...
DrWho198 Posted December 1, 2015 Share Posted December 1, 2015 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. Quote Link to comment Share on other sites More sharing options...
drzaiusx11 Posted December 2, 2015 Author Share Posted December 2, 2015 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. Quote Link to comment Share on other sites More sharing options...
DrWho198 Posted December 2, 2015 Share Posted December 2, 2015 (edited) might be possible but the structure of my sketch is a bit different. I'll send it to you later tonight. The project I'm working on is based on an arduino mega. that makes it super cheap. Edited December 2, 2015 by DrWho198 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.