]> Shamusworld >> Repos - rmac/commitdiff
Minor fix to kill unnecessary field YPOS in gpuobj in the OP assembler. v2.2.3
authorShamus Hammons <jlhamm@acm.org>
Mon, 27 Jun 2022 13:44:00 +0000 (08:44 -0500)
committerShamus Hammons <jlhamm@acm.org>
Mon, 27 Jun 2022 13:44:00 +0000 (08:44 -0500)
Turns out that the documentation we relied on was bogus; SCPCD confirmed
this (from the Jaguar netlists) as well.  Thanks to Bastian (42bs) for
the patch!  :-)

op.c
version.h

diff --git a/op.c b/op.c
index 3833bfbee292e17117b3058cc7a9333e29103fc3..9a4cc784175dd599d4696d815a39590cc95b06db 100644 (file)
--- a/op.c
+++ b/op.c
@@ -37,7 +37,6 @@ static TOKEN fixupExpr[4] = { CONST, 0, 0, ENDEXPR };
 //static PTR fixupPtr = { .tk = (fixupExpr + 1) };             // C99 \o/
 static PTR fixupPtr = { (uint8_t *)(fixupExpr + 1) };  // meh, it works
 
-
 //
 // The main Object Processor assembler. Basically just calls the sub functions
 // to generate the appropriate code.
@@ -68,7 +67,6 @@ int GenerateOPCode(int state)
        return error("unknown OP opcode");
 }
 
-
 static inline void GetSymbolUCFromTokenStream(char * s)
 {
        strcpy(s, string[tok[1]]);
@@ -76,7 +74,6 @@ static inline void GetSymbolUCFromTokenStream(char * s)
        tok += 2;
 }
 
-
 static inline uint64_t CheckFlags(char * s)
 {
        GetSymbolUCFromTokenStream(s);
@@ -93,7 +90,6 @@ static inline uint64_t CheckFlags(char * s)
        return 0;
 }
 
-
 //
 // Define a bitmap object
 // Form: bitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>, <bpp>,
@@ -191,7 +187,6 @@ static int HandleBitmap(void)
        return OK;
 }
 
-
 //
 // Define a scaled bitmap object
 // Form: scbitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>,
@@ -319,10 +314,9 @@ static int HandleScaledBitmap(void)
        return OK;
 }
 
-
 //
 // Insert GPU object
-// Form: gpuobj <line #>, <userdata> (bits 14-63 of this object)
+// Form: gpuobj <userdata> (bits 3-63 of this object)
 //
 static int HandleGPUObject(void)
 {
@@ -330,16 +324,6 @@ static int HandleGPUObject(void)
        uint16_t eattr;
        SYM * esym = 0;
 
-       if (expr(exprbuf, &eval, &eattr, &esym) != OK)
-               return ERROR;
-
-       if (!(eattr & DEFINED))
-               return error("bad expression in y position");
-
-       uint64_t ypos = eval;
-
-       CHECK_COMMA;
-
        if (expr(exprbuf, &eval, &eattr, &esym) != OK)
                return ERROR;
 
@@ -348,7 +332,7 @@ static int HandleGPUObject(void)
 
        ErrorIfNotAtEOL();
 
-       uint64_t p1 = 0x02 | ((ypos * 2) << 3) | (eval << 14);
+       uint64_t p1 = 0x02 | (eval << 3);
 
        lastObjType = 2;
        D_quad(p1);
@@ -356,7 +340,6 @@ static int HandleGPUObject(void)
        return OK;
 }
 
-
 //
 // Insert a branch object
 // Form: branch VC <condition (<, =, >)> <line #>, <link addr>
@@ -421,7 +404,6 @@ static int HandleBranch(void)
        return OK;
 }
 
-
 //
 // Insert a stop object
 // Form: stop
@@ -434,7 +416,6 @@ static int HandleStop(void)
        return OK;
 }
 
-
 //
 // Insert a phrase sized "NOP" in the object list (psuedo-op)
 // Form: nop
@@ -452,7 +433,6 @@ static int HandleNOP(void)
        return OK;
 }
 
-
 //
 // Insert an unconditional jump in the object list (psuedo-op)
 // Form: jump <link addr>
@@ -479,4 +459,3 @@ static int HandleJump(void)
 
        return OK;
 }
-
index 11a3a177845ee9a9a7187e44e86ae45975ddb27b..46bf58bc5400a88fa554685a88cf5db77f728760 100644 (file)
--- a/version.h
+++ b/version.h
@@ -15,6 +15,6 @@
 
 #define MAJOR   2              // Major version number
 #define MINOR   2              // Minor version number
-#define PATCH   2              // Patch release number
+#define PATCH   3              // Patch release number
 
 #endif // __VERSION_H__