mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-19 02:36:27 +01:00
Remove all tab/space mismatches from the Core project. For anyone working on a branch that heavily involves the core, I am so sorry.
- Also killed off some trailing spaces/tabs. - Updated the license header to be consistent with the rest of the project (All projects are now done moving over to this) - Also, killed some dangling else's (where appropriate) Now all the tab fixing is done. No more of this crap should be needed to be pushed. Rejoice!
This commit is contained in:
parent
f498686289
commit
2316cb6876
@ -16,7 +16,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "ARDecrypt.h"
|
#include "ARDecrypt.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#ifndef _ARDECRYPT_H_
|
#ifndef _ARDECRYPT_H_
|
||||||
#define _ARDECRYPT_H_
|
#define _ARDECRYPT_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------
|
||||||
@ -198,8 +198,10 @@ void LoadCodes(IniFile &ini, bool forceLoad)
|
|||||||
if (!success_val) PanicAlertT("The value is invalid");
|
if (!success_val) PanicAlertT("The value is invalid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
currentCode.ops.push_back(op);
|
currentCode.ops.push_back(op);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SplitString(line, '-', pieces);
|
SplitString(line, '-', pieces);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _ACTIONREPLAY_H_
|
#ifndef _ACTIONREPLAY_H_
|
||||||
|
@ -53,7 +53,8 @@
|
|||||||
|
|
||||||
void CBoot::Load_FST(bool _bIsWii)
|
void CBoot::Load_FST(bool _bIsWii)
|
||||||
{
|
{
|
||||||
if (!VolumeHandler::IsValid()) return;
|
if (!VolumeHandler::IsValid())
|
||||||
|
return;
|
||||||
|
|
||||||
// copy first 20 bytes of disc to start of Mem 1
|
// copy first 20 bytes of disc to start of Mem 1
|
||||||
VolumeHandler::ReadToPtr(Memory::GetPointer(0x80000000), 0, 0x20);
|
VolumeHandler::ReadToPtr(Memory::GetPointer(0x80000000), 0, 0x20);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _BOOT_H
|
#ifndef _BOOT_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Boot_DOL.h"
|
#include "Boot_DOL.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _BOOT_DOL_H
|
#ifndef _BOOT_DOL_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Boot.h"
|
#include "Boot.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _ELFREADER_H
|
#ifndef _ELFREADER_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// File description
|
// File description
|
||||||
@ -78,7 +78,8 @@ bool BootCore(const std::string& _rFilename)
|
|||||||
StartUp.hInstance = Host_GetInstance();
|
StartUp.hInstance = Host_GetInstance();
|
||||||
|
|
||||||
// If for example the ISO file is bad we return here
|
// If for example the ISO file is bad we return here
|
||||||
if (!StartUp.AutoSetup(SCoreStartupParameter::BOOT_DEFAULT)) return false;
|
if (!StartUp.AutoSetup(SCoreStartupParameter::BOOT_DEFAULT))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Load game specific settings
|
// Load game specific settings
|
||||||
IniFile game_ini;
|
IniFile game_ini;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _BOOTMANAGER_H
|
#ifndef _BOOTMANAGER_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -65,7 +65,7 @@ static const struct {
|
|||||||
|
|
||||||
{ "StartRecording", 0, 0 /* wxMOD_NONE */ },
|
{ "StartRecording", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "PlayRecording", 0, 0 /* wxMOD_NONE */ },
|
{ "PlayRecording", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "ExportRecording", 0, 0 /* wxMOD_NONE */ },
|
{ "ExportRecording",0, 0 /* wxMOD_NONE */ },
|
||||||
{ "Readonlymode", 0, 0 /* wxMOD_NONE */ },
|
{ "Readonlymode", 0, 0 /* wxMOD_NONE */ },
|
||||||
|
|
||||||
{ "ToggleFullscreen", 13 /* WXK_RETURN */, 1 /* wxMOD_ALT */ },
|
{ "ToggleFullscreen", 13 /* WXK_RETURN */, 1 /* wxMOD_ALT */ },
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _CONFIGMANAGER_H
|
#ifndef _CONFIGMANAGER_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -150,5 +150,7 @@ void Console_Submit(const char *cmd)
|
|||||||
g_symbolDB.List();
|
g_symbolDB.List();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(CONSOLE, "Invalid command");
|
ERROR_LOG(CONSOLE, "Invalid command");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
|
||||||
@ -143,7 +143,9 @@ void DisplayMessage(const char *message, int time_in_ms)
|
|||||||
Host_UpdateStatusBar(message);
|
Host_UpdateStatusBar(message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Host_UpdateTitle(message);
|
Host_UpdateTitle(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Callback_DebuggerBreak()
|
void Callback_DebuggerBreak()
|
||||||
@ -555,7 +557,9 @@ static std::string GenerateScreenshotName()
|
|||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
|
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
|
||||||
{}
|
{
|
||||||
|
// TODO?
|
||||||
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -614,7 +618,8 @@ void VideoThrottle()
|
|||||||
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
|
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
|
||||||
|
|
||||||
u32 timeDifference = (u32)Timer.GetTimeDifference();
|
u32 timeDifference = (u32)Timer.GetTimeDifference();
|
||||||
if (timeDifference < frametime) {
|
if (timeDifference < frametime)
|
||||||
|
{
|
||||||
Common::SleepCurrentThread(frametime - timeDifference - 1);
|
Common::SleepCurrentThread(frametime - timeDifference - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,10 +747,12 @@ void UpdateTitle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_CoreParameter.bRenderToMain &&
|
if (_CoreParameter.bRenderToMain &&
|
||||||
SConfig::GetInstance().m_InterfaceStatusbar) {
|
SConfig::GetInstance().m_InterfaceStatusbar)
|
||||||
|
{
|
||||||
Host_UpdateStatusBar(SMessage.c_str());
|
Host_UpdateStatusBar(SMessage.c_str());
|
||||||
Host_UpdateTitle(scm_rev_str);
|
Host_UpdateTitle(scm_rev_str);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
Host_UpdateTitle(TMessage.c_str());
|
Host_UpdateTitle(TMessage.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _COREPARAMETER_H
|
#ifndef _COREPARAMETER_H
|
||||||
@ -21,7 +21,8 @@
|
|||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
enum Hotkey {
|
enum Hotkey
|
||||||
|
{
|
||||||
HK_OPEN,
|
HK_OPEN,
|
||||||
HK_CHANGE_DISC,
|
HK_CHANGE_DISC,
|
||||||
HK_REFRESH_LIST,
|
HK_REFRESH_LIST,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -262,7 +262,9 @@ void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata)
|
|||||||
event_types[event_type].callback(userdata, 0);
|
event_types[event_type].callback(userdata, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ScheduleEvent_Threadsafe(0, event_type, userdata);
|
ScheduleEvent_Threadsafe(0, event_type, userdata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearPendingEvents()
|
void ClearPendingEvents()
|
||||||
@ -327,6 +329,7 @@ void RemoveEvent(int event_type)
|
|||||||
{
|
{
|
||||||
if (!first)
|
if (!first)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while(first)
|
while(first)
|
||||||
{
|
{
|
||||||
if (first->type == event_type)
|
if (first->type == event_type)
|
||||||
@ -340,8 +343,10 @@ void RemoveEvent(int event_type)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Event *prev = first;
|
Event *prev = first;
|
||||||
Event *ptr = prev->next;
|
Event *ptr = prev->next;
|
||||||
while (ptr)
|
while (ptr)
|
||||||
@ -367,6 +372,7 @@ void RemoveThreadsafeEvent(int event_type)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(tsFirst)
|
while(tsFirst)
|
||||||
{
|
{
|
||||||
if (tsFirst->type == event_type)
|
if (tsFirst->type == event_type)
|
||||||
@ -380,10 +386,12 @@ void RemoveThreadsafeEvent(int event_type)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tsFirst)
|
if (!tsFirst)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Event *prev = tsFirst;
|
Event *prev = tsFirst;
|
||||||
Event *ptr = prev->next;
|
Event *ptr = prev->next;
|
||||||
while (ptr)
|
while (ptr)
|
||||||
@ -499,6 +507,7 @@ void Advance()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
{
|
{
|
||||||
WARN_LOG(POWERPC, "WARNING - no events in queue. Setting downcount to 10000");
|
WARN_LOG(POWERPC, "WARNING - no events in queue. Setting downcount to 10000");
|
||||||
@ -511,6 +520,7 @@ void Advance()
|
|||||||
slicelength = maxSliceLength;
|
slicelength = maxSliceLength;
|
||||||
downcount = slicelength;
|
downcount = slicelength;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (advanceCallback)
|
if (advanceCallback)
|
||||||
advanceCallback(cyclesExecuted);
|
advanceCallback(cyclesExecuted);
|
||||||
}
|
}
|
||||||
@ -554,9 +564,11 @@ std::string GetScheduledEventsSummary()
|
|||||||
unsigned int t = ptr->type;
|
unsigned int t = ptr->type;
|
||||||
if (t >= event_types.size())
|
if (t >= event_types.size())
|
||||||
PanicAlertT("Invalid event type %i", t);
|
PanicAlertT("Invalid event type %i", t);
|
||||||
|
|
||||||
const char *name = event_types[ptr->type].name;
|
const char *name = event_types[ptr->type].name;
|
||||||
if (!name)
|
if (!name)
|
||||||
name = "[unknown]";
|
name = "[unknown]";
|
||||||
|
|
||||||
text += StringFromFormat("%s : %i %08x%08x\n", event_types[ptr->type].name, ptr->time, ptr->userdata >> 32, ptr->userdata);
|
text += StringFromFormat("%s : %i %08x%08x\n", event_types[ptr->type].name, ptr->time, ptr->userdata >> 32, ptr->userdata);
|
||||||
ptr = ptr->next;
|
ptr = ptr->next;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _CORETIMING_H
|
#ifndef _CORETIMING_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSP_ACCELERATOR_H
|
#ifndef _DSP_ACCELERATOR_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "DSPAnalyzer.h"
|
#include "DSPAnalyzer.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Basic code analysis.
|
// Basic code analysis.
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSP_BREAKPOINTS
|
#ifndef _DSP_BREAKPOINTS
|
||||||
@ -21,38 +21,53 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
// super fast breakpoints for a limited range.
|
// super fast breakpoints for a limited range.
|
||||||
// To be used interchangably with the BreakPoints class.
|
// To be used interchangeably with the BreakPoints class.
|
||||||
class DSPBreakpoints
|
class DSPBreakpoints
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DSPBreakpoints() {Clear();}
|
DSPBreakpoints()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// is address breakpoint
|
// is address breakpoint
|
||||||
bool IsAddressBreakPoint(u32 addr) {
|
bool IsAddressBreakPoint(u32 addr)
|
||||||
|
{
|
||||||
return b[addr] != 0;
|
return b[addr] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddBreakPoint
|
// AddBreakPoint
|
||||||
bool Add(u32 addr, bool temp=false) {
|
bool Add(u32 addr, bool temp=false)
|
||||||
|
{
|
||||||
bool was_one = b[addr] != 0;
|
bool was_one = b[addr] != 0;
|
||||||
if (!was_one) {
|
|
||||||
|
if (!was_one)
|
||||||
|
{
|
||||||
b[addr] = temp ? 2 : 1;
|
b[addr] = temp ? 2 : 1;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove Breakpoint
|
// Remove Breakpoint
|
||||||
bool Remove(u32 addr) {
|
bool Remove(u32 addr)
|
||||||
|
{
|
||||||
bool was_one = b[addr] != 0;
|
bool was_one = b[addr] != 0;
|
||||||
b[addr] = 0;
|
b[addr] = 0;
|
||||||
return was_one;
|
return was_one;
|
||||||
}
|
}
|
||||||
void Clear() {
|
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
for (int i = 0; i < 65536; i++)
|
for (int i = 0; i < 65536; i++)
|
||||||
b[i] = 0;
|
b[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteByAddress(u32 addr) {
|
void DeleteByAddress(u32 addr)
|
||||||
|
{
|
||||||
b[addr] = 0;
|
b[addr] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -38,7 +38,8 @@ bool Assemble(const char *text, std::vector<u16> &code, bool force)
|
|||||||
|
|
||||||
// TODO: fix the terrible api of the assembler.
|
// TODO: fix the terrible api of the assembler.
|
||||||
DSPAssembler assembler(settings);
|
DSPAssembler assembler(settings);
|
||||||
if (!assembler.Assemble(text, code)) {
|
if (!assembler.Assemble(text, code))
|
||||||
|
{
|
||||||
std::cerr << assembler.GetErrorString() << std::endl;
|
std::cerr << assembler.GetErrorString() << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -77,7 +78,9 @@ bool Compare(const std::vector<u16> &code1, const std::vector<u16> &code2)
|
|||||||
for (int i = 0; i < min_size; i++)
|
for (int i = 0; i < min_size; i++)
|
||||||
{
|
{
|
||||||
if (code1[i] == code2[i])
|
if (code1[i] == code2[i])
|
||||||
|
{
|
||||||
count_equal++;
|
count_equal++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string line1, line2;
|
std::string line1, line2;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPCODEUTIL_H
|
#ifndef _DSPCODEUTIL_H
|
||||||
|
@ -260,11 +260,13 @@ void DSPCore_CheckExceptions()
|
|||||||
if (g_dsp.exceptions == 0)
|
if (g_dsp.exceptions == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 7; i > 0; i--) {
|
for (int i = 7; i > 0; i--)
|
||||||
|
{
|
||||||
// Seems exp int are not masked by sr_int_enable
|
// Seems exp int are not masked by sr_int_enable
|
||||||
if (g_dsp.exceptions & (1 << i)) {
|
if (g_dsp.exceptions & (1 << i))
|
||||||
if (dsp_SR_is_flag_set(SR_INT_ENABLE) || (i == EXP_INT)) {
|
{
|
||||||
|
if (dsp_SR_is_flag_set(SR_INT_ENABLE) || (i == EXP_INT))
|
||||||
|
{
|
||||||
// store pc and sr until RTI
|
// store pc and sr until RTI
|
||||||
dsp_reg_store_stack(DSP_STACK_C, g_dsp.pc);
|
dsp_reg_store_stack(DSP_STACK_C, g_dsp.pc);
|
||||||
dsp_reg_store_stack(DSP_STACK_D, g_dsp.r.sr);
|
dsp_reg_store_stack(DSP_STACK_D, g_dsp.r.sr);
|
||||||
@ -276,7 +278,9 @@ void DSPCore_CheckExceptions()
|
|||||||
else
|
else
|
||||||
g_dsp.r.sr &= ~SR_INT_ENABLE;
|
g_dsp.r.sr &= ~SR_INT_ENABLE;
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
ERROR_LOG(DSPLLE, "Firing exception %d failed", i);
|
ERROR_LOG(DSPLLE, "Firing exception %d failed", i);
|
||||||
#endif
|
#endif
|
||||||
@ -381,8 +385,10 @@ void CompileCurrent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 DSPCore_ReadRegister(int reg) {
|
u16 DSPCore_ReadRegister(int reg)
|
||||||
switch(reg) {
|
{
|
||||||
|
switch(reg)
|
||||||
|
{
|
||||||
case DSP_REG_AR0:
|
case DSP_REG_AR0:
|
||||||
case DSP_REG_AR1:
|
case DSP_REG_AR1:
|
||||||
case DSP_REG_AR2:
|
case DSP_REG_AR2:
|
||||||
@ -430,8 +436,10 @@ u16 DSPCore_ReadRegister(int reg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPCore_WriteRegister(int reg, u16 val) {
|
void DSPCore_WriteRegister(int reg, u16 val)
|
||||||
switch(reg) {
|
{
|
||||||
|
switch(reg)
|
||||||
|
{
|
||||||
case DSP_REG_AR0:
|
case DSP_REG_AR0:
|
||||||
case DSP_REG_AR1:
|
case DSP_REG_AR1:
|
||||||
case DSP_REG_AR2:
|
case DSP_REG_AR2:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -147,28 +147,38 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
|||||||
bool ext_is_jit = false;
|
bool ext_is_jit = false;
|
||||||
|
|
||||||
// Call extended
|
// Call extended
|
||||||
if (tinst->extended) {
|
if (tinst->extended)
|
||||||
if ((inst >> 12) == 0x3) {
|
{
|
||||||
if (! extOpTable[inst & 0x7F]->jitFunc) {
|
if ((inst >> 12) == 0x3)
|
||||||
|
{
|
||||||
|
if (! extOpTable[inst & 0x7F]->jitFunc)
|
||||||
|
{
|
||||||
// Fall back to interpreter
|
// Fall back to interpreter
|
||||||
gpr.pushRegs();
|
gpr.pushRegs();
|
||||||
ABI_CallFunctionC16((void*)extOpTable[inst & 0x7F]->intFunc, inst);
|
ABI_CallFunctionC16((void*)extOpTable[inst & 0x7F]->intFunc, inst);
|
||||||
gpr.popRegs();
|
gpr.popRegs();
|
||||||
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
|
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
|
||||||
ext_is_jit = false;
|
ext_is_jit = false;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
(this->*extOpTable[inst & 0x7F]->jitFunc)(inst);
|
(this->*extOpTable[inst & 0x7F]->jitFunc)(inst);
|
||||||
ext_is_jit = true;
|
ext_is_jit = true;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
if (!extOpTable[inst & 0xFF]->jitFunc) {
|
else
|
||||||
|
{
|
||||||
|
if (!extOpTable[inst & 0xFF]->jitFunc)
|
||||||
|
{
|
||||||
// Fall back to interpreter
|
// Fall back to interpreter
|
||||||
gpr.pushRegs();
|
gpr.pushRegs();
|
||||||
ABI_CallFunctionC16((void*)extOpTable[inst & 0xFF]->intFunc, inst);
|
ABI_CallFunctionC16((void*)extOpTable[inst & 0xFF]->intFunc, inst);
|
||||||
gpr.popRegs();
|
gpr.popRegs();
|
||||||
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
|
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
|
||||||
ext_is_jit = false;
|
ext_is_jit = false;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
(this->*extOpTable[inst & 0xFF]->jitFunc)(inst);
|
(this->*extOpTable[inst & 0xFF]->jitFunc)(inst);
|
||||||
ext_is_jit = true;
|
ext_is_jit = true;
|
||||||
}
|
}
|
||||||
@ -176,7 +186,8 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main instruction
|
// Main instruction
|
||||||
if (!opTable[inst]->jitFunc) {
|
if (!opTable[inst]->jitFunc)
|
||||||
|
{
|
||||||
Default(inst);
|
Default(inst);
|
||||||
INFO_LOG(DSPLLE, "Instruction not JITed(main part): %04x\n", inst);
|
INFO_LOG(DSPLLE, "Instruction not JITed(main part): %04x\n", inst);
|
||||||
}
|
}
|
||||||
@ -186,14 +197,18 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Backlog
|
// Backlog
|
||||||
if (tinst->extended) {
|
if (tinst->extended)
|
||||||
if (!ext_is_jit) {
|
{
|
||||||
|
if (!ext_is_jit)
|
||||||
|
{
|
||||||
//need to call the online cleanup function because
|
//need to call the online cleanup function because
|
||||||
//the writeBackLog gets populated at runtime
|
//the writeBackLog gets populated at runtime
|
||||||
gpr.pushRegs();
|
gpr.pushRegs();
|
||||||
ABI_CallFunction((void*)::applyWriteBackLog);
|
ABI_CallFunction((void*)::applyWriteBackLog);
|
||||||
gpr.popRegs();
|
gpr.popRegs();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
popExtValueToReg();
|
popExtValueToReg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -322,7 +337,8 @@ void DSPEmitter::Compile(u16 start_addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fixup_pc) {
|
if (fixup_pc)
|
||||||
|
{
|
||||||
MOV(16, M(&(g_dsp.pc)), Imm16(compilePC));
|
MOV(16, M(&(g_dsp.pc)), Imm16(compilePC));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPEMITTER_H
|
#ifndef _DSPEMITTER_H
|
||||||
|
@ -154,7 +154,8 @@ void gdsp_ifx_write(u32 addr, u32 val)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DSP_GAIN:
|
case DSP_GAIN:
|
||||||
if (val) {
|
if (val)
|
||||||
|
{
|
||||||
INFO_LOG(DSPLLE,"Gain Written: 0x%04x", val);
|
INFO_LOG(DSPLLE,"Gain Written: 0x%04x", val);
|
||||||
}
|
}
|
||||||
case DSP_DSPA:
|
case DSP_DSPA:
|
||||||
@ -169,15 +170,19 @@ void gdsp_ifx_write(u32 addr, u32 val)
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
if ((addr & 0xff) >= 0xa0) {
|
if ((addr & 0xff) >= 0xa0)
|
||||||
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description) {
|
{
|
||||||
|
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description)
|
||||||
|
{
|
||||||
INFO_LOG(DSPLLE, "%04x MW %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name, val);
|
INFO_LOG(DSPLLE, "%04x MW %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name, val);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
ERROR_LOG(DSPLLE, "%04x MW %04x (%04x)", g_dsp.pc, addr, val);
|
||||||
}
|
}
|
||||||
g_dsp.ifx_regs[addr & 0xFF] = val;
|
g_dsp.ifx_regs[addr & 0xFF] = val;
|
||||||
@ -211,15 +216,19 @@ u16 gdsp_ifx_read(u16 addr)
|
|||||||
return dsp_read_aram_d3();
|
return dsp_read_aram_d3();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((addr & 0xff) >= 0xa0) {
|
if ((addr & 0xff) >= 0xa0)
|
||||||
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description) {
|
{
|
||||||
|
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description)
|
||||||
|
{
|
||||||
INFO_LOG(DSPLLE, "%04x MR %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name, g_dsp.ifx_regs[addr & 0xFF]);
|
INFO_LOG(DSPLLE, "%04x MR %s (%04x)", g_dsp.pc, pdlabels[(addr & 0xFF) - 0xa0].name, g_dsp.ifx_regs[addr & 0xFF]);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
ERROR_LOG(DSPLLE, "%04x MR %04x (%04x)", g_dsp.pc, addr, g_dsp.ifx_regs[addr & 0xFF]);
|
||||||
}
|
}
|
||||||
return g_dsp.ifx_regs[addr & 0xFF];
|
return g_dsp.ifx_regs[addr & 0xFF];
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPHOST_H
|
#ifndef _DSPHOST_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#include "DSPIntUtil.h"
|
#include "DSPIntUtil.h"
|
||||||
#include "DSPMemoryMap.h"
|
#include "DSPMemoryMap.h"
|
||||||
@ -56,21 +56,24 @@ inline bool IsSameMemArea(u16 a, u16 b)
|
|||||||
// DR $arR
|
// DR $arR
|
||||||
// xxxx xxxx 0000 01rr
|
// xxxx xxxx 0000 01rr
|
||||||
// Decrement addressing register $arR.
|
// Decrement addressing register $arR.
|
||||||
void dr(const UDSPInstruction opc) {
|
void dr(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
writeToBackLog(0, opc & 0x3, dsp_decrement_addr_reg(opc & 0x3));
|
writeToBackLog(0, opc & 0x3, dsp_decrement_addr_reg(opc & 0x3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// IR $arR
|
// IR $arR
|
||||||
// xxxx xxxx 0000 10rr
|
// xxxx xxxx 0000 10rr
|
||||||
// Increment addressing register $arR.
|
// Increment addressing register $arR.
|
||||||
void ir(const UDSPInstruction opc) {
|
void ir(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
writeToBackLog(0, opc & 0x3, dsp_increment_addr_reg(opc & 0x3));
|
writeToBackLog(0, opc & 0x3, dsp_increment_addr_reg(opc & 0x3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// NR $arR
|
// NR $arR
|
||||||
// xxxx xxxx 0000 11rr
|
// xxxx xxxx 0000 11rr
|
||||||
// Add corresponding indexing register $ixR to addressing register $arR.
|
// Add corresponding indexing register $ixR to addressing register $arR.
|
||||||
void nr(const UDSPInstruction opc) {
|
void nr(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
u8 reg = opc & 0x3;
|
u8 reg = opc & 0x3;
|
||||||
|
|
||||||
writeToBackLog(0, reg, dsp_increase_addr_reg(reg, (s16)g_dsp.r.ix[reg]));
|
writeToBackLog(0, reg, dsp_increase_addr_reg(reg, (s16)g_dsp.r.ix[reg]));
|
||||||
@ -84,7 +87,8 @@ void mv(const UDSPInstruction opc)
|
|||||||
u8 sreg = (opc & 0x3) + DSP_REG_ACL0;
|
u8 sreg = (opc & 0x3) + DSP_REG_ACL0;
|
||||||
u8 dreg = ((opc >> 2) & 0x3);
|
u8 dreg = ((opc >> 2) & 0x3);
|
||||||
|
|
||||||
switch(sreg) {
|
switch(sreg)
|
||||||
|
{
|
||||||
case DSP_REG_ACL0:
|
case DSP_REG_ACL0:
|
||||||
case DSP_REG_ACL1:
|
case DSP_REG_ACL1:
|
||||||
writeToBackLog(0, dreg + DSP_REG_AXL0, g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
writeToBackLog(0, dreg + DSP_REG_AXL0, g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
||||||
@ -105,7 +109,8 @@ void s(const UDSPInstruction opc)
|
|||||||
u8 dreg = opc & 0x3;
|
u8 dreg = opc & 0x3;
|
||||||
u8 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
|
u8 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
|
||||||
|
|
||||||
switch(sreg) {
|
switch(sreg)
|
||||||
|
{
|
||||||
case DSP_REG_ACL0:
|
case DSP_REG_ACL0:
|
||||||
case DSP_REG_ACL1:
|
case DSP_REG_ACL1:
|
||||||
dsp_dmem_write(g_dsp.r.ar[dreg], g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
dsp_dmem_write(g_dsp.r.ar[dreg], g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
||||||
@ -127,7 +132,8 @@ void sn(const UDSPInstruction opc)
|
|||||||
u8 dreg = opc & 0x3;
|
u8 dreg = opc & 0x3;
|
||||||
u8 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
|
u8 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
|
||||||
|
|
||||||
switch(sreg) {
|
switch(sreg)
|
||||||
|
{
|
||||||
case DSP_REG_ACL0:
|
case DSP_REG_ACL0:
|
||||||
case DSP_REG_ACL1:
|
case DSP_REG_ACL1:
|
||||||
dsp_dmem_write(g_dsp.r.ar[dreg], g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
dsp_dmem_write(g_dsp.r.ar[dreg], g_dsp.r.ac[sreg-DSP_REG_ACL0].l);
|
||||||
@ -520,7 +526,8 @@ void applyWriteBackLog()
|
|||||||
{
|
{
|
||||||
// always make sure to have an extra entry at the end w/ -1 to avoid
|
// always make sure to have an extra entry at the end w/ -1 to avoid
|
||||||
// infinitive loops
|
// infinitive loops
|
||||||
for (int i = 0; writeBackLogIdx[i] != -1; i++) {
|
for (int i = 0; writeBackLogIdx[i] != -1; i++)
|
||||||
|
{
|
||||||
#ifdef PRECISE_BACKLOG
|
#ifdef PRECISE_BACKLOG
|
||||||
dsp_op_write_reg(writeBackLogIdx[i], dsp_op_read_reg(writeBackLogIdx[i]) | writeBackLog[i]);
|
dsp_op_write_reg(writeBackLogIdx[i], dsp_op_read_reg(writeBackLogIdx[i]) | writeBackLog[i]);
|
||||||
#else
|
#else
|
||||||
@ -543,7 +550,8 @@ void zeroWriteBackLog()
|
|||||||
#ifdef PRECISE_BACKLOG
|
#ifdef PRECISE_BACKLOG
|
||||||
// always make sure to have an extra entry at the end w/ -1 to avoid
|
// always make sure to have an extra entry at the end w/ -1 to avoid
|
||||||
// infinitive loops
|
// infinitive loops
|
||||||
for (int i = 0; writeBackLogIdx[i] != -1; i++) {
|
for (int i = 0; writeBackLogIdx[i] != -1; i++)
|
||||||
|
{
|
||||||
dsp_op_write_reg(writeBackLogIdx[i], 0);
|
dsp_op_write_reg(writeBackLogIdx[i], 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -552,8 +560,8 @@ void zeroWriteBackLog()
|
|||||||
void zeroWriteBackLogPreserveAcc(u8 acc)
|
void zeroWriteBackLogPreserveAcc(u8 acc)
|
||||||
{
|
{
|
||||||
#ifdef PRECISE_BACKLOG
|
#ifdef PRECISE_BACKLOG
|
||||||
for (int i = 0; writeBackLogIdx[i] != -1; i++) {
|
for (int i = 0; writeBackLogIdx[i] != -1; i++)
|
||||||
|
{
|
||||||
// acc0
|
// acc0
|
||||||
if ((acc == 0) &&
|
if ((acc == 0) &&
|
||||||
((writeBackLogIdx[i] == DSP_REG_ACL0) || (writeBackLogIdx[i] == DSP_REG_ACM0) || (writeBackLogIdx[i] == DSP_REG_ACH0)))
|
((writeBackLogIdx[i] == DSP_REG_ACL0) || (writeBackLogIdx[i] == DSP_REG_ACM0) || (writeBackLogIdx[i] == DSP_REG_ACH0)))
|
||||||
|
@ -130,7 +130,9 @@ static inline u16 dsp_decrement_addr_reg(u16 reg)
|
|||||||
static inline u16 dsp_op_read_reg(int _reg)
|
static inline u16 dsp_op_read_reg(int _reg)
|
||||||
{
|
{
|
||||||
int reg = _reg & 0x1f;
|
int reg = _reg & 0x1f;
|
||||||
switch (reg) {
|
|
||||||
|
switch (reg)
|
||||||
|
{
|
||||||
case DSP_REG_ST0:
|
case DSP_REG_ST0:
|
||||||
case DSP_REG_ST1:
|
case DSP_REG_ST1:
|
||||||
case DSP_REG_ST2:
|
case DSP_REG_ST2:
|
||||||
@ -181,7 +183,9 @@ static inline u16 dsp_op_read_reg(int _reg)
|
|||||||
static inline void dsp_op_write_reg(int _reg, u16 val)
|
static inline void dsp_op_write_reg(int _reg, u16 val)
|
||||||
{
|
{
|
||||||
int reg = _reg & 0x1f;
|
int reg = _reg & 0x1f;
|
||||||
switch (reg) {
|
|
||||||
|
switch (reg)
|
||||||
|
{
|
||||||
// 8-bit sign extended registers. Should look at prod.h too...
|
// 8-bit sign extended registers. Should look at prod.h too...
|
||||||
case DSP_REG_ACH0:
|
case DSP_REG_ACH0:
|
||||||
case DSP_REG_ACH1:
|
case DSP_REG_ACH1:
|
||||||
@ -349,10 +353,14 @@ inline u16 dsp_op_read_reg_and_saturate(u8 _reg)
|
|||||||
return 0x8000;
|
return 0x8000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return g_dsp.r.ac[_reg].m;
|
return g_dsp.r.ac[_reg].m;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return g_dsp.r.ac[_reg].m;
|
return g_dsp.r.ac[_reg].m;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPINTERPRETER_H
|
#ifndef _DSPINTERPRETER_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie (c) 2005 (duddie@walla.com)
|
// Additional copyrights go to Duddie (c) 2005 (duddie@walla.com)
|
||||||
@ -27,7 +27,8 @@
|
|||||||
void nop(const UDSPInstruction opc)
|
void nop(const UDSPInstruction opc)
|
||||||
{
|
{
|
||||||
// The real nop is 0. Anything else is bad.
|
// The real nop is 0. Anything else is bad.
|
||||||
if (opc) {
|
if (opc)
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "LLE: Unrecognized opcode 0x%04x", opc);
|
ERROR_LOG(DSPLLE, "LLE: Unrecognized opcode 0x%04x", opc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie (c) 2005 (duddie@walla.com)
|
// Additional copyrights go to Duddie (c) 2005 (duddie@walla.com)
|
||||||
@ -143,14 +143,18 @@ inline void ExecuteInstruction(const UDSPInstruction inst)
|
|||||||
{
|
{
|
||||||
const DSPOPCTemplate *tinst = GetOpTemplate(inst);
|
const DSPOPCTemplate *tinst = GetOpTemplate(inst);
|
||||||
|
|
||||||
if (tinst->extended) {
|
if (tinst->extended)
|
||||||
|
{
|
||||||
if ((inst >> 12) == 0x3)
|
if ((inst >> 12) == 0x3)
|
||||||
extOpTable[inst & 0x7F]->intFunc(inst);
|
extOpTable[inst & 0x7F]->intFunc(inst);
|
||||||
else
|
else
|
||||||
extOpTable[inst & 0xFF]->intFunc(inst);
|
extOpTable[inst & 0xFF]->intFunc(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
tinst->intFunc(inst);
|
tinst->intFunc(inst);
|
||||||
if (tinst->extended) {
|
|
||||||
|
if (tinst->extended)
|
||||||
|
{
|
||||||
applyWriteBackLog();
|
applyWriteBackLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
@ -758,7 +758,8 @@ void movr(const UDSPInstruction opc)
|
|||||||
u8 sreg = ((opc >> 9) & 0x3) + DSP_REG_AXL0;
|
u8 sreg = ((opc >> 9) & 0x3) + DSP_REG_AXL0;
|
||||||
|
|
||||||
s64 ax = 0;
|
s64 ax = 0;
|
||||||
switch(sreg) {
|
switch(sreg)
|
||||||
|
{
|
||||||
case DSP_REG_AXL0:
|
case DSP_REG_AXL0:
|
||||||
case DSP_REG_AXL1:
|
case DSP_REG_AXL1:
|
||||||
ax = (s16)g_dsp.r.ax[sreg-DSP_REG_AXL0].l;
|
ax = (s16)g_dsp.r.ax[sreg-DSP_REG_AXL0].l;
|
||||||
@ -973,9 +974,12 @@ void lsrn(const UDSPInstruction opc)
|
|||||||
else
|
else
|
||||||
shift = accm & 0x3f;
|
shift = accm & 0x3f;
|
||||||
|
|
||||||
if (shift > 0) {
|
if (shift > 0)
|
||||||
|
{
|
||||||
acc >>= shift;
|
acc >>= shift;
|
||||||
} else if (shift < 0) {
|
}
|
||||||
|
else if (shift < 0)
|
||||||
|
{
|
||||||
acc <<= -shift;
|
acc <<= -shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1002,9 +1006,12 @@ void asrn(const UDSPInstruction opc)
|
|||||||
else
|
else
|
||||||
shift = accm & 0x3f;
|
shift = accm & 0x3f;
|
||||||
|
|
||||||
if (shift > 0) {
|
if (shift > 0)
|
||||||
|
{
|
||||||
acc >>= shift;
|
acc >>= shift;
|
||||||
} else if (shift < 0) {
|
}
|
||||||
|
else if (shift < 0)
|
||||||
|
{
|
||||||
acc <<= -shift;
|
acc <<= -shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1035,9 +1042,12 @@ void lsrnrx(const UDSPInstruction opc)
|
|||||||
else
|
else
|
||||||
shift = axh & 0x3f;
|
shift = axh & 0x3f;
|
||||||
|
|
||||||
if (shift > 0) {
|
if (shift > 0)
|
||||||
|
{
|
||||||
acc <<= shift;
|
acc <<= shift;
|
||||||
} else if (shift < 0) {
|
}
|
||||||
|
else if (shift < 0)
|
||||||
|
{
|
||||||
acc >>= -shift;
|
acc >>= -shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,9 +1079,12 @@ void asrnrx(const UDSPInstruction opc)
|
|||||||
else
|
else
|
||||||
shift = axh & 0x3f;
|
shift = axh & 0x3f;
|
||||||
|
|
||||||
if (shift > 0) {
|
if (shift > 0)
|
||||||
|
{
|
||||||
acc <<= shift;
|
acc <<= shift;
|
||||||
} else if (shift < 0) {
|
}
|
||||||
|
else if (shift < 0)
|
||||||
|
{
|
||||||
acc >>= -shift;
|
acc >>= -shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
@ -194,7 +194,9 @@ void loop(const UDSPInstruction opc)
|
|||||||
dsp_reg_store_stack(3, cnt);
|
dsp_reg_store_stack(3, cnt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
dsp_skip_inst();
|
dsp_skip_inst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOOPI #I
|
// LOOPI #I
|
||||||
@ -217,7 +219,9 @@ void loopi(const UDSPInstruction opc)
|
|||||||
dsp_reg_store_stack(3, cnt);
|
dsp_reg_store_stack(3, cnt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
dsp_skip_inst();
|
dsp_skip_inst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "../DSPMemoryMap.h"
|
#include "../DSPMemoryMap.h"
|
||||||
@ -29,7 +29,8 @@ template <void(*jitCode)(const UDSPInstruction, DSPEmitter&)>
|
|||||||
static void ReJitConditional(const UDSPInstruction opc, DSPEmitter& emitter)
|
static void ReJitConditional(const UDSPInstruction opc, DSPEmitter& emitter)
|
||||||
{
|
{
|
||||||
u8 cond = opc & 0xf;
|
u8 cond = opc & 0xf;
|
||||||
if (cond == 0xf) {// Always true.
|
if (cond == 0xf) // Always true.
|
||||||
|
{
|
||||||
jitCode(opc,emitter);
|
jitCode(opc,emitter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#include "../DSPMemoryMap.h"
|
#include "../DSPMemoryMap.h"
|
||||||
#include "../DSPEmitter.h"
|
#include "../DSPEmitter.h"
|
||||||
@ -41,21 +41,24 @@ using namespace Gen;
|
|||||||
// DR $arR
|
// DR $arR
|
||||||
// xxxx xxxx 0000 01rr
|
// xxxx xxxx 0000 01rr
|
||||||
// Decrement addressing register $arR.
|
// Decrement addressing register $arR.
|
||||||
void DSPEmitter::dr(const UDSPInstruction opc) {
|
void DSPEmitter::dr(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
decrement_addr_reg(opc & 0x3);
|
decrement_addr_reg(opc & 0x3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IR $arR
|
// IR $arR
|
||||||
// xxxx xxxx 0000 10rr
|
// xxxx xxxx 0000 10rr
|
||||||
// Increment addressing register $arR.
|
// Increment addressing register $arR.
|
||||||
void DSPEmitter::ir(const UDSPInstruction opc) {
|
void DSPEmitter::ir(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
increment_addr_reg(opc & 0x3);
|
increment_addr_reg(opc & 0x3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NR $arR
|
// NR $arR
|
||||||
// xxxx xxxx 0000 11rr
|
// xxxx xxxx 0000 11rr
|
||||||
// Add corresponding indexing register $ixR to addressing register $arR.
|
// Add corresponding indexing register $ixR to addressing register $arR.
|
||||||
void DSPEmitter::nr(const UDSPInstruction opc) {
|
void DSPEmitter::nr(const UDSPInstruction opc)
|
||||||
|
{
|
||||||
u8 reg = opc & 0x3;
|
u8 reg = opc & 0x3;
|
||||||
|
|
||||||
increase_addr_reg(reg, reg);
|
increase_addr_reg(reg, reg);
|
||||||
@ -652,12 +655,14 @@ void DSPEmitter::ldaxnm(const UDSPInstruction opc)
|
|||||||
|
|
||||||
// Push value from g_dsp.r[sreg] into EBX and stores the destinationindex in
|
// Push value from g_dsp.r[sreg] into EBX and stores the destinationindex in
|
||||||
// storeIndex
|
// storeIndex
|
||||||
void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg) {
|
void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg)
|
||||||
|
{
|
||||||
dsp_op_read_reg(sreg, RBX, ZERO);
|
dsp_op_read_reg(sreg, RBX, ZERO);
|
||||||
storeIndex = dreg;
|
storeIndex = dreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg) {
|
void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg)
|
||||||
|
{
|
||||||
// u16 addr = g_dsp.r[addr];
|
// u16 addr = g_dsp.r[addr];
|
||||||
|
|
||||||
X64Reg tmp1;
|
X64Reg tmp1;
|
||||||
@ -673,7 +678,8 @@ void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg) {
|
|||||||
storeIndex = dreg;
|
storeIndex = dreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg) {
|
void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg)
|
||||||
|
{
|
||||||
// u16 addr = g_dsp.r[addr];
|
// u16 addr = g_dsp.r[addr];
|
||||||
|
|
||||||
X64Reg tmp1;
|
X64Reg tmp1;
|
||||||
@ -690,7 +696,8 @@ void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg) {
|
|||||||
storeIndex2 = dreg;
|
storeIndex2 = dreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::popExtValueToReg() {
|
void DSPEmitter::popExtValueToReg()
|
||||||
|
{
|
||||||
// in practise, we rarely ever have a non-NX main op
|
// in practise, we rarely ever have a non-NX main op
|
||||||
// with an extended op, so the OR here is either
|
// with an extended op, so the OR here is either
|
||||||
// not run (storeIndex == -1) or ends up OR'ing
|
// not run (storeIndex == -1) or ends up OR'ing
|
||||||
@ -698,9 +705,11 @@ void DSPEmitter::popExtValueToReg() {
|
|||||||
// nakee wants to keep it clean, so lets do that.
|
// nakee wants to keep it clean, so lets do that.
|
||||||
// [nakeee] the or case never happens in real
|
// [nakeee] the or case never happens in real
|
||||||
// [nakeee] it's just how the hardware works so we added it
|
// [nakeee] it's just how the hardware works so we added it
|
||||||
if (storeIndex != -1) {
|
if (storeIndex != -1)
|
||||||
|
{
|
||||||
dsp_op_write_reg(storeIndex, RBX);
|
dsp_op_write_reg(storeIndex, RBX);
|
||||||
if (storeIndex >= DSP_REG_ACM0 && storeIndex2 == -1) {
|
if (storeIndex >= DSP_REG_ACM0 && storeIndex2 == -1)
|
||||||
|
{
|
||||||
TEST(32, R(EBX), Imm32(SR_40_MODE_BIT << 16));
|
TEST(32, R(EBX), Imm32(SR_40_MODE_BIT << 16));
|
||||||
FixupBranch not_40bit = J_CC(CC_Z, true);
|
FixupBranch not_40bit = J_CC(CC_Z, true);
|
||||||
DSPJitRegCache c(gpr);
|
DSPJitRegCache c(gpr);
|
||||||
@ -722,9 +731,11 @@ void DSPEmitter::popExtValueToReg() {
|
|||||||
|
|
||||||
storeIndex = -1;
|
storeIndex = -1;
|
||||||
|
|
||||||
if (storeIndex2 != -1) {
|
if (storeIndex2 != -1)
|
||||||
|
{
|
||||||
SHR(32, R(EBX), Imm8(16));
|
SHR(32, R(EBX), Imm8(16));
|
||||||
dsp_op_write_reg(storeIndex2, RBX);
|
dsp_op_write_reg(storeIndex2, RBX);
|
||||||
}
|
}
|
||||||
|
|
||||||
storeIndex2 = -1;
|
storeIndex2 = -1;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
@ -49,7 +49,6 @@ void DSPEmitter::srs(const UDSPInstruction opc)
|
|||||||
dmem_write(tmp1);
|
dmem_write(tmp1);
|
||||||
|
|
||||||
gpr.putXReg(tmp1);
|
gpr.putXReg(tmp1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LRS $(0x18+D), @M
|
// LRS $(0x18+D), @M
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +207,8 @@ void DSPEmitter::dsp_conditional_extend_accum_imm(int reg, u16 val)
|
|||||||
|
|
||||||
void DSPEmitter::dsp_op_read_reg(int reg, Gen::X64Reg host_dreg, DSPJitSignExtend extend)
|
void DSPEmitter::dsp_op_read_reg(int reg, Gen::X64Reg host_dreg, DSPJitSignExtend extend)
|
||||||
{
|
{
|
||||||
switch (reg & 0x1f) {
|
switch (reg & 0x1f)
|
||||||
|
{
|
||||||
case DSP_REG_ST0:
|
case DSP_REG_ST0:
|
||||||
case DSP_REG_ST1:
|
case DSP_REG_ST1:
|
||||||
case DSP_REG_ST2:
|
case DSP_REG_ST2:
|
||||||
@ -430,7 +431,8 @@ void DSPEmitter::addarn(const UDSPInstruction opc)
|
|||||||
//----
|
//----
|
||||||
|
|
||||||
|
|
||||||
void DSPEmitter::setCompileSR(u16 bit) {
|
void DSPEmitter::setCompileSR(u16 bit)
|
||||||
|
{
|
||||||
|
|
||||||
// g_dsp.r[DSP_REG_SR] |= bit
|
// g_dsp.r[DSP_REG_SR] |= bit
|
||||||
OpArg sr_reg;
|
OpArg sr_reg;
|
||||||
@ -441,7 +443,8 @@ void DSPEmitter::setCompileSR(u16 bit) {
|
|||||||
compileSR |= bit;
|
compileSR |= bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::clrCompileSR(u16 bit) {
|
void DSPEmitter::clrCompileSR(u16 bit)
|
||||||
|
{
|
||||||
|
|
||||||
// g_dsp.r[DSP_REG_SR] &= bit
|
// g_dsp.r[DSP_REG_SR] &= bit
|
||||||
OpArg sr_reg;
|
OpArg sr_reg;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// Additional copyrights go to Duddie and Tratax (c) 2004
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "DSPJitRegCache.h"
|
#include "DSPJitRegCache.h"
|
||||||
@ -21,8 +21,10 @@
|
|||||||
|
|
||||||
using namespace Gen;
|
using namespace Gen;
|
||||||
|
|
||||||
static void *reg_ptr(int reg) {
|
static void *reg_ptr(int reg)
|
||||||
switch(reg) {
|
{
|
||||||
|
switch(reg)
|
||||||
|
{
|
||||||
case DSP_REG_AR0:
|
case DSP_REG_AR0:
|
||||||
case DSP_REG_AR1:
|
case DSP_REG_AR1:
|
||||||
case DSP_REG_AR2:
|
case DSP_REG_AR2:
|
||||||
@ -84,11 +86,14 @@ static void *reg_ptr(int reg) {
|
|||||||
//#undef STATIC_REG_ACCS
|
//#undef STATIC_REG_ACCS
|
||||||
|
|
||||||
DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
||||||
: emitter(_emitter), temporary(false), merged(false) {
|
: emitter(_emitter), temporary(false), merged(false)
|
||||||
for(unsigned int i = 0; i < NUMXREGS; i++) {
|
{
|
||||||
|
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||||
|
{
|
||||||
xregs[i].guest_reg = DSP_REG_STATIC;
|
xregs[i].guest_reg = DSP_REG_STATIC;
|
||||||
xregs[i].pushed = false;
|
xregs[i].pushed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
xregs[RAX].guest_reg = DSP_REG_STATIC;// reserved for MUL/DIV
|
xregs[RAX].guest_reg = DSP_REG_STATIC;// reserved for MUL/DIV
|
||||||
xregs[RDX].guest_reg = DSP_REG_STATIC;// reserved for MUL/DIV
|
xregs[RDX].guest_reg = DSP_REG_STATIC;// reserved for MUL/DIV
|
||||||
xregs[RCX].guest_reg = DSP_REG_STATIC;// reserved for shifts
|
xregs[RCX].guest_reg = DSP_REG_STATIC;// reserved for shifts
|
||||||
@ -119,7 +124,8 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
|||||||
xregs[R15].guest_reg = DSP_REG_NONE;
|
xregs[R15].guest_reg = DSP_REG_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
regs[i].mem = reg_ptr(i);
|
regs[i].mem = reg_ptr(i);
|
||||||
regs[i].size = 0;
|
regs[i].size = 0;
|
||||||
regs[i].dirty = false;
|
regs[i].dirty = false;
|
||||||
@ -140,7 +146,8 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
|||||||
regs[DSP_REG_ACC0_64].host_reg = R8;
|
regs[DSP_REG_ACC0_64].host_reg = R8;
|
||||||
regs[DSP_REG_ACC1_64].host_reg = R9;
|
regs[DSP_REG_ACC1_64].host_reg = R9;
|
||||||
#endif
|
#endif
|
||||||
for(unsigned int i = 0; i < 2; i++) {
|
for(unsigned int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
regs[i+DSP_REG_ACC0_64].size = 8;
|
regs[i+DSP_REG_ACC0_64].size = 8;
|
||||||
regs[i+DSP_REG_ACL0].parentReg = i+DSP_REG_ACC0_64;
|
regs[i+DSP_REG_ACL0].parentReg = i+DSP_REG_ACC0_64;
|
||||||
regs[i+DSP_REG_ACM0].parentReg = i+DSP_REG_ACC0_64;
|
regs[i+DSP_REG_ACM0].parentReg = i+DSP_REG_ACC0_64;
|
||||||
@ -149,6 +156,7 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
|||||||
regs[i+DSP_REG_ACM0].shift = 16;
|
regs[i+DSP_REG_ACM0].shift = 16;
|
||||||
regs[i+DSP_REG_ACH0].shift = 32;
|
regs[i+DSP_REG_ACH0].shift = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
regs[DSP_REG_PROD_64].size = 8;
|
regs[DSP_REG_PROD_64].size = 8;
|
||||||
regs[DSP_REG_PRODL].parentReg = DSP_REG_PROD_64;
|
regs[DSP_REG_PRODL].parentReg = DSP_REG_PROD_64;
|
||||||
regs[DSP_REG_PRODM].parentReg = DSP_REG_PROD_64;
|
regs[DSP_REG_PRODM].parentReg = DSP_REG_PROD_64;
|
||||||
@ -160,7 +168,8 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
|||||||
regs[DSP_REG_PRODM2].shift = 48;
|
regs[DSP_REG_PRODM2].shift = 48;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int i = 0; i < 2; i++) {
|
for(unsigned int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
regs[i+DSP_REG_AX0_32].size = 4;
|
regs[i+DSP_REG_AX0_32].size = 4;
|
||||||
regs[i+DSP_REG_AXL0].parentReg = i+DSP_REG_AX0_32;
|
regs[i+DSP_REG_AXL0].parentReg = i+DSP_REG_AX0_32;
|
||||||
regs[i+DSP_REG_AXH0].parentReg = i+DSP_REG_AX0_32;
|
regs[i+DSP_REG_AXH0].parentReg = i+DSP_REG_AX0_32;
|
||||||
@ -206,7 +215,8 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
//drop all guest register not used by cache
|
//drop all guest register not used by cache
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
regs[i].used = false;//used is restored later
|
regs[i].used = false;//used is restored later
|
||||||
if (regs[i].loc.IsSimpleReg() &&
|
if (regs[i].loc.IsSimpleReg() &&
|
||||||
!cache.regs[i].loc.IsSimpleReg())
|
!cache.regs[i].loc.IsSimpleReg())
|
||||||
@ -215,13 +225,15 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
|
|||||||
|
|
||||||
//try to move guest regs in the wrong host reg to the correct one
|
//try to move guest regs in the wrong host reg to the correct one
|
||||||
int movcnt;
|
int movcnt;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
movcnt = 0;
|
movcnt = 0;
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
X64Reg simple = regs[i].loc.GetSimpleReg();
|
X64Reg simple = regs[i].loc.GetSimpleReg();
|
||||||
X64Reg simple_cache = cache.regs[i].loc.GetSimpleReg();
|
X64Reg simple_cache = cache.regs[i].loc.GetSimpleReg();
|
||||||
if (simple_cache != simple
|
|
||||||
&& xregs[simple_cache].guest_reg == DSP_REG_NONE)
|
if (simple_cache != simple && xregs[simple_cache].guest_reg == DSP_REG_NONE)
|
||||||
{
|
{
|
||||||
movToHostReg(i, simple_cache, true);
|
movToHostReg(i, simple_cache, true);
|
||||||
movcnt++;
|
movcnt++;
|
||||||
@ -230,7 +242,8 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
|
|||||||
} while (movcnt != 0);
|
} while (movcnt != 0);
|
||||||
|
|
||||||
//free all host regs that are not used for the same guest reg
|
//free all host regs that are not used for the same guest reg
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (cache.regs[i].loc.GetSimpleReg() !=
|
if (cache.regs[i].loc.GetSimpleReg() !=
|
||||||
regs[i].loc.GetSimpleReg() &&
|
regs[i].loc.GetSimpleReg() &&
|
||||||
regs[i].loc.IsSimpleReg())
|
regs[i].loc.IsSimpleReg())
|
||||||
@ -238,27 +251,33 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//load all guest regs that are in memory and should be in host reg
|
//load all guest regs that are in memory and should be in host reg
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
if (cache.regs[i].loc.IsSimpleReg()) {
|
{
|
||||||
movToHostReg(i, cache.regs[i].loc.GetSimpleReg(),
|
if (cache.regs[i].loc.IsSimpleReg())
|
||||||
true);
|
{
|
||||||
|
movToHostReg(i, cache.regs[i].loc.GetSimpleReg(), true);
|
||||||
rotateHostReg(i, cache.regs[i].shift, true);
|
rotateHostReg(i, cache.regs[i].shift, true);
|
||||||
} else if(cache.regs[i].loc.IsImm()) {
|
|
||||||
//todo: immediates?
|
|
||||||
}
|
}
|
||||||
|
else if(cache.regs[i].loc.IsImm())
|
||||||
|
{
|
||||||
|
// TODO: Immediates?
|
||||||
|
}
|
||||||
|
|
||||||
regs[i].used = cache.regs[i].used;
|
regs[i].used = cache.regs[i].used;
|
||||||
regs[i].dirty |= cache.regs[i].dirty;
|
regs[i].dirty |= cache.regs[i].dirty;
|
||||||
regs[i].last_use_ctr = cache.regs[i].last_use_ctr;
|
regs[i].last_use_ctr = cache.regs[i].last_use_ctr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//consistency checks
|
//consistency checks
|
||||||
for(i = 0; i < NUMXREGS; i++) {
|
for(i = 0; i < NUMXREGS; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
xregs[i].guest_reg == cache.xregs[i].guest_reg,
|
xregs[i].guest_reg == cache.xregs[i].guest_reg,
|
||||||
"cache and current xreg guest_reg mismatch for %d", i);
|
"cache and current xreg guest_reg mismatch for %d", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
regs[i].loc.IsImm() == cache.regs[i].loc.IsImm(),
|
regs[i].loc.IsImm() == cache.regs[i].loc.IsImm(),
|
||||||
"cache and current reg loc mismatch for %x", i);
|
"cache and current reg loc mismatch for %x", i);
|
||||||
@ -285,16 +304,21 @@ void DSPJitRegCache::flushMemBackedRegs()
|
|||||||
//this should have the same effect as
|
//this should have the same effect as
|
||||||
//merge(DSPJitRegCache(emitter));
|
//merge(DSPJitRegCache(emitter));
|
||||||
|
|
||||||
unsigned int i;
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
{
|
||||||
_assert_msg_(DSPLLE, !regs[i].used,
|
_assert_msg_(DSPLLE, !regs[i].used,
|
||||||
"register %x still in use", i);
|
"register %x still in use", i);
|
||||||
|
|
||||||
if (regs[i].used)
|
if (regs[i].used)
|
||||||
emitter.INT3();
|
emitter.INT3();
|
||||||
if (regs[i].host_reg != INVALID_REG) {
|
|
||||||
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
|
{
|
||||||
movToHostReg(i,regs[i].host_reg,true);
|
movToHostReg(i,regs[i].host_reg,true);
|
||||||
rotateHostReg(i, 0, true);
|
rotateHostReg(i, 0, true);
|
||||||
} else if (regs[i].parentReg == DSP_REG_NONE) {
|
}
|
||||||
|
else if (regs[i].parentReg == DSP_REG_NONE)
|
||||||
|
{
|
||||||
movToMemory(i);
|
movToMemory(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,12 +328,14 @@ void DSPJitRegCache::flushRegs()
|
|||||||
{
|
{
|
||||||
flushMemBackedRegs();
|
flushMemBackedRegs();
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (regs[i].host_reg != INVALID_REG)
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
movToMemory(i);
|
movToMemory(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
!regs[i].loc.IsSimpleReg(),
|
!regs[i].loc.IsSimpleReg(),
|
||||||
"register %x is still a simple reg", i);
|
"register %x is still a simple reg", i);
|
||||||
@ -373,12 +399,14 @@ static u64 ebp_store;
|
|||||||
|
|
||||||
void DSPJitRegCache::loadRegs(bool emit)
|
void DSPJitRegCache::loadRegs(bool emit)
|
||||||
{
|
{
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (regs[i].host_reg != INVALID_REG)
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
movToHostReg(i,regs[i].host_reg);
|
movToHostReg(i,regs[i].host_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emit) {
|
if (emit)
|
||||||
|
{
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
emitter.MOV(64, M(&ebp_store), R(RBP));
|
emitter.MOV(64, M(&ebp_store), R(RBP));
|
||||||
#else
|
#else
|
||||||
@ -391,12 +419,14 @@ void DSPJitRegCache::saveRegs()
|
|||||||
{
|
{
|
||||||
flushRegs();
|
flushRegs();
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (regs[i].host_reg != INVALID_REG)
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
movToMemory(i);
|
movToMemory(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
!regs[i].loc.IsSimpleReg(),
|
!regs[i].loc.IsSimpleReg(),
|
||||||
"register %x is still a simple reg", i);
|
"register %x is still a simple reg", i);
|
||||||
@ -409,16 +439,19 @@ void DSPJitRegCache::saveRegs()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPJitRegCache::pushRegs() {
|
void DSPJitRegCache::pushRegs()
|
||||||
|
{
|
||||||
flushMemBackedRegs();
|
flushMemBackedRegs();
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (regs[i].host_reg != INVALID_REG)
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
movToMemory(i);
|
movToMemory(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int push_count = 0;
|
int push_count = 0;
|
||||||
for(unsigned int i = 0; i < NUMXREGS; i++) {
|
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||||
|
{
|
||||||
if (xregs[i].guest_reg == DSP_REG_USED)
|
if (xregs[i].guest_reg == DSP_REG_USED)
|
||||||
push_count++;
|
push_count++;
|
||||||
}
|
}
|
||||||
@ -432,21 +465,25 @@ void DSPJitRegCache::pushRegs() {
|
|||||||
emitter.SUB(32,R(ESP),Imm32(16 - 4 * (push_count & 3)));
|
emitter.SUB(32,R(ESP),Imm32(16 - 4 * (push_count & 3)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int i = 0; i < NUMXREGS; i++) {
|
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||||
if (xregs[i].guest_reg == DSP_REG_USED) {
|
{
|
||||||
|
if (xregs[i].guest_reg == DSP_REG_USED)
|
||||||
|
{
|
||||||
emitter.PUSH((X64Reg)i);
|
emitter.PUSH((X64Reg)i);
|
||||||
xregs[i].pushed = true;
|
xregs[i].pushed = true;
|
||||||
xregs[i].guest_reg = DSP_REG_NONE;
|
xregs[i].guest_reg = DSP_REG_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
!regs[i].loc.IsSimpleReg(),
|
!regs[i].loc.IsSimpleReg(),
|
||||||
"register %x is still a simple reg", i);
|
"register %x is still a simple reg", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i < NUMXREGS; i++) {
|
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE,
|
_assert_msg_(DSPLLE,
|
||||||
xregs[i].guest_reg == DSP_REG_NONE ||
|
xregs[i].guest_reg == DSP_REG_NONE ||
|
||||||
xregs[i].guest_reg == DSP_REG_STATIC,
|
xregs[i].guest_reg == DSP_REG_STATIC,
|
||||||
@ -467,13 +504,16 @@ void DSPJitRegCache::popRegs() {
|
|||||||
emitter.MOV(32, M(&ebp_store), R(EBP));
|
emitter.MOV(32, M(&ebp_store), R(EBP));
|
||||||
#endif
|
#endif
|
||||||
int push_count = 0;
|
int push_count = 0;
|
||||||
for(unsigned int i = 0; i < NUMXREGS; i++) {
|
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||||
|
{
|
||||||
if (xregs[i].pushed)
|
if (xregs[i].pushed)
|
||||||
push_count++;
|
push_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = NUMXREGS-1; i >= 0; i--) {
|
for(int i = NUMXREGS-1; i >= 0; i--)
|
||||||
if (xregs[i].pushed) {
|
{
|
||||||
|
if (xregs[i].pushed)
|
||||||
|
{
|
||||||
emitter.POP((X64Reg)i);
|
emitter.POP((X64Reg)i);
|
||||||
xregs[i].pushed = false;
|
xregs[i].pushed = false;
|
||||||
xregs[i].guest_reg = DSP_REG_USED;
|
xregs[i].guest_reg = DSP_REG_USED;
|
||||||
@ -489,14 +529,17 @@ void DSPJitRegCache::popRegs() {
|
|||||||
emitter.ADD(32,R(ESP),Imm32(16 - 4 * (push_count & 3)));
|
emitter.ADD(32,R(ESP),Imm32(16 - 4 * (push_count & 3)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
|
||||||
|
{
|
||||||
if (regs[i].host_reg != INVALID_REG)
|
if (regs[i].host_reg != INVALID_REG)
|
||||||
movToHostReg(i,regs[i].host_reg);
|
movToHostReg(i,regs[i].host_reg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg) {
|
X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
|
||||||
if (reg != RBP) {
|
{
|
||||||
|
if (reg != RBP)
|
||||||
|
{
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,8 +573,10 @@ void DSPJitRegCache::movToHostReg(int reg, X64Reg host_reg, bool load)
|
|||||||
if (xregs[host_reg].guest_reg != DSP_REG_STATIC)
|
if (xregs[host_reg].guest_reg != DSP_REG_STATIC)
|
||||||
xregs[host_reg].guest_reg = reg;
|
xregs[host_reg].guest_reg = reg;
|
||||||
|
|
||||||
if (load) {
|
if (load)
|
||||||
switch(regs[reg].size) {
|
{
|
||||||
|
switch(regs[reg].size)
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
emitter.MOV(16, R(host_reg), regs[reg].loc); break;
|
emitter.MOV(16, R(host_reg), regs[reg].loc); break;
|
||||||
case 4:
|
case 4:
|
||||||
@ -545,6 +590,7 @@ void DSPJitRegCache::movToHostReg(int reg, X64Reg host_reg, bool load)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
regs[reg].loc = R(host_reg);
|
regs[reg].loc = R(host_reg);
|
||||||
if (old_reg != INVALID_REG &&
|
if (old_reg != INVALID_REG &&
|
||||||
xregs[old_reg].guest_reg != DSP_REG_STATIC)
|
xregs[old_reg].guest_reg != DSP_REG_STATIC)
|
||||||
@ -562,13 +608,16 @@ void DSPJitRegCache::movToHostReg(int reg, bool load)
|
|||||||
|
|
||||||
if (regs[reg].loc.IsSimpleReg())
|
if (regs[reg].loc.IsSimpleReg())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
X64Reg tmp;
|
X64Reg tmp;
|
||||||
if (regs[reg].host_reg != INVALID_REG)
|
if (regs[reg].host_reg != INVALID_REG)
|
||||||
tmp = regs[reg].host_reg;
|
tmp = regs[reg].host_reg;
|
||||||
else
|
else
|
||||||
tmp = findSpillFreeXReg();
|
tmp = findSpillFreeXReg();
|
||||||
|
|
||||||
if (tmp == INVALID_REG)
|
if (tmp == INVALID_REG)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
movToHostReg(reg, tmp, load);
|
movToHostReg(reg, tmp, load);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,8 +631,11 @@ void DSPJitRegCache::rotateHostReg(int reg, int shift, bool emit)
|
|||||||
"register %x is not a simple reg", reg);
|
"register %x is not a simple reg", reg);
|
||||||
_assert_msg_(DSPLLE, !regs[reg].used,
|
_assert_msg_(DSPLLE, !regs[reg].used,
|
||||||
"rotating in use guest reg %x!", reg);
|
"rotating in use guest reg %x!", reg);
|
||||||
if (shift > regs[reg].shift && emit) {
|
|
||||||
switch(regs[reg].size) {
|
if (shift > regs[reg].shift && emit)
|
||||||
|
{
|
||||||
|
switch(regs[reg].size)
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
emitter.ROR(16, regs[reg].loc,
|
emitter.ROR(16, regs[reg].loc,
|
||||||
Imm8(shift - regs[reg].shift));
|
Imm8(shift - regs[reg].shift));
|
||||||
@ -599,8 +651,11 @@ void DSPJitRegCache::rotateHostReg(int reg, int shift, bool emit)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (shift < regs[reg].shift && emit) {
|
}
|
||||||
switch(regs[reg].size) {
|
else if (shift < regs[reg].shift && emit)
|
||||||
|
{
|
||||||
|
switch(regs[reg].size)
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
emitter.ROL(16, regs[reg].loc,
|
emitter.ROL(16, regs[reg].loc,
|
||||||
Imm8(regs[reg].shift - shift));
|
Imm8(regs[reg].shift - shift));
|
||||||
@ -638,16 +693,23 @@ void DSPJitRegCache::movToMemory(int reg)
|
|||||||
|
|
||||||
//but first, check for any needed rotations
|
//but first, check for any needed rotations
|
||||||
if (regs[reg].loc.IsSimpleReg())
|
if (regs[reg].loc.IsSimpleReg())
|
||||||
|
{
|
||||||
rotateHostReg(reg, 0, true);
|
rotateHostReg(reg, 0, true);
|
||||||
else {} //todo: immediates?
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: Immediates?
|
||||||
|
}
|
||||||
|
|
||||||
_assert_msg_(DSPLLE, regs[reg].shift == 0, "still shifted??");
|
_assert_msg_(DSPLLE, regs[reg].shift == 0, "still shifted??");
|
||||||
|
|
||||||
//move to mem
|
//move to mem
|
||||||
OpArg tmp = M(regs[reg].mem);
|
OpArg tmp = M(regs[reg].mem);
|
||||||
|
|
||||||
if (regs[reg].dirty) {
|
if (regs[reg].dirty)
|
||||||
switch(regs[reg].size) {
|
{
|
||||||
|
switch(regs[reg].size)
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
emitter.MOV(16, tmp, regs[reg].loc); break;
|
emitter.MOV(16, tmp, regs[reg].loc); break;
|
||||||
case 4:
|
case 4:
|
||||||
@ -663,7 +725,8 @@ void DSPJitRegCache::movToMemory(int reg)
|
|||||||
regs[reg].dirty = false;
|
regs[reg].dirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regs[reg].loc.IsSimpleReg()) {
|
if (regs[reg].loc.IsSimpleReg())
|
||||||
|
{
|
||||||
X64Reg hostreg = regs[reg].loc.GetSimpleReg();
|
X64Reg hostreg = regs[reg].loc.GetSimpleReg();
|
||||||
if (xregs[hostreg].guest_reg != DSP_REG_STATIC)
|
if (xregs[hostreg].guest_reg != DSP_REG_STATIC)
|
||||||
xregs[hostreg].guest_reg = DSP_REG_NONE;
|
xregs[hostreg].guest_reg = DSP_REG_NONE;
|
||||||
@ -677,7 +740,8 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
|
|||||||
{
|
{
|
||||||
int real_reg;
|
int real_reg;
|
||||||
int shift;
|
int shift;
|
||||||
if (regs[reg].parentReg != DSP_REG_NONE) {
|
if (regs[reg].parentReg != DSP_REG_NONE)
|
||||||
|
{
|
||||||
real_reg = regs[reg].parentReg;
|
real_reg = regs[reg].parentReg;
|
||||||
|
|
||||||
// always load and rotate since we need the other
|
// always load and rotate since we need the other
|
||||||
@ -685,7 +749,9 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
|
|||||||
load = true;
|
load = true;
|
||||||
|
|
||||||
shift = regs[reg].shift;
|
shift = regs[reg].shift;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
real_reg = reg;
|
real_reg = reg;
|
||||||
shift = 0;
|
shift = 0;
|
||||||
}
|
}
|
||||||
@ -698,20 +764,24 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
|
|||||||
// no nead to actually emit code for load or rotate if caller doesn't
|
// no nead to actually emit code for load or rotate if caller doesn't
|
||||||
// use the contents, but see above for a reason to force the load
|
// use the contents, but see above for a reason to force the load
|
||||||
movToHostReg(real_reg, load);
|
movToHostReg(real_reg, load);
|
||||||
//todo: actually handle INVALID_REG
|
|
||||||
|
// TODO: actually handle INVALID_REG
|
||||||
_assert_msg_(DSPLLE, regs[real_reg].loc.IsSimpleReg(),
|
_assert_msg_(DSPLLE, regs[real_reg].loc.IsSimpleReg(),
|
||||||
"did not get host reg for %x", reg);
|
"did not get host reg for %x", reg);
|
||||||
|
|
||||||
rotateHostReg(real_reg, shift, load);
|
rotateHostReg(real_reg, shift, load);
|
||||||
oparg = regs[real_reg].loc;
|
oparg = regs[real_reg].loc;
|
||||||
regs[real_reg].used = true;
|
regs[real_reg].used = true;
|
||||||
|
|
||||||
//do some register specific fixup
|
//do some register specific fixup
|
||||||
switch(reg) {
|
switch(reg)
|
||||||
|
{
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
case DSP_REG_ACC0_64:
|
case DSP_REG_ACC0_64:
|
||||||
case DSP_REG_ACC1_64:
|
case DSP_REG_ACC1_64:
|
||||||
{
|
{
|
||||||
if (load) {
|
if (load)
|
||||||
|
{
|
||||||
//need to do this because interpreter only does 48 bits
|
//need to do this because interpreter only does 48 bits
|
||||||
//(and putReg does the same)
|
//(and putReg does the same)
|
||||||
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
|
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
|
||||||
@ -730,15 +800,20 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
|
|||||||
int real_reg = reg;
|
int real_reg = reg;
|
||||||
if (regs[reg].parentReg != DSP_REG_NONE)
|
if (regs[reg].parentReg != DSP_REG_NONE)
|
||||||
real_reg = regs[reg].parentReg;
|
real_reg = regs[reg].parentReg;
|
||||||
|
|
||||||
OpArg oparg = regs[real_reg].loc;
|
OpArg oparg = regs[real_reg].loc;
|
||||||
switch(reg) {
|
|
||||||
|
switch(reg)
|
||||||
|
{
|
||||||
case DSP_REG_ACH0:
|
case DSP_REG_ACH0:
|
||||||
case DSP_REG_ACH1:
|
case DSP_REG_ACH1:
|
||||||
{
|
{
|
||||||
if (dirty) {
|
if (dirty)
|
||||||
|
{
|
||||||
//no need to extend to full 64bit here until interpreter
|
//no need to extend to full 64bit here until interpreter
|
||||||
//uses that
|
//uses that
|
||||||
if (oparg.IsSimpleReg()) {
|
if (oparg.IsSimpleReg())
|
||||||
|
{
|
||||||
//register is already shifted correctly
|
//register is already shifted correctly
|
||||||
//(if at all)
|
//(if at all)
|
||||||
|
|
||||||
@ -761,9 +836,13 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
|
|||||||
oparg.GetSimpleReg(),
|
oparg.GetSimpleReg(),
|
||||||
oparg);
|
oparg);
|
||||||
}
|
}
|
||||||
} else if (oparg.IsImm()) {
|
}
|
||||||
//todo: immediates?
|
else if (oparg.IsImm())
|
||||||
} else {
|
{
|
||||||
|
// TODO: Immediates?
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
//this works on the memory, so use reg instead
|
//this works on the memory, so use reg instead
|
||||||
//of real_reg, since it has the right loc
|
//of real_reg, since it has the right loc
|
||||||
X64Reg tmp;
|
X64Reg tmp;
|
||||||
@ -780,7 +859,8 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
|
|||||||
case DSP_REG_ACC0_64:
|
case DSP_REG_ACC0_64:
|
||||||
case DSP_REG_ACC1_64:
|
case DSP_REG_ACC1_64:
|
||||||
{
|
{
|
||||||
if (dirty) {
|
if (dirty)
|
||||||
|
{
|
||||||
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
|
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
|
||||||
emitter.SAR(64, oparg, Imm8(64-40));
|
emitter.SAR(64, oparg, Imm8(64-40));
|
||||||
}
|
}
|
||||||
@ -790,8 +870,11 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
regs[real_reg].used = false;
|
regs[real_reg].used = false;
|
||||||
if (regs[real_reg].loc.IsSimpleReg()) {
|
|
||||||
|
if (regs[real_reg].loc.IsSimpleReg())
|
||||||
|
{
|
||||||
regs[real_reg].dirty |= dirty;
|
regs[real_reg].dirty |= dirty;
|
||||||
regs[real_reg].last_use_ctr = use_ctr;
|
regs[real_reg].last_use_ctr = use_ctr;
|
||||||
use_ctr++;
|
use_ctr++;
|
||||||
@ -802,9 +885,12 @@ void DSPJitRegCache::readReg(int sreg, X64Reg host_dreg, DSPJitSignExtend extend
|
|||||||
{
|
{
|
||||||
OpArg reg;
|
OpArg reg;
|
||||||
getReg(sreg, reg);
|
getReg(sreg, reg);
|
||||||
switch(regs[sreg].size) {
|
|
||||||
|
switch(regs[sreg].size)
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
switch(extend) {
|
switch(extend)
|
||||||
|
{
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
case SIGN: emitter.MOVSX(64, 16, host_dreg, reg); break;
|
case SIGN: emitter.MOVSX(64, 16, host_dreg, reg); break;
|
||||||
case ZERO: emitter.MOVZX(64, 16, host_dreg, reg); break;
|
case ZERO: emitter.MOVZX(64, 16, host_dreg, reg); break;
|
||||||
@ -817,7 +903,8 @@ void DSPJitRegCache::readReg(int sreg, X64Reg host_dreg, DSPJitSignExtend extend
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
switch(extend) {
|
switch(extend)
|
||||||
|
{
|
||||||
case SIGN: emitter.MOVSX(64, 32, host_dreg, reg); break;
|
case SIGN: emitter.MOVSX(64, 32, host_dreg, reg); break;
|
||||||
case ZERO: emitter.MOVZX(64, 32, host_dreg, reg); break;
|
case ZERO: emitter.MOVZX(64, 32, host_dreg, reg); break;
|
||||||
case NONE: emitter.MOV(32, R(host_dreg), reg); break;
|
case NONE: emitter.MOV(32, R(host_dreg), reg); break;
|
||||||
@ -842,7 +929,9 @@ void DSPJitRegCache::writeReg(int dreg, OpArg arg)
|
|||||||
{
|
{
|
||||||
OpArg reg;
|
OpArg reg;
|
||||||
getReg(dreg, reg, false);
|
getReg(dreg, reg, false);
|
||||||
switch(regs[dreg].size) {
|
|
||||||
|
switch(regs[dreg].size)
|
||||||
|
{
|
||||||
case 2: emitter.MOV(16, reg, arg); break;
|
case 2: emitter.MOV(16, reg, arg); break;
|
||||||
case 4: emitter.MOV(32, reg, arg); break;
|
case 4: emitter.MOV(32, reg, arg); break;
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
@ -870,29 +959,36 @@ X64Reg DSPJitRegCache::spillXReg()
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int max_use_ctr_diff = 0;
|
unsigned int max_use_ctr_diff = 0;
|
||||||
X64Reg least_recent_use_reg = INVALID_REG;
|
X64Reg least_recent_use_reg = INVALID_REG;
|
||||||
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++) {
|
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||||
|
{
|
||||||
X64Reg reg = alloc_order[i];
|
X64Reg reg = alloc_order[i];
|
||||||
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
||||||
!regs[xregs[reg].guest_reg].used) {
|
!regs[xregs[reg].guest_reg].used)
|
||||||
|
{
|
||||||
unsigned int use_ctr_diff = use_ctr -
|
unsigned int use_ctr_diff = use_ctr -
|
||||||
regs[xregs[reg].guest_reg].last_use_ctr;
|
regs[xregs[reg].guest_reg].last_use_ctr;
|
||||||
if (use_ctr_diff >= max_use_ctr_diff) {
|
|
||||||
|
if (use_ctr_diff >= max_use_ctr_diff)
|
||||||
|
{
|
||||||
max_use_ctr_diff = use_ctr_diff;
|
max_use_ctr_diff = use_ctr_diff;
|
||||||
least_recent_use_reg = reg;
|
least_recent_use_reg = reg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (least_recent_use_reg != INVALID_REG) {
|
if (least_recent_use_reg != INVALID_REG)
|
||||||
|
{
|
||||||
movToMemory(xregs[least_recent_use_reg].guest_reg);
|
movToMemory(xregs[least_recent_use_reg].guest_reg);
|
||||||
return least_recent_use_reg;
|
return least_recent_use_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
//just choose one.
|
//just choose one.
|
||||||
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++) {
|
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||||
|
{
|
||||||
X64Reg reg = alloc_order[i];
|
X64Reg reg = alloc_order[i];
|
||||||
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
||||||
!regs[xregs[reg].guest_reg].used) {
|
!regs[xregs[reg].guest_reg].used)
|
||||||
|
{
|
||||||
movToMemory(xregs[reg].guest_reg);
|
movToMemory(xregs[reg].guest_reg);
|
||||||
return reg;
|
return reg;
|
||||||
}
|
}
|
||||||
@ -903,12 +999,16 @@ X64Reg DSPJitRegCache::spillXReg()
|
|||||||
|
|
||||||
void DSPJitRegCache::spillXReg(X64Reg reg)
|
void DSPJitRegCache::spillXReg(X64Reg reg)
|
||||||
{
|
{
|
||||||
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED) {
|
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED)
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE, !regs[xregs[reg].guest_reg].used,
|
_assert_msg_(DSPLLE, !regs[xregs[reg].guest_reg].used,
|
||||||
"to be spilled host reg %x(guest reg %x) still in use!",
|
"to be spilled host reg %x(guest reg %x) still in use!",
|
||||||
reg, xregs[reg].guest_reg);
|
reg, xregs[reg].guest_reg);
|
||||||
|
|
||||||
movToMemory(xregs[reg].guest_reg);
|
movToMemory(xregs[reg].guest_reg);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_NONE,
|
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_NONE,
|
||||||
"to be spilled host reg %x still in use!",
|
"to be spilled host reg %x still in use!",
|
||||||
reg);
|
reg);
|
||||||
@ -917,9 +1017,10 @@ void DSPJitRegCache::spillXReg(X64Reg reg)
|
|||||||
|
|
||||||
X64Reg DSPJitRegCache::findFreeXReg()
|
X64Reg DSPJitRegCache::findFreeXReg()
|
||||||
{
|
{
|
||||||
unsigned int i;
|
for(unsigned int i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||||
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++) {
|
{
|
||||||
if (xregs[alloc_order[i]].guest_reg == DSP_REG_NONE) {
|
if (xregs[alloc_order[i]].guest_reg == DSP_REG_NONE)
|
||||||
|
{
|
||||||
return alloc_order[i];
|
return alloc_order[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -946,23 +1047,29 @@ void DSPJitRegCache::getFreeXReg(X64Reg ®)
|
|||||||
|
|
||||||
void DSPJitRegCache::getXReg(X64Reg reg)
|
void DSPJitRegCache::getXReg(X64Reg reg)
|
||||||
{
|
{
|
||||||
if (xregs[reg].guest_reg == DSP_REG_STATIC) {
|
if (xregs[reg].guest_reg == DSP_REG_STATIC)
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "Trying to get statically used XReg %d", reg);
|
ERROR_LOG(DSPLLE, "Trying to get statically used XReg %d", reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xregs[reg].guest_reg != DSP_REG_NONE)
|
if (xregs[reg].guest_reg != DSP_REG_NONE)
|
||||||
spillXReg(reg);
|
spillXReg(reg);
|
||||||
|
|
||||||
_assert_msg_(DSPLLE, xregs[reg].guest_reg != DSP_REG_NONE, "register already in use");
|
_assert_msg_(DSPLLE, xregs[reg].guest_reg != DSP_REG_NONE, "register already in use");
|
||||||
xregs[reg].guest_reg = DSP_REG_USED;
|
xregs[reg].guest_reg = DSP_REG_USED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPJitRegCache::putXReg(X64Reg reg)
|
void DSPJitRegCache::putXReg(X64Reg reg)
|
||||||
{
|
{
|
||||||
if (xregs[reg].guest_reg == DSP_REG_STATIC) {
|
if (xregs[reg].guest_reg == DSP_REG_STATIC)
|
||||||
|
{
|
||||||
ERROR_LOG(DSPLLE, "Trying to put statically used XReg %d", reg);
|
ERROR_LOG(DSPLLE, "Trying to put statically used XReg %d", reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_USED,
|
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_USED,
|
||||||
"putXReg without get(Free)XReg");
|
"putXReg without get(Free)XReg");
|
||||||
|
|
||||||
xregs[reg].guest_reg = DSP_REG_NONE;
|
xregs[reg].guest_reg = DSP_REG_NONE;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPJITREGCACHE_H
|
#ifndef _DSPJITREGCACHE_H
|
||||||
@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
class DSPEmitter;
|
class DSPEmitter;
|
||||||
|
|
||||||
enum DSPJitRegSpecial {
|
enum DSPJitRegSpecial
|
||||||
|
{
|
||||||
DSP_REG_AX0_32 =32,
|
DSP_REG_AX0_32 =32,
|
||||||
DSP_REG_AX1_32 =33,
|
DSP_REG_AX1_32 =33,
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
@ -39,8 +40,11 @@ enum DSPJitRegSpecial {
|
|||||||
DSP_REG_NONE =255
|
DSP_REG_NONE =255
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DSPJitSignExtend {
|
enum DSPJitSignExtend
|
||||||
SIGN, ZERO, NONE
|
{
|
||||||
|
SIGN,
|
||||||
|
ZERO,
|
||||||
|
NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
@ -49,14 +53,17 @@ enum DSPJitSignExtend {
|
|||||||
#define NUMXREGS 8
|
#define NUMXREGS 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class DSPJitRegCache {
|
class DSPJitRegCache
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
struct X64CachedReg
|
struct X64CachedReg
|
||||||
{
|
{
|
||||||
int guest_reg; //including DSPJitRegSpecial
|
int guest_reg; //including DSPJitRegSpecial
|
||||||
bool pushed;
|
bool pushed;
|
||||||
};
|
};
|
||||||
struct DynamicReg {
|
|
||||||
|
struct DynamicReg
|
||||||
|
{
|
||||||
Gen::OpArg loc;
|
Gen::OpArg loc;
|
||||||
void *mem;
|
void *mem;
|
||||||
size_t size;
|
size_t size;
|
||||||
@ -67,7 +74,7 @@ private:
|
|||||||
int shift;//current shift if parentReg == DSP_REG_NONE
|
int shift;//current shift if parentReg == DSP_REG_NONE
|
||||||
//otherwise the shift this part can be found at
|
//otherwise the shift this part can be found at
|
||||||
Gen::X64Reg host_reg;
|
Gen::X64Reg host_reg;
|
||||||
/* todo:
|
/* TODO:
|
||||||
+ drop sameReg
|
+ drop sameReg
|
||||||
+ add parentReg
|
+ add parentReg
|
||||||
+ add shift:
|
+ add shift:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "../DSPMemoryMap.h"
|
#include "../DSPMemoryMap.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef __DSPJITUTIL_H__
|
#ifndef __DSPJITUTIL_H__
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "LabelMap.h"
|
#include "LabelMap.h"
|
||||||
@ -68,10 +68,13 @@ bool LabelMap::GetLabelValue(const std::string &label, u16 *value, LabelType typ
|
|||||||
{
|
{
|
||||||
if (!label.compare(labels[i].name))
|
if (!label.compare(labels[i].name))
|
||||||
{
|
{
|
||||||
if (type & labels[i].type) {
|
if (type & labels[i].type)
|
||||||
|
{
|
||||||
*value = labels[i].addr;
|
*value = labels[i].addr;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
printf("WARNING: Wrong label type requested. %s\n", label.c_str());
|
printf("WARNING: Wrong label type requested. %s\n", label.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _LABELMAP_H
|
#ifndef _LABELMAP_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "DSPEmulator.h"
|
#include "DSPEmulator.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPEMULATOR_H_
|
#ifndef _DSPEMULATOR_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DEBUGGER_SYMBOLMAP_H
|
#ifndef _DEBUGGER_SYMBOLMAP_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
// uncompress the dumps from costis GC-Debugger tool
|
// uncompress the dumps from costis GC-Debugger tool
|
||||||
//
|
//
|
||||||
|
@ -63,7 +63,8 @@ typedef struct
|
|||||||
unsigned short e_shtrndx;
|
unsigned short e_shtrndx;
|
||||||
} ELF_Header;
|
} ELF_Header;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
unsigned int vaddr;
|
unsigned int vaddr;
|
||||||
@ -88,7 +89,8 @@ typedef struct
|
|||||||
unsigned int entsize;
|
unsigned int entsize;
|
||||||
} Section_Header;
|
} Section_Header;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
unsigned int name;
|
unsigned int name;
|
||||||
unsigned int value;
|
unsigned int value;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
@ -97,7 +99,8 @@ typedef struct {
|
|||||||
unsigned short shndx;
|
unsigned short shndx;
|
||||||
} Symbol_Header;
|
} Symbol_Header;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
unsigned int info;
|
unsigned int info;
|
||||||
signed int addend;
|
signed int addend;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Debugger_SymbolMap.h"
|
#include "Debugger_SymbolMap.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// M O D U L E B E G I N
|
// M O D U L E B E G I N
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "FifoAnalyzer.h"
|
#include "FifoAnalyzer.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFOANALYZER_H
|
#ifndef _FIFOANALYZER_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "FifoDataFile.h"
|
#include "FifoDataFile.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFODATAFILE_H_
|
#ifndef _FIFODATAFILE_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFOFILESTRUCT_H_
|
#ifndef _FIFOFILESTRUCT_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "FifoAnalyzer.h"
|
#include "FifoAnalyzer.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFOPLAYBACKANALYZER_H_
|
#ifndef _FIFOPLAYBACKANALYZER_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "FifoDataFile.h"
|
#include "FifoDataFile.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFOPLAYER_H_
|
#ifndef _FIFOPLAYER_H_
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "FifoAnalyzer.h"
|
#include "FifoAnalyzer.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFORECORDANALYZER_H_
|
#ifndef _FIFORECORDANALYZER_H_
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _FIFORECORDER_H_
|
#ifndef _FIFORECORDER_H_
|
||||||
|
@ -104,12 +104,14 @@ void SetActiveCodes(const std::vector<GeckoCode>& gcodes)
|
|||||||
gcodes_iter = gcodes.begin(),
|
gcodes_iter = gcodes.begin(),
|
||||||
gcodes_end = gcodes.end();
|
gcodes_end = gcodes.end();
|
||||||
for (; gcodes_iter!=gcodes_end; ++gcodes_iter)
|
for (; gcodes_iter!=gcodes_end; ++gcodes_iter)
|
||||||
|
{
|
||||||
if (gcodes_iter->enabled)
|
if (gcodes_iter->enabled)
|
||||||
{
|
{
|
||||||
// TODO: apply modifiers
|
// TODO: apply modifiers
|
||||||
// TODO: don't need description or creator string, just takin up memory
|
// TODO: don't need description or creator string, just takin up memory
|
||||||
active_codes.push_back(*gcodes_iter);
|
active_codes.push_back(*gcodes_iter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inserted_asm_codes.clear();
|
inserted_asm_codes.clear();
|
||||||
|
|
||||||
@ -289,7 +291,8 @@ void RunCodeHandler()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<u32, std::vector<u32> >& GetInsertedAsmCodes() {
|
const std::map<u32, std::vector<u32> >& GetInsertedAsmCodes()
|
||||||
|
{
|
||||||
return inserted_asm_codes;
|
return inserted_asm_codes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,8 +594,10 @@ bool FlowControl()
|
|||||||
current_code = target_code - 1;
|
current_code = target_code - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return false; // trying to GOTO to bad address
|
return false; // trying to GOTO to bad address
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// CST4 : Gosub
|
// CST4 : Gosub
|
||||||
@ -608,8 +613,10 @@ bool FlowControl()
|
|||||||
current_code = target_code - 1;
|
current_code = target_code - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return false; // trying to GOSUB to bad address
|
return false; // trying to GOSUB to bad address
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// INVALID SUBTYPE
|
// INVALID SUBTYPE
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _HLE_H
|
#ifndef _HLE_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef HLE_MISC_H
|
#ifndef HLE_MISC_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef HLE_OS_H
|
#ifndef HLE_OS_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// See CPP file for comments.
|
// See CPP file for comments.
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
@ -78,7 +78,8 @@ reswitch:
|
|||||||
PowerPC::SingleStep();
|
PowerPC::SingleStep();
|
||||||
|
|
||||||
//4: update disasm dialog
|
//4: update disasm dialog
|
||||||
if (m_SyncEvent) {
|
if (m_SyncEvent)
|
||||||
|
{
|
||||||
m_SyncEvent->Set();
|
m_SyncEvent->Set();
|
||||||
m_SyncEvent = 0;
|
m_SyncEvent = 0;
|
||||||
}
|
}
|
||||||
@ -157,6 +158,7 @@ bool CCPU::PauseAndLock(bool doLock, bool unpauseOnUnlock)
|
|||||||
PowerPC::Start();
|
PowerPC::Start();
|
||||||
m_StepEvent.Set();
|
m_StepEvent.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Core::IsCPUThread())
|
if (!Core::IsCPUThread())
|
||||||
m_csCpuOccupied.unlock();
|
m_csCpuOccupied.unlock();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#ifndef _CPU_H
|
#ifndef _CPU_H
|
||||||
#define _CPU_H
|
#define _CPU_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
// AID / AUDIO_DMA controls pushing audio out to the SRC and then the speakers.
|
// AID / AUDIO_DMA controls pushing audio out to the SRC and then the speakers.
|
||||||
@ -180,7 +180,8 @@ struct ARAMInfo
|
|||||||
u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc...
|
u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc...
|
||||||
|
|
||||||
// Default to GC mode
|
// Default to GC mode
|
||||||
ARAMInfo() {
|
ARAMInfo()
|
||||||
|
{
|
||||||
wii_mode = false;
|
wii_mode = false;
|
||||||
size = ARAM_SIZE;
|
size = ARAM_SIZE;
|
||||||
mask = ARAM_MASK;
|
mask = ARAM_MASK;
|
||||||
@ -651,14 +652,18 @@ void GenerateDSPInterruptFromDSPEmu(DSPInterruptType type, bool _bSet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// called whenever SystemTimers thinks the dsp deserves a few more cycles
|
// called whenever SystemTimers thinks the dsp deserves a few more cycles
|
||||||
void UpdateDSPSlice(int cycles) {
|
void UpdateDSPSlice(int cycles)
|
||||||
if (dsp_is_lle) {
|
{
|
||||||
|
if (dsp_is_lle)
|
||||||
|
{
|
||||||
//use up the rest of the slice(if any)
|
//use up the rest of the slice(if any)
|
||||||
dsp_emulator->DSP_Update(dsp_slice);
|
dsp_emulator->DSP_Update(dsp_slice);
|
||||||
dsp_slice %= 6;
|
dsp_slice %= 6;
|
||||||
//note the new budget
|
//note the new budget
|
||||||
dsp_slice += cycles;
|
dsp_slice += cycles;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
dsp_emulator->DSP_Update(cycles);
|
dsp_emulator->DSP_Update(cycles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -727,7 +732,10 @@ void Do_ARAM_DMA()
|
|||||||
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
|
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
|
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
|
||||||
|
}
|
||||||
|
|
||||||
g_arDMA.MMAddr += 8;
|
g_arDMA.MMAddr += 8;
|
||||||
g_arDMA.ARAddr += 8;
|
g_arDMA.ARAddr += 8;
|
||||||
g_arDMA.Cnt.count -= 8;
|
g_arDMA.Cnt.count -= 8;
|
||||||
@ -772,7 +780,9 @@ void Do_ARAM_DMA()
|
|||||||
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
|
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
|
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
|
||||||
|
}
|
||||||
|
|
||||||
g_arDMA.MMAddr += 8;
|
g_arDMA.MMAddr += 8;
|
||||||
g_arDMA.ARAddr += 8;
|
g_arDMA.ARAddr += 8;
|
||||||
@ -803,7 +813,9 @@ u8 ReadARAM(u32 _iAddress)
|
|||||||
return Memory::Read_U8(_iAddress & Memory::RAM_MASK);
|
return Memory::Read_U8(_iAddress & Memory::RAM_MASK);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return g_ARAM.ptr[_iAddress & g_ARAM.mask];
|
return g_ARAM.ptr[_iAddress & g_ARAM.mask];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteARAM(u8 value, u32 _uAddress)
|
void WriteARAM(u8 value, u32 _uAddress)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPINTERFACE_H
|
#ifndef _DSPINTERFACE_H
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -31,7 +31,8 @@
|
|||||||
#include "HW/SystemTimers.h"
|
#include "HW/SystemTimers.h"
|
||||||
#include "HW/VideoInterface.h"
|
#include "HW/VideoInterface.h"
|
||||||
|
|
||||||
DSPHLE::DSPHLE() {
|
DSPHLE::DSPHLE()
|
||||||
|
{
|
||||||
m_InitMixer = false;
|
m_InitMixer = false;
|
||||||
soundStream = NULL;
|
soundStream = NULL;
|
||||||
}
|
}
|
||||||
@ -42,7 +43,8 @@ struct DSPState
|
|||||||
u32 CPUMailbox;
|
u32 CPUMailbox;
|
||||||
u32 DSPMailbox;
|
u32 DSPMailbox;
|
||||||
|
|
||||||
void Reset() {
|
void Reset()
|
||||||
|
{
|
||||||
CPUMailbox = 0x00000000;
|
CPUMailbox = 0x00000000;
|
||||||
DSPMailbox = 0x00000000;
|
DSPMailbox = 0x00000000;
|
||||||
}
|
}
|
||||||
@ -195,7 +197,9 @@ void DSPHLE::DoState(PointerWrap &p)
|
|||||||
if (ucode != m_pUCode)
|
if (ucode != m_pUCode)
|
||||||
{
|
{
|
||||||
if (p.GetMode() != PointerWrap::MODE_READ)
|
if (p.GetMode() != PointerWrap::MODE_READ)
|
||||||
|
{
|
||||||
delete ucode;
|
delete ucode;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete m_pUCode;
|
delete m_pUCode;
|
||||||
@ -205,7 +209,9 @@ void DSPHLE::DoState(PointerWrap &p)
|
|||||||
if (lastucode != m_lastUCode)
|
if (lastucode != m_lastUCode)
|
||||||
{
|
{
|
||||||
if (p.GetMode() != PointerWrap::MODE_READ)
|
if (p.GetMode() != PointerWrap::MODE_READ)
|
||||||
|
{
|
||||||
delete lastucode;
|
delete lastucode;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete m_lastUCode;
|
delete m_lastUCode;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// A copy of the GPL 2.0 should have been included with the program.
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
// If not, see http://www.gnu.org/licenses/
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official Git repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _DSPHLE_H
|
#ifndef _DSPHLE_H
|
||||||
@ -71,7 +71,8 @@ private:
|
|||||||
u32 CPUMailbox;
|
u32 CPUMailbox;
|
||||||
u32 DSPMailbox;
|
u32 DSPMailbox;
|
||||||
|
|
||||||
void Reset() {
|
void Reset()
|
||||||
|
{
|
||||||
CPUMailbox = 0x00000000;
|
CPUMailbox = 0x00000000;
|
||||||
DSPMailbox = 0x00000000;
|
DSPMailbox = 0x00000000;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user