File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,6 +251,11 @@ void chip8_reset(bool verbose) {
251251
252252}
253253
254+ void chip8_save_profile (void ){
255+ profiles_save_current ();
256+ gui .save_profile_flag = 0 ;
257+ }
258+
254259void chip8_run (){
255260 int event ;
256261 unsigned int t1 ;
@@ -274,10 +279,7 @@ void chip8_run(){
274279 if (event & USER_QUIT ) return ;
275280 if (event & LOAD_ROM ) chip8_load_rom (NULL );
276281 if (event & SOFT_RESET ) chip8_reset (true);
277- if (event & SAVE_PROFILE ) {
278- profiles_save_current ();
279- gui .save_profile_flag = 0 ;
280- }
282+ if (event & SAVE_PROFILE ) chip8_save_profile ();
281283
282284 /* Update toast timers */
283285 toast_update ((double )interval / 1000.0 );
Original file line number Diff line number Diff line change @@ -105,9 +105,11 @@ void chip8_update_timers(void);
105105void chip8_step_cpu (int cycles );
106106void chip8_reset (bool verbose );
107107int chip8_load_bootrom (void );
108+ void chip8_save_profile (void );
108109void chip8_fetch_opcode (void );
109110void chip8_execute_opcode (void );
110111
112+
111113#ifdef __cplusplus
112114}
113115#endif
Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ static void profiles_write_to_file(void) {
273273 fclose (file );
274274}
275275
276- void profiles_save_current (void ) {
276+ void profiles_save_current () {
277277 if (!chip8 .rom_loaded || !chip8 .rom || chip8 .rom_size == 0 ) {
278278 toast_show (TOAST_ERROR , "No ROM loaded. Cannot save profile." );
279279 return ;
You can’t perform that action at this time.
0 commit comments