@@ -4682,9 +4682,9 @@ bool runloop_event_init_core(
46824682 if (!runloop_st -> current_core .retro_run )
46834683 runloop_st -> current_core .retro_run = retro_run_null ;
46844684 runloop_st -> current_core .flags |= RETRO_CORE_FLAG_SYMBOLS_INITED ;
4685- runloop_st -> last_error_code = 0 ;
4686- runloop_st -> current_core .retro_get_system_info (& sys_info -> info );
46874685
4686+ RESET_ERROR_CODE ;
4687+ runloop_st -> current_core .retro_get_system_info (& sys_info -> info );
46884688 if (runloop_st -> last_error_code )
46894689 LOG_ERROR_CODE (LOG , "init_core get_system_info" );
46904690
@@ -4777,7 +4777,7 @@ bool runloop_event_init_core(
47774777
47784778 video_st -> frame_cache_data = NULL ;
47794779
4780- runloop_st -> last_error_code = 0 ;
4780+ RESET_ERROR_CODE ;
47814781 runloop_st -> current_core .retro_init ();
47824782 runloop_st -> current_core .flags |= RETRO_CORE_FLAG_INITED ;
47834783 if (runloop_st -> last_error_code )
@@ -7511,7 +7511,6 @@ bool core_set_cheat(retro_ctx_cheat_info_t *info)
75117511 unsigned run_ahead_frames = 0 ;
75127512 bool run_ahead_secondary_instance = false;
75137513 bool want_runahead = false;
7514- runloop_st -> last_error_code = 0 ;
75157514
75167515 if (settings )
75177516 {
@@ -7528,6 +7527,7 @@ bool core_set_cheat(retro_ctx_cheat_info_t *info)
75287527 }
75297528#endif
75307529
7530+ RESET_ERROR_CODE ;
75317531 runloop_st -> current_core .retro_cheat_set (info -> index , info -> enabled , info -> code );
75327532
75337533 if (runloop_st -> last_error_code )
@@ -7561,7 +7561,6 @@ bool core_reset_cheat(void)
75617561 unsigned run_ahead_frames = 0 ;
75627562 bool run_ahead_secondary_instance = false;
75637563 bool want_runahead = false;
7564- runloop_st -> last_error_code = 0 ;
75657564
75667565 if (settings )
75677566 {
@@ -7578,6 +7577,7 @@ bool core_reset_cheat(void)
75787577 }
75797578#endif
75807579
7580+ RESET_ERROR_CODE ;
75817581 runloop_st -> current_core .retro_cheat_reset ();
75827582 if (runloop_st -> last_error_code )
75837583 LOG_ERROR_CODE (LOG , "core_cheat_reset" );
@@ -7659,7 +7659,6 @@ bool core_load_game(retro_ctx_load_content_info_t *load_info)
76597659 runloop_state_t * runloop_st = & runloop_state ;
76607660
76617661 video_st -> frame_cache_data = NULL ;
7662- runloop_st -> last_error_code = 0 ;
76637662
76647663#ifdef HAVE_RUNAHEAD
76657664 runahead_set_load_content_info (runloop_st , load_info );
@@ -7712,7 +7711,7 @@ bool core_get_system_info(struct retro_system_info *sysinfo)
77127711 if (!sysinfo )
77137712 return false;
77147713
7715- runloop_st -> last_error_code = 0 ;
7714+ RESET_ERROR_CODE ;
77167715 runloop_st -> current_core .retro_get_system_info (sysinfo );
77177716 if (runloop_st -> last_error_code )
77187717 LOG_ERROR_CODE (LOG , "core_get_system_info" );
@@ -7723,8 +7722,8 @@ bool core_get_system_info(struct retro_system_info *sysinfo)
77237722bool core_unserialize (retro_ctx_serialize_info_t * info )
77247723{
77257724 runloop_state_t * runloop_st = & runloop_state ;
7726- runloop_st -> last_error_code = 0 ;
77277725
7726+ RESET_ERROR_CODE ;
77287727 if (!info || !runloop_st -> current_core .retro_unserialize (info -> data_const , info -> size ))
77297728 {
77307729 if (runloop_st -> last_error_code )
@@ -7771,8 +7770,8 @@ bool core_unserialize_special(retro_ctx_serialize_info_t *info)
77717770bool core_serialize (retro_ctx_serialize_info_t * info )
77727771{
77737772 runloop_state_t * runloop_st = & runloop_state ;
7774- runloop_st -> last_error_code = 0 ;
7775-
7773+
7774+ RESET_ERROR_CODE ;
77767775 if (!info || !runloop_st -> current_core .retro_serialize (info -> data , info -> size ))
77777776 {
77787777 if (runloop_st -> last_error_code )
@@ -7845,8 +7844,8 @@ void core_reset(void)
78457844 runloop_state_t * runloop_st = & runloop_state ;
78467845 video_driver_state_t * video_st = video_state_get_ptr ();
78477846 video_st -> frame_cache_data = NULL ;
7848- runloop_st -> last_error_code = 0 ;
78497847
7848+ RESET_ERROR_CODE ;
78507849 runloop_st -> current_core .retro_reset ();
78517850
78527851 if (runloop_st -> last_error_code )
0 commit comments