From 303c881f3808c57d35fd0306dc212e2b4b4cf443 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Tue, 26 Nov 2024 21:44:28 +0200 Subject: [PATCH] Updated GB_set_user_data and GB_get_user_data (markdown) --- GB_set_user_data and GB_get_user_data.md | 15 --------------- GB_set_user_data-and-GB_get_user_data.md | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 GB_set_user_data and GB_get_user_data.md create mode 100644 GB_set_user_data-and-GB_get_user_data.md diff --git a/GB_set_user_data and GB_get_user_data.md b/GB_set_user_data and GB_get_user_data.md deleted file mode 100644 index 10f51c4..0000000 --- a/GB_set_user_data and GB_get_user_data.md +++ /dev/null @@ -1,15 +0,0 @@ -## Definition - -void GB_set_user_data([[GB_gameboy_t]] *gb, void *data); - -void *GB_get_user_data([[GB_gameboy_t]] *gb); - -In `gb.h` - -## Description - -TBD - -## Thread Safety - -`GB_set_user_data` and `GB_get_user_data` thread-safe and can be called from any thread and context. diff --git a/GB_set_user_data-and-GB_get_user_data.md b/GB_set_user_data-and-GB_get_user_data.md new file mode 100644 index 0000000..7763052 --- /dev/null +++ b/GB_set_user_data-and-GB_get_user_data.md @@ -0,0 +1,15 @@ +## Definition + +void GB_set_user_data([[GB_gameboy_t]] *gb, void *data); + +void *GB_get_user_data([[GB_gameboy_t]] *gb); + +In `gb.h` + +## Description + +`GB_set_user_data` can associate an arbitrary pointer with an emulator instance, and `GB_get_user_data` can read the associated pointer back. They can be used by a frontend that can handle multiple emulator instances to associate an emulator instance with its frontend data (For example, a window object that displays the screen of the instance) and read it back when getting callbacks. + +## Thread Safety + +`GB_set_user_data` and `GB_get_user_data` thread-safe and can be called from any thread and context.