Project64: Code clean up

This commit is contained in:
zilmar 2022-09-21 14:46:07 +09:30
parent a2981ff4d8
commit a65086579f
108 changed files with 3500 additions and 3311 deletions

View File

@ -1,7 +1,8 @@
#include "stdafx.h" #include "stdafx.h"
#include <io.h>
#include "PluginList.h" #include "PluginList.h"
#include <Project64-core/Plugins/PluginBase.h> #include <Project64-core/Plugins/PluginBase.h>
#include <io.h>
CPluginList::CPluginList(bool bAutoFill /* = true */) : CPluginList::CPluginList(bool bAutoFill /* = true */) :
m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "") m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "")

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "UISettings.h" #include "UISettings.h"
#include <Project64-core/Settings/SettingType/SettingsType-Application.h> #include <Project64-core/Settings/SettingType/SettingsType-Application.h>
#include <Project64-core/Settings/SettingType/SettingsType-ApplicationIndex.h> #include <Project64-core/Settings/SettingType/SettingsType-ApplicationIndex.h>

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include <Project64\UserInterface\About.h> #include <Project64\UserInterface\About.h>
CAboutDlg::CAboutDlg(CProjectSupport & Support) : CAboutDlg::CAboutDlg(CProjectSupport & Support) :
@ -66,7 +67,6 @@ void CAboutDlg::SetWindowDetais(int nIDDlgItem, int nAboveIDDlgItem, const wchar
Wnd.SetWindowPos(nullptr, rcWin.left, Top, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOOWNERZORDER); Wnd.SetWindowPos(nullptr, rcWin.left, Top, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOOWNERZORDER);
} }
LRESULT CAboutDlg::OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL & /*bHandled*/) LRESULT CAboutDlg::OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL & /*bHandled*/)
{ {
HDC hdcStatic = (HDC)wParam; HDC hdcStatic = (HDC)wParam;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64-core/N64System/Enhancement/Enhancements.h> #include <Project64-core/N64System/Enhancement/Enhancements.h>
CCheatsUI::CCheatsUI(void) : CCheatsUI::CCheatsUI(void) :

View File

@ -1,10 +1,10 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "stdafx.h" #include "stdafx.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Assembler.h" #include "Assembler.h"
#include "Project64-core/N64System/Mips/R4300iOpcode.h" #include "Project64-core/N64System/Mips/R4300iOpcode.h"

View File

@ -1,10 +1,10 @@
#include "stdafx.h" #include "stdafx.h"
#include "Breakpoints.h"
#include <Project64-core/N64System/Mips/Register.h> #include "Breakpoints.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/R4300iInstruction.h> #include <Project64-core/N64System/Mips/R4300iInstruction.h>
#include <Project64-core/N64System/Mips/Register.h>
#include <Project64-core/N64System/N64System.h> #include <Project64-core/N64System/N64System.h>
#include <Project64-core/N64System/SystemGlobals.h>
CBreakpoints::CBreakpoints() : CBreakpoints::CBreakpoints() :
m_bHaveRegBP(false), m_bHaveRegBP(false),

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "CPULog.h" #include "CPULog.h"
#include <Project64-core/N64System/Mips/R4300iInstruction.h> #include <Project64-core/N64System/Mips/R4300iInstruction.h>

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdafx.h>
typedef struct typedef struct
{ {
uint32_t pc; uint32_t pc;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DMALog.h" #include "DMALog.h"
void CDMALog::AddEntry(uint32_t romAddr, uint32_t ramAddr, uint32_t length) void CDMALog::AddEntry(uint32_t romAddr, uint32_t ramAddr, uint32_t length)

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdafx.h>
struct DMALOGENTRY struct DMALOGENTRY
{ {
uint32_t romAddr; uint32_t romAddr;

View File

@ -1,4 +1,4 @@
#include <stdafx.h> #include "stdafx.h"
#include "DebugMMU.h" #include "DebugMMU.h"
#include <Common/MemoryManagement.h> #include <Common/MemoryManagement.h>

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
class CDebugMMU class CDebugMMU
{ {

View File

@ -1,6 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h"
#include "CPULog.h" #include "CPULog.h"
#include "DebuggerUI.h"
#include "Debugger-CPULogView.h" #include "Debugger-CPULogView.h"
#include <Project64-core/N64System/Mips/R4300iInstruction.h> #include <Project64-core/N64System/Mips/R4300iInstruction.h>

View File

@ -1,6 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
#include "DebuggerUI.h" #include "DebuggerUI.h"
class CDebugCPULogView : class CDebugCPULogView :

View File

@ -1,10 +1,11 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include "Symbols.h"
#include "Breakpoints.h"
#include "Assembler.h" #include "Assembler.h"
#include "Breakpoints.h"
#include "OpInfo.h" #include "OpInfo.h"
#include "Symbols.h"
#include <Project64-core/N64System/Mips/R4300iInstruction.h> #include <Project64-core/N64System/Mips/R4300iInstruction.h>
@ -737,7 +738,8 @@ LRESULT CDebugCommandsView::OnCustomDrawList(NMHDR* pNMHDR)
R4300iOpcode & OpCode = OpInfo.m_OpCode; R4300iOpcode & OpCode = OpInfo.m_OpCode;
bool bAddrOkay = m_Debugger->DebugLoad_VAddr(address, OpCode.Value); bool bAddrOkay = m_Debugger->DebugLoad_VAddr(address, OpCode.Value);
struct { struct
{
COLORREF bg; COLORREF bg;
COLORREF fg; COLORREF fg;
} colors; } colors;

View File

@ -1,6 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h"
#include "DMALog.h" #include "DMALog.h"
#include "DebuggerUI.h"
#include <fstream> #include <fstream>
CDebugDMALogView::CDebugDMALogView(CDebuggerUI * debugger) : CDebugDMALogView::CDebugDMALogView(CDebuggerUI * debugger) :
@ -354,7 +355,6 @@ LRESULT CDebugDMALogView::OnRomAddrChanged(WORD /*wNotifyCode*/, WORD /*wID*/, H
return FALSE; return FALSE;
} }
LRESULT CDebugDMALogView::OnCustomDrawList(NMHDR * pNMHDR) LRESULT CDebugDMALogView::OnCustomDrawList(NMHDR * pNMHDR)
{ {
NMLVCUSTOMDRAW * pLVCD = reinterpret_cast<NMLVCUSTOMDRAW *>(pNMHDR); NMLVCUSTOMDRAW * pLVCD = reinterpret_cast<NMLVCUSTOMDRAW *>(pNMHDR);

View File

@ -1,6 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
#include "DebuggerUI.h" #include "DebuggerUI.h"
class CDebugDMALogView : class CDebugDMALogView :

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
CDebugExcBreakpoints::ExcCheckboxMeta CDebugExcBreakpoints::ExcCheckboxMap[] = { CDebugExcBreakpoints::ExcCheckboxMeta CDebugExcBreakpoints::ExcCheckboxMap[] = {

View File

@ -1,6 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
#include "DebuggerUI.h" #include "DebuggerUI.h"

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include "MemoryScanner.h" #include "MemoryScanner.h"
@ -2063,11 +2064,21 @@ void CDebugMemorySearch::LoadWatchList(void)
char *szAddrType, *szAddress, *szValueType, *szDisplayFormat, *szDescription; char *szAddrType, *szAddress, *szValueType, *szDisplayFormat, *szDescription;
szAddrType = p; p = strchr(p, ','); *p++ = '\0'; szAddrType = p;
szAddress = p; p = strchr(p, ','); *p++ = '\0'; p = strchr(p, ',');
szValueType = p; p = strchr(p, ','); *p++ = '\0'; *p++ = '\0';
szDisplayFormat = p; p = strchr(p, ','); *p++ = '\0'; szAddress = p;
szDescription = p; p = strchr(p, '\n'); *p++ = '\0'; p = strchr(p, ',');
*p++ = '\0';
szValueType = p;
p = strchr(p, ',');
*p++ = '\0';
szDisplayFormat = p;
p = strchr(p, ',');
*p++ = '\0';
szDescription = p;
p = strchr(p, '\n');
*p++ = '\0';
switch (szAddrType[0]) switch (szAddrType[0])
{ {
@ -2122,7 +2133,6 @@ void CDebugMemorySearch::LoadWatchList(void)
parse_error: parse_error:
delete[] szWlFile; delete[] szWlFile;
} }
void CDebugMemorySearch::FixListHeader(CListViewCtrl & listCtrl) void CDebugMemorySearch::FixListHeader(CListViewCtrl & listCtrl)
@ -2517,7 +2527,6 @@ bool CEditMixed::GetValueHexString(const wchar_t*& value, int& length)
return false; return false;
} }
char * hexString = new char[numBytes]; char * hexString = new char[numBytes];
wchar_t * wchexString = new wchar_t[numBytes]; wchar_t * wchexString = new wchar_t[numBytes];

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "stdafx.h"
struct FieldPair struct FieldPair
{ {

View File

@ -631,7 +631,6 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L
HWND hWnd = (HWND)lParam; HWND hWnd = (HWND)lParam;
WORD ctrlId = (WORD)::GetWindowLong(hWnd, GWL_ID); WORD ctrlId = (WORD)::GetWindowLong(hWnd, GWL_ID);
HDC hdc = (HDC)wParam; HDC hdc = (HDC)wParam;
COLORREF colorRead = RGB(200, 200, 255); COLORREF colorRead = RGB(200, 200, 255);
@ -827,7 +826,8 @@ void CRegisterTabs::ZeroRegisterEdits64(CEditReg64* edits, uint32_t ctrlIdsCount
} }
} }
void CRegisterTabs::CopyTabRegisters() { void CRegisterTabs::CopyTabRegisters()
{
int nPage = GetCurSel(); int nPage = GetCurSel();
stdstr str = CopyTabRegisters(nPage); stdstr str = CopyTabRegisters(nPage);
@ -840,9 +840,11 @@ void CRegisterTabs::CopyTabRegisters() {
CloseClipboard(); CloseClipboard();
} }
void CRegisterTabs::CopyAllRegisters() { void CRegisterTabs::CopyAllRegisters()
{
stdstr str; stdstr str;
for (int i = 0; i <= 12; i++) { for (int i = 0; i <= 12; i++)
{
if (!str.empty()) str += "\r\n"; if (!str.empty()) str += "\r\n";
str += CopyTabRegisters(i); str += CopyTabRegisters(i);
} }

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
CDebugScripts::CDebugScripts(CDebuggerUI * debugger) : CDebugScripts::CDebugScripts(CDebuggerUI * debugger) :
@ -440,9 +441,8 @@ LRESULT CDebugScripts::OnRefreshList(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
} }
} while (searchPath.FindNext()); } while (searchPath.FindNext());
fileNames.sort([](stdstr a, stdstr b) { fileNames.sort([](stdstr a, stdstr b)
return a.ToLower() < b.ToLower(); { return a.ToLower() < b.ToLower(); });
});
m_ScriptList.SetRedraw(false); m_ScriptList.SetRedraw(false);
m_ScriptList.DeleteAllItems(); m_ScriptList.DeleteAllItems();

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include <sstream> #include <sstream>
@ -69,7 +70,6 @@ LRESULT CScriptsAutorunDlg::OnOKCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND
return 0; return 0;
} }
LRESULT CScriptsAutorunDlg::OnAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL & /*bHandled*/) LRESULT CScriptsAutorunDlg::OnAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL & /*bHandled*/)
{ {
m_bScriptListNeedsRefocus = true; m_bScriptListNeedsRefocus = true;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include "Symbols.h" #include "Symbols.h"

View File

@ -1,8 +1,9 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include <stdio.h>
#include <Common/path.h> #include <Common/path.h>
#include <stdio.h>
#include "Symbols.h" #include "Symbols.h"

View File

@ -1,12 +1,13 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64-core/ExceptionHandler.h>
#include <Common/MemoryManagement.h> #include <Common/MemoryManagement.h>
#include <Project64-core/ExceptionHandler.h>
#include <UserInterface/WTLControls/HexEditCtrl.h> #include <UserInterface/WTLControls/HexEditCtrl.h>
#include "DMALog.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include "Symbols.h" #include "Symbols.h"
#include "DMALog.h"
CDebugMemoryView::jump_item_t CDebugMemoryView::JumpItems[] = { CDebugMemoryView::jump_item_t CDebugMemoryView::JumpItems[] = {
{0x80000000, 0x00000000, 0x0800000, "RDRAM"}, {0x80000000, 0x00000000, 0x0800000, "RDRAM"},
@ -217,7 +218,6 @@ void CDebugMemoryView::FollowPointer(bool bContextMenuAddress)
} }
} }
void CDebugMemoryView::JumpToSelection(void) void CDebugMemoryView::JumpToSelection(void)
{ {
uint32_t startAddress, endAddress; uint32_t startAddress, endAddress;
@ -1005,7 +1005,6 @@ LRESULT CDebugMemoryView::OnHxPaste(LPNMHDR lpNMHDR)
return retDataLength; return retDataLength;
} }
LRESULT CDebugMemoryView::OnTabSelChange(LPNMHDR /*lpNMHDR*/) LRESULT CDebugMemoryView::OnTabSelChange(LPNMHDR /*lpNMHDR*/)
{ {
TabSelChanged(); TabSelChanged();

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "DebuggerUI.h" #include "DebuggerUI.h"
#include "CPULog.h" #include "CPULog.h"

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "MemoryScanner.h" #include "MemoryScanner.h"
CMixed::TypeNameEntry CMixed::TypeNames[] = { CMixed::TypeNameEntry CMixed::TypeNames[] = {
@ -599,7 +600,6 @@ uint8_t* CMemoryScanner::GetMemoryPool(uint32_t physAddr)
{ {
return nullptr; return nullptr;
} }
} }
bool CMemoryScanner::SetValueType(ValueType type) bool CMemoryScanner::SetValueType(ValueType type)
@ -976,7 +976,6 @@ bool CMemoryScanner::NextScan()
return true; return true;
} }
int CMemoryScanner::HexDigitVal(char c) int CMemoryScanner::HexDigitVal(char c)
{ {
if (c >= '0' && c <= '9') return (c - '0'); if (c >= '0' && c <= '9') return (c - '0');

View File

@ -1,6 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
#include <string> #include <string>
enum ValueType enum ValueType

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdafx.h>
#include <Project64-core/N64System/Mips/R4300iOpcode.h> #include <Project64-core/N64System/Mips/R4300iOpcode.h>
class COpInfo class COpInfo

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "JSIntervalWorker.h"
#include "../ScriptInstance.h" #include "../ScriptInstance.h"
#include "JSIntervalWorker.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
CJSIntervalWorker::CJSIntervalWorker(CScriptInstance * inst, void * dukObjectHeapPtr, int delayMS, bool bOnce) : CJSIntervalWorker::CJSIntervalWorker(CScriptInstance * inst, void * dukObjectHeapPtr, int delayMS, bool bOnce) :

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "JSServerWorker.h" #include "JSServerWorker.h"
#include "JSSocketWorker.h" #include "JSSocketWorker.h"

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "JSSocketWorker.h" #include "JSSocketWorker.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
@ -365,12 +366,14 @@ void CJSSocketWorker::UpdateAddresses()
sockaddr * pLocalAddr = nullptr; sockaddr * pLocalAddr = nullptr;
sockaddr * pRemoteAddr = nullptr; sockaddr * pRemoteAddr = nullptr;
union { union
{
sockaddr_in ipv4; sockaddr_in ipv4;
sockaddr_in6 ipv6; sockaddr_in6 ipv6;
} localAddr; } localAddr;
union { union
{
sockaddr_in ipv4; sockaddr_in ipv4;
sockaddr_in6 ipv6; sockaddr_in6 ipv6;
} remoteAddr; } remoteAddr;

View File

@ -1,7 +1,9 @@
#include <stdafx.h> #include "stdafx.h"
#include "N64Image.h" #include "N64Image.h"
struct ImgFormatInfo { struct ImgFormatInfo
{
int bitsPerPixel; int bitsPerPixel;
int paletteColorCount; int paletteColorCount;
}; };

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
#include "ScriptAPI.h" #include "ScriptAPI.h"
enum { enum {

View File

@ -1,10 +1,12 @@
#include <stdafx.h> #include "stdafx.h"
#include <3rdParty/png/png.h>
#include "N64Image.h" #include "N64Image.h"
#include <3rdParty/png/png.h>
#pragma warning(disable : 4611) // disable setjmp/c++ deconstruction warning #pragma warning(disable : 4611) // disable setjmp/c++ deconstruction warning
struct PNGReadState { struct PNGReadState
{
uint8_t * pngData; uint8_t * pngData;
size_t pngSize; size_t pngSize;
png_size_t offset; png_size_t offset;

View File

@ -1,7 +1,8 @@
#include <stdafx.h> #include "stdafx.h"
#include <dwrite.h>
#include "ScriptAPI.h"
#include "N64Image.h" #include "N64Image.h"
#include "ScriptAPI.h"
#include <dwrite.h>
#pragma warning(disable : 4702) // disable unreachable code warning #pragma warning(disable : 4702) // disable unreachable code warning
@ -975,8 +976,7 @@ const char* ScriptAPI::ArgTypeName(ArgType argType)
{Arg_Function, "function"}, {Arg_Function, "function"},
{Arg_Object, "object"}, {Arg_Object, "object"},
{Arg_Array, "array"}, {Arg_Array, "array"},
{ Arg_Boolean, "boolean" } {Arg_Boolean, "boolean"}};
};
if (argTypeNames.count(argType) == 0) if (argTypeNames.count(argType) == 0)
{ {

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
#pragma warning(disable : 4702) // disable unreachable code warning #pragma warning(disable : 4702) // disable unreachable code warning
@ -17,7 +18,11 @@ void ScriptAPI::Define_AddressRange(duk_context* ctx)
DefineGlobalClass(ctx, "AddressRange", js_AddressRange__constructor, prototype); DefineGlobalClass(ctx, "AddressRange", js_AddressRange__constructor, prototype);
struct { const char* key; uint32_t start, end; } ranges[] = { struct
{
const char * key;
uint32_t start, end;
} ranges[] = {
{"ADDR_ANY", 0x00000000, 0xFFFFFFFF}, {"ADDR_ANY", 0x00000000, 0xFFFFFFFF},
{"ADDR_ANY_KUSEG", 0x00000000, 0x7FFFFFFF}, {"ADDR_ANY_KUSEG", 0x00000000, 0x7FFFFFFF},
{"ADDR_ANY_KSEG0", 0x80000000, 0x9FFFFFFF}, {"ADDR_ANY_KSEG0", 0x80000000, 0x9FFFFFFF},
@ -108,7 +113,8 @@ duk_ret_t ScriptAPI::js_AddressRange_offset(duk_context* ctx)
duk_push_this(ctx); duk_push_this(ctx);
GetRange(ctx, -1, &start, &end); GetRange(ctx, -1, &start, &end);
if (address < start || address > end) { if (address < start || address > end)
{
duk_push_error_object(ctx, DUK_ERR_RANGE_ERROR, "address out of bounds"); duk_push_error_object(ctx, DUK_ERR_RANGE_ERROR, "address out of bounds");
return duk_throw(ctx); return duk_throw(ctx);
} }
@ -129,7 +135,8 @@ duk_ret_t ScriptAPI::js_AddressRange_address(duk_context* ctx)
duk_uint_t address = start + offset; duk_uint_t address = start + offset;
if (address < start || address > end) { if (address < start || address > end)
{
duk_push_error_object(ctx, DUK_ERR_RANGE_ERROR, "offset out of bounds"); duk_push_error_object(ctx, DUK_ERR_RANGE_ERROR, "offset out of bounds");
return duk_throw(ctx); return duk_throw(ctx);
} }

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "N64Image.h" #include "N64Image.h"
#include "ScriptAPI.h"
#pragma warning(disable : 4702) // disable unreachable code warning #pragma warning(disable : 4702) // disable unreachable code warning

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
void ScriptAPI::Define_Number_prototype_hex(duk_context * ctx) void ScriptAPI::Define_Number_prototype_hex(duk_context * ctx)

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "JSServerWorker.h" #include "JSServerWorker.h"
#include "ScriptAPI.h"
static CJSServerWorker * GetThisServer(duk_context * ctx); static CJSServerWorker * GetThisServer(duk_context * ctx);
@ -34,12 +35,7 @@ duk_ret_t ScriptAPI::js_Server__constructor(duk_context* ctx)
duk_push_this(ctx); duk_push_this(ctx);
void * objectHeapPtr = duk_get_heapptr(ctx, -1); void * objectHeapPtr = duk_get_heapptr(ctx, -1);
InitEmitter(ctx, -1, { InitEmitter(ctx, -1, {"close", "connection", "error", "listening"});
"close",
"connection",
"error",
"listening"
});
duk_push_c_function(ctx, js_Server__finalizer, 1); duk_push_c_function(ctx, js_Server__finalizer, 1);
duk_set_finalizer(ctx, -2); duk_set_finalizer(ctx, -2);

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "JSSocketWorker.h" #include "JSSocketWorker.h"
#include "ScriptAPI.h"
#pragma warning(disable : 4702) // disable unreachable code warning #pragma warning(disable : 4702) // disable unreachable code warning
@ -55,15 +56,7 @@ duk_ret_t ScriptAPI::js_Socket__constructor(duk_context* ctx)
duk_push_this(ctx); duk_push_this(ctx);
void * objectHeapPtr = duk_get_heapptr(ctx, -1); void * objectHeapPtr = duk_get_heapptr(ctx, -1);
InitEmitter(ctx, -1, { InitEmitter(ctx, -1, {"data", "end", "connect", "error", "close", "drain", "lookup"});
"data",
"end",
"connect",
"error",
"close",
"drain",
"lookup"
});
duk_push_uint(ctx, 0); duk_push_uint(ctx, 0);
duk_put_prop_string(ctx, -2, HS_socketNextWriteCallbackId); duk_put_prop_string(ctx, -2, HS_socketNextWriteCallbackId);

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include <windows.h>
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <windows.h>
void ScriptAPI::Define_alert(duk_context * ctx) void ScriptAPI::Define_alert(duk_context * ctx)
{ {

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "../Assembler.h" #include "../Assembler.h"
#include "ScriptAPI.h"
#include <Project64-core/N64System/Mips/R4300iInstruction.h> #include <Project64-core/N64System/Mips/R4300iInstruction.h>
void ScriptAPI::Define_asm(duk_context * ctx) void ScriptAPI::Define_asm(duk_context * ctx)

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include <windows.h>
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <windows.h>
static void ConcatArgs(duk_context * ctx, stdstr & out); static void ConcatArgs(duk_context * ctx, stdstr & out);

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <Project64-core/N64System/Mips/Register.h> #include <Project64-core/N64System/Mips/Register.h>
@ -28,7 +29,8 @@ void ScriptAPI::Define_cpu(duk_context* ctx)
{ nullptr, nullptr, 0 } \ { nullptr, nullptr, 0 } \
} }
const struct { const struct
{
const char * key; const char * key;
const duk_function_list_entry functions[3]; const duk_function_list_entry functions[3];
} proxies[] = { } proxies[] = {
@ -410,7 +412,8 @@ static uint32_t* COP0RegPtr(const char *regName)
return nullptr; return nullptr;
} }
struct { struct
{
const char * name; const char * name;
uint32_t * ptr; uint32_t * ptr;
} names[] = { } names[] = {

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <Project64-core/Settings/DebugSettings.h> #include <Project64-core/Settings/DebugSettings.h>

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "../OpInfo.h" #include "../OpInfo.h"
#include "ScriptAPI.h"
#pragma warning(disable : 4702) // disable unreachable code warning #pragma warning(disable : 4702) // disable unreachable code warning
@ -404,7 +405,8 @@ duk_idx_t CbArgs_ReadEventObject(duk_context* ctx, void* _env)
DukPutPropList(ctx, -1, props); DukPutPropList(ctx, -1, props);
union { union
{
uint8_t u8; uint8_t u8;
int8_t s8; int8_t s8;
uint16_t u16; uint16_t u16;

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include <windows.h>
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <windows.h>
void ScriptAPI::Define_exec(duk_context * ctx) void ScriptAPI::Define_exec(duk_context * ctx)
{ {

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h"
#include "JSIntervalWorker.h" #include "JSIntervalWorker.h"
#include "ScriptAPI.h"
using namespace ScriptAPI; using namespace ScriptAPI;

View File

@ -1,7 +1,8 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <Project64/UserInterface/Debugger/debugger.h>
#include <Project64/UserInterface/Debugger/DebugMMU.h> #include <Project64/UserInterface/Debugger/DebugMMU.h>
#include <Project64/UserInterface/Debugger/debugger.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
@ -269,7 +270,8 @@ duk_ret_t ScriptAPI::js_mem__boundget(duk_context *ctx)
uint32_t addr = duk_get_uint(ctx, 0); uint32_t addr = duk_get_uint(ctx, 0);
duk_int_t type = duk_get_int(ctx, 1); duk_int_t type = duk_get_int(ctx, 1);
union { union
{
uint8_t u8; uint8_t u8;
uint16_t u16; uint16_t u16;
uint32_t u32; uint32_t u32;

View File

@ -1,4 +1,5 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptAPI.h" #include "ScriptAPI.h"
#include <Project64/UserInterface/DiscordRPC.h> #include <Project64/UserInterface/DiscordRPC.h>
#include <Project64/UserInterface/MainWindow.h> #include <Project64/UserInterface/MainWindow.h>

View File

@ -1,10 +1,12 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptTypes.h"
#include "ScriptInstance.h"
#include "ScriptAPI/ScriptAPI.h" #include "ScriptAPI/ScriptAPI.h"
#include "ScriptInstance.h"
#include "ScriptTypes.h"
#include <sys/stat.h> #include <sys/stat.h>
extern "C" { extern "C"
{
int DukTimeoutCheck(void * udata) int DukTimeoutCheck(void * udata)
{ {
CScriptInstance * inst = (CScriptInstance *)udata; CScriptInstance * inst = (CScriptInstance *)udata;
@ -115,7 +117,6 @@ bool CScriptInstance::Run(const char* path)
return true; return true;
error_cleanup: error_cleanup:
Cleanup(); Cleanup();
return false; return false;

View File

@ -1,12 +1,13 @@
#include <stdafx.h> #include "stdafx.h"
#include <sys/stat.h>
#include <sstream>
#include "ScriptTypes.h"
#include "ScriptSystem.h"
#include "ScriptInstance.h"
#include "ScriptAPI/ScriptAPI.h"
#include "Debugger.h" #include "Debugger.h"
#include "Project64\UserInterface\DiscordRPC.h" #include "Project64\UserInterface\DiscordRPC.h"
#include "ScriptAPI/ScriptAPI.h"
#include "ScriptInstance.h"
#include "ScriptSystem.h"
#include "ScriptTypes.h"
#include <sstream>
#include <sys/stat.h>
CScriptSystem::CScriptSystem(CDebuggerUI * debugger) : CScriptSystem::CScriptSystem(CDebuggerUI * debugger) :
m_Debugger(debugger), m_Debugger(debugger),

View File

@ -1,6 +1,7 @@
#include <stdafx.h> #include "stdafx.h"
#include "ScriptWorker.h"
#include "ScriptInstance.h" #include "ScriptInstance.h"
#include "ScriptWorker.h"
CScriptWorker::CScriptWorker(CScriptInstance * instance, void * dukObjectHeapPtr) : CScriptWorker::CScriptWorker(CScriptInstance * instance, void * dukObjectHeapPtr) :
m_bStopping(false), m_bStopping(false),
@ -21,7 +22,8 @@ CScriptWorker::~CScriptWorker()
} }
} }
DWORD WINAPI CScriptWorker::ThreadProc(void* _this) { DWORD WINAPI CScriptWorker::ThreadProc(void * _this)
{
((CScriptWorker *)_this)->WorkerProc(); ((CScriptWorker *)_this)->WorkerProc();
return 0; return 0;
} }

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Symbols.h" #include "Symbols.h"
CSymbolTable::CSymbolTable(CDebuggerUI * debugger) : CSymbolTable::CSymbolTable(CDebuggerUI * debugger) :
@ -356,21 +357,24 @@ void CSymbolTable::GetValueString(char* dst, CSymbol* symbol)
sprintf(dst, "%f", value.f64); sprintf(dst, "%f", value.f64);
break; break;
case SYM_VECTOR2: case SYM_VECTOR2:
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++)
{
m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32); m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32);
xyzw[i] = value.f32; xyzw[i] = value.f32;
} }
sprintf(dst, "%f, %f", xyzw[0], xyzw[1]); sprintf(dst, "%f, %f", xyzw[0], xyzw[1]);
break; break;
case SYM_VECTOR3: case SYM_VECTOR3:
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++)
{
m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32); m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32);
xyzw[i] = value.f32; xyzw[i] = value.f32;
} }
sprintf(dst, "%f, %f, %f", xyzw[0], xyzw[1], xyzw[2]); sprintf(dst, "%f, %f, %f", xyzw[0], xyzw[1], xyzw[2]);
break; break;
case SYM_VECTOR4: case SYM_VECTOR4:
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++)
{
m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32); m_Debugger->DebugLoad_VAddr(address + (i * sizeof(float)), value.f32);
xyzw[i] = value.f32; xyzw[i] = value.f32;
} }

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "stdafx.h"
class CSymbol; class CSymbol;

View File

@ -1,6 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include <3rdParty\discord-rpc\include\discord_rpc.h>
#include "DiscordRPC.h" #include "DiscordRPC.h"
#include <3rdParty\discord-rpc\include\discord_rpc.h>
#define UNIX_TIME_START 0x019DB1DED53E8000 #define UNIX_TIME_START 0x019DB1DED53E8000
#define TICKS_PER_SECOND 10000000 #define TICKS_PER_SECOND 10000000
@ -27,9 +28,11 @@ static stdstr GetTitle()
bool existsInRdb = g_Settings->LoadStringVal(Rdb_GoodName, Default); bool existsInRdb = g_Settings->LoadStringVal(Rdb_GoodName, Default);
if (existsInRdb) if (existsInRdb)
return g_Settings->LoadStringVal(Rdb_GoodName); return g_Settings->LoadStringVal(Rdb_GoodName);
else { else
{
Default = CPath(g_Settings->LoadStringVal(Game_File)).GetName().c_str(); Default = CPath(g_Settings->LoadStringVal(Game_File)).GetName().c_str();
if (strstr(const_cast<char*>(Default.c_str()), "?") != nullptr) { if (strstr(const_cast<char *>(Default.c_str()), "?") != nullptr)
{
return Default.substr(Default.find("?") + 1); return Default.substr(Default.find("?") + 1);
} }
return Default; return Default;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64\UserInterface\EnhancementUI.h> #include <Project64\UserInterface\EnhancementUI.h>
#include <Project64-core/N64System/Enhancement/Enhancements.h> #include <Project64-core/N64System/Enhancement/Enhancements.h>

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64-core/Logging.h> #include <Project64-core/Logging.h>
#include <Project64-core/Settings/LoggingSettings.h> #include <Project64-core/Settings/LoggingSettings.h>
#include <prsht.h> #include <prsht.h>

View File

@ -1,12 +1,13 @@
#include "stdafx.h" #include "stdafx.h"
#include "RomInformation.h"
#include "Debugger/Breakpoints.h" #include "Debugger/Breakpoints.h"
#include "Debugger/ScriptSystem.h" #include "Debugger/ScriptSystem.h"
#include "DiscordRPC.h" #include "DiscordRPC.h"
#include "RomInformation.h"
#include <Project64-core/N64System/N64Disk.h> #include <Project64-core/N64System/N64Disk.h>
#include <Project64\UserInterface\About.h> #include <Project64\UserInterface\About.h>
#include <windows.h>
#include <commdlg.h> #include <commdlg.h>
#include <windows.h>
CMainMenu::CMainMenu(CMainGui * hMainWindow) : CMainMenu::CMainMenu(CMainGui * hMainWindow) :
CBaseMenu(), CBaseMenu(),
@ -348,7 +349,9 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_BaseSystem->ExternalEvent(g_Settings->LoadBool(GameRunning_CPU_Paused) ? SysEvent_ResumeCPU_FromMenu : SysEvent_PauseCPU_FromMenu); g_BaseSystem->ExternalEvent(g_Settings->LoadBool(GameRunning_CPU_Paused) ? SysEvent_ResumeCPU_FromMenu : SysEvent_PauseCPU_FromMenu);
WriteTrace(TraceUserInterface, TraceDebug, "ID_SYSTEM_PAUSE 1"); WriteTrace(TraceUserInterface, TraceDebug, "ID_SYSTEM_PAUSE 1");
break; break;
case ID_SYSTEM_BITMAP: OnScreenShot(); break; case ID_SYSTEM_BITMAP:
OnScreenShot();
break;
break; break;
case ID_SYSTEM_LIMITFPS: case ID_SYSTEM_LIMITFPS:
WriteTrace(TraceUserInterface, TraceDebug, "ID_SYSTEM_LIMITFPS"); WriteTrace(TraceUserInterface, TraceDebug, "ID_SYSTEM_LIMITFPS");

View File

@ -1,12 +1,13 @@
#include "stdafx.h" #include "stdafx.h"
#include "DiscordRPC.h"
#include "RomInformation.h" #include "RomInformation.h"
#include <Project64\UserInterface\About.h>
#include <commctrl.h>
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
#include <Project64-core/N64System/Enhancement/Enhancements.h> #include <Project64-core/N64System/Enhancement/Enhancements.h>
#include <Project64-core/N64System/N64Disk.h> #include <Project64-core/N64System/N64Disk.h>
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
#include <Project64/UserInterface/Debugger/DebuggerUI.h> #include <Project64/UserInterface/Debugger/DebuggerUI.h>
#include "DiscordRPC.h" #include <Project64\UserInterface\About.h>
#include <commctrl.h>
void EnterLogOptions(HWND hwndOwner); void EnterLogOptions(HWND hwndOwner);
@ -387,8 +388,7 @@ void CMainGui::Caption(LPCWSTR Caption)
void CMainGui::Create(const char * WindowTitle) void CMainGui::Create(const char * WindowTitle)
{ {
stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR); stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
m_hMainWindow = CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.ToUTF16().c_str(), stdstr(WindowTitle).ToUTF16().c_str(), WS_OVERLAPPED | WS_CLIPCHILDREN | m_hMainWindow = CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.ToUTF16().c_str(), stdstr(WindowTitle).ToUTF16().c_str(), WS_OVERLAPPED | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX, 5, 5, 640, 480,
WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX, 5, 5, 640, 480,
nullptr, nullptr, GetModuleHandle(nullptr), this); nullptr, nullptr, GetModuleHandle(nullptr), this);
m_Created = m_hMainWindow != nullptr; m_Created = m_hMainWindow != nullptr;
} }
@ -616,7 +616,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
} }
break; break;
case WM_SYSCOMMAND: case WM_SYSCOMMAND:
switch (wParam) { switch (wParam)
{
case SC_SCREENSAVE: case SC_SCREENSAVE:
case SC_MONITORPOWER: case SC_MONITORPOWER:
{ {
@ -774,7 +775,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
{ {
if (g_BaseSystem) if (g_BaseSystem)
{ {
if (g_Plugins && g_Plugins->Control()->WM_KeyUp) { if (g_Plugins && g_Plugins->Control()->WM_KeyUp)
{
g_Plugins->Control()->WM_KeyUp(wParam, lParam); g_Plugins->Control()->WM_KeyUp(wParam, lParam);
} }
} }
@ -832,7 +834,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_AppLostFocus); g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_AppLostFocus);
} }
if (g_Plugins && g_Plugins->Control()->WM_KillFocus) { if (g_Plugins && g_Plugins->Control()->WM_KillFocus)
{
g_Plugins->Control()->WM_KillFocus(wParam, lParam); g_Plugins->Control()->WM_KillFocus(wParam, lParam);
} }
} }
@ -965,7 +968,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN: case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
if (g_Settings->LoadBool(Debugger_Enabled)) { if (g_Settings->LoadBool(Debugger_Enabled))
{
SetCapture(hWnd); SetCapture(hWnd);
CDebuggerUI * debugger = (CDebuggerUI *)g_Debugger; CDebuggerUI * debugger = (CDebuggerUI *)g_Debugger;
debugger->ScriptSystem()->DoMouseEvent(JS_HOOK_MOUSEDOWN, debugger->ScriptSystem()->DoMouseEvent(JS_HOOK_MOUSEDOWN,
@ -975,7 +979,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
case WM_LBUTTONUP: case WM_LBUTTONUP:
case WM_MBUTTONUP: case WM_MBUTTONUP:
case WM_RBUTTONUP: case WM_RBUTTONUP:
if (g_Settings->LoadBool(Debugger_Enabled)) { if (g_Settings->LoadBool(Debugger_Enabled))
{
ReleaseCapture(); ReleaseCapture();
CDebuggerUI * debugger = (CDebuggerUI *)g_Debugger; CDebuggerUI * debugger = (CDebuggerUI *)g_Debugger;
debugger->ScriptSystem()->DoMouseEvent(JS_HOOK_MOUSEUP, debugger->ScriptSystem()->DoMouseEvent(JS_HOOK_MOUSEUP,
@ -983,7 +988,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
} }
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if (g_Settings->LoadBool(Debugger_Enabled)) { if (g_Settings->LoadBool(Debugger_Enabled))
{
static int lastX = 0; static int lastX = 0;
static int lastY = 0; static int lastY = 0;
int x = GET_X_LPARAM(lParam); int x = GET_X_LPARAM(lParam);
@ -1002,7 +1008,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class"); CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this == nullptr) { break; } if (_this == nullptr) { break; }
switch (LOWORD(wParam)) { switch (LOWORD(wParam))
{
case ID_POPUPMENU_PLAYGAME: case ID_POPUPMENU_PLAYGAME:
{ {
if ((CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd") && (CPath(_this->CurrentedSelectedRom()).GetExtension() != "d64")) if ((CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd") && (CPath(_this->CurrentedSelectedRom()).GetExtension() != "d64"))

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include <time.h> #include <time.h>
CNotificationImp & Notify(void) CNotificationImp & Notify(void)

View File

@ -1,8 +1,9 @@
#include "stdafx.h" #include "stdafx.h"
#include <Common/md5.h> #include <Common/md5.h>
#include <Wininet.h>
#include <time.h> #include <time.h>
#include <windows.h> #include <windows.h>
#include <Wininet.h>
#pragma comment(lib, "Wininet.lib") #pragma comment(lib, "Wininet.lib")

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64/Settings/UISettings.h> #include <Project64/Settings/UISettings.h>
#include <commctrl.h> #include <commctrl.h>

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "RomInformation.h" #include "RomInformation.h"
#include <Project64-core/N64System/N64Disk.h> #include <Project64-core/N64System/N64Disk.h>

View File

@ -64,7 +64,10 @@ void CAdvancedOptionsPage::ApplySettings(bool UpdateScreen)
bool CAdvancedOptionsPage::EnableReset(void) bool CAdvancedOptionsPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CAdvancedOptionsPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CAdvancedOptionsPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h" #include "SettingsPage.h"
CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay) CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay)
@ -89,7 +90,10 @@ void CDefaultsOptionsPage::ApplySettings(bool UpdateScreen)
bool CDefaultsOptionsPage::EnableReset(void) bool CDefaultsOptionsPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CDefaultsOptionsPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CDefaultsOptionsPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -94,35 +94,50 @@ void COptionsDirectoriesPage::SelectDirectory(LanguageStringID Title, CModifiedE
void COptionsDirectoriesPage::PluginDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void COptionsDirectoriesPage::PluginDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_PluginDir.SetChanged(true); m_PluginDir.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void COptionsDirectoriesPage::AutoSaveDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void COptionsDirectoriesPage::AutoSaveDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_AutoSaveDir.SetChanged(true); m_AutoSaveDir.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void COptionsDirectoriesPage::InstantSaveDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void COptionsDirectoriesPage::InstantSaveDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_InstantSaveDir.SetChanged(true); m_InstantSaveDir.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void COptionsDirectoriesPage::SnapShotDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void COptionsDirectoriesPage::SnapShotDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_ScreenShotDir.SetChanged(true); m_ScreenShotDir.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void COptionsDirectoriesPage::TextureDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void COptionsDirectoriesPage::TextureDirChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_TextureDir.SetChanged(true); m_TextureDir.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
@ -312,16 +327,46 @@ void COptionsDirectoriesPage::ApplySettings(bool UpdateScreen)
bool COptionsDirectoriesPage::EnableReset(void) bool COptionsDirectoriesPage::EnableReset(void)
{ {
if (m_PluginDir.IsChanged()) { return true; } if (m_PluginDir.IsChanged())
if (m_AutoSaveDir.IsChanged()) { return true; } {
if (m_InstantSaveDir.IsChanged()) { return true; } return true;
if (m_ScreenShotDir.IsChanged()) { return true; } }
if (m_TextureDir.IsChanged()) { return true; } if (m_AutoSaveDir.IsChanged())
if (m_PluginDefault.IsChanged()) { return true; } {
if (m_AutoSaveDefault.IsChanged()) { return true; } return true;
if (m_InstantDefault.IsChanged()) { return true; } }
if (m_ScreenShotDefault.IsChanged()) { return true; } if (m_InstantSaveDir.IsChanged())
if (m_TextureDefault.IsChanged()) { return true; } {
return true;
}
if (m_ScreenShotDir.IsChanged())
{
return true;
}
if (m_TextureDir.IsChanged())
{
return true;
}
if (m_PluginDefault.IsChanged())
{
return true;
}
if (m_AutoSaveDefault.IsChanged())
{
return true;
}
if (m_InstantDefault.IsChanged())
{
return true;
}
if (m_ScreenShotDefault.IsChanged())
{
return true;
}
if (m_TextureDefault.IsChanged())
{
return true;
}
return false; return false;
} }

View File

@ -74,7 +74,10 @@ void CDiskDrivePage::ApplySettings(bool UpdateScreen)
bool CDiskDrivePage::EnableReset(void) bool CDiskDrivePage::EnableReset(void)
{ {
if (CSettingsPageImpl<CDiskDrivePage>::EnableReset()) { return true; } if (CSettingsPageImpl<CDiskDrivePage>::EnableReset())
{
return true;
}
return false; return false;
} }
@ -100,21 +103,30 @@ void CDiskDrivePage::SelectIplDirTl(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
void CDiskDrivePage::IplDirJpChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void CDiskDrivePage::IplDirJpChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_IplDirJp.SetChanged(true); m_IplDirJp.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void CDiskDrivePage::IplDirUsChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void CDiskDrivePage::IplDirUsChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_IplDirUs.SetChanged(true); m_IplDirUs.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }
void CDiskDrivePage::IplDirTlChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) void CDiskDrivePage::IplDirTlChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{ {
if (m_InUpdateSettings) { return; } if (m_InUpdateSettings)
{
return;
}
m_IplDirTl.SetChanged(true); m_IplDirTl.SetChanged(true);
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
} }

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h"
#include "SettingsPage-Game-DiskDrive.h" #include "SettingsPage-Game-DiskDrive.h"
#include "SettingsPage.h"
CGameDiskDrivePage::CGameDiskDrivePage(HWND hParent, const RECT & rcDispay) CGameDiskDrivePage::CGameDiskDrivePage(HWND hParent, const RECT & rcDispay)
{ {
@ -42,7 +42,10 @@ void CGameDiskDrivePage::ApplySettings(bool UpdateScreen)
bool CGameDiskDrivePage::EnableReset(void) bool CGameDiskDrivePage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGameDiskDrivePage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGameDiskDrivePage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "../WTLControls/ModifiedCheckBox.h" #include "SettingsPage.h"
#include <Project64\UserInterface\WTLControls\ModifiedCheckBox.h>
#include <Project64-core/N64System/N64Types.h> #include <Project64-core/N64System/N64Types.h>
class CGameDiskDrivePage : class CGameDiskDrivePage :

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h"
#include "SettingsPage-Game-General.h" #include "SettingsPage-Game-General.h"
#include "SettingsPage.h"
CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay) CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
{ {
@ -106,7 +106,10 @@ void CGameGeneralPage::ApplySettings(bool UpdateScreen)
bool CGameGeneralPage::EnableReset(void) bool CGameGeneralPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGameGeneralPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGameGeneralPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,7 +1,8 @@
#pragma once #pragma once
#include "../WTLControls/ModifiedCheckBox.h" #include <Project64\UserInterface\WTLControls\ModifiedCheckBox.h>
#include <Project64-core/N64System/N64Types.h> #include <Project64-core/N64System/N64Types.h>
#include "SettingsPage.h"
class CGameGeneralPage : class CGameGeneralPage :
public CSettingsPageImpl<CGameGeneralPage>, public CSettingsPageImpl<CGameGeneralPage>,

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h"
#include "SettingsPage-Game-Plugin.h" #include "SettingsPage-Game-Plugin.h"
#include "SettingsPage.h"
CGamePluginPage::CGamePluginPage(HWND hParent, const RECT & rcDispay) CGamePluginPage::CGamePluginPage(HWND hParent, const RECT & rcDispay)
{ {
@ -190,7 +190,8 @@ void CGamePluginPage::UpdatePageSettings(void)
ComboBox->SetDefault((WPARAM)Plugin); ComboBox->SetDefault((WPARAM)Plugin);
} }
} }
else { else
{
ComboBox->SetDefault(NULL); ComboBox->SetDefault(NULL);
} }
} }
@ -217,7 +218,10 @@ void CGamePluginPage::ApplySettings(bool UpdateScreen)
bool CGamePluginPage::EnableReset(void) bool CGamePluginPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGamePluginPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGamePluginPage>::EnableReset())
{
return true;
}
return false; return false;
} }
@ -254,7 +258,8 @@ void CGamePluginPage::ApplyComboBoxes(void)
g_Settings->SaveString(cb_iter->first, Plugin->FileName.c_str()); g_Settings->SaveString(cb_iter->first, Plugin->FileName.c_str());
} }
} }
else { else
{
g_Settings->DeleteSetting(cb_iter->first); g_Settings->DeleteSetting(cb_iter->first);
} }
} }

View File

@ -2,6 +2,7 @@
#include <Project64-core/Plugin.h> #include <Project64-core/Plugin.h>
#include <Project64/Plugins/PluginList.h> #include <Project64/Plugins/PluginList.h>
#include "SettingsPage.h"
class CGamePluginPage : class CGamePluginPage :
public CSettingsPageImpl<CGamePluginPage>, public CSettingsPageImpl<CGamePluginPage>,

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h"
#include "SettingsPage-Game-Recompiler.h" #include "SettingsPage-Game-Recompiler.h"
#include "SettingsPage.h"
CGameRecompilePage::CGameRecompilePage(HWND hParent, const RECT & rcDispay) CGameRecompilePage::CGameRecompilePage(HWND hParent, const RECT & rcDispay)
{ {
@ -76,7 +76,10 @@ void CGameRecompilePage::ApplySettings(bool UpdateScreen)
bool CGameRecompilePage::EnableReset(void) bool CGameRecompilePage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGameRecompilePage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGameRecompilePage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "SettingsPage.h"
class CGameRecompilePage : class CGameRecompilePage :
public CSettingsPageImpl<CGameRecompilePage>, public CSettingsPageImpl<CGameRecompilePage>,

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsPage.h"
#include "SettingsPage-Game-Status.h" #include "SettingsPage-Game-Status.h"
#include "SettingsPage.h"
CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay) CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
{ {
@ -21,8 +21,14 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
{ {
for (CIniFile::strlist::iterator item = Keys.begin(); item != Keys.end(); item++) for (CIniFile::strlist::iterator item = Keys.begin(); item != Keys.end(); item++)
{ {
if (strstr(item->c_str(), ".Sel") != nullptr) { continue; } if (strstr(item->c_str(), ".Sel") != nullptr)
if (strstr(item->c_str(), ".Auto") != nullptr) { continue; } {
continue;
}
if (strstr(item->c_str(), ".Auto") != nullptr)
{
continue;
}
ComboBox->AddItem(stdstr(*item).ToUTF16().c_str(), item->c_str()); ComboBox->AddItem(stdstr(*item).ToUTF16().c_str(), item->c_str());
} }
ComboBox->SetTextField(GetDlgItem(IDC_STATUS_TEXT)); ComboBox->SetTextField(GetDlgItem(IDC_STATUS_TEXT));
@ -53,7 +59,10 @@ void CGameStatusPage::ApplySettings(bool UpdateScreen)
bool CGameStatusPage::EnableReset(void) bool CGameStatusPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGameStatusPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGameStatusPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "SettingsPage.h"
class CGameStatusPage : class CGameStatusPage :
public CSettingsPageImpl<CGameStatusPage>, public CSettingsPageImpl<CGameStatusPage>,

View File

@ -54,7 +54,10 @@ void COptionsGameBrowserPage::UpdateFieldList(const ROMBROWSER_FIELDS_LIST & Fie
continue; continue;
} }
int listCount = m_Using.GetCount(); int listCount = m_Using.GetCount();
if (Pos > listCount) { Pos = listCount; } if (Pos > listCount)
{
Pos = listCount;
}
m_Using.SetItemData(m_Using.InsertString(Pos, wGS(Fields[i].LangID()).c_str()), i); m_Using.SetItemData(m_Using.InsertString(Pos, wGS(Fields[i].LangID()).c_str()), i);
} }
} }
@ -99,7 +102,10 @@ void COptionsGameBrowserPage::AddFieldClicked(UINT /*Code*/, int /*id*/, HWND /*
// Select next in list // Select next in list
int listCount = m_Avaliable.GetCount(); int listCount = m_Avaliable.GetCount();
if (index >= listCount) { index -= 1; } if (index >= listCount)
{
index -= 1;
}
m_Avaliable.SetCurSel(index); m_Avaliable.SetCurSel(index);
// Add to list // Add to list
@ -125,7 +131,10 @@ void COptionsGameBrowserPage::RemoveFieldClicked(UINT /*Code*/, int /*id*/, HWND
// Select next in list // Select next in list
int listCount = m_Using.GetCount(); int listCount = m_Using.GetCount();
if (index >= listCount) { index -= 1; } if (index >= listCount)
{
index -= 1;
}
m_Using.SetCurSel(index); m_Using.SetCurSel(index);
// Add to list // Add to list
@ -231,7 +240,10 @@ void COptionsGameBrowserPage::ApplySettings(bool UpdateScreen)
bool COptionsGameBrowserPage::EnableReset(void) bool COptionsGameBrowserPage::EnableReset(void)
{ {
if (m_OrderChanged) { return true; } if (m_OrderChanged)
{
return true;
}
return CSettingsPageImpl<COptionsGameBrowserPage>::EnableReset(); return CSettingsPageImpl<COptionsGameBrowserPage>::EnableReset();
} }

View File

@ -218,7 +218,10 @@ void COptionsShortCutsPage::OnShortCutChanged(UINT /*Code*/, int /*id*/, HWND /*
{ {
// Get the virtual key info // Get the virtual key info
int index = m_VirtualKeyList.GetCurSel(); int index = m_VirtualKeyList.GetCurSel();
if (index < 0) { return; } if (index < 0)
{
return;
}
WORD key = (WORD)m_VirtualKeyList.GetItemData(index); WORD key = (WORD)m_VirtualKeyList.GetItemData(index);
bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED); bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED);
bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED); bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED);
@ -297,22 +300,39 @@ void COptionsShortCutsPage::InputGetKeys(void)
::EnableWindow(GetParent(), false); ::EnableWindow(GetParent(), false);
MSG msg; MSG msg;
for (bool fDone = false; !fDone; MsgWaitForMultipleObjects(0, nullptr, false, 45, QS_ALLINPUT)) { for (bool fDone = false; !fDone; MsgWaitForMultipleObjects(0, nullptr, false, 45, QS_ALLINPUT))
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { {
if (msg.message == WM_QUIT) { while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
fDone = true; fDone = true;
::PostMessage(nullptr, WM_QUIT, 0, 0); ::PostMessage(nullptr, WM_QUIT, 0, 0);
break; break;
} }
if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
{
int nVirtKey = (int)msg.wParam; int nVirtKey = (int)msg.wParam;
if (nVirtKey == VK_SHIFT) { continue; } if (nVirtKey == VK_SHIFT)
if (nVirtKey == VK_CONTROL) { continue; } {
if (nVirtKey == VK_MENU) { continue; } continue;
}
if (nVirtKey == VK_CONTROL)
{
continue;
}
if (nVirtKey == VK_MENU)
{
continue;
}
SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, (WPARAM)-1, 0); SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, (WPARAM)-1, 0);
for (int count = 0; count < SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETCOUNT, 0, 0); count++) { for (int count = 0; count < SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETCOUNT, 0, 0); count++)
{
int Data = (int)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, count, 0); int Data = (int)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, count, 0);
if (Data != nVirtKey) { continue; } if (Data != nVirtKey)
{
continue;
}
SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, count, 0); SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, count, 0);
SendDlgItemMessage(IDC_CTL, BM_SETCHECK, (GetKeyState(VK_CONTROL) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessage(IDC_CTL, BM_SETCHECK, (GetKeyState(VK_CONTROL) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(IDC_ALT, BM_SETCHECK, (GetKeyState(VK_MENU) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessage(IDC_ALT, BM_SETCHECK, (GetKeyState(VK_MENU) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0);
@ -323,13 +343,17 @@ void COptionsShortCutsPage::InputGetKeys(void)
} }
continue; continue;
} }
if (!::IsDialogMessage(hKeyDlg, &msg)) { if (!::IsDialogMessage(hKeyDlg, &msg))
{
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
} }
if (!::IsWindow(hKeyDlg)) { fDone = true; } if (!::IsWindow(hKeyDlg))
{
fDone = true;
}
} }
::SetFocus(GetParent()); ::SetFocus(GetParent());
::EnableWindow(GetParent(), true); ::EnableWindow(GetParent(), true);

View File

@ -54,7 +54,10 @@ void CGeneralOptionsPage::ApplySettings(bool UpdateScreen)
bool CGeneralOptionsPage::EnableReset(void) bool CGeneralOptionsPage::EnableReset(void)
{ {
if (CSettingsPageImpl<CGeneralOptionsPage>::EnableReset()) { return true; } if (CSettingsPageImpl<CGeneralOptionsPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -207,7 +207,10 @@ void COptionPluginPage::ApplySettings(bool UpdateScreen)
bool COptionPluginPage::EnableReset(void) bool COptionPluginPage::EnableReset(void)
{ {
if (CSettingsPageImpl<COptionPluginPage>::EnableReset()) { return true; } if (CSettingsPageImpl<COptionPluginPage>::EnableReset())
{
return true;
}
return false; return false;
} }

View File

@ -1,7 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsConfig.h"
#include "Settings/SettingsPage.h" #include "Settings/SettingsPage.h"
#include "SettingsConfig.h"
#include <Project64-core/Settings/SettingType/SettingsType-Application.h> #include <Project64-core/Settings/SettingType/SettingsType-Application.h>
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) : CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :

View File

@ -1,7 +1,8 @@
#include "stdafx.h" #include "stdafx.h"
#include "SupportEnterCode.h" #include "SupportEnterCode.h"
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
#include "resource.h" #include "resource.h"
#include <Project64-core/Settings/SettingType/SettingsType-Application.h>
class CRequestCode : class CRequestCode :
public CDialogImpl<CRequestCode> public CDialogImpl<CRequestCode>

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "SupportEnterCode.h" #include "SupportEnterCode.h"
#include <time.h> #include <time.h>

View File

@ -1,5 +1,3 @@
#include "stdafx.h"
#pragma once #pragma once
enum { enum {

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "EditNumber32.h" #include "EditNumber32.h"
CEditNumber32::CEditNumber32(void) : CEditNumber32::CEditNumber32(void) :
@ -192,7 +193,8 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
// Does not allow to delete '0' before x // Does not allow to delete '0' before x
bHandled = true; bHandled = true;
} }
else { else
{
bHandled = false; bHandled = false;
} }
return TRUE; return TRUE;
@ -214,7 +216,8 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
SendMessage(uMsg, L'x', lParam); SendMessage(uMsg, L'x', lParam);
bHandled = true; bHandled = true;
} }
else { else
{
bHandled = false; bHandled = false;
} }
return true; return true;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "GetCWindowText.h" #include "GetCWindowText.h"
#include <Common/StdString.h> #include <Common/StdString.h>

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "HexEditCtrl.h" #include "HexEditCtrl.h"
#include <unordered_map> #include <unordered_map>
@ -1208,7 +1209,6 @@ void CHexEditCtrl::OnKeyDown(UINT nChar, UINT /*nRepCnt*/, UINT /*nFlags*/)
} }
} }
if (nChar == VK_DOWN) if (nChar == VK_DOWN)
{ {
m_CaretAddress = SatAdd32(m_CaretAddress, m_NumBytesPerRow); m_CaretAddress = SatAdd32(m_CaretAddress, m_NumBytesPerRow);

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include <stdafx.h>
enum enum
{ {

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include "stdafx.h"
typedef struct { typedef struct {
WORD ctrlId; WORD ctrlId;
char* text; char* text;

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "wtl-BitmapPicture.h" #include "wtl-BitmapPicture.h"
CBitmapPicture::CBitmapPicture() : CBitmapPicture::CBitmapPicture() :

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "WelcomeScreen.h" #include "WelcomeScreen.h"
#include "resource.h" #include "resource.h"
@ -105,7 +106,8 @@ LRESULT WelcomeScreen::OnOkCmd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCt
} }
string Project64VideoPluginPath = g_Settings->LoadStringVal(Plugin_GFX_Default); string Project64VideoPluginPath = g_Settings->LoadStringVal(Plugin_GFX_Default);
if (Project64VideoPluginPath.find("Project64-Video") == string::npos) { if (Project64VideoPluginPath.find("Project64-Video") == string::npos)
{
Project64VideoPluginPath = "GFX\\Project64-Video.dll"; Project64VideoPluginPath = "GFX\\Project64-Video.dll";
} }
g_Settings->SaveString(Plugin_GFX_Default, CButton(GetDlgItem(IDC_RADIO_GLIDEN64)).GetCheck() == BST_CHECKED ? "GFX\\GLideN64\\GLideN64.dll" : Project64VideoPluginPath); g_Settings->SaveString(Plugin_GFX_Default, CButton(GetDlgItem(IDC_RADIO_GLIDEN64)).GetCheck() == BST_CHECKED ? "GFX\\GLideN64\\GLideN64.dll" : Project64VideoPluginPath);

View File

@ -1,7 +1,8 @@
#include "stdafx.h" #include "stdafx.h"
#include <Project64-core/AppInit.h>
#include "UserInterface/WelcomeScreen.h"
#include "Settings/UISettings.h" #include "Settings/UISettings.h"
#include "UserInterface/WelcomeScreen.h"
#include <Project64-core/AppInit.h>
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/) int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/)
{ {
@ -34,13 +35,12 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
{ {
// Handle combo loading (N64 ROM and 64DD Disk) // Handle combo loading (N64 ROM and 64DD Disk)
MainWindow.Show(true); // Show the main window MainWindow.Show(true);
stdstr extcombo = CPath(g_Settings->LoadStringVal(Cmd_ComboDiskFile)).GetExtension(); stdstr extcombo = CPath(g_Settings->LoadStringVal(Cmd_ComboDiskFile)).GetExtension();
stdstr ext = CPath(g_Settings->LoadStringVal(Cmd_RomFile)).GetExtension(); stdstr ext = CPath(g_Settings->LoadStringVal(Cmd_RomFile)).GetExtension();
if (g_Settings->LoadStringVal(Cmd_ComboDiskFile).length() > 0 if (g_Settings->LoadStringVal(Cmd_ComboDiskFile).length() > 0 && ((_stricmp(extcombo.c_str(), "ndd") == 0) || (_stricmp(extcombo.c_str(), "d64") == 0)))
&& ((_stricmp(extcombo.c_str(), "ndd") == 0) || (_stricmp(extcombo.c_str(), "d64") == 0)))
{ {
if ((!(_stricmp(ext.c_str(), "ndd") == 0)) && (!(_stricmp(ext.c_str(), "d64") == 0))) if ((!(_stricmp(ext.c_str(), "ndd") == 0)) && (!(_stricmp(ext.c_str(), "d64") == 0)))
{ {
@ -54,7 +54,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
{ {
// Handle single game (N64 ROM or 64DD Disk) // Handle single game (N64 ROM or 64DD Disk)
MainWindow.Show(true); // Show the main window MainWindow.Show(true);
stdstr ext = CPath(g_Settings->LoadStringVal(Cmd_RomFile)).GetExtension(); stdstr ext = CPath(g_Settings->LoadStringVal(Cmd_RomFile)).GetExtension();
if ((!(_stricmp(ext.c_str(), "ndd") == 0)) && (!(_stricmp(ext.c_str(), "d64") == 0))) if ((!(_stricmp(ext.c_str(), "ndd") == 0)) && (!(_stricmp(ext.c_str(), "d64") == 0)))