Initial API reference commit

Initial Home page

Initial API reference progress
Lior Halphon 2024-11-24 21:57:04 +02:00
commit 79e3cbdd03
184 changed files with 3143 additions and 0 deletions

23
Built-In DMG Palettes.md Normal file

@ -0,0 +1,23 @@
## Definition
<pre>
extern const <a href="GB_palette_t.md">GB_palette_t</a> GB_PALETTE_GREY;
extern const <a href="GB_palette_t.md">GB_palette_t</a> GB_PALETTE_DMG;
extern const <a href="GB_palette_t.md">GB_palette_t</a> GB_PALETTE_MGB;
extern const <a href="GB_palette_t.md">GB_palette_t</a> GB_PALETTE_GBL;
</pre>
In `display.h`
## Description
Four built-in presets palettes to be used with [[GB_set_palette|GB_set_palette and GB_get_palette]]:
* `GB_PALETTE_GREY`: A palette with four evenly-spaced shades of grey.
* `GB_PALETTE_DMG`: A green palette mimicking the look of the original Game Boy (DMG)
* `GB_PALETTE_MGB`: An olive palette mimicking the look of the Game Boy Pocket (MGB)
* `GB_PALETTE_GBL`: A teal palette mimicking the look of the Game Boy Light (GBL/MGL)
## See Also
* [[GB_set_palette and GB_get_palette]]
* [[GB_palette_t]]

9
GB_BIG_ENDIAN.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_BIG_ENDIAN</code>
In `gb.h`
## Description
TBD

9
GB_CHEAT_ANY_BANK.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_CHEAT_ANY_BANK 0xFFFF</tt>
In `cheats.h`
## Description
TBD

9
GB_ENUM.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_ENUM(type, ...)</code>
In `save_state.h`
## Description
TBD

9
GB_LITTLE_ENDIAN.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_LITTLE_ENDIAN</tt>
In `gb.h`
## Description
TBD

15
GB_accessory_t.md Normal file

@ -0,0 +1,15 @@
## Definition
```c
typedef GB_ENUM(uint8_t, {
GB_ACCESSORY_NONE,
GB_ACCESSORY_PRINTER,
GB_ACCESSORY_WORKBOY,
}) GB_accessory_t;
```
In `gb.h`
## Description
TBD

13
GB_add_cheat.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>const [[GB_cheat_t]] *GB_add_cheat([[GB_gameboy_t]] *gb, const char *description, uint16_t address, uint16_t bank, uint8_t value, uint8_t old_value, bool use_old_value, bool enabled);</tt>
In `cheats.h`
## Description
TBD
## Thread Safety
`GB_add_cheat` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

@ -0,0 +1,17 @@
## Definition
```c
typedef void (*GB_sample_callback_t)(GB_gameboy_t *gb, GB_sample_t *sample);
```
<tt>void GB_apu_set_sample_callback([[GB_gameboy_t]] *gb, [[GB_sample_callback_t]] callback);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_apu_set_sample_callback` is thread-safe and can be called from any thread and context.

13
GB_attributed_log.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_attributed_log([[GB_gameboy_t]] *gb, [[GB_log_attributes_t]] attributes, const char *fmt, ...) __printflike(3, 4);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_attributed_log` is thread-safe and can be called from any thread and context.

15
GB_audio_format_t.md Normal file

@ -0,0 +1,15 @@
## Definition
```c
typedef enum {
GB_AUDIO_FORMAT_RAW,
GB_AUDIO_FORMAT_AIFF,
GB_AUDIO_FORMAT_WAV,
} GB_audio_format_t;
```
In `apu.h`
## Description
TBD

13
GB_camera_updated.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_camera_updated([[GB_gameboy_t]] *gb);</tt>
In `camera.h`
## Description
TBD
## Thread Safety
`GB_camera_updated` is thread-safe and can be called from any thread and context.

