shithub: rgbds

Download patch

ref: 0ffa4ce9efdb4656fb4126bbdca262d283841f1f
parent: fd4b5c89256b0937f385ebdf5908ba0ae17d00fb
author: yenatch <[email protected]>
date: Mon Jan 6 15:04:55 EST 2014

rgbasm: let rgblink try to import undefined symbols

Manual imports are inconvenient and don't provide any functionality.

--- a/src/asm/symbol.c
+++ b/src/asm/symbol.c
@@ -364,12 +364,12 @@
 			}
 			return (getvaluefield(psym));
 		} else {
-			if ((nPass == 1) || (psym->nType & SYMF_IMPORT)) {
-				/* 0x80 seems like a good default value... */
-				return (0x80);
-			} else {
-				yyerror("'%s' not defined", s);
+			if (nPass == 2) {
+				/* Assume undefined symbols are imported from somewhere else */
+				psym->nType |= SYMF_IMPORT;
 			}
+			/* 0x80 seems like a good default value... */
+			return (0x80);
 		}
 	} else {
 		if (nPass == 1) {