From ec6096adee1b1862e18d52407ee6660546418d39 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 30 Nov 2024 21:27:48 +0200 Subject: [PATCH] Updated GB_load_gbs_from_buffer (markdown) --- GB_load_gbs_from_buffer.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/GB_load_gbs_from_buffer.md b/GB_load_gbs_from_buffer.md index 57d218d..3d155fa 100644 --- a/GB_load_gbs_from_buffer.md +++ b/GB_load_gbs_from_buffer.md @@ -6,8 +6,22 @@ In `gb.h` ## Description -TBD +Loads a GBS from `buffer` with length `size` into an emulator instance. Returns `0` on success, and `-1` on failures. + +In case of a failure, an error message will also be output to the [[log|GB_set_log_callback]]. Warning messages may be output to the [[log|GB_set_log_callback]] upon success. + +Upon success, and if `info` is not `NULL`, the [[GB_gbs_info_t]] struct pointed by `info` will be filled with metadata from the GBS file. + +The emulator instance will play the first track of the GBS file. To play another track, call [[GB_gbs_switch_track]]. + ## Thread Safety `GB_load_gbs_from_buffer` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback). + +## See Also + +* [[GB_load_gbs]] +* [[GB_gbs_info_t]] +* [[GB_gbs_switch_track]] +* [[GB_load_rom_from_buffer]]