Refactorisation and tests
This commit is contained in:
parent
07a78d1aae
commit
1bd8c3ec1a
|
@ -8,6 +8,7 @@ include(GenerateG1A)
|
|||
include(GenerateG3A)
|
||||
include(Fxconv)
|
||||
find_package(Gint 2.1 REQUIRED)
|
||||
find_package(LibProf 2.4 REQUIRED)
|
||||
|
||||
set(SOURCES
|
||||
src/main.c
|
||||
|
@ -36,7 +37,7 @@ fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
|
|||
|
||||
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
|
||||
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)
|
||||
target_link_libraries(myaddin Gint::Gint)
|
||||
target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
|
||||
|
||||
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
|
||||
generate_g1a(TARGET myaddin OUTPUT "CCJDemo.g1a"
|
||||
|
|
39
src/main.c
39
src/main.c
|
@ -3,6 +3,7 @@
|
|||
#include <gint/dma.h>
|
||||
#include <gint/rtc.h>
|
||||
|
||||
#include <libprof.h>
|
||||
#include <gint/usb.h>
|
||||
#include <gint/usb-ff-bulk.h>
|
||||
|
||||
|
@ -1100,6 +1101,8 @@ void run_intro( void )
|
|||
|
||||
|
||||
|
||||
uint8_t valueOC = 0;
|
||||
|
||||
|
||||
static void get_minimum_inputs( void )
|
||||
{
|
||||
|
@ -1189,20 +1192,31 @@ static void get_minimum_inputs( void )
|
|||
|
||||
/// TEST OC
|
||||
|
||||
if (keydown(KEY_1)) clock_overclock( OC_Default );
|
||||
if (keydown(KEY_2)) clock_overclock( OC_PtuneF2 );
|
||||
if (keydown(KEY_3)) clock_overclock( OC_PtuneF3 );
|
||||
if (keydown(KEY_4)) clock_overclock( OC_PtuneF4 );
|
||||
if (keydown(KEY_5)) clock_overclock( OC_PtuneF5 );
|
||||
if (keydown(KEY_1)) valueOC=clock_overclock( OC_Default );
|
||||
if (keydown(KEY_2)) valueOC=clock_overclock( OC_PtuneF2 );
|
||||
if (keydown(KEY_3)) valueOC=clock_overclock( OC_PtuneF3 );
|
||||
if (keydown(KEY_4)) valueOC=clock_overclock( OC_PtuneF4 );
|
||||
if (keydown(KEY_5)) valueOC=clock_overclock( OC_PtuneF5 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
__printf_enable_fp();
|
||||
__printf_enable_fixed();
|
||||
|
||||
usb_interface_t const *interfaces[] = { &usb_ff_bulk, NULL };
|
||||
usb_open(interfaces, GINT_CALL_NULL);
|
||||
|
||||
|
||||
prof_init();
|
||||
|
||||
prof_t perf_render;
|
||||
uint32_t time_render = 0;
|
||||
float dt = 1.0;
|
||||
|
||||
|
||||
/// TEST OC
|
||||
clock_overclock( OC_Default );
|
||||
|
||||
|
@ -1222,6 +1236,11 @@ int main(void)
|
|||
|
||||
while(!stop)
|
||||
{
|
||||
dt = ((float) time_render / 1000.0);
|
||||
|
||||
perf_render = prof_make();
|
||||
prof_enter(perf_render);
|
||||
|
||||
dclear(C_BLACK);
|
||||
|
||||
if (skip_intro==false)
|
||||
|
@ -1261,8 +1280,14 @@ int main(void)
|
|||
}
|
||||
}
|
||||
|
||||
dprint(1,1, C_WHITE, "FPS %.0f", (float) (1000.0f/dt) );
|
||||
dprint(1,15, C_WHITE, "OC STAT %d", valueOC );
|
||||
|
||||
dupdate();
|
||||
|
||||
prof_leave(perf_render);
|
||||
time_render = prof_time(perf_render);
|
||||
|
||||
if (screenshot && usb_is_open())
|
||||
{
|
||||
usb_fxlink_screenshot(false);
|
||||
|
@ -1280,6 +1305,10 @@ int main(void)
|
|||
/// TEST OC
|
||||
clock_overclock( OC_Default );
|
||||
|
||||
prof_quit();
|
||||
|
||||
usb_close();
|
||||
|
||||
//free( screen );
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue