DSP: some clean up feel free to revert if you want those files
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2916 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5a9fcaea62
commit
d2b11faa05
|
@ -1,4 +1,3 @@
|
|||
// April Fools!
|
||||
// Copyright (C) 2003-2009 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
@ -16,8 +15,8 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _PLUGIN_DSP_HLE_CONFIG_H
|
||||
#define _PLUGIN_DSP_HLE_CONFIG_H
|
||||
#ifndef _PLUGIN_DSP_LLE_CONFIG_H
|
||||
#define _PLUGIN_DSP_LLE_CONFIG_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -31,5 +30,5 @@ struct CConfig
|
|||
|
||||
extern CConfig g_Config;
|
||||
|
||||
#endif // _PLUGIN_DSP_HLE_CONFIG_H
|
||||
#endif // _PLUGIN_DSP_LLE_CONFIG_H
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,38 +0,0 @@
|
|||
// Copyright (C) 2003-2009 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/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "stdafx.h"
|
||||
#endif
|
||||
|
||||
#include "Globals.h"
|
||||
#include "gdsp_interpreter.h"
|
||||
#include "gdsp_memory.h"
|
||||
#include "gdsp_opcodes_helper.h"
|
||||
|
||||
|
||||
bool WriteDMEM(u16 addr, u16 val)
|
||||
{
|
||||
dsp_dmem_write(addr, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
u16 ReadDMEM(u16 addr)
|
||||
{
|
||||
return dsp_dmem_read(addr);
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
// Copyright (C) 2003-2009 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(u16 addr, u16 val);
|
||||
u16 ReadDMEM(u16 addr);
|
||||
|
||||
template<unsigned N>
|
||||
class TAccumulator
|
||||
{
|
||||
public:
|
||||
|
||||
TAccumulator()
|
||||
{
|
||||
_assert_(N < 2);
|
||||
}
|
||||
|
||||
void operator=(s64 val)
|
||||
{
|
||||
setValue(val);
|
||||
}
|
||||
|
||||
void operator<<=(s64 value)
|
||||
{
|
||||
s64 acc = getValue();
|
||||
acc <<= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator>>=(s64 value)
|
||||
{
|
||||
s64 acc = getValue();
|
||||
acc >>= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator+=(s64 value)
|
||||
{
|
||||
s64 acc = getValue();
|
||||
acc += value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
operator s64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
operator u64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
inline void setValue(s64 val)
|
||||
{
|
||||
g_dsp.r[0x1c + N] = (u16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + N] = (u16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + N] = (u16)val;
|
||||
}
|
||||
|
||||
inline s64 getValue()
|
||||
{
|
||||
s64 val;
|
||||
s64 low_acc;
|
||||
val = (s8)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=(s64 val)
|
||||
{
|
||||
g_dsp.r[0x14] = (u16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (u16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (u16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
operator s64()
|
||||
{
|
||||
s64 val;
|
||||
s64 low_prod;
|
||||
val = (s8)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
|
|
@ -22,8 +22,6 @@ files = [
|
|||
"gdsp_memory.cpp",
|
||||
"gdsp_registers.cpp",
|
||||
"Globals.cpp",
|
||||
"HLE_Functions.cpp",
|
||||
"HLE_Helper.cpp",
|
||||
"DSPInterpreter.cpp",
|
||||
"DSPJit.cpp",
|
||||
"DSPTables.cpp",
|
||||
|
|
|
@ -222,20 +222,10 @@ void gdsp_loop_step()
|
|||
ComputeInstruction(UDSPInstruction(opc));
|
||||
}
|
||||
|
||||
u16 HLE_ROM_80E7_81F8();
|
||||
void hacks();
|
||||
|
||||
|
||||
|
||||
void gdsp_step()
|
||||
{
|
||||
g_dsp.step_counter++;
|
||||
|
||||
if (g_dsp.pc == 0x80e7)
|
||||
{
|
||||
//g_dsp.pc = HLE_ROM_80E7_81F8();
|
||||
}
|
||||
|
||||
g_dsp.err_pc = g_dsp.pc;
|
||||
|
||||
#if PROFILE
|
||||
|
@ -331,118 +321,8 @@ bool gdsp_run()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool gdsp_runx(u16 cnt)
|
||||
{
|
||||
gdsp_running = true;
|
||||
|
||||
while (!(g_dsp.cr & 0x4) && gdsp_running)
|
||||
{
|
||||
gdsp_step();
|
||||
cnt--;
|
||||
|
||||
if (cnt == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gdsp_running = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void gdsp_stop()
|
||||
{
|
||||
gdsp_running = false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// From fires for fires :)
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#include "disassemble.h"
|
||||
//#include "WaveFile.h"
|
||||
#include "Mixer.h"
|
||||
|
||||
// u16 r30 = 0, r31 = 0;
|
||||
//extern WaveFileWriter g_wave_writer;
|
||||
|
||||
extern u16 dsp_swap16(u16 x);
|
||||
void Hacks()
|
||||
{
|
||||
// if (g_wave_writer.GetAudioSize() > 1024*1024*1)
|
||||
|
||||
/* if (g_dsp.pc == 0x165)
|
||||
{
|
||||
PanicAlert("Opcode_06");
|
||||
|
||||
}
|
||||
if (g_dsp.pc == 0x43b)
|
||||
{
|
||||
PanicAlert("Opcode_14");
|
||||
|
||||
}
|
||||
if (g_dsp.pc == 0xb37)
|
||||
{
|
||||
PanicAlert("Opcode_08");
|
||||
|
||||
}*/
|
||||
/* if (g_dsp.pc == 0x1bc)
|
||||
{
|
||||
r30 = g_dsp.r[30];
|
||||
r31 = g_dsp.r[31];
|
||||
}
|
||||
else if (g_dsp.pc == 0x384)
|
||||
{
|
||||
// if ((r30 == 0x1bc) && (r31 == 0xaff))
|
||||
{
|
||||
//PanicAlert("%x, %x", r30, r31);
|
||||
|
||||
const int numSamples = 0x280;
|
||||
static short Buffer[numSamples];
|
||||
|
||||
u16 bufferAddr = 0x280; //dsp_dmem_read(0xe44);
|
||||
for (int i=0; i<numSamples; i++)
|
||||
{
|
||||
Buffer[i] = dsp_dmem_read(bufferAddr+i);
|
||||
}
|
||||
|
||||
g_wave_writer.AddStereoSamples(Buffer, numSamples/2); // 2 channels
|
||||
|
||||
if (g_wave_writer.GetAudioSize() > 1024*1024*2)
|
||||
{
|
||||
//PanicAlert("%x", bufferAddr);
|
||||
g_wave_writer.Stop();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
if (g_dsp.pc == 0x468)
|
||||
{
|
||||
int numSamples = g_dsp.r[25] / 2;
|
||||
u16 bufferAddr = g_dsp.r[27];
|
||||
|
||||
// PanicAlert("%x %x", bufferAddr, numSamples);
|
||||
|
||||
short samples[1024];
|
||||
for (int i=0; i<numSamples; i++)
|
||||
{
|
||||
samples[i] = dsp_dmem_read(bufferAddr+i);
|
||||
}
|
||||
soundStream->GetMixer()->PushSamples(samples, numSamples / 2, 32000); //sample_rate);
|
||||
|
||||
// g_wave_writer.AddStereoSamples(samples, numSamples/2); // 2 channels
|
||||
|
||||
// if (g_wave_writer.GetAudioSize() > 1024*1024*2)
|
||||
// {
|
||||
//PanicAlert("%x", bufferAddr);
|
||||
// g_wave_writer.Stop();
|
||||
// exit(1);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue