From 79bd9ae0c1043249af4b521c0d96d7ed5c8a1d92 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 27 Oct 2010 01:48:02 +0000 Subject: [PATCH] merge 3814-3816, 3819-3822, 3824, 3831, 3832 to release branch --- desmume/src/GPU.cpp | 6 ++++++ desmume/src/Makefile.am | 1 - desmume/src/armcpu.cpp | 6 ++---- desmume/src/utils/libfat/disc_io.h | 2 -- desmume/src/utils/libfat/fatfile.cpp | 5 ++--- desmume/src/utils/libfat/ndstypes.h | 0 desmume/src/windows/DeSmuME_2005.vcproj | 4 ---- desmume/src/windows/DeSmuME_2008.vcproj | 4 ---- desmume/src/windows/DeSmuME_2010.vcxproj | 9 +++++---- .../src/windows/DeSmuME_2010.vcxproj.filters | 3 --- desmume/src/windows/hotkey.cpp | 13 +++++++++++++ desmume/src/windows/hotkey.h | 1 + desmume/src/windows/ramwatch.cpp | 2 ++ desmume/src/windows/resource.h | 1 + desmume/src/windows/resources.rc | Bin 946662 -> 946748 bytes 15 files changed, 32 insertions(+), 25 deletions(-) delete mode 100644 desmume/src/utils/libfat/ndstypes.h diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index df4944882..f083ec8f9 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -196,6 +196,12 @@ void GPU_Reset(GPU *g, u8 l) { memset(g, 0, sizeof(GPU)); + //important for emulator stability for this to initialize, since we have to setup a table based on it + g->BLDALPHA_EVA = 0; + g->BLDALPHA_EVB = 0; + //make sure we have our blend table setup even if the game blends without setting the blend variables + g->updateBLDALPHA(); + g->setFinalColorBck_funcNum = 0; g->setFinalColor3d_funcNum = 0; g->setFinalColorSpr_funcNum = 0; diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index d3c756d45..e12e4a347 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -74,7 +74,6 @@ libdesmume_a_SOURCES = \ utils/libfat/lock.cpp \ utils/libfat/lock.h \ utils/libfat/mem_allocate.h \ - utils/libfat/ndstypes.h \ utils/libfat/partition.cpp \ utils/libfat/partition.h \ addons.cpp addons.h \ diff --git a/desmume/src/armcpu.cpp b/desmume/src/armcpu.cpp index 3f0750744..79a74177b 100644 --- a/desmume/src/armcpu.cpp +++ b/desmume/src/armcpu.cpp @@ -215,8 +215,6 @@ void armcpu_t::changeCPSR() void armcpu_init(armcpu_t *armcpu, u32 adr) { - u32 i; - armcpu->LDTBit = (armcpu->proc_ID==0); //Si ARM9 utiliser le syte v5 pour le load armcpu->intVector = 0xFFFF0000 * (armcpu->proc_ID==0); armcpu->waitIRQ = FALSE; @@ -227,12 +225,12 @@ void armcpu_init(armcpu_t *armcpu, u32 adr) // armcpu->irq_flag = 0; //#endif - for(i = 0; i < 15; ++i) + for(int i = 0; i < 16; ++i) { armcpu->R[i] = 0; if(armcpu->coproc[i]) free(armcpu->coproc[i]); armcpu->coproc[i] = NULL; - } + } armcpu->CPSR.val = armcpu->SPSR.val = SYS; diff --git a/desmume/src/utils/libfat/disc_io.h b/desmume/src/utils/libfat/disc_io.h index f0e0fa614..2640c634b 100644 --- a/desmume/src/utils/libfat/disc_io.h +++ b/desmume/src/utils/libfat/disc_io.h @@ -30,8 +30,6 @@ #ifndef NDS_DISC_IO_INCLUDE #define NDS_DISC_IO_INCLUDE -#include "ndstypes.h" - #define FEATURE_MEDIUM_CANREAD 0x00000001 #define FEATURE_MEDIUM_CANWRITE 0x00000002 #define FEATURE_SLOT_GBA 0x00000010 diff --git a/desmume/src/utils/libfat/fatfile.cpp b/desmume/src/utils/libfat/fatfile.cpp index 366f0ea43..2e80af7ed 100644 --- a/desmume/src/utils/libfat/fatfile.cpp +++ b/desmume/src/utils/libfat/fatfile.cpp @@ -656,12 +656,9 @@ ssize_t _FAT_write_r (struct _reent *r, intptr_t fd, const char *ptr, size_t len _FAT_lock(&partition->lock); // Only write up to the maximum file size, taking into account wrap-around of ints - // first `len` here was changed from `remain` which was a bug due to being used before being defined. - // this was a blind stab in the dark, I didnt think about it much. need to update this file when it is fixed in libnds trunk if (len + file->filesize > FILE_MAX_SIZE || len + file->filesize < file->filesize) { len = FILE_MAX_SIZE - file->filesize; } - remain = len; // Short circuit cases where len is 0 (or less) if (len <= 0) { @@ -669,6 +666,8 @@ ssize_t _FAT_write_r (struct _reent *r, intptr_t fd, const char *ptr, size_t len return 0; } + remain = len; + // Get a new cluster for the start of the file if required if (file->startCluster == CLUSTER_FREE) { tempNextCluster = _FAT_fat_linkFreeCluster (partition, CLUSTER_FREE); diff --git a/desmume/src/utils/libfat/ndstypes.h b/desmume/src/utils/libfat/ndstypes.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index a8ef21b3c..3f2b3245f 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -1592,10 +1592,6 @@ RelativePath="..\utils\libfat\mem_allocate.h" > - - diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index 8efd2c72f..e29363a78 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -1233,10 +1233,6 @@ RelativePath="..\utils\libfat\mem_allocate.h" > - - diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj b/desmume/src/windows/DeSmuME_2010.vcxproj index 7176dc40a..6b3412a23 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj +++ b/desmume/src/windows/DeSmuME_2010.vcxproj @@ -155,7 +155,9 @@ $(ProjectName)_x64_release $(ProjectName)_x64_dev+ $(ProjectName)_x64_debug - $(ProjectName) + $(ProjectName)_release + $(ProjectName)_dev+ + $(ProjectName)_debug @@ -208,7 +210,7 @@ true true .;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\7z;.\agg\include;.\agg\examples;.\wx\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;EXPERIMENTAL_WIFI_COMM;%(PreprocessorDefinitions) + _CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;%(PreprocessorDefinitions) true Sync Default @@ -254,7 +256,7 @@ true false .;..;lua\include;glib-2.20.1\build;glib-2.20.1\build\glib;.\zlib123;.\zziplib;.\winpcap;userconfig;defaultconfig;.\7z;.\agg\include;.\agg\examples;.\wx\include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;EXPERIMENTAL_WIFI_COMM;%(PreprocessorDefinitions) + _CRT_SECURE_NO_DEPRECATE;GLIB_STATIC_COMPILATION;WIN32;HAVE_LIBZ;NOMINMAX;RELEASE;NDEBUG;FASTBUILD;DEVELOPER;%(PreprocessorDefinitions) true Sync Default @@ -621,7 +623,6 @@ - diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj.filters b/desmume/src/windows/DeSmuME_2010.vcxproj.filters index 77d4e47d1..9cc46b2ca 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj.filters +++ b/desmume/src/windows/DeSmuME_2010.vcxproj.filters @@ -771,9 +771,6 @@ Core\utils - - Core\utils\libfat - Core\utils\libfat diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 778bb9bae..1d9655679 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -21,6 +21,7 @@ #include "hotkey.h" #include "main.h" +#include "CheatsWin.h" #include "NDSSystem.h" #include "saves.h" #include "inputdx.h" @@ -91,6 +92,11 @@ void HK_ReloadROM(int, bool justPressed) void OpenRecentROM(int listNum); OpenRecentROM(0); } +void HK_SearchCheats(int, bool justPressed) +{ + if (romloaded) + CheatsSearchDialog(MainWindow->getHWnd()); +} void HK_QuickScreenShot(int param, bool justPressed) { char buffer[MAX_PATH]; @@ -703,6 +709,13 @@ void InitCustomKeys (SCustomKeys *keys) keys->LCDsSwap.page = HOTKEY_PAGE_MOVIE; keys->LCDsSwap.key = VK_NEXT; + keys->SearchCheats.handleKeyDown = HK_SearchCheats; + keys->SearchCheats.code = "SearchCheats"; + keys->SearchCheats.name = STRW(ID_LABEL_HK54); + keys->SearchCheats.page = HOTKEY_PAGE_MOVIE; + keys->SearchCheats.key = 'S'; + keys->SearchCheats.modifiers = CUSTKEY_CTRL_MASK; + keys->IncreaseVolume.handleKeyDown = HK_IncreaseVolume; keys->IncreaseVolume.code = "IncreaseVolume"; keys->IncreaseVolume.name = STRW(ID_LABEL_HK32); diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index b26efc95b..d041c52ab 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -94,6 +94,7 @@ struct SCustomKeys SCustomKey StylusAutoHold; SCustomKey LCDsMode; SCustomKey LCDsSwap; + SCustomKey SearchCheats; SCustomKey IncreaseVolume; SCustomKey DecreaseVolume; SCustomKey LastItem; // dummy, must be last diff --git a/desmume/src/windows/ramwatch.cpp b/desmume/src/windows/ramwatch.cpp index d8a761ab2..c185e894c 100644 --- a/desmume/src/windows/ramwatch.cpp +++ b/desmume/src/windows/ramwatch.cpp @@ -1077,6 +1077,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam memcpy(&(rswatches[watchIndex]),&(rswatches[watchIndex - 1]),sizeof(AddressWatcher)); memcpy(&(rswatches[watchIndex - 1]),tmp,sizeof(AddressWatcher)); free(tmp); + ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex,0,LVIS_FOCUSED|LVIS_SELECTED); ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1); ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount); @@ -1093,6 +1094,7 @@ LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam memcpy(&(rswatches[watchIndex]),&(rswatches[watchIndex + 1]),sizeof(AddressWatcher)); memcpy(&(rswatches[watchIndex + 1]),tmp,sizeof(AddressWatcher)); free(tmp); + ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex,0,LVIS_FOCUSED|LVIS_SELECTED); ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1); ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount); diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index dd8faa5b1..b64ad3f23 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -770,6 +770,7 @@ #define ID_LABEL_HK51 4515 #define ID_LABEL_HK52 4516 #define ID_LABEL_HK53 4517 +#define ID_LABEL_HK54 4519 #define ID_LABEL_HK13b 4518 #define IDD_MICROPHONE 5000 #define IDM_MICROPHONESETTINGS 5001 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 8e3f902609bee0b2ad65dc131ec5e92a6f7bb072..10993303ed1a7920a184233538fffc323d7cbb01 100644 GIT binary patch delta 102 zcmaF%*mBPk%Z3)l7N!>F7M2#)7Pc1lEgVmdGjdMC`>F7M2#)7Pc1lEgVmdZ{IMHJBg=#&J_+I<^*CcAm#>Qp6zq4 I@Gh7O0O98vVgLXD