mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-27 15:04:15 +01:00
V19F: Fixed timing for GBA 1M flashrom save games
This commit is contained in:
parent
7b03f32968
commit
861998b155
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user