From 0a0d4fe509e8a3e5ce57e62713554bad626d6e74 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 21 Feb 2011 20:12:04 +0000 Subject: [PATCH] add --debug-console=1 which affects arm9 swi 0x0F and whether 8MB ewram is installed --- desmume/src/bios.cpp | 11 +++++------ desmume/src/commandline.cpp | 4 ++++ desmume/src/commandline.h | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/desmume/src/bios.cpp b/desmume/src/bios.cpp index 9da575806..09ee7bd4d 100644 --- a/desmume/src/bios.cpp +++ b/desmume/src/bios.cpp @@ -1,5 +1,5 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2008-2010 DeSmuME team + Copyright (C) 2008-2011 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1079,11 +1079,10 @@ TEMPLATE static u32 getCRC16() TEMPLATE static u32 isDebugger() { //gbatek has additional specifications which are not emulated here -#ifdef DEVELOPER - cpu->R[0] = 1; -#else - cpu->R[0] = 0; -#endif + if(CommonSettings.DebugConsole) + cpu->R[0] = 1; + else + cpu->R[0] = 0; return 1; } diff --git a/desmume/src/commandline.cpp b/desmume/src/commandline.cpp index bb25c2ea8..57ddbe5d6 100644 --- a/desmume/src/commandline.cpp +++ b/desmume/src/commandline.cpp @@ -52,6 +52,7 @@ CommandLine::CommandLine() , _slot1(NULL) , _slot1_fat_dir(NULL) , depth_threshold(-1) +, debug_console(-1) , load_slot(-1) , arm9_gdb_port(0) , arm7_gdb_port(0) @@ -95,6 +96,7 @@ void CommandLine::loadCommonOptions() { "slot1", 0, 0, G_OPTION_ARG_STRING, &_slot1, "Device to load in slot 1 (default retail)", "SLOT1"}, { "slot1-fat-dir", 0, 0, G_OPTION_ARG_STRING, &_slot1_fat_dir, "Directory to scan for slot 1", "SLOT1_DIR"}, { "depth-threshold", 0, 0, G_OPTION_ARG_INT, &depth_threshold, "Depth comparison threshold (default 0)", "DEPTHTHRESHOLD"}, + { "debug-console", 0, 0, G_OPTION_ARG_INT, &debug_console, "Behave as 8MB debug console (default 0)", "DEBUGCONSOLE"}, #ifndef _MSC_VER { "disable-sound", 0, 0, G_OPTION_ARG_NONE, &disable_sound, "Disables the sound emulation", NULL}, { "disable-limiter", 0, 0, G_OPTION_ARG_NONE, &disable_limiter, "Disables the 60fps limiter", NULL}, @@ -133,6 +135,8 @@ bool CommandLine::parse(int argc,char **argv) if(_advanced_timing != -1) CommonSettings.advanced_timing = _advanced_timing==1; if(depth_threshold != -1) CommonSettings.GFX3D_Zelda_Shadow_Depth_Hack = depth_threshold; + if(debug_console != -1) + CommonSettings.DebugConsole = true; //TODO MAX PRIORITY! change ARM9BIOS etc to be a std::string if(_bios_arm9) { CommonSettings.UseExtBIOS = true; strcpy(CommonSettings.ARM9BIOS,_bios_arm9); } diff --git a/desmume/src/commandline.h b/desmume/src/commandline.h index 9e6a7079b..7a84f1ded 100644 --- a/desmume/src/commandline.h +++ b/desmume/src/commandline.h @@ -39,6 +39,7 @@ public: //actual options: these may move to another sturct int load_slot; int depth_threshold; + int debug_console; std::string nds_file; std::string play_movie_file; std::string record_movie_file;