ROM and Compression library updates
Remove Compress and Decompress from ROM Move Editor parent class to its own file Move 65816 editor constants to widgets Update compression_test and snes_palette_test Start version constant classes (experimental) Move SetupROM for editors to load renderer
This commit is contained in:
@@ -2,36 +2,13 @@
|
||||
#define YAZE_CORE_COMMON_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace core {
|
||||
|
||||
class Editor {
|
||||
public:
|
||||
Editor() = default;
|
||||
virtual ~Editor() = default;
|
||||
|
||||
virtual void Cut() = 0;
|
||||
virtual void Copy() = 0;
|
||||
virtual void Paste() = 0;
|
||||
|
||||
virtual void Undo() = 0;
|
||||
virtual void Redo() = 0;
|
||||
|
||||
virtual void SelectAll() = 0;
|
||||
|
||||
virtual void Delete() = 0;
|
||||
|
||||
virtual void Find() = 0;
|
||||
|
||||
virtual void Replace() = 0;
|
||||
|
||||
virtual void Goto() = 0;
|
||||
};
|
||||
|
||||
unsigned int SnesToPc(unsigned int addr);
|
||||
int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3);
|
||||
int HexToDec(char *input, int length);
|
||||
|
||||
@@ -123,31 +123,50 @@ constexpr int kScreenWidth = 1440;
|
||||
constexpr int kScreenHeight = 900;
|
||||
|
||||
// ============================================================================
|
||||
// 65816 LanguageDefinition
|
||||
// Z3 Version Constants
|
||||
// ============================================================================
|
||||
|
||||
static const char *const kKeywords[] = {
|
||||
"ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI", "BNE",
|
||||
"BPL", "BRA", "BRL", "BVC", "BVS", "CLC", "CLD", "CLI", "CLV",
|
||||
"CMP", "CPX", "CPY", "DEC", "DEX", "DEY", "EOR", "INC", "INX",
|
||||
"INY", "JMP", "JSR", "JSL", "LDA", "LDX", "LDY", "LSR", "MVN",
|
||||
"NOP", "ORA", "PEA", "PER", "PHA", "PHB", "PHD", "PHP", "PHX",
|
||||
"PHY", "PLA", "PLB", "PLD", "PLP", "PLX", "PLY", "REP", "ROL",
|
||||
"ROR", "RTI", "RTL", "RTS", "SBC", "SEC", "SEI", "SEP", "STA",
|
||||
"STP", "STX", "STY", "STZ", "TAX", "TAY", "TCD", "TCS", "TDC",
|
||||
"TRB", "TSB", "TSC", "TSX", "TXA", "TXS", "TXY", "TYA", "TYX",
|
||||
"WAI", "WDM", "XBA", "XCE", "ORG", "LOROM", "HIROM", "NAMESPACE", "DB"};
|
||||
enum class Z3_Version {
|
||||
US = 1,
|
||||
JP = 2,
|
||||
SD = 3,
|
||||
};
|
||||
|
||||
template <Z3_Version version>
|
||||
class VersionConstants;
|
||||
|
||||
template <>
|
||||
class VersionConstants<Z3_Version::US> {
|
||||
public:
|
||||
static constexpr uint32_t kGgxAnimatedPointer = 0x10275;
|
||||
static constexpr uint32_t kOverworldGfxGroups1 = 0x5D97;
|
||||
static constexpr uint32_t kOverworldGfxGroups2 = 0x6073;
|
||||
|
||||
static constexpr uint32_t compressedAllMap32PointersHigh = 0x1794D;
|
||||
static constexpr uint32_t compressedAllMap32PointersLow = 0x17B2D;
|
||||
};
|
||||
|
||||
template <>
|
||||
class VersionConstants<Z3_Version::JP> {
|
||||
public:
|
||||
static constexpr uint32_t kGgxAnimatedPointer = 0x10624;
|
||||
static constexpr uint32_t kOverworldGfxGroups1 = 0x5DD7;
|
||||
static constexpr uint32_t kOverworldGfxGroups2 = 0x60B3;
|
||||
|
||||
// LONGPointers all tiles of maps[High] (mapid* 3)
|
||||
static constexpr uint32_t compressedAllMap32PointersHigh = 0x176B1;
|
||||
|
||||
// LONGPointers all tiles of maps[Low] (mapid* 3)
|
||||
static constexpr uint32_t compressedAllMap32PointersLow = 0x17891;
|
||||
|
||||
static constexpr uint32_t overworldMapPalette = 0x7D1C; // JP
|
||||
static constexpr uint32_t overworldMapPaletteGroup = 0x67E74;
|
||||
static constexpr uint32_t overworldMapSize = 0x1273B; // JP
|
||||
static constexpr uint32_t overlayPointers = 0x3FAF4;
|
||||
static constexpr uint32_t overlayPointersBank = 0x07;
|
||||
static constexpr uint32_t overworldTilesType = 0x7FD94;
|
||||
};
|
||||
|
||||
static const char *const kIdentifiers[] = {
|
||||
"abort", "abs", "acos", "asin", "atan", "atexit",
|
||||
"atof", "atoi", "atol", "ceil", "clock", "cosh",
|
||||
"ctime", "div", "exit", "fabs", "floor", "fmod",
|
||||
"getchar", "getenv", "isalnum", "isalpha", "isdigit", "isgraph",
|
||||
"ispunct", "isspace", "isupper", "kbhit", "log10", "log2",
|
||||
"log", "memcmp", "modf", "pow", "putchar", "putenv",
|
||||
"puts", "rand", "remove", "rename", "sinh", "sqrt",
|
||||
"srand", "strcat", "strcmp", "strerror", "time", "tolower",
|
||||
"toupper"};
|
||||
|
||||
// ============================================================================
|
||||
// Magic numbers
|
||||
|
||||
21
src/app/core/editor.h
Normal file
21
src/app/core/editor.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef YAZE_APP_CORE_EDITOR_H
|
||||
#define YAZE_APP_CORE_EDITOR_H
|
||||
|
||||
#include "absl/status/status.h"
|
||||
|
||||
class Editor {
|
||||
public:
|
||||
Editor() = default;
|
||||
virtual ~Editor() = default;
|
||||
|
||||
virtual absl::Status Cut() = 0;
|
||||
virtual absl::Status Copy() = 0;
|
||||
virtual absl::Status Paste() = 0;
|
||||
|
||||
virtual absl::Status Undo() = 0;
|
||||
virtual absl::Status Redo() = 0;
|
||||
|
||||
virtual absl::Status Update() = 0;
|
||||
};
|
||||
|
||||
#endif // YAZE_APP_CORE_EDITOR_H
|
||||
Reference in New Issue
Block a user