]> git.sur5r.net Git - cc65/commitdiff
New segment type renamed to "overwrite".
authorLaubzega <mileksmyk@gmail.com>
Sun, 9 Sep 2018 02:18:41 +0000 (19:18 -0700)
committerLaubzega <mileksmyk@gmail.com>
Sun, 9 Sep 2018 02:18:41 +0000 (19:18 -0700)
src/ld65/bin.c
src/ld65/config.c
src/ld65/config.h
src/ld65/scanner.h

index 6f0e4ab362e8d0cbd2a313cffa7817933886641b..a77d49679c1105771e0dddaf2c121200ad978da0 100644 (file)
@@ -193,8 +193,8 @@ static void BinWriteMem (BinDesc* D, MemoryArea* M)
                     NewAddr += M->Start;
                 }
                 if (DoWrite || (M->Flags & MF_FILL) != 0) {
-                    /* Seek in "replace" segments */
-                    if (S->Flags & SF_REPLACE) {
+                    /* Seek in "overwrite" segments */
+                    if (S->Flags & SF_OVERWRITE) {
                         fseek (D->F, NewAddr - M->Start, SEEK_SET);
                     } else {
                         WriteMult (D->F, M->FillVal, NewAddr-Addr);
index 0e4d0c1e4577745c9103f0b3341372cdb0e44b2d..73eee1caac57255b715d353eb401b2a578a6950e 100644 (file)
@@ -653,7 +653,7 @@ static void ParseSegments (void)
         {   "RW",               CFGTOK_RW               },
         {   "BSS",              CFGTOK_BSS              },
         {   "ZP",               CFGTOK_ZP               },
-        {   "REPLACE",          CFGTOK_REPLACE          },
+        {   "OVERWRITE",        CFGTOK_OVERWRITE        },
     };
 
     unsigned Count;
@@ -754,12 +754,12 @@ static void ParseSegments (void)
                     FlagAttr (&S->Attr, SA_TYPE, "TYPE");
                     CfgSpecialToken (Types, ENTRY_COUNT (Types), "Type");
                     switch (CfgTok) {
-                        case CFGTOK_RO:      S->Flags |= SF_RO;                break;
-                        case CFGTOK_RW:      /* Default */                     break;
-                        case CFGTOK_BSS:     S->Flags |= SF_BSS;               break;
-                        case CFGTOK_ZP:      S->Flags |= (SF_BSS | SF_ZP);     break;
-                        case CFGTOK_REPLACE: S->Flags |= (SF_REPLACE | SF_RO); break;
-                        default:             Internal ("Unexpected token: %d", CfgTok);
+                        case CFGTOK_RO:        S->Flags |= SF_RO;                  break;
+                        case CFGTOK_RW:        /* Default */                       break;
+                        case CFGTOK_BSS:       S->Flags |= SF_BSS;                 break;
+                        case CFGTOK_ZP:        S->Flags |= (SF_BSS | SF_ZP);       break;
+                        case CFGTOK_OVERWRITE: S->Flags |= (SF_OVERWRITE | SF_RO); break;
+                        default:               Internal ("Unexpected token: %d", CfgTok);
                     }
                     CfgNextTok ();
                     break;
@@ -1797,7 +1797,7 @@ unsigned CfgProcess (void)
     for (I = 0; I < CollCount (&MemoryAreas); ++I) {
         unsigned J;
         unsigned long Addr;
-        unsigned Replaces = 0;
+        unsigned Overwrites = 0;
 
         /* Get the next memory area */
         MemoryArea* M = CollAtUnchecked (&MemoryAreas, I);
@@ -1851,23 +1851,23 @@ unsigned CfgProcess (void)
             /* Remember the start address before handling this segment */
             unsigned long StartAddr = Addr;
 
-            /* Take note of "replace" segments and make sure there are no other
-            ** segment types following them in current memory region.
+            /* Take note of "overwrite" segments and make sure there are no
+            ** other segment types following them in current memory region.
             */
-            if (S->Flags & SF_REPLACE) {
+            if (S->Flags & SF_OVERWRITE) {
                 if (S->Flags & (SF_OFFSET | SF_START)) {
-                    ++Replaces;
+                    ++Overwrites;
                 } else {
                     CfgError (GetSourcePos (M->LI),
-                              "Segment `%s' of type `replace' requires either"
+                              "Segment `%s' of type `overwrite' requires either"
                               " `Start' or `Offset' attribute to be specified",
                               GetString (S->Name));
                 }
             } else {
-                if (Replaces > 0) {
+                if (Overwrites > 0) {
                     CfgError (GetSourcePos (M->LI),
                               "Segment `%s' is preceded by at least one segment"
-                              " of type `replace'",
+                              " of type `overwrite'",
                               GetString (S->Name));
                 }
             }
@@ -1921,7 +1921,7 @@ unsigned CfgProcess (void)
                         NewAddr += M->Start;
                     }
 
-                    if (S->Flags & SF_REPLACE) {
+                    if (S->Flags & SF_OVERWRITE) {
                         if (NewAddr < M->Start) {
                             CfgError (GetSourcePos (S->LI),
                                       "Segment `%s' begins before memory area `%s'",
index d172560bd21594abc74ce7e086c8a20546d42acc..d97675b21831deff37ea5faf3ca63c4d40e861ef 100644 (file)
@@ -96,7 +96,7 @@ struct SegDesc {
 #define SF_RUN_DEF      0x0200          /* RUN symbols already defined */
 #define SF_LOAD_DEF     0x0400          /* LOAD symbols already defined */
 #define SF_FILLVAL      0x0800          /* Segment has separate fill value */
-#define SF_REPLACE      0x1000          /* Segment can replace (part of) another one */
+#define SF_OVERWRITE    0x1000          /* Segment can overwrite (part of) another one */
 
 
 
index 2c60da9755689fedb47c74f9df421b2fd04990ac..2df952ebbb6aa8be7813437152e08e955cbb8601 100644 (file)
@@ -105,7 +105,7 @@ typedef enum {
     CFGTOK_RW,
     CFGTOK_BSS,
     CFGTOK_ZP,
-    CFGTOK_REPLACE,
+    CFGTOK_OVERWRITE,
 
     CFGTOK_O65,
     CFGTOK_BIN,