diff --git a/Source/Glide64/TexCache.cpp b/Source/Glide64/TexCache.cpp index aea1d2d83..05b7e5879 100644 --- a/Source/Glide64/TexCache.cpp +++ b/Source/Glide64/TexCache.cpp @@ -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) diff --git a/Source/Glide64/TexLoad.h b/Source/Glide64/TexLoad.h index 26a6a1b03..09265041f 100644 --- a/Source/Glide64/TexLoad.h +++ b/Source/Glide64/TexLoad.h @@ -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, diff --git a/Source/Glide64/TexLoad16b.h b/Source/Glide64/TexLoad16b.h index 7c605cca7..af751d50c 100644 --- a/Source/Glide64/TexLoad16b.h +++ b/Source/Glide64/TexLoad16b.h @@ -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; diff --git a/Source/Glide64/TexLoad32b.h b/Source/Glide64/TexLoad32b.h index bd346a132..2a55a3997 100644 --- a/Source/Glide64/TexLoad32b.h +++ b/Source/Glide64/TexLoad32b.h @@ -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); diff --git a/Source/Glide64/TexLoad4b.h b/Source/Glide64/TexLoad4b.h index bc360a0e0..3685b73d5 100644 --- a/Source/Glide64/TexLoad4b.h +++ b/Source/Glide64/TexLoad4b.h @@ -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); diff --git a/Source/Glide64/TexLoad8b.h b/Source/Glide64/TexLoad8b.h index a19243851..1f94326fc 100644 --- a/Source/Glide64/TexLoad8b.h +++ b/Source/Glide64/TexLoad8b.h @@ -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); diff --git a/Source/Glide64/rdp.h b/Source/Glide64/rdp.h index 12b0ef5b4..db42519ff 100644 --- a/Source/Glide64/rdp.h +++ b/Source/Glide64/rdp.h @@ -801,8 +801,6 @@ extern uint32_t offset_texbuf1; extern int ucode_error_report; -extern wxString iniPath; - // RDP functions void rdp_reset();