[Glide64] change wxUIntPtr to uintptr_t

This commit is contained in:
zilmar 2016-01-25 22:13:35 +11:00
parent 5c9962684f
commit b8cbfa30c4
7 changed files with 19 additions and 24 deletions

View File

@ -95,7 +95,7 @@ typedef struct HIRESTEX_t {
typedef struct NODE_t {
uint32_t crc;
wxUIntPtr data;
uintptr_t data;
int tmu;
int number;
NODE_t *pNext;
@ -103,7 +103,7 @@ typedef struct NODE_t {
NODE *cachelut[65536];
void AddToList(NODE **list, uint32_t crc, wxUIntPtr data, int tmu, int number)
void AddToList(NODE **list, uint32_t crc, uintptr_t data, int tmu, int number)
{
NODE *node = new NODE;
node->crc = crc;
@ -379,7 +379,7 @@ void GetTexInfo(int id, int tile)
else
{
crc = 0xFFFFFFFF;
wxUIntPtr addr = uintptr_t(rdp.tmem) + (rdp.tiles[tile].t_mem << 3);
uintptr_t addr = uintptr_t(rdp.tmem) + (rdp.tiles[tile].t_mem << 3);
uint32_t line2 = maxval(line, 1);
if (rdp.tiles[tile].size < 3)
{
@ -980,10 +980,7 @@ uint32_t sizeBytes[4] = { 0, 1, 2, 4 };
inline uint32_t Txl2Words(uint32_t width, uint32_t size)
{
if (size == 0)
return maxval(1, width / 16);
else
return maxval(1, width*sizeBytes[size] / 8);
return size == 0 ? maxval(1, width / 16) : maxval(1, width*sizeBytes[size] / 8);
}
inline uint32_t ReverseDXT(uint32_t val, uint32_t /*lrs*/, uint32_t width, uint32_t size)

View File

@ -42,13 +42,13 @@
#include "TexLoad16b.h"
#include "TexLoad32b.h"
uint32_t LoadNone(wxUIntPtr /*dst*/,wxUIntPtr /*src*/,int /*wid_64*/,int /*height*/,int /*line*/,int /*real_width*/,int /*tile*/)
uint32_t LoadNone(uintptr_t /*dst*/,uintptr_t /*src*/,int /*wid_64*/,int /*height*/,int /*line*/,int /*real_width*/,int /*tile*/)
{
memset (texture, 0, 4096*4);
return (1 << 16) | GR_TEXFMT_ARGB_1555;
}
typedef uint32_t (*texfunc)(wxUIntPtr, wxUIntPtr, int, int, int, int, int);
typedef uint32_t (*texfunc)(uintptr_t, uintptr_t, int, int, int, int, int);
texfunc load_table [4][5] = { // [size][format]
{ Load4bSelect,
LoadNone,

View File

@ -159,7 +159,7 @@ static inline void load16bIA(uint8_t *src, uint8_t *dst, int wid_64, int height,
// Size: 2, Format: 0
//
uint32_t Load16bRGBA(wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
uint32_t Load16bRGBA(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int /*tile*/)
{
if (wid_64 < 1) wid_64 = 1;
if (height < 1) height = 1;
@ -174,7 +174,7 @@ uint32_t Load16bRGBA(wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int l
// Size: 2, Format: 3
//
uint32_t Load16bIA(wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
uint32_t Load16bIA(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int /*tile*/)
{
if (wid_64 < 1) wid_64 = 1;
if (height < 1) height = 1;
@ -229,7 +229,7 @@ uint16_t yuv_to_rgb565(uint8_t y, uint8_t u, uint8_t v)
// Size: 2, Format: 1
//
uint32_t Load16bYUV(wxUIntPtr dst, wxUIntPtr /*src*/, int /*wid_64*/, int /*height*/, int /*line*/, int /*real_width*/, int tile)
uint32_t Load16bYUV(uintptr_t dst, uintptr_t /*src*/, int /*wid_64*/, int /*height*/, int /*line*/, int /*real_width*/, int tile)
{
uint32_t * mb = (uint32_t*)(gfx.RDRAM + rdp.addr[rdp.tiles[tile].t_mem]); //pointer to the macro block
uint16_t * tex = (uint16_t*)dst;

View File

@ -43,11 +43,11 @@
// Load 32bit RGBA texture
// Based on sources of angrylion's software plugin.
//
uint32_t Load32bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load32bRGBA (uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (height < 1) height = 1;
const uint16_t *tmem16 = (uint16_t*)rdp.tmem;
const uint32_t tbase = (src - (wxUIntPtr)rdp.tmem) >> 1;
const uint32_t tbase = (src - (uintptr_t)rdp.tmem) >> 1;
const uint32_t width = maxval(1, wid_64 << 1);
const int ext = real_width - width;
line = width + (line>>2);

View File

@ -590,7 +590,7 @@ static inline void load4bI(uint8_t *src, uint8_t *dst, int wid_64, int height, i
//****************************************************************
// Size: 0, Format: 2
uint32_t Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load4bCI(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (wid_64 < 1) wid_64 = 1;
if (height < 1) height = 1;
@ -604,7 +604,7 @@ uint32_t Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
return /*(0 << 16) | */GR_TEXFMT_ALPHA_INTENSITY_44;
}
wxUIntPtr pal = uintptr_t(rdp.pal_8 + (rdp.tiles[tile].palette << 4));
uintptr_t pal = uintptr_t(rdp.pal_8 + (rdp.tiles[tile].palette << 4));
if (rdp.tlut_mode == 2)
{
ext <<= 1;
@ -622,7 +622,7 @@ uint32_t Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
//
// ** BY GUGAMAN **
uint32_t Load4bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load4bIA(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (rdp.tlut_mode != 0)
return Load4bCI (dst, src, wid_64, height, line, real_width, tile);
@ -637,7 +637,7 @@ uint32_t Load4bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
//****************************************************************
// Size: 0, Format: 4
uint32_t Load4bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load4bI(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (rdp.tlut_mode != 0)
return Load4bCI (dst, src, wid_64, height, line, real_width, tile);
@ -653,7 +653,7 @@ uint32_t Load4bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line
//****************************************************************
// Size: 0, Format: 0
uint32_t Load4bSelect (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load4bSelect(uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (rdp.tlut_mode == 0)
return Load4bI (dst, src, wid_64, height, line, real_width, tile);

View File

@ -373,7 +373,7 @@ static inline void load8bI(uint8_t *src, uint8_t *dst, int wid_64, int height, i
// Size: 1, Format: 2
//
uint32_t Load8bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
uint32_t Load8bCI (uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int /*tile*/)
{
if (wid_64 < 1) wid_64 = 1;
if (height < 1) height = 1;
@ -401,7 +401,7 @@ uint32_t Load8bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
// Size: 1, Format: 3
//
uint32_t Load8bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load8bIA (uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (rdp.tlut_mode != 0)
return Load8bCI (dst, src, wid_64, height, line, real_width, tile);
@ -417,7 +417,7 @@ uint32_t Load8bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
// Size: 1, Format: 4
//
uint32_t Load8bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
uint32_t Load8bI (uintptr_t dst, uintptr_t src, int wid_64, int height, int line, int real_width, int tile)
{
if (rdp.tlut_mode != 0)
return Load8bCI (dst, src, wid_64, height, line, real_width, tile);

View File

@ -801,8 +801,6 @@ extern uint32_t offset_texbuf1;
extern int ucode_error_report;
extern wxString iniPath;
// RDP functions
void rdp_reset();