prepare code to clean signatures

This commit is contained in:
Gwenhael Le Moine 2024-02-23 23:37:39 +01:00
parent bf49e00c37
commit 49c2139b4c
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
3 changed files with 12 additions and 13 deletions

View file

@ -1,4 +1,5 @@
#include <errno.h> #include <errno.h>
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -202,7 +203,7 @@ void init_display( void )
int init_emulator( void ) int init_emulator( void )
{ {
/* If files are readble => let's go */ /* If files are successfully read => return and let's go */
if ( read_files() ) { if ( read_files() ) {
if ( resetOnStartup ) if ( resetOnStartup )
saturn.PC = 0x00000; saturn.PC = 0x00000;
@ -215,17 +216,12 @@ int init_emulator( void )
init_saturn(); init_saturn();
if ( !read_rom( normalized_rom_path ) ) if ( !read_rom( normalized_rom_path ) )
exit( 1 ); exit( 1 ); /* can't read ROM */
return 0; return 0;
} }
int exit_emulator( void ) void exit_emulator( void ) { write_files(); }
{
write_files();
return 1;
}
/***********************************************/ /***********************************************/
/* READING ~/.config/x48ng/{rom,ram,state,port1,port2} */ /* READING ~/.config/x48ng/{rom,ram,state,port1,port2} */
@ -952,7 +948,9 @@ int write_state_file( char* filename )
write_32( fp, &saturn.mem_cntl[ i ].config[ 0 ] ); write_32( fp, &saturn.mem_cntl[ i ].config[ 0 ] );
write_32( fp, &saturn.mem_cntl[ i ].config[ 1 ] ); write_32( fp, &saturn.mem_cntl[ i ].config[ 1 ] );
} }
fclose( fp ); fclose( fp );
if ( verbose ) if ( verbose )
printf( "wrote %s\n", filename ); printf( "wrote %s\n", filename );

View file

@ -323,7 +323,7 @@ extern int annunciators_bits[ NB_ANNUNCIATORS ];
/**************/ /**************/
extern void init_display( void ); /* used in ui_*.c */ extern void init_display( void ); /* used in ui_*.c */
extern int init_emulator( void ); /* used in main.c */ extern int init_emulator( void ); /* used in main.c */
extern int exit_emulator( void ); /* debugger.c; main.c; ui_*.c */ extern void exit_emulator( void ); /* debugger.c; main.c; ui_*.c */
extern int read_files( void ); /* debugger.c */ extern int read_files( void ); /* debugger.c */
extern int write_files( void ); /* used in debugger.c */ extern int write_files( void ); /* used in debugger.c */

View file

@ -1,6 +1,7 @@
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <pwd.h> #include <pwd.h>
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>