Merge pull request #39 from ramapcsx2/various

SNES: blink LED while dumping (as with the other modules); show total…
This commit is contained in:
sanni 2019-08-31 08:02:24 +02:00 committed by GitHub
commit 61f5966a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,11 +118,21 @@ void snesMenu() {
switch (mainMenu) switch (mainMenu)
{ {
case 0: case 0:
{
display_Clear(); display_Clear();
// Change working dir to root // Change working dir to root
sd.chdir("/"); sd.chdir("/");
// get current time
unsigned long startTime = millis();
// start reading from cart
readROM_SNES(); readROM_SNES();
compare_checksum(); compare_checksum();
// print elapsed time
print_Msg(F("Time elapsed: "));
print_Msg((millis() - startTime) / 1000);
println_Msg(F("s"));
display_Update();
}
break; break;
case 1: case 1:
@ -425,6 +435,10 @@ void readLoRomBanks( unsigned int start, unsigned int total, SdFile *file)
for (int currBank = start; currBank < total; currBank++) { for (int currBank = start; currBank < total; currBank++) {
PORTL = currBank; PORTL = currBank;
// Blink led
PORTB ^= (1 << 4);
currByte = 32768; currByte = 32768;
while (1) { while (1) {
c = 0; c = 0;
@ -468,6 +482,10 @@ void readHiRomBanks( unsigned int start, unsigned int total, SdFile *file)
for (int currBank = start; currBank < total; currBank++) { for (int currBank = start; currBank < total; currBank++) {
PORTL = currBank; PORTL = currBank;
// Blink led
PORTB ^= (1 << 4);
currByte = 0; currByte = 0;
while (1) { while (1) {
c = 0; c = 0;
@ -1020,9 +1038,6 @@ void readROM_SNES() {
print_Error(F("Can't create file on SD"), true); print_Error(F("Can't create file on SD"), true);
} }
// get current time
unsigned long startTime = millis();
//Dump Derby Stallion '96 (Japan) Actual Size is 24Mb //Dump Derby Stallion '96 (Japan) Actual Size is 24Mb
if ((romType == LO) && (numBanks == 128) && (strcmp("CC86", checksumStr) == 0)) { if ((romType == LO) && (numBanks == 128) && (strcmp("CC86", checksumStr) == 0)) {
// Read Banks 0x00-0x3F for the 1st/2nd MB // Read Banks 0x00-0x3F for the 1st/2nd MB
@ -1101,6 +1116,7 @@ void readROM_SNES() {
controlIn_SNES(); controlIn_SNES();
readHiRomBanks( 240, 256, &myFile ); readHiRomBanks( 240, 256, &myFile );
if (currMemmap == 2) display_Clear(); // need more space for the progress bars
} }
dataOut(); dataOut();
@ -1181,12 +1197,6 @@ void readROM_SNES() {
// Close the file: // Close the file:
myFile.close(); myFile.close();
// print elapsed time
print_Msg(F("Time elapsed: "));
print_Msg((millis() - startTime) / 1000);
println_Msg(F("s"));
display_Update();
} }
/****************************************** /******************************************