From e0797fee241036ef537191f5c5c87303aaff5299 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 19 Jan 2025 21:00:51 -0500 Subject: [PATCH] Rename snes_color.h to snes.h and consolidate tile structures --- incl/{snes_color.h => snes.h} | 32 +++++++++++++++++++++++++--- incl/snes_tile.h | 40 ----------------------------------- incl/yaze.h | 2 +- src/app/gfx/snes_color.h | 2 +- src/app/gfx/snes_tile.h | 2 +- src/cli/z3ed.h | 28 +++++------------------- 6 files changed, 37 insertions(+), 69 deletions(-) rename incl/{snes_color.h => snes.h} (54%) delete mode 100644 incl/snes_tile.h diff --git a/incl/snes_color.h b/incl/snes.h similarity index 54% rename from incl/snes_color.h rename to incl/snes.h index db23db0c..c7d34454 100644 --- a/incl/snes_color.h +++ b/incl/snes.h @@ -1,10 +1,11 @@ -#ifndef YAZE_BASE_SNES_COLOR_H_ -#define YAZE_BASE_SNES_COLOR_H_ +#ifndef YAZE_INCL_SNES_TILE_H +#define YAZE_INCL_SNES_TILE_H #ifdef __cplusplus extern "C" { #endif +#include #include /** @@ -25,8 +26,33 @@ typedef struct snes_palette { snes_color* colors; /**< Pointer to the colors in the palette. */ } snes_palette; +typedef struct snes_tile8 { + uint32_t id; + uint32_t palette_id; + uint8_t data[64]; +} snes_tile8; + +typedef struct snes_tile_info { + uint16_t id; + uint8_t palette; + bool priority; + bool vertical_mirror; + bool horizontal_mirror; +} snes_tile_info; + +typedef struct snes_tile16 { + snes_tile_info tiles[4]; +} snes_tile16; + +typedef struct snes_tile32 { + uint16_t t0; + uint16_t t1; + uint16_t t2; + uint16_t t3; +} snes_tile32; + #ifdef __cplusplus } #endif -#endif // YAZE_BASE_SNES_COLOR_H_ +#endif diff --git a/incl/snes_tile.h b/incl/snes_tile.h deleted file mode 100644 index 922bbf4d..00000000 --- a/incl/snes_tile.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef YAZE_INCL_SNES_TILE_H -#define YAZE_INCL_SNES_TILE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef struct snes_tile8 { - uint32_t id; - uint32_t palette_id; - uint8_t data[64]; -} snes_tile8; - -typedef struct snes_tile_info { - uint16_t id; - uint8_t palette; - bool priority; - bool vertical_mirror; - bool horizontal_mirror; -} snes_tile_info; - -typedef struct snes_tile16 { - snes_tile_info tiles[4]; -} snes_tile16; - -typedef struct snes_tile32 { - uint16_t t0; - uint16_t t1; - uint16_t t2; - uint16_t t3; -} snes_tile32; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/incl/yaze.h b/incl/yaze.h index e69b879c..3e27b235 100644 --- a/incl/yaze.h +++ b/incl/yaze.h @@ -10,7 +10,7 @@ extern "C" { #include "dungeon.h" #include "overworld.h" -#include "snes_color.h" +#include "snes.h" #include "zelda.h" typedef struct yaze_project yaze_project; diff --git a/src/app/gfx/snes_color.h b/src/app/gfx/snes_color.h index 82a37536..0aa89647 100644 --- a/src/app/gfx/snes_color.h +++ b/src/app/gfx/snes_color.h @@ -1,7 +1,7 @@ #ifndef YAZE_APP_GFX_SNES_COLOR_H_ #define YAZE_APP_GFX_SNES_COLOR_H_ -#include +#include #include #include diff --git a/src/app/gfx/snes_tile.h b/src/app/gfx/snes_tile.h index 1d78cece..e113a642 100644 --- a/src/app/gfx/snes_tile.h +++ b/src/app/gfx/snes_tile.h @@ -1,7 +1,7 @@ #ifndef YAZE_APP_GFX_SNES_TILE_H #define YAZE_APP_GFX_SNES_TILE_H -#include +#include #include #include diff --git a/src/cli/z3ed.h b/src/cli/z3ed.h index fe8d7c13..2c338d1e 100644 --- a/src/cli/z3ed.h +++ b/src/cli/z3ed.h @@ -65,9 +65,11 @@ class CreatePatch : public CommandHandler { absl::Status handle(const std::vector& arg_vec) override; }; -/** - * @brief Open a Rom file and display information about it. - */ +class Tile16Transfer : public CommandHandler { + public: + absl::Status handle(const std::vector& arg_vec) override; +}; + class Open : public CommandHandler { public: absl::Status handle(const std::vector& arg_vec) override { @@ -83,9 +85,6 @@ class Open : public CommandHandler { } }; -/** - * @brief Backup a Rom file. - */ class Backup : public CommandHandler { public: absl::Status handle(const std::vector& arg_vec) override { @@ -100,17 +99,11 @@ class Backup : public CommandHandler { } }; -// Compress Graphics class Compress : public CommandHandler { public: absl::Status handle(const std::vector& arg_vec) override; }; -// Decompress (Export) Graphics -// -// -e --mode= -// -// mode: class Decompress : public CommandHandler { public: absl::Status handle(const std::vector& arg_vec) override; @@ -195,17 +188,6 @@ class ReadFromRom : public CommandHandler { } }; -/** - * @brief Transfer tile 16 data from one Rom to another. - - * @param arg_vec `-t ""` - * @return absl::Status -*/ -class Tile16Transfer : public CommandHandler { - public: - absl::Status handle(const std::vector& arg_vec) override; -}; - /** * @brief Expand a Rom file.