//--- // gint:core:kernel - Installing and unloading the library //--- #include #include #include /* internal global witch content Casio and Gint environment */ void *kernel_env_casio; void *kernel_env_gint; /* global information ( workaround >_< ) */ void *gint_vbr = NULL; /* kinit(): Install and start gint */ void kinit(void) { /* generate the VBR address */ #ifdef FX9860G /* VBR is loaded 0x600 bytes before end of the user RAM (0x100 bytes at the start of the VBR space are unused) */ gint_vbr = (void*)(uintptr_t)mmu_uram() + 0x1a00 - 0x100; #endif #ifdef FXCG50 /* VBR is loaded at the start of the user RAM */ gint_vbr = (void*)(uintptr_t)mmu_uram(); #endif /* create Casio's context, switch to Gint and save Gint context */ kernel_env_gint = drivers_context_create(); kernel_env_casio = drivers_context_create(); drivers_save(kernel_env_casio); drivers_init(kernel_env_gint); drivers_save(kernel_env_gint); } /* kquit(): Quit gint and give back control to the system */ void kquit(void) { drivers_restore(kernel_env_casio); atomic_begin(); drivers_context_destroy(&kernel_env_casio); drivers_context_destroy(&kernel_env_gint); atomic_end(); }