mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Add FBInfo config options.
This commit is contained in:
parent
dca42610a8
commit
ac8a9a9d5d
|
@ -52,8 +52,11 @@ void Config::resetToDefaults()
|
|||
frameBufferEmulation.copyAuxToRDRAM = 0;
|
||||
frameBufferEmulation.copyToRDRAM = ctAsync;
|
||||
frameBufferEmulation.N64DepthCompare = 0;
|
||||
frameBufferEmulation.aspect = 1;
|
||||
frameBufferEmulation.aspect = a43;
|
||||
frameBufferEmulation.bufferSwapMode = bsOnVerticalInterrupt;
|
||||
frameBufferEmulation.fbInfoDisabled = 0;
|
||||
frameBufferEmulation.fbInfoReadColorChunk = 0;
|
||||
frameBufferEmulation.fbInfoReadDepthChunk = 1;
|
||||
|
||||
textureFilter.txCacheSize = 100 * gc_uMegabyte;
|
||||
textureFilter.txDump = 0;
|
||||
|
|
15
src/Config.h
15
src/Config.h
|
@ -10,7 +10,8 @@
|
|||
#define CONFIG_VERSION_FOUR 4U // Remove ValidityCheckMethod setting
|
||||
#define CONFIG_VERSION_FIVE 5U // Add shader storage option
|
||||
#define CONFIG_VERSION_SIX 6U // Change gamma correction options
|
||||
#define CONFIG_VERSION_CURRENT CONFIG_VERSION_SIX
|
||||
#define CONFIG_VERSION_SEVEN 7U // Add FBInfo options
|
||||
#define CONFIG_VERSION_CURRENT CONFIG_VERSION_SEVEN
|
||||
|
||||
#define BILINEAR_3POINT 0
|
||||
#define BILINEAR_STANDARD 1
|
||||
|
@ -78,13 +79,19 @@ struct Config
|
|||
|
||||
struct {
|
||||
u32 enable;
|
||||
u32 aspect; // 0: stretch ; 1: 4/3 ; 2: 16/9; 3: adjust
|
||||
u32 bufferSwapMode; // 0: on VI update call; 1: on VI origin change; 2: on main frame buffer update
|
||||
u32 N64DepthCompare;
|
||||
u32 copyAuxToRDRAM;
|
||||
// Buffer read/write
|
||||
u32 copyToRDRAM;
|
||||
u32 copyDepthToRDRAM;
|
||||
u32 copyFromRDRAM;
|
||||
u32 N64DepthCompare;
|
||||
u32 aspect; // 0: stretch ; 1: 4/3 ; 2: 16/9; 3: adjust
|
||||
u32 bufferSwapMode; // 0: on VI update call; 1: on VI origin change; 2: on main frame buffer update
|
||||
// FBInfo
|
||||
u32 fbInfoSupported;
|
||||
u32 fbInfoDisabled;
|
||||
u32 fbInfoReadColorChunk;
|
||||
u32 fbInfoReadDepthChunk;
|
||||
} frameBufferEmulation;
|
||||
|
||||
struct
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <list>
|
||||
#include "FrameBufferInfoAPI.h"
|
||||
#include "FrameBufferInfo.h"
|
||||
#include "Config.h"
|
||||
#include "OpenGL.h"
|
||||
#include "FrameBuffer.h"
|
||||
#include "DepthBuffer.h"
|
||||
|
@ -12,7 +12,7 @@ FBInfo fbInfo;
|
|||
|
||||
void FBInfo::reset() {
|
||||
m_supported = false;
|
||||
m_pWriteBuffer = nullptr;
|
||||
m_pWriteBuffer = m_pReadBuffer = nullptr;
|
||||
}
|
||||
|
||||
void FBInfo::Write(u32 addr, u32 size)
|
||||
|
@ -45,10 +45,19 @@ void FBInfo::Read(u32 addr)
|
|||
if (pBuffer == nullptr || pBuffer == m_pWriteBuffer)
|
||||
return;
|
||||
|
||||
if (pBuffer->m_isDepthBuffer)
|
||||
FrameBuffer_CopyDepthBufferChunk(address);
|
||||
else
|
||||
FrameBuffer_CopyChunkToRDRAM(address);
|
||||
if (pBuffer->m_isDepthBuffer) {
|
||||
if (config.frameBufferEmulation.fbInfoReadDepthChunk != 0)
|
||||
FrameBuffer_CopyDepthBufferChunk(address);
|
||||
else if (pBuffer != m_pReadBuffer)
|
||||
FrameBuffer_CopyDepthBuffer(address);
|
||||
} else {
|
||||
if (config.frameBufferEmulation.fbInfoReadColorChunk != 0)
|
||||
FrameBuffer_CopyChunkToRDRAM(address);
|
||||
else if (pBuffer != m_pReadBuffer)
|
||||
FrameBuffer_CopyToRDRAM(address, true);
|
||||
}
|
||||
|
||||
m_pReadBuffer = pBuffer;
|
||||
}
|
||||
|
||||
void FBInfo::GetInfo(void *pinfo)
|
||||
|
@ -56,6 +65,10 @@ void FBInfo::GetInfo(void *pinfo)
|
|||
// debugPrint("FBGetInfo\n");
|
||||
FrameBufferInfo * pFBInfo = (FrameBufferInfo*)pinfo;
|
||||
memset(pFBInfo, 0, sizeof(FrameBufferInfo)* 6);
|
||||
|
||||
if (config.frameBufferEmulation.fbInfoDisabled != 0)
|
||||
return;
|
||||
|
||||
u32 idx = 0;
|
||||
DepthBuffer * pDepthBuffer = depthBufferList().getCurrent();
|
||||
if (pDepthBuffer != nullptr) {
|
||||
|
@ -66,6 +79,6 @@ void FBInfo::GetInfo(void *pinfo)
|
|||
}
|
||||
frameBufferList().fillBufferInfo(&pFBInfo[idx], 6 - idx);
|
||||
|
||||
m_pWriteBuffer = nullptr;
|
||||
m_pWriteBuffer = m_pReadBuffer = nullptr;
|
||||
m_supported = true;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
|
||||
private:
|
||||
const FrameBuffer * m_pWriteBuffer;
|
||||
const FrameBuffer * m_pReadBuffer;
|
||||
bool m_supported;
|
||||
};
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "Combiner.h"
|
||||
#include "FrameBuffer.h"
|
||||
#include "DepthBuffer.h"
|
||||
#include "FrameBufferInfo.h"
|
||||
#include "GBI.h"
|
||||
#include "PluginAPI.h"
|
||||
#include "Config.h"
|
||||
|
@ -209,7 +210,7 @@ void RSP_ProcessDList()
|
|||
}
|
||||
}
|
||||
|
||||
if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable)
|
||||
if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable && !fbInfo.isSupported())
|
||||
FrameBuffer_CopyDepthBuffer(gDP.colorImage.address);
|
||||
|
||||
RSP.busy = FALSE;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "CRC.h"
|
||||
#include "FrameBuffer.h"
|
||||
#include "DepthBuffer.h"
|
||||
#include "FrameBufferInfo.h"
|
||||
#include "VI.h"
|
||||
#include "Config.h"
|
||||
#include "Combiner.h"
|
||||
|
@ -883,11 +884,11 @@ void gDPFullSync()
|
|||
}
|
||||
|
||||
const bool sync = config.frameBufferEmulation.copyToRDRAM == Config::ctSync;
|
||||
if (config.frameBufferEmulation.copyToRDRAM != Config::ctDisable)
|
||||
if (config.frameBufferEmulation.copyToRDRAM != Config::ctDisable && !fbInfo.isSupported())
|
||||
FrameBuffer_CopyToRDRAM(gDP.colorImage.address, sync);
|
||||
|
||||
if (RSP.bLLE) {
|
||||
if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable)
|
||||
if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable && !fbInfo.isSupported())
|
||||
FrameBuffer_CopyDepthBuffer(gDP.colorImage.address);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user