mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Compare commits
6 Commits
v1.0.0
...
3553c9c4da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3553c9c4da | ||
|
|
5c2c893ced | ||
|
|
0f266d1c66 | ||
|
|
8ab4602ae5 | ||
|
|
04e3a904c2 | ||
|
|
395b03e88e |
@@ -49,7 +49,7 @@ else()
|
|||||||
-fsanitize=float-divide-by-zero)
|
-fsanitize=float-divide-by-zero)
|
||||||
add_compile_options(${SAN_FLAGS})
|
add_compile_options(${SAN_FLAGS})
|
||||||
add_link_options(${SAN_FLAGS})
|
add_link_options(${SAN_FLAGS})
|
||||||
add_definitions(-D_GLIBCXX_ASSERTIONS)
|
add_definitions(-D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)
|
||||||
# A non-zero optimization level is desired in debug mode, but allow overriding it nonetheless
|
# A non-zero optimization level is desired in debug mode, but allow overriding it nonetheless
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls ${CMAKE_CXX_FLAGS_DEBUG}"
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls ${CMAKE_CXX_FLAGS_DEBUG}"
|
||||||
CACHE STRING "" FORCE)
|
CACHE STRING "" FORCE)
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -222,8 +222,8 @@ develop:
|
|||||||
-Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1 \
|
-Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1 \
|
||||||
-Wno-format-nonliteral -Wno-strict-overflow -Wno-unused-but-set-variable \
|
-Wno-format-nonliteral -Wno-strict-overflow -Wno-unused-but-set-variable \
|
||||||
-Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wvla \
|
-Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wvla \
|
||||||
-D_GLIBCXX_ASSERTIONS -fsanitize=address -fsanitize=undefined \
|
-D_GLIBCXX_ASSERTIONS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG \
|
||||||
-fsanitize=float-divide-by-zero" \
|
-fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero" \
|
||||||
CXXFLAGS="-ggdb3 -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls"
|
CXXFLAGS="-ggdb3 -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls"
|
||||||
|
|
||||||
# Target used in development to debug with gdb.
|
# Target used in development to debug with gdb.
|
||||||
|
|||||||
@@ -3,17 +3,14 @@
|
|||||||
#ifndef RGBDS_VERBOSITY_HPP
|
#ifndef RGBDS_VERBOSITY_HPP
|
||||||
#define RGBDS_VERBOSITY_HPP
|
#define RGBDS_VERBOSITY_HPP
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "style.hpp"
|
|
||||||
|
|
||||||
// This macro does not evaluate its arguments unless the condition is true.
|
// This macro does not evaluate its arguments unless the condition is true.
|
||||||
#define verbosePrint(level, ...) \
|
#define verbosePrint(level, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (checkVerbosity(level)) { \
|
if (checkVerbosity(level)) { \
|
||||||
style_Set(stderr, STYLE_MAGENTA, false); \
|
printVerbosely(__VA_ARGS__); \
|
||||||
fprintf(stderr, __VA_ARGS__); \
|
|
||||||
style_Reset(stderr); \
|
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -30,6 +27,9 @@ enum Verbosity {
|
|||||||
void incrementVerbosity();
|
void incrementVerbosity();
|
||||||
bool checkVerbosity(Verbosity level);
|
bool checkVerbosity(Verbosity level);
|
||||||
|
|
||||||
|
[[gnu::format(printf, 1, 2)]]
|
||||||
|
void printVerbosely(char const *fmt, ...);
|
||||||
|
|
||||||
void printVVVVVVerbosity();
|
void printVVVVVVerbosity();
|
||||||
|
|
||||||
#endif // RGBDS_VERBOSITY_HPP
|
#endif // RGBDS_VERBOSITY_HPP
|
||||||
|
|||||||
@@ -120,9 +120,8 @@ Section *sect_FindSectionByName(std::string const &name) {
|
|||||||
++nbSectErrors; \
|
++nbSectErrors; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static unsigned int mergeSectUnion(
|
static unsigned int
|
||||||
Section §, SectionType type, uint32_t org, uint8_t alignment, uint16_t alignOffset
|
mergeSectUnion(Section §, uint32_t org, uint8_t alignment, uint16_t alignOffset) {
|
||||||
) {
|
|
||||||
unsigned int nbSectErrors = 0;
|
unsigned int nbSectErrors = 0;
|
||||||
|
|
||||||
assume(alignment < 16); // Should be ensured by the caller
|
assume(alignment < 16); // Should be ensured by the caller
|
||||||
@@ -133,12 +132,6 @@ static unsigned int mergeSectUnion(
|
|||||||
uint32_t sectAlignSize = 1u << sect.align;
|
uint32_t sectAlignSize = 1u << sect.align;
|
||||||
uint32_t sectAlignMask = sectAlignSize - 1;
|
uint32_t sectAlignMask = sectAlignSize - 1;
|
||||||
|
|
||||||
// Unionized sections only need "compatible" constraints, and they end up with the strictest
|
|
||||||
// combination of both.
|
|
||||||
if (sectTypeHasData(type)) {
|
|
||||||
sectError("Cannot declare ROM sections as `UNION`");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (org != UINT32_MAX) {
|
if (org != UINT32_MAX) {
|
||||||
// If both are fixed, they must be the same
|
// If both are fixed, they must be the same
|
||||||
if (sect.org != UINT32_MAX && sect.org != org) {
|
if (sect.org != UINT32_MAX && sect.org != org) {
|
||||||
@@ -266,12 +259,10 @@ static void mergeSections(
|
|||||||
} else {
|
} else {
|
||||||
switch (mod) {
|
switch (mod) {
|
||||||
case SECTION_UNION:
|
case SECTION_UNION:
|
||||||
case SECTION_FRAGMENT:
|
case SECTION_FRAGMENT: {
|
||||||
nbSectErrors += mod == SECTION_UNION
|
unsigned int (*merge)(Section &, uint32_t, uint8_t, uint16_t) =
|
||||||
? mergeSectUnion(sect, type, org, alignment, alignOffset)
|
mod == SECTION_UNION ? mergeSectUnion : mergeFragments;
|
||||||
: mergeFragments(sect, org, alignment, alignOffset);
|
nbSectErrors += merge(sect, org, alignment, alignOffset);
|
||||||
|
|
||||||
// Common checks
|
|
||||||
|
|
||||||
// If the section's bank is unspecified, override it
|
// If the section's bank is unspecified, override it
|
||||||
if (sect.bank == UINT32_MAX) {
|
if (sect.bank == UINT32_MAX) {
|
||||||
@@ -282,6 +273,7 @@ static void mergeSections(
|
|||||||
sectError("Section already declared with different bank %" PRIu32, sect.bank);
|
sectError("Section already declared with different bank %" PRIu32, sect.bank);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SECTION_NORMAL:
|
case SECTION_NORMAL:
|
||||||
errorNoTrace([&]() {
|
errorNoTrace([&]() {
|
||||||
@@ -513,6 +505,11 @@ void sect_NewSection(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mod == SECTION_UNION && sectTypeHasData(type)) {
|
||||||
|
error("Cannot declare ROM sections as `UNION`");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentLoadSection) {
|
if (currentLoadSection) {
|
||||||
sect_EndLoadSection("SECTION");
|
sect_EndLoadSection("SECTION");
|
||||||
}
|
}
|
||||||
@@ -1121,12 +1118,12 @@ std::string sect_PushSectionFragmentLiteral() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This section has data (ROM0 or ROMX), so it cannot be a UNION
|
||||||
|
assume(currentSection->modifier != SECTION_UNION);
|
||||||
|
|
||||||
if (currentLoadSection) {
|
if (currentLoadSection) {
|
||||||
fatal("`LOAD` blocks cannot contain fragment literals");
|
fatal("`LOAD` blocks cannot contain fragment literals");
|
||||||
}
|
}
|
||||||
if (currentSection->modifier == SECTION_UNION) {
|
|
||||||
fatal("`SECTION UNION` cannot contain fragment literals");
|
|
||||||
}
|
|
||||||
|
|
||||||
// A section containing a fragment literal has to become a fragment too
|
// A section containing a fragment literal has to become a fragment too
|
||||||
currentSection->modifier = SECTION_FRAGMENT;
|
currentSection->modifier = SECTION_FRAGMENT;
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ static std::vector<size_t>
|
|||||||
|
|
||||||
std::filebuf file;
|
std::filebuf file;
|
||||||
if (!file.open(path, std::ios_base::in)) {
|
if (!file.open(path, std::ios_base::in)) {
|
||||||
|
int errnum = errno;
|
||||||
style_Set(stderr, STYLE_RED, true);
|
style_Set(stderr, STYLE_RED, true);
|
||||||
fputs("FATAL: ", stderr);
|
fputs("FATAL: ", stderr);
|
||||||
style_Reset(stderr);
|
style_Reset(stderr);
|
||||||
fprintf(stderr, "Failed to open at-file \"%s\": %s\n", path.c_str(), strerror(errno));
|
fprintf(stderr, "Failed to open at-file \"%s\": %s\n", path.c_str(), strerror(errnum));
|
||||||
usage.printAndExit(1);
|
usage.printAndExit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,50 +208,37 @@ static std::optional<size_t> getPlacement(Section const §ion, MemoryLocation
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::string getSectionDescription(Section const §ion) {
|
static std::string getSectionDescription(Section const §ion) {
|
||||||
std::string where;
|
std::string description =
|
||||||
|
"\"" + section.name + "\" (" + sectionTypeInfo[section.type].name + " section) ";
|
||||||
char bank[8], addr[8], mask[8], offset[8];
|
|
||||||
if (section.isBankFixed && sectTypeBanks(section.type) != 1) {
|
if (section.isBankFixed && sectTypeBanks(section.type) != 1) {
|
||||||
|
char bank[8];
|
||||||
snprintf(bank, sizeof(bank), "%02" PRIx32, section.bank);
|
snprintf(bank, sizeof(bank), "%02" PRIx32, section.bank);
|
||||||
}
|
|
||||||
if (section.isAddressFixed) {
|
|
||||||
snprintf(addr, sizeof(addr), "%04" PRIx16, section.org);
|
|
||||||
}
|
|
||||||
if (section.isAlignFixed) {
|
|
||||||
snprintf(mask, sizeof(mask), "%" PRIx16, static_cast<uint16_t>(~section.alignMask));
|
|
||||||
snprintf(offset, sizeof(offset), "%" PRIx16, section.alignOfs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (section.isBankFixed && sectTypeBanks(section.type) != 1) {
|
|
||||||
if (section.isAddressFixed) {
|
if (section.isAddressFixed) {
|
||||||
where = "at $";
|
char addr[8];
|
||||||
where += bank;
|
snprintf(addr, sizeof(addr), "%04" PRIx16, section.org);
|
||||||
where += ":";
|
description = description + "at $" + bank + ":" + addr;
|
||||||
where += addr;
|
|
||||||
} else if (section.isAlignFixed) {
|
} else if (section.isAlignFixed) {
|
||||||
where = "in bank $";
|
char mask[8];
|
||||||
where += bank;
|
snprintf(mask, sizeof(mask), "%" PRIx16, static_cast<uint16_t>(~section.alignMask));
|
||||||
where += " with align mask $";
|
description = description + "in bank $" + bank + " with align mask $" + mask;
|
||||||
where += mask;
|
|
||||||
} else {
|
} else {
|
||||||
where = "in bank $";
|
description = description + "in bank $" + bank;
|
||||||
where += bank;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (section.isAddressFixed) {
|
if (section.isAddressFixed) {
|
||||||
where = "at address $";
|
char addr[8];
|
||||||
where += addr;
|
snprintf(addr, sizeof(addr), "%04" PRIx16, section.org);
|
||||||
|
description = description + "at address $" + addr;
|
||||||
} else if (section.isAlignFixed) {
|
} else if (section.isAlignFixed) {
|
||||||
where = "with align mask $";
|
char mask[8], offset[8];
|
||||||
where += mask;
|
snprintf(mask, sizeof(mask), "%" PRIx16, static_cast<uint16_t>(~section.alignMask));
|
||||||
where += " and offset $";
|
snprintf(offset, sizeof(offset), "%" PRIx16, section.alignOfs);
|
||||||
where += offset;
|
description = description + "with align mask $" + mask + " and offset $" + offset;
|
||||||
} else {
|
} else {
|
||||||
where = "anywhere";
|
description = description + "anywhere";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return description;
|
||||||
return where;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Places a section in a suitable location, or error out if it fails to.
|
// Places a section in a suitable location, or error out if it fails to.
|
||||||
@@ -310,19 +297,11 @@ static void placeSection(Section §ion) {
|
|||||||
|
|
||||||
if (!section.isBankFixed || !section.isAddressFixed) {
|
if (!section.isBankFixed || !section.isAddressFixed) {
|
||||||
// If a section failed to go to several places, nothing we can report
|
// If a section failed to go to several places, nothing we can report
|
||||||
fatal(
|
fatal("Unable to place %s", getSectionDescription(section).c_str());
|
||||||
"Unable to place \"%s\" (%s section) %s",
|
|
||||||
section.name.c_str(),
|
|
||||||
sectionTypeInfo[section.type].name.c_str(),
|
|
||||||
getSectionDescription(section).c_str()
|
|
||||||
);
|
|
||||||
} else if (section.org + section.size > sectTypeEndAddr(section.type) + 1) {
|
} else if (section.org + section.size > sectTypeEndAddr(section.type) + 1) {
|
||||||
// If the section just can't fit the bank, report that
|
// If the section just can't fit the bank, report that
|
||||||
fatal(
|
fatal(
|
||||||
"Unable to place \"%s\" (%s section) %s: section runs past end of region ($%04x > "
|
"Unable to place %s: section runs past end of region ($%04x > $%04x)",
|
||||||
"$%04x)",
|
|
||||||
section.name.c_str(),
|
|
||||||
sectionTypeInfo[section.type].name.c_str(),
|
|
||||||
getSectionDescription(section).c_str(),
|
getSectionDescription(section).c_str(),
|
||||||
section.org + section.size,
|
section.org + section.size,
|
||||||
sectTypeEndAddr(section.type) + 1
|
sectTypeEndAddr(section.type) + 1
|
||||||
@@ -330,9 +309,7 @@ static void placeSection(Section §ion) {
|
|||||||
} else {
|
} else {
|
||||||
// Otherwise there is overlap with another section
|
// Otherwise there is overlap with another section
|
||||||
fatal(
|
fatal(
|
||||||
"Unable to place \"%s\" (%s section) %s: section overlaps with \"%s\"",
|
"Unable to place %s: section overlaps with \"%s\"",
|
||||||
section.name.c_str(),
|
|
||||||
sectionTypeInfo[section.type].name.c_str(),
|
|
||||||
getSectionDescription(section).c_str(),
|
getSectionDescription(section).c_str(),
|
||||||
out_OverlappingSection(section)->name.c_str()
|
out_OverlappingSection(section)->name.c_str()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -437,6 +437,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
|
|||||||
} else if (Symbol const *symbol = getSymbol(fileSymbols, value); !symbol) {
|
} else if (Symbol const *symbol = getSymbol(fileSymbols, value); !symbol) {
|
||||||
errorAt(patch, "Undefined symbol `%s`", fileSymbols[value].name.c_str());
|
errorAt(patch, "Undefined symbol `%s`", fileSymbols[value].name.c_str());
|
||||||
sym_TraceLocalAliasedSymbols(fileSymbols[value].name);
|
sym_TraceLocalAliasedSymbols(fileSymbols[value].name);
|
||||||
|
value = 0;
|
||||||
isError = true;
|
isError = true;
|
||||||
} else if (std::holds_alternative<Label>(symbol->data)) {
|
} else if (std::holds_alternative<Label>(symbol->data)) {
|
||||||
Label const &label = std::get<Label>(symbol->data);
|
Label const &label = std::get<Label>(symbol->data);
|
||||||
|
|||||||
@@ -24,6 +24,15 @@ void incrementVerbosity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printVerbosely(char const *fmt, ...) {
|
||||||
|
va_list args;
|
||||||
|
style_Set(stderr, STYLE_MAGENTA, false);
|
||||||
|
va_start(args, fmt);
|
||||||
|
vfprintf(stderr, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
style_Reset(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
void printVVVVVVerbosity() {
|
void printVVVVVVerbosity() {
|
||||||
if (!checkVerbosity(VERB_VVVVVV)) {
|
if (!checkVerbosity(VERB_VVVVVV)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -14,7 +14,13 @@
|
|||||||
#if !defined(NDEBUG) && defined(__SANITIZE_ADDRESS__) && !defined(__APPLE__)
|
#if !defined(NDEBUG) && defined(__SANITIZE_ADDRESS__) && !defined(__APPLE__)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char const *__asan_default_options(void) {
|
char const *__asan_default_options(void) {
|
||||||
return "detect_leaks=1";
|
return "detect_leaks=1"
|
||||||
|
":detect_stack_use_after_return=1"
|
||||||
|
":detect_invalid_pointer_pairs=2"
|
||||||
|
":check_initialization_order=1"
|
||||||
|
":strict_init_order=1"
|
||||||
|
":strict_string_checks=1"
|
||||||
|
":print_legend=0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
FATAL: `SECTION UNION` cannot contain fragment literals
|
error: Cannot declare ROM sections as `UNION`
|
||||||
|
at fragment-literal-in-union.asm(1)
|
||||||
|
error: Cannot output data outside of a `SECTION`
|
||||||
|
at fragment-literal-in-union.asm(2)
|
||||||
|
FATAL: Cannot output fragment literals outside of a `SECTION`
|
||||||
at fragment-literal-in-union.asm(3)
|
at fragment-literal-in-union.asm(3)
|
||||||
|
|||||||
2
test/asm/section-union-data.asm
Normal file
2
test/asm/section-union-data.asm
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
SECTION UNION "wat", ROM0
|
||||||
|
db 42
|
||||||
5
test/asm/section-union-data.err
Normal file
5
test/asm/section-union-data.err
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
error: Cannot declare ROM sections as `UNION`
|
||||||
|
at section-union-data.asm(1)
|
||||||
|
error: Cannot output data outside of a `SECTION`
|
||||||
|
at section-union-data.asm(2)
|
||||||
|
Assembly aborted with 2 errors!
|
||||||
3
test/link/rpn-bad-sym-id.asm
Normal file
3
test/link/rpn-bad-sym-id.asm
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SECTION "bad", ROM0
|
||||||
|
ld a, FOO * 256
|
||||||
|
ld a, BAR * 256
|
||||||
5
test/link/rpn-bad-sym-id.out
Normal file
5
test/link/rpn-bad-sym-id.out
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
error: Undefined symbol `BAR`
|
||||||
|
at rpn-bad-sym-id.asm(3)
|
||||||
|
error: Undefined symbol `FOO`
|
||||||
|
at rpn-bad-sym-id.asm(2)
|
||||||
|
Linking failed with 2 errors
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
section fragment "test", rom0
|
section fragment "test", wram0
|
||||||
db 1
|
w1:: db
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
section union "test", rom0
|
section union "test", wram0
|
||||||
db 2
|
w2:: db
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
IF !DEF(SECOND)
|
|
||||||
def DATA equs "ds 4"
|
|
||||||
ELSE
|
|
||||||
def DATA equs "db $aa, $bb, $cc, $dd"
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
SECTION UNION "overlaid data", ROM0
|
|
||||||
{DATA}
|
|
||||||
|
|
||||||
PURGE DATA
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FATAL: Section "overlaid data" is of type `ROM0`, which cannot be `UNION`ized
|
|
||||||
Linking aborted with 1 error
|
|
||||||
---
|
|
||||||
error: Cannot declare ROM sections as `UNION`
|
|
||||||
at <stdin>(18)
|
|
||||||
FATAL: Cannot create section "overlaid data" (1 error)
|
|
||||||
at <stdin>(18)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
IF !DEF(SECOND)
|
|
||||||
def DATA = 1
|
|
||||||
ELSE
|
|
||||||
def DATA = 2
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
SECTION UNION "different data", ROM0
|
|
||||||
db DATA
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FATAL: Section "different data" is of type `ROM0`, which cannot be `UNION`ized
|
|
||||||
Linking aborted with 1 error
|
|
||||||
---
|
|
||||||
error: Cannot declare ROM sections as `UNION`
|
|
||||||
at <stdin>(16)
|
|
||||||
FATAL: Cannot create section "different data" (1 error)
|
|
||||||
at <stdin>(16)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
IF !DEF(SECOND)
|
|
||||||
def SIZE = 69
|
|
||||||
ELSE
|
|
||||||
def SIZE = 420
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
SECTION UNION "different section sizes", ROM0
|
|
||||||
ds SIZE
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FATAL: Section "different section sizes" is of type `ROM0`, which cannot be `UNION`ized
|
|
||||||
Linking aborted with 1 error
|
|
||||||
---
|
|
||||||
error: Cannot declare ROM sections as `UNION`
|
|
||||||
at <stdin>(16)
|
|
||||||
FATAL: Cannot create section "different section sizes" (1 error)
|
|
||||||
at <stdin>(16)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
IF !DEF(SECOND)
|
|
||||||
def INSTR equs "sbc a"
|
|
||||||
ELSE
|
|
||||||
def INSTR equs "db $9f"
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
SECTION UNION "different syntaxes", ROM0
|
|
||||||
{INSTR}
|
|
||||||
|
|
||||||
PURGE INSTR
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FATAL: Section "different syntaxes" is of type `ROM0`, which cannot be `UNION`ized
|
|
||||||
Linking aborted with 1 error
|
|
||||||
---
|
|
||||||
error: Cannot declare ROM sections as `UNION`
|
|
||||||
at <stdin>(18)
|
|
||||||
FATAL: Cannot create section "different syntaxes" (1 error)
|
|
||||||
at <stdin>(18)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
IF !DEF(SECOND)
|
|
||||||
def DATA equs "ds 1\ndb $aa"
|
|
||||||
ELSE
|
|
||||||
def DATA equs "db $bb\nds 1"
|
|
||||||
ENDC
|
|
||||||
|
|
||||||
SECTION UNION "mutually-overlaid data", ROM0
|
|
||||||
{DATA}
|
|
||||||
|
|
||||||
PURGE DATA
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
FATAL: Section "mutually-overlaid data" is of type `ROM0`, which cannot be `UNION`ized
|
|
||||||
Linking aborted with 1 error
|
|
||||||
---
|
|
||||||
error: Cannot declare ROM sections as `UNION`
|
|
||||||
at <stdin>(18)
|
|
||||||
FATAL: Cannot create section "mutually-overlaid data" (1 error)
|
|
||||||
at <stdin>(18)
|
|
||||||
Reference in New Issue
Block a user