From a621806e4234758c275a38df293af59dad6d3b7f Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Sun, 4 Aug 2024 21:09:25 -0400 Subject: [PATCH] Use bankless symbols for VC constants This is valid according to the .sym file spec: --- tools/make_patch.c | 12 +++++++----- vc/pokegold.constants.asm | 2 +- vc/pokesilver.constants.asm | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/make_patch.c b/tools/make_patch.c index 03ec25ec..91e56d58 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/pokegold.constants.asm b/vc/pokegold.constants.asm index a3e1cc7b..3e2278ab 100644 --- a/vc/pokegold.constants.asm +++ b/vc/pokegold.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/pokesilver.constants.asm b/vc/pokesilver.constants.asm index 0da206e0..86a7b2c9 100644 --- a/vc/pokesilver.constants.asm +++ b/vc/pokesilver.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]