Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about texture filtering on real hardware
03-26-2023, 01:18 PM
Post: #2
RE: Question about texture filtering on real hardware
If your goal is to patch a game to play outside of emulator, you should not be changing anything you see in GE debugger directly, but instead check what code on the cpu side is writing it using disassembly then depending on how deep you search and what you find either change the filtering flag directly or if you only find a function that loads all gpu commands create a custom function to hook into it which will detect command for linear filtering C6000101(passed as some register value) and replace it with C6000000 before writing it then patch game executable with your custom code.

"Sce-functions" are syscalls, I don't think tracing any of those would avoid tracing GE commands or could be in any way easier or faster, things like filtering flags can be written by simple commands that write value to register or came from some math that's based on some other parameters.

The only proper way to find what to change will be tracing the code back from the function that writes the gpu commands to their destination in memory, through with some luck you can try looking blindly for all commands that sets or adds 0x101(assuming that's what game is setting, but it could as well be 0x100 or 0x1 for just min/mag separately to a register and either use your experience or try changing randomly if you're really lucky, just remember that those flags might be set only during boot and never used again so changing them in-game will most likely not create any change in-game, loading savestates will also not work. Also things like flags can be reused since compilers optimize the code and even if you find the place where a flag is set, changing it directly might be potentially changing other flags that were set to same value so you might end up having to write your own function to filter out what you want to change anyway.

In the end whenever you find it easy or have a very hard time doing anything will depend on how the game itself works and your own experience with the first being random and the latter potentially starting from 0, so it might be impossible at first, but technically changing something like texture filtering should be on the easier side, just don't expect to be able to patch every game in exactly same way.
Another thing is - while it might be true that linear filtering was abused in many things without much sense, in many other cases linear filtering was used to avoid artifacts of stretching the pixels, this is completely different from forcing nearest in emulator that can easily run the game at xx times the original resolution and will look objectively bad on a hardware running 1:1 res.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Question about texture filtering on real hardware - LunaMoo - 03-26-2023 01:18 PM

Forum Jump: