renaming functions

This commit is contained in:
Gwenhael Le Moine 2024-04-18 15:39:28 +02:00
parent 69241a0838
commit 4d7d83328f
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
5 changed files with 14 additions and 12 deletions

View file

@ -23,7 +23,7 @@ Config config = {
.fn_state = "state",
};
void parse_args( int argc, char* argv[] )
void config_init( int argc, char* argv[] )
{
int option_index;
int c = '?';

View file

@ -23,6 +23,6 @@ typedef struct {
extern Config config;
void parse_args( int argc, char* argv[] );
void config_init( int argc, char* argv[] );
#endif

View file

@ -958,7 +958,7 @@ static inline void _button_mouse_up( int mouse_x, int mouse_y, int mouse_button
/********************/
/* PUBLIC FUNCTIONS */
/********************/
void gui_refresh()
void gui_update()
{
SDL_SetRenderDrawColor( renderer, gui_colors.faceplate.r, gui_colors.faceplate.g, gui_colors.faceplate.b, gui_colors.faceplate.a );
SDL_RenderClear( renderer );

View file

@ -3,7 +3,7 @@
#include <stdbool.h>
extern void gui_refresh( void );
extern void gui_update( void );
extern bool gui_events();
extern bool gui_init( void );

View file

@ -8,48 +8,50 @@
#include "gui.h"
#include "display.h"
unsigned int currentTime;
Uint64 currentTime;
// display_update
unsigned int lastTime_timer1 = 0;
Uint64 lastTime_timer1 = 0;
unsigned int delay_timer1 = 16384;
// display show
unsigned int lastTime_timer5 = 0;
Uint64 lastTime_timer5 = 0;
unsigned int delay_timer5 = 64; // fps
int main( int argc, char* argv[] )
{
parse_args( argc, argv );
config_init( argc, argv );
if ( !gui_init() )
exit( EXIT_FAILURE );
emulator_init( "rom", "ram", "port1", "port2", "bus", "cpu" );
emulator_init();
while ( !please_exit ) {
if ( please_exit )
break;
currentTime = SDL_GetTicks();
currentTime = SDL_GetTicks64();
emulator_run();
if ( currentTime > lastTime_timer1 + delay_timer1 ) {
lastTime_timer1 = currentTime;
display_update();
}
if ( currentTime > lastTime_timer5 + delay_timer5 ) {
lastTime_timer5 = currentTime;
gui_refresh();
gui_update();
}
if ( !gui_events() )
break;
}
emulator_exit( "rom", "ram", "port1", "port2", "bus", "cpu" );
emulator_exit();
gui_exit();
return 0;