Safer file loading, better showing of fatal errors (drop out of double buffering)

This commit is contained in:
stevenhowes
2021-04-03 22:30:49 +01:00
parent cd49a33a46
commit 151a4d859c
3 changed files with 12 additions and 1 deletions
+7
View File
@@ -46,6 +46,13 @@ void game2_loadmap(char* filename)
// Length will be in R4 if it exists
length = outreg.r[4];
if(length > sizeof(map[0]))
{
screen_nobuffer();
printf("Map exceeds %d bytes (%d bytes)",sizeof(map[0]),length);
exit(0);
}
// Attempt to get file info
inreg.r[0] = 16;
inreg.r[1] = (int) filename;