mirror of
https://github.com/sanni/cartreader.git
synced 2025-02-02 06:42:38 +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
|
||||
|
||||
Author: sanni
|
||||
Date: 2016-07-31
|
||||
Version: V17D
|
||||
Date: 2016-08-15
|
||||
Version: V17E
|
||||
|
||||
SD lib: https://github.com/greiman/SdFat
|
||||
LCD lib: https://github.com/adafruit/Adafruit_SSD1306
|
||||
Clockgen: https://github.com/etherkit/Si5351Arduino
|
||||
RGB Tools lib: https://github.com/joushx/Arduino-RGB-Tools
|
||||
|
||||
Compiled with Arduino 1.6.9
|
||||
Compiled with Arduino 1.6.10
|
||||
|
||||
Thanks to:
|
||||
MichlK - ROM-Reader for Super Nintendo
|
||||
@ -31,7 +31,7 @@
|
||||
Pickle - SDD1 fix
|
||||
|
||||
**********************************************************************************/
|
||||
char ver[5] = "V17D";
|
||||
char ver[5] = "V17E";
|
||||
|
||||
/******************************************
|
||||
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
|
||||
*****************************************/
|
||||
@ -678,40 +669,6 @@ byte questionBox_Serial(const char* question, char answers[7][20], int num_answe
|
||||
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
|
||||
*****************************************/
|
||||
@ -958,7 +915,7 @@ unsigned char questionBox_OLED(const char* question, char answers[7][20], int nu
|
||||
/******************************************
|
||||
Filebrowser Module
|
||||
*****************************************/
|
||||
void fileBrowser_OLED(const char browserTitle[]) {
|
||||
void fileBrowser(const char browserTitle[]) {
|
||||
char fileNames[30][26];
|
||||
int currFile;
|
||||
filebrowse = 1;
|
||||
|
@ -310,8 +310,8 @@ byte readBank_SNES(byte myBank, word myAddress) {
|
||||
PORTF = myAddress & 0xFF;
|
||||
PORTK = (myAddress >> 8) & 0xFF;
|
||||
|
||||
// Arduino running at 16Mhz -> one nop = 62.5ns
|
||||
__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");
|
||||
// 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""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
|
||||
byte tempByte = PINC;
|
||||
@ -429,6 +429,10 @@ void getCartInfo_SNES() {
|
||||
wait();
|
||||
}
|
||||
|
||||
else if (enable_Serial) {
|
||||
println_Msg(F(" "));
|
||||
}
|
||||
|
||||
// Start manual config
|
||||
if (manualConfig == 1) {
|
||||
confMenu();
|
||||
@ -965,6 +969,16 @@ void readSRAM () {
|
||||
sd.mkdir(folder, true);
|
||||
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
|
||||
foldern = foldern + 1;
|
||||
EEPROM_writeAnything(0, foldern);
|
||||
@ -1012,12 +1026,7 @@ void readSRAM () {
|
||||
myFile.close();
|
||||
|
||||
// Signal end of process
|
||||
print_Msg(F("Saved to SAVE/"));
|
||||
print_Msg(romName);
|
||||
print_Msg(F("/"));
|
||||
print_Msg(foldern - 1);
|
||||
print_Msg(F("/"));
|
||||
println_Msg(fileName);
|
||||
println_Msg(F("Done"));
|
||||
display_Update();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user