From c5e0f2500e3f4993a05522450ef8f103ff28d8e7 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 26 Jun 2009 19:30:08 +0000 Subject: [PATCH] Add the alternative cf implementation from the addons. The plan is to have more instruments to sort out what's wrong with not being able to run pythonNDS demo under linux. --- desmume/configure.ac | 7 +++++++ desmume/src/gtk/main.cpp | 25 ++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/desmume/configure.ac b/desmume/configure.ac index d50f3e6a2..294968696 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -200,6 +200,13 @@ AC_ARG_ENABLE(wifi, ]) ]) +dnl - gba slot support +AC_ARG_ENABLE(gbaslot, + [AC_HELP_STRING(--enable-gbaslot, enable experimental gba slot support)], + [ + AC_DEFINE(EXPERIMENTAL_GBASLOT) + ]) + dnl Set compiler library flags per target. case $target in *linux* | *bsd*) diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 1da1a0a19..e6abd1085 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -49,6 +49,10 @@ #include "commandline.h" +#ifdef EXPERIMENTAL_GBASLOT +#include "addons.h" +#endif + #ifdef GDB_STUB #include "gdbstub.h" #endif @@ -1736,7 +1740,26 @@ common_gtk_main( struct configured_features *my_config) fw_config.language = my_config->firmware_language; } +#ifdef EXPERIMENTAL_GBASLOT + addon_type = NDS_ADDON_CFLASH; + if (my_config->cflash_disk_image_file != NULL) { + strncpy(CFlashName, my_config->cflash_disk_image_file, 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); +#else bad_glob_cflash_disk_image_file = my_config->cflash_disk_image_file; +#endif #ifdef GDB_STUB if ( my_config->arm9_gdb_port != 0) { @@ -1917,7 +1940,7 @@ common_gtk_main( struct configured_features *my_config) /* Command line arg */ if( my_config->nds_file != "") { - if(Open( my_config->nds_file.c_str(), bad_glob_cflash_disk_image_file) >= 0) { + if(Open( my_config->nds_file.c_str(), my_config->cflash_disk_image_file) >= 0) { my_config->process_movieCommands(); if(my_config->load_slot){