From aeaa60209392e3426241ef121db9e30e917664e0 Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:06:47 +0100 Subject: [PATCH] First 4MB of VROM maps to polygon RAM Daytona 2 PE replaces unused Dreamcast logo textures by filling in zeroed data from polygon RAM. Before we were reading from the first 4MB of VROM which is filled with 0xFF values, resulting in the replaced textures incorrectly becoming white and opaque. --- Src/Model3/Real3D.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Model3/Real3D.cpp b/Src/Model3/Real3D.cpp index 7261cd4..762ef1d 100644 --- a/Src/Model3/Real3D.cpp +++ b/Src/Model3/Real3D.cpp @@ -715,7 +715,13 @@ void CReal3D::WriteTexturePort(unsigned reg, uint32_t data) { uint32_t addr = m_vromTextureFIFO[0]; uint32_t header = m_vromTextureFIFO[1]; - UploadTexture(header, (const uint16_t *) &vrom[addr & 0xFFFFFF]); + + // first 4 MB maps to polygon RAM rather than VROM + // Daytona 2 PE uses zeroed data to replace unused Dreamcast logo textures + if (addr < 0x100000) + UploadTexture(header, (const uint16_t*)&polyRAM[addr & 0xFFFFFF]); + else + UploadTexture(header, (const uint16_t*)&vrom[addr & 0xFFFFFF]); m_vromTextureFIFOIdx = 0; } else