mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-15 01:15:06 +01:00
Fix compiler warnings/errors
This commit is contained in:
parent
edc2b2fa15
commit
06243694d4
@ -291,7 +291,7 @@ void writeData3F_2600(uint16_t addr, uint8_t data) {
|
|||||||
boolean checkE7(uint16_t bank) {
|
boolean checkE7(uint16_t bank) {
|
||||||
writeData_2600(0x1800, 0xFF);
|
writeData_2600(0x1800, 0xFF);
|
||||||
readData_2600(0x1FE0 + bank);
|
readData_2600(0x1FE0 + bank);
|
||||||
uint32_t testdata = (readData_2600(0x1000) << 24) | (readData_2600(0x1001) << 16) | (readData_2600(0x1002) << 8) | (readData_2600(0x1003));
|
uint32_t testdata = ((uint32_t)readData_2600(0x1000) << 24) | ((uint32_t)readData_2600(0x1001) << 16) | (readData_2600(0x1002) << 8) | (readData_2600(0x1003));
|
||||||
return (testdata == 0xFFFFFFFF);
|
return (testdata == 0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,8 @@
|
|||||||
Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman, Chomemel,
|
Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman, Chomemel,
|
||||||
philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage, qufb,
|
philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage, qufb,
|
||||||
vpelletier, Ancyker, mattiacci, RWeick, ButThouMust, partlyhuman, fakkuyuu, hxlnt, breyell,
|
vpelletier, Ancyker, mattiacci, RWeick, ButThouMust, partlyhuman, fakkuyuu, hxlnt, breyell,
|
||||||
smesgr9000, joshman196, PsychoFox11, plaidpants, LuigiBlood, InvalidInterrupt
|
smesgr9000, joshman196, PsychoFox11, plaidpants, LuigiBlood, InvalidInterrupt, andy-miles,
|
||||||
|
wfmarques
|
||||||
|
|
||||||
And to nocash for figuring out the secrets of the SFC Nintendo Power cartridge.
|
And to nocash for figuring out the secrets of the SFC Nintendo Power cartridge.
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -105,7 +105,7 @@ byte ljprosize;
|
|||||||
byte newljprosize;
|
byte newljprosize;
|
||||||
|
|
||||||
char mnfID[3];
|
char mnfID[3];
|
||||||
char deviceID[5];
|
char deviceID_str[5];
|
||||||
boolean ljproflash1found = false;
|
boolean ljproflash1found = false;
|
||||||
boolean ljproflash2found = false;
|
boolean ljproflash2found = false;
|
||||||
byte ljproflash1size;
|
byte ljproflash1size;
|
||||||
@ -346,18 +346,18 @@ void readID_U1() // Parallel Mode
|
|||||||
CS1_HIGH; // U1 HIGH
|
CS1_HIGH; // U1 HIGH
|
||||||
// Flash ID
|
// Flash ID
|
||||||
sprintf(mnfID, "%02X", id0);
|
sprintf(mnfID, "%02X", id0);
|
||||||
sprintf(deviceID, "%02X%02X", id1, id2);
|
sprintf(deviceID_str, "%02X%02X", id1, id2);
|
||||||
// println_Msg(mnfID);
|
// println_Msg(mnfID);
|
||||||
// println_Msg(deviceID);
|
// println_Msg(deviceID_str);
|
||||||
// display_Update();
|
// display_Update();
|
||||||
if(strcmp(deviceID, "2015") == 0) { // MX25L1605
|
if(strcmp(deviceID_str, "2015") == 0) { // MX25L1605
|
||||||
ljproflash1found = 1;
|
ljproflash1found = 1;
|
||||||
ljproflash1size = 2;
|
ljproflash1size = 2;
|
||||||
display_Clear();
|
display_Clear();
|
||||||
println_Msg(F("U1 MX25L1605 FOUND"));
|
println_Msg(F("U1 MX25L1605 FOUND"));
|
||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
else if (strcmp(deviceID, "2016") == 0) { // MX25L3205
|
else if (strcmp(deviceID_str, "2016") == 0) { // MX25L3205
|
||||||
ljproflash1found = 1;
|
ljproflash1found = 1;
|
||||||
ljproflash1size = 4;
|
ljproflash1size = 4;
|
||||||
display_Clear();
|
display_Clear();
|
||||||
@ -380,17 +380,17 @@ void readID_U2() // Parallel Mode
|
|||||||
CS2_HIGH; // U2 HIGH
|
CS2_HIGH; // U2 HIGH
|
||||||
// Flash ID
|
// Flash ID
|
||||||
sprintf(mnfID, "%02X", id0);
|
sprintf(mnfID, "%02X", id0);
|
||||||
sprintf(deviceID, "%02X%02X", id1, id2);
|
sprintf(deviceID_str, "%02X%02X", id1, id2);
|
||||||
// println_Msg(mnfID);
|
// println_Msg(mnfID);
|
||||||
// println_Msg(deviceID);
|
// println_Msg(deviceID_str);
|
||||||
// display_Update();
|
// display_Update();
|
||||||
if(strcmp(deviceID, "2015") == 0) { // MX25L1605
|
if(strcmp(deviceID_str, "2015") == 0) { // MX25L1605
|
||||||
ljproflash2found = 1;
|
ljproflash2found = 1;
|
||||||
ljproflash2size = 2;
|
ljproflash2size = 2;
|
||||||
println_Msg(F("U2 MX25L1605 FOUND"));
|
println_Msg(F("U2 MX25L1605 FOUND"));
|
||||||
display_Update();
|
display_Update();
|
||||||
}
|
}
|
||||||
else if (strcmp(deviceID, "2016") == 0) { // MX25L3205
|
else if (strcmp(deviceID_str, "2016") == 0) { // MX25L3205
|
||||||
ljproflash2found = 1;
|
ljproflash2found = 1;
|
||||||
ljproflash2size = 4;
|
ljproflash2size = 4;
|
||||||
println_Msg(F("U2 MX25L3205 FOUND"));
|
println_Msg(F("U2 MX25L3205 FOUND"));
|
||||||
|
@ -76,10 +76,10 @@
|
|||||||
#define NAND_1A_LOW PORTH &= ~(1 << 3)
|
#define NAND_1A_LOW PORTH &= ~(1 << 3)
|
||||||
#define NAND_1B_HIGH PORTH |= (1 << 4)
|
#define NAND_1B_HIGH PORTH |= (1 << 4)
|
||||||
#define NAND_1B_LOW PORTH &= ~(1 << 4) // Built-in RAM + I/O
|
#define NAND_1B_LOW PORTH &= ~(1 << 4) // Built-in RAM + I/O
|
||||||
#define WE_HIGH PORTH |= (1 << 5)
|
#define WE_HIGH_PCW PORTH |= (1 << 5)
|
||||||
#define WE_LOW PORTH &= ~(1 << 5)
|
#define WE_LOW_PCW PORTH &= ~(1 << 5)
|
||||||
#define OE_HIGH PORTH |= (1 << 6)
|
#define OE_HIGH_PCW PORTH |= (1 << 6)
|
||||||
#define OE_LOW PORTH &= ~(1 << 6)
|
#define OE_LOW_PCW PORTH &= ~(1 << 6)
|
||||||
|
|
||||||
#define MODE_READ DDRC = 0 // [INPUT]
|
#define MODE_READ DDRC = 0 // [INPUT]
|
||||||
#define MODE_WRITE DDRC = 0xFF //[OUTPUT]
|
#define MODE_WRITE DDRC = 0xFF //[OUTPUT]
|
||||||
@ -207,8 +207,8 @@ void read_setup_PCW()
|
|||||||
{
|
{
|
||||||
NAND_1A_HIGH;
|
NAND_1A_HIGH;
|
||||||
NAND_1B_HIGH;
|
NAND_1B_HIGH;
|
||||||
OE_HIGH;
|
OE_HIGH_PCW;
|
||||||
WE_HIGH;
|
WE_HIGH_PCW;
|
||||||
LE_LOW;
|
LE_LOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,11 +226,11 @@ unsigned char read_rom_byte_PCW(unsigned long address)
|
|||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
// Read Data on AD0-AD7
|
// Read Data on AD0-AD7
|
||||||
OE_LOW;
|
OE_LOW_PCW;
|
||||||
DATA_READ;
|
DATA_READ;
|
||||||
delayMicroseconds(5); // 3+ Microseconds for Problem Carts
|
delayMicroseconds(5); // 3+ Microseconds for Problem Carts
|
||||||
unsigned char data = PINC;
|
unsigned char data = PINC;
|
||||||
OE_HIGH;
|
OE_HIGH_PCW;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ unsigned char read_ram_byte_1A_PCW(unsigned long address)
|
|||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
// Read Data on AD0-AD7
|
// Read Data on AD0-AD7
|
||||||
OE_LOW;
|
OE_LOW_PCW;
|
||||||
DATA_READ;
|
DATA_READ;
|
||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
@ -263,7 +263,7 @@ unsigned char read_ram_byte_1A_PCW(unsigned long address)
|
|||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
unsigned char data = PINC;
|
unsigned char data = PINC;
|
||||||
OE_HIGH;
|
OE_HIGH_PCW;
|
||||||
NAND_1A_HIGH;
|
NAND_1A_HIGH;
|
||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
@ -300,7 +300,7 @@ unsigned char read_ram_byte_1B_PCW(unsigned long address)
|
|||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
// Read Data on AD0-AD7
|
// Read Data on AD0-AD7
|
||||||
OE_LOW;
|
OE_LOW_PCW;
|
||||||
DATA_READ;
|
DATA_READ;
|
||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
@ -309,7 +309,7 @@ unsigned char read_ram_byte_1B_PCW(unsigned long address)
|
|||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
unsigned char data = PINC;
|
unsigned char data = PINC;
|
||||||
OE_HIGH;
|
OE_HIGH_PCW;
|
||||||
NAND_1B_HIGH;
|
NAND_1B_HIGH;
|
||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
@ -333,13 +333,13 @@ void write_ram_byte_1A_PCW(unsigned long address, unsigned char data)
|
|||||||
PORTC = address & 0xFF; // A0-A7
|
PORTC = address & 0xFF; // A0-A7
|
||||||
LE_LOW; // Address Latched
|
LE_LOW; // Address Latched
|
||||||
// Write Data on AD0-AD7 - WE LOW ~240-248ns
|
// Write Data on AD0-AD7 - WE LOW ~240-248ns
|
||||||
WE_LOW;
|
WE_LOW_PCW;
|
||||||
PORTC = data;
|
PORTC = data;
|
||||||
__asm__("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");
|
||||||
WE_HIGH;
|
WE_HIGH_PCW;
|
||||||
NAND_1A_HIGH;
|
NAND_1A_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ void write_ram_byte_1B_PCW(unsigned long address, unsigned char data)
|
|||||||
PORTC = address & 0xFF; // A0-A7
|
PORTC = address & 0xFF; // A0-A7
|
||||||
LE_LOW; // Address Latched
|
LE_LOW; // Address Latched
|
||||||
// Write Data on AD0-AD7 - WE LOW ~740ns
|
// Write Data on AD0-AD7 - WE LOW ~740ns
|
||||||
WE_LOW;
|
WE_LOW_PCW;
|
||||||
PORTC = data;
|
PORTC = data;
|
||||||
__asm__("nop\n\t"
|
__asm__("nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
@ -370,7 +370,7 @@ void write_ram_byte_1B_PCW(unsigned long address, unsigned char data)
|
|||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t"
|
"nop\n\t"
|
||||||
"nop\n\t");
|
"nop\n\t");
|
||||||
WE_HIGH;
|
WE_HIGH_PCW;
|
||||||
NAND_1B_HIGH;
|
NAND_1B_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,13 +540,13 @@ void write_bank_byte_PCW(unsigned char data)
|
|||||||
PORTC = 0xFF; // A0-A7
|
PORTC = 0xFF; // A0-A7
|
||||||
LE_LOW; // Address Latched
|
LE_LOW; // Address Latched
|
||||||
// Write Data on AD0-AD7 - WE LOW ~728-736ns
|
// Write Data on AD0-AD7 - WE LOW ~728-736ns
|
||||||
WE_LOW;
|
WE_LOW_PCW;
|
||||||
PORTC = data;
|
PORTC = data;
|
||||||
|
|
||||||
for (unsigned int x = 0; x < 40; x++)
|
for (unsigned int x = 0; x < 40; x++)
|
||||||
__asm__("nop\n\t");
|
__asm__("nop\n\t");
|
||||||
|
|
||||||
WE_HIGH;
|
WE_HIGH_PCW;
|
||||||
NAND_1B_HIGH;
|
NAND_1B_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user