]> Shamusworld >> Repos - virtualjaguar/commitdiff
Added a header file to compensate for files removed
authorShamus Hammons <jlhamm@acm.org>
Wed, 25 May 2005 04:48:49 +0000 (04:48 +0000)
committerShamus Hammons <jlhamm@acm.org>
Wed, 25 May 2005 04:48:49 +0000 (04:48 +0000)
src/dsp.cpp
src/gpu.cpp
src/objectp.cpp

index f21fa692a65bf647000288776f52313f4bd2d400..41e826950b022190c82963a6f765b4f84f591330 100644 (file)
@@ -6,6 +6,7 @@
 // Extensive cleanups/rewrites by James L. Hammons
 //
 
+#include <stdlib.h>
 #include <SDL.h>       // Used only for SDL_GetTicks...
 #include "dsp.h"
 
index f2cc7c74806935670afc33490e2fda4177a14081..4729126928d99b4f1e3f2c4eb941b79d5194afcb 100644 (file)
@@ -12,6 +12,7 @@
 // Same problem with ADDC...
 //
 
+#include <stdlib.h>
 #include "gpu.h"
 
 //#define GPU_DEBUG
index 37e7ff56ee9fa7d04c3bd034b0d54d3e42be69cf..fc1c64829ebd1eb556bbe0c9b7b396d7b80988c3 100644 (file)
@@ -1,13 +1,13 @@
 //
 // Object Processor
 //
-// Original source by Cal2
+// Original source by David Raingeard (Cal2)
 // GCC/SDL port by Niels Wagenaar (Linux/WIN32) and Caz (BeOS)
 // Extensive cleanups/fixes/rewrites by James L. Hammons
 //
 
 //#include <stdio.h>
-//#include <stdlib.h>
+#include <stdlib.h>
 #include <string.h>
 #include "jaguar.h"
 
 #define BLEND_Y(dst, src)      op_blend_y[(((uint16)dst<<8)) | ((uint16)(src))]
 #define BLEND_CR(dst, src)     op_blend_cr[(((uint16)dst)<<8) | ((uint16)(src))]
 
-#define OBJECT_TYPE_BITMAP     0                       // 000
-#define OBJECT_TYPE_SCALE      1                       // 001
-#define OBJECT_TYPE_GPU                2                       // 010
-#define OBJECT_TYPE_BRANCH     3                       // 011
-#define OBJECT_TYPE_STOP       4                       // 100
+#define OBJECT_TYPE_BITMAP     0                                       // 000
+#define OBJECT_TYPE_SCALE      1                                       // 001
+#define OBJECT_TYPE_GPU                2                                       // 010
+#define OBJECT_TYPE_BRANCH     3                                       // 011
+#define OBJECT_TYPE_STOP       4                                       // 100
 
 #define CONDITION_EQUAL                                0
 #define CONDITION_LESS_THAN                    1
 #define CONDITION_OP_FLAG_SET          3
 #define CONDITION_SECOND_HALF_LINE     4
 
-#define OPFLAG_RELEASE         8                       // Bus release bit
-#define OPFLAG_TRANS           4                       // Transparency bit
-#define OPFLAG_RMW                     2                       // Read-Modify-Write bit
-#define OPFLAG_REFLECT         1                       // Horizontal mirror bit
+#define OPFLAG_RELEASE         8                                       // Bus release bit
+#define OPFLAG_TRANS           4                                       // Transparency bit
+#define OPFLAG_RMW                     2                                       // Read-Modify-Write bit
+#define OPFLAG_REFLECT         1                                       // Horizontal mirror bit
 
 // Private function prototypes
 
@@ -83,23 +83,28 @@ void op_init(void)
                int dc2 = (INT8)(i & 0xF0) >> 4;        // Sign extend the C index
 
                y += dy;
+
                if (y < 0)
                        y = 0;
                else if (y > 0xFF)
                        y = 0xFF;
+
                op_blend_y[i] = y;
 
                c1 += dc1;
+
                if (c1 < 0)
                        c1 = 0;
                else if (c1 > 0x0F)
                        c1 = 0x0F;
+
                c2 += dc2;
 
                if (c2 < 0)
                        c2 = 0;
                else if (c2 > 0x0F)
                        c2 = 0x0F;
+
                op_blend_cr[i] = (c2 << 4) | c1;
        }