arcade: better error visibility.

This commit is contained in:
sorgelig
2019-12-21 08:08:56 +08:00
parent a311d13591
commit 2e12b079d5
4 changed files with 11 additions and 13 deletions

View File

@@ -32,7 +32,7 @@ struct arc_struct {
struct MD5Context context;
};
char global_error_msg[kBigTextSize];
static char arcade_error_msg[kBigTextSize] = {};
static char arcade_root[kBigTextSize];
#define DEBUG_ROM_BINARY 0
@@ -450,22 +450,21 @@ int arcade_send_rom(const char *xml)
XMLDoc_parse_file_SAX(xml, &sax, &arc_info);
if (arc_info.validrom0 == 0 && strlen(arc_info.error_msg))
{
strcpy(global_error_msg, arc_info.error_msg);
printf("arcade_send_rom: pretty error: [%s]\n", global_error_msg);
strcpy(arcade_error_msg, arc_info.error_msg);
printf("arcade_send_rom: pretty error: [%s]\n", arcade_error_msg);
}
buffer_destroy(arc_info.data);
return 0;
}
int arcade_check_error(void)
void arcade_check_error()
{
if (global_error_msg[0] != 0) {
printf("ERROR: [%s]\n", global_error_msg);
Info(global_error_msg, 1000 * 30);
global_error_msg[0] = 0;
if (arcade_error_msg[0] != 0) {
printf("ERROR: [%s]\n", arcade_error_msg);
Info(arcade_error_msg, 1000 * 30);
arcade_error_msg[0] = 0;
sleep(3);
}
return 0;
}
static const char *get_rbf(const char *xml)

View File

@@ -3,6 +3,6 @@
int arcade_send_rom(const char *xml);
int arcade_load(const char *xml);
int arcade_check_error(void);
void arcade_check_error();
#endif

View File

@@ -917,6 +917,7 @@ void user_io_init(const char *path, const char *xml)
// release reset
user_io_8bit_set_status(0, UIO_STATUS_RESET);
if(xml) arcade_check_error();
break;
}

View File

@@ -603,8 +603,6 @@ static uint32_t show_video_info(int force)
Info(str, cfg.video_info * 1000);
}
arcade_check_error();
uint32_t scrh = v_cur.item[5];
if (height && scrh)
{