mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Make some INCBIN errors non-fatal
This commit is contained in:
@@ -764,7 +764,8 @@ void out_BinaryFile(char const *s, int32_t startPos)
|
|||||||
oFailedOnMissingInclude = true;
|
oFailedOnMissingInclude = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fatalerror("Error opening INCBIN file '%s': %s\n", s, strerror(errno));
|
error("Error opening INCBIN file '%s': %s\n", s, strerror(errno));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t fsize = -1;
|
int32_t fsize = -1;
|
||||||
@@ -830,7 +831,8 @@ void out_BinaryFileSlice(char const *s, int32_t start_pos, int32_t length)
|
|||||||
oFailedOnMissingInclude = true;
|
oFailedOnMissingInclude = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fatalerror("Error opening INCBIN file '%s': %s\n", s, strerror(errno));
|
error("Error opening INCBIN file '%s': %s\n", s, strerror(errno));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcodesection();
|
checkcodesection();
|
||||||
@@ -846,8 +848,11 @@ void out_BinaryFileSlice(char const *s, int32_t start_pos, int32_t length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((start_pos + length) > fsize)
|
if ((start_pos + length) > fsize) {
|
||||||
fatalerror("Specified range in INCBIN is out of bounds\n");
|
error("Specified range in INCBIN is out of bounds (%" PRIu32 " + %" PRIu32
|
||||||
|
" > %" PRIu32 ")\n", start_pos, length, fsize);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fseek(f, start_pos, SEEK_SET);
|
fseek(f, start_pos, SEEK_SET);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
FATAL: incbin-empty-bad.asm(3):
|
ERROR: incbin-empty-bad.asm(3):
|
||||||
Specified range in INCBIN is out of bounds
|
Specified range in INCBIN is out of bounds (0 + 1 > 0)
|
||||||
|
error: Assembly aborted (1 errors)!
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
FATAL: incbin-end-bad.asm(3):
|
ERROR: incbin-end-bad.asm(3):
|
||||||
Specified range in INCBIN is out of bounds
|
Specified range in INCBIN is out of bounds (123 + 1 > 123)
|
||||||
|
error: Assembly aborted (1 errors)!
|
||||||
|
|||||||
Reference in New Issue
Block a user