https://bugs.dolphin-emu.org/https://bugs.dolphin-emu.org/favicon.ico?12012-05-04T19:06:36ZDolphin bug trackerEmulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988082012-05-04T19:06:36Zwordmanwordswordmanwords@gmail.com
<ul></ul><p>Update:<br>
Although changing the "floor" to "round" fixes many hotspots, some hotspots (For example - the man and the shelf behind him in the guesthouse) are still not clickable.<br>
It looks like the hotspots that were fixed have an internal color representation with the top (5th/6th/5th) bits clear. e.g. (0xe, 0, 0xe)<br>
Meanwhile, the ones that weren't fixed have an internal color representation with the top bit set.<br>
Changing the "round" to "ceil" fixes all hotspots encountered so far but is most likely incorrect as well. </p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988092012-05-04T21:18:39Zhatarumoroboshihatarumoroboshi@hotmail.com
<ul></ul><p>Are you saying that this issue won't ever be fixed in a "conventional" way? If that's the case, since for the Paper-Mario games was created in game-properties a dedicated "Enable bounding box calculation" hack fix, maybe a dedicated one for Another Code R could be created as well...</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988102012-05-04T23:32:33Zskidau
<ul></ul><p>wordmanwords, nice find. Could the problem be caused by a change in format (at the PanicAlert message)? i.e. the RGB565 has been changed to another format which results in colours of (0xf, 0x0, 0xf)?</p>
<p>The FPU precision is different between a PC and a Wii. Knowing this, what is the possibility of "ceil" being correct?</p>
<p>Please keep on working on this game, because I am not aware of any devs that own this game.</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988112012-05-05T00:49:32Zwordmanwordswordmanwords@gmail.com
<ul></ul><p>Alright, figured out that WriteToBitDepth was multiplying by the wrong value.<br>
The attached patch fixes it to multiply by the correct value (and keeps 'floor', which is correct).<br>
From my testing, this fixes all hotspots in Another Code R.</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988122012-05-05T01:26:32Zskidau
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Fixed</i></li></ul><p>This issue was closed by revision 1587cb3738ee.</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988132012-05-05T11:19:23ZDimitriPilot3DimitriPilot3@gmail.com
<ul></ul><p>Issue 2137 has been merged into this issue.</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988142012-05-05T20:59:59Zwordmanwordswordmanwords@gmail.com
<ul></ul><p>Addendum: <br>
DX11 uses its own version of the code that was patched (instead of the common one) and so wasn't fixed by the patch - whoops!<br>
I'm attaching a patch that will fix the same code in DX11 as well. (It's more or less the same change, just changed to use the DX11 features (uint, >>) the rest of the DX11 shader code is using).</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988152012-05-05T21:11:32ZNeoBrainXNeoBrainX@gmail.com
<ul></ul><p>Hm, what's exactly the difference between e.g. pixel.r*31 and (uint)(pixel.r*255.0) >> 3 (line 31 in your patch)? </p>
<p>Also, could you give those DECODE_ functions a more meaningful name? (esp. since they don't even decode anything)</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988162012-05-05T21:16:05ZNeoBrainXNeoBrainX@gmail.com
<ul></ul><p>Or rather, wouldn't round(pixel.r*31.0f) have the same result?</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988172012-05-05T21:22:55Zwordmanwordswordmanwords@gmail.com
<ul></ul><p>Attached a patch with less lazy names.</p>
<p>No, round(x*31) doesn't have the same result - that was checked. ceil(x*31) <em>might</em> have the same result, but you'd need to check it for all valid values of x (0/255 ... 255/255) to confirm.<br>
Basically, the float is a number between 0/255 and 255/255. It makes little sense to multiply this by 31 - 31 and 255 don't have any common denominators. Instead, you should multiply it by 255 and go from there.</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988182012-05-05T22:27:31Ziceman4love77iceman4love77@gmail.com
<ul></ul><p>open gl works with patch for dx9<br>
only dx11 doesn't</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988192012-05-05T22:29:57Ziceman4love77iceman4love77@gmail.com
<ul></ul><p>oops sorry didn't meant with your latest patch ,sorry haven't noticed it :P</p>
Emulator - Emulator Issues #5405: Off-by-one error in encoded textures causes Another Code R issue (revival of issue 2137)https://bugs.dolphin-emu.org/issues/5405?journal_id=6988202013-02-01T16:21:24Zstefano.gasparstefano.gaspar@gmail.com
<ul></ul><p>Where do I put the patch??</p>