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:
Lioncash 2013-04-16 23:14:36 -04:00
parent f498686289
commit 2316cb6876
324 changed files with 3133 additions and 2569 deletions

View File

@ -16,7 +16,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "ARDecrypt.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _ARDECRYPT_H_
#define _ARDECRYPT_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// -----------------------------------------------------------------------------------------
@ -198,8 +198,10 @@ void LoadCodes(IniFile &ini, bool forceLoad)
if (!success_val) PanicAlertT("The value is invalid");
}
else
{
currentCode.ops.push_back(op);
}
}
else
{
SplitString(line, '-', pieces);

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _ACTIONREPLAY_H_

View File

@ -53,7 +53,8 @@
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
VolumeHandler::ReadToPtr(Memory::GetPointer(0x80000000), 0, 0x20);

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _BOOT_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Boot_DOL.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _BOOT_DOL_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "../PowerPC/PowerPC.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#pragma once

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Boot.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <string>

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _ELFREADER_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// File description
@ -78,7 +78,8 @@ bool BootCore(const std::string& _rFilename)
StartUp.hInstance = Host_GetInstance();
// 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
IniFile game_ini;

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _BOOTMANAGER_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <string>
@ -65,7 +65,7 @@ static const struct {
{ "StartRecording", 0, 0 /* wxMOD_NONE */ },
{ "PlayRecording", 0, 0 /* wxMOD_NONE */ },
{ "ExportRecording", 0, 0 /* wxMOD_NONE */ },
{ "ExportRecording",0, 0 /* wxMOD_NONE */ },
{ "Readonlymode", 0, 0 /* wxMOD_NONE */ },
{ "ToggleFullscreen", 13 /* WXK_RETURN */, 1 /* wxMOD_ALT */ },

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _CONFIGMANAGER_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <iostream>
@ -150,5 +150,7 @@ void Console_Submit(const char *cmd)
g_symbolDB.List();
}
else
{
ERROR_LOG(CONSOLE, "Invalid command");
}
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
@ -143,7 +143,9 @@ void DisplayMessage(const char *message, int time_in_ms)
Host_UpdateStatusBar(message);
}
else
{
Host_UpdateTitle(message);
}
}
void Callback_DebuggerBreak()
@ -555,7 +557,9 @@ static std::string GenerateScreenshotName()
std::string name;
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
{}
{
// TODO?
}
return name;
}
@ -614,7 +618,8 @@ void VideoThrottle()
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
u32 timeDifference = (u32)Timer.GetTimeDifference();
if (timeDifference < frametime) {
if (timeDifference < frametime)
{
Common::SleepCurrentThread(frametime - timeDifference - 1);
}
@ -742,10 +747,12 @@ void UpdateTitle()
}
if (_CoreParameter.bRenderToMain &&
SConfig::GetInstance().m_InterfaceStatusbar) {
SConfig::GetInstance().m_InterfaceStatusbar)
{
Host_UpdateStatusBar(SMessage.c_str());
Host_UpdateTitle(scm_rev_str);
} else
}
else
Host_UpdateTitle(TMessage.c_str());
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _COREPARAMETER_H
@ -21,7 +21,8 @@
#include "IniFile.h"
#include <string>
enum Hotkey {
enum Hotkey
{
HK_OPEN,
HK_CHANGE_DISC,
HK_REFRESH_LIST,

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <vector>
@ -262,7 +262,9 @@ void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata)
event_types[event_type].callback(userdata, 0);
}
else
{
ScheduleEvent_Threadsafe(0, event_type, userdata);
}
}
void ClearPendingEvents()
@ -327,6 +329,7 @@ void RemoveEvent(int event_type)
{
if (!first)
return;
while(first)
{
if (first->type == event_type)
@ -340,8 +343,10 @@ void RemoveEvent(int event_type)
break;
}
}
if (!first)
return;
Event *prev = first;
Event *ptr = prev->next;
while (ptr)
@ -367,6 +372,7 @@ void RemoveThreadsafeEvent(int event_type)
{
return;
}
while(tsFirst)
{
if (tsFirst->type == event_type)
@ -380,10 +386,12 @@ void RemoveThreadsafeEvent(int event_type)
break;
}
}
if (!tsFirst)
{
return;
}
Event *prev = tsFirst;
Event *ptr = prev->next;
while (ptr)
@ -499,6 +507,7 @@ void Advance()
break;
}
}
if (!first)
{
WARN_LOG(POWERPC, "WARNING - no events in queue. Setting downcount to 10000");
@ -511,6 +520,7 @@ void Advance()
slicelength = maxSliceLength;
downcount = slicelength;
}
if (advanceCallback)
advanceCallback(cyclesExecuted);
}
@ -554,9 +564,11 @@ std::string GetScheduledEventsSummary()
unsigned int t = ptr->type;
if (t >= event_types.size())
PanicAlertT("Invalid event type %i", t);
const char *name = event_types[ptr->type].name;
if (!name)
name = "[unknown]";
text += StringFromFormat("%s : %i %08x%08x\n", event_types[ptr->type].name, ptr->time, ptr->userdata >> 32, ptr->userdata);
ptr = ptr->next;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _CORETIMING_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSP_ACCELERATOR_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "DSPAnalyzer.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Basic code analysis.

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSP_BREAKPOINTS
@ -21,38 +21,53 @@
#include "Common.h"
// 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
{
public:
DSPBreakpoints() {Clear();}
DSPBreakpoints()
{
Clear();
}
// is address breakpoint
bool IsAddressBreakPoint(u32 addr) {
bool IsAddressBreakPoint(u32 addr)
{
return b[addr] != 0;
}
// AddBreakPoint
bool Add(u32 addr, bool temp=false) {
bool Add(u32 addr, bool temp=false)
{
bool was_one = b[addr] != 0;
if (!was_one) {
if (!was_one)
{
b[addr] = temp ? 2 : 1;
return true;
} else {
}
else
{
return false;
}
}
// Remove Breakpoint
bool Remove(u32 addr) {
bool Remove(u32 addr)
{
bool was_one = b[addr] != 0;
b[addr] = 0;
return was_one;
}
void Clear() {
void Clear()
{
for (int i = 0; i < 65536; i++)
b[i] = 0;
}
void DeleteByAddress(u32 addr) {
void DeleteByAddress(u32 addr)
{
b[addr] = 0;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#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.
DSPAssembler assembler(settings);
if (!assembler.Assemble(text, code)) {
if (!assembler.Assemble(text, code))
{
std::cerr << assembler.GetErrorString() << std::endl;
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++)
{
if (code1[i] == code2[i])
{
count_equal++;
}
else
{
std::string line1, line2;

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPCODEUTIL_H

View File

@ -260,11 +260,13 @@ void DSPCore_CheckExceptions()
if (g_dsp.exceptions == 0)
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
if (g_dsp.exceptions & (1 << i)) {
if (dsp_SR_is_flag_set(SR_INT_ENABLE) || (i == EXP_INT)) {
if (g_dsp.exceptions & (1 << i))
{
if (dsp_SR_is_flag_set(SR_INT_ENABLE) || (i == EXP_INT))
{
// store pc and sr until RTI
dsp_reg_store_stack(DSP_STACK_C, g_dsp.pc);
dsp_reg_store_stack(DSP_STACK_D, g_dsp.r.sr);
@ -276,7 +278,9 @@ void DSPCore_CheckExceptions()
else
g_dsp.r.sr &= ~SR_INT_ENABLE;
break;
} else {
}
else
{
#if defined(_DEBUG) || defined(DEBUGFAST)
ERROR_LOG(DSPLLE, "Firing exception %d failed", i);
#endif
@ -381,8 +385,10 @@ void CompileCurrent()
}
}
u16 DSPCore_ReadRegister(int reg) {
switch(reg) {
u16 DSPCore_ReadRegister(int reg)
{
switch(reg)
{
case DSP_REG_AR0:
case DSP_REG_AR1:
case DSP_REG_AR2:
@ -430,8 +436,10 @@ u16 DSPCore_ReadRegister(int reg) {
}
}
void DSPCore_WriteRegister(int reg, u16 val) {
switch(reg) {
void DSPCore_WriteRegister(int reg, u16 val)
{
switch(reg)
{
case DSP_REG_AR0:
case DSP_REG_AR1:
case DSP_REG_AR2:

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <cstring>
@ -147,28 +147,38 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
bool ext_is_jit = false;
// Call extended
if (tinst->extended) {
if ((inst >> 12) == 0x3) {
if (! extOpTable[inst & 0x7F]->jitFunc) {
if (tinst->extended)
{
if ((inst >> 12) == 0x3)
{
if (! extOpTable[inst & 0x7F]->jitFunc)
{
// Fall back to interpreter
gpr.pushRegs();
ABI_CallFunctionC16((void*)extOpTable[inst & 0x7F]->intFunc, inst);
gpr.popRegs();
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
ext_is_jit = false;
} else {
}
else
{
(this->*extOpTable[inst & 0x7F]->jitFunc)(inst);
ext_is_jit = true;
}
} else {
if (!extOpTable[inst & 0xFF]->jitFunc) {
}
else
{
if (!extOpTable[inst & 0xFF]->jitFunc)
{
// Fall back to interpreter
gpr.pushRegs();
ABI_CallFunctionC16((void*)extOpTable[inst & 0xFF]->intFunc, inst);
gpr.popRegs();
INFO_LOG(DSPLLE, "Instruction not JITed(ext part): %04x\n", inst);
ext_is_jit = false;
} else {
}
else
{
(this->*extOpTable[inst & 0xFF]->jitFunc)(inst);
ext_is_jit = true;
}
@ -176,7 +186,8 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
}
// Main instruction
if (!opTable[inst]->jitFunc) {
if (!opTable[inst]->jitFunc)
{
Default(inst);
INFO_LOG(DSPLLE, "Instruction not JITed(main part): %04x\n", inst);
}
@ -186,14 +197,18 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
}
// Backlog
if (tinst->extended) {
if (!ext_is_jit) {
if (tinst->extended)
{
if (!ext_is_jit)
{
//need to call the online cleanup function because
//the writeBackLog gets populated at runtime
gpr.pushRegs();
ABI_CallFunction((void*)::applyWriteBackLog);
gpr.popRegs();
} else {
}
else
{
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));
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPEMITTER_H

View File

@ -154,7 +154,8 @@ void gdsp_ifx_write(u32 addr, u32 val)
break;
case DSP_GAIN:
if (val) {
if (val)
{
INFO_LOG(DSPLLE,"Gain Written: 0x%04x", val);
}
case DSP_DSPA:
@ -169,15 +170,19 @@ void gdsp_ifx_write(u32 addr, u32 val)
break;
*/
default:
if ((addr & 0xff) >= 0xa0) {
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description) {
if ((addr & 0xff) >= 0xa0)
{
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);
}
else {
else
{
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);
}
g_dsp.ifx_regs[addr & 0xFF] = val;
@ -211,15 +216,19 @@ u16 gdsp_ifx_read(u16 addr)
return dsp_read_aram_d3();
default:
if ((addr & 0xff) >= 0xa0) {
if (pdlabels[(addr & 0xFF) - 0xa0].name && pdlabels[(addr & 0xFF) - 0xa0].description) {
if ((addr & 0xff) >= 0xa0)
{
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]);
}
else {
else
{
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]);
}
return g_dsp.ifx_regs[addr & 0xFF];

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPHOST_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "DSPIntUtil.h"
#include "DSPMemoryMap.h"
@ -56,21 +56,24 @@ inline bool IsSameMemArea(u16 a, u16 b)
// DR $arR
// xxxx xxxx 0000 01rr
// Decrement addressing register $arR.
void dr(const UDSPInstruction opc) {
void dr(const UDSPInstruction opc)
{
writeToBackLog(0, opc & 0x3, dsp_decrement_addr_reg(opc & 0x3));
}
// IR $arR
// xxxx xxxx 0000 10rr
// Increment addressing register $arR.
void ir(const UDSPInstruction opc) {
void ir(const UDSPInstruction opc)
{
writeToBackLog(0, opc & 0x3, dsp_increment_addr_reg(opc & 0x3));
}
// NR $arR
// xxxx xxxx 0000 11rr
// Add corresponding indexing register $ixR to addressing register $arR.
void nr(const UDSPInstruction opc) {
void nr(const UDSPInstruction opc)
{
u8 reg = opc & 0x3;
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 dreg = ((opc >> 2) & 0x3);
switch(sreg) {
switch(sreg)
{
case DSP_REG_ACL0:
case DSP_REG_ACL1:
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 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
switch(sreg) {
switch(sreg)
{
case DSP_REG_ACL0:
case DSP_REG_ACL1:
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 sreg = ((opc >> 3) & 0x3) + DSP_REG_ACL0;
switch(sreg) {
switch(sreg)
{
case DSP_REG_ACL0:
case DSP_REG_ACL1:
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
// infinitive loops
for (int i = 0; writeBackLogIdx[i] != -1; i++) {
for (int i = 0; writeBackLogIdx[i] != -1; i++)
{
#ifdef PRECISE_BACKLOG
dsp_op_write_reg(writeBackLogIdx[i], dsp_op_read_reg(writeBackLogIdx[i]) | writeBackLog[i]);
#else
@ -543,7 +550,8 @@ void zeroWriteBackLog()
#ifdef PRECISE_BACKLOG
// always make sure to have an extra entry at the end w/ -1 to avoid
// 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);
}
#endif
@ -552,8 +560,8 @@ void zeroWriteBackLog()
void zeroWriteBackLogPreserveAcc(u8 acc)
{
#ifdef PRECISE_BACKLOG
for (int i = 0; writeBackLogIdx[i] != -1; i++) {
for (int i = 0; writeBackLogIdx[i] != -1; i++)
{
// acc0
if ((acc == 0) &&
((writeBackLogIdx[i] == DSP_REG_ACL0) || (writeBackLogIdx[i] == DSP_REG_ACM0) || (writeBackLogIdx[i] == DSP_REG_ACH0)))

View File

@ -130,7 +130,9 @@ static inline u16 dsp_decrement_addr_reg(u16 reg)
static inline u16 dsp_op_read_reg(int _reg)
{
int reg = _reg & 0x1f;
switch (reg) {
switch (reg)
{
case DSP_REG_ST0:
case DSP_REG_ST1:
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)
{
int reg = _reg & 0x1f;
switch (reg) {
switch (reg)
{
// 8-bit sign extended registers. Should look at prod.h too...
case DSP_REG_ACH0:
case DSP_REG_ACH1:
@ -349,10 +353,14 @@ inline u16 dsp_op_read_reg_and_saturate(u8 _reg)
return 0x8000;
}
else
{
return g_dsp.r.ac[_reg].m;
}
}
else
{
return g_dsp.r.ac[_reg].m;
}
}
// ---------------------------------------------------------------------------------------

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPINTERPRETER_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie (c) 2005 (duddie@walla.com)
@ -27,7 +27,8 @@
void nop(const UDSPInstruction opc)
{
// The real nop is 0. Anything else is bad.
if (opc) {
if (opc)
{
ERROR_LOG(DSPLLE, "LLE: Unrecognized opcode 0x%04x", opc);
}
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// 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);
if (tinst->extended) {
if (tinst->extended)
{
if ((inst >> 12) == 0x3)
extOpTable[inst & 0x7F]->intFunc(inst);
else
extOpTable[inst & 0xFF]->intFunc(inst);
}
tinst->intFunc(inst);
if (tinst->extended) {
if (tinst->extended)
{
applyWriteBackLog();
}
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// 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;
s64 ax = 0;
switch(sreg) {
switch(sreg)
{
case DSP_REG_AXL0:
case DSP_REG_AXL1:
ax = (s16)g_dsp.r.ax[sreg-DSP_REG_AXL0].l;
@ -973,9 +974,12 @@ void lsrn(const UDSPInstruction opc)
else
shift = accm & 0x3f;
if (shift > 0) {
if (shift > 0)
{
acc >>= shift;
} else if (shift < 0) {
}
else if (shift < 0)
{
acc <<= -shift;
}
@ -1002,9 +1006,12 @@ void asrn(const UDSPInstruction opc)
else
shift = accm & 0x3f;
if (shift > 0) {
if (shift > 0)
{
acc >>= shift;
} else if (shift < 0) {
}
else if (shift < 0)
{
acc <<= -shift;
}
@ -1035,9 +1042,12 @@ void lsrnrx(const UDSPInstruction opc)
else
shift = axh & 0x3f;
if (shift > 0) {
if (shift > 0)
{
acc <<= shift;
} else if (shift < 0) {
}
else if (shift < 0)
{
acc >>= -shift;
}
@ -1069,9 +1079,12 @@ void asrnrx(const UDSPInstruction opc)
else
shift = axh & 0x3f;
if (shift > 0) {
if (shift > 0)
{
acc <<= shift;
} else if (shift < 0) {
}
else if (shift < 0)
{
acc >>= -shift;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004
@ -194,7 +194,9 @@ void loop(const UDSPInstruction opc)
dsp_reg_store_stack(3, cnt);
}
else
{
dsp_skip_inst();
}
}
// LOOPI #I
@ -217,7 +219,9 @@ void loopi(const UDSPInstruction opc)
dsp_reg_store_stack(3, cnt);
}
else
{
dsp_skip_inst();
}
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "../DSPMemoryMap.h"
@ -29,7 +29,8 @@ template <void(*jitCode)(const UDSPInstruction, DSPEmitter&)>
static void ReJitConditional(const UDSPInstruction opc, DSPEmitter& emitter)
{
u8 cond = opc & 0xf;
if (cond == 0xf) {// Always true.
if (cond == 0xf) // Always true.
{
jitCode(opc,emitter);
return;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "../DSPMemoryMap.h"
#include "../DSPEmitter.h"
@ -41,21 +41,24 @@ using namespace Gen;
// DR $arR
// xxxx xxxx 0000 01rr
// Decrement addressing register $arR.
void DSPEmitter::dr(const UDSPInstruction opc) {
void DSPEmitter::dr(const UDSPInstruction opc)
{
decrement_addr_reg(opc & 0x3);
}
// IR $arR
// xxxx xxxx 0000 10rr
// Increment addressing register $arR.
void DSPEmitter::ir(const UDSPInstruction opc) {
void DSPEmitter::ir(const UDSPInstruction opc)
{
increment_addr_reg(opc & 0x3);
}
// NR $arR
// xxxx xxxx 0000 11rr
// 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;
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
// storeIndex
void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg) {
void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg)
{
dsp_op_read_reg(sreg, RBX, ZERO);
storeIndex = dreg;
}
void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg) {
void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg)
{
// u16 addr = g_dsp.r[addr];
X64Reg tmp1;
@ -673,7 +678,8 @@ void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg) {
storeIndex = dreg;
}
void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg) {
void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg)
{
// u16 addr = g_dsp.r[addr];
X64Reg tmp1;
@ -690,7 +696,8 @@ void DSPEmitter::pushExtValueFromMem2(u16 dreg, u16 sreg) {
storeIndex2 = dreg;
}
void DSPEmitter::popExtValueToReg() {
void DSPEmitter::popExtValueToReg()
{
// in practise, we rarely ever have a non-NX main op
// with an extended op, so the OR here is either
// 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.
// [nakeee] the or case never happens in real
// [nakeee] it's just how the hardware works so we added it
if (storeIndex != -1) {
if (storeIndex != -1)
{
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));
FixupBranch not_40bit = J_CC(CC_Z, true);
DSPJitRegCache c(gpr);
@ -722,9 +731,11 @@ void DSPEmitter::popExtValueToReg() {
storeIndex = -1;
if (storeIndex2 != -1) {
if (storeIndex2 != -1)
{
SHR(32, R(EBX), Imm8(16));
dsp_op_write_reg(storeIndex2, RBX);
}
storeIndex2 = -1;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004
@ -49,7 +49,6 @@ void DSPEmitter::srs(const UDSPInstruction opc)
dmem_write(tmp1);
gpr.putXReg(tmp1);
}
// LRS $(0x18+D), @M

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
@ -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)
{
switch (reg & 0x1f) {
switch (reg & 0x1f)
{
case DSP_REG_ST0:
case DSP_REG_ST1:
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
OpArg sr_reg;
@ -441,7 +443,8 @@ void DSPEmitter::setCompileSR(u16 bit) {
compileSR |= bit;
}
void DSPEmitter::clrCompileSR(u16 bit) {
void DSPEmitter::clrCompileSR(u16 bit)
{
// g_dsp.r[DSP_REG_SR] &= bit
OpArg sr_reg;

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// Additional copyrights go to Duddie and Tratax (c) 2004

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "DSPJitRegCache.h"
@ -21,8 +21,10 @@
using namespace Gen;
static void *reg_ptr(int reg) {
switch(reg) {
static void *reg_ptr(int reg)
{
switch(reg)
{
case DSP_REG_AR0:
case DSP_REG_AR1:
case DSP_REG_AR2:
@ -84,11 +86,14 @@ static void *reg_ptr(int reg) {
//#undef STATIC_REG_ACCS
DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
: emitter(_emitter), temporary(false), merged(false) {
for(unsigned int i = 0; i < NUMXREGS; i++) {
: emitter(_emitter), temporary(false), merged(false)
{
for(unsigned int i = 0; i < NUMXREGS; i++)
{
xregs[i].guest_reg = DSP_REG_STATIC;
xregs[i].pushed = false;
}
xregs[RAX].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
@ -119,7 +124,8 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
xregs[R15].guest_reg = DSP_REG_NONE;
#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].size = 0;
regs[i].dirty = false;
@ -140,7 +146,8 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
regs[DSP_REG_ACC0_64].host_reg = R8;
regs[DSP_REG_ACC1_64].host_reg = R9;
#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_ACL0].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_ACH0].shift = 32;
}
regs[DSP_REG_PROD_64].size = 8;
regs[DSP_REG_PRODL].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;
#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_AXL0].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;
//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
if (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
int movcnt;
do {
do
{
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_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);
movcnt++;
@ -230,7 +242,8 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
} while (movcnt != 0);
//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() !=
regs[i].loc.GetSimpleReg() &&
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
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
if (cache.regs[i].loc.IsSimpleReg()) {
movToHostReg(i, cache.regs[i].loc.GetSimpleReg(),
true);
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
{
if (cache.regs[i].loc.IsSimpleReg())
{
movToHostReg(i, cache.regs[i].loc.GetSimpleReg(), 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].dirty |= cache.regs[i].dirty;
regs[i].last_use_ctr = cache.regs[i].last_use_ctr;
}
//consistency checks
for(i = 0; i < NUMXREGS; i++) {
for(i = 0; i < NUMXREGS; i++)
{
_assert_msg_(DSPLLE,
xregs[i].guest_reg == cache.xregs[i].guest_reg,
"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,
regs[i].loc.IsImm() == cache.regs[i].loc.IsImm(),
"cache and current reg loc mismatch for %x", i);
@ -285,16 +304,21 @@ void DSPJitRegCache::flushMemBackedRegs()
//this should have the same effect as
//merge(DSPJitRegCache(emitter));
unsigned int i;
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
for(unsigned int i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++)
{
_assert_msg_(DSPLLE, !regs[i].used,
"register %x still in use", i);
if (regs[i].used)
emitter.INT3();
if (regs[i].host_reg != INVALID_REG) {
if (regs[i].host_reg != INVALID_REG)
{
movToHostReg(i,regs[i].host_reg,true);
rotateHostReg(i, 0, true);
} else if (regs[i].parentReg == DSP_REG_NONE) {
}
else if (regs[i].parentReg == DSP_REG_NONE)
{
movToMemory(i);
}
}
@ -304,12 +328,14 @@ void DSPJitRegCache::flushRegs()
{
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)
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,
!regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i);
@ -373,12 +399,14 @@ static u64 ebp_store;
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)
movToHostReg(i,regs[i].host_reg);
}
if (emit) {
if (emit)
{
#ifdef _M_X64
emitter.MOV(64, M(&ebp_store), R(RBP));
#else
@ -391,12 +419,14 @@ void DSPJitRegCache::saveRegs()
{
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)
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,
!regs[i].loc.IsSimpleReg(),
"register %x is still a simple reg", i);
@ -409,16 +439,19 @@ void DSPJitRegCache::saveRegs()
#endif
}
void DSPJitRegCache::pushRegs() {
void DSPJitRegCache::pushRegs()
{
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)
movToMemory(i);
}
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)
push_count++;
}
@ -432,21 +465,25 @@ void DSPJitRegCache::pushRegs() {
emitter.SUB(32,R(ESP),Imm32(16 - 4 * (push_count & 3)));
#endif
for(unsigned int i = 0; i < NUMXREGS; i++) {
if (xregs[i].guest_reg == DSP_REG_USED) {
for(unsigned int i = 0; i < NUMXREGS; i++)
{
if (xregs[i].guest_reg == DSP_REG_USED)
{
emitter.PUSH((X64Reg)i);
xregs[i].pushed = true;
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,
!regs[i].loc.IsSimpleReg(),
"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,
xregs[i].guest_reg == DSP_REG_NONE ||
xregs[i].guest_reg == DSP_REG_STATIC,
@ -467,13 +504,16 @@ void DSPJitRegCache::popRegs() {
emitter.MOV(32, M(&ebp_store), R(EBP));
#endif
int push_count = 0;
for(unsigned int i = 0; i < NUMXREGS; i++) {
for(unsigned int i = 0; i < NUMXREGS; i++)
{
if (xregs[i].pushed)
push_count++;
}
for(int i = NUMXREGS-1; i >= 0; i--) {
if (xregs[i].pushed) {
for(int i = NUMXREGS-1; i >= 0; i--)
{
if (xregs[i].pushed)
{
emitter.POP((X64Reg)i);
xregs[i].pushed = false;
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)));
#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)
movToHostReg(i,regs[i].host_reg);
}
}
X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg) {
if (reg != RBP) {
X64Reg DSPJitRegCache::makeABICallSafe(X64Reg reg)
{
if (reg != RBP)
{
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)
xregs[host_reg].guest_reg = reg;
if (load) {
switch(regs[reg].size) {
if (load)
{
switch(regs[reg].size)
{
case 2:
emitter.MOV(16, R(host_reg), regs[reg].loc); break;
case 4:
@ -545,6 +590,7 @@ void DSPJitRegCache::movToHostReg(int reg, X64Reg host_reg, bool load)
break;
}
}
regs[reg].loc = R(host_reg);
if (old_reg != INVALID_REG &&
xregs[old_reg].guest_reg != DSP_REG_STATIC)
@ -562,13 +608,16 @@ void DSPJitRegCache::movToHostReg(int reg, bool load)
if (regs[reg].loc.IsSimpleReg())
return;
X64Reg tmp;
if (regs[reg].host_reg != INVALID_REG)
tmp = regs[reg].host_reg;
else
tmp = findSpillFreeXReg();
if (tmp == INVALID_REG)
return;
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);
_assert_msg_(DSPLLE, !regs[reg].used,
"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:
emitter.ROR(16, regs[reg].loc,
Imm8(shift - regs[reg].shift));
@ -599,8 +651,11 @@ void DSPJitRegCache::rotateHostReg(int reg, int shift, bool emit)
break;
#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:
emitter.ROL(16, regs[reg].loc,
Imm8(regs[reg].shift - shift));
@ -638,16 +693,23 @@ void DSPJitRegCache::movToMemory(int reg)
//but first, check for any needed rotations
if (regs[reg].loc.IsSimpleReg())
{
rotateHostReg(reg, 0, true);
else {} //todo: immediates?
}
else
{
// TODO: Immediates?
}
_assert_msg_(DSPLLE, regs[reg].shift == 0, "still shifted??");
//move to mem
OpArg tmp = M(regs[reg].mem);
if (regs[reg].dirty) {
switch(regs[reg].size) {
if (regs[reg].dirty)
{
switch(regs[reg].size)
{
case 2:
emitter.MOV(16, tmp, regs[reg].loc); break;
case 4:
@ -663,7 +725,8 @@ void DSPJitRegCache::movToMemory(int reg)
regs[reg].dirty = false;
}
if (regs[reg].loc.IsSimpleReg()) {
if (regs[reg].loc.IsSimpleReg())
{
X64Reg hostreg = regs[reg].loc.GetSimpleReg();
if (xregs[hostreg].guest_reg != DSP_REG_STATIC)
xregs[hostreg].guest_reg = DSP_REG_NONE;
@ -677,7 +740,8 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
{
int real_reg;
int shift;
if (regs[reg].parentReg != DSP_REG_NONE) {
if (regs[reg].parentReg != DSP_REG_NONE)
{
real_reg = regs[reg].parentReg;
// always load and rotate since we need the other
@ -685,7 +749,9 @@ void DSPJitRegCache::getReg(int reg, OpArg &oparg, bool load)
load = true;
shift = regs[reg].shift;
} else {
}
else
{
real_reg = reg;
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
// use the contents, but see above for a reason to force the load
movToHostReg(real_reg, load);
//todo: actually handle INVALID_REG
// TODO: actually handle INVALID_REG
_assert_msg_(DSPLLE, regs[real_reg].loc.IsSimpleReg(),
"did not get host reg for %x", reg);
rotateHostReg(real_reg, shift, load);
oparg = regs[real_reg].loc;
regs[real_reg].used = true;
//do some register specific fixup
switch(reg) {
switch(reg)
{
#ifdef _M_X64
case DSP_REG_ACC0_64:
case DSP_REG_ACC1_64:
{
if (load) {
if (load)
{
//need to do this because interpreter only does 48 bits
//(and putReg does the same)
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
@ -730,15 +800,20 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
int real_reg = reg;
if (regs[reg].parentReg != DSP_REG_NONE)
real_reg = regs[reg].parentReg;
OpArg oparg = regs[real_reg].loc;
switch(reg) {
switch(reg)
{
case DSP_REG_ACH0:
case DSP_REG_ACH1:
{
if (dirty) {
if (dirty)
{
//no need to extend to full 64bit here until interpreter
//uses that
if (oparg.IsSimpleReg()) {
if (oparg.IsSimpleReg())
{
//register is already shifted correctly
//(if at all)
@ -761,9 +836,13 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
oparg.GetSimpleReg(),
oparg);
}
} else if (oparg.IsImm()) {
//todo: immediates?
} else {
}
else if (oparg.IsImm())
{
// TODO: Immediates?
}
else
{
//this works on the memory, so use reg instead
//of real_reg, since it has the right loc
X64Reg tmp;
@ -780,7 +859,8 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
case DSP_REG_ACC0_64:
case DSP_REG_ACC1_64:
{
if (dirty) {
if (dirty)
{
emitter.SHL(64, oparg, Imm8(64-40));//sign extend
emitter.SAR(64, oparg, Imm8(64-40));
}
@ -790,8 +870,11 @@ void DSPJitRegCache::putReg(int reg, bool dirty)
default:
break;
}
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].last_use_ctr = use_ctr;
use_ctr++;
@ -802,9 +885,12 @@ void DSPJitRegCache::readReg(int sreg, X64Reg host_dreg, DSPJitSignExtend extend
{
OpArg reg;
getReg(sreg, reg);
switch(regs[sreg].size) {
switch(regs[sreg].size)
{
case 2:
switch(extend) {
switch(extend)
{
#ifdef _M_X64
case SIGN: emitter.MOVSX(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;
case 4:
#ifdef _M_X64
switch(extend) {
switch(extend)
{
case SIGN: emitter.MOVSX(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;
@ -842,7 +929,9 @@ void DSPJitRegCache::writeReg(int dreg, OpArg arg)
{
OpArg reg;
getReg(dreg, reg, false);
switch(regs[dreg].size) {
switch(regs[dreg].size)
{
case 2: emitter.MOV(16, reg, arg); break;
case 4: emitter.MOV(32, reg, arg); break;
#ifdef _M_X64
@ -870,29 +959,36 @@ X64Reg DSPJitRegCache::spillXReg()
unsigned int i;
unsigned int max_use_ctr_diff = 0;
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];
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 -
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;
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);
return least_recent_use_reg;
}
//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];
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);
return reg;
}
@ -903,12 +999,16 @@ X64Reg DSPJitRegCache::spillXReg()
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,
"to be spilled host reg %x(guest reg %x) still in use!",
reg, xregs[reg].guest_reg);
movToMemory(xregs[reg].guest_reg);
} else {
}
else
{
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_NONE,
"to be spilled host reg %x still in use!",
reg);
@ -917,9 +1017,10 @@ void DSPJitRegCache::spillXReg(X64Reg reg)
X64Reg DSPJitRegCache::findFreeXReg()
{
unsigned int i;
for(i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++) {
if (xregs[alloc_order[i]].guest_reg == DSP_REG_NONE) {
for(unsigned int i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
{
if (xregs[alloc_order[i]].guest_reg == DSP_REG_NONE)
{
return alloc_order[i];
}
}
@ -946,23 +1047,29 @@ void DSPJitRegCache::getFreeXReg(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);
return;
}
if (xregs[reg].guest_reg != DSP_REG_NONE)
spillXReg(reg);
_assert_msg_(DSPLLE, xregs[reg].guest_reg != DSP_REG_NONE, "register already in use");
xregs[reg].guest_reg = DSP_REG_USED;
}
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);
return;
}
_assert_msg_(DSPLLE, xregs[reg].guest_reg == DSP_REG_USED,
"putXReg without get(Free)XReg");
xregs[reg].guest_reg = DSP_REG_NONE;
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPJITREGCACHE_H
@ -22,7 +22,8 @@
class DSPEmitter;
enum DSPJitRegSpecial {
enum DSPJitRegSpecial
{
DSP_REG_AX0_32 =32,
DSP_REG_AX1_32 =33,
#ifdef _M_X64
@ -39,8 +40,11 @@ enum DSPJitRegSpecial {
DSP_REG_NONE =255
};
enum DSPJitSignExtend {
SIGN, ZERO, NONE
enum DSPJitSignExtend
{
SIGN,
ZERO,
NONE
};
#ifdef _M_X64
@ -49,14 +53,17 @@ enum DSPJitSignExtend {
#define NUMXREGS 8
#endif
class DSPJitRegCache {
class DSPJitRegCache
{
private:
struct X64CachedReg
{
int guest_reg; //including DSPJitRegSpecial
bool pushed;
};
struct DynamicReg {
struct DynamicReg
{
Gen::OpArg loc;
void *mem;
size_t size;
@ -67,7 +74,7 @@ private:
int shift;//current shift if parentReg == DSP_REG_NONE
//otherwise the shift this part can be found at
Gen::X64Reg host_reg;
/* todo:
/* TODO:
+ drop sameReg
+ add parentReg
+ add shift:

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "../DSPMemoryMap.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef __DSPJITUTIL_H__

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#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 (type & labels[i].type) {
if (type & labels[i].type)
{
*value = labels[i].addr;
return true;
} else {
}
else
{
printf("WARNING: Wrong label type requested. %s\n", label.c_str());
}
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _LABELMAP_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "DSPEmulator.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPEMULATOR_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DEBUGGER_SYMBOLMAP_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <stdio.h>

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// uncompress the dumps from costis GC-Debugger tool
//

View File

@ -63,7 +63,8 @@ typedef struct
unsigned short e_shtrndx;
} ELF_Header;
typedef struct {
typedef struct
{
unsigned int type;
unsigned int offset;
unsigned int vaddr;
@ -88,7 +89,8 @@ typedef struct
unsigned int entsize;
} Section_Header;
typedef struct {
typedef struct
{
unsigned int name;
unsigned int value;
unsigned int size;
@ -97,7 +99,8 @@ typedef struct {
unsigned short shndx;
} Symbol_Header;
typedef struct {
typedef struct
{
unsigned int offset;
unsigned int info;
signed int addend;

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Debugger_SymbolMap.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// M O D U L E B E G I N

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "FifoAnalyzer.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFOANALYZER_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "FifoDataFile.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFODATAFILE_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFOFILESTRUCT_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "FifoAnalyzer.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFOPLAYBACKANALYZER_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "FifoDataFile.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFOPLAYER_H_

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "FifoAnalyzer.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFORECORDANALYZER_H_

View File

@ -9,7 +9,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "ConfigManager.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _FIFORECORDER_H_

View File

@ -104,12 +104,14 @@ void SetActiveCodes(const std::vector<GeckoCode>& gcodes)
gcodes_iter = gcodes.begin(),
gcodes_end = gcodes.end();
for (; gcodes_iter!=gcodes_end; ++gcodes_iter)
{
if (gcodes_iter->enabled)
{
// TODO: apply modifiers
// TODO: don't need description or creator string, just takin up memory
active_codes.push_back(*gcodes_iter);
}
}
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;
}
@ -591,8 +594,10 @@ bool FlowControl()
current_code = target_code - 1;
}
else
{
return false; // trying to GOTO to bad address
}
}
break;
// CST4 : Gosub
@ -608,8 +613,10 @@ bool FlowControl()
current_code = target_code - 1;
}
else
{
return false; // trying to GOSUB to bad address
}
}
break;
// INVALID SUBTYPE

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _HLE_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <cmath>

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef HLE_MISC_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "StringUtil.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef HLE_OS_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
/*

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// See CPP file for comments.

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "StringUtil.h"

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include "Common.h"
@ -78,7 +78,8 @@ reswitch:
PowerPC::SingleStep();
//4: update disasm dialog
if (m_SyncEvent) {
if (m_SyncEvent)
{
m_SyncEvent->Set();
m_SyncEvent = 0;
}
@ -157,6 +158,7 @@ bool CCPU::PauseAndLock(bool doLock, bool unpauseOnUnlock)
PowerPC::Start();
m_StepEvent.Set();
}
if (!Core::IsCPUThread())
m_csCpuOccupied.unlock();
}

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _CPU_H
#define _CPU_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
// 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...
// Default to GC mode
ARAMInfo() {
ARAMInfo()
{
wii_mode = false;
size = ARAM_SIZE;
mask = ARAM_MASK;
@ -651,14 +652,18 @@ void GenerateDSPInterruptFromDSPEmu(DSPInterruptType type, bool _bSet)
}
// called whenever SystemTimers thinks the dsp deserves a few more cycles
void UpdateDSPSlice(int cycles) {
if (dsp_is_lle) {
void UpdateDSPSlice(int cycles)
{
if (dsp_is_lle)
{
//use up the rest of the slice(if any)
dsp_emulator->DSP_Update(dsp_slice);
dsp_slice %= 6;
//note the new budget
dsp_slice += cycles;
} else {
}
else
{
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);
}
else
{
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
}
g_arDMA.MMAddr += 8;
g_arDMA.ARAddr += 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));
}
else
{
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
}
g_arDMA.MMAddr += 8;
g_arDMA.ARAddr += 8;
@ -803,7 +813,9 @@ u8 ReadARAM(u32 _iAddress)
return Memory::Read_U8(_iAddress & Memory::RAM_MASK);
}
else
{
return g_ARAM.ptr[_iAddress & g_ARAM.mask];
}
}
void WriteARAM(u8 value, u32 _uAddress)

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPINTERFACE_H

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#include <iostream>
@ -31,7 +31,8 @@
#include "HW/SystemTimers.h"
#include "HW/VideoInterface.h"
DSPHLE::DSPHLE() {
DSPHLE::DSPHLE()
{
m_InitMixer = false;
soundStream = NULL;
}
@ -42,7 +43,8 @@ struct DSPState
u32 CPUMailbox;
u32 DSPMailbox;
void Reset() {
void Reset()
{
CPUMailbox = 0x00000000;
DSPMailbox = 0x00000000;
}
@ -195,7 +197,9 @@ void DSPHLE::DoState(PointerWrap &p)
if (ucode != m_pUCode)
{
if (p.GetMode() != PointerWrap::MODE_READ)
{
delete ucode;
}
else
{
delete m_pUCode;
@ -205,7 +209,9 @@ void DSPHLE::DoState(PointerWrap &p)
if (lastucode != m_lastUCode)
{
if (p.GetMode() != PointerWrap::MODE_READ)
{
delete lastucode;
}
else
{
delete m_lastUCode;

View File

@ -12,7 +12,7 @@
// A copy of the GPL 2.0 should have been included with the program.
// 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/
#ifndef _DSPHLE_H
@ -71,7 +71,8 @@ private:
u32 CPUMailbox;
u32 DSPMailbox;
void Reset() {
void Reset()
{
CPUMailbox = 0x00000000;
DSPMailbox = 0x00000000;
}

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