Project

General

Profile

Actions

Emulator Issues #5405

closed

Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)

Added by wordmanwords about 12 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

  1. Game Name and ID?
    RNOP01

2) What is the expected output? What do you see instead?
Currently, it's not possible to interact with objects in zoomed-in scenes (such as the house or the sign at the start). Normally, when the cursor is over an object (e.g. door) in one of those scenes, the object glows gold and can be clicked. In dolphin, the object doesn't glow and can't be clicked.
This issue doesn't seem affected by various Video/Emu options.

  1. What steps will reproduce the problem?
    Start game, proceed until you're near a sign or a house, click on it to have the camera zoom in, try to click on objects like the sign or the door in this zoomed-in view.

  2. What causes this problem? How can it be hack-fixed?
    Every frame in the zoomed-in view, the game writes an EFB texture to RAM. The texture uses format RGB565 and has plain colors for clickable areas and black for non-clickable areas.
    In Dolphin, the texture contains colors such as (0xe, 0, 0xe) and the game doesn't recognize those colors.
    However, if the colors were (0xf, 0, 0xf), the game would've recognized the colors and the issue would be gone.
    One hack-fix for this problem is in TextureConversionShader.cpp, WriteToBitDepth: change " %s = floor(%s * %ff);\n" to " %s = round(%s * %ff);\n".
    Of course, this is just a hack-fix. It doesn't show where the problem is - just what piece of code can be (most likely incorrectly) modified to fix it. Hopefully, a dev with in-depth experience with dolphin Video could help pinpoint the real issue.


Related issues 1 (0 open1 closed)

Has duplicate Emulator - Emulator Issues #2137: Trying to reinterpret pixel dataDuplicate

Actions
Actions

Also available in: Atom PDF