This is a very common technique on bootleg Game Boy and Game Boy Advance games which bootleggers use to save a few cents on batteries. And in truth, it's not too difficult to make such a patch.
Bootleggers will write per-game patches which flush the save contents to writeable flash depending on a small amount of reverse engineering work to discover where in the code the game saves. However, since all official GBA games always save data using functions from the Nintendo SDK, it's fairly straightforward to hook those functions and make a generic patch for any GBA game to save on a batteryless bootleg cartridge.
Bootleggers will write per-game patches which flush the save contents to writeable flash depending on a small amount of reverse engineering work to discover where in the code the game saves. However, since all official GBA games always save data using functions from the Nintendo SDK, it's fairly straightforward to hook those functions and make a generic patch for any GBA game to save on a batteryless bootleg cartridge.
I have written a patcher to do this which you can find here. https://github.com/metroid-maniac/gba-auto-batteryless-patch...