mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
PUSHS and POPS also affect the symbol scope
Now, when POPS is executed, it restores the symbol scope of the
corresponding PUSHS. That way, the local symbols previously available
can be used again after the POPS.
This is useful in cases like this one:
```
SECTION "Section 1", ROMX
BigFunction:
...
.loop:
...
PUSHS
SECTION "Section 2", ROMX
DataForBigFunction:
DB 1, 2, 3, 4, 5
POPS
ld a,BANK(DataForBigFunction)
ld hl,DataForBigFunction
...
jr .loop
```
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -80,4 +80,8 @@ void sym_Purge(char *tzName);
|
||||
uint32_t sym_isConstDefined(char *tzName);
|
||||
int32_t sym_IsRelocDiffDefined(char *tzSym1, char *tzSym2);
|
||||
|
||||
/* Functions to save and restore the current symbol scope. */
|
||||
struct sSymbol *sym_GetCurrentSymbolScope(void);
|
||||
void sym_SetCurrentSymbolScope(struct sSymbol *pNewScope);
|
||||
|
||||
#endif /* RGBDS_SYMBOL_H */
|
||||
|
||||
Reference in New Issue
Block a user