Rename snes_color.h to snes.h and consolidate tile structures

This commit is contained in:
scawful
2025-01-19 21:00:51 -05:00
parent c38108b551
commit e0797fee24
6 changed files with 37 additions and 69 deletions

View File

@@ -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 <stdbool.h>
#include <stdint.h>
/**
@@ -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

View File

@@ -1,40 +0,0 @@
#ifndef YAZE_INCL_SNES_TILE_H
#define YAZE_INCL_SNES_TILE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
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

View File

@@ -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;

View File

@@ -1,7 +1,7 @@
#ifndef YAZE_APP_GFX_SNES_COLOR_H_
#define YAZE_APP_GFX_SNES_COLOR_H_
#include <snes_color.h>
#include <snes.h>
#include <cstdint>
#include <vector>

View File

@@ -1,7 +1,7 @@
#ifndef YAZE_APP_GFX_SNES_TILE_H
#define YAZE_APP_GFX_SNES_TILE_H
#include <snes_tile.h>
#include <snes.h>
#include <array>
#include <cstdint>

View File

@@ -65,9 +65,11 @@ class CreatePatch : public CommandHandler {
absl::Status handle(const std::vector<std::string>& arg_vec) override;
};
/**
* @brief Open a Rom file and display information about it.
*/
class Tile16Transfer : public CommandHandler {
public:
absl::Status handle(const std::vector<std::string>& arg_vec) override;
};
class Open : public CommandHandler {
public:
absl::Status handle(const std::vector<std::string>& 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<std::string>& arg_vec) override {
@@ -100,17 +99,11 @@ class Backup : public CommandHandler {
}
};
// Compress Graphics
class Compress : public CommandHandler {
public:
absl::Status handle(const std::vector<std::string>& arg_vec) override;
};
// Decompress (Export) Graphics
//
// -e <rom_file> <bin_file> --mode=<optional:mode>
//
// mode:
class Decompress : public CommandHandler {
public:
absl::Status handle(const std::vector<std::string>& 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 <src_rom> <dest_rom> "<tile32_id_list:csv>"`
* @return absl::Status
*/
class Tile16Transfer : public CommandHandler {
public:
absl::Status handle(const std::vector<std::string>& arg_vec) override;
};
/**
* @brief Expand a Rom file.