@ -0,0 +1,16 @@
## Definition
```c
typedef enum {
GB_CHEAT_SEARCH_DATA_TYPE_8BIT = 0,
GB_CHEAT_SEARCH_DATA_TYPE_16BIT = 1,
GB_CHEAT_SEARCH_DATA_TYPE_BE_BIT = 2,
GB_CHEAT_SEARCH_DATA_TYPE_16BIT_BE = GB_CHEAT_SEARCH_DATA_TYPE_16BIT | GB_CHEAT_SEARCH_DATA_TYPE_BE_BIT,
} GB_cheat_search_data_type_t;
```
In `cheat_search.h`
## Description
TBD

13
GB_cheat_search_filter.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_cheat_search_filter([[GB_gameboy_t]] *gb, const char *expression, [[GB_cheat_search_data_type_t]] data_type);</tt>
In `cheat_search.h`
## Description
TBD
## Thread Safety
`GB_cheat_search_filter` must not be called if the instance is being run in any thread, including the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>void GB_cheat_search_get_results([[GB_gameboy_t]] *gb, [[GB_cheat_search_result_t]] *results);</tt>
In `cheat_search.h`
## Description
TBD
## Thread Safety
`GB_cheat_search_get_results` is thread-safe and can be called from any thread and context.

13
GB_cheat_search_reset.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_cheat_search_reset([[GB_gameboy_t]] *gb);</tt>
In `cheat_search.h`
## Description
TBD
## Thread Safety
`GB_cheat_search_reset` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>size_t GB_cheat_search_result_count([[GB_gameboy_t]] *gb);</tt>
In `cheat_search.h`
## Description
TBD
## Thread Safety
`GB_cheat_search_result_count` is thread-safe and can be called from any thread and context.

@ -0,0 +1,15 @@
## Definition
```c
typedef struct {
uint16_t addr;
uint16_t bank;
uint16_t value;
} GB_cheat_search_result_t;
```
In `cheat_search.h`
## Description
TBD

19
GB_cheat_t.md Normal file

@ -0,0 +1,19 @@
## Definition
```c
typedef struct GB_cheat_s {
uint16_t address;
uint16_t bank;
uint8_t value;
uint8_t old_value;
bool use_old_value;
bool enabled;
char description[128];
} GB_cheat_t;
```
In `cheats.h`
## Description
TBD

13
GB_cheats_enabled.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_cheats_enabled([[GB_gameboy_t]] *gb);</tt>
In `cheats.h`
## Description
TBD
## Thread Safety
`GB_cheats_enabled` is thread-safe and can be called from any thread and context.

13
GB_clear_joyp_accessed.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_clear_joyp_accessed([[GB_gameboy_t]] *gb);</tt>
In `joypad.h`
## Description
TBD
## Thread Safety
`GB_clear_joyp_accessed` is thread-safe and can be called from any thread and context.

