aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_unai
diff options
context:
space:
mode:
authornotaz2015-02-04 00:31:01 +0200
committernotaz2015-02-04 00:31:01 +0200
commit4144e9abc1fb8420e08e0a5ef48a9ceba7f26661 (patch)
tree3ee7853d116d459072c3f8dfea0d4de2ebce2d3e /plugins/gpu_unai
parent92a5fe88a86f0a25c3bbc74f80b67b16e18608e7 (diff)
downloadpcsx_rearmed-4144e9abc1fb8420e08e0a5ef48a9ceba7f26661.tar.gz
pcsx_rearmed-4144e9abc1fb8420e08e0a5ef48a9ceba7f26661.tar.bz2
pcsx_rearmed-4144e9abc1fb8420e08e0a5ef48a9ceba7f26661.zip
gpu_unai: fix some 64bit issues
Diffstat (limited to 'plugins/gpu_unai')
-rw-r--r--plugins/gpu_unai/gpu.cpp4
-rw-r--r--plugins/gpu_unai/gpu_command.h11
-rw-r--r--plugins/gpu_unai/gpu_raster_line.h2
-rw-r--r--plugins/gpu_unai/gpulib_if.cpp4
4 files changed, 11 insertions, 10 deletions
diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp
index d509617..1552bed 100644
--- a/plugins/gpu_unai/gpu.cpp
+++ b/plugins/gpu_unai/gpu.cpp
@@ -432,7 +432,7 @@ void GPU_readDataMem(u32* dmaAddress, s32 dmaCount)
{
if ((&pvram[px])>(VIDEO_END)) pvram-=512*1024;
// lower 16 bit
- u32 data = (unsigned long)pvram[px];
+ u32 data = pvram[px];
if (++px>=x_end)
{
@@ -442,7 +442,7 @@ void GPU_readDataMem(u32* dmaAddress, s32 dmaCount)
if ((&pvram[px])>(VIDEO_END)) pvram-=512*1024;
// higher 16 bit (always, even if it's an odd width)
- data |= (unsigned long)(pvram[px])<<16;
+ data |= (u32)(pvram[px])<<16;
*dmaAddress++ = data;
diff --git a/plugins/gpu_unai/gpu_command.h b/plugins/gpu_unai/gpu_command.h
index 049b146..d6e7a74 100644
--- a/plugins/gpu_unai/gpu_command.h
+++ b/plugins/gpu_unai/gpu_command.h
@@ -21,9 +21,9 @@
///////////////////////////////////////////////////////////////////////////////
INLINE void gpuSetTexture(u16 tpage)
{
- long tp;
- long tx, ty;
- GPU_GP1 = (GPU_GP1 & ~0x7FF) | (tpage & 0x7FF);
+ u32 tp;
+ u32 tx, ty;
+ GPU_GP1 = (GPU_GP1 & ~0x1FF) | (tpage & 0x1FF);
TextureWindow[0]&= ~TextureWindow[2];
TextureWindow[1]&= ~TextureWindow[3];
@@ -31,6 +31,7 @@ INLINE void gpuSetTexture(u16 tpage)
tp = (tpage >> 7) & 3;
tx = (tpage & 0x0F) << 6;
ty = (tpage & 0x10) << 4;
+ if (tp == 3) tp = 2;
tx += (TextureWindow[0] >> (2 - tp));
ty += TextureWindow[1];
@@ -437,8 +438,8 @@ void gpuSendPacketFunction(const int PRIM)
case 0xE5:
{
const u32 temp = PacketBuffer.U4[0];
- DrawingOffset[0] = ((long)temp<<(32-11))>>(32-11);
- DrawingOffset[1] = ((long)temp<<(32-22))>>(32-11);
+ DrawingOffset[0] = ((s32)temp<<(32-11))>>(32-11);
+ DrawingOffset[1] = ((s32)temp<<(32-22))>>(32-11);
//isSkip = false;
DO_LOG(("DrawingOffset(0x%x)\n",PRIM));
}
diff --git a/plugins/gpu_unai/gpu_raster_line.h b/plugins/gpu_unai/gpu_raster_line.h
index 4edfa06..fc59b79 100644
--- a/plugins/gpu_unai/gpu_raster_line.h
+++ b/plugins/gpu_unai/gpu_raster_line.h
@@ -26,7 +26,7 @@
#define GPU_DIGITS 16
#define GPU_DIGITSC (GPU_DIGITS+3)
-INLINE long GPU_DIV(long rs, long rt)
+INLINE s32 GPU_DIV(s32 rs, s32 rt)
{
return rt ? (rs / rt) : (0);
}
diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp
index 0d506bc..646b0f2 100644
--- a/plugins/gpu_unai/gpulib_if.cpp
+++ b/plugins/gpu_unai/gpulib_if.cpp
@@ -490,8 +490,8 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
}
case 0xE5: {
const u32 temp = PacketBuffer.U4[0];
- DrawingOffset[0] = ((long)temp<<(32-11))>>(32-11);
- DrawingOffset[1] = ((long)temp<<(32-22))>>(32-11);
+ DrawingOffset[0] = ((s32)temp<<(32-11))>>(32-11);
+ DrawingOffset[1] = ((s32)temp<<(32-22))>>(32-11);
gpu.ex_regs[5] = temp;
break;
}