Use bankless symbols for VC constants

This is valid according to the .sym file spec:
<https://rgbds.gbdev.io/sym/>
This commit is contained in:
Rangi42 2024-08-04 21:03:56 -04:00
parent 9ae05312d6
commit 746a06f1de
2 changed files with 8 additions and 6 deletions

View File

@ -103,12 +103,14 @@ int parse_number(const char *input, int base) {
void parse_symbol_value(char *input, int *restrict bank, int *restrict address) { void parse_symbol_value(char *input, int *restrict bank, int *restrict address) {
char *colon = strchr(input, ':'); char *colon = strchr(input, ':');
if (!colon) { if (colon) {
error_exit("Error: Cannot parse bank+address: \"%s\"\n", input);
}
*colon++ = '\0'; *colon++ = '\0';
*bank = parse_number(input, 16); *bank = parse_number(input, 16);
*address = parse_number(colon, 16); *address = parse_number(colon, 16);
} else {
*bank = 0;
*address = parse_number(input, 16);
}
} }
void parse_symbols(const char *filename, struct Symbol **symbols) { void parse_symbols(const char *filename, struct Symbol **symbols) {

View File

@ -2,7 +2,7 @@
MACRO vc_const MACRO vc_const
DEF x = \1 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 ENDM
; [fight begin] ; [fight begin]