document yaze.h

This commit is contained in:
scawful
2024-08-08 21:31:14 -04:00
parent 8a2477dd1f
commit 94fe4fe280
2 changed files with 34 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ namespace yaze_test {
TEST(YazeCLibTest, InitializeAndCleanup) {
yaze_flags flags;
yaze_init(&flags);
yaze_cleanup();
yaze_cleanup(&flags);
}
} // namespace yaze_test

View File

@@ -12,12 +12,34 @@ extern "C" {
#include "base/sprite.h"
typedef struct yaze_flags yaze_flags;
typedef struct z3_rom z3_rom;
/**
* @brief Flags to initialize the Yaze library.
*/
struct yaze_flags {
int debug;
const char* rom_filename;
z3_rom* rom;
};
/**
* @brief Initialize the Yaze library.
*
* @param flags Flags to initialize the library.
*/
void yaze_init(yaze_flags*);
/**
* @brief Clean up the Yaze library.
*
* @param flags Flags used to initialize the library.
*/
void yaze_cleanup(yaze_flags*);
typedef struct z3_rom z3_rom;
/**
* @brief Primitive of a Zelda3 ROM.
*/
struct z3_rom {
const char* filename;
const uint8_t* data;
@@ -25,15 +47,19 @@ struct z3_rom {
void* impl; // yaze::app::Rom*
};
struct yaze_flags {
int debug;
const char* rom_filename;
z3_rom* rom;
};
/**
* @brief Load a Zelda3 ROM from a file.
*/
z3_rom* yaze_load_rom(const char* filename);
/**
* @brief Unload a Zelda3 ROM.
*/
void yaze_unload_rom(z3_rom* rom);
/**
* @brief Get a color from a palette set.
*/
snes_color yaze_get_color_from_paletteset(const z3_rom* rom, int palette_set,
int palette, int color);