]> Shamusworld >> Repos - rmac/blobdiff - direct.c
Version bump for following patch.
[rmac] / direct.c
index e3685d1c8eef7c245370338c30347b215c6f4994..c6e5ea8375f766acee3410b557cc6338c2288ff2 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -536,7 +536,7 @@ int d_equrundef(void)
                {
                        // Reset the attributes of this symbol...
                        regname->sattr = 0;
-                       regname->sattre &= ~(EQUATEDREG | BANK_0 | BANK_1);
+                       regname->sattre &= ~EQUATEDREG;
                        regname->sattre |= UNDEF_EQUR;
                }
 
@@ -645,8 +645,7 @@ allright:
                                        }
 
                                        lseek(fd, pos, SEEK_SET);
-                                       size -= pos;
-                                       if ((int64_t)size < 0)
+                                       if ((int64_t)(size - pos) < 0)
                                        {
                                                return error("requested incbin size out of range");
                                        }
@@ -702,16 +701,16 @@ allright:
 //
 int d_regbank0(void)
 {
-       // Set active register bank zero
-       regbank = BANK_0;
+       // Deprecated, it's not as if this did anything useful, ever
+       warn("regbank0 ignored");
        return 0;
 }
 
 
 int d_regbank1(void)
 {
-       // Set active register bank one
-       regbank = BANK_1;
+       // Deprecated, it's not as if this did anything useful, ever
+       warn("regbank1 ignored");
        return 0;
 }
 
@@ -1138,6 +1137,7 @@ int d_ds(WORD siz)
        DEBUG { printf("Directive: .ds.[size] = %u, sloc = $%X\n", siz, sloc); }
 
        uint64_t eval;
+    WORD eattr;
 
        if ((cursect & (M6502 | M56KPXYL)) == 0)
        {
@@ -1145,9 +1145,9 @@ int d_ds(WORD siz)
                        auto_even();
        }
 
-       if (abs_expr(&eval) != OK)
-               return 0;
-
+       if (expr(exprbuf, &eval, &eattr, NULL) < 0)
+               return ERROR;
+       
        // Check to see if the value being passed in is negative (who the hell does
        // that?--nobody does; it's the code gremlins, or rum, what does it)
        // N.B.: Since 'eval' is of type uint64_t, if it goes negative, it will
@@ -1965,7 +1965,6 @@ int d_gpu(void)
        rdsp = 0;                       // Unset DSP assembly
        robjproc = 0;           // Unset OP assembly
        dsp56001 = 0;           // Unset 56001 assembly
-       regbank = BANK_N;       // Set no default register bank
        return 0;
 }
 
@@ -1992,7 +1991,6 @@ int d_dsp(void)
        rgpu = 0;                       // Unset GPU assembly
        robjproc = 0;           // Unset OP assembly
        dsp56001 = 0;           // Unset 56001 assembly
-       regbank = BANK_N;       // Set no default register bank
        return 0;
 }