mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-30 08:24:05 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
d30c8fa31b
|
@ -607,8 +607,12 @@ TxFileStorage::TxFileStorage(uint32 options,
|
||||||
|
|
||||||
void TxFileStorage::buildFullPath()
|
void TxFileStorage::buildFullPath()
|
||||||
{
|
{
|
||||||
char cbuf[MAX_PATH * 2];
|
char cbuf[MAX_PATH * 2];
|
||||||
|
#ifdef RELATIVE_PATHS
|
||||||
|
tx_wstring filename = _filename;
|
||||||
|
#else
|
||||||
tx_wstring filename = _cachePath + OSAL_DIR_SEPARATOR_STR + _filename;
|
tx_wstring filename = _cachePath + OSAL_DIR_SEPARATOR_STR + _filename;
|
||||||
|
#endif
|
||||||
wcstombs(cbuf, filename.c_str(), MAX_PATH * 2);
|
wcstombs(cbuf, filename.c_str(), MAX_PATH * 2);
|
||||||
_fullPath = cbuf;
|
_fullPath = cbuf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,33 @@
|
||||||
#include "TxInternal.h"
|
#include "TxInternal.h"
|
||||||
#include "TxUtil.h"
|
#include "TxUtil.h"
|
||||||
|
|
||||||
|
struct Checksum
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
uint64 _checksum; /* checksum hi:palette low:texture */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32 _low;
|
||||||
|
uint32 _hi;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Checksum(uint64 checksum) : _checksum(checksum) {}
|
||||||
|
operator bool() {
|
||||||
|
return _checksum != 0;
|
||||||
|
}
|
||||||
|
operator uint64() {
|
||||||
|
return _checksum;
|
||||||
|
}
|
||||||
|
bool operator ==(const Checksum& rhs) {
|
||||||
|
return _checksum == rhs._checksum;
|
||||||
|
}
|
||||||
|
bool operator !=(const Checksum& rhs) {
|
||||||
|
return _checksum != rhs._checksum;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class TxCacheImpl;
|
class TxCacheImpl;
|
||||||
|
|
||||||
class TxCache
|
class TxCache
|
||||||
|
|
|
@ -38,6 +38,11 @@
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SWAP32(data) \
|
||||||
|
( (((data) >> 24) & 0x000000FF) | (((data) >> 8) & 0x0000FF00) | \
|
||||||
|
(((data) << 8) & 0x00FF0000) | (((data) << 24) & 0xFF000000) )
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utilities
|
* Utilities
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
@ -140,6 +145,7 @@ TxUtil::checksum64(uint8 *src, int width, int height, int size, int rowStride, u
|
||||||
* (unsigned short)(rdp.tiles[tile].format << 8 | rdp.tiles[tile].size),
|
* (unsigned short)(rdp.tiles[tile].format << 8 | rdp.tiles[tile].size),
|
||||||
* bpl);
|
* bpl);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
TxUtil::RiceCRC32(const uint8* src, int width, int height, int size, int rowStride)
|
TxUtil::RiceCRC32(const uint8* src, int width, int height, int size, int rowStride)
|
||||||
{
|
{
|
||||||
|
@ -193,6 +199,11 @@ loop1:
|
||||||
while (x >= 0)
|
while (x >= 0)
|
||||||
{
|
{
|
||||||
esi = *(uint32*)(src + x);
|
esi = *(uint32*)(src + x);
|
||||||
|
|
||||||
|
#ifdef NATIVE
|
||||||
|
esi = SWAP32(esi);
|
||||||
|
#endif
|
||||||
|
|
||||||
esi ^= x;
|
esi ^= x;
|
||||||
|
|
||||||
crc32Ret = (crc32Ret << 4) + ((crc32Ret >> 28) & 15);
|
crc32Ret = (crc32Ret << 4) + ((crc32Ret >> 28) & 15);
|
||||||
|
@ -215,17 +226,18 @@ loop1:
|
||||||
static
|
static
|
||||||
uint8 CalculateMaxCI8b(const uint8* src, uint32 width, uint32 height, uint32 rowStride)
|
uint8 CalculateMaxCI8b(const uint8* src, uint32 width, uint32 height, uint32 rowStride)
|
||||||
{
|
{
|
||||||
uint8 val = 0;
|
uint8 max = 0;
|
||||||
|
|
||||||
for (uint32 y = 0; y < height; ++y) {
|
for (uint32 y = 0; y < height; ++y) {
|
||||||
const uint8 * buf = src + rowStride * y;
|
const uint8 * buf = src + rowStride * y;
|
||||||
for (uint32 x = 0; x<width; ++x) {
|
for (uint32 x = 0; x < width; ++x) {
|
||||||
if (buf[x] > val)
|
if (buf[x] > max)
|
||||||
val = buf[x];
|
max = buf[x];
|
||||||
if (val == 0xFF)
|
if (max == 0xFF)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return val;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -236,7 +248,7 @@ uint8 CalculateMaxCI4b(const uint8* src, uint32 width, uint32 height, uint32 row
|
||||||
width >>= 1;
|
width >>= 1;
|
||||||
for (uint32 y = 0; y < height; ++y) {
|
for (uint32 y = 0; y < height; ++y) {
|
||||||
const uint8 * buf = src + rowStride * y;
|
const uint8 * buf = src + rowStride * y;
|
||||||
for (uint32 x = 0; x<width; ++x) {
|
for (uint32 x = 0; x < width; ++x) {
|
||||||
val1 = buf[x] >> 4;
|
val1 = buf[x] >> 4;
|
||||||
val2 = buf[x] & 0xF;
|
val2 = buf[x] & 0xF;
|
||||||
if (val1 > val) val = val1;
|
if (val1 > val) val = val1;
|
||||||
|
|
|
@ -33,7 +33,11 @@ RSPInfo RSP;
|
||||||
static
|
static
|
||||||
void _ProcessDList()
|
void _ProcessDList()
|
||||||
{
|
{
|
||||||
|
#ifdef NATIVE
|
||||||
|
for (int i = 0; !RSP.halt && i < 1000*1000*1000; ++i) {
|
||||||
|
#else
|
||||||
while (!RSP.halt) {
|
while (!RSP.halt) {
|
||||||
|
#endif
|
||||||
#ifndef NATIVE
|
#ifndef NATIVE
|
||||||
if ((RSP.PC[RSP.PCi] + sizeof(Gwords)) > RDRAMSize) {
|
if ((RSP.PC[RSP.PCi] + sizeof(Gwords)) > RDRAMSize) {
|
||||||
#ifdef DEBUG_DUMP
|
#ifdef DEBUG_DUMP
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
static u64 g_originalWidth = START_WIDTH;//Size set by the end-user
|
static u64 g_originalWidth = START_WIDTH;//Size set by the end-user
|
||||||
static u64 g_width = START_WIDTH;//Current size
|
static u64 g_width = START_WIDTH;//Current size
|
||||||
static u64 g_height = START_HEIGHT;
|
static u64 g_height = START_HEIGHT;
|
||||||
|
static int highres_enabled = 0;//1 if HD texture mode is enabled
|
||||||
|
static bool highres_hts = true;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
u64 gfx_width()
|
u64 gfx_width()
|
||||||
|
@ -139,6 +141,24 @@ extern "C" {
|
||||||
RDRAMSize = (word)-1;
|
RDRAMSize = (word)-1;
|
||||||
|
|
||||||
api().RomOpen(romName);
|
api().RomOpen(romName);
|
||||||
|
|
||||||
|
config.textureFilter.txHiresEnable = highres_enabled;
|
||||||
|
wsprintf(config.textureFilter.txCachePath, L".");
|
||||||
|
config.textureFilter.txHiresTextureFileStorage = highres_hts ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_switch_to_htc(bool enable) {
|
||||||
|
highres_hts = !enable;
|
||||||
|
config.textureFilter.txHiresTextureFileStorage = enable ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gfx_is_highres_enabled() {
|
||||||
|
highres_enabled = 1;
|
||||||
|
return config.textureFilter.txHiresEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_highres_enable(bool enable) {
|
||||||
|
config.textureFilter.txHiresEnable = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_force_43(bool enable) {
|
void gfx_force_43(bool enable) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user