diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index d76904180..65dd93351 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -57,6 +57,7 @@ #include "GPU_osd.h" #include "desmume_config.h" #include "commandline.h" +#include "addons.h" #ifdef GDB_STUB #include "gdbstub.h" #endif @@ -653,6 +654,29 @@ int main(int argc, char ** argv) { fw_config.language = my_config.firmware_language; } + /* addons */ + my_config.process_addonCommands(); + addon_type = NDS_ADDON_NONE; + if (my_config.is_cflash_configured) + addon_type = NDS_ADDON_CFLASH; + + if(my_config.gbaslot_rom != "") { + addon_type = NDS_ADDON_GBAGAME; + strncpy(GBAgameName, my_config.gbaslot_rom.c_str(), MAX_PATH); + } + + switch (addon_type) { + case NDS_ADDON_CFLASH: + case NDS_ADDON_RUMBLEPAK: + case NDS_ADDON_NONE: + case NDS_ADDON_GBAGAME: + break; + default: + addon_type = NDS_ADDON_NONE; + break; + } + addonsChangePak (addon_type); + if ( !g_thread_supported()) { g_thread_init( NULL); }