mirror of
https://github.com/rh-hideout/pokeemerald-expansion
synced 2025-10-06 03:02:44 +02:00
Hacky support for enums in C asm statements (#7494)
This commit is contained in:
@@ -51,7 +51,6 @@ asm(".set FALSE, 0\n"
|
||||
".set VARS_END, " STR(VARS_END) "\n"
|
||||
".set SPECIAL_VARS_START, " STR(SPECIAL_VARS_START) "\n"
|
||||
".set SPECIAL_VARS_END, " STR(SPECIAL_VARS_END) "\n");
|
||||
asm(".include \"constants/gba_constants.inc\"\n");
|
||||
|
||||
// Make overworld script macros available.
|
||||
asm(".include \"constants/gba_constants.inc\"\n"
|
||||
|
@@ -620,6 +620,10 @@ bool AsmFile::ParseEnum()
|
||||
}
|
||||
enumCounter = 0;
|
||||
}
|
||||
// HACK(#7394): Make the definitions global so that C 'asm'
|
||||
// statements are able to reference them (if they happen to
|
||||
// be available in an assembled object file).
|
||||
std::printf(".global %s; ", currentIdentName.c_str());
|
||||
std::printf(".equiv %s, (%s) + %ld\n", currentIdentName.c_str(), enumBase.c_str(), enumCounter);
|
||||
enumCounter++;
|
||||
symbolCount++;
|
||||
|
Reference in New Issue
Block a user