Rename snes_color.h to snes.h and consolidate tile structures
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
#ifndef YAZE_BASE_SNES_COLOR_H_
|
#ifndef YAZE_INCL_SNES_TILE_H
|
||||||
#define YAZE_BASE_SNES_COLOR_H_
|
#define YAZE_INCL_SNES_TILE_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,8 +26,33 @@ typedef struct snes_palette {
|
|||||||
snes_color* colors; /**< Pointer to the colors in the palette. */
|
snes_color* colors; /**< Pointer to the colors in the palette. */
|
||||||
} snes_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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // YAZE_BASE_SNES_COLOR_H_
|
#endif
|
||||||
@@ -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
|
|
||||||
@@ -10,7 +10,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include "dungeon.h"
|
#include "dungeon.h"
|
||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
#include "snes_color.h"
|
#include "snes.h"
|
||||||
#include "zelda.h"
|
#include "zelda.h"
|
||||||
|
|
||||||
typedef struct yaze_project yaze_project;
|
typedef struct yaze_project yaze_project;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef YAZE_APP_GFX_SNES_COLOR_H_
|
#ifndef YAZE_APP_GFX_SNES_COLOR_H_
|
||||||
#define YAZE_APP_GFX_SNES_COLOR_H_
|
#define YAZE_APP_GFX_SNES_COLOR_H_
|
||||||
|
|
||||||
#include <snes_color.h>
|
#include <snes.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef YAZE_APP_GFX_SNES_TILE_H
|
#ifndef YAZE_APP_GFX_SNES_TILE_H
|
||||||
#define YAZE_APP_GFX_SNES_TILE_H
|
#define YAZE_APP_GFX_SNES_TILE_H
|
||||||
|
|
||||||
#include <snes_tile.h>
|
#include <snes.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|||||||
@@ -65,9 +65,11 @@ class CreatePatch : public CommandHandler {
|
|||||||
absl::Status handle(const std::vector<std::string>& arg_vec) override;
|
absl::Status handle(const std::vector<std::string>& arg_vec) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
class Tile16Transfer : public CommandHandler {
|
||||||
* @brief Open a Rom file and display information about it.
|
public:
|
||||||
*/
|
absl::Status handle(const std::vector<std::string>& arg_vec) override;
|
||||||
|
};
|
||||||
|
|
||||||
class Open : public CommandHandler {
|
class Open : public CommandHandler {
|
||||||
public:
|
public:
|
||||||
absl::Status handle(const std::vector<std::string>& arg_vec) override {
|
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 {
|
class Backup : public CommandHandler {
|
||||||
public:
|
public:
|
||||||
absl::Status handle(const std::vector<std::string>& arg_vec) override {
|
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 {
|
class Compress : public CommandHandler {
|
||||||
public:
|
public:
|
||||||
absl::Status handle(const std::vector<std::string>& arg_vec) override;
|
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 {
|
class Decompress : public CommandHandler {
|
||||||
public:
|
public:
|
||||||
absl::Status handle(const std::vector<std::string>& arg_vec) override;
|
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.
|
* @brief Expand a Rom file.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user