aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRangi42 <remy.oukaour+rangi42@gmail.com>2024-08-04 21:13:45 -0400
committerRangi42 <remy.oukaour+rangi42@gmail.com>2024-08-04 21:13:45 -0400
commit59202a2ab5f097262db25eb9b12c41d2389c5164 (patch)
tree759c12c90d6f85ee871581d0e97998610d93441e
parentIdentify wcf91 as wCurPartySpecies, wCurItem, and wCurListMenuItem (#457) (diff)
downloadpokeyellow-59202a2ab5f097262db25eb9b12c41d2389c5164.tar.gz
pokeyellow-59202a2ab5f097262db25eb9b12c41d2389c5164.tar.xz
pokeyellow-59202a2ab5f097262db25eb9b12c41d2389c5164.zip
Use bankless symbols for VC constants
This is valid according to the .sym file spec: <https://rgbds.gbdev.io/sym/>
-rw-r--r--tools/make_patch.c12
-rw-r--r--vc/pokeblue.constants.asm2
-rw-r--r--vc/pokered.constants.asm2
3 files changed, 9 insertions, 7 deletions
diff --git a/tools/make_patch.c b/tools/make_patch.c
index ecfd67b2..77a30683 100644
--- a/tools/make_patch.c
+++ b/tools/make_patch.c
@@ -103,12 +103,14 @@ int parse_number(const char *input, int base) {
void parse_symbol_value(char *input, int *restrict bank, int *restrict address) {
char *colon = strchr(input, ':');
- if (!colon) {
- error_exit("Error: Cannot parse bank+address: \"%s\"\n", input);
+ if (colon) {
+ *colon++ = '\0';
+ *bank = parse_number(input, 16);
+ *address = parse_number(colon, 16);
+ } else {
+ *bank = 0;
+ *address = parse_number(input, 16);
}
- *colon++ = '\0';
- *bank = parse_number(input, 16);
- *address = parse_number(colon, 16);
}
void parse_symbols(const char *filename, struct Symbol **symbols) {
diff --git a/vc/pokeblue.constants.asm b/vc/pokeblue.constants.asm
index c32c39e6..41c0d8fd 100644
--- a/vc/pokeblue.constants.asm
+++ b/vc/pokeblue.constants.asm
@@ -2,7 +2,7 @@
MACRO vc_const
DEF x = \1
- PRINTLN "00:{04x:x} \1" ; same format as rgblink's .sym file
+ PRINTLN "{02x:x} \1" ; same format as rgblink's .sym file
ENDM
; [FPA 001 Begin]
diff --git a/vc/pokered.constants.asm b/vc/pokered.constants.asm
index 646444ee..8ae18a13 100644
--- a/vc/pokered.constants.asm
+++ b/vc/pokered.constants.asm
@@ -2,7 +2,7 @@
MACRO vc_const
DEF x = \1
- PRINTLN "00:{04x:x} \1" ; same format as rgblink's .sym file
+ PRINTLN "{02x:x} \1" ; same format as rgblink's .sym file
ENDM
; [FPA 001 Begin]