Rename some cart info variables that indicates size (readability)

This commit is contained in:
negativeExponent
2020-02-16 22:15:25 +08:00
parent bbce95d5aa
commit d6143ef2ef
5 changed files with 26 additions and 26 deletions

View File

@@ -808,10 +808,10 @@ int iNESLoad(const char *name, FCEUFILE *fp) {
chrRom |= ((uint32)head.upper_PRG_CHR_size << 4) & 0xF00;
subMapper = (head.ROM_type3 >> 4) & 0x0F;
iNESCart.prgRam = (head.PRGRAM_size & 0x0F) ? (64 << (head.PRGRAM_size & 0x0F)) : 0;
iNESCart.chrRam = (head.CHRRAM_size & 0x0F) ? (64 << (head.CHRRAM_size & 0x0F)) : 0;
iNESCart.prgRam_battery = (head.PRGRAM_size & 0xF0) ? (64 << ((head.PRGRAM_size & 0xF0) >> 4)) : 0;
iNESCart.chrRam_battery = (head.CHRRAM_size & 0xF0) ? (64 << ((head.CHRRAM_size & 0xF0) >> 4)) : 0;
iNESCart.PRGRamSize = (head.PRGRAM_size & 0x0F) ? (64 << (head.PRGRAM_size & 0x0F)) : 0;
iNESCart.CHRRamSize = (head.CHRRAM_size & 0x0F) ? (64 << (head.CHRRAM_size & 0x0F)) : 0;
iNESCart.PRGRamSaveSize = (head.PRGRAM_size & 0xF0) ? (64 << ((head.PRGRAM_size & 0xF0) >> 4)) : 0;
iNESCart.CHRRamSaveSize = (head.CHRRAM_size & 0xF0) ? (64 << ((head.CHRRAM_size & 0xF0) >> 4)) : 0;
region = (head.Region & 3);
} else {
if (!prgRom)
@@ -832,8 +832,8 @@ int iNESLoad(const char *name, FCEUFILE *fp) {
} else if (romSize < filesize)
FCEU_PrintError(" File contains %llu bytes of unused data\n", filesize - romSize);
iNESCart.prgRom = prgRom;
iNESCart.chrRom = chrRom;
iNESCart.PRGRomSize = prgRom;
iNESCart.CHRRomSize = chrRom;
ROM_size = uppow2(prgRom);
@@ -891,8 +891,8 @@ int iNESLoad(const char *name, FCEUFILE *fp) {
if (iNES2) {
const char *tv_region[] = { "NTSC", "PAL", "Multi-region", "Dendy" };
unsigned PRGRAM = iNESCart.prgRam + iNESCart.prgRam_battery;
unsigned CHRRAM = iNESCart.chrRam + iNESCart.chrRam_battery;
unsigned PRGRAM = iNESCart.PRGRamSize + iNESCart.PRGRamSaveSize;
unsigned CHRRAM = iNESCart.CHRRamSize + iNESCart.CHRRamSaveSize;
FCEU_printf(" NES 2.0 extended iNES.\n");
FCEU_printf(" Mapper #: %3d\n", MapperNo);
@@ -902,8 +902,8 @@ int iNESLoad(const char *name, FCEUFILE *fp) {
FCEU_printf(" PRG RAM: %d KB\n", PRGRAM / 1024);
FCEU_printf(" CHR RAM: %d KB\n", CHRRAM / 1024);
if (head.ROM_type & 0x02) {
FCEU_printf(" PRG RAM backed by battery: %d KiB\n", iNESCart.prgRam_battery / 1024);
FCEU_printf(" CHR RAM backed by battery: %d KiB\n", iNESCart.chrRam_battery / 1024);
FCEU_printf(" PRG RAM backed by battery: %d KiB\n", iNESCart.PRGRamSaveSize / 1024);
FCEU_printf(" CHR RAM backed by battery: %d KiB\n", iNESCart.CHRRamSaveSize / 1024);
}
}
FCEU_printf(" Mirroring: %s\n", Mirroring == 2 ? "None (Four-screen)" : Mirroring ? "Vertical" : "Horizontal");
@@ -1011,7 +1011,7 @@ static int iNES_Init(int num) {
UNIFchrrama = 0; /* need here for compatibility with UNIF mapper code */
if (!VROM_size) {
if (iNESCart.iNES2) {
CHRRAMSize = iNESCart.chrRam + iNESCart.chrRam_battery;
CHRRAMSize = iNESCart.CHRRamSize + iNESCart.CHRRamSaveSize;
} else {
switch (num) { /* FIXME, mapper or game data base with the board parameters and ROM/RAM sizes */
case 13: CHRRAMSize = 16 * 1024; break;
@@ -1026,7 +1026,7 @@ static int iNES_Init(int num) {
case 268: CHRRAMSize = 256 * 1024; break;
default: CHRRAMSize = 8 * 1024; break;
}
iNESCart.chrRam = CHRRAMSize;
iNESCart.CHRRamSize = CHRRAMSize;
FCEU_printf(" CHR-RAM: %3d KiB\n", CHRRAMSize / 1024);
}
if (CHRRAMSize) { /* TODO: CHR-RAM are sometimes handled in mappers e.g. MMC1 using submapper 1/2/4 and CHR-RAM can be zero here */