diff --git a/index.html b/index.html
index 452da30..7a8d8db 100644
--- a/index.html
+++ b/index.html
@@ -49,7 +49,7 @@
-
- rgbds manual
+ rgbds manual
-
Report a problem
diff --git a/patches/rgbds.patch b/patches/rgbds.patch
index f328e1f..d616c21 100644
--- a/patches/rgbds.patch
+++ b/patches/rgbds.patch
@@ -1,55 +1,60 @@
-diff --git a/include/asm/symbol.hpp b/include/asm/symbol.hpp
-index 409e2ba5..58b78ba0 100644
---- a/include/asm/symbol.hpp
-+++ b/include/asm/symbol.hpp
-@@ -100,4 +100,6 @@ void sym_Init(time_t now);
- std::optional const &sym_GetCurrentSymbolScope();
- void sym_SetCurrentSymbolScope(std::optional const &newScope);
-
-+Symbol *sym_AddSecret();
-+
- #endif // RGBDS_ASM_SYMBOL_HPP
diff --git a/src/asm/parser.y b/src/asm/parser.y
-index 55044bfc..94ec183d 100644
+index 437c6afa..61be7ae4 100644
--- a/src/asm/parser.y
+++ b/src/asm/parser.y
-@@ -429,7 +429,9 @@ else:
+@@ -86,7 +86,7 @@
+ static void compoundAssignment(std::string const &symName, RPNCommand op, int32_t constValue);
+ static void failAssert(AssertionType type);
+ static void failAssertMsg(AssertionType type, std::string const &message);
+-
++ Symbol *sym_AddSecret();
+ // The CPU encodes instructions in a logical way, so most instructions actually follow patterns.
+ // These enums thus help with bit twiddling to compute opcodes.
+ enum { REG_B, REG_C, REG_D, REG_E, REG_H, REG_L, REG_HL_IND, REG_A };
+@@ -503,7 +503,7 @@ else:
plain_directive:
label
- | label cpu_commands
-+ | label {
-+ sym_AddSecret();
-+ } cpu_commands
++ | label { sym_AddSecret(); } cpu_commands
| label macro
| label directive
;
diff --git a/src/asm/symbol.cpp b/src/asm/symbol.cpp
-index 8d803a39..be108ae8 100644
+index 1ae86aba..3ed2dcd4 100644
--- a/src/asm/symbol.cpp
+++ b/src/asm/symbol.cpp
-@@ -597,3 +597,24 @@ void sym_Init(time_t now) {
+@@ -669,3 +669,33 @@ void sym_Init(time_t now) {
sym_AddEqu("__UTC_MINUTE__"s, time_utc->tm_min)->isBuiltin = true;
sym_AddEqu("__UTC_SECOND__"s, time_utc->tm_sec)->isBuiltin = true;
}
+
-+static uint32_t secret_counter = 0;
+Symbol *sym_AddSecret() {
-+ Symbol *sym;
-+ char name[256];
-+ secret_counter += 1;
-+ std::shared_ptr fstk = fstk_GetFileStack();
-+ while(fstk->type == NODE_REPT) {
-+ fstk = fstk->parent;
-+ }
-+ sprintf(name, "__SEC_%x_%x_%s", secret_counter, lexer_GetLineNo(), fstk->name().c_str());
++ static uint64_t secretCounter = 1;
++
++ std::shared_ptr fstk = fstk_GetFileStack();
++ while (fstk->type == NODE_REPT) {
++ fstk = fstk->parent;
++ }
++
++ char valueBuf[64];
++ snprintf(
++ valueBuf,
++ sizeof(valueBuf),
++ "__SEC_%" PRIx64 "_%" PRIx32 "_",
++ secretCounter++,
++ lexer_GetLineNo()
++ );
++
++ std::string name = valueBuf;
++ name += fstk->name();
+
-+ sym = &createSymbol(name);
-+ sym->type = SYM_LABEL;
-+ sym->data = (int32_t)sect_GetSymbolOffset();
-+ sym->isExported = true;
-+ sym->section = sect_GetSymbolSection();
++ Symbol *sym = &createSymbol(name);
++ sym->type = SYM_LABEL;
++ sym->data = static_cast(sect_GetSymbolOffset());
++ sym->isExported = true;
++ sym->section = sect_GetSymbolSection();
+
-+ updateSymbolFilename(*sym);
-+ return sym;
++ updateSymbolFilename(*sym);
++ return sym;
+}
diff --git a/rgbds b/rgbds
index 556c8a9..d63955e 160000
--- a/rgbds
+++ b/rgbds
@@ -1 +1 @@
-Subproject commit 556c8a968aebfa5ed20589b514690a5e26e7c0d0
+Subproject commit d63955eccd7aa69794960a626144ea247d638957