PCSX2's GSHack Draw-call skipping



    1. PCSX2 is a PS2 emulator.
    2. GSHack = Game-Specific Hack.
    3. Draw call skipping = ignoring GPU commands

    Pictured above is the first 20 of 2000 lines of game-specific draw call skipping.

    200 lines of 100% hardcoded and terrible game-specific hacks.
    Not even stuff that is well thought out like disabling specific features. Just random "hey, skip these draw calls if I reached this rendering state".

    You also have the wonderful DynamicCrcHack code to load new game-specific draw call skipping code from a DLL while the emulator is running: https://github.com/PCSX2/pcsx2/blob/330d14941fd32c17be6e60a6aab10f1c966c4b96/plugins/GSdx/GSState.cpp#L5284-L5319

    "Hey, it's too hard to figure out these random hacks, let's implement a generic DLL reloading thing so that we can iterate on the hacks!"

    Also, all of these functions return true. Except three return false. Why are they so special to return false? I have no fucking clue.



  • I wonder how many of these game-specific hacks "fix" stuff that's since been fixed in the core code. I wonder if any are still even needed.



  • Not a WTF. There's a reason they're called "game-specific hacks" and not "game-specific IoC container configurations" after all.



  • Something that would be more reasonable would be boolean feature flags to turn on and off hacks that work for multiple games, along with more accurate emulation reducing the need for "skipping drawcalls".
    In the rare case where you do need something game-specific, put that in the name and in a config file. (That link is nopping out some code.)

    Of course, that would require a sane design.



  • @riking said:

    Of course, that would require a sane design.

    What kind of website do you think this is?



  • @riking said:

    Except three return false. Why are they so special to return false? I have no fucking clue.

    Because it's allowed?

    			return false; // allowed
    


  • @riking said:

    Something that would be more reasonable would be boolean feature flags to turn on and off hacks that work for multiple games, along with more accurate emulation reducing the need for "skipping drawcalls".

    No shit, of course more accurate emulation would reduce the need for game-specific hacks.

    Game-specific hacks are for making games work before they figure out how to emulate them 100% correctly. Hence the name.

    And how many of these apply to more than one game?



  • @immibis_ said:

    And how many of these apply to more than one game?

    I'm talking about underlying causes, clearly.

    NeedsAccurateICache=1
    

    <[Unknown]> just only do the evictions on certain ranges
    <[Unknown]> then you can track down which range has the problem
    <[Unknown]> once you have the range - track down what writes there
    <[Unknown]> then you have the func that is causing the nasty problems
    <[Unknown]> and maybe you can just hook the exit of the func and flush the icache there or something



  • @riking said:

    I'm talking about underlying causes, clearly.

    NeedsAccurateICache=1</blockquote>
    

    If only programming was that easy. We could just write:

    NeedsAccurateEmulator=1
    

    and have an emulator that runs every game flawlessly!



  • @riking said:

    In the rare case where you do need something game-specific, put that in the name
    They did. GSC_Okami


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.