renaming functions
This commit is contained in:
parent
69241a0838
commit
4d7d83328f
5 changed files with 14 additions and 12 deletions
|
@ -23,7 +23,7 @@ Config config = {
|
||||||
.fn_state = "state",
|
.fn_state = "state",
|
||||||
};
|
};
|
||||||
|
|
||||||
void parse_args( int argc, char* argv[] )
|
void config_init( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
int option_index;
|
int option_index;
|
||||||
int c = '?';
|
int c = '?';
|
||||||
|
|
|
@ -23,6 +23,6 @@ typedef struct {
|
||||||
|
|
||||||
extern Config config;
|
extern Config config;
|
||||||
|
|
||||||
void parse_args( int argc, char* argv[] );
|
void config_init( int argc, char* argv[] );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -958,7 +958,7 @@ static inline void _button_mouse_up( int mouse_x, int mouse_y, int mouse_button
|
||||||
/********************/
|
/********************/
|
||||||
/* PUBLIC FUNCTIONS */
|
/* 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_SetRenderDrawColor( renderer, gui_colors.faceplate.r, gui_colors.faceplate.g, gui_colors.faceplate.b, gui_colors.faceplate.a );
|
||||||
SDL_RenderClear( renderer );
|
SDL_RenderClear( renderer );
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
extern void gui_refresh( void );
|
extern void gui_update( void );
|
||||||
extern bool gui_events();
|
extern bool gui_events();
|
||||||
|
|
||||||
extern bool gui_init( void );
|
extern bool gui_init( void );
|
||||||
|
|
18
src/main.c
18
src/main.c
|
@ -8,48 +8,50 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
unsigned int currentTime;
|
Uint64 currentTime;
|
||||||
|
|
||||||
// display_update
|
// display_update
|
||||||
unsigned int lastTime_timer1 = 0;
|
Uint64 lastTime_timer1 = 0;
|
||||||
unsigned int delay_timer1 = 16384;
|
unsigned int delay_timer1 = 16384;
|
||||||
|
|
||||||
// display show
|
// display show
|
||||||
unsigned int lastTime_timer5 = 0;
|
Uint64 lastTime_timer5 = 0;
|
||||||
unsigned int delay_timer5 = 64; // fps
|
unsigned int delay_timer5 = 64; // fps
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
parse_args( argc, argv );
|
config_init( argc, argv );
|
||||||
|
|
||||||
if ( !gui_init() )
|
if ( !gui_init() )
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
|
|
||||||
emulator_init( "rom", "ram", "port1", "port2", "bus", "cpu" );
|
emulator_init();
|
||||||
|
|
||||||
while ( !please_exit ) {
|
while ( !please_exit ) {
|
||||||
if ( please_exit )
|
if ( please_exit )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
currentTime = SDL_GetTicks();
|
currentTime = SDL_GetTicks64();
|
||||||
|
|
||||||
emulator_run();
|
emulator_run();
|
||||||
|
|
||||||
if ( currentTime > lastTime_timer1 + delay_timer1 ) {
|
if ( currentTime > lastTime_timer1 + delay_timer1 ) {
|
||||||
lastTime_timer1 = currentTime;
|
lastTime_timer1 = currentTime;
|
||||||
|
|
||||||
display_update();
|
display_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( currentTime > lastTime_timer5 + delay_timer5 ) {
|
if ( currentTime > lastTime_timer5 + delay_timer5 ) {
|
||||||
lastTime_timer5 = currentTime;
|
lastTime_timer5 = currentTime;
|
||||||
gui_refresh();
|
|
||||||
|
gui_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !gui_events() )
|
if ( !gui_events() )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
emulator_exit( "rom", "ram", "port1", "port2", "bus", "cpu" );
|
emulator_exit();
|
||||||
gui_exit();
|
gui_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue