[Project64] Create Project64-core

This commit is contained in:
zilmar 2015-12-06 20:59:58 +11:00
parent 9547e0fd48
commit a429a7fd08
193 changed files with 2268 additions and 1867 deletions

View File

@ -1,6 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 or later
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rd Party", "3rd Party", "{AA8F7F8E-5377-4911-859D-8A8817B0DB26}"
EndProject
@ -61,6 +62,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PropertySheets", "PropertyS
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "Source\3rdParty\sdl\sdl2.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64-core", "Source\Project64-core\Project64-core.vcxproj", "{00C7B43A-DED7-4DF0-B072-9A5783EF866D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -210,6 +213,12 @@ Global
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Debug|Win32.ActiveCfg = Debug|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Debug|Win32.Build.0 = Debug|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Debug|x64.ActiveCfg = Debug|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|Win32.ActiveCfg = Release|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|Win32.Build.0 = Release|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -8,6 +8,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64", "Source\Project
{731BD205-2826-4631-B7AF-117658E88DBC} = {731BD205-2826-4631-B7AF-117658E88DBC}
{A4D13408-A794-4199-8FC7-4A9A32505005} = {A4D13408-A794-4199-8FC7-4A9A32505005}
{3326E128-33AF-422C-BB7C-67CC6B915610} = {3326E128-33AF-422C-BB7C-67CC6B915610}
{00C7B43A-DED7-4DF0-B072-9A5783EF866D} = {00C7B43A-DED7-4DF0-B072-9A5783EF866D}
{FD617E80-9E40-4138-85DA-B94633972E6A} = {FD617E80-9E40-4138-85DA-B94633972E6A}
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421} = {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}
EndProjectSection
@ -82,6 +83,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PJ64 NRage", "Source\nragev
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "Source\3rdParty\sdl\sdl2.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64-core", "Source\Project64-core\Project64-core.vcproj", "{00C7B43A-DED7-4DF0-B072-9A5783EF866D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -163,6 +166,10 @@ Global
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Debug|Win32.ActiveCfg = Debug|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Debug|Win32.Build.0 = Debug|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|Win32.ActiveCfg = Release|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,5 +1,11 @@
#include "stdafx.h"
#include <Common\Util.h>
#include <common/path.h>
#include <common/trace.h>
#include <Common/Util.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/PluginClass.h>
#include <Project64-core/N64System/N64RomClass.h>
void FixDirectories(void);
@ -120,6 +126,7 @@ void FixDirectories(void)
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
}
#include <windows.h>
void IncreaseThreadPriority(void)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);

View File

@ -0,0 +1,4 @@
#include <excpt.h>
#define __except_try() __try
#define __except_catch() __except (g_MMU->MemoryFilter(_exception_code(), _exception_info()))

View File

@ -11,10 +11,10 @@
#include "stdafx.h"
#include "logging.h"
#include <Common/path.h>
#include <Project64/N64System/SystemGlobals.h>
#include <Project64/N64System/Mips/TranslateVaddr.h>
#include <Project64/N64System/Mips/MemoryClass.h>
#include <Project64/N64System/N64RomClass.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/TranslateVaddr.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/N64RomClass.h>
CFile * CLogging::m_hLogFile = NULL;

View File

@ -9,7 +9,7 @@
* *
****************************************************************************/
#pragma once
#include <Project64/Settings/LoggingSettings.h>
#include <Project64-core/Settings/LoggingSettings.h>
#include <Common/FileClass.h>
class CLogging :

View File

