summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-05-03 11:15:17 +0000
committerhrydgard <hrydgard@gmail.com>2009-05-03 11:15:17 +0000
commit0772db6af6f35c700c6ff169bc94bef13d9b8cb7 (patch)
treed04f72f205695cd4f0b068894b3a3959452c82f9 /Source/Core
parent90ae2a8e55362bc06867ba8d44a39818b7aa31b9 (diff)
DSP: add a crazy little shell script that will build DSPCore into DSPSpy. make DSPCore build in gekko mode. re-add GC-pad controls to DSPSpy (now it can run inside Dolphin, kind of neat but not super useful for the obvious reasons).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3141 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/CommonFuncs.h6
-rw-r--r--Source/Core/Common/Src/Log.h10
-rw-r--r--Source/Core/Common/Src/MsgHandler.h8
-rw-r--r--Source/Core/DSPCore/Src/DSPAnalyzer.h2
-rw-r--r--Source/Core/DSPCore/Src/DSPCodeUtil.cpp6
-rw-r--r--Source/Core/DSPCore/Src/DSPCodeUtil.h2
-rw-r--r--Source/Core/DSPCore/Src/DSPCore.cpp2
-rw-r--r--Source/Core/DSPCore/Src/DSPHost.h2
-rw-r--r--Source/Core/DSPCore/Src/DSPTables.cpp4
-rw-r--r--Source/Core/DSPCore/Src/DspIntMultiplier.cpp2
-rw-r--r--Source/Core/DSPCore/Src/assemble.cpp1
-rw-r--r--Source/Core/DSPCore/Src/disassemble.cpp1
-rw-r--r--Source/Core/DSPCore/Src/gdsp_interface.cpp3
-rw-r--r--Source/Core/DSPCore/Src/gdsp_interpreter.cpp2
-rw-r--r--Source/Core/DSPCore/Src/gdsp_registers.cpp2
15 files changed, 38 insertions, 15 deletions
diff --git a/Source/Core/Common/Src/CommonFuncs.h b/Source/Core/Common/Src/CommonFuncs.h
index d71e9fe24d..4f128c4726 100644
--- a/Source/Core/Common/Src/CommonFuncs.h
+++ b/Source/Core/Common/Src/CommonFuncs.h
@@ -36,7 +36,11 @@ size_t strnlen(const char *s, size_t n);
#endif // APPLE
#include <errno.h>
// go to debugger mode
- #define Crash() {asm ("int $3");}
+ #ifdef GEKKO
+ #define Crash()
+ #else
+ #define Crash() {asm ("int $3");}
+ #endif
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
inline u32 _rotl(u32 x, int shift) {
shift &= 31;
diff --git a/Source/Core/Common/Src/Log.h b/Source/Core/Common/Src/Log.h
index a9f2833d07..e607c464c5 100644
--- a/Source/Core/Common/Src/Log.h
+++ b/Source/Core/Common/Src/Log.h
@@ -103,8 +103,13 @@ enum LOG_LEVELS {
// FIXME can we get rid of this?
#include "LogManager.h"
+#ifdef GEKKO
+#define GENERIC_LOG(t, v, ...)
+#else
+
// Let the compiler optimize this out
#define GENERIC_LOG(t, v, ...) {if (v <= MAX_LOGLEVEL) {LogManager::GetInstance()->Log(v, t, __VA_ARGS__);}}
+#endif
#if MAX_LOGLEVEL >= ERROR_LEVEL
#undef ERROR_LOG
@@ -155,6 +160,8 @@ enum LOG_LEVELS {
#endif // MAX_LOGLEVEL DEBUG
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
+
+#ifndef GEKKO
#ifdef _WIN32
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
if (!(_a_)) {\
@@ -166,5 +173,8 @@ enum LOG_LEVELS {
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
}
#endif // WIN32
+#else // GEKKO
+#define _assert_msg_(_t_, _a_, _fmt_, ...)
+#endif
#endif // _LOG_H_
diff --git a/Source/Core/Common/Src/MsgHandler.h b/Source/Core/Common/Src/MsgHandler.h
index fe9322f6ef..d128b0233c 100644
--- a/Source/Core/Common/Src/MsgHandler.h
+++ b/Source/Core/Common/Src/MsgHandler.h
@@ -31,6 +31,7 @@ void RegisterMsgAlertHandler(MsgAlertHandler handler);
extern bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...);
void SetEnableAlert(bool enable);
+#ifndef GEKKO
#ifdef _WIN32
#define SuccessAlert(format, ...) MsgAlert("Information", false, INFORMATION, format, __VA_ARGS__)
#define PanicAlert(format, ...) MsgAlert("Warning", false, WARNING, format, __VA_ARGS__)
@@ -42,5 +43,12 @@ void SetEnableAlert(bool enable);
#define PanicYesNo(format, ...) MsgAlert("Warning", true, WARNING, format, ##__VA_ARGS__)
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
#endif
+#else
+// GEKKO
+ #define SuccessAlert(format, ...) ;
+ #define PanicAlert(format, ...) ;
+ #define PanicYesNo(format, ...) ;
+ #define AskYesNo(format, ...) ;
+#endif
#endif // _MSGHANDLER_H_
diff --git a/Source/Core/DSPCore/Src/DSPAnalyzer.h b/Source/Core/DSPCore/Src/DSPAnalyzer.h
index b187eef2a7..89e1e6c980 100644
--- a/Source/Core/DSPCore/Src/DSPAnalyzer.h
+++ b/Source/Core/DSPCore/Src/DSPAnalyzer.h
@@ -48,4 +48,4 @@ extern u8 code_flags[ISPACE];
// some pretty expensive analysis if necessary.
void Analyze();
-} // namespace \ No newline at end of file
+} // namespace
diff --git a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
index a75582a5c8..2d247231e4 100644
--- a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
+++ b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
@@ -90,7 +90,7 @@ bool Compare(const std::vector<u16> &code1, const std::vector<u16> &code2)
{
printf("Extra code words:\n");
const std::vector<u16> &longest = code1.size() > code2.size() ? code1 : code2;
- for (int i = min_size; i < longest.size(); i++)
+ for (int i = min_size; i < (int)longest.size(); i++)
{
u16 pc = i;
std::string line;
@@ -140,7 +140,7 @@ void CodeToHeader(const std::vector<u16> &code, const char *name, std::string &h
void CodeToBinaryStringBE(const std::vector<u16> &code, std::string &str)
{
str.resize(code.size() * 2);
- for (int i = 0; i < code.size(); i++)
+ for (int i = 0; i < (int)code.size(); i++)
{
str[i * 2 + 0] = code[i] >> 8;
str[i * 2 + 1] = code[i] & 0xff;
@@ -150,7 +150,7 @@ void CodeToBinaryStringBE(const std::vector<u16> &code, std::string &str)
void BinaryStringBEToCode(const std::string &str, std::vector<u16> &code)
{
code.resize(str.size() / 2);
- for (int i = 0; i < code.size(); i++)
+ for (int i = 0; i < (int)code.size(); i++)
{
code[i] = ((u16)(u8)str[i * 2 + 0] << 8) | ((u16)(u8)str[i * 2 + 1]);
}
diff --git a/Source/Core/DSPCore/Src/DSPCodeUtil.h b/Source/Core/DSPCore/Src/DSPCodeUtil.h
index 5e4d32568c..86477051bc 100644
--- a/Source/Core/DSPCore/Src/DSPCodeUtil.h
+++ b/Source/Core/DSPCore/Src/DSPCodeUtil.h
@@ -37,4 +37,4 @@ void BinaryStringBEToCode(const std::string &str, std::vector<u16> &code);
bool LoadBinary(const char *filename, std::vector<u16> &code);
bool SaveBinary(const std::vector<u16> &code, const char *filename);
-#endif // _DSPCODEUTIL_H \ No newline at end of file
+#endif // _DSPCODEUTIL_H
diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp
index 270952f8ed..ac684f5e9a 100644
--- a/Source/Core/DSPCore/Src/DSPCore.cpp
+++ b/Source/Core/DSPCore/Src/DSPCore.cpp
@@ -202,4 +202,4 @@ void gdsp_check_exceptions()
}
}
-//} // namespace \ No newline at end of file
+//} // namespace
diff --git a/Source/Core/DSPCore/Src/DSPHost.h b/Source/Core/DSPCore/Src/DSPHost.h
index 294af23c1e..7a96fd1ff3 100644
--- a/Source/Core/DSPCore/Src/DSPHost.h
+++ b/Source/Core/DSPCore/Src/DSPHost.h
@@ -28,4 +28,4 @@ bool DSPHost_OnThread();
bool DSPHost_Running();
u32 DSPHost_CodeLoaded(const u8 *ptr, int size);
-#endif \ No newline at end of file
+#endif
diff --git a/Source/Core/DSPCore/Src/DSPTables.cpp b/Source/Core/DSPCore/Src/DSPTables.cpp
index 0eab6484ed..f1afb2074c 100644
--- a/Source/Core/DSPCore/Src/DSPTables.cpp
+++ b/Source/Core/DSPCore/Src/DSPTables.cpp
@@ -473,7 +473,7 @@ const char *pdregnamelong(int val)
const DSPOPCTemplate *GetOpTemplate(const UDSPInstruction &inst)
{
- for (u32 i = 0; i < opcodes_size; i++)
+ for (int i = 0; i < opcodes_size; i++)
{
u16 mask = opcodes[i].opcode_mask;
if (opcodes[i].size & P_EXT) {
@@ -501,7 +501,7 @@ void InitInstructionTable()
for (int i = 0; i < OPTABLE_SIZE; i++)
{
- for (u32 j = 0; j < opcodes_size; j++)
+ for (int j = 0; j < opcodes_size; j++)
{
u16 mask = opcodes[j].opcode_mask;
if (opcodes[j].size & P_EXT) {
diff --git a/Source/Core/DSPCore/Src/DspIntMultiplier.cpp b/Source/Core/DSPCore/Src/DspIntMultiplier.cpp
index 54d9c69088..6a9cb47f30 100644
--- a/Source/Core/DSPCore/Src/DspIntMultiplier.cpp
+++ b/Source/Core/DSPCore/Src/DspIntMultiplier.cpp
@@ -148,7 +148,7 @@ void addpaxz(const UDSPInstruction& opc)
u8 dreg = (opc.hex >> 8) & 0x1;
u8 sreg = (opc.hex >> 9) & 0x1;
- s64 prod = dsp_get_long_prod() & ~0x0ffff;
+ s64 prod = dsp_get_long_prod() & ~0xffff; // hm, should we really mask here?
s64 ax = dsp_get_long_acx(sreg);
s64 acc = (prod + ax) & ~0xffff;
diff --git a/Source/Core/DSPCore/Src/assemble.cpp b/Source/Core/DSPCore/Src/assemble.cpp
index 45c63c12d7..8032a6e46a 100644
--- a/Source/Core/DSPCore/Src/assemble.cpp
+++ b/Source/Core/DSPCore/Src/assemble.cpp
@@ -38,7 +38,6 @@ Initial import
====================================================================*/
#include <cstdio>
-#include <memory.h>
#include <cstdlib>
#include <map>
diff --git a/Source/Core/DSPCore/Src/disassemble.cpp b/Source/Core/DSPCore/Src/disassemble.cpp
index d15e45d2bb..dc3841745c 100644
--- a/Source/Core/DSPCore/Src/disassemble.cpp
+++ b/Source/Core/DSPCore/Src/disassemble.cpp
@@ -23,7 +23,6 @@
====================================================================*/
-#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/Source/Core/DSPCore/Src/gdsp_interface.cpp b/Source/Core/DSPCore/Src/gdsp_interface.cpp
index 84125c939f..8b6f4a65a4 100644
--- a/Source/Core/DSPCore/Src/gdsp_interface.cpp
+++ b/Source/Core/DSPCore/Src/gdsp_interface.cpp
@@ -138,6 +138,9 @@ void gdsp_ifx_write(u16 addr, u16 val)
gdsp_ifx_regs[DSP_DSCR] &= ~0x0004;
break;
+ case 0xde:
+ //if (val)
+ // PanicAlert("Gain written: %04x", val); // BMX XXX does, and sounds HORRIBLE.
case 0xcd:
case 0xce:
case 0xcf:
diff --git a/Source/Core/DSPCore/Src/gdsp_interpreter.cpp b/Source/Core/DSPCore/Src/gdsp_interpreter.cpp
index 883e6e8881..757ddf9aac 100644
--- a/Source/Core/DSPCore/Src/gdsp_interpreter.cpp
+++ b/Source/Core/DSPCore/Src/gdsp_interpreter.cpp
@@ -185,4 +185,4 @@ void Stop()
gdsp_running = false;
}
-} // namespace \ No newline at end of file
+} // namespace
diff --git a/Source/Core/DSPCore/Src/gdsp_registers.cpp b/Source/Core/DSPCore/Src/gdsp_registers.cpp
index ed6cef1685..091e5e0ca9 100644
--- a/Source/Core/DSPCore/Src/gdsp_registers.cpp
+++ b/Source/Core/DSPCore/Src/gdsp_registers.cpp
@@ -57,4 +57,4 @@ u16 dsp_reg_load_stack(u8 stack_reg)
u16 val = g_dsp.r[DSP_REG_ST0 + stack_reg];
dsp_reg_stack_pop(stack_reg);
return val;
-} \ No newline at end of file
+}