Skip to content
Lior Halphon edited this page Nov 29, 2024 · 8 revisions

SameBoy API Reference

This wiki serves as the API documentation of SameBoy's core. It is currently a work in progress, and reflects the API for the upcoming SameBoy 1.0 release. Since version 1.0 has not been released yet, the API has not been finalized yet.

General Usage

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.

API Reference

Base

These APIs are used for base operations of an emulator instance; including initialization, running, loading ROM files, etc.

Video

These APIs are used to obtain the video output of an emulator instance and affect it.

Audio

These APIs are used to obtain the audio output of an emulator instance and affect it.

Player Controls

These APIs are used to handle the player controls in an emulator instance.

Saves

These APIs are used to save and load battery and save states.

Camera

These APIs are used to provide image input while emulating a Game Boy Camera.

Cheats

These APIs are used to manage and apply cheats to an emulator instance.

Cheat Search

These APIs are used to search the memory of an emulator instance for specific values for the purpose of creating cheat codes.

Connectivity

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.

Console I/O

These APIs are used to communicate with an emulator instance's console I/O, used for logging and debugger input/output.

GBS

These APIs are used to load and play GBS audio files in an emulator instance.

Inspection

These APIs are used to obtain internal information about the currently loaded ROM or the current execution state of an emulator instance.

Macros

These macros are defined and exported by SameBoy and provide various capabilities and information.

Real Time Clock

These APIs are used to control and integrate with Real Time Clock features in supported ROMs.

Rewinding

These APIs are used to enable and control rewinding support in an emulator instance.

SFC/SNES Integration

These APIs can be used to integrate SameBoy as the Game Boy core of a SFC or SNES emulator emulating a Super Game Boy.

Clone this wiki locally