Skip to content

Commit

Permalink
Fixed several broken textures in Rayman 2 and Donald Duck Quack Attack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Apr 14, 2022
1 parent fc3f96b commit ba53a22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Source/SysVita/HLEGraphics/RendererLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,9 @@ uint32_t RendererLegacy::PrepareTrisUnclipped(uint32_t **clr)
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
vglTexCoordPointerMapped(gTexCoordBuffer);

if (g_ROM.T0_SKIP_HACK && (gRDPOtherMode.L == 0x0C184240)) UpdateTileSnapshots( mTextureTile + 1 );
else UpdateTileSnapshots( mTextureTile );
if (g_ROM.T0_SKIP_HACK && ((gRDPOtherMode.L >= 0x0C184000 && gRDPOtherMode.L <= 0x0C184FFF) || gRDPOtherMode.L == 0xC8104A50)) {
UpdateTileSnapshots( mTextureTile + 1 );
} else UpdateTileSnapshots( mTextureTile );

CNativeTexture *texture = mBoundTexture[0];

Expand Down
8 changes: 6 additions & 2 deletions Source/SysVita/HLEGraphics/RendererModern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ void RendererModern::PrepareRenderState(const float (&mat_project)[16], bool dis
float scale_x = texture->GetScaleX();
float scale_y = texture->GetScaleY();

//printf("PrepareRenderState: %X\n", gRDPOtherMode.L);
if (g_ROM.ZELDA_HACK && (gRDPOtherMode.L == 0x0C184241)) { // Hack to fix the sun in Zelda OOT/MM
scale_x *= 0.5f;
scale_y *= 0.5f;
Expand Down Expand Up @@ -776,6 +777,7 @@ void RendererModern::TexRect( u32 tile_idx, const v2 & xy0, const v2 & xy1, TexC
const f32 depth = gRDPOtherMode.depth_source ? mPrimDepth : 0.0f;

float *uvs = gTexCoordBuffer;
//printf("TexRect: %X\n", gRDPOtherMode.L);
if (g_ROM.T0_SKIP_HACK && (gRDPOtherMode.L == 0x0C184244)) {
gTexCoordBuffer[0] = NORMALIZE_C1842XX(uv0.x);
gTexCoordBuffer[1] = NORMALIZE_C1842XX(uv0.y);
Expand Down Expand Up @@ -1113,8 +1115,10 @@ uint32_t RendererModern::PrepareTrisUnclipped(uint32_t **clr)
if (mTnL.Flags.Texture) {
vglVertexAttribPointerMapped(1, gTexCoordBuffer);

if (g_ROM.T0_SKIP_HACK && (gRDPOtherMode.L == 0x0C184240)) UpdateTileSnapshots( mTextureTile + 1 );
else UpdateTileSnapshots( mTextureTile );
//printf("PrepareTrisUnclipped: %X\n", gRDPOtherMode.L);
if (g_ROM.T0_SKIP_HACK && ((gRDPOtherMode.L >= 0x0C184000 && gRDPOtherMode.L <= 0x0C184FFF) || gRDPOtherMode.L == 0xC8104A50)) {
UpdateTileSnapshots( mTextureTile + 1 );
} else UpdateTileSnapshots( mTextureTile );

CNativeTexture *texture = mBoundTexture[0];

Expand Down

0 comments on commit ba53a22

Please sign in to comment.