Conditional rules were actually heavily optimized just a few days ago.
kya is working on another HD Pack for CV1 (different from the one he made on Nestopia last year) and abused conditionals and background graphics so much it would slow the execution to ~90fps on my computer for some portions of the game. After optimizing the code, the same HD Pack runs around 250fps. I just tried your pack on my end - it runs at 120fps w/ 0.9.4 vs 190fps as of the latest commit. 4x scale resolution does hurt performance a fair amount though, so it's normal for the pack to run relatively slow.
You can grab a build with the optimizations here:
downloadLet me know if/how much it helps - hopefully it gets you well above 60fps. I'll try to profile your HD pack when I get the chance to see if I can squeeze a bit more performance out of the HD pack code (but it's been optimized a lot already, so it's starting to get a bit hard to make it any faster)
mkwong98 wrote:
can you give some examples of using these built-in conditions?
They work like the other conditions, but will only have any impact if the tile is a sprite. They are automatically available in any hires.txt file, without having to define a <condition> tag for them:
Code:
[bgpriority]<tile>0,2304,FF271607,416,672,1,N
[hmirror]<tile>0,2304,FF271607,416,672,1,N
[vmirror]<tile>0,2304,FF271607,416,672,1,N
Also, I've added a few new condition types recently. All of these now exist:
-tileAtPosition/tileNearby
-spriteAtPosition/spriteNearby
-memoryCheck/memoryCheckConstant (to compare 2 addresses in memory or an address vs a constant)
-frameRange (to change tiles based on the frame number)
They are not documented anywhere yet, you can check
HdPackLoader.cpp to get an idea of how they work.
I haven't had the chance to take a look at changing sign of the offset values when mirroring is enabled (what you asked last time) - I'll try to get this done before the next release.