Don't use static variables this way. It'll mess up initial emulator state if the emu core is run more than once without restarting the application.