@ -10,6 +10,12 @@
****************************************************************************/
#include "stdafx.h"
#include "CheatClass.h"
#include <Project64-core/Settings/SettingType/SettingsType-Cheats.h>
#include <Project64-core/Plugins/GFXplugin.h>
#include <Project64-core/Plugins/AudioPlugin.h>
#include <Project64-core/Plugins/RSPPlugin.h>
#include <Project64-core/Plugins/ControllerPlugin.h>
CCheats::CCheats()
{

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#pragma once
#include "N64RomClass.h"
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/Plugins/PluginClass.h>
class CCheats
{

View File

@ -9,7 +9,8 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64/N64System/N64Class.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/Notification.h>
#include <common/Util.h>
#include <Windows.h>
#include <Objbase.h>

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "FramePerSecondClass.h"
#include <Project64-core/N64System/N64Types.h>
#include <Windows.h>
CFramePerSecond::CFramePerSecond ()
{
@ -72,7 +75,7 @@ void CFramePerSecond::UpdateViCounter ( void )
m_CurrentFrame += 1;
}
void CFramePerSecond::DisplayViCounter(DWORD FrameRate)
void CFramePerSecond::DisplayViCounter(uint32_t FrameRate)
{
if (m_iFrameRateType == FR_VIs)
{
@ -157,7 +160,7 @@ void CFramePerSecond::UpdateDlCounter ( void )
m_CurrentFrame += 1;
}
void CFramePerSecond::DisplayDlCounter(DWORD FrameRate)
void CFramePerSecond::DisplayDlCounter(uint32_t FrameRate)
{
if (m_iFrameRateType != FR_DLs)
{

View File

@ -20,8 +20,8 @@ public:
void UpdateDlCounter ( void );
void UpdateViCounter ( void );
void DisplayDlCounter ( DWORD FrameRate );
void DisplayViCounter ( DWORD FrameRate );
void DisplayDlCounter ( uint32_t FrameRate );
void DisplayViCounter ( uint32_t FrameRate );
private:
static void FrameRateTypeChanged(CFramePerSecond * _this);

View File

@ -9,6 +9,15 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "InterpreterCPU.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps32.h>
#include <Project64-core/Plugins/PluginClass.h>
#include <Project64-core/Plugins/GFXplugin.h>
#include <Project64-core/ExceptionHandler.h>
R4300iOp::Func * CInterpreterCPU::m_R4300i_Opcode = NULL;

View File

@ -10,7 +10,7 @@
****************************************************************************/
#pragma once
#include <Project64/N64System/Interpreter/InterpreterOps.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps.h>
class CInterpreterCPU :
private R4300iOp

View File

@ -9,7 +9,17 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64/UserInterface/LoggingUI.h>
#include "InterpreterOps.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#include <Project64-core/N64System/Mips/TLBClass.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/Logging.h>
#include <float.h>
#include <math.h>
void InPermLoop();
void TestInterpreterJump(uint32_t PC, uint32_t TargetPC, int32_t Reg1, int32_t Reg2);

View File

@ -10,9 +10,9 @@
****************************************************************************/
#pragma once
#include <Project64/Settings/DebugSettings.h>
#include <Project64/N64System/Mips/RegisterClass.h>
#include <Project64/N64System/Mips/OpCode.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/Mips/OpCode.h>
class R4300iOp :
public CLogging,

View File

@ -9,7 +9,12 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64\Logging.h>
#include "InterpreterOps32.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/SystemTiming.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/Logging.h>
bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2);

View File

@ -10,8 +10,8 @@
****************************************************************************/
#include "stdafx.h"
#include "Audio.h"
#include <Project64/N64System/SystemGlobals.h>
#include <Project64/N64System/N64Class.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
CAudio::CAudio()
{

View File

@ -9,6 +9,13 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Dma.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Windows.h>
CDMA::CDMA(CFlashram & FlashRam, CSram & Sram) :
m_FlashRam(FlashRam),

View File

@ -9,9 +9,9 @@
* *
****************************************************************************/
#pragma once
#include <Project64/Settings/DebugSettings.h>
#include <Project64/N64System/Mips/FlashRam.h>
#include <Project64/N64System/Mips/Sram.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/N64System/Mips/FlashRam.h>
#include <Project64-core/N64System/Mips/Sram.h>
class CDMA :
private CDebugSettings

View File

@ -10,9 +10,10 @@
****************************************************************************/
#include "stdafx.h"
#include "Eeprom.h"
#include <Project64/N64System/SystemGlobals.h>
#include <Project64/N64System/N64Class.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <time.h>
#include <Windows.h>
CEeprom::CEeprom(bool ReadOnly) :
m_ReadOnly(ReadOnly),

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include <Project64-core/Settings/DebugSettings.h>
class CEeprom :
private CDebugSettings

View File

@ -9,6 +9,11 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "FlashRam.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Common/path.h>
#include <Windows.h>
CFlashram::CFlashram(bool ReadOnly):
m_FlashRamPointer(NULL),
@ -30,10 +35,10 @@ CFlashram::~CFlashram()
}
}
void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
void CFlashram::DmaFromFlashram(uint8_t * dest, int StartOffset, int len)
{
BYTE FlipBuffer[0x10000];
DWORD dwRead, count;
uint8_t FlipBuffer[0x10000];
uint32_t count;
switch (m_FlashFlag)
{
@ -64,6 +69,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
memset(FlipBuffer,0,sizeof(FlipBuffer));
StartOffset = StartOffset << 1;
SetFilePointer(m_hFile,StartOffset,NULL,FILE_BEGIN);
DWORD dwRead;
ReadFile(m_hFile,FlipBuffer,len,&dwRead,NULL);
for (count = dwRead; (int)count < len; count ++)
{
@ -72,11 +78,11 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
for (count = 0; (int)count < len; count += 4)
{
register DWORD eax;
register uint32_t eax;
eax = *(unsigned __int32 *)&FlipBuffer[count];
eax = *(uint32_t *)&FlipBuffer[count];
// eax = swap32by8(eax); // ; bswap eax
*(unsigned __int32 *)(dest + count) = eax;
*(uint32_t *)(dest + count) = eax;
}
break;
case FLASHRAM_MODE_STATUS:
@ -87,8 +93,8 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": Reading m_FlashStatus not being handled correctly\nStart: %X len: %X", StartOffset, len).ToUTF16().c_str());
}
}
*((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF);
*((DWORD *)(dest) + 1) = (DWORD)(m_FlashStatus & 0xFFFFFFFF);
*((uint32_t *)(dest)) = (uint32_t)((m_FlashStatus >> 32) & 0xFFFFFFFF);
*((uint32_t *)(dest)+1) = (uint32_t)(m_FlashStatus & 0xFFFFFFFF);
break;
default:
if (bHaveDebugger())
@ -98,7 +104,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
}
}
void CFlashram::DmaToFlashram(BYTE * Source, int StartOffset, int len)
void CFlashram::DmaToFlashram(uint8_t * Source, int StartOffset, int len)
{
switch (m_FlashFlag)
{
@ -114,11 +120,11 @@ void CFlashram::DmaToFlashram(BYTE * Source, int StartOffset, int len)
}
DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr)
uint32_t CFlashram::ReadFromFlashStatus(uint32_t PAddr)
{
switch (PAddr)
{
case 0x08000000: return (DWORD)(m_FlashStatus >> 32);
case 0x08000000: return (uint32_t)(m_FlashStatus >> 32);
default:
if (bHaveDebugger())
{
@ -126,7 +132,7 @@ DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr)
}
break;
}
return (DWORD)(m_FlashStatus >> 32);
return (uint32_t)(m_FlashStatus >> 32);
}
bool CFlashram::LoadFlashram()
@ -154,9 +160,9 @@ bool CFlashram::LoadFlashram()
return true;
}
void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command)
void CFlashram::WriteToFlashCommand(uint32_t FlashRAM_Command)
{
BYTE EmptyBlock[128];
uint8_t EmptyBlock[128];
DWORD dwWritten;
switch (FlashRAM_Command & 0xFF000000)
@ -186,14 +192,14 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command)
}
}
{
BYTE FlipBuffer[128];
uint8_t FlipBuffer[128];
register size_t edx;
BYTE * FlashRamPointer = m_FlashRamPointer;
uint8_t * FlashRamPointer = m_FlashRamPointer;
memset(FlipBuffer,0,sizeof(FlipBuffer));
for (edx = 0; edx < 128; edx += 4)
{
register DWORD eax;
register uint32_t eax;
eax = *(unsigned __int32 *)&FlashRamPointer[edx];
// eax = swap32by8(eax); // ; bswap eax

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include <Project64-core/Settings/DebugSettings.h>
class CFlashram :
private CDebugSettings
@ -26,18 +27,18 @@ public:
CFlashram(bool ReadOnly);
~CFlashram();
void DmaFromFlashram ( BYTE * dest, int StartOffset, int len );
void DmaToFlashram ( BYTE * Source, int StartOffset, int len );
DWORD ReadFromFlashStatus ( DWORD PAddr );
void WriteToFlashCommand ( DWORD Value );
void DmaFromFlashram ( uint8_t * dest, int StartOffset, int len );
void DmaToFlashram ( uint8_t * Source, int StartOffset, int len );
uint32_t ReadFromFlashStatus ( uint32_t PAddr );
void WriteToFlashCommand ( uint32_t Value );
private:
bool LoadFlashram();
bool LoadFlashram();
BYTE * m_FlashRamPointer;
Modes m_FlashFlag;
QWORD m_FlashStatus;
DWORD m_FlashRAM_Offset;
bool m_ReadOnly;
HANDLE m_hFile;
uint8_t * m_FlashRamPointer;
Modes m_FlashFlag;
uint64_t m_FlashStatus;
uint32_t m_FlashRAM_Offset;
bool m_ReadOnly;
void * m_hFile;
};

View File

@ -9,6 +9,13 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "MemoryVirtualMem.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Windows.h>
uint32_t RegModValue;

View File

@ -9,6 +9,14 @@
* *
****************************************************************************/
#pragma once
#include "MemoryClass.h"
#include "TranslateVaddr.h"
#include <Project64-core/N64System/Recompiler/RecompilerOps.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps.h>
#include <Project64-core/N64System/Mips/PifRam.h>
#include <Project64-core/N64System/Mips/FlashRam.h>
#include <Project64-core/N64System/Mips/Sram.h>
#include <Project64-core/N64System/Mips/Dma.h>
/*
* 64-bit Windows exception recovery facilities will expect to interact with

View File

@ -13,9 +13,8 @@
class Mempak
{
public:
static void Close();
static BYTE CalculateCrc(BYTE * DataToCrc);
static void ReadFrom(int Control, BYTE * command);
static void WriteTo(int Control, BYTE * command);
static void Close();
static uint8_t CalculateCrc(uint8_t * DataToCrc);
static void ReadFrom(int32_t Control, uint8_t * command);
static void WriteTo(int32_t Control, uint8_t * command);
};

View File

@ -9,7 +9,11 @@
* *
****************************************************************************/
#include "stdafx.h"
static BYTE Mempaks[4][0x8000];
#include "Mempak.H"
#include <common/path.h>
#include <Windows.h>
static uint8_t Mempaks[4][0x8000];
HANDLE hMempakFile[4];
void Mempak::Close()
@ -46,7 +50,7 @@ void LoadMempak (int Control)
FileName.DirectoryCreate();
}
BYTE Initialize[] = {
uint8_t Initialize[] = {
0x81,0x01,0x02,0x03, 0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b, 0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B, 0x1C,0x1D,0x1E,0x1F,
0xFF,0xFF,0xFF,0xFF, 0x05,0x1A,0x5F,0x13, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,
@ -94,13 +98,13 @@ void LoadMempak (int Control)
}
}
BYTE Mempak::CalculateCrc(BYTE * DataToCrc)
uint8_t Mempak::CalculateCrc(uint8_t * DataToCrc)
{
DWORD Count;
DWORD XorTap;
int Length;
BYTE CRC = 0;
uint8_t CRC = 0;
for (Count = 0; Count < 0x21; Count++)
{
@ -127,7 +131,7 @@ BYTE Mempak::CalculateCrc(BYTE * DataToCrc)
return CRC;
}
void Mempak::ReadFrom(int Control, BYTE * command)
void Mempak::ReadFrom(int Control, uint8_t * command)
{
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
@ -146,10 +150,10 @@ void Mempak::ReadFrom(int Control, BYTE * command)
}
}
void Mempak::WriteTo(int Control, BYTE * command)
void Mempak::WriteTo(int Control, uint8_t * command)
{
DWORD dwWritten;
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
uint32_t address = (command[3] << 8) | (command[4] & 0xE0);
if (address < 0x8000)
{

View File

@ -9,34 +9,22 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "OpCode.h"
#include "RegisterClass.h"
#define FPR_Type(Reg) (Reg) == R4300i_COP1_S ? "S" : (Reg) == R4300i_COP1_D ? "D" :\
(Reg) == R4300i_COP1_W ? "W" : "L"
BOOL InR4300iCommandsWindow = FALSE;
char CommandName[100];
void SetR4300iCommandToStepping ( void )
{
}
void SetR4300iCommandViewto ( UINT /*NewLocation*/ )
{
}
void __cdecl Enter_R4300i_Commands_Window ( void )
{
}
char strLabelName[100];
char * LabelName (DWORD Address)
char * LabelName (uint32_t Address)
{
static char strLabelName[100];
sprintf(strLabelName,"0x%08X",Address);
return strLabelName;
}
char * R4300iSpecialName ( DWORD OpCode, DWORD /*PC*/ )
char * R4300iSpecialName ( uint32_t OpCode, uint32_t /*PC*/ )
{
OPCODE command;
command.Hex = OpCode;
@ -239,7 +227,7 @@ char * R4300iSpecialName ( DWORD OpCode, DWORD /*PC*/ )
return CommandName;
}
char * R4300iRegImmName ( DWORD OpCode, DWORD PC )
char * R4300iRegImmName ( uint32_t OpCode, uint32_t PC )
{
OPCODE command;
command.Hex = OpCode;
@ -308,7 +296,7 @@ char * R4300iRegImmName ( DWORD OpCode, DWORD PC )
return CommandName;
}
char * R4300iCop1Name ( DWORD OpCode, DWORD PC )
char * R4300iCop1Name ( uint32_t OpCode, uint32_t PC )
{
OPCODE command;
command.Hex = OpCode;
@ -519,7 +507,7 @@ char * R4300iCop1Name ( DWORD OpCode, DWORD PC )
return CommandName;
}
char * R4300iOpcodeName ( DWORD OpCode, DWORD PC )
const char * R4300iOpcodeName(uint32_t OpCode, uint32_t PC)
{
OPCODE command;
command.Hex = OpCode;

View File

@ -10,26 +10,4 @@
****************************************************************************/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _DEBUG
void Disable_R4300i_Commands_Window ( void );
void Enable_R4300i_Commands_Window ( void );
void __cdecl Enter_R4300i_Commands_Window ( void );
char * R4300iOpcodeName ( DWORD OpCode, DWORD PC );
void RefreshR4300iCommands ( void );
void SetR4300iCommandToRunning ( void );
void SetR4300iCommandToStepping ( void );
void SetR4300iCommandViewto ( UINT NewLocation );
void Update_r4300iCommandList (void);
extern BOOL InR4300iCommandsWindow;
#else
char * R4300iOpcodeName ( DWORD OpCode, DWORD PC );
#endif
#ifdef __cplusplus
}
#endif
const char * R4300iOpcodeName(uint32_t OpCode, uint32_t PC);

View File

@ -9,7 +9,15 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64/UserInterface/LoggingUI.h>
#include "PifRam.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/ControllerPlugin.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/Rumblepak.h>
#include <Project64-core/N64System/Mips/Mempak.H>
#include <Project64-core/Logging.h>
int CPifRamSettings::m_RefCount = 0;
bool CPifRamSettings::m_bShowPifRamErrors = false;
@ -166,19 +174,19 @@ void CPifRam::PifRamWrite()
Challenge[i * 2 + 1] = m_PifRam[48 + i] & 0x0f;
}
n64_cic_nus_6105(Challenge, Response, CHALLENGE_LENGTH - 2);
QWORD ResponseValue = 0;
uint64_t ResponseValue = 0;
m_PifRam[46] = m_PifRam[47] = 0x00;
for (int z = 8; z > 0; z--)
{
ResponseValue = (ResponseValue << 8) | ((Response[(z - 1) * 2] << 4) + Response[(z - 1) * 2 + 1]);
}
std::memcpy(&m_PifRam[48], &ResponseValue, sizeof(QWORD));
std::memcpy(&m_PifRam[48], &ResponseValue, sizeof(uint64_t));
ResponseValue = 0;
for (int z = 7; z > 0; z--)
{
ResponseValue = (ResponseValue << 8) | ((Response[((z + 8) - 1) * 2] << 4) + Response[((z + 8) - 1) * 2 + 1]);
}
std::memcpy(&m_PifRam[56], &ResponseValue, sizeof(QWORD));
std::memcpy(&m_PifRam[56], &ResponseValue, sizeof(uint64_t));
}
break;
case 0x08:
@ -270,8 +278,8 @@ void CPifRam::PifRamWrite()
void CPifRam::SI_DMA_READ()
{
BYTE * PifRamPos = m_PifRam;
BYTE * RDRAM = g_MMU->Rdram();
uint8_t * PifRamPos = m_PifRam;
uint8_t * RDRAM = g_MMU->Rdram();
uint32_t & SI_DRAM_ADDR_REG = (uint32_t &)g_Reg->SI_DRAM_ADDR_REG;
if ((int32_t)SI_DRAM_ADDR_REG > (int32_t)g_System->RdramSize())
@ -444,7 +452,7 @@ void CPifRam::SI_DMA_WRITE()
}
}
void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
void CPifRam::ProcessControllerCommand(int Control, uint8_t * Command)
{
CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
@ -467,7 +475,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
g_Notify->DisplayError(L"What am I meant to do with this Controller Command");
}
}
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
Command[3] = 0x05;
Command[4] = 0x00;
@ -498,7 +506,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
g_Notify->DisplayError(L"What am I meant to do with this Controller Command");
}
}
if (Controllers[Control].Present == FALSE)
if (Controllers[Control].Present == false)
{
Command[1] |= 0x80;
}
@ -519,7 +527,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
g_Notify->DisplayError(L"What am I meant to do with this Controller Command");
}
}
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
switch (Controllers[Control].Plugin)
{
@ -561,7 +569,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
g_Notify->DisplayError(L"What am I meant to do with this Controller Command");
}
}
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
switch (Controllers[Control].Plugin)
{
@ -593,13 +601,13 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command)
}
}
void CPifRam::ReadControllerCommand(int Control, BYTE * Command) {
void CPifRam::ReadControllerCommand(int Control, uint8_t * Command) {
CONTROL * Controllers = g_Plugins->Control()->PluginControllers();
switch (Command[2])
{
case 0x01: // read controller
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
if (bShowPifRamErrors())
{
@ -607,12 +615,12 @@ void CPifRam::ReadControllerCommand(int Control, BYTE * Command) {
if (Command[1] != 4) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
const DWORD buttons = g_BaseSystem->GetButtons(Control);
std::memcpy(&Command[3], &buttons, sizeof(DWORD));
const uint32_t buttons = g_BaseSystem->GetButtons(Control);
std::memcpy(&Command[3], &buttons, sizeof(uint32_t));
}
break;
case 0x02: //read from controller pack
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
switch (Controllers[Control].Plugin)
{
@ -621,7 +629,7 @@ void CPifRam::ReadControllerCommand(int Control, BYTE * Command) {
}
break;
case 0x03: //write controller pak
if (Controllers[Control].Present == TRUE)
if (Controllers[Control].Present == true)
{
switch (Controllers[Control].Plugin)
{
@ -634,7 +642,7 @@ void CPifRam::ReadControllerCommand(int Control, BYTE * Command) {
void CPifRam::LogControllerPakData(char * Description)
{
BYTE * PIF_Ram = g_MMU->PifRam();
uint8_t * PIF_Ram = g_MMU->PifRam();
int count, count2;
char HexData[100], AsciiData[100], Addon[20];

View File

@ -10,7 +10,9 @@
****************************************************************************/
#pragma once
#include <Project64/Logging.h>
#include <Project64-core/Logging.h>
#include "Eeprom.h"
class CPifRamSettings
{
protected:
@ -49,13 +51,13 @@ public:
void SI_DMA_WRITE();
protected:
BYTE m_PifRom[0x7C0];
BYTE m_PifRam[0x40];
uint8_t m_PifRom[0x7C0];
uint8_t m_PifRam[0x40];
private:
#define CHALLENGE_LENGTH 0x20
void ProcessControllerCommand ( int Control, BYTE * Command );
void ReadControllerCommand ( int Control, BYTE * Command );
void ProcessControllerCommand ( int Control, uint8_t * Command );
void ReadControllerCommand ( int Control, uint8_t * Command );
void LogControllerPakData ( char * Description );
void n64_cic_nus_6105 (char challenge[], char response[], int length);
};

View File

@ -9,7 +9,10 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64/UserInterface/LoggingUI.h>
#include "RegisterClass.h"
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Logging.h>
const char * CRegName::GPR[32] = { "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
@ -507,7 +510,7 @@ void CRegisters::DoTLBReadMiss(bool DelaySlot, uint32_t BadVaddr)
{
if (bHaveDebugger())
{
g_Notify->DisplayError(stdstr_f("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s", BadVaddr, g_TLB->AddressDefined(BadVaddr) ? "TRUE" : "FALSE").ToUTF16().c_str());
g_Notify->DisplayError(stdstr_f("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s", BadVaddr, g_TLB->AddressDefined(BadVaddr) ? "true" : "false").ToUTF16().c_str());
}
m_PROGRAM_COUNTER = 0x80000180;
}

View File

@ -10,8 +10,10 @@
****************************************************************************/
#pragma once
#include <Project64/Settings/GameSettings.h>
#include <Project64/Logging.h>
#include <Project64-core/N64System/N64Types.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/Settings/GameSettings.h>
#include <Project64-core/Logging.h>
//CPO registers by name
class CP0registers

View File

@ -9,10 +9,14 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Rumblepak.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/PluginClass.h>
#include <Project64-core/Plugins/ControllerPlugin.h>
void Rumblepak::ReadFrom(BYTE * command)
void Rumblepak::ReadFrom(uint8_t * command)
{
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
uint32_t address = (command[3] << 8) | (command[4] & 0xE0);
if ((address >= 0x8000) && (address < 0x9000))
{
@ -24,15 +28,15 @@ void Rumblepak::ReadFrom(BYTE * command)
}
}
void Rumblepak::WriteTo(int Control, BYTE * command)
void Rumblepak::WriteTo(int Control, uint8_t * command)
{
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
uint32_t address = (command[3] << 8) | (command[4] & 0xE0);
if ((address) == 0xC000)
{
if (g_Plugins->Control()->RumbleCommand != NULL)
{
g_Plugins->Control()->RumbleCommand(Control, *(BOOL *)(&command[5]));
g_Plugins->Control()->RumbleCommand(Control, *(int *)(&command[5]));
}
}
}

View File

@ -13,7 +13,6 @@
class Rumblepak
{
public:
static void ReadFrom(BYTE * command);
static void WriteTo(int Control, BYTE * command);
static void ReadFrom(uint8_t * command);
static void WriteTo(int Control, uint8_t * command);
};

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Sram.h"
#include <Common/path.h>
#include <Windows.h>
CSram::CSram ( bool ReadOnly ) :
m_ReadOnly(ReadOnly),
@ -50,11 +53,11 @@ bool CSram::LoadSram()
return true;
}
void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len)
void CSram::DmaFromSram(uint8_t * dest, int StartOffset, int len)
{
DWORD dwRead;
DWORD i;
BYTE tmp[4];
uint32_t i;
uint8_t tmp[4];
if (m_hFile == NULL)
{
@ -67,7 +70,7 @@ void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len)
// Fix Dezaemon 3D saves
StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF);
DWORD Offset = StartOffset & 3;
uint32_t Offset = StartOffset & 3;
if (Offset == 0)
{
@ -131,11 +134,11 @@ void CSram::DmaFromSram(BYTE * dest, int StartOffset, int len)
}
}
void CSram::DmaToSram(BYTE * Source, int StartOffset, int len)
void CSram::DmaToSram(uint8_t * Source, int StartOffset, int len)
{
DWORD dwWritten;
DWORD i;
BYTE tmp[4];
uint32_t i;
uint8_t tmp[4];
if (m_ReadOnly)
{
@ -153,7 +156,7 @@ void CSram::DmaToSram(BYTE * Source, int StartOffset, int len)
// Fix Dezaemon 3D saves
StartOffset = ((StartOffset >> 3) & 0xFFFF8000) | (StartOffset & 0x7FFF);
DWORD Offset = StartOffset & 3;
uint32_t Offset = StartOffset & 3;
if (Offset == 0)
{

View File

@ -16,12 +16,12 @@ public:
CSram(bool ReadOnly);
~CSram();
void DmaFromSram(BYTE * dest, int StartOffset, int len);
void DmaToSram(BYTE * Source, int StartOffset, int len);
void DmaFromSram(uint8_t * dest, int StartOffset, int len);
void DmaToSram(uint8_t * Source, int StartOffset, int len);
private:
bool LoadSram();
bool m_ReadOnly;
HANDLE m_hFile;
void * m_hFile;
};

View File

@ -1,3 +1,4 @@
SysEvent_ChangingFullScreen
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
@ -9,6 +10,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "SystemEvents.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
CSystemEvents::CSystemEvents(CN64System * System, CPlugins * Plugins) :
m_System(System),
@ -122,7 +126,7 @@ void CSystemEvents::ExecuteEvents()
ChangePluginFunc();
break;
case SysEvent_ChangingFullScreen:
Notify().ChangeFullScreen();
g_Notify->ChangeFullScreen();
break;
case SysEvent_GSButtonPressed:
if (m_System->HasCheatsSlectionChanged())

View File

@ -10,6 +10,8 @@
****************************************************************************/
#pragma once
#include <common/CriticalSection.h>
enum SystemEvent
{
SysEvent_ExecuteInterrupt,
@ -52,6 +54,9 @@ enum SystemEvent
SysEvent_Profile_GenerateLogs,
};
class CN64System;
class CPlugins;
class CSystemEvents
{
typedef std::vector<SystemEvent> EventList;
@ -64,7 +69,7 @@ public:
void ExecuteEvents();
void QueueEvent(SystemEvent action);
const BOOL & DoSomething() const
const int32_t & DoSomething() const
{
return m_bDoSomething;
}
@ -79,6 +84,6 @@ private:
CN64System * m_System;
CPlugins * m_Plugins;
EventList m_Events;
BOOL m_bDoSomething;
int32_t m_bDoSomething;
CriticalSection m_CS;
};

View File

@ -9,6 +9,11 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "SystemTiming.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/3rdParty/zip.h>
CSystemTimer::CSystemTimer( int & NextTimer ) :
m_NextTimer(NextTimer),
@ -33,7 +38,7 @@ void CSystemTimer::Reset()
SetCompareTimer();
}
void CSystemTimer::SetTimer ( TimerType Type, DWORD Cycles, bool bRelative )
void CSystemTimer::SetTimer ( TimerType Type, uint32_t Cycles, bool bRelative )
{
if (Type >= MaxTimer || Type == UnknownTimer)
{
@ -61,7 +66,7 @@ void CSystemTimer::SetTimer ( TimerType Type, DWORD Cycles, bool bRelative )
FixTimers();
}
DWORD CSystemTimer::GetTimer ( TimerType Type )
uint32_t CSystemTimer::GetTimer ( TimerType Type )
{
if (Type >= MaxTimer || Type == UnknownTimer)
{
@ -81,7 +86,7 @@ DWORD CSystemTimer::GetTimer ( TimerType Type )
{
return 0x7FFFFFFF;
}
return (DWORD)CyclesToTimer;
return (uint32_t)CyclesToTimer;
}
void CSystemTimer::StopTimer ( TimerType Type )
@ -172,7 +177,7 @@ void CSystemTimer::TimerDone()
{
UpdateTimers();
/* DWORD LastTimer;
/* uint32_t LastTimer;
if (Profiling)
{
LastTimer = StartTimer(Timer_Done);
@ -253,7 +258,7 @@ void CSystemTimer::TimerDone()
void CSystemTimer::SetCompareTimer()
{
DWORD NextCompare = 0x7FFFFFFF;
uint32_t NextCompare = 0x7FFFFFFF;
if (g_Reg)
{
NextCompare = g_Reg->COMPARE_REGISTER - g_Reg->COUNT_REGISTER;
@ -296,8 +301,8 @@ bool CSystemTimer::SaveAllowed ( void )
void CSystemTimer::SaveData ( void * file ) const
{
DWORD TimerDetailsSize = sizeof(TIMER_DETAILS);
DWORD Entries = sizeof(m_TimerDetatils)/sizeof(m_TimerDetatils[0]);
uint32_t TimerDetailsSize = sizeof(TIMER_DETAILS);
uint32_t Entries = sizeof(m_TimerDetatils)/sizeof(m_TimerDetatils[0]);
zipWriteInFileInZip(file,&TimerDetailsSize,sizeof(TimerDetailsSize));
zipWriteInFileInZip(file,&Entries,sizeof(Entries));
zipWriteInFileInZip(file,(void *)&m_TimerDetatils,sizeof(m_TimerDetatils));
@ -308,7 +313,7 @@ void CSystemTimer::SaveData ( void * file ) const
void CSystemTimer::LoadData ( void * file )
{
DWORD TimerDetailsSize, Entries;
uint32_t TimerDetailsSize, Entries;
unzReadCurrentFile( file,&TimerDetailsSize,sizeof(TimerDetailsSize));
unzReadCurrentFile( file,&Entries,sizeof(Entries));
@ -357,7 +362,7 @@ void CSystemTimer::RecordDifference( CLog &LogFile, const CSystemTimer& rSystemT
}
if (m_TimerDetatils[i].CyclesToTimer != rSystemTimer.m_TimerDetatils[i].CyclesToTimer)
{
LogFile.LogF("Timer-m_TimerDetatils[%d] 0x%08X, 0x%08X\r\n",i,(DWORD)m_TimerDetatils[i].CyclesToTimer,(DWORD)rSystemTimer.m_TimerDetatils[i].CyclesToTimer );
LogFile.LogF("Timer-m_TimerDetatils[%d] 0x%08X, 0x%08X\r\n",i,(uint32_t)m_TimerDetatils[i].CyclesToTimer,(uint32_t)rSystemTimer.m_TimerDetatils[i].CyclesToTimer );
}
}
}

View File

@ -10,7 +10,8 @@
****************************************************************************/
#pragma once
#include "../N64Types.h"
#include <Common/LogClass.h>
#include <Project64-core/N64System/N64Types.h>
class CSystemTimer
{
@ -39,8 +40,8 @@ public:
public:
CSystemTimer ( int & NextTimer );
void SetTimer ( TimerType Type, DWORD Cycles, bool bRelative );
DWORD GetTimer ( TimerType Type );
void SetTimer(TimerType Type, uint32_t Cycles, bool bRelative);
uint32_t GetTimer(TimerType Type);
void StopTimer ( TimerType Type );
void UpdateTimers ();
void TimerDone ();

View File

@ -10,6 +10,9 @@
****************************************************************************/
#pragma once
#include <Common/LogClass.h>
#include "RegisterClass.h"
class CDebugTlb;
__interface CTLB_CB

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "TLBClass.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include "RegisterClass.h"
CTLB::CTLB(CTLB_CB * CallBack ):
m_CB(CallBack)

View File

@ -9,7 +9,18 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <common/Util.h>
#include "N64class.h"
#include <Project64-core/3rdParty/zip.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/Mempak.H>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/ExceptionHandler.h>
#include <Project64-core/Logging.h>
#include <Project64-core/Debugger.h>
#include <Common/Util.h>
#include <float.h>
#pragma warning(disable:4355) // Disable 'this' : used in base member initializer list
@ -1381,7 +1392,7 @@ bool CN64System::SaveState()
CPath SavedFileName(FileName);
g_Notify->DisplayMessage(5, stdstr_f("%ws %s", SaveMessage.c_str(), SavedFileName.GetNameExtension().c_str()).ToUTF16().c_str());
Notify().RefreshMenu();
//Notify().RefreshMenu();
WriteTrace(TraceDebug, __FUNCTION__ ": Done");
return true;
}

View File

@ -11,7 +11,22 @@
#pragma once
#include <Common/SyncEvent.h>
#include <Project64/Logging.h>
#include <Project64-core/Settings/N64SystemSettings.h>
#include <Project64-core/N64System/Recompiler/RecompilerClass.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/Plugin.h>
#include <Project64-core/Logging.h>
#include "Mips/SystemEvents.h"
#include "Mips/MemoryClass.h"
#include "Mips/TLBClass.h"
#include "Mips/Audio.h"
#include "Mips/SystemTiming.h"
#include "ProfilingClass.h"
#include "CheatClass.h"
#include "FramePerSecondClass.h"
#include "SpeedLimitorClass.h"
typedef std::list<SystemEvent> EVENT_LIST;

View File

@ -9,6 +9,12 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "N64RomClass.h"
#include "SystemGlobals.h"
#include <Project64-core/3rdParty/zip.h>
#include <Project64-core/3rdParty/7zip.h>
#include <Common/md5.h>
#include <Windows.h>
CN64Rom::CN64Rom()
{

View File

@ -10,7 +10,8 @@
****************************************************************************/
#pragma once
#include "N64Types.h"
#include <Project64-core/N64System/N64Types.h>
#include <Project64-core/Settings/DebugSettings.h>
class CN64Rom :
protected CDebugSettings

View File

@ -9,6 +9,8 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "ProfilingClass.h"
#include <Common/LogClass.h>
enum { MAX_FRAMES = 13 };
@ -26,8 +28,9 @@ SPECIAL_TIMERS CProfiling::StartTimer(SPECIAL_TIMERS Address)
m_CurrentTimerAddr = Address;
#ifdef _M_IX86
DWORD HiValue, LoValue;
_asm {
uint32_t HiValue, LoValue;
_asm
{
pushad
rdtsc
mov HiValue, edx
@ -43,7 +46,7 @@ SPECIAL_TIMERS CProfiling::StartTimer(SPECIAL_TIMERS Address)
}
SPECIAL_TIMERS CProfiling::StopTimer() {
DWORD HiValue, LoValue;
uint32_t HiValue, LoValue;
if (m_CurrentTimerAddr == Timer_None) { return m_CurrentTimerAddr; }
@ -182,6 +185,5 @@ void CProfiling::GenerateLog() {
}
}
ShellExecute(NULL,"open",LogFileName.c_str(),NULL,NULL,SW_SHOW);
ResetCounters();
}

View File

@ -9,7 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "N64Types.h"
#include <Project64-core/N64System/N64Types.h>
typedef std::map<SPECIAL_TIMERS, __int64 > PROFILE_ENRTIES;
typedef PROFILE_ENRTIES::iterator PROFILE_ENRTY;
@ -38,8 +38,7 @@ private:
CProfiling& operator=(const CProfiling&); // Disable assignment
SPECIAL_TIMERS m_CurrentTimerAddr;
DWORD m_CurrentDisplayCount;
DWORD m_StartTimeHi, m_StartTimeLo; //The Current Timer start time
uint32_t m_CurrentDisplayCount;
uint32_t m_StartTimeHi, m_StartTimeLo; //The Current Timer start time
PROFILE_ENRTIES m_Entries;
};

View File

@ -9,6 +9,12 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "CodeBlock.h"
#include "x86CodeLog.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/TranslateVaddr.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
bool DelaySlotEffectsCompare (uint32_t PC, uint32_t Reg1, uint32_t Reg2);

View File

@ -9,6 +9,10 @@
* *
****************************************************************************/
#pragma once
#include <common/md5.h>
#include "RecompilerOps.h"
#include "ExitInfo.h"
#include "CodeSection.h"
class CCodeBlock :
private CRecompilerOps

View File

@ -10,15 +10,16 @@
****************************************************************************/
#include "stdafx.h"
#include "CodeSection.h"
#include <Project64/N64System/Mips/OpCode.h>
#include <Project64/N64System/SystemGlobals.h>
#include <Project64/N64System/Mips/MemoryClass.h>
#include <Project64/N64System/Recompiler/x86CodeLog.h>
#include <Project64/N64System/Recompiler/CodeBlock.h>
#include <Project64/N64System/N64Class.h>
#include <Project64/N64System/Interpreter/InterpreterCPU.h>
#include <Project64/N64System/Recompiler/LoopAnalysis.h>
#include <Project64/N64System/Recompiler/SectionInfo.h>
#include <Project64-core/N64System/Mips/OpCode.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/Recompiler/CodeBlock.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/N64System/Recompiler/LoopAnalysis.h>
#include <Project64-core/N64System/Recompiler/SectionInfo.h>
#include <Windows.h>
void InPermLoop();

View File

@ -9,6 +9,8 @@
* *
****************************************************************************/
#pragma once
#include "JumpInfo.h"
#include <Project64-core/N64System/Recompiler/RecompilerOps.h>
class CCodeBlock;

View File

@ -10,6 +10,8 @@
****************************************************************************/
#pragma once
#include <Project64-core/N64System/Recompiler/RegInfo.h>
struct CExitInfo
{
enum EXIT_REASON

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "FunctionInfo.h"
CCompiledFunc::CCompiledFunc( const CCodeBlock & CodeBlock ) :
m_EnterPC(CodeBlock.VAddrEnter()),

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "CodeBlock.h"
class CCompiledFunc
{

View File

@ -9,6 +9,10 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "FunctionMapClass.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include <Windows.h>
CFunctionMap::CFunctionMap() :
m_JumpTable(NULL),

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "FunctionInfo.h"
class CFunctionMap
{

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "ExitInfo.h"
struct CJumpInfo
{

View File

@ -9,6 +9,13 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "LoopAnalysis.h"
#include <Project64-core/N64System/N64Types.h>
#include <Project64-core/N64System/Recompiler/CodeBlock.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#ifdef _DEBUG
#define CHECKED_BUILD 1

View File

@ -10,6 +10,9 @@
****************************************************************************/
#pragma once
#include <Project64-core/N64System/Recompiler/RegInfo.h>
#include <Project64-core/N64System/Mips/OpCode.h>
class CCodeSection;
class CCodeBlock;

View File

@ -9,6 +9,12 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "RecompilerClass.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Recompiler/x86CodeLog.h>
#include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Objbase.h>
CRecompiler::CRecompiler(CRegisters & Registers, CProfiling & Profile, bool & EndEmulation) :
m_Registers(Registers),

View File

@ -9,6 +9,10 @@
* *
****************************************************************************/
#pragma once
#include <Project64-core/Settings/RecompilerSettings.h>
#include <Project64-core/N64System/Recompiler/FunctionMapClass.h>
#include <Project64-core/N64System/ProfilingClass.h>
#include "RecompilerMemory.h"
class CRecompiler :
protected CDebugSettings,

View File

@ -9,6 +9,10 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "RecompilerMemory.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Recompiler/RecompilerClass.h>
#include <Windows.h>
CRecompMemory::CRecompMemory() :
m_RecompCode(NULL),
@ -29,7 +33,7 @@ CRecompMemory::~CRecompMemory()
bool CRecompMemory::AllocateMemory()
{
BYTE * RecompCodeBase = (BYTE *)VirtualAlloc(NULL, MaxCompileBufferSize + 4, MEM_RESERVE | MEM_TOP_DOWN, PAGE_EXECUTE_READWRITE);
uint8_t * RecompCodeBase = (uint8_t *)VirtualAlloc(NULL, MaxCompileBufferSize + 4, MEM_RESERVE | MEM_TOP_DOWN, PAGE_EXECUTE_READWRITE);
if (RecompCodeBase == NULL)
{
WriteTrace(TraceError, __FUNCTION__ ": failed to allocate RecompCodeBase");
@ -37,7 +41,7 @@ bool CRecompMemory::AllocateMemory()
return false;
}
m_RecompCode = (BYTE *)VirtualAlloc(RecompCodeBase, InitialCompileBufferSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
m_RecompCode = (uint8_t *)VirtualAlloc(RecompCodeBase, InitialCompileBufferSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (m_RecompCode == NULL)
{
WriteTrace(TraceError, __FUNCTION__ ": failed to commit initial buffer");
@ -53,7 +57,7 @@ bool CRecompMemory::AllocateMemory()
void CRecompMemory::CheckRecompMem()
{
DWORD Size = (DWORD)((BYTE *)m_RecompPos - (BYTE *)m_RecompCode);
uint32_t Size = (uint32_t)((uint8_t *)m_RecompPos - (uint8_t *)m_RecompCode);
if ((Size + 0x20000) < m_RecompSize)
{
return;
@ -79,13 +83,13 @@ void CRecompMemory::Reset()
void CRecompMemory::ShowMemUsed()
{
DWORD Size = m_RecompPos - m_RecompCode;
DWORD MB = Size / 0x100000;
uint32_t Size = m_RecompPos - m_RecompCode;
uint32_t MB = Size / 0x100000;
Size -= MB * 0x100000;
DWORD KB = Size / 1024;
uint32_t KB = Size / 1024;
Size -= KB * 1024;
DWORD TotalAvaliable = m_RecompSize / 0x100000;
uint32_t TotalAvaliable = m_RecompSize / 0x100000;
g_Notify->DisplayMessage(0, stdstr_f("Memory used: %d mb %-3d kb %-3d bytes Total Available: %d mb", MB, KB, Size, TotalAvaliable).ToUTF16().c_str());
}

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#pragma once
#include "X86ops.h"
class CRecompMemory :
protected CX86Ops

View File

@ -9,6 +9,16 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/OpcodeName.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Interpreter/InterpreterOps.h>
#include <Project64-core/N64System/Interpreter/InterpreterCPU.h>
#include <Project64-core/N64System/N64Class.h>
#include "RecompilerClass.h"
#include "RecompilerOps.h"
#include "CodeSection.h"
#include "x86CodeLog.h"
CCodeSection * CRecompilerOps::m_Section = NULL;
CRegInfo CRecompilerOps::m_RegWorkingSet;
@ -5491,7 +5501,7 @@ void CRecompilerOps::COP0_CO_TLBWI(void)
CPU_Message(" %X %s", m_CompilePC, R4300iOpcodeName(m_Opcode.Hex, m_CompilePC));
if (!g_System->bUseTlb()) { return; }
BeforeCallDirect(m_RegWorkingSet);
PushImm32("FALSE", 0);
PushImm32("false", 0);
MoveVariableToX86reg(&g_Reg->INDEX_REGISTER, "INDEX_REGISTER", x86_ECX);
AndConstToX86Reg(x86_ECX, 0x1F);
Push(x86_ECX);

View File

@ -10,8 +10,13 @@
****************************************************************************/
#pragma once
#include <Project64/Settings/N64SystemSettings.h>
#include <Project64/Settings/RecompilerSettings.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/Mips/OpCode.h>
#include <Project64-core/N64System/Recompiler/RegInfo.h>
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/Settings/N64SystemSettings.h>
#include <Project64-core/Settings/RecompilerSettings.h>
#include "X86ops.h"
class CCodeSection;

View File

@ -9,6 +9,11 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h>
#include "RegInfo.h"
#include "RecompilerClass.h"
#include "x86CodeLog.h"
uint32_t CRegInfo::m_fpuControl = 0;
@ -1137,7 +1142,7 @@ void CRegInfo::UnMap_GPR(uint32_t Reg, bool WriteBackValue)
}
if (IsUnknown(Reg)) { return; }
//CPU_Message("UnMap_GPR: State: %X\tReg: %s\tWriteBack: %s",State,CRegName::GPR[Reg],WriteBackValue?"TRUE":"FALSE");
//CPU_Message("UnMap_GPR: State: %X\tReg: %s\tWriteBack: %s",State,CRegName::GPR[Reg],WriteBackValue?"true":"false");
if (IsConst(Reg))
{
if (!WriteBackValue)

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#pragma once
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include "X86ops.h"
class CRegInfo :
private CDebugSettings,

View File

@ -9,6 +9,8 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "SectionInfo.h"
#include "JumpInfo.h"
CJumpInfo::CJumpInfo()
{

View File

@ -9,6 +9,10 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include "X86ops.h"
#include "x86CodeLog.h"
#define PUTDST8(dest,value) (*((uint8_t *)(dest))=(uint8_t)(value)); dest += 1;
#define PUTDST16(dest,value) (*((uint16_t *)(dest))=(uint16_t)(value)); dest += 2;

View File

@ -9,6 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "x86CodeLog.h"
#include <Common/path.h>
#include <Windows.h>
static HANDLE hCPULogFile = NULL;
bool bX86Logging = false;

View File

@ -9,6 +9,7 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "SystemGlobals.h"
CN64System * g_System = NULL;
CN64System * g_BaseSystem = NULL;

View File

@ -10,21 +10,42 @@
****************************************************************************/
#pragma once
extern CNotification * g_Notify;
class CSettings;
extern CSettings * g_Settings;
class CN64System;
extern CN64System * g_System;
extern CN64System * g_BaseSystem;
extern CN64System * g_SyncSystem;
class CRecompiler;
extern CRecompiler * g_Recompiler;
__interface CMipsMemory;
extern CMipsMemory * g_MMU; //Memory of the n64
class CTLB;
extern CTLB * g_TLB; //TLB Unit
class CRegisters;
extern CRegisters * g_Reg; //Current Register Set attached to the g_MMU
class CPlugins;
extern CPlugins * g_Plugins;
class CN64Rom;
extern CN64Rom * g_Rom; //The current rom that this system is executing.. it can only execute one file at the time
class CAudio;
extern CAudio * g_Audio;
class CSystemTimer;
extern CSystemTimer * g_SystemTimer;
__interface CTransVaddr;
extern CTransVaddr * g_TransVaddr;
class CSystemEvents;
extern CSystemEvents * g_SystemEvents;
extern int32_t * g_NextTimer;

View File

@ -0,0 +1 @@
#include "../stdafx.h"

View File

@ -0,0 +1,34 @@
#pragma once
#include "Multilanguage.h"
#ifndef _MSC_VER
#define __interface struct
#endif
__interface CNotification
{
public:
//Error Messages
virtual void DisplayError(const wchar_t * Message) const = 0;
virtual void DisplayError(LanguageStringID StringID) const = 0;
virtual void FatalError(const wchar_t * Message) const = 0;
virtual void FatalError(LanguageStringID StringID) const = 0;
//User Feedback
virtual void DisplayMessage(int DisplayTime, const wchar_t * Message) const = 0;
virtual void DisplayMessage(int DisplayTime, LanguageStringID StringID) const = 0;
virtual void DisplayMessage2(const wchar_t * Message) const = 0;
// Ask a Yes/No Question to the user, yes = true, no = false
virtual bool AskYesNoQuestion(const wchar_t * Question) const = 0;
virtual void BreakPoint(const wchar_t * FileName, int LineNumber) = 0;
virtual void AppInitDone(void) = 0;
virtual bool ProcessGuiMessages(void) const = 0;
virtual void ChangeFullScreen(void) const = 0;
};
extern CNotification * g_Notify;

View File

@ -10,8 +10,6 @@
****************************************************************************/
#pragma once
#include "Support.h"
//Plugin controller
#include "Plugins/PluginClass.h"
@ -22,4 +20,3 @@
#include "Plugins/AudioPlugin.h"
#include "Plugins/ControllerPlugin.h"
#include "Plugins/RSPPlugin.h"
#include "Plugins/PluginList.h"

View File

@ -9,6 +9,13 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64RomClass.h>
#include <Project64-core/N64System/Mips/MemoryClass.h>
#include <Project64-core/N64System/Mips/RegisterClass.h>
#include <Project64-core/N64System/N64Class.h>
#include "AudioPlugin.h"
#include <Windows.h>
CAudioPlugin::CAudioPlugin() :
AiLenChanged(NULL),

Some files were not shown because too many files have changed in this diff Show More