#include <cstring>#include <memory>#include <string>#include <vector>#include "app/editor/message/message_data.h"#include "rom/rom.h"#include "yaze.h"#include "yaze_config.h"#include "zelda3/game_data.h"#include "zelda3/overworld/overworld.h"Go to the source code of this file.
Functions | |
| yaze_status | yaze_library_init () |
| Initialize the YAZE library. | |
| void | yaze_library_shutdown () |
| Shutdown the YAZE library. | |
| const char * | yaze_status_to_string (yaze_status status) |
| Convert a status code to a human-readable string. | |
| const char * | yaze_get_version_string () |
| Get the current YAZE version string. | |
| int | yaze_get_version_number () |
| Get the current YAZE version number. | |
| bool | yaze_check_version_compatibility (const char *expected_version) |
| Check if the current YAZE version is compatible with the expected version. | |
| yaze_status | yaze_init (yaze_editor_context *context, const char *rom_filename) |
| Initialize a YAZE editor context. | |
| yaze_status | yaze_shutdown (yaze_editor_context *context) |
| Shutdown and clean up a YAZE editor context. | |
| zelda3_rom * | yaze_load_rom (const char *filename) |
| Load a ROM file. | |
| void | yaze_unload_rom (zelda3_rom *rom) |
| Unload and free ROM data. | |
| int | yaze_save_rom (zelda3_rom *rom, const char *filename) |
| Save ROM to file. | |
| yaze_bitmap | yaze_load_bitmap (const char *filename) |
| Load a bitmap from file. | |
| snes_color | yaze_get_color_from_paletteset (const zelda3_rom *rom, int palette_set, int palette, int color) |
| Get a color from a palette set. | |
| zelda3_overworld * | yaze_load_overworld (const zelda3_rom *rom) |
| Load the overworld from ROM. | |
| zelda3_dungeon_room * | yaze_load_all_rooms (const zelda3_rom *rom, int *room_count) |
| Load all dungeon rooms from ROM. | |
| yaze_status | yaze_load_messages (const zelda3_rom *rom, zelda3_message **messages, int *message_count) |
| Load all text messages from ROM. | |
| void | yaze_free_bitmap (yaze_bitmap *bitmap) |
| Free bitmap data. | |
| yaze_bitmap | yaze_create_bitmap (int width, int height, uint8_t bpp) |
| Create an empty bitmap. | |
| snes_color | yaze_rgb_to_snes_color (uint8_t r, uint8_t g, uint8_t b) |
| Convert RGB888 color to SNES color. | |
| void | yaze_snes_color_to_rgb (snes_color color, uint8_t *r, uint8_t *g, uint8_t *b) |
| Convert SNES color to RGB888. | |
| zelda3_version | zelda3_detect_version (const uint8_t *rom_data, size_t size) |
| Detect ROM version from header data. | |
| const char * | zelda3_version_to_string (zelda3_version version) |
| Get version name as string. | |
| const zelda3_version_pointers * | zelda3_get_version_pointers (zelda3_version version) |
| Get version-specific pointers. | |
| yaze_status yaze_library_init | ( | void | ) |
Initialize the YAZE library.
This function must be called before using any other YAZE functions. It initializes internal subsystems and prepares the library for use.
Definition at line 20 of file yaze.cc.
References YAZE_OK.
Referenced by yaze_init().
| void yaze_library_shutdown | ( | void | ) |
Shutdown the YAZE library.
This function cleans up resources allocated by yaze_library_init(). After calling this function, no other YAZE functions should be called until yaze_library_init() is called again.
| const char * yaze_status_to_string | ( | yaze_status | status | ) |
Convert a status code to a human-readable string.
| status | The status code to convert |
Definition at line 41 of file yaze.cc.
References YAZE_ERROR_CORRUPTION, YAZE_ERROR_FILE_NOT_FOUND, YAZE_ERROR_INVALID_ARG, YAZE_ERROR_IO, YAZE_ERROR_MEMORY, YAZE_ERROR_NOT_INITIALIZED, YAZE_ERROR_UNKNOWN, and YAZE_OK.
| const char * yaze_get_version_string | ( | void | ) |
Get the current YAZE version string.
Definition at line 64 of file yaze.cc.
References YAZE_VERSION_STRING.
| int yaze_get_version_number | ( | void | ) |
Get the current YAZE version number.
Definition at line 66 of file yaze.cc.
References YAZE_VERSION_NUMBER.
| bool yaze_check_version_compatibility | ( | const char * | expected_version | ) |
Check if the current YAZE version is compatible with the expected version.
| expected_version | Expected version string (e.g., "0.3.2") |
Definition at line 68 of file yaze.cc.
References YAZE_VERSION_STRING.
| yaze_status yaze_init | ( | yaze_editor_context * | context, |
| const char * | rom_filename ) |
Initialize a YAZE editor context.
Creates and initializes an editor context for working with ROM files. The context manages the ROM data and provides access to editing functions.
| context | Pointer to context structure to initialize |
| rom_filename | Path to the ROM file to load (can be NULL to create empty context) |
Definition at line 75 of file yaze.cc.
References yaze_editor_context::error_message, yaze_editor_context::rom, YAZE_ERROR_FILE_NOT_FOUND, YAZE_ERROR_INVALID_ARG, yaze_library_init(), yaze_load_rom(), and YAZE_OK.

