diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index d15db4c54..620f81536 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -2639,9 +2639,6 @@ void NDS_Reset() } - // Write the header checksum to memory (the firmware needs it to see the cart) - _MMU_write16(0x027FF808, T1ReadWord(MMU.CART_ROM, 0x15E)); - //-------------------------------- //setup the homebrew argv //this is useful for nitrofs apps which are emulating themselves via cflash diff --git a/desmume/src/addons/slot1_none.cpp b/desmume/src/addons/slot1_none.cpp index 64876d685..004c34dba 100644 --- a/desmume/src/addons/slot1_none.cpp +++ b/desmume/src/addons/slot1_none.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2010-2012 DeSmuME team + Copyright (C) 2010-2013 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 @@ -16,13 +16,19 @@ */ #include "../slot1.h" +#include "../registers.h" +#include "../MMU.h" static void slot1_info(char *info) { strcpy(info, "Slot1 no-card emulation"); } static void slot1_config(void) {} static BOOL slot1_init() { return (TRUE); } -static void slot1_reset() {} +static void slot1_reset() +{ + // Write the header checksum to memory (the firmware needs it to see the cart) + _MMU_write16(0x027FF808, 0); +} static void slot1_close() {} @@ -41,6 +47,8 @@ static u16 slot1_read16(u8 PROCNUM, u32 adr) } static u32 slot1_read32(u8 PROCNUM, u32 adr) { + if (adr == REG_GCDATAIN && MMU.dscard[PROCNUM].command[0] == 0xB8) + return 0; return 0xFFFFFFFF; } diff --git a/desmume/src/addons/slot1_r4.cpp b/desmume/src/addons/slot1_r4.cpp index 31285f0ba..f2470eac5 100644 --- a/desmume/src/addons/slot1_r4.cpp +++ b/desmume/src/addons/slot1_r4.cpp @@ -1,20 +1,18 @@ -/* Copyright (C) 2010-2011 DeSmuME team +/* + Copyright (C) 2010-2013 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 @@ -51,6 +49,8 @@ static BOOL init() } static void reset() { + // Write the header checksum to memory (the firmware needs it to see the cart) + _MMU_write16(0x027FF808, T1ReadWord(MMU.CART_ROM, 0x15E)); init_r4_flash(); } diff --git a/desmume/src/addons/slot1_retail.cpp b/desmume/src/addons/slot1_retail.cpp index a3ea9eff0..9c462144c 100644 --- a/desmume/src/addons/slot1_retail.cpp +++ b/desmume/src/addons/slot1_retail.cpp @@ -1,20 +1,18 @@ -/* Copyright (C) 2010-2011 DeSmuME team +/* + Copyright (C) 2010-2013 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" @@ -27,7 +25,11 @@ static void config(void) {} static BOOL init() { return (TRUE); } -static void reset() {} +static void reset() +{ + // Write the header checksum to memory (the firmware needs it to see the cart) + _MMU_write16(0x027FF808, T1ReadWord(MMU.CART_ROM, 0x15E)); +} static void close() {} diff --git a/desmume/src/addons/slot1_retail_nand.cpp b/desmume/src/addons/slot1_retail_nand.cpp index 197ae5ea1..3e9e30629 100644 --- a/desmume/src/addons/slot1_retail_nand.cpp +++ b/desmume/src/addons/slot1_retail_nand.cpp @@ -1,20 +1,18 @@ -/* Copyright (C) 2011 DeSmuME team +/* + Copyright (C) 2010-2013 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" @@ -27,7 +25,11 @@ static void config(void) {} static BOOL init() { return (TRUE); } -static void reset() {} +static void reset() +{ + // Write the header checksum to memory (the firmware needs it to see the cart) + _MMU_write16(0x027FF808, T1ReadWord(MMU.CART_ROM, 0x15E)); +} static void close() {}