]> git.sur5r.net Git - cc65/blobdiff - src/ca65/main.c
initial import of the gamate stuff
[cc65] / src / ca65 / main.c
index a0f45ac34378a3f16c74e7826db5149d821e95ab..0016c46f3fe8b3eae76b205e9a9a431bb1189996 100644 (file)
@@ -264,6 +264,10 @@ static void SetSys (const char* Sys)
             NewSymbol ("__APPLE2ENH__", 1);
             break;
 
+        case TGT_GAMATE:
+            NewSymbol ("__GAMATE__", 1);
+            break;
+
         case TGT_GEOS_CBM:
             /* Do not handle as a CBM system */
             NewSymbol ("__GEOS__", 1);
@@ -303,6 +307,14 @@ static void SetSys (const char* Sys)
             NewSymbol ("__SIM65C02__", 1);
             break;
 
+        case TGT_OSIC1P:
+            NewSymbol ("__OSIC1P__", 1);
+            break;
+
+        case TGT_PCENGINE:
+            NewSymbol ("__PCE__", 1);
+            break;
+
         default:
             AbEnd ("Invalid target name: `%s'", Sys);
 
@@ -519,8 +531,8 @@ static void OptListing (const char* Opt, const char* Arg)
 /* Create a listing file */
 {
     /* Since the meaning of -l and --listing has changed, print an error if
-     * the filename is empty or begins with the option char.
-     */
+    ** the filename is empty or begins with the option char.
+    */
     if (Arg == 0 || *Arg == '\0' || *Arg == '-') {
         Fatal ("The meaning of `%s' has changed. It does now "
                "expect a file name as argument.", Opt);
@@ -635,8 +647,8 @@ static void OneLine (void)
     int           Instr = -1;
 
     /* Initialize the new listing line if we are actually reading from file
-     * and not from internally pushed input.
-     */
+    ** and not from internally pushed input.
+    */
     if (!HavePushedInput ()) {
         InitListingLine ();
     }
@@ -648,8 +660,8 @@ static void OneLine (void)
     }
 
     /* If the first token on the line is an identifier, check for a macro or
-     * an instruction.
-     */
+    ** an instruction.
+    */
     if (CurTok.Tok == TOK_IDENT) {
         if (UbiquitousIdents) {
             /* Macros CAN be instructions, so check for them first */
@@ -667,9 +679,9 @@ static void OneLine (void)
     }
 
     /* Handle an identifier. This may be a cheap local symbol, or a fully
-     * scoped identifier which may start with a namespace token (for global
-     * namespace)
-     */
+    ** scoped identifier which may start with a namespace token (for global
+    ** namespace)
+    */
     if (CurTok.Tok == TOK_LOCAL_IDENT ||
         CurTok.Tok == TOK_NAMESPACE   ||
         (CurTok.Tok == TOK_IDENT && Instr < 0 && Mac == 0)) {
@@ -681,8 +693,8 @@ static void OneLine (void)
         Sym = ParseAnySymName (SYM_ALLOC_NEW);
 
         /* If a colon follows, this is a label definition. If there
-         * is no colon, it's an assignment.
-         */
+        ** is no colon, it's an assignment.
+        */
         if (CurTok.Tok == TOK_EQ || CurTok.Tok == TOK_ASSIGN) {
 
             /* Determine the symbol flags from the assignment token */
@@ -709,8 +721,8 @@ static void OneLine (void)
             Expr = GenLiteralExpr (ConstExpression ());
 
             /* Define the symbol with the constant expression following
-             * the '='
-             */
+            ** the '='
+            */
             SymDef (Sym, Expr, ADDR_SIZE_DEFAULT, SF_VAR);
 
             /* Don't allow anything after a symbol definition */
@@ -720,8 +732,8 @@ static void OneLine (void)
         } else {
 
             /* A label. Remember the current segment, so we can later
-             * determine the size of the data stored under the label.
-             */
+            ** determine the size of the data stored under the label.
+            */
             Seg = ActiveSeg;
             PC  = GetPC ();
 
@@ -729,9 +741,9 @@ static void OneLine (void)
             SymDef (Sym, GenCurrentPC (), ADDR_SIZE_DEFAULT, SF_LABEL);
 
             /* Skip the colon. If NoColonLabels is enabled, allow labels
-             * without a colon if there is no whitespace before the
-             * identifier.
-             */
+            ** without a colon if there is no whitespace before the
+            ** identifier.
+            */
             if (CurTok.Tok != TOK_COLON) {
                 if (HadWS || !NoColonLabels) {
                     Error ("`:' expected");
@@ -746,8 +758,8 @@ static void OneLine (void)
             }
 
             /* If we come here, a new identifier may be waiting, which may
-             * be a macro or instruction.
-             */
+            ** be a macro or instruction.
+            */
             if (CurTok.Tok == TOK_IDENT) {
                 if (UbiquitousIdents) {
                     /* Macros CAN be instructions, so check for them first */
@@ -790,9 +802,9 @@ static void OneLine (void)
     }
 
     /* If we have defined a label, remember its size. Sym is also set by
-     * a symbol assignment, but in this case Done is false, so we don't
-     * come here.
-     */
+    ** a symbol assignment, but in this case Done is false, so we don't
+    ** come here.
+    */
     if (Sym) {
         unsigned long Size;
         if (Seg == ActiveSeg) {
@@ -916,13 +928,13 @@ int main (int argc, char* argv [])
     SegInit ();
 
     /* Enter the base lexical level. We must do that here, since we may
-     * define symbols using -D.
-     */
+    ** define symbols using -D.
+    */
     SymEnterLevel (&GlobalNameSpace, SCOPE_FILE, ADDR_SIZE_DEFAULT, 0);
 
     /* Initialize the line infos. Must be done here, since we need line infos
-     * for symbol definitions.
-     */
+    ** for symbol definitions.
+    */
     InitLineInfo ();
 
     /* Check the parameters */
@@ -1104,8 +1116,8 @@ int main (int argc, char* argv [])
     DoneLineInfo ();
 
     /* If we didn't have any errors, create the object, listing and
-     * dependency files
-     */
+    ** dependency files
+    */
     if (ErrorCount == 0) {
         CreateObjFile ();
         if (SB_GetLen (&ListingName) > 0) {