New Visual Boy Advance GX - with dynamic recompiler

Tantric

Well-Known Member
Member
Joined
Feb 8, 2007
Messages
250
Reaction score
167
Trophies
1
XP
902
Country
Canada
I decided to give my VBA-M port some love - so I wrote a JIT thumb compiler for it. I didn't want to leave GameCube behind - so I've also written a whole new backend for handling paging (since GameCube only has 24MB of RAM). Note - I haven't put a ton of effort into tuning the JIT settings. They're not configurable from the front end but if anyone is interested they're not hard to find in the code. The main ones are - JIT_ARENA_SIZE, HASH_TABLE_SIZE, SMC_MAP_SIZE, JIT_TRACE_MAX_INSTRUCTIONS. I'd be interested to know if anyone finds better settings. With the settings I picked I've been able to get ~180fps out of the JIT headless (~25 MIPS vs ~5 MIPS in the C++ interpreter). There's a whole debug / profiling system I built to test with. This prompted me to stop tuning further since that already made 60fps (my target!) a lot easier.

With both of those in place I didn't want to leave things unpolished, so I rounded it out with cheat support, rewritten/reworked audio and new timing code. And before anyone tests and reports back that FPS jumps up and down slightly - my focus is on player experience not meeting some arbitrary benchmark. I notice more when audio skips than if a frame is skipped to keep the audio timing correct.

Enjoy!

Here's the full changelog:
  • Implemented a brand new Dynamic Recompilation (JIT) core for GBA games on both Wii and GameCube, built entirely from scratch. This is a from-the-ground-up addition, not a port - real GBA titles now run with plenty of headroom to
    run at full speed, well beyond what the interpreter core could sustain. Enable it from Settings > Emulation
  • Replaced GameCube's old ROM paging system with a new ARAM/SD hybrid virtual memory pager - ROM data now streams transparently from SD into ARAM and MEM1 on demand instead of needing to fit entirely in memory ahead of time, allowing the JIT to be possible (since it doesn't have to be aware of backing data location)
  • Rewritten memory management for both Wii/GameCube, freeing up 8MB+ for a JIT Cache, while still allowing 32MB ROMs
  • Added cheat code support for both GBA and GB/GBC games, using the Libretro .cht file format
  • GB/GBA audio is cleaner and truer to the original hardware, with one less resampling step - it is now generated natively at 48kHz - instead of upsampled from 44100Hz (GBA) and 22050Hz (GB)
  • Audio samples are now written directly into the output buffer with no intermediate mixing buffer in between, reducing audio latency
  • Smart dynamic audio rate control keeps playback speed correctly matched to real GBA hardware timing, with a stronger correction kicking in only when actually needed to avoid a dropout - this means fewer, less noticeable pitch adjustments during normal play
  • Buffer underruns (audio momentarily running dry) now fade smoothly to silence and back instead of producing a hard click, and startup/resume is primed to avoid an initial stutter
  • Reworked frameskip and frame pacing so video timing is smoother and more consistent, especially when the JIT core is running well above 60fps, and skipped frames are spaced more evenly instead of clumping
  • Added FPS display option
https://github.com/dborth/vbagx
 
I decided to give my VBA-M port some love - so I wrote a JIT thumb compiler for it. I didn't want to leave GameCube behind - so I've also written a whole new backend for handling paging (since GameCube only has 24MB of RAM). Note - I haven't put a ton of effort into tuning the JIT settings. They're not configurable from the front end but if anyone is interested they're not hard to find in the code. The main ones are - JIT_ARENA_SIZE, HASH_TABLE_SIZE, SMC_MAP_SIZE, JIT_TRACE_MAX_INSTRUCTIONS. I'd be interested to know if anyone finds better settings. With the settings I picked I've been able to get ~180fps out of the JIT headless (~25 MIPS vs ~5 MIPS in the C++ interpreter). There's a whole debug / profiling system I built to test with. This prompted me to stop tuning further since that already made 60fps (my target!) a lot easier.

With both of those in place I didn't want to leave things unpolished, so I rounded it out with cheat support, rewritten/reworked audio and new timing code. And before anyone tests and reports back that FPS jumps up and down slightly - my focus is on player experience not meeting some arbitrary benchmark. I notice more when audio skips than if a frame is skipped to keep the audio timing correct.

Enjoy!

