sdl2: Fix np2cfg.biospath and check the default.ttf exists (mostly for Windows)
@@ -166,6 +166,7 @@ int np2_main(int argc, char *argv[]) {
int i, imagetype, drvfdd, drvhddSASI, drvhddSCSI;
char *ext;
char tmppath[MAX_PATH];
+ FILE *fcheck;
pos = 1;
while(pos < argc) {
@@ -187,12 +188,17 @@ int np2_main(int argc, char *argv[]) {
readlink("/proc/self/exe", np2cfg.biospath, sizeof(np2cfg.biospath) - 1);
#endif /* _WIN32 */
file_setcd(np2cfg.biospath);
+ *(file_getname(np2cfg.biospath)) = '\0';
#endif /* __LIBRETRO__ */
initload();
sprintf(tmppath, "%sdefault.ttf", np2cfg.biospath);
+ fcheck = fopen(tmppath, "rb");
+ if (fcheck != NULL) {
+ fclose(fcheck);
fontmng_setdeffontname(tmppath);
+ }
#if defined(SUPPORT_IDEIO) || defined(SUPPORT_SASI) || defined(SUPPORT_SCSI)
drvhddSASI = drvhddSCSI = 0;
