Next Generation Emulation banner

Dynamic skip frame in IDisplay::render() to increase the CPU time for emulator core

1503 Views 5 Replies 3 Participants Last post by  pokemonhacker_
I like to run VBA with hq2x filter. But when hq2x filter is enable, some games run a little bit slow, such as F-ZERO.

So I download the source code of VBA 1.72, and do some minor modifications.

(1) I add some dynamic frame control mechanism in IDisplay::render() function. After doing that, the render function of display class always try to keep 45 FPS, no matter which frequency emulator core to call the IDisplay::render().

(2) Second I use ICC 8.1 to optimize VBA.

The result I get is about 15% faster than official optimzed VBA 1.72 version. I have attached two pictures running F-Zero with 3x window size, hq2x filter, 0 frame skip, no throttle.

I have upload both compiled bin & modified source code for anyone who is interested.
1 - 6 of 6 Posts
Cheers :).
I think dynamic skip frame is a not bad idea, but nobody interested. So let me explain a little bit the reason why I add frame control in display class since VBA already have frame skip mechanism. And any comments and corrections is more than welcome.

(1) VBA frame skip mechanism is fixed in skipping order. For example if you choosing skip 1 frame, then VBA always drop second frame. In some games, for example F-Zero, this cause the track don't show up.

(2) No matter how big the CPU loading of GBA core is, VBA frame skip mechanism drop the same amount of frames. In title screen the cpu core may be free, but in middle of game the CPU may be busy. Always skip the same amount of frames don't make sense to me.

(3) Frame skip automatic didn't take the display rendering overhead into account. If you run a game usin large window size (x3 for example), and use high cpu demand filter (hq2x for example), the image process take about 10 - 20 ms in my computer. So I think it's more make sense to determine how long to sleep after display rendering not before.
See less See more
Just to let you know I've added your changes to my build, and even I don't see any improvment from my test, I don't anything going bad either :p
I'll try to make some performance test someday (but I bet your changes would make the whole thing go a bit faster, so thanks for them :p).

And just for the record, you can select which frame VBA drops (in the F-Zero case for exemple) : press ctrl+P, ctrl+N, ctrl+P : the 'other' frame is skipped now.
pokemonhacker_ said:
Just to let you know I've added your changes to my build, and even I don't see any improvment from my test, I don't anything going bad either :p
I'll try to make some performance test someday (but I bet your changes would make the whole thing go a bit faster, so thanks for them :p).

And just for the record, you can select which frame VBA drops (in the F-Zero case for exemple) : press ctrl+P, ctrl+N, ctrl+P : the 'other' frame is skipped now.
After set skip frame to 0 and no throttle, then you can see the difference.
I'll try that (I always play at the original size without filters, that might be why I didn't see the benefits of your changes).
1 - 6 of 6 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top