small improvements of the LLE plugin
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@840 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ba88ebaecb
commit
3763b365d1
|
@ -26,7 +26,7 @@ void Decode(uint16 startAddress, uint16 endAddress)
|
|||
uint16 oldPC = g_currentAddress;
|
||||
uint16 op = FetchOpcode();
|
||||
|
||||
OutBuffer::Add("l_%4X:", oldPC);
|
||||
OutBuffer::Add("// l_%4X:", oldPC);
|
||||
DecodeOpcode(op);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -754,6 +754,14 @@
|
|||
RelativePath=".\Src\HLE_Functions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HLE_Helper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HLE_Helper.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\Src\DSoundStream.cpp"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,35 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// 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
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "globals.h"
|
||||
#include "gdsp_interpreter.h"
|
||||
#include "gdsp_memory.h"
|
||||
#include "gdsp_opcodes_helper.h"
|
||||
|
||||
|
||||
bool WriteDMEM(uint16 addr, uint16 val)
|
||||
{
|
||||
return dsp_dmem_write(addr, val);
|
||||
}
|
||||
|
||||
uint16 ReadDMEM(uint16 addr)
|
||||
{
|
||||
return dsp_dmem_read(addr);
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// 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
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef HLE_HELPER_H
|
||||
#define HLE_HELPER_H
|
||||
|
||||
#include "gdsp_interpreter.h"
|
||||
|
||||
bool WriteDMEM(uint16 addr, uint16 val);
|
||||
uint16 ReadDMEM(uint16 addr);
|
||||
void Update_SR_Register(sint64 _Value);
|
||||
sint8 GetMultiplyModifier();
|
||||
|
||||
template<unsigned N>
|
||||
class TAccumulator
|
||||
{
|
||||
public:
|
||||
|
||||
TAccumulator()
|
||||
{
|
||||
_dbg_assert_(N < 2);
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
setValue(val);
|
||||
}
|
||||
|
||||
void operator<<=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc <<= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator>>=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc >>= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator+=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc += value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
operator uint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
inline void setValue(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x1c + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + N] = (uint16)val;
|
||||
}
|
||||
|
||||
inline sint64 getValue()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_acc;
|
||||
val = (sint8)g_dsp.r[0x10 + N];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + N];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + N];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
class CProd
|
||||
{
|
||||
public:
|
||||
CProd()
|
||||
{
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x14] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (uint16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_prod;
|
||||
val = (sint8)g_dsp.r[0x16];
|
||||
val <<= 32;
|
||||
low_prod = g_dsp.r[0x15];
|
||||
low_prod += g_dsp.r[0x17];
|
||||
low_prod <<= 16;
|
||||
low_prod |= g_dsp.r[0x14];
|
||||
val += low_prod;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue