Hello! I've been working on integrating my Wanderbar sidebar thingy into Windows mGBA 0.6.1, but I know almost nothing about Qt and threads, plus the mGBA source code is light-years more advanced and cleaner than anything I could ever produce.
Still, I've been poking at the code and learning how things work. I've mostly got my Wanderbar working with mGBA now, but the biggest (and probably final) snag is that I need to call my Wanderbar's "doLogic" function before each GB/GBC/GBA CPU instruction.
Currently, I do that call in thread.c, around this part. (This actually works fine until my Wanderbar needs to update the browser, after which it crashes & I can't debug the cause, but it appears to be thread-related)
The issue is that I need to move this call out of thread.c and make it so that GameController.cpp (or maybe Window.cpp) calls my Wanderbar logic function instead. So basically I can't find a clear way to make it so that GameController.cpp knows when a core CPU instruction is about to be executed.
I figure that's probably not even how something like this should be handled, but again, I'm out of my league here with threads and Qt and such. Is there any way to make this work somehow? Currently my best guess is to try to create something like the debugger that's in the "if" statement in the code above, but that's also all written in C and part of the core, so I don't think that'll work either
Still, I've been poking at the code and learning how things work. I've mostly got my Wanderbar working with mGBA now, but the biggest (and probably final) snag is that I need to call my Wanderbar's "doLogic" function before each GB/GBC/GBA CPU instruction.
Currently, I do that call in thread.c, around this part. (This actually works fine until my Wanderbar needs to update the browser, after which it crashes & I can't debug the cause, but it appears to be thread-related)
The issue is that I need to move this call out of thread.c and make it so that GameController.cpp (or maybe Window.cpp) calls my Wanderbar logic function instead. So basically I can't find a clear way to make it so that GameController.cpp knows when a core CPU instruction is about to be executed.
I figure that's probably not even how something like this should be handled, but again, I'm out of my league here with threads and Qt and such. Is there any way to make this work somehow? Currently my best guess is to try to create something like the debugger that's in the "if" statement in the code above, but that's also all written in C and part of the core, so I don't think that'll work either