mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 00:29:57 +00:00
Use an accessor for depth/frame addresses.
This commit is contained in:
parent
6e3c741d83
commit
d49ad5f114
@ -386,10 +386,10 @@ void FramebufferManagerDX9::SetRenderFrameBuffer() {
|
||||
gstate_c.framebufChanged = false;
|
||||
|
||||
// Get parameters
|
||||
u32 fb_address = (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8);
|
||||
u32 fb_address = gstate.getFrameBufRawAddress();
|
||||
int fb_stride = gstate.fbwidth & 0x3C0;
|
||||
|
||||
u32 z_address = (gstate.zbptr & 0xFFFFFF) | ((gstate.zbwidth & 0xFF0000) << 8);
|
||||
u32 z_address = gstate.getDepthBufRawAddress();
|
||||
int z_stride = gstate.zbwidth & 0x3C0;
|
||||
|
||||
// Yeah this is not completely right. but it'll do for now.
|
||||
|
@ -516,10 +516,10 @@ void FramebufferManager::SetRenderFrameBuffer() {
|
||||
gstate_c.framebufChanged = false;
|
||||
|
||||
// Get parameters
|
||||
u32 fb_address = (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8);
|
||||
u32 fb_address = gstate.getFrameBufRawAddress();
|
||||
int fb_stride = gstate.fbwidth & 0x3C0;
|
||||
|
||||
u32 z_address = (gstate.zbptr & 0xFFFFFF) | ((gstate.zbwidth & 0xFF0000) << 8);
|
||||
u32 z_address = gstate.getDepthBufRawAddress();
|
||||
int z_stride = gstate.zbwidth & 0x3C0;
|
||||
|
||||
// Yeah this is not completely right. but it'll do for now.
|
||||
@ -1402,7 +1402,7 @@ void FramebufferManager::Resized() {
|
||||
}
|
||||
|
||||
bool FramebufferManager::GetCurrentFramebuffer(GPUDebugBuffer &buffer) {
|
||||
u32 fb_address = (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8);
|
||||
u32 fb_address = gstate.getFrameBufRawAddress();
|
||||
int fb_stride = gstate.fbwidth & 0x3C0;
|
||||
|
||||
VirtualFramebuffer *vfb = currentRenderVfb_;
|
||||
@ -1429,10 +1429,10 @@ bool FramebufferManager::GetCurrentFramebuffer(GPUDebugBuffer &buffer) {
|
||||
}
|
||||
|
||||
bool FramebufferManager::GetCurrentDepthbuffer(GPUDebugBuffer &buffer) {
|
||||
u32 fb_address = (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8);
|
||||
u32 fb_address = gstate.getFrameBufRawAddress();
|
||||
int fb_stride = gstate.fbwidth & 0x3C0;
|
||||
|
||||
u32 z_address = (gstate.zbptr & 0xFFFFFF) | ((gstate.zbwidth & 0xFF0000) << 8);
|
||||
u32 z_address = gstate.getDepthBufRawAddress();
|
||||
int z_stride = gstate.zbwidth & 0x3C0;
|
||||
|
||||
VirtualFramebuffer *vfb = currentRenderVfb_;
|
||||
@ -1462,7 +1462,7 @@ bool FramebufferManager::GetCurrentDepthbuffer(GPUDebugBuffer &buffer) {
|
||||
}
|
||||
|
||||
bool FramebufferManager::GetCurrentStencilbuffer(GPUDebugBuffer &buffer) {
|
||||
u32 fb_address = (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8);
|
||||
u32 fb_address = gstate.getFrameBufRawAddress();
|
||||
int fb_stride = gstate.fbwidth & 0x3C0;
|
||||
|
||||
VirtualFramebuffer *vfb = currentRenderVfb_;
|
||||
|
@ -212,8 +212,13 @@ struct GPUgstate
|
||||
float tgenMatrix[12];
|
||||
float boneMatrix[12 * 8]; // Eight bone matrices.
|
||||
|
||||
u32 getFrameBufRawAddress() const { return (fbptr & 0xFFFFFF) | ((fbwidth & 0xFF0000) << 8); }
|
||||
// 0x44000000 is uncached VRAM.
|
||||
u32 getFrameBufAddress() const { return 0x44000000 | getFrameBufRawAddress(); }
|
||||
GEBufferFormat FrameBufFormat() const { return static_cast<GEBufferFormat>(framebufpixformat & 3); }
|
||||
int FrameBufStride() const { return fbwidth&0x7C0; }
|
||||
u32 getDepthBufRawAddress() const { return (zbptr & 0xFFFFFF) | ((zbwidth & 0xFF0000) << 8); }
|
||||
u32 getDepthBufAddress() const { return 0x44000000 | getDepthBufRawAddress(); }
|
||||
int DepthBufStride() const { return zbwidth&0x7C0; }
|
||||
|
||||
// Pixel Pipeline
|
||||
|
@ -431,11 +431,11 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
|
||||
break;
|
||||
|
||||
case GE_CMD_FRAMEBUFPTR:
|
||||
fb.data = Memory::GetPointer(0x44000000 | (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8));
|
||||
fb.data = Memory::GetPointer(gstate.getFrameBufAddress());
|
||||
break;
|
||||
|
||||
case GE_CMD_FRAMEBUFWIDTH:
|
||||
fb.data = Memory::GetPointer(0x44000000 | (gstate.fbptr & 0xFFFFFF) | ((gstate.fbwidth & 0xFF0000) << 8));
|
||||
fb.data = Memory::GetPointer(gstate.getFrameBufAddress());
|
||||
break;
|
||||
|
||||
case GE_CMD_FRAMEBUFPIXFORMAT:
|
||||
@ -532,11 +532,11 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
|
||||
break;
|
||||
|
||||
case GE_CMD_ZBUFPTR:
|
||||
depthbuf.data = Memory::GetPointer(0x44000000 | (gstate.zbptr & 0xFFFFFF) | ((gstate.zbwidth & 0xFF0000) << 8));
|
||||
depthbuf.data = Memory::GetPointer(gstate.getDepthBufAddress());
|
||||
break;
|
||||
|
||||
case GE_CMD_ZBUFWIDTH:
|
||||
depthbuf.data = Memory::GetPointer(0x44000000 | (gstate.zbptr & 0xFFFFFF) | ((gstate.zbwidth & 0xFF0000) << 8));
|
||||
depthbuf.data = Memory::GetPointer(gstate.getDepthBufAddress());
|
||||
break;
|
||||
|
||||
case GE_CMD_AMBIENTCOLOR:
|
||||
|
Loading…
Reference in New Issue
Block a user