diff --git a/src/test/libc_test.cc b/src/test/libc_test.cc index 50c6adce..d845ca79 100644 --- a/src/test/libc_test.cc +++ b/src/test/libc_test.cc @@ -7,7 +7,7 @@ namespace yaze_test { TEST(YazeCLibTest, InitializeAndCleanup) { yaze_flags flags; yaze_init(&flags); - yaze_cleanup(); + yaze_cleanup(&flags); } } // namespace yaze_test \ No newline at end of file diff --git a/src/yaze.h b/src/yaze.h index 4cc2a8f1..9cfc2871 100644 --- a/src/yaze.h +++ b/src/yaze.h @@ -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);