| yaze_status yaze_shutdown | ( | yaze_editor_context * | context | ) |
Shutdown and clean up a YAZE editor context.
Releases all resources associated with the context, including ROM data. After calling this function, the context should not be used.
| context | Pointer to context to shutdown |
Definition at line 101 of file yaze.cc.
References yaze_editor_context::error_message, yaze_editor_context::rom, YAZE_ERROR_INVALID_ARG, YAZE_OK, and yaze_unload_rom().

| yaze_bitmap yaze_load_bitmap | ( | const char * | filename | ) |
Load a bitmap from file.
Loads a bitmap image from the specified file. Supports common image formats and SNES-specific formats.
| filename | Path to the image file |
Definition at line 182 of file yaze.cc.
References yaze_bitmap::bpp, yaze_bitmap::data, yaze_bitmap::height, and yaze_bitmap::width.
| snes_color yaze_get_color_from_paletteset | ( | const zelda3_rom * | rom, |
| int | palette_set, | ||
| int | palette, | ||
| int | color ) |
Get a color from a palette set.
Retrieves a specific color from a palette set in the ROM.
| rom | The ROM to get the color from |
| palette_set | The palette set index (0-255) |
| palette | The palette index within the set (0-15) |
| color | The color index within the palette (0-15) |
Definition at line 191 of file yaze.cc.
References snes_color::blue, yaze::gfx::PaletteGroupMap::get_group(), snes_color::green, yaze::gfx::kPaletteGroupAddressesKeys, yaze::gfx::PaletteGroup::palette(), yaze::zelda3::GameData::palette_groups, and snes_color::red.

| zelda3_overworld * yaze_load_overworld | ( | const zelda3_rom * | rom | ) |
Load the overworld from ROM.
Loads and parses the overworld data from the ROM, including all maps, sprites, and related data structures.
| rom | The ROM to load the overworld from |
Definition at line 213 of file yaze.cc.
References zelda3_overworld_map::id, zelda3_overworld::impl, and zelda3_overworld::maps.
| zelda3_dungeon_room * yaze_load_all_rooms | ( | const zelda3_rom * | rom, |
| int * | room_count ) |
Load all dungeon rooms from ROM.
Loads and parses all dungeon room data from the ROM.
| rom | The ROM to load rooms from |
| room_count | Pointer to store the number of rooms loaded |
Definition at line 236 of file yaze.cc.
References zelda3_dungeon_room::id.
| yaze_status yaze_load_messages | ( | const zelda3_rom * | rom, |
| zelda3_message ** | messages, | ||
| int * | message_count ) |
Load all text messages from ROM.
Loads and parses all in-game text messages from the ROM.
| rom | The ROM to load messages from |
| messages | Pointer to store array of messages |
| message_count | Pointer to store number of messages loaded |
Definition at line 256 of file yaze.cc.
References yaze::Rom::data(), zelda3_message::id, yaze::editor::ReadAllTextData(), YAZE_ERROR_INVALID_ARG, YAZE_ERROR_MEMORY, YAZE_ERROR_NOT_INITIALIZED, and YAZE_OK.

| void yaze_free_bitmap | ( | yaze_bitmap * | bitmap | ) |
Free bitmap data.
Releases memory allocated for bitmap pixel data.
| bitmap | Pointer to bitmap structure to free |
Definition at line 303 of file yaze.cc.
References yaze_bitmap::bpp, yaze_bitmap::data, yaze_bitmap::height, and yaze_bitmap::width.
| yaze_bitmap yaze_create_bitmap | ( | int | width, |
| int | height, | ||
| uint8_t | bpp ) |
Create an empty bitmap.
Allocates a new bitmap with the specified dimensions.
| width | Width in pixels |
| height | Height in pixels |
| bpp | Bits per pixel |
Definition at line 313 of file yaze.cc.
References yaze_bitmap::bpp, yaze_bitmap::data, yaze_bitmap::height, and yaze_bitmap::width.
| snes_color yaze_rgb_to_snes_color | ( | uint8_t | r, |
| uint8_t | g, | ||
| uint8_t | b ) |
Convert RGB888 color to SNES color.
| r | Red component (0-255) |
| g | Green component (0-255) |
| b | Blue component (0-255) |
Definition at line 329 of file yaze.cc.
References snes_color::blue, snes_color::green, and snes_color::red.
| void yaze_snes_color_to_rgb | ( | snes_color | color, |
| uint8_t * | r, | ||
| uint8_t * | g, | ||
| uint8_t * | b ) |
Convert SNES color to RGB888.
| color | SNES color to convert |
| r | Pointer to store red component (0-255) |
| g | Pointer to store green component (0-255) |
| b | Pointer to store blue component (0-255) |
Definition at line 337 of file yaze.cc.
References snes_color::blue, snes_color::green, and snes_color::red.