diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 588237902..f8e438719 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -944,14 +944,10 @@ int NDS_WriteBMP_32bppBuffer(int width, int height, const void* buf, const char } void NDS_Sleep() { nds.sleeping = TRUE; } -void NDS_ToggleCardEject() + +void NDS_TriggerCardEjectIRQ() { - if(!nds.cardEjected) - { - //staff of kings will test this (it also uses the arm9 0xB8 poll) - NDS_makeIrq(ARMCPU_ARM7, IRQ_BIT_GC_IREQ_MC); - } - nds.cardEjected ^= TRUE; + NDS_makeIrq(ARMCPU_ARM7, IRQ_BIT_GC_IREQ_MC); } diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 7b281efd4..94d82a778 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -456,7 +456,7 @@ bool nds_loadstate(EMUFILE* is, int size); int NDS_WriteBMP(const char *filename); void NDS_Sleep(); -void NDS_ToggleCardEject(); +void NDS_TriggerCardEjectIRQ(); void NDS_SkipNextFrame(); #define NDS_SkipFrame(s) if(s) NDS_SkipNext2DFrame(); diff --git a/desmume/src/addons/slot1_none.cpp b/desmume/src/addons/slot1_none.cpp index f0c0ce557..64876d685 100644 --- a/desmume/src/addons/slot1_none.cpp +++ b/desmume/src/addons/slot1_none.cpp @@ -1,25 +1,23 @@ -/* Copyright (C) 2010-2011 DeSmuME team +/* + Copyright (C) 2010-2012 DeSmuME team - This file is part of DeSmuME + 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 + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. - DeSmuME is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - DeSmuME is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with the this software. If not, see . */ #include "../slot1.h" -static void slot1_info(char *info) { strcpy(info, "Slot1 no-card emulation (card ejected!)"); } +static void slot1_info(char *info) { strcpy(info, "Slot1 no-card emulation"); } static void slot1_config(void) {} static BOOL slot1_init() { return (TRUE); } diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index 513a09055..a3a3e78d3 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -18,6 +18,8 @@ along with the this software. If not, see . */ +//MUST SAVE ADDONS! OMG HOW DID WE FORGET THAT + #ifdef HAVE_LIBZ #include #endif diff --git a/desmume/src/slot1.cpp b/desmume/src/slot1.cpp index 28654edb9..79685d1f1 100644 --- a/desmume/src/slot1.cpp +++ b/desmume/src/slot1.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2010-2011 DeSmuME team + Copyright (C) 2010-2012 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 @@ -20,6 +20,7 @@ #include "types.h" #include "slot1.h" +#include "NDSSystem.h" #include "emufile.h" #include "utils/vfat.h" @@ -84,6 +85,7 @@ void slot1Reset() BOOL slot1Change(NDS_SLOT1_TYPE changeToType) { + if(changeToType == slot1_device_type) return FALSE; //nothing to do if (changeToType > NDS_SLOT1_COUNT || changeToType < 0) return FALSE; slot1_device.close(); slot1_device_type = changeToType; @@ -91,6 +93,8 @@ BOOL slot1Change(NDS_SLOT1_TYPE changeToType) if (changeToType == NDS_SLOT1_R4) scanDir(); printf("Slot 1: %s\n", slot1_device.name); + printf("sending eject signal to SLOT-1\n"); + NDS_TriggerCardEjectIRQ(); return slot1_device.init(); } diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 9ee5b1b15..f4994a0ca 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -3993,7 +3993,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM DesEnableMenuItem(mainMenu, IDM_QUICK_PRINTSCREEN, romloaded); DesEnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, romloaded); DesEnableMenuItem(mainMenu, IDM_FILE_RECORDWAV, romloaded); - DesEnableMenuItem(mainMenu, IDM_EJECTCARD, romloaded && movieMode == MOVIEMODE_INACTIVE); DesEnableMenuItem(mainMenu, IDM_RESET, romloaded && !(movieMode == MOVIEMODE_PLAY && movie_readonly)); DesEnableMenuItem(mainMenu, IDM_CLOSEROM, romloaded); DesEnableMenuItem(mainMenu, IDM_SHUT_UP, romloaded); @@ -4032,7 +4031,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM //emulation menu MainWindow->checkMenu(IDM_PAUSE, ((paused))); - MainWindow->checkMenu(IDM_EJECTCARD, nds.cardEjected != FALSE); // LCDs layout MainWindow->checkMenu(ID_LCDS_VERTICAL, ((video.layout==0))); @@ -5350,10 +5348,6 @@ DOKEYDOWN: } break; - case IDM_EJECTCARD: - NDS_ToggleCardEject(); - return 0; - case IDM_RESET: ResetGame(); return 0; diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index 1cb6a0b9f..0f22df284 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -47,6 +47,7 @@ #define IDM_SBG1 125 #define IDD_IMPORT_SAVE_SIZE 125 #define IDM_SBG2 126 +#define IDD_SLOT1CONFIG 126 #define IDM_SBG3 127 #define IDM_OAM 128 #define IDM_PRINTSCREEN 129 @@ -383,6 +384,7 @@ #define IDC_PIANO_CS 1034 #define IDC_BBROWSE 1035 #define IDC_PIANO_D 1035 +#define IDC_ADDONS_INFO2 1035 #define IDC_PATHIMG 1036 #define IDC_PIANO_DS 1036 #define IDC_PATH 1037 @@ -872,7 +874,6 @@ #define ID_RAMSEARCH_CAPTIONTEXT 40064 #define IDM_VIEW3D 40065 #define IDM_LOCKDOWN 40066 -#define IDM_EJECTCARD 40068 #define IDM_SHOWTOOLBAR 40069 #define ID_CONFIG_DISPLAYMETHOD 40070 #define ID_DISPLAYMETHOD_DIRECTDRAWHW 40071 @@ -1004,7 +1005,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 125 +#define _APS_NEXT_RESOURCE_VALUE 127 #define _APS_NEXT_COMMAND_VALUE 40102 #define _APS_NEXT_CONTROL_VALUE 1053 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 2b12aff10..e36975e58 100644 Binary files a/desmume/src/windows/resources.rc and b/desmume/src/windows/resources.rc differ diff --git a/desmume/src/windows/slot1_config.cpp b/desmume/src/windows/slot1_config.cpp index 8342d901e..a72b643f1 100644 --- a/desmume/src/windows/slot1_config.cpp +++ b/desmume/src/windows/slot1_config.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2011 DeSmuME team + Copyright (C) 2011-2012 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 @@ -140,12 +140,13 @@ BOOL CALLBACK Slot1Box_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam) case IDOK: { int Msg = IDYES; - if (romloaded && (needReset_slot1 || (temp_type_slot1!=slot1_device_type)) ) - { - Msg = MessageBox(dialog, - "After change slot1 device game will reset!\nAre you sure to continue?", "DeSmuME", - MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); - } + //zero 30-aug-2012 - do we really need to reset whenever we change the slot 1 device? why should resetting matter? if thats what you want to do, then do it. + //if (romloaded && (needReset_slot1 || (temp_type_slot1!=slot1_device_type)) ) + //{ + // Msg = MessageBox(dialog, + // "After change slot1 device game will reset!\nAre you sure to continue?", "DeSmuME", + // MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); + //} if (Msg == IDYES) { if (wndConfigSlot1) DestroyWindow(wndConfigSlot1); @@ -194,7 +195,7 @@ void slot1Dialog(HWND hwnd) last_type_slot1 = temp_type_slot1; _OKbutton_slot1 = false; needReset_slot1 = true; - u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_GBASLOT), hwnd, (DLGPROC)Slot1Box_Proc); + u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_SLOT1CONFIG), hwnd, (DLGPROC)Slot1Box_Proc); if (res) { switch (temp_type_slot1) @@ -222,8 +223,9 @@ void slot1Dialog(HWND hwnd) WritePrivateProfileInt("Slot1","type",temp_type_slot1,IniName); slot1Change((NDS_SLOT1_TYPE)temp_type_slot1); - if (romloaded && needReset_slot1) - NDS_Reset(); + //zero 30-aug-2012 + //if (romloaded && needReset_slot1) + // NDS_Reset(); return; } } \ No newline at end of file