Commit 534d994f authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups

parent 94eda9b2
...@@ -147,27 +147,27 @@ unsigned char blockNumFromAddr(unsigned int addr) ...@@ -147,27 +147,27 @@ unsigned char blockNumFromAddr(unsigned int addr)
unsigned int blockNumToAddr(unsigned char chip, unsigned char blockNum) unsigned int blockNumToAddr(unsigned char chip, unsigned char blockNum)
{ {
unsigned int addr; unsigned int addr;
if(blockNum >= bootBlockStartNum) if(blockNum >= bootBlockStartNum)
{ {
addr = bootBlockStartNum * 0x10000; addr = bootBlockStartNum * 0x10000;
unsigned char bootBlock = blockNum - bootBlockStartNum; unsigned char bootBlock = blockNum - bootBlockStartNum;
if(bootBlock>=1) if(bootBlock>=1)
addr+= 0x8000; addr+= 0x8000;
if(bootBlock>=2) if(bootBlock>=2)
addr+= 0x2000; addr+= 0x2000;
if(bootBlock>=3) if(bootBlock>=3)
addr+= 0x2000; addr+= 0x2000;
} }
else else
addr = blockNum * 0x10000; addr = blockNum * 0x10000;
if(chip) if (chip)
addr+=0x200000; addr+=0x200000;
return addr; return addr;
} }
unsigned int blockSize(unsigned char blockNum) unsigned int blockSize(unsigned char blockNum)
...@@ -301,12 +301,12 @@ void writeSaveGameFile(void) ...@@ -301,12 +301,12 @@ void writeSaveGameFile(void)
} }
bytes = fwrite(&mainrom[blockNumToAddr(0, i)], 1, blockSize(i), ngfFile); bytes = fwrite(&mainrom[blockNumToAddr(0, i)], 1, blockSize(i), ngfFile);
if(bytes != blockSize(i)) if(bytes != blockSize(i))
{ {
fprintf(stderr, "writeSaveGameFile: wrote %d bytes, but exptected %d bytes\n", bytes, blockSize(i)); fprintf(stderr, "writeSaveGameFile: wrote %d bytes, but exptected %d bytes\n", bytes, blockSize(i));
fclose(ngfFile); fclose(ngfFile);
return; return;
} }
} }
} }
...@@ -328,12 +328,12 @@ void writeSaveGameFile(void) ...@@ -328,12 +328,12 @@ void writeSaveGameFile(void)
} }
bytes = fwrite(&mainrom[blockNumToAddr(1, i)], 1, blockSize(i), ngfFile); bytes = fwrite(&mainrom[blockNumToAddr(1, i)], 1, blockSize(i), ngfFile);
if(bytes != blockSize(i)) if(bytes != blockSize(i))
{ {
fprintf(stderr, "writeSaveGameFile: wrote %d bytes, but exptected %d bytes\n", bytes, blockSize(i)); fprintf(stderr, "writeSaveGameFile: wrote %d bytes, but exptected %d bytes\n", bytes, blockSize(i));
fclose(ngfFile); fclose(ngfFile);
return; return;
} }
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment