FDS fix (SubLoad() returns 0 on success now)

This commit is contained in:
Alexey 'Cluster' Avdyukhin 2020-12-21 09:42:02 +03:00
parent 1709fb7990
commit 6aebbcbb9b
2 changed files with 1 additions and 4 deletions

View File

@ -862,7 +862,7 @@ int FDSLoad(const char *name, FCEUFILE *fp) {
if ((tp = FCEU_fopen(fn, 0, "rb", 0))) {
FCEU_printf("Disk was written. Auxillary FDS file open \"%s\".\n",fn);
FreeFDSMemory();
if (!SubLoad(tp)) {
if (SubLoad(tp)) {
FCEU_PrintError("Error reading auxillary FDS file.");
if(FDSBIOS)
free(FDSBIOS);

View File

@ -1022,7 +1022,6 @@ static int iNES_Init(int num) {
while (tmp->init) {
if (num == tmp->number) {
// is this code used by the UNIF loader in any way?
UNIFchrrama = NULL; // need here for compatibility with UNIF mapper code
if (!VROM_size) {
if(!iNESCart.ines2)
@ -1045,8 +1044,6 @@ static int iNES_Init(int num) {
}
if (CHRRAMSize > 0)
{
// again. seems like this code never executed for UNIF files
// so why we need to set UNIFchrrama here?
if ((UNIFchrrama = VROM = (uint8*)FCEU_dmalloc(CHRRAMSize)) == NULL) return 2;
FCEU_MemoryRand(VROM, CHRRAMSize);
SetupCartCHRMapping(0, VROM, CHRRAMSize, 1);