mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-26 04:52:08 +00:00
Implement state file output for RGBASM (#1435)
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
|
||||
#define DEFAULT_CHARMAP_NAME "main"
|
||||
|
||||
bool charmap_ForEach(
|
||||
void (*mapFunc)(std::string const &),
|
||||
void (*charFunc)(std::string const &, std::vector<int32_t>)
|
||||
);
|
||||
void charmap_New(std::string const &name, std::string const *baseName);
|
||||
void charmap_Set(std::string const &name);
|
||||
void charmap_Push();
|
||||
|
||||
@@ -6,12 +6,23 @@
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "linkdefs.hpp"
|
||||
|
||||
struct Expression;
|
||||
struct FileStackNode;
|
||||
|
||||
enum StateFeature {
|
||||
STATE_EQU,
|
||||
STATE_VAR,
|
||||
STATE_EQUS,
|
||||
STATE_CHAR,
|
||||
STATE_MACRO,
|
||||
NB_STATE_FEATURES
|
||||
};
|
||||
|
||||
extern std::string objectFileName;
|
||||
|
||||
void out_RegisterNode(std::shared_ptr<FileStackNode> node);
|
||||
@@ -21,5 +32,6 @@ void out_CreateAssert(
|
||||
AssertionType type, Expression const &expr, std::string const &message, uint32_t ofs
|
||||
);
|
||||
void out_WriteObject();
|
||||
void out_WriteState(std::string name, std::vector<StateFeature> const &features);
|
||||
|
||||
#endif // RGBDS_ASM_OUTPUT_HPP
|
||||
|
||||
@@ -44,7 +44,8 @@ struct Symbol {
|
||||
>
|
||||
data;
|
||||
|
||||
uint32_t ID; // ID of the symbol in the object file (-1 if none)
|
||||
uint32_t ID; // ID of the symbol in the object file (-1 if none)
|
||||
uint32_t defIndex; // Ordering of the symbol in the state file
|
||||
|
||||
bool isDefined() const { return type != SYM_REF; }
|
||||
bool isNumeric() const { return type == SYM_LABEL || type == SYM_EQU || type == SYM_VAR; }
|
||||
|
||||
Reference in New Issue
Block a user