diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index 6cd91c8..0c4ca59 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -2,7 +2,7 @@ Cartridge Reader for Arduino Mega2560 Date: 26.04.2021 - Version: 6.0 + Version: 6.1 SD lib: https://github.com/greiman/SdFat LCD lib: https://github.com/adafruit/Adafruit_SSD1306 @@ -39,10 +39,11 @@ Modman - N64 checksum comparison fix splash5 - EMS GB Smart cart, Wonderswan and NGP module jiyunomegami - Retrode Game Gear adapter support and code improvements + Kreeblah - NES database **********************************************************************************/ -char ver[5] = "6.0"; +char ver[5] = "6.1"; /****************************************** Libraries @@ -52,10 +53,9 @@ char ver[5] = "6.0"; // SD Card #include "SdFat.h" -#define SD_FAT_TYPE 0 -SdFat sd; -SdFile myFile; -SdFile myDir; +SdFs sd; +FsFile myDir; +FsFile myFile; // Basic Libs #include @@ -433,7 +433,7 @@ void aboutScreen() { display.drawBitmap(0, 0, sig, 128, 64, 1); println_Msg(F("Cartridge Reader")); println_Msg(F("github.com/sanni")); - print_Msg(F("2020 Version ")); + print_Msg(F("2021 Version ")); println_Msg(ver); println_Msg(F("")); println_Msg(F("")); @@ -691,7 +691,7 @@ void setup() { // Serial Begin Serial.begin(9600); Serial.println(F("Cartridge Reader")); - Serial.println(F("2020 sanni")); + Serial.println(F("2021 sanni")); Serial.println(""); // LED Error rgb.setColor(0, 0, 255); diff --git a/Cart_Reader/NES.ino b/Cart_Reader/NES.ino index 8f589b2..c9c8ed2 100644 --- a/Cart_Reader/NES.ino +++ b/Cart_Reader/NES.ino @@ -168,9 +168,9 @@ char flashID[5]; boolean flashfound = false; // NESmaker 39SF040 Flash Cart // Files -File sdFile; +FsFile sdFile; char fileCount[3]; -File nesFile; +FsFile nesFile; uint32_t prg_crc32; uint32_t chr_crc32; char filePRG[] = "PRG.bin"; @@ -589,7 +589,7 @@ int int_pow(int base, int exp) { // Power for int /****************************************** CRC Functions *****************************************/ -File crcFile; +FsFile crcFile; char tempCRC[9]; inline uint32_t updateCRC32(uint8_t ch, uint32_t crc) { @@ -598,7 +598,7 @@ inline uint32_t updateCRC32(uint8_t ch, uint32_t crc) { return tab_value ^ ((crc) >> 8); } -uint32_t crc32(File &file, uint32_t &charcnt) { +uint32_t crc32(FsFile &file, uint32_t &charcnt) { uint32_t oldcrc32 = 0xFFFFFFFF; charcnt = 0; while (file.available()) { @@ -612,7 +612,7 @@ uint32_t crc32(File &file, uint32_t &charcnt) { return ~oldcrc32; } -uint32_t crc32EEP(File &file, uint32_t &charcnt) { +uint32_t crc32EEP(FsFile &file, uint32_t &charcnt) { uint32_t oldcrc32 = 0xFFFFFFFF; charcnt = 0; while (file.available()) { diff --git a/Cart_Reader/PCE.ino b/Cart_Reader/PCE.ino index e444871..825bd4f 100644 --- a/Cart_Reader/PCE.ino +++ b/Cart_Reader/PCE.ino @@ -425,7 +425,7 @@ void read_bank_PCE_RAM(uint32_t address_start, int block_index) } //Get line from file and convert upper case to lower case -void skip_line(SdFile* readfile) +void skip_line(FsFile* readfile) { int i = 0; char str_buf; @@ -446,7 +446,7 @@ void skip_line(SdFile* readfile) } //Get line from file and convert upper case to lower case -void get_line(char* str_buf, SdFile* readfile, uint8_t maxi) +void get_line(char* str_buf, FsFile* readfile, uint8_t maxi) { int i = 0; @@ -487,7 +487,7 @@ uint32_t calculate_crc32(int n, unsigned char c[], uint32_t r) void crc_search(char *file_p, char *folder_p, uint32_t rom_size, uint32_t crc) { - SdFile rom, script; + FsFile rom, script; uint32_t r, processedsize; char gamename[100]; char crc_file[9], crc_search[9]; diff --git a/Cart_Reader/SNES.ino b/Cart_Reader/SNES.ino index b769414..8392271 100644 --- a/Cart_Reader/SNES.ino +++ b/Cart_Reader/SNES.ino @@ -482,7 +482,7 @@ byte readBank_SNES(byte myBank, word myAddress) { return tempByte; } -void readLoRomBanks( unsigned int start, unsigned int total, SdFile *file) +void readLoRomBanks( unsigned int start, unsigned int total, FsFile *file) { byte buffer[1024] = { 0 }; @@ -529,7 +529,7 @@ void readLoRomBanks( unsigned int start, unsigned int total, SdFile *file) } } -void readHiRomBanks( unsigned int start, unsigned int total, SdFile *file) +void readHiRomBanks( unsigned int start, unsigned int total, FsFile *file) { byte buffer[1024] = { 0 };