Skip to content

Commit

Permalink
Add support for Atari 5200/7800, C64, Vectrex (thx to skaman)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni committed Sep 22, 2023
1 parent b373b66 commit 5590100
Show file tree
Hide file tree
Showing 32 changed files with 69,803 additions and 65,117 deletions.
929 changes: 929 additions & 0 deletions Cart_Reader/5200.ino

Large diffs are not rendered by default.

1,021 changes: 1,021 additions & 0 deletions Cart_Reader/7800.ino

Large diffs are not rendered by default.

1,502 changes: 1,502 additions & 0 deletions Cart_Reader/C64.ino

Large diffs are not rendered by default.

162 changes: 138 additions & 24 deletions Cart_Reader/Cart_Reader.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
This project represents a community-driven effort to provide
an easy to build and easy to modify cartridge dumper.
Date: 2023-07-19
Version: 12.8
Date: 2023-09-22
Version: 12.9
SD lib: https://github.com/greiman/SdFat
LCD lib: https://github.com/olikraus/u8g2
Expand All @@ -15,13 +15,13 @@
RTC lib: https://github.com/adafruit/RTClib
Frequency lib: https://github.com/PaulStoffregen/FreqCount
Compiled with Arduino IDE 2.1.1
Compiled with Arduino IDE 2.2.1
Thanks to:
MichlK - ROM Reader for Super Nintendo
Jeff Saltzman - 4-Way Button
Wayne and Layne - Video Game Shield menu
skaman - Cart ROM READER SNES ENHANCED, Famicom Cart Dumper, Coleco-, Intellivision, Virtual Boy, WSV, PCW, ARC, Atari, ODY2, Fairchild, MSX, Pokemon Mini modules
skaman - Cart ROM READER SNES ENHANCED, Famicom Cart Dumper, Coleco-, Intellivision, Virtual Boy, WSV, PCW, ARC, Atari 2600/5200/7800, ODY2, Fairchild, MSX, Pokemon Mini, C64, Vectrex modules
Tamanegi_taro - PCE and Satellaview modules
splash5 - GBSmart, Wonderswan, NGP and Super A'can modules
partlyhuman - Casio Loopy module
Expand All @@ -39,7 +39,8 @@
jiyunomegami, splash5, Kreeblah, ramapcsx2, PsyK0p4T, Dakkaron, majorpbx, Pickle, sdhizumi,
Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman,
philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage,
vpelletier, Ancyker, mattiacci, RWeick, joshman196, partlyhuman
vpelletier, Ancyker, mattiacci, RWeick, joshman196, partlyhuman, ButThouMust, hxlnt,
breyell
And to nocash for figuring out the secrets of the SFC Nintendo Power cartridge.
Expand Down Expand Up @@ -252,6 +253,10 @@ void print_STR(byte string_number, boolean newline) {
#define mode_MSX 33
#define mode_POKE 34
#define mode_LOOPY 35
#define mode_C64 36
#define mode_5200 37
#define mode_7800 38
#define mode_VECTREX 39

// optimization-safe nop delay
#define NOP __asm__ __volatile__("nop\n\t")
Expand Down Expand Up @@ -491,9 +496,9 @@ uint32_t calculateCRC(char* fileName, char* folder, int offset) {
}

/******************************************
CRC Functions for Atari, Fairchild, Ody2, Arc modules
CRC Functions for Atari, Fairchild, Ody2, Arc, etc. modules
*****************************************/
#if (defined(enable_ATARI) || defined(enable_ODY2) || defined(enable_ARC) || defined(enable_FAIRCHILD) || defined(enable_MSX) || defined(enable_POKE))
#if (defined(enable_ATARI) || defined(enable_ODY2) || defined(enable_ARC) || defined(enable_FAIRCHILD) || defined(enable_MSX) || defined(enable_POKE) || defined(enable_5200) || defined(enable_7800) || defined(enable_C64) || defined(enable_VECTREX))

inline uint32_t updateCRC(uint8_t ch, uint32_t crc) {
uint32_t idx = ((crc) ^ (ch)) & 0xff;
Expand Down Expand Up @@ -885,12 +890,24 @@ static const char modeItem21[] PROGMEM = "Pokemon Mini (3V)";
#ifdef enable_LOOPY
static const char modeItem22[] PROGMEM = "Casio Loopy";
#endif
#ifdef enable_C64
static const char modeItem23[] PROGMEM = "Commodore 64";
#endif
#ifdef enable_5200
static const char modeItem24[] PROGMEM = "Atari 5200";
#endif
#ifdef enable_7800
static const char modeItem25[] PROGMEM = "Atari 7800";
#endif
#ifdef enable_VECTREX
static const char modeItem26[] PROGMEM = "Vectrex";
#endif
#ifdef enable_FLASH
static const char modeItem23[] PROGMEM = "Flashrom Programmer";
static const char modeItem27[] PROGMEM = "Flashrom Programmer";
#endif
static const char modeItem24[] PROGMEM = "Self Test (3V)";
static const char modeItem25[] PROGMEM = "About";
//static const char modeItem25[] PROGMEM = "Reset"; (stored in common strings array)
static const char modeItem28[] PROGMEM = "Self Test (3V)";
static const char modeItem29[] PROGMEM = "About";
//static const char modeItem30[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const modeOptions[] PROGMEM = {
#ifdef enable_GBX
modeItem1,
Expand Down Expand Up @@ -958,10 +975,22 @@ static const char* const modeOptions[] PROGMEM = {
#ifdef enable_LOOPY
modeItem22,
#endif
#ifdef enable_FLASH
#ifdef enable_C64
modeItem23,
#endif
modeItem24, modeItem25, string_reset2
#ifdef enable_5200
modeItem24,
#endif
#ifdef enable_7800
modeItem25,
#endif
#ifdef enable_VECTREX
modeItem26,
#endif
#ifdef enable_FLASH
modeItem27,
#endif
modeItem28, modeItem29, string_reset2
};

// Count menu entries
Expand Down Expand Up @@ -1033,6 +1062,18 @@ byte countMenuEntries() {
#ifdef enable_LOOPY
count++;
#endif
#ifdef enable_C64
count++;
#endif
#ifdef enable_5200
count++;
#endif
#ifdef enable_7800
count++;
#endif
#ifdef enable_VECTREX
count++;
#endif
#ifdef enable_FLASH
count++;
#endif
Expand Down Expand Up @@ -1154,22 +1195,42 @@ unsigned char fixMenuOrder(unsigned char modeMenu) {
currentEntry++;
#endif

#if defined(enable_FLASH)
#if defined(enable_C64)
translationMatrix[currentEntry] = 22;
currentEntry++;
#endif

// Self Test
#if defined(enable_5200)
translationMatrix[currentEntry] = 23;
currentEntry++;
#endif

// About
#if defined(enable_7800)
translationMatrix[currentEntry] = 24;
currentEntry++;
#endif

// Reset
#if defined(enable_VECTREX)
translationMatrix[currentEntry] = 25;
currentEntry++;
#endif

#if defined(enable_FLASH)
translationMatrix[currentEntry] = 26;
currentEntry++;
#endif

// Self Test
translationMatrix[currentEntry] = 27;
currentEntry++;

// About
translationMatrix[currentEntry] = 28;
currentEntry++;

// Reset
translationMatrix[currentEntry] = 29;
currentEntry++;

return translationMatrix[modeMenu];
}
Expand Down Expand Up @@ -1211,9 +1272,15 @@ void mainMenu() {
num_answers = menuCount - 14;
else
num_answers = 7;
} else { // currPage == 4
} else if (currPage == 4) {
option_offset = 21;
num_answers = menuCount - 21;
if (menuCount < 28)
num_answers = menuCount - 21;
else
num_answers = 7;
} else { // currPage == 5
option_offset = 28;
num_answers = menuCount - 28;
}
// Copy menuOptions out of progmem
convertPgm(modeOptions + option_offset, num_answers);
Expand Down Expand Up @@ -1389,8 +1456,36 @@ void mainMenu() {
break;
#endif

#ifdef enable_FLASH
#ifdef enable_C64
case 22:
setup_C64();
c64Menu();
break;
#endif

#ifdef enable_5200
case 23:
setup_5200();
a5200Menu();
break;
#endif

#ifdef enable_7800
case 24:
setup_7800();
a7800Menu();
break;
#endif

#ifdef enable_VECTREX
case 25:
setup_VECTREX();
vectrexMenu();
break;
#endif

#ifdef enable_FLASH
case 26:
#ifdef ENABLE_VSELECT
setup_FlashVoltage();
#endif
Expand All @@ -1399,16 +1494,16 @@ void mainMenu() {
#endif

#ifdef enable_selftest
case 23:
case 27:
selfTest();
break;
#endif

case 24:
case 28:
aboutScreen();
break;

case 25:
case 29:
resetArduino();
break;

Expand Down Expand Up @@ -3590,7 +3685,26 @@ void loop() {
loopyMenu();
}
#endif

#ifdef enable_C64
else if (mode == mode_C64) {
c64Menu();
}
#endif
#ifdef enable_5200
else if (mode == mode_5200) {
a5200Menu();
}
#endif
#ifdef enable_7800
else if (mode == mode_7800) {
a7800Menu();
}
#endif
#ifdef enable_VECTREX
else if (mode == mode_VECTREX) {
vectrexMenu();
}
#endif
else {
display_Clear();
println_Msg(F("Menu Error"));
Expand Down
Loading

0 comments on commit 5590100

Please sign in to comment.