diff --git a/gfx/gfx_thumbnail.c b/gfx/gfx_thumbnail.c index ad14c13557..299e1f96af 100644 --- a/gfx/gfx_thumbnail.c +++ b/gfx/gfx_thumbnail.c @@ -78,6 +78,7 @@ typedef struct retro_time_t list_id; } gfx_thumbnail_tag_t; +/* TODO/FIXME */ /* Global gfx_thumbnail_state structure */ static gfx_thumbnail_state_t gfx_thumb_state; diff --git a/input/input_osk.c b/input/input_osk.c index 637b6ddffc..a756c5ccb1 100644 --- a/input/input_osk.c +++ b/input/input_osk.c @@ -31,8 +31,8 @@ #include "input_osk.h" #include "input_driver.h" +/* TODO/FIXME - static public global variables */ static char *osk_grid[45] = {NULL}; - static int osk_ptr = 0; static enum osk_type osk_idx = OSK_LOWERCASE_LATIN; diff --git a/input/input_remapping.c b/input/input_remapping.c index dde304dbc4..ec66f9f985 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -24,6 +24,7 @@ #include "../configuration.h" #include "../retroarch.h" +/* TODO/FIXME - static public global variables */ static unsigned old_analog_dpad_mode[MAX_USERS]; static unsigned old_libretro_device[MAX_USERS]; diff --git a/managers/cheat_manager.c b/managers/cheat_manager.c index 06bced509a..15438c9daa 100644 --- a/managers/cheat_manager.c +++ b/managers/cheat_manager.c @@ -49,6 +49,7 @@ #include "../core.h" #include "../verbosity.h" +/* TODO/FIXME - public global variables */ cheat_manager_t cheat_manager_state; unsigned cheat_manager_get_buf_size(void) diff --git a/managers/state_manager.c b/managers/state_manager.c index 0b35a276c6..177349f063 100644 --- a/managers/state_manager.c +++ b/managers/state_manager.c @@ -62,6 +62,65 @@ #include #endif +struct state_manager +{ + uint8_t *data; + size_t capacity; + /* Reading and writing is done here here. */ + uint8_t *head; + /* If head comes close to this, discard a frame. */ + uint8_t *tail; + + uint8_t *thisblock; + uint8_t *nextblock; + + /* This one is rounded up from reset::blocksize. */ + size_t blocksize; + + /* size_t + (blocksize + 131071) / 131072 * + * (blocksize + u16 + u16) + u16 + u32 + size_t + * (yes, the math is a bit ugly). */ + size_t maxcompsize; + + unsigned entries; + bool thisblock_valid; +#if STRICT_BUF_SIZE + size_t debugsize; + uint8_t *debugblock; +#endif +}; + +struct state_manager_rewind_state +{ + /* Rewind support. */ + state_manager_t *state; + size_t size; +}; + +/* Format per frame (pseudocode): */ +#if 0 +size nextstart; +repeat { + uint16 numchanged; /* everything is counted in units of uint16 */ + if (numchanged) + { + uint16 numunchanged; /* skip these before handling numchanged */ + uint16[numchanged] changeddata; + } + else + { + uint32 numunchanged; + if (!numunchanged) + break; + } +} +size thisstart; +#endif + +/* TODO/FIXME - static public global variables */ +static struct state_manager_rewind_state rewind_state; +static bool frame_is_reversed = false; + /* There's no equivalent in libc, you'd think so ... * std::mismatch exists, but it's not optimized at all. */ static size_t find_change(const uint16_t *a, const uint16_t *b) @@ -159,64 +218,6 @@ static size_t find_same(const uint16_t *a, const uint16_t *b) return a - a_org; } -struct state_manager -{ - uint8_t *data; - size_t capacity; - /* Reading and writing is done here here. */ - uint8_t *head; - /* If head comes close to this, discard a frame. */ - uint8_t *tail; - - uint8_t *thisblock; - uint8_t *nextblock; - - /* This one is rounded up from reset::blocksize. */ - size_t blocksize; - - /* size_t + (blocksize + 131071) / 131072 * - * (blocksize + u16 + u16) + u16 + u32 + size_t - * (yes, the math is a bit ugly). */ - size_t maxcompsize; - - unsigned entries; - bool thisblock_valid; -#if STRICT_BUF_SIZE - size_t debugsize; - uint8_t *debugblock; -#endif -}; - -/* Format per frame (pseudocode): */ -#if 0 -size nextstart; -repeat { - uint16 numchanged; /* everything is counted in units of uint16 */ - if (numchanged) - { - uint16 numunchanged; /* skip these before handling numchanged */ - uint16[numchanged] changeddata; - } - else - { - uint32 numunchanged; - if (!numunchanged) - break; - } -} -size thisstart; -#endif - -struct state_manager_rewind_state -{ - /* Rewind support. */ - state_manager_t *state; - size_t size; -}; - -static struct state_manager_rewind_state rewind_state; -static bool frame_is_reversed = false; - /* Returns the maximum compressed size of a savestate. * It is very likely to compress to far less. */ static size_t state_manager_raw_maxsize(size_t uncomp) diff --git a/menu/widgets/menu_dialog.c b/menu/widgets/menu_dialog.c index 770abf229b..6291fed519 100644 --- a/menu/widgets/menu_dialog.c +++ b/menu/widgets/menu_dialog.c @@ -45,6 +45,7 @@ struct menu_dialog typedef struct menu_dialog menu_dialog_t; +/* TODO/FIXME - static public global variables */ static menu_dialog_t dialog; static menu_dialog_t *dialog_get_ptr(void) diff --git a/menu/widgets/menu_filebrowser.c b/menu/widgets/menu_filebrowser.c index 98c559d9d8..30a2360613 100644 --- a/menu/widgets/menu_filebrowser.c +++ b/menu/widgets/menu_filebrowser.c @@ -38,6 +38,7 @@ #include "../../content.h" #include "../../dynamic.h" +/* TODO/FIXME - static public global variables */ static enum filebrowser_enums filebrowser_types = FILEBROWSER_NONE; enum filebrowser_enums filebrowser_get_type(void) diff --git a/menu/widgets/menu_input_bind_dialog.c b/menu/widgets/menu_input_bind_dialog.c index 110ca1cb93..1875d40851 100644 --- a/menu/widgets/menu_input_bind_dialog.c +++ b/menu/widgets/menu_input_bind_dialog.c @@ -66,6 +66,7 @@ struct menu_bind_state struct menu_bind_axis_state axis_state[MAX_USERS]; }; +/* TODO/FIXME - static public global variables */ static struct menu_bind_state menu_input_binds = {0}; static bool input_joypad_button_raw(const input_device_driver_t *drv, diff --git a/network/discord.c b/network/discord.c index 882da7ae64..d9ca215c44 100644 --- a/network/discord.c +++ b/network/discord.c @@ -86,6 +86,7 @@ struct discord_state typedef struct discord_state discord_state_t; +/* TODO/FIXME - static public global variables */ static discord_state_t discord_st; #define CDN_URL "https://cdn.discordapp.com/avatars"