Final Fantasy Hacktics

Modding => Non-FFT Modding => FFTA/FFTA2 Hacking => Topic started by: endrift on February 03, 2015, 12:44:31 am

Title: FFTA busy loop removal
Post by: endrift on February 03, 2015, 12:44:31 am
This patch will basically just make FFTA use less CPU in emulators (up to maybe 35%, but it practice probably more like 15%). That's about it. But it's great if you hold down fast forward all the time! I've only tested it against the US release (AGB-AFXE-USA, MD5: cd99cdde3d45554c1b36fbeb8863b7bd), but it might work against other regions as well.

Background: Final Fantasy Tactics Advance is not particularly well coded. That's no surprise, because most GBA games have tons of errors. However, one specific grievance that FFTA has is that, while waiting for the current frame to end, it performs a busy loop (http://en.wikipedia.org/wiki/Busy_waiting), perpetually checking if the frame has ended. This patch replaces three instructions to call the Halt syscall, which causes the CPU to stop until something happens. This saves battery on real GBAs, and lets emulators not do as much work, so as a result, emulated games use less CPU time.
Title: Re: FFTA busy loop removal
Post by: bcrobert on February 03, 2015, 12:52:17 am
Sweet! Thanks for uploading this. I love fast forwarding through the easy battles so your fix should help me out quite a bit. :D
Title: Re: FFTA busy loop removal
Post by: endrift on February 03, 2015, 12:54:08 am
Just a note: I think VBA caps out at 10x speedup, so if you've already got a fast computer this might be irrelevant in VBA.