-
-
Notifications
You must be signed in to change notification settings - Fork 212
Home
This wiki serves as the API documentation of SameBoy's core. It is currently a work in progress, and reflects the API for SameBoy 1.0.
The recommended way to use SameBoy as a library is to build the lib
target, and use the built .o
or .a
file, together with the generated include
directory. This guarantees SameBoy is compiled with the optimal compilation flags. You do not need to include specific header files, the main header file will include all other headers for you:
#include <sameboy/gb.h>
See the README file in the main repositry for more information about building and build configurations.
These APIs are used for base operations of an emulator instance; including initialization, running, loading ROM files, etc.
- Instance Allocation
- GB_gameboy_t
- GB_model_t
- GB_get_model
- GB_run
- GB_run_frame
- GB_reset
- GB_quick_reset
- GB_switch_model_and_reset
- GB_set_boot_rom_load_callback
- GB_load_boot_rom
- GB_load_boot_rom_from_buffer
- GB_load_isx
- GB_load_rom
- GB_load_rom_from_buffer
- GB_get_clock_rate
- GB_set_clock_multiplier
- GB_get_unmultiplied_clock_rate
- GB_get_direct_access
- GB_set_user_data and GB_get_user_data
- GB_is_cgb
- GB_is_cgb_in_cgb_mode
- GB_is_hle_sgb
- GB_is_sgb
- GB_random_seed
- GB_random_set_enabled
- GB_set_open_bus_decay_time
- GB_set_rendering_disabled
- GB_set_turbo_mode
- IO Register Constants
These APIs are used to obtain the video output of an emulator instance and affect it.
- GB_set_pixels_output
- GB_set_rgb_encode_callback
- GB_get_screen_width and GB_get_screen_height
- GB_set_vblank_callback
- GB_set_border_mode
- GB_set_color_correction_mode
- GB_set_light_temperature
- GB_set_palette and GB_get_palette
- Built‐In DMG Palettes
- GB_convert_rgb15
- GB_draw_tilemap
- GB_draw_tileset
- GB_get_oam_info
- GB_get_usual_frame_rate
- GB_is_odd_frame
- GB_map_type_t
- GB_oam_info_t
- GB_palette_t
- GB_palette_type_t
- GB_set_background_rendering_disabled
- GB_set_object_rendering_disabled
These APIs are used to obtain the audio output of an emulator instance and affect it.
- GB_set_sample_rate
- GB_apu_set_sample_callback
- GB_sample_t
- GB_set_highpass_filter_mode
- GB_audio_format_t
- GB_get_apu_wave_table
- GB_get_channel_amplitude
- GB_get_channel_edge_triggered
- GB_get_channel_period
- GB_get_channel_volume
- GB_is_channel_muted
- GB_set_channel_muted
- GB_set_interference_volume
- GB_start_audio_recording
- GB_stop_audio_recording
These APIs are used to handle the player controls in an emulator instance.
- GB_key_t
- GB_key_mask_t
- GB_set_key_state
- GB_set_key_state_for_player
- GB_set_key_mask
- GB_set_key_mask_for_player
- GB_get_player_count
- GB_get_joyp_accessed
- GB_clear_joyp_accessed
- GB_has_accelerometer
- GB_set_accelerometer_values
- GB_set_allow_illegal_inputs
- GB_set_emulate_joypad_bouncing
- GB_set_rumble_mode
- GB_set_rumble_callback
- GB_set_update_input_hint_callback
These APIs are used to save and load battery and save states.
- GB_save_battery
- GB_save_battery_to_buffer
- GB_save_battery_size
- GB_load_battery
- GB_load_battery_from_buffer
- GB_save_state
- GB_save_state_to_buffer
- GB_get_save_state_size
- GB_load_state
- GB_load_state_from_buffer
- GB_get_state_model
- GB_get_state_model_from_buffer
- GB_is_save_state
- GB_debugger_break
- GB_debugger_evaluate
- GB_debugger_execute_command
- GB_debugger_is_stopped
- GB_debugger_set_disabled
- GB_debugger_clear_symbols
- GB_debugger_set_reload_callback
- GB_debugger_complete_substring
- GB_debugger_describe_address
- GB_debugger_load_symbol_file
- GB_debugger_name_for_address
- GB_cpu_disassemble
These APIs are used to provide image input while emulating a Game Boy Camera.
These APIs are used to manage and apply cheats to an emulator instance.
- GB_add_cheat
- GB_CHEAT_ANY_BANK
- GB_cheat_t
- GB_cheats_enabled
- GB_get_cheats
- GB_import_cheat
- GB_load_cheats
- GB_remove_all_cheats
- GB_remove_cheat
- GB_save_cheats
- GB_set_cheats_enabled
- GB_update_cheat
These APIs are used to search the memory of an emulator instance for specific values for the purpose of creating cheat codes.
- GB_cheat_search_data_type_t
- GB_cheat_search_filter
- GB_cheat_search_get_results
- GB_cheat_search_reset
- GB_cheat_search_result_count
- GB_cheat_search_result_t
These APIs are used to communicate with the serial port and infrared transceiver of an emulator instance. They can also connect a built-in supported accessory (such as a Game Boy Printer or WorkBoy) to an emulator instance.
- GB_accessory_t
- GB_connect_printer
- GB_connect_workboy
- GB_disconnect_serial
- GB_get_built_in_accessory
- GB_print_image_callback_t
- GB_printer_done_callback_t
- GB_serial_get_data_bit
- GB_serial_set_data_bit
- GB_set_infrared_callback
- GB_set_infrared_input
- GB_set_serial_transfer_bit_end_callback
- GB_set_serial_transfer_bit_start_callback
- GB_workboy_is_enabled
- GB_workboy_set_key
These APIs are used to communicate with an emulator instance's console I/O, used for logging and debugger input/output.
These APIs are used to load and play GBS audio files in an emulator instance.
These APIs are used to obtain internal information about the currently loaded ROM or the current execution state of an emulator instance.
- GB_get_registers
- GB_get_rom_crc32
- GB_get_rom_title
- GB_read_memory
- GB_registers_t
- GB_safe_read_memory
- GB_set_execution_callback
- GB_set_read_memory_callback
- GB_set_write_memory_callback
- GB_write_memory
These macros are defined and exported by SameBoy and provide various capabilities and information.
These APIs are used to control and integrate with Real Time Clock features in supported ROMs.
These APIs are used to enable and control rewinding support in an emulator instance.
These APIs can be used to integrate SameBoy as the Game Boy core of a SFC or SNES emulator emulating a Super Game Boy.