13
GB_connect_printer.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_connect_printer([[GB_gameboy_t]] *gb, [[GB_print_image_callback_t]] callback, [[GB_printer_done_callback_t]] done_callback);</tt>
In `printer.h`
## Description
TBD
## Thread Safety
`GB_connect_printer` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_connect_workboy.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_connect_workboy([[GB_gameboy_t]] *gb, [GB_workboy_set_time_callback_t](GB_workboy_set_time_callback_t.gb) set_time_callback, [GB_workboy_get_time_callback_t](GB_workboy_get_time_callback_t.gb) get_time_callback);</tt>
In `workboy.h`
## Description
TBD
## Thread Safety
`GB_connect_workboy` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_convert_rgb15.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint32_t GB_convert_rgb15([[GB_gameboy_t]] *gb, uint16_t color, bool for_border);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_convert_rgb15` is thread-safe and can be called from any thread and context.

13
GB_cpu_disassemble.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_cpu_disassemble([[GB_gameboy_t]] *gb, uint16_t pc, uint16_t count);</tt>
In `sm83_cpu.h`
## Description
TBD
## Thread Safety
`GB_cpu_disassemble` is thread-safe and can be called from any thread and context.

13
GB_debugger_break.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_debugger_break([[GB_gameboy_t]] *gb);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_break` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>void GB_debugger_clear_symbols([[GB_gameboy_t]] *gb);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_clear_symbols` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>char *GB_debugger_complete_substring([[GB_gameboy_t]] *gb, char *input, uintptr_t *context);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_complete_substring` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>const char *GB_debugger_describe_address([[GB_gameboy_t]] *gb, uint16_t addr, uint16_t bank, bool exact_match, bool prefer_local);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_describe_address` is thread-safe and can be called from any thread and context.

13
GB_debugger_evaluate.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_debugger_evaluate([[GB_gameboy_t]] *gb, const char *string, uint16_t *result, uint16_t *result_bank);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_evaluate` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>GB_debugger_execute_command([[GB_gameboy_t]] *gb, char *input);</code>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_execute_command` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_debugger_is_stopped.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_debugger_is_stopped([[GB_gameboy_t]] *gb);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_is_stopped` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>void GB_debugger_load_symbol_file([[GB_gameboy_t]] *gb, const char *path);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_load_symbol_file` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>const char *GB_debugger_name_for_address([[GB_gameboy_t]] *gb, uint16_t addr);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_name_for_address` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>void GB_debugger_set_disabled([[GB_gameboy_t]] *gb, bool disabled);</tt>
In `debugger.h`
## Description
TBD
## Thread Safety
`GB_debugger_set_disabled` is thread-safe and can be called from any thread and context.

@ -0,0 +1,17 @@
## Definition
```c
typedef void (*GB_debugger_reload_callback_t)(GB_gameboy_t *gb);
```
<tt>void GB_debugger_set_reload_callback([[GB_gameboy_t]] *gb, [[GB_debugger_reload_callback_t]] callback);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_debugger_set_reload_callback` is thread-safe and can be called from any thread and context.

13
GB_disconnect_serial.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_disconnect_serial([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_disconnect_serial` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_draw_tilemap.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_draw_tilemap([[GB_gameboy_t]] *gb, uint32_t *dest, [[GB_palette_type_t]] palette_type, uint8_t palette_index, [[GB_map_type_t]] map_type, [[GB_tileset_type_t]] tileset_type);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_draw_tilemap` is thread-safe and can be called from any thread and context.

21
GB_draw_tileset.md Normal file

@ -0,0 +1,21 @@
## Definition
```c
typedef enum {
GB_TILESET_AUTO,
GB_TILESET_8800,
GB_TILESET_8000,
} GB_tileset_type_t;
```
<tt>void GB_draw_tileset([[GB_gameboy_t]] *gb, uint32_t *dest, [[GB_palette_type_t]] palette_type, uint8_t palette_index);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_draw_tileset` is thread-safe and can be called from any thread and context.

18
GB_gameboy_t.md Normal file

@ -0,0 +1,18 @@
## Definition
```c
typedef struct GB_gameboy_s GB_gameboy_t;
```
In `defs.h`
## Description
An object representing an emulated Game Boy instance, normally passed as a reference (`GB_gameboy_t *`) to functions.
## Notes
The size of this struct changes between versions of SameBoy. If the version of SameBoy you're linking against is not known in compile-time, you must not allocate instance statically. See [[Instance Allocation]].
## See Also
* [[Instance Allocation]]

17
GB_gbs_info_t.md Normal file

@ -0,0 +1,17 @@
## Definition
```c
typedef struct {
uint8_t track_count;
uint8_t first_track;
char title[33];
char author[33];
char copyright[33];
} GB_gbs_info_t;
```
In `gb.h`
## Description
TBD

