So hello, I hope I didn't miss the right ticket to report bugs :)
So what the problem is that I rewrote a routine that does internal sound rendering in Pokemon Emerald (German Version) and "sometimes" causes the game to crash with VBA-M (PC seems to get into unused memory areas above 0x10000000) and to reset after a while (when PC reaches BIOS area). It only seems to happen when closing the main Pokemon Menu (Start -> Pokemon). The amount of trys you need to get is crash can vary between 2 and ~100 (just open and close the Pokemon menu).
So the first thing you might tell me now is that I wrote some buggy code which causes the game to crash. I loaded the ROM in the VBA-SDL-H debugger and couldn't force a single crash and therefore I cannot analyze my code. I tried a few other emulators like the "old" VBA 1.8.0 and No$gba 2.7. I didn't have a single crash with those ones and I'm a little bit unsure if it's a problem with VBA-M or my code (or the repointed memory areas, nothing out of valid areas!!!).
I'll try to attatch an IPS file (patch) to give you my modified version of Pokemon Emerald GER (Code: BPED) and I'd really appreciate any help or advice you can offer me.
PS: If you want to I can offer you the source of my code.
It's located at 0xF00000 in ROM and gets loaded to IWRAM 0x03006380 upon ROM start and is executed in IWRAM.