Fix compiler warnings/errors

This commit is contained in:
sanni 2024-08-16 16:53:55 +02:00
parent edc2b2fa15
commit 06243694d4
5 changed files with 353 additions and 279 deletions

View File

@ -291,7 +291,7 @@ void writeData3F_2600(uint16_t addr, uint8_t data) {
boolean checkE7(uint16_t bank) {
writeData_2600(0x1800, 0xFF);
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);
}

View File

@ -37,13 +37,14 @@
fceux - iNes header
PsyK0p4T - Sufami Turbo module
LuigiBlood - SNES Game Processor RAM Cassette module
And a special Thank You to all coders and contributors on Github and the Arduino forum:
jiyunomegami, splash5, Kreeblah, ramapcsx2, PsyK0p4T, Dakkaron, majorpbx, Pickle, sdhizumi,
Uzlopak, sakman55, Tombo89, scrap-a, borti4938, vogelfreiheit, CaitSith2, Modman, Chomemel,
philenotfound, karimhadjsalem, nsx0r, ducky92, niklasweber, Lesserkuma, BacteriaMage, qufb,
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.

File diff suppressed because it is too large Load Diff

View File

@ -105,7 +105,7 @@ byte ljprosize;
byte newljprosize;
char mnfID[3];
char deviceID[5];
char deviceID_str[5];
boolean ljproflash1found = false;
boolean ljproflash2found = false;
byte ljproflash1size;
@ -346,18 +346,18 @@ void readID_U1() // Parallel Mode
CS1_HIGH; // U1 HIGH
// Flash ID
sprintf(mnfID, "%02X", id0);
sprintf(deviceID, "%02X%02X", id1, id2);
sprintf(deviceID_str, "%02X%02X", id1, id2);
// println_Msg(mnfID);
// println_Msg(deviceID);
// println_Msg(deviceID_str);
// display_Update();
if(strcmp(deviceID, "2015") == 0) { // MX25L1605
if(strcmp(deviceID_str, "2015") == 0) { // MX25L1605
ljproflash1found = 1;
ljproflash1size = 2;
display_Clear();
println_Msg(F("U1 MX25L1605 FOUND"));
display_Update();
}
else if (strcmp(deviceID, "2016") == 0) { // MX25L3205
else if (strcmp(deviceID_str, "2016") == 0) { // MX25L3205
ljproflash1found = 1;
ljproflash1size = 4;
display_Clear();
@ -380,17 +380,17 @@ void readID_U2() // Parallel Mode
CS2_HIGH; // U2 HIGH
// Flash ID
sprintf(mnfID, "%02X", id0);
sprintf(deviceID, "%02X%02X", id1, id2);
sprintf(deviceID_str, "%02X%02X", id1, id2);
// println_Msg(mnfID);
// println_Msg(deviceID);
// println_Msg(deviceID_str);
// display_Update();
if(strcmp(deviceID, "2015") == 0) { // MX25L1605
if(strcmp(deviceID_str, "2015") == 0) { // MX25L1605
ljproflash2found = 1;
ljproflash2size = 2;
println_Msg(F("U2 MX25L1605 FOUND"));
display_Update();
}
else if (strcmp(deviceID, "2016") == 0) { // MX25L3205
else if (strcmp(deviceID_str, "2016") == 0) { // MX25L3205
ljproflash2found = 1;
ljproflash2size = 4;
println_Msg(F("U2 MX25L3205 FOUND"));

View File

@ -76,10 +76,10 @@
#define NAND_1A_LOW PORTH &= ~(1 << 3)
#define NAND_1B_HIGH PORTH |= (1 << 4)
#define NAND_1B_LOW PORTH &= ~(1 << 4) // Built-in RAM + I/O
#define WE_HIGH PORTH |= (1 << 5)
#define WE_LOW PORTH &= ~(1 << 5)
#define OE_HIGH PORTH |= (1 << 6)
#define OE_LOW PORTH &= ~(1 << 6)
#define WE_HIGH_PCW PORTH |= (1 << 5)
#define WE_LOW_PCW PORTH &= ~(1 << 5)
#define OE_HIGH_PCW PORTH |= (1 << 6)
#define OE_LOW_PCW PORTH &= ~(1 << 6)
#define MODE_READ DDRC = 0 // [INPUT]
#define MODE_WRITE DDRC = 0xFF //[OUTPUT]
@ -207,8 +207,8 @@ void read_setup_PCW()
{
NAND_1A_HIGH;
NAND_1B_HIGH;
OE_HIGH;
WE_HIGH;
OE_HIGH_PCW;
WE_HIGH_PCW;
LE_LOW;
}
@ -226,11 +226,11 @@ unsigned char read_rom_byte_PCW(unsigned long address)
__asm__("nop\n\t"
"nop\n\t");
// Read Data on AD0-AD7
OE_LOW;
OE_LOW_PCW;
DATA_READ;
delayMicroseconds(5); // 3+ Microseconds for Problem Carts
unsigned char data = PINC;
OE_HIGH;
OE_HIGH_PCW;
return data;
}
@ -254,7 +254,7 @@ unsigned char read_ram_byte_1A_PCW(unsigned long address)
"nop\n\t"
"nop\n\t");
// Read Data on AD0-AD7
OE_LOW;
OE_LOW_PCW;
DATA_READ;
__asm__("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");
unsigned char data = PINC;
OE_HIGH;
OE_HIGH_PCW;
NAND_1A_HIGH;
__asm__("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");
// Read Data on AD0-AD7
OE_LOW;
OE_LOW_PCW;
DATA_READ;
__asm__("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");
unsigned char data = PINC;
OE_HIGH;
OE_HIGH_PCW;
NAND_1B_HIGH;
__asm__("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
LE_LOW; // Address Latched
// Write Data on AD0-AD7 - WE LOW ~240-248ns
WE_LOW;
WE_LOW_PCW;
PORTC = data;
__asm__("nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t");
WE_HIGH;
WE_HIGH_PCW;
NAND_1A_HIGH;
}
@ -358,7 +358,7 @@ void write_ram_byte_1B_PCW(unsigned long address, unsigned char data)
PORTC = address & 0xFF; // A0-A7
LE_LOW; // Address Latched
// Write Data on AD0-AD7 - WE LOW ~740ns
WE_LOW;
WE_LOW_PCW;
PORTC = data;
__asm__("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");
WE_HIGH;
WE_HIGH_PCW;
NAND_1B_HIGH;
}
@ -540,13 +540,13 @@ void write_bank_byte_PCW(unsigned char data)
PORTC = 0xFF; // A0-A7
LE_LOW; // Address Latched
// Write Data on AD0-AD7 - WE LOW ~728-736ns
WE_LOW;
WE_LOW_PCW;
PORTC = data;
for (unsigned int x = 0; x < 40; x++)
__asm__("nop\n\t");
WE_HIGH;
WE_HIGH_PCW;
NAND_1B_HIGH;
}