From 861998b155c967b2d9c1cf83f9d81122fe6f1e7c Mon Sep 17 00:00:00 2001 From: sanni Date: Thu, 6 Oct 2016 23:04:31 +0200 Subject: [PATCH] V19F: Fixed timing for GBA 1M flashrom save games --- Cart_Reader/Cart_Reader.ino | 6 +++--- Cart_Reader/GBA.ino | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index 1f0d56f..6e0ac95 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -2,8 +2,8 @@ Cartridge Reader for Arduino Mega2560 Author: sanni - Date: 2016-10-05 - Version: V19E + Date: 2016-10-06 + Version: V19F SD lib: https://github.com/greiman/SdFat LCD lib: https://github.com/adafruit/Adafruit_SSD1306 @@ -34,7 +34,7 @@ YamaArashi - GBA flashrom bank switch command **********************************************************************************/ -char ver[5] = "V19E"; +char ver[5] = "V19F"; /****************************************** Define Output diff --git a/Cart_Reader/GBA.ino b/Cart_Reader/GBA.ino index 7d0fcf8..16c1e7f 100644 --- a/Cart_Reader/GBA.ino +++ b/Cart_Reader/GBA.ino @@ -241,7 +241,7 @@ void gbaMenu() { println_Msg(F("Flashrom Type not supported")); print_Msg(F("ID: ")); println_Msg(flashid); - print_Error(F(":("), true); + print_Error(F(""), true); } eraseFLASH_GBA(); if (blankcheckFLASH_GBA(65536)) { @@ -264,7 +264,7 @@ void gbaMenu() { println_Msg(F("Flashrom Type not supported")); print_Msg(F("ID: ")); println_Msg(flashid); - print_Error(F(":("), true); + print_Error(F(""), true); } eraseFLASH_GBA(); // 131072 bytes are divided into two 65536 byte banks @@ -932,13 +932,13 @@ byte readByteFlash_GBA(unsigned long myAddress) { PORTK = (myAddress >> 8) & 0xFF; // Wait until byte is ready to read - __asm__("nop\n\t""nop\n\t"); + __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // Read byte byte tempByte = PINC; // Arduino running at 16Mhz -> one nop = 62.5ns - __asm__("nop\n\t"); + __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); return tempByte; } @@ -950,19 +950,19 @@ void writeByteFlash_GBA(unsigned long myAddress, byte myData) { // Arduino running at 16Mhz -> one nop = 62.5ns // Wait till output is stable - __asm__("nop\n\t"); + __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // Switch WE_FLASH(PH5) to LOW PORTH &= ~(1 << 5); // Leave WE low for at least 40ns - __asm__("nop\n\t"); + __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // Switch WE_FLASH(PH5) to HIGH PORTH |= (1 << 5); // Leave WE high for a bit - __asm__("nop\n\t"); + __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); } // Erase FLASH