mirror of
https://github.com/libretro/FreeIntv.git
synced 2024-11-30 20:10:51 +00:00
more logging, intendation fixes
This commit is contained in:
parent
4f96be6e12
commit
cd5a8f971a
65
src/cart.c
65
src/cart.c
@ -43,7 +43,7 @@ int pos = 0; // current position in data
|
|||||||
|
|
||||||
int LoadCart(char *path)
|
int LoadCart(char *path)
|
||||||
{
|
{
|
||||||
printf("[INFO] [FREEINTV] Attempting to load cartridge ROM from: %s\n", path);
|
printf("[INFO] [FREEINTV] Attempting to load cartridge ROM from: %s\n", path);
|
||||||
unsigned char word[1];
|
unsigned char word[1];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
@ -56,34 +56,41 @@ int LoadCart(char *path)
|
|||||||
data[size] = word[0];
|
data[size] = word[0];
|
||||||
size++;
|
size++;
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
if (feof(fp))
|
||||||
if(isROM()) // intellicart format
|
{
|
||||||
{
|
printf("[INFO] [FREEINTV] Successful cartridge load: EOF indicator set");
|
||||||
printf("[INFO] [FREEINTV] Intellicart cartridge format detected\n");
|
}
|
||||||
return loadROM();
|
if (ferror(fp))
|
||||||
}
|
{
|
||||||
else
|
printf("[ERROR] [FREEINTV] Cartridge load error indicator set");
|
||||||
{
|
}
|
||||||
// check cartinfo database for load method
|
if(isROM()) // intellicart format
|
||||||
printf("[INFO] [FREEINTV] Intelllicart format not detected. Determining load method via database.\n");
|
{
|
||||||
switch(getLoadMethod())
|
printf("[INFO] [FREEINTV] Intellicart cartridge format detected\n");
|
||||||
{
|
return loadROM();
|
||||||
case 0: printf("[INFO] [FREEINTV] Cartridge database match: memory map 0\n"); load0(); break;
|
}
|
||||||
case 1: printf("[INFO] [FREEINTV] Cartridge database match: memory map 1\n"); load1(); break;
|
else
|
||||||
case 2: printf("[INFO] [FREEINTV] Cartridge database match: memory map 2\n"); load2(); break;
|
{
|
||||||
case 3: printf("[INFO] [FREEINTV] Cartridge database match: memory map 3\n"); load3(); break;
|
// check cartinfo database for load method
|
||||||
case 4: printf("[INFO] [FREEINTV] Cartridge database match: memory map 4\n"); load4(); break;
|
printf("[INFO] [FREEINTV] Intelllicart format not detected. Determining load method via database.\n");
|
||||||
case 5: printf("[INFO] [FREEINTV] Cartridge database match: memory map 5\n"); load5(); break;
|
switch(getLoadMethod())
|
||||||
case 6: printf("[INFO] [FREEINTV] Cartridge database match: memory map 6\n"); load6(); break;
|
{
|
||||||
case 7: printf("[INFO] [FREEINTV] Cartridge database match: memory map 7\n"); load7(); break;
|
case 0: printf("[INFO] [FREEINTV] Cartridge database match: memory map 0\n"); load0(); break;
|
||||||
case 8: printf("[INFO] [FREEINTV] Cartridge database match: memory map 8\n"); load8(); break;
|
case 1: printf("[INFO] [FREEINTV] Cartridge database match: memory map 1\n"); load1(); break;
|
||||||
case 9: printf("[INFO] [FREEINTV] Cartridge database match: memory map 9\n"); load9(); break;
|
case 2: printf("[INFO] [FREEINTV] Cartridge database match: memory map 2\n"); load2(); break;
|
||||||
default: printf("[INFO] [FREEINTV] No database match. Using default cartridge memory map.\n"); load0();
|
case 3: printf("[INFO] [FREEINTV] Cartridge database match: memory map 3\n"); load3(); break;
|
||||||
}
|
case 4: printf("[INFO] [FREEINTV] Cartridge database match: memory map 4\n"); load4(); break;
|
||||||
}
|
case 5: printf("[INFO] [FREEINTV] Cartridge database match: memory map 5\n"); load5(); break;
|
||||||
printf("[INFO] [FREEINTV] Cartridge ROM loaded into memory.\n");
|
case 6: printf("[INFO] [FREEINTV] Cartridge database match: memory map 6\n"); load6(); break;
|
||||||
return 1;
|
case 7: printf("[INFO] [FREEINTV] Cartridge database match: memory map 7\n"); load7(); break;
|
||||||
|
case 8: printf("[INFO] [FREEINTV] Cartridge database match: memory map 8\n"); load8(); break;
|
||||||
|
case 9: printf("[INFO] [FREEINTV] Cartridge database match: memory map 9\n"); load9(); break;
|
||||||
|
default: printf("[INFO] [FREEINTV] No database match. Using default cartridge memory map.\n"); load0();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("[INFO] [FREEINTV] Cartridge ROM loaded into memory.\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user