yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze.h
Go to the documentation of this file.
1#ifndef YAZE_H
2#define YAZE_H
3
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <stdbool.h>
21#include <stddef.h>
22#include <stdint.h>
23
24#include "zelda.h"
25
32#define YAZE_VERSION_STRING "0.3.2"
33
35#define YAZE_VERSION_NUMBER 302
36
43
65
72const char* yaze_status_to_string(yaze_status status);
73
83
91void yaze_library_shutdown(void);
92
100int yaze_app_main(int argc, char** argv);
101
108bool yaze_check_version_compatibility(const char* expected_version);
109
115const char* yaze_get_version_string(void);
116
123
136yaze_status yaze_init(yaze_editor_context* context, const char* rom_filename);
137
148
161typedef struct yaze_bitmap {
162 int width;
163 int height;
164 uint8_t bpp;
165 uint8_t* data;
167
179yaze_bitmap yaze_load_bitmap(const char* filename);
180
188void yaze_free_bitmap(yaze_bitmap* bitmap);
189
200yaze_bitmap yaze_create_bitmap(int width, int height, uint8_t bpp);
201
208typedef struct snes_color {
209 uint16_t red;
210 uint16_t green;
211 uint16_t blue;
213
222snes_color yaze_rgb_to_snes_color(uint8_t r, uint8_t g, uint8_t b);
223
232void yaze_snes_color_to_rgb(snes_color color, uint8_t* r, uint8_t* g, uint8_t* b);
233
240typedef struct snes_palette {
241 uint16_t id;
242 uint16_t size;
245
253snes_palette* yaze_create_palette(uint16_t id, uint16_t size);
254
261
269snes_palette* yaze_load_palette_from_rom(const zelda3_rom* rom, uint16_t palette_id);
270
277typedef struct snes_tile8 {
278 uint32_t id;
279 uint32_t palette_id;
280 uint8_t data[64];
282
291snes_tile8 yaze_load_tile_from_rom(const zelda3_rom* rom, uint32_t tile_id, uint8_t bpp);
292
301snes_tile8 yaze_convert_tile_bpp(const snes_tile8* tile, uint8_t from_bpp, uint8_t to_bpp);
302
310
314
315typedef struct snes_tile32 {
316 uint16_t t0;
317 uint16_t t1;
318 uint16_t t2;
319 uint16_t t3;
321
339zelda3_rom* yaze_load_rom_file(const char* filename);
340
350
359yaze_status yaze_get_rom_info(const zelda3_rom* rom, zelda3_version* version, uint64_t* size);
360
373 int palette_set, int palette,
374 int color);
375
395
402
410const zelda3_overworld_map* yaze_get_overworld_map(const zelda3_overworld* overworld, int map_index);
411
419
439
447const zelda3_dungeon_room* yaze_load_room(const zelda3_rom* rom, int room_id);
448
455void yaze_free_rooms(zelda3_dungeon_room* rooms, int room_count);
456
476yaze_status yaze_load_messages(const zelda3_rom* rom, zelda3_message** messages, int* message_count);
477
485const zelda3_message* yaze_get_message(const zelda3_rom* rom, int message_id);
486
493void yaze_free_messages(zelda3_message* messages, int message_count);
494
503typedef void (*yaze_cleanup_func)(void);
504
516typedef struct yaze_extension {
517 const char* name;
518 const char* version;
519 const char* description;
520 const char* author;
533
540 void (*cleanup)(void);
541
549 uint32_t (*get_capabilities)(void);
551
553#define YAZE_EXT_CAP_ROM_EDITING (1 << 0)
554#define YAZE_EXT_CAP_GRAPHICS (1 << 1)
555#define YAZE_EXT_CAP_AUDIO (1 << 2)
556#define YAZE_EXT_CAP_SCRIPTING (1 << 3)
557#define YAZE_EXT_CAP_IMPORT_EXPORT (1 << 4)
566
574
577#ifdef __cplusplus
578}
579#endif
580
581#endif // YAZE_H
yaze_status yaze_library_init(void)
Initialize the YAZE library.
Definition yaze.cc:19
int yaze_app_main(int argc, char **argv)
Main entry point for the YAZE application.
int yaze_get_version_number(void)
Get the current YAZE version number.
Definition yaze.cc:67
const char * yaze_get_version_string(void)
Get the current YAZE version string.
Definition yaze.cc:63
yaze_status
Status codes returned by YAZE functions.
Definition yaze.h:55
bool yaze_check_version_compatibility(const char *expected_version)
Check if the current YAZE version is compatible with the expected version.
Definition yaze.cc:71
yaze_status yaze_shutdown(yaze_editor_context *context)
Shutdown and clean up a YAZE editor context.
Definition yaze.cc:104
yaze_status yaze_init(yaze_editor_context *context, const char *rom_filename)
Initialize a YAZE editor context.
Definition yaze.cc:78
const char * yaze_status_to_string(yaze_status status)
Convert a status code to a human-readable string.
Definition yaze.cc:40
void yaze_library_shutdown(void)
Shutdown the YAZE library.
Definition yaze.cc:29
@ YAZE_OK
Definition yaze.h:56
@ YAZE_ERROR_CORRUPTION
Definition yaze.h:62
@ YAZE_ERROR_IO
Definition yaze.h:61
@ YAZE_ERROR_FILE_NOT_FOUND
Definition yaze.h:59
@ YAZE_ERROR_INVALID_ARG
Definition yaze.h:58
@ YAZE_ERROR_MEMORY
Definition yaze.h:60
@ YAZE_ERROR_NOT_INITIALIZED
Definition yaze.h:63
@ YAZE_ERROR_UNKNOWN
Definition yaze.h:57
void yaze_free_rooms(zelda3_dungeon_room *rooms, int room_count)
Free dungeon room data.
const zelda3_dungeon_room * yaze_load_room(const zelda3_rom *rom, int room_id)
Load a specific dungeon room.
zelda3_dungeon_room * yaze_load_all_rooms(const zelda3_rom *rom, int *room_count)
Load all dungeon rooms from ROM.
yaze_status yaze_unregister_extension(const char *name)
Unregister an extension.
yaze_status yaze_register_extension(const yaze_extension *extension)
Register an extension with YAZE.
snes_color yaze_rgb_to_snes_color(uint8_t r, uint8_t g, uint8_t b)
Convert RGB888 color to SNES color.
Definition yaze.cc:306
snes_palette * yaze_load_palette_from_rom(const zelda3_rom *rom, uint16_t palette_id)
Load palette from ROM.
yaze_bitmap yaze_load_bitmap(const char *filename)
Load a bitmap from file.
Definition yaze.cc:172
snes_tile8 yaze_load_tile_from_rom(const zelda3_rom *rom, uint32_t tile_id, uint8_t bpp)
Load tile data from ROM.
snes_palette * yaze_create_palette(uint16_t id, uint16_t size)
Create an empty palette.
snes_tile8 yaze_convert_tile_bpp(const snes_tile8 *tile, uint8_t from_bpp, uint8_t to_bpp)
Convert tile data between different bit depths.
yaze_bitmap yaze_create_bitmap(int width, int height, uint8_t bpp)
Create an empty bitmap.
Definition yaze.cc:290
void yaze_free_bitmap(yaze_bitmap *bitmap)
Free bitmap data.
Definition yaze.cc:280
void yaze_free_palette(snes_palette *palette)
Free palette memory.
void yaze_snes_color_to_rgb(snes_color color, uint8_t *r, uint8_t *g, uint8_t *b)
Convert SNES color to RGB888.
Definition yaze.cc:314
void yaze_free_messages(zelda3_message *messages, int message_count)
Free message data.
yaze_status yaze_load_messages(const zelda3_rom *rom, zelda3_message **messages, int *message_count)
Load all text messages from ROM.
Definition yaze.cc:234
const zelda3_message * yaze_get_message(const zelda3_rom *rom, int message_id)
Get a specific message by ID.
zelda3_overworld * yaze_load_overworld(const zelda3_rom *rom)
Load the overworld from ROM.
Definition yaze.cc:203
int yaze_get_overworld_map_count(const zelda3_overworld *overworld)
Get total number of overworld maps.
void yaze_free_overworld(zelda3_overworld *overworld)
Free overworld data.
const zelda3_overworld_map * yaze_get_overworld_map(const zelda3_overworld *overworld, int map_index)
Get overworld map by index.
zelda3_version
Different versions of the game supported by YAZE.
Definition zelda.h:33
yaze_status yaze_validate_rom(const zelda3_rom *rom)
Validate ROM integrity.
zelda3_rom * yaze_load_rom_file(const char *filename)
Load a ROM file.
yaze_status yaze_get_rom_info(const zelda3_rom *rom, zelda3_version *version, uint64_t *size)
Get ROM information.
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.
Definition yaze.cc:181
SNES color in 15-bit RGB format (BGR555)
Definition yaze.h:208
uint16_t green
Definition yaze.h:210
uint16_t red
Definition yaze.h:209
uint16_t blue
Definition yaze.h:211
SNES color palette.
Definition yaze.h:240
uint16_t id
Definition yaze.h:241
uint16_t size
Definition yaze.h:242
snes_color * colors
Definition yaze.h:243
snes_tile_info tiles[4]
Definition yaze.h:312
uint16_t t1
Definition yaze.h:317
uint16_t t0
Definition yaze.h:316
uint16_t t2
Definition yaze.h:318
uint16_t t3
Definition yaze.h:319
8x8 SNES tile data
Definition yaze.h:277
uint32_t id
Definition yaze.h:278
uint8_t data[64]
Definition yaze.h:280
uint32_t palette_id
Definition yaze.h:279
uint8_t palette
Definition yaze.h:305
bool priority
Definition yaze.h:306
bool vertical_mirror
Definition yaze.h:307
uint16_t id
Definition yaze.h:304
bool horizontal_mirror
Definition yaze.h:308
Bitmap data structure.
Definition yaze.h:161
uint8_t * data
Definition yaze.h:165
int height
Definition yaze.h:163
uint8_t bpp
Definition yaze.h:164
int width
Definition yaze.h:162
zelda3_rom * rom
Definition yaze.h:40
const char * error_message
Definition yaze.h:41
Extension interface for YAZE.
Definition yaze.h:516
const char * author
Definition yaze.h:520
void(* cleanup)(void)
Clean up the extension.
Definition yaze.h:540
uint32_t(* get_capabilities)(void)
Get extension capabilities.
Definition yaze.h:549
const char * description
Definition yaze.h:519
const char * version
Definition yaze.h:518
int api_version
Definition yaze.h:521
yaze_status(* initialize)(yaze_editor_context *context)
Initialize the extension.
Definition yaze.h:532
const char * name
Definition yaze.h:517
Complete dungeon room data.
Definition zelda.h:460
In-game text message data.
Definition zelda.h:271
Overworld map data.
Definition zelda.h:294
Complete overworld data.
Definition zelda.h:332
ROM data structure.
Definition zelda.h:210
void(* yaze_cleanup_func)(void)
Definition yaze.h:503
void(* yaze_initialize_func)(yaze_editor_context *context)
Function pointer to initialize the extension.
Definition yaze.h:502
The Legend of Zelda: A Link to the Past - Data Structures and Constants.