Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/tic80.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ typedef struct

TIC80_API tic80* tic80_create(s32 samplerate, tic80_pixel_color_format format);
TIC80_API void tic80_load(tic80* tic, void* cart, s32 size);
TIC80_API void tic80_tick(tic80* tic, tic80_input input, u64 (*counter)(), u64 (*freq)());
TIC80_API void tic80_tick(tic80* tic, tic80_input input, u64 (*counter)(void*), u64 (*freq)(void*));
TIC80_API void tic80_sound(tic80* tic);
TIC80_API void tic80_delete(tic80* tic);

Expand Down
3 changes: 3 additions & 0 deletions src/studio/studio.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ struct Studio

#if defined(BUILD_SURF)
Surf* surf;
#endif

#if defined(BUILD_EDITORS) || defined(BUILD_SURF)
tic_net* net;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/system/libretro/tic80_libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static struct tic80_state* state = NULL;
/**
* TIC-80 callback; Request counter.
*/
static u64 tic80_libretro_counter()
static u64 tic80_libretro_counter(void* data)
{
if (state == NULL) {
return 0;
Expand All @@ -96,7 +96,7 @@ static u64 tic80_libretro_counter()
/**
* TIC-80 callback; Request frequency.
*/
static u64 tic80_libretro_frequency()
static u64 tic80_libretro_frequency(void* data)
{
return TIC80_FREQUENCY;
}
Expand Down
4 changes: 2 additions & 2 deletions src/system/sdl/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ static void onExit()
state.quit = true;
}

static u64 tic_sys_counter_get()
static u64 tic_sys_counter_get(void* data)
{
return SDL_GetPerformanceCounter();
}

static u64 tic_sys_freq_get()
static u64 tic_sys_freq_get(void* data)
{
return SDL_GetPerformanceFrequency();
}
Expand Down
4 changes: 0 additions & 4 deletions src/system/tanmatsu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ endif()
# TIC-80 and its vendored libraries are older and noisier than the ESP-IDF
# default warning set; none of these are actionable from this port.
target_compile_options(${COMPONENT_LIB} PRIVATE
# TIC-80 predates C23's reading of "()" as "(void)": include/tic80.h
# declares tic80_tick with unspecified arguments while tic.c defines it
# with the real ones, which only agree under the older standard.
-std=gnu17
# Warnings in code this port does not own must not stop the build.
-Wno-error
-Wno-error=implicit-function-declaration
Expand Down
9 changes: 6 additions & 3 deletions src/system/tanmatsu/project/sdkconfigs/tanmatsu
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y

# Performance. TIC-80's working set lives in PSRAM, so cache size and clock
# both matter more here than they would for a typical badge app.
# Dynamic frequency scaling is off on purpose: it clocks down under exactly the
# load we care about. Costs battery life.
CONFIG_PM_ENABLE=n
# Dynamic frequency scaling back on, and measured rather than assumed: the main
# loop is busy for about 15.7 ms of every 16.7 ms, so there is little idle for
# it to scale into and little to lose, while this is a battery powered handheld
# that would otherwise sit at full clock forever.
CONFIG_PM_ENABLE=y
CONFIG_PM_DFS_INIT_AUTO=y
# 400 MHz is rejected on pre-v3 P4 silicon ("invalid CPU frequency value" from
# esp_clk_init), and this board selects REV_LESS_V3, so 360 MHz is the ceiling.
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_360=y
Expand Down