13
GB_gbs_switch_track.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_gbs_switch_track([[GB_gameboy_t]] *gb, uint8_t track);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_gbs_switch_track` must not be called if the instance is being run in any thread, including the current one (via a callback).

13
GB_get_apu_wave_table.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_get_apu_wave_table([[GB_gameboy_t]] *gb, uint8_t *wave_table);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_get_apu_wave_table` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>[[GB_accessory_t]] GB_get_built_in_accessory([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_built_in_accessory` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>uint8_t GB_get_channel_amplitude([[GB_gameboy_t]] *gb, [[GB_channel_t]] channel);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_get_channel_amplitude` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_get_channel_edge_triggered([[GB_gameboy_t]] *gb, [[GB_channel_t]] channel);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_get_channel_edge_triggered` is thread-safe and can be called from any thread and context.

13
GB_get_channel_period.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint16_t GB_get_channel_period([[GB_gameboy_t]] *gb, [[GB_channel_t]] channel);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_get_channel_period` is thread-safe and can be called from any thread and context.

13
GB_get_channel_volume.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint8_t GB_get_channel_volume([[GB_gameboy_t]] *gb, [[GB_channel_t]] channel);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_get_channel_volume` is thread-safe and can be called from any thread and context.

13
GB_get_cheats.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>const [[GB_cheat_t]] *const *GB_get_cheats([[GB_gameboy_t]] *gb, size_t *size);</tt>
In `cheats.h`
## Description
TBD
## Thread Safety
`GB_get_cheats` is thread-safe and can be called from any thread and context.

13
GB_get_clock_rate.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint32_t GB_get_clock_rate([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_clock_rate` is thread-safe and can be called from any thread and context.

30
GB_get_direct_access.md Normal file

@ -0,0 +1,30 @@
## Definition
```c
typedef enum {
GB_DIRECT_ACCESS_ROM,
GB_DIRECT_ACCESS_RAM,
GB_DIRECT_ACCESS_CART_RAM,
GB_DIRECT_ACCESS_VRAM,
GB_DIRECT_ACCESS_HRAM,
GB_DIRECT_ACCESS_IO,
GB_DIRECT_ACCESS_BOOTROM,
GB_DIRECT_ACCESS_OAM,
GB_DIRECT_ACCESS_BGP,
GB_DIRECT_ACCESS_OBP,
GB_DIRECT_ACCESS_IE,
GB_DIRECT_ACCESS_ROM0,
} GB_direct_access_t;
```
<tt>void *GB_get_direct_access([[GB_gameboy_t]] *gb, [[GB_direct_access_t]] access, size_t *size, uint16_t *bank);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_direct_access` is thread-safe and can be called from any thread and context.

13
GB_get_joyp_accessed.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_get_joyp_accessed([[GB_gameboy_t]] *gb);</tt>
In `joypad.h`
## Description
TBD
## Thread Safety
`GB_get_joyp_accessed` is thread-safe and can be called from any thread and context.

13
GB_get_model.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>[[GB_model_t]] GB_get_model([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_model` is thread-safe and can be called from any thread and context.

13
GB_get_oam_info.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint8_t GB_get_oam_info([[GB_gameboy_t]] *gb, [[GB_oam_info_t]] *dest, uint8_t *object_height);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_get_oam_info` is thread-safe and can be called from any thread and context.

9
GB_get_pixels_output.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>uint32_t *GB_get_pixels_output([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD

13
GB_get_player_count.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>unsigned GB_get_player_count([[GB_gameboy_t]] *gb);</tt>
In `sgb.h`
## Description
TBD
## Thread Safety
`GB_get_player_count` is thread-safe and can be called from any thread and context.

13
GB_get_registers.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>[[GB_registers_t]] *GB_get_registers([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_registers` is thread-safe and can be called from any thread and context.

13
GB_get_rom_crc32.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>uint32_t GB_get_rom_crc32([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_rom_crc32` is thread-safe and can be called from any thread and context.

13
GB_get_rom_title.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_get_rom_title([[GB_gameboy_t]] *gb, char *title);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_rom_title` is thread-safe and can be called from any thread and context.

13
GB_get_save_state_size.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>size_t GB_get_save_state_size([[GB_gameboy_t]] *gb);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_get_save_state_size` is thread-safe and can be called from any thread and context.

@ -0,0 +1,15 @@
## Definition
<tt>unsigned GB_get_screen_height([[GB_gameboy_t]] *gb);</tt>
<tt>unsigned GB_get_screen_width([[GB_gameboy_t]] *gb);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_get_screen_width` and `GB_get_screen_height` are thread-safe and can be called from any thread and context.

13
GB_get_state_model.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_get_state_model(const char *path, [[GB_model_t]] *model);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_get_state_model` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>int GB_get_state_model_from_buffer(const uint8_t *buffer, size_t length, [[GB_model_t]] *model);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_get_state_model_from_buffer` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>uint32_t GB_get_unmultiplied_clock_rate([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_get_unmultiplied_clock_rate` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>double GB_get_usual_frame_rate([[GB_gameboy_t]] *gb);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_get_usual_frame_rate` is thread-safe and can be called from any thread and context.

13
GB_has_accelerometer.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_has_accelerometer([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_has_accelerometer` is thread-safe and can be called from any thread and context.

13
GB_icd_set_joyp.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_icd_set_joyp([[GB_gameboy_t]] *gb, uint8_t value);</tt>
In `joypad.h`
## Description
TBD
## Thread Safety
`GB_icd_set_joyp` is thread-safe and can be called from any thread and context.

13
GB_import_cheat.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>const [[GB_cheat_t]] *GB_import_cheat([[GB_gameboy_t]] *gb, const char *cheat, const char *description, bool enabled);</tt>
In `cheats.h`
## Description
TBD
## Thread Safety
`GB_import_cheat` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

9
GB_inline_const.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_inline_const(type, ...) (*({static const typeof(type) _= __VA_ARGS__; &_;}))</tt>
In `defs.h`
## Description
TBD

13
GB_is_cgb.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_cgb(const [[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_is_cgb` is thread-safe and can be called from any thread and context.

13
GB_is_cgb_in_cgb_mode.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_cgb_in_cgb_mode([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_is_cgb_in_cgb_mode` is thread-safe and can be called from any thread and context.

13
GB_is_channel_muted.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_channel_muted([[GB_gameboy_t]] *gb, [[GB_channel_t]] channel);</tt>
In `apu.h`
## Description
TBD
## Thread Safety
`GB_is_channel_muted` is thread-safe and can be called from any thread and context.

13
GB_is_hle_sgb.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_hle_sgb([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_is_hle_sgb` is thread-safe and can be called from any thread and context.

13
GB_is_odd_frame.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_odd_frame([[GB_gameboy_t]] *gb);</tt>
In `display.h`
## Description
TBD
## Thread Safety
`GB_is_odd_frame` is thread-safe and can be called from any thread and context.

13
GB_is_save_state.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_save_state(const char *path);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_is_save_state` is thread-safe and can be called from any thread and context.

13
GB_is_sgb.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>bool GB_is_sgb([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_is_sgb` is thread-safe and can be called from any thread and context.

22
GB_key_mask_t.md Normal file

@ -0,0 +1,22 @@
## Definition
<pre>
typedef enum {
GB_KEY_RIGHT_MASK = 1 << <a href="GB_key_t.md">GB_KEY_RIGHT</a>,
GB_KEY_LEFT_MASK = 1 << <a href="GB_key_t.md">GB_KEY_LEFT</a>,
GB_KEY_UP_MASK = 1 << <a href="GB_key_t.md">GB_KEY_UP</a>,
GB_KEY_DOWN_MASK = 1 << <a href="GB_key_t.md">GB_KEY_DOWN</a>,
GB_KEY_A_MASK = 1 << <a href="GB_key_t.md">GB_KEY_A</a>,
GB_KEY_B_MASK = 1 << <a href="GB_key_t.md">GB_KEY_B</a>,
GB_KEY_SELECT_MASK = 1 << <a href="GB_key_t.md">GB_KEY_SELECT</a>,
GB_KEY_START_MASK = 1 << <a href="GB_key_t.md">GB_KEY_START</a>,
} GB_key_mask_t;
#define GB_MASK_FOR_PLAYER(mask, player) ((x) << (player * 8))
</pre>
In `joypad.h`
## Description
TBD

21
GB_key_t.md Normal file

@ -0,0 +1,21 @@
## Definition
```c
typedef enum {
GB_KEY_RIGHT,
GB_KEY_LEFT,
GB_KEY_UP,
GB_KEY_DOWN,
GB_KEY_A,
GB_KEY_B,
GB_KEY_SELECT,
GB_KEY_START,
GB_KEY_MAX
} GB_key_t;
```
In `joypad.h`
## Description
TBD

9
GB_likely.md Normal file

@ -0,0 +1,9 @@
## Definition
<tt>#define GB_likely(x)</tt>
In `defs.h`
## Description
TBD

13
GB_load_battery.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_battery([[GB_gameboy_t]] *gb, const char *path);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_battery` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>void GB_load_battery_from_buffer([[GB_gameboy_t]] *gb, const uint8_t *buffer, size_t size);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_battery_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).

13
GB_load_boot_rom.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_boot_rom([[GB_gameboy_t]] *gb, const char *path);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_boot_rom` is thread-safe and can be called from any thread and context.

@ -0,0 +1,13 @@
## Definition
<tt>void GB_load_boot_rom_from_buffer([[GB_gameboy_t]] *gb, const unsigned char *buffer, size_t size);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_boot_rom_from_buffer` is thread-safe and can be called from any thread and context.

13
GB_load_cheats.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_cheats([[GB_gameboy_t]] *gb, const char *path, bool replace_existing);</tt>
In `cheats.h`
## Description
TBD
## Thread Safety
`GB_load_cheats` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_load_gbs.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_gbs([[GB_gameboy_t]] *gb, const char *path, [[GB_gbs_info_t]] *info);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_gbs` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_gbs_from_buffer([[GB_gameboy_t]] *gb, const uint8_t *buffer, size_t size, [[GB_gbs_info_t]] *info);</tt>
In `gb.h`
## Description
TBD
## 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).

13
GB_load_isx.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_isx([[GB_gameboy_t]] *gb, const char *path);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_isx` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

13
GB_load_rom.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_rom([[GB_gameboy_t]] *gb, const char *path);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_rom` must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>void GB_load_rom_from_buffer([[GB_gameboy_t]] *gb, const uint8_t *buffer, size_t size);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_load_rom_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).

13
GB_load_state.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_state([[GB_gameboy_t]] *gb, const char *path);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_load_state` must not be called if the instance is being run in any thread, including the current one (via a callback).

@ -0,0 +1,13 @@
## Definition
<tt>int GB_load_state_from_buffer([[GB_gameboy_t]] *gb, const uint8_t *buffer, size_t length);</tt>
In `save_state.h`
## Description
TBD
## Thread Safety
`GB_load_state_from_buffer` must not be called if the instance is being run in any thread, including the current one (via a callback).

13
GB_log.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_log([[GB_gameboy_t]] *gb, const char *fmt, ...) __printflike(2, 3);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_log` is thread-safe and can be called from any thread and context.

16
GB_log_attributes_t.md Normal file

@ -0,0 +1,16 @@
## Definition
```c
typedef enum {
GB_LOG_BOLD = 1,
GB_LOG_DASHED_UNDERLINE = 2,
GB_LOG_UNDERLINE = 4,
GB_LOG_UNDERLINE_MASK = GB_LOG_DASHED_UNDERLINE | GB_LOG_UNDERLINE
} GB_log_attributes_t;
```
In `gb.h`
## Description
TBD

15
GB_map_type_t.md Normal file

@ -0,0 +1,15 @@
## Definition
```c
typedef enum {
GB_MAP_AUTO,
GB_MAP_9800,
GB_MAP_9C00,
} GB_map_type_t;
```
In `display.h`
## Description
TBD

47
GB_model_t.md Normal file

@ -0,0 +1,47 @@
## Definition
```c
#define GB_MODEL_FAMILY_MASK 0xF00
#define GB_MODEL_DMG_FAMILY 0x000
#define GB_MODEL_MGB_FAMILY 0x100
#define GB_MODEL_CGB_FAMILY 0x200
#define GB_MODEL_GBP_BIT 0x20
#define GB_MODEL_PAL_BIT 0x40
#define GB_MODEL_NO_SFC_BIT 0x80
typedef enum {
// GB_MODEL_DMG_0 = 0x000,
// GB_MODEL_DMG_A = 0x001,
GB_MODEL_DMG_B = 0x002,
// GB_MODEL_DMG_C = 0x003,
GB_MODEL_SGB = 0x004,
GB_MODEL_SGB_NTSC = GB_MODEL_SGB,
GB_MODEL_SGB_PAL = GB_MODEL_SGB | GB_MODEL_PAL_BIT,
GB_MODEL_SGB_NTSC_NO_SFC = GB_MODEL_SGB | GB_MODEL_NO_SFC_BIT,
GB_MODEL_SGB_NO_SFC = GB_MODEL_SGB_NTSC_NO_SFC,
GB_MODEL_SGB_PAL_NO_SFC = GB_MODEL_SGB | GB_MODEL_NO_SFC_BIT | GB_MODEL_PAL_BIT,
GB_MODEL_MGB = 0x100,
GB_MODEL_SGB2 = 0x101,
GB_MODEL_SGB2_NO_SFC = GB_MODEL_SGB2 | GB_MODEL_NO_SFC_BIT,
GB_MODEL_CGB_0 = 0x200,
GB_MODEL_CGB_A = 0x201,
GB_MODEL_CGB_B = 0x202,
GB_MODEL_CGB_C = 0x203,
GB_MODEL_CGB_D = 0x204,
GB_MODEL_CGB_E = 0x205,
// GB_MODEL_AGB_0 = 0x206,
GB_MODEL_AGB_A = 0x207,
GB_MODEL_GBP_A = GB_MODEL_AGB_A | GB_MODEL_GBP_BIT,
GB_MODEL_AGB = GB_MODEL_AGB_A,
GB_MODEL_GBP = GB_MODEL_GBP_A,
// GB_MODEL_AGB_B = 0x208
// GB_MODEL_AGB_E = 0x209
// GB_MODEL_GBP_E = GB_MODEL_AGB_E | GB_MODEL_GBP_BIT,
} GB_model_t;
```
In `model.h`
## Description
TBD

16
GB_oam_info_t.md Normal file

@ -0,0 +1,16 @@
## Definition
```c
typedef struct {
uint32_t image[128];
uint8_t x, y, tile, flags;
uint16_t oam_addr;
bool obscured_by_line_limit;
} GB_oam_info_t;
```
In `display.h`
## Description
TBD

15
GB_palette_t.md Normal file

@ -0,0 +1,15 @@
## Definition
```c
typedef struct {
struct GB_color_s {
uint8_t r, g, b;
} colors[5];
} GB_palette_t;
```
In `display.h`
## Description
TBD

16
GB_palette_type_t.md Normal file

@ -0,0 +1,16 @@
## Definition
```c
typedef enum {
GB_PALETTE_NONE,
GB_PALETTE_BACKGROUND,
GB_PALETTE_OAM,
GB_PALETTE_AUTO,
} GB_palette_type_t;
```
In `display.h`
## Description
TBD

@ -0,0 +1,16 @@
## Definition
```c
typedef void (*GB_print_image_callback_t)(GB_gameboy_t *gb,
uint32_t *image,
uint8_t height,
uint8_t top_margin,
uint8_t bottom_margin,
uint8_t exposure);
```
In `printer.h`
## Description
TBD

@ -0,0 +1,11 @@
## Definition
```c
typedef void (*GB_printer_done_callback_t)(GB_gameboy_t *gb);
```
In `printer.h`
## Description
TBD

13
GB_quick_reset.md Normal file

@ -0,0 +1,13 @@
## Definition
<tt>void GB_quick_reset([[GB_gameboy_t]] *gb);</tt>
In `gb.h`
## Description
TBD
## Thread Safety
`GB_quick_reset` must not be called if the instance is being run in any thread, including the current one (via a callback).

Some files were not shown because too many files have changed in this diff Show More