Here's the full changelog:
  • Implemented a brand new Dynamic Recompilation (JIT) core for GBA games on both Wii and GameCube, built entirely from scratch. This is a from-the-ground-up addition, not a port - real GBA titles now run with plenty of headroom to
    run at full speed, well beyond what the interpreter core could sustain. Enable it from Settings > Emulation
  • Replaced GameCube's old ROM paging system with a new ARAM/SD hybrid virtual memory pager - ROM data now streams transparently from SD into ARAM and MEM1 on demand instead of needing to fit entirely in memory ahead of time, allowing the JIT to be possible (since it doesn't have to be aware of backing data location)
  • Rewritten memory management for both Wii/GameCube, freeing up 8MB+ for a JIT Cache, while still allowing 32MB ROMs
  • Added cheat code support for both GBA and GB/GBC games, using the Libretro .cht file format
  • GB/GBA audio is cleaner and truer to the original hardware, with one less resampling step - it is now generated natively at 48kHz - instead of upsampled from 44100Hz (GBA) and 22050Hz (GB)
  • Audio samples are now written directly into the output buffer with no intermediate mixing buffer in between, reducing audio latency
  • Smart dynamic audio rate control keeps playback speed correctly matched to real GBA hardware timing, with a stronger correction kicking in only when actually needed to avoid a dropout - this means fewer, less noticeable pitch adjustments during normal play
  • Buffer underruns (audio momentarily running dry) now fade smoothly to silence and back instead of producing a hard click, and startup/resume is primed to avoid an initial stutter
  • Reworked frameskip and frame pacing so video timing is smoother and more consistent, especially when the JIT core is running well above 60fps, and skipped frames are spaced more evenly instead of clumping
  • Added FPS display option
https://github.com/dborth/vbagx
Good 'ole VBA-GX is back too. :grog:
 
Wow, i wanna check this out, but i think i am sticking with GB/GBC with this one.
Post automatically merged:

I decided to give my VBA-M port some love - so I wrote a JIT thumb compiler for it. I didn't want to leave GameCube behind - so I've also written a whole new backend for handling paging (since GameCube only has 24MB of RAM). Note - I haven't put a ton of effort into tuning the JIT settings. They're not configurable from the front end but if anyone is interested they're not hard to find in the code. The main ones are - JIT_ARENA_SIZE, HASH_TABLE_SIZE, SMC_MAP_SIZE, JIT_TRACE_MAX_INSTRUCTIONS. I'd be interested to know if anyone finds better settings. With the settings I picked I've been able to get ~180fps out of the JIT headless (~25 MIPS vs ~5 MIPS in the C++ interpreter). There's a whole debug / profiling system I built to test with. This prompted me to stop tuning further since that already made 60fps (my target!) a lot easier.

With both of those in place I didn't want to leave things unpolished, so I rounded it out with cheat support, rewritten/reworked audio and new timing code. And before anyone tests and reports back that FPS jumps up and down slightly - my focus is on player experience not meeting some arbitrary benchmark. I notice more when audio skips than if a frame is skipped to keep the audio timing correct.

Enjoy!

Here's the full changelog:
  • Implemented a brand new Dynamic Recompilation (JIT) core for GBA games on both Wii and GameCube, built entirely from scratch. This is a from-the-ground-up addition, not a port - real GBA titles now run with plenty of headroom to
    run at full speed, well beyond what the interpreter core could sustain. Enable it from Settings > Emulation
  • Replaced GameCube's old ROM paging system with a new ARAM/SD hybrid virtual memory pager - ROM data now streams transparently from SD into ARAM and MEM1 on demand instead of needing to fit entirely in memory ahead of time, allowing the JIT to be possible (since it doesn't have to be aware of backing data location)
  • Rewritten memory management for both Wii/GameCube, freeing up 8MB+ for a JIT Cache, while still allowing 32MB ROMs
  • Added cheat code support for both GBA and GB/GBC games, using the Libretro .cht file format
  • GB/GBA audio is cleaner and truer to the original hardware, with one less resampling step - it is now generated natively at 48kHz - instead of upsampled from 44100Hz (GBA) and 22050Hz (GB)
  • Audio samples are now written directly into the output buffer with no intermediate mixing buffer in between, reducing audio latency
  • Smart dynamic audio rate control keeps playback speed correctly matched to real GBA hardware timing, with a stronger correction kicking in only when actually needed to avoid a dropout - this means fewer, less noticeable pitch adjustments during normal play
  • Buffer underruns (audio momentarily running dry) now fade smoothly to silence and back instead of producing a hard click, and startup/resume is primed to avoid an initial stutter
  • Reworked frameskip and frame pacing so video timing is smoother and more consistent, especially when the JIT core is running well above 60fps, and skipped frames are spaced more evenly instead of clumping
  • Added FPS display option
https://github.com/dborth/vbagx

Hey yo man, can i add some suggestions? is it possible you can fix the uneven blurryness that happens when you try to scale GB & GBC into SGB dimensions? specially when you are using borders, i am aware that long ago you guys switch the horizontal display to 720 as opposed to 640, and that causes pixels to look wider and sharper with no shimmering issues even without bilinear sharp, but i kinda dont like the way it looks too wide.
Post automatically merged:

Hey, when i set up Borders from SGB game only to play at SGB dimensions, i keep gettin stack dumps,.
 
Last edited by MeXen,

Site & Scene News

Popular threads in this forum