From 78af47d32c554c4128bf3de9ff4291f3408c04b9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 1 Jul 2009 14:17:27 +0000 Subject: [PATCH] Win32 - Drag & Drop for cheat (.cht) files --- changelog.txt | 1 + src/drivers/win/window.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 20b45ed5..5c9d6cc9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +01-july-2009 - adelikat - win32 - drag & drop for cheat (.cht) files 25-jun-2009 - qeed - sound/ppu - fixed the noise value, it seems that the noise logic was shifting the values to the left by 1 when reloading, but this doesnt work for PAL since one of the PAL reload value is odd, so fix the logic and used the old tables. Revert a stupid CPU ignore logic in PPU. Sorry about that. 25-jun-2009 - adelikat - Win32 - CD Logger - Drag and Drop for .cdl files 24-jun-2009 - qeed - sound/ppu - reverted to old noise table value since this seems to get correct sound for double diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 49316b47..f0b0d4d7 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -23,6 +23,7 @@ #include "../../input.h" #include "../../state.h" +#include "../../cheat.h" //adelikat: For FCEU_LoadGameCheats() #include "window.h" #include "main.h" #include "state.h" @@ -1254,10 +1255,20 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) DragQueryFile((HDROP)wParam,0,ftmp,len); string fileDropped = ftmp; //adelikat: Drag and Drop only checks file extension, the internal functions are responsible for file error checking + //------------------------------------------------------- - //Check if .fcm file, if so, convert it + //Check if a cheats (.cht) file //------------------------------------------------------- - if (!(fileDropped.find(".fcm") == string::npos) && (fileDropped.find(".fcm") == fileDropped.length()-4)) + if (!(fileDropped.find(".cht") == string::npos) && (fileDropped.find(".cht") == fileDropped.length()-4)) + { + FILE* file = FCEUD_UTF8fopen(fileDropped.c_str(),"rb"); + FCEU_LoadGameCheats(file); + } + + //------------------------------------------------------- + //Check if .fcm file, if so, convert it and play the resulting .fm2 + //------------------------------------------------------- + else if (!(fileDropped.find(".fcm") == string::npos) && (fileDropped.find(".fcm") == fileDropped.length()-4)) { //produce output filename std::string outname;