Use automatic allocation for patches

This commit is contained in:
Rangi42
2024-02-22 15:34:49 -05:00
committed by Sylvie
parent 9140180c85
commit 72e9f55368
4 changed files with 60 additions and 74 deletions

View File

@@ -3,7 +3,6 @@
#ifndef RGBDS_ASM_OUTPUT_H
#define RGBDS_ASM_OUTPUT_H
#include <deque>
#include <stdint.h>
#include "linkdefs.hpp"
@@ -12,7 +11,6 @@ struct Expression;
struct FileStackNode;
extern const char *objectName;
extern std::deque<struct Section> sectionList;
void out_RegisterNode(struct FileStackNode *node);
void out_ReplaceNode(struct FileStackNode *node);

View File

@@ -12,6 +12,19 @@
extern uint8_t fillByte;
struct Expression;
struct FileStackNode;
struct Section;
struct Patch {
struct FileStackNode const *src;
uint32_t lineNo;
uint32_t offset;
struct Section *pcSection;
uint32_t pcOffset;
uint8_t type;
uint32_t rpnSize;
uint8_t *rpn;
};
struct Section {
char *name;
@@ -24,7 +37,7 @@ struct Section {
uint32_t bank;
uint8_t align; // Exactly as specified in `ALIGN[]`
uint16_t alignOfs;
std::deque<struct Patch *> *patches;
std::deque<struct Patch> patches;
uint8_t *data;
};
@@ -34,6 +47,7 @@ struct SectionSpec {
uint16_t alignOfs;
};
extern std::deque<struct Section> sectionList;
extern struct Section *currentSection;
struct Section *sect_FindSectionByName(char const *name);