mirror of
https://github.com/sanni/cartreader.git
synced 2025-02-02 14:52:40 +01:00
V17E: Added +500ns delay per byte on SNES reads
That's an added delay of 0.5 seconds per read Megabyte.
This commit is contained in:
parent
a3afac7b3e
commit
2aa75f02b5
@ -2,15 +2,15 @@
|
|||||||
Nintendo Cart Reader for Arduino Mega2560
|
Nintendo Cart Reader for Arduino Mega2560
|
||||||
|
|
||||||
Author: sanni
|
Author: sanni
|
||||||
Date: 2016-07-31
|
Date: 2016-08-15
|
||||||
Version: V17D
|
Version: V17E
|
||||||
|
|
||||||
SD lib: https://github.com/greiman/SdFat
|
SD lib: https://github.com/greiman/SdFat
|
||||||
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
||||||
Clockgen: https://github.com/etherkit/Si5351Arduino
|
Clockgen: https://github.com/etherkit/Si5351Arduino
|
||||||
RGB Tools lib: https://github.com/joushx/Arduino-RGB-Tools
|
RGB Tools lib: https://github.com/joushx/Arduino-RGB-Tools
|
||||||
|
|
||||||
Compiled with Arduino 1.6.9
|
Compiled with Arduino 1.6.10
|
||||||
|
|
||||||
Thanks to:
|
Thanks to:
|
||||||
MichlK - ROM-Reader for Super Nintendo
|
MichlK - ROM-Reader for Super Nintendo
|
||||||
@ -31,7 +31,7 @@
|
|||||||
Pickle - SDD1 fix
|
Pickle - SDD1 fix
|
||||||
|
|
||||||
**********************************************************************************/
|
**********************************************************************************/
|
||||||
char ver[5] = "V17D";
|
char ver[5] = "V17E";
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Choose Output
|
Choose Output
|
||||||
@ -635,15 +635,6 @@ unsigned char question_box(const char* question, char answers[7][20], int num_an
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fileBrowser(const char browserTitle[]) {
|
|
||||||
if (enable_OLED) {
|
|
||||||
fileBrowser_OLED(browserTitle);
|
|
||||||
}
|
|
||||||
if (enable_Serial) {
|
|
||||||
fileBrowser_Serial(browserTitle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
Serial Out
|
Serial Out
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -678,40 +669,6 @@ byte questionBox_Serial(const char* question, char answers[7][20], int num_answe
|
|||||||
return incomingByte;
|
return incomingByte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prompt a filename from the Serial Monitor
|
|
||||||
void fileBrowser_Serial(const char browserTitle[]) {
|
|
||||||
Serial.println(browserTitle);
|
|
||||||
// Print all files in root of SD
|
|
||||||
Serial.println(F("Name - Size"));
|
|
||||||
// Rewind filesystem and reset filepath
|
|
||||||
sd.vwd()->rewind();
|
|
||||||
filePath[0] = '\0';
|
|
||||||
|
|
||||||
while (myFile.openNext(sd.vwd(), O_READ)) {
|
|
||||||
if (myFile.isHidden()) {
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (myFile.isDir()) {
|
|
||||||
// Indicate a directory.
|
|
||||||
Serial.write('/');
|
|
||||||
}
|
|
||||||
myFile.printName(&Serial);
|
|
||||||
Serial.write(' ');
|
|
||||||
myFile.printFileSize(&Serial);
|
|
||||||
Serial.println();
|
|
||||||
}
|
|
||||||
myFile.close();
|
|
||||||
}
|
|
||||||
Serial.println("");
|
|
||||||
Serial.print(F("Please enter a filename in 8.3 format: _"));
|
|
||||||
while (Serial.available() == 0) {
|
|
||||||
}
|
|
||||||
String strBuffer;
|
|
||||||
strBuffer = Serial.readString();
|
|
||||||
strBuffer.toCharArray(fileName, 13);
|
|
||||||
Serial.println(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
RGB LED
|
RGB LED
|
||||||
*****************************************/
|
*****************************************/
|
||||||
@ -958,7 +915,7 @@ unsigned char questionBox_OLED(const char* question, char answers[7][20], int nu
|
|||||||
/******************************************
|
/******************************************
|
||||||
Filebrowser Module
|
Filebrowser Module
|
||||||
*****************************************/
|
*****************************************/
|
||||||
void fileBrowser_OLED(const char browserTitle[]) {
|
void fileBrowser(const char browserTitle[]) {
|
||||||
char fileNames[30][26];
|
char fileNames[30][26];
|
||||||
int currFile;
|
int currFile;
|
||||||
filebrowse = 1;
|
filebrowse = 1;
|
||||||
|
@ -310,8 +310,8 @@ byte readBank_SNES(byte myBank, word myAddress) {
|
|||||||
PORTF = myAddress & 0xFF;
|
PORTF = myAddress & 0xFF;
|
||||||
PORTK = (myAddress >> 8) & 0xFF;
|
PORTK = (myAddress >> 8) & 0xFF;
|
||||||
|
|
||||||
// Arduino running at 16Mhz -> one nop = 62.5ns
|
// Arduino running at 16Mhz -> one nop = 62.5ns -> 1000ns total
|
||||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||||
|
|
||||||
// Read
|
// Read
|
||||||
byte tempByte = PINC;
|
byte tempByte = PINC;
|
||||||
@ -429,6 +429,10 @@ void getCartInfo_SNES() {
|
|||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (enable_Serial) {
|
||||||
|
println_Msg(F(" "));
|
||||||
|
}
|
||||||
|
|
||||||
// Start manual config
|
// Start manual config
|
||||||
if (manualConfig == 1) {
|
if (manualConfig == 1) {
|
||||||
confMenu();
|
confMenu();
|
||||||
@ -965,6 +969,16 @@ void readSRAM () {
|
|||||||
sd.mkdir(folder, true);
|
sd.mkdir(folder, true);
|
||||||
sd.chdir(folder);
|
sd.chdir(folder);
|
||||||
|
|
||||||
|
// Signal end of process
|
||||||
|
print_Msg(F("Reading to SAVE/"));
|
||||||
|
print_Msg(romName);
|
||||||
|
print_Msg(F("/"));
|
||||||
|
print_Msg(foldern);
|
||||||
|
print_Msg(F("/"));
|
||||||
|
print_Msg(fileName);
|
||||||
|
print_Msg(F("..."));
|
||||||
|
display_Update();
|
||||||
|
|
||||||
// write new folder number back to eeprom
|
// write new folder number back to eeprom
|
||||||
foldern = foldern + 1;
|
foldern = foldern + 1;
|
||||||
EEPROM_writeAnything(0, foldern);
|
EEPROM_writeAnything(0, foldern);
|
||||||
@ -1012,12 +1026,7 @@ void readSRAM () {
|
|||||||
myFile.close();
|
myFile.close();
|
||||||
|
|
||||||
// Signal end of process
|
// Signal end of process
|
||||||
print_Msg(F("Saved to SAVE/"));
|
println_Msg(F("Done"));
|
||||||
print_Msg(romName);
|
|
||||||
print_Msg(F("/"));
|
|
||||||
print_Msg(foldern - 1);
|
|
||||||
print_Msg(F("/"));
|
|
||||||
println_Msg(fileName);
|
|
||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user