mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-26 20:25:58 +00:00
revert to r4531, but keep the changes from the following revisions: 4533,4550-4551,4556-4559
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4566 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
18305c7c49
commit
06aa62504c
66 changed files with 2170 additions and 1570 deletions
|
@ -201,23 +201,3 @@ std::string CPUInfo::Summarize()
|
|||
if (bLongMode) sum += ", 64-bit support";
|
||||
return sum;
|
||||
}
|
||||
|
||||
// Turn the cpu info into a string we can show(This version uses headings and line breaks)
|
||||
std::string CPUInfo::Summarize_long()
|
||||
{
|
||||
std::string sum;
|
||||
sum = StringFromFormat("CPU Brand: %s\n",cpu_string);
|
||||
|
||||
sum += StringFromFormat("Number of cores: %i \n ",num_cores);
|
||||
|
||||
sum+= "Supported instruction sets:\n";
|
||||
|
||||
if (bSSE) sum += " -SSE\n";
|
||||
if (bSSE2) sum += " -SSE2\n";
|
||||
if (bSSE3) sum += " -SSE3\n";
|
||||
if (bSSSE3) sum += " -SSSE3\n";
|
||||
if (bSSE4_1) sum += " -SSE4.1\n";
|
||||
if (bSSE4_2) sum += " -SSE4.2\n";
|
||||
if (bLongMode) sum += "64-bit supported";
|
||||
return sum;
|
||||
}
|
|
@ -58,9 +58,6 @@ struct CPUInfo
|
|||
|
||||
// Turn the cpu info into a string we can show
|
||||
std::string Summarize();
|
||||
|
||||
// Turn the cpu info into a string we can show(This version uses headings and line breaks)
|
||||
std::string Summarize_long();
|
||||
};
|
||||
|
||||
extern CPUInfo cpu_info;
|
||||
|
|
|
@ -251,14 +251,6 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool
|
|||
#endif
|
||||
}
|
||||
|
||||
void ConsoleListener::CustomLog(const char *Text)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
DWORD cCharsWritten;
|
||||
WriteConsole(hConsole, Text, (DWORD)strlen(Text), &cCharsWritten, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
|
|
|
@ -83,7 +83,6 @@ public:
|
|||
#ifdef _WIN32
|
||||
COORD GetCoordinates(int BytesRead, int BufferWidth);
|
||||
#endif
|
||||
void CustomLog(const char *Text);
|
||||
void Log(LogTypes::LOG_LEVELS, const char *Text);
|
||||
void ClearScreen(bool Cursor = true);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ enum
|
|||
ZCODE_END = 0x00,
|
||||
ZCODE_NORM = 0x02,
|
||||
ZCODE_ROW = 0x03,
|
||||
ZCODE_04 = 0x04,
|
||||
ZCODE_MEM_COPY = 0x04,
|
||||
|
||||
// Conditonal Codes
|
||||
CONDTIONAL_IF_EQUAL = 0x01,
|
||||
|
@ -227,17 +227,16 @@ void LogInfo(const char *format, ...)
|
|||
|
||||
void RunAllActive()
|
||||
{
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats)
|
||||
{
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) {
|
||||
for (std::vector<ARCode>::iterator i = activeCodes.begin(); i != activeCodes.end(); ++i)
|
||||
{
|
||||
if (i->active)
|
||||
{
|
||||
i->active = RunCode(*i);
|
||||
if (!RunCode(*i))
|
||||
i->active = false;
|
||||
LogInfo("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!b_RanOnce)
|
||||
b_RanOnce = true;
|
||||
}
|
||||
|
@ -293,18 +292,16 @@ bool RunCode(const ARCode &arcode) {
|
|||
LogInfo("Command: %08x", cmd);
|
||||
|
||||
// Do Fill & Slide
|
||||
if (doFillNSlide)
|
||||
{
|
||||
if (doFillNSlide) {
|
||||
doFillNSlide = false;
|
||||
LogInfo("Doing Fill And Slide");
|
||||
if (!ZeroCode_FillAndSlide(val_last, addr, data))
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Memory Copy
|
||||
if (doMemoryCopy)
|
||||
{
|
||||
if (doMemoryCopy) {
|
||||
doMemoryCopy = false;
|
||||
LogInfo("Doing Memory Copy");
|
||||
if (!ZeroCode_MemoryCopy(val_last, addr, data))
|
||||
|
@ -313,8 +310,7 @@ bool RunCode(const ARCode &arcode) {
|
|||
}
|
||||
|
||||
// ActionReplay program self modification codes
|
||||
if (addr >= 0x00002000 && addr < 0x00003000)
|
||||
{
|
||||
if (addr >= 0x00002000 && addr < 0x00003000) {
|
||||
LogInfo("This action replay simulator does not support codes that modify Action Replay itself.");
|
||||
PanicAlert("This action replay simulator does not support codes that modify Action Replay itself.");
|
||||
return false;
|
||||
|
@ -343,7 +339,7 @@ bool RunCode(const ARCode &arcode) {
|
|||
LogInfo("ZCode: Executes all codes in the same row, Set register 1BB4 to 1 (zcode not supported)");
|
||||
PanicAlert("Zero 3 code not supported");
|
||||
return false;
|
||||
case ZCODE_04: // Fill & Slide or Memory Copy
|
||||
case ZCODE_MEM_COPY: // Fill & Slide or Memory Copy
|
||||
if (((addr >> 25) & 0x03) == 0x3)
|
||||
{
|
||||
LogInfo("ZCode: Memory Copy");
|
||||
|
@ -558,7 +554,7 @@ bool Subtype_WriteToPointer(u32 addr, u32 data)
|
|||
bool Subtype_AddCode(u32 addr, u32 data)
|
||||
{
|
||||
// Used to incrment a value in memory
|
||||
u32 new_addr = (addr & 0x81FFFFFF);
|
||||
u32 new_addr = (addr & 0x01FFFFFF) | 0x80000000;
|
||||
u8 size = (addr >> 25) & 0x03;
|
||||
LogInfo("Hardware Address: %08x", new_addr);
|
||||
LogInfo("Size: %08x", size);
|
||||
|
@ -589,15 +585,12 @@ bool Subtype_AddCode(u32 addr, u32 data)
|
|||
{
|
||||
LogInfo("32-bit floating Add");
|
||||
LogInfo("--------");
|
||||
|
||||
u32 read = Memory::Read_U32(new_addr);
|
||||
float fread = *((float*)&read);
|
||||
fread += (float)data;
|
||||
u32 newval = *((u32*)&fread);
|
||||
Memory::Write_U32(newval, new_addr);
|
||||
LogInfo("Old Value %08x", read);
|
||||
LogInfo("Increment %08x", data);
|
||||
LogInfo("New value %08x", newval);
|
||||
union conv {float x; u32 y;};
|
||||
conv c1;
|
||||
c1.y = Memory::Read_U32(new_addr);
|
||||
c1.x += (float)data;
|
||||
Memory::Write_U32((u32)c1.x, new_addr);
|
||||
LogInfo("Wrote %08x to address %08x", (u32)c1.x, new_addr);
|
||||
LogInfo("--------");
|
||||
break;
|
||||
}
|
||||
|
@ -622,7 +615,7 @@ bool Subtype_MasterCodeAndWriteToCCXXXXXX(u32 addr, u32 data)
|
|||
|
||||
bool ZeroCode_FillAndSlide(u32 val_last, u32 addr, u32 data) // This needs more testing
|
||||
{
|
||||
u32 new_addr = (val_last & 0x81FFFFFF);
|
||||
u32 new_addr = (val_last & 0x01FFFFFF) | 0x80000000;
|
||||
u8 size = (val_last >> 25) & 0x03;
|
||||
s16 addr_incr = (s16)(data & 0xFFFF);
|
||||
s8 val_incr = (s8)((data & 0xFF000000) >> 24);
|
||||
|
|
|
@ -235,7 +235,8 @@ void PatchEngineCallback(u64 userdata, int cyclesLate)
|
|||
// Patch mem and run the Action Replay
|
||||
PatchEngine::ApplyFramePatches();
|
||||
PatchEngine::ApplyARPatches();
|
||||
CoreTiming::ScheduleEvent((CPU_CORE_CLOCK / 5000) - cyclesLate, et_PatchEngine);
|
||||
|
||||
CoreTiming::ScheduleEvent((GetTicksPerSecond() / 60) - cyclesLate, et_PatchEngine);
|
||||
}
|
||||
|
||||
void Init()
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
// Supports simple memory patches, and has a partial Action Replay implementation
|
||||
// in ActionReplay.cpp/h.
|
||||
|
||||
// TODO: Still even needed? Zelda WW now works with improved DSP code.
|
||||
// Zelda item hang fixes:
|
||||
// [Tue Aug 21 2007] [18:30:40] <Knuckles-> 0x802904b4 in US released
|
||||
// [Tue Aug 21 2007] [18:30:53] <Knuckles-> 0x80294d54 in EUR Demo version
|
||||
|
|
|
@ -76,11 +76,12 @@ CPluginManager::~CPluginManager()
|
|||
|
||||
for (int i = 0; i < MAXPADS; i++)
|
||||
{
|
||||
if (m_pad[i] && (OkayToInitPlugin(i) == -1) && !m_params->m_strPadPlugin[i].empty())
|
||||
if (m_pad[i] && (OkayToInitPlugin(i) == -1))
|
||||
{
|
||||
INFO_LOG(CONSOLE, "Delete: %i\n", i);
|
||||
FreePad(i);
|
||||
delete m_pad[i];
|
||||
}
|
||||
m_pad[i] = NULL;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAXWIIMOTES; i++)
|
||||
|
@ -164,7 +165,7 @@ void CPluginManager::ShutdownPlugins()
|
|||
if (m_pad[i])
|
||||
{
|
||||
m_pad[i]->Shutdown();
|
||||
//delete m_pad[i]; Causes crash on stop
|
||||
//delete m_pad[i];
|
||||
}
|
||||
//m_pad[i] = NULL;
|
||||
}
|
||||
|
@ -301,7 +302,7 @@ void *CPluginManager::LoadPlugin(const char *_rFilename, int Number)
|
|||
PanicAlert("Can't open %s, it has a missing function", _rFilename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Call the DLL function SetGlobals
|
||||
plugin->SetGlobals(m_PluginGlobals);
|
||||
return plugin;
|
||||
|
|
|
@ -103,14 +103,11 @@ void dsp_write_aram_d3(u16 value)
|
|||
case 0xA: // 16-bit writes
|
||||
DSPHost_WriteHostMemory(value >> 8, Address);
|
||||
DSPHost_WriteHostMemory(value & 0xFF, Address + 1);
|
||||
Address += 2;
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(DSPLLE, "dsp_write_aram_d3: Unseen Format %i", gdsp_ifx_regs[DSP_FORMAT]);
|
||||
break;
|
||||
}
|
||||
gdsp_ifx_regs[DSP_ACCAH] = Address >> 16;
|
||||
gdsp_ifx_regs[DSP_ACCAL] = Address & 0xffff;
|
||||
}
|
||||
|
||||
u16 dsp_read_accelerator()
|
||||
|
@ -156,10 +153,9 @@ u16 dsp_read_accelerator()
|
|||
// Set address back to start address.
|
||||
Address = (gdsp_ifx_regs[DSP_ACSAH] << 16) | gdsp_ifx_regs[DSP_ACSAL];
|
||||
|
||||
// Do we really need both? (nakee: seems to cause problems with some
|
||||
// AX games)
|
||||
// DSPHost_InterruptRequest();
|
||||
// DSPCore_SetException(EXP_2);
|
||||
// Do we really need both?
|
||||
DSPHost_InterruptRequest();
|
||||
DSPCore_SetException(EXP_2);
|
||||
DSPCore_SetException(EXP_ACCOV);
|
||||
|
||||
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
|
||||
|
|
|
@ -161,7 +161,7 @@ void gdsp_ifx_write(u16 addr, u16 val)
|
|||
break;
|
||||
|
||||
case 0xd3: // ZeldaUnk (accelerator WRITE)
|
||||
// NOTICE_LOG(DSPLLE, "Write To ZeldaUnk pc=%04x (%04x)", g_dsp.pc, val);
|
||||
NOTICE_LOG(DSPLLE, "Write To ZeldaUnk pc=%04x (%04x)", g_dsp.pc, val);
|
||||
dsp_write_aram_d3(val);
|
||||
break;
|
||||
|
||||
|
@ -215,7 +215,7 @@ u16 gdsp_ifx_read(u16 addr)
|
|||
return dsp_read_accelerator();
|
||||
|
||||
case 0xd3:
|
||||
//NOTICE_LOG(DSPLLE, "Read from ZeldaUnk pc=%04x", g_dsp.pc);
|
||||
NOTICE_LOG(DSPLLE, "Read from ZeldaUnk pc=%04x", g_dsp.pc);
|
||||
return dsp_read_aram_d3();
|
||||
|
||||
default:
|
||||
|
@ -316,7 +316,7 @@ void gdsp_do_dma()
|
|||
exit(0);
|
||||
}
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
DEBUG_LOG(DSPLLE, "DMA pc: %04x ctl: %04x addr: %08x da: %04x size: %04x", g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
NOTICE_LOG(DSPLLE, "DMA pc: %04x ctl: %04x addr: %08x da: %04x size: %04x", g_dsp.pc, ctl, addr, dsp_addr, len);
|
||||
#endif
|
||||
switch (ctl & 0x3)
|
||||
{
|
||||
|
|
|
@ -42,8 +42,6 @@ const DSPOPCTemplate opcodes[] =
|
|||
{"DAR", 0x0004, 0xfffc, DSPInterpreter::dar, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false},
|
||||
{"IAR", 0x0008, 0xfffc, DSPInterpreter::iar, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false},
|
||||
|
||||
{"ADDARN", 0x0010, 0xfff0, DSPInterpreter::addarn, nop, 1, 2, {{P_REG, 1, 0, 0, 0x0003}, {P_REG04, 1, 0, 2, 0x000c}}, false},
|
||||
|
||||
{"HALT", 0x0021, 0xffff, DSPInterpreter::halt, nop, 1, 0, {}, false},
|
||||
|
||||
{"RETGE", 0x02d0, 0xffff, DSPInterpreter::ret, nop, 1, 0, {}, false},
|
||||
|
@ -126,9 +124,10 @@ const DSPOPCTemplate opcodes[] =
|
|||
{"LSR", 0x1440, 0xfec0, DSPInterpreter::lsr, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, false},
|
||||
{"ASL", 0x1480, 0xfec0, DSPInterpreter::asl, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, false},
|
||||
{"ASR", 0x14c0, 0xfec0, DSPInterpreter::asr, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, false},
|
||||
|
||||
{"LSRN", 0x02ca, 0xffff, DSPInterpreter::lsrn, nop, 1, 0, {}, false}, // discovered by ector!
|
||||
{"ASRN", 0x02cb, 0xffff, DSPInterpreter::asrn, nop, 1, 0, {}, false}, // discovered by ector!
|
||||
|
||||
// discovered by ector!
|
||||
{"LSRN", 0x02ca, 0xffff, DSPInterpreter::lsrn, nop, 1, 0, {}, false},
|
||||
{"ASRN", 0x02cb, 0xffff, DSPInterpreter::asrn, nop, 1, 0, {}, false},
|
||||
|
||||
{"LRI", 0x0080, 0xffe0, DSPInterpreter::lri, nop, 2, 2, {{P_REG, 1, 0, 0, 0x001f}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"LR", 0x00c0, 0xffe0, DSPInterpreter::lr, nop, 2, 2, {{P_REG, 1, 0, 0, 0x001f}, {P_MEM, 2, 1, 0, 0xffff}}, false},
|
||||
|
@ -138,20 +137,25 @@ const DSPOPCTemplate opcodes[] =
|
|||
|
||||
{"SI", 0x1600, 0xff00, DSPInterpreter::si, nop, 2, 2, {{P_MEM, 1, 0, 0, 0x00ff}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
{"ADDIS", 0x0400, 0xfe00, DSPInterpreter::addis, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"CMPIS", 0x0600, 0xfe00, DSPInterpreter::cmpis, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"LRS", 0x2000, 0xf800, DSPInterpreter::lrs, nop, 1, 2, {{P_REG18, 1, 0, 8, 0x0700}, {P_MEM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"SRS", 0x2800, 0xf800, DSPInterpreter::srs, nop, 1, 2, {{P_MEM, 1, 0, 0, 0x00ff}, {P_REG18, 1, 0, 8, 0x0700}}, false},
|
||||
|
||||
{"LRIS", 0x0800, 0xf800, DSPInterpreter::lris, nop, 1, 2, {{P_REG18, 1, 0, 8, 0x0700}, {P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
|
||||
{"ADDI", 0x0200, 0xfeff, DSPInterpreter::addi, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false}, // F|RES: missing S64
|
||||
{"XORI", 0x0220, 0xfeff, DSPInterpreter::xori, nop, 2, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"ADDIS", 0x0400, 0xfe00, DSPInterpreter::addis, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"CMPIS", 0x0600, 0xfe00, DSPInterpreter::cmpis, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"ANDI", 0x0240, 0xfeff, DSPInterpreter::andi, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"ORI", 0x0260, 0xfeff, DSPInterpreter::ori, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"CMPI", 0x0280, 0xfeff, DSPInterpreter::cmpi, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
{"ANDF", 0x02a0, 0xfeff, DSPInterpreter::andf, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"ANDCF", 0x02c0, 0xfeff, DSPInterpreter::andcf, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
{"XORI", 0x0220, 0xfeff, DSPInterpreter::xori, nop, 2, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"ANDF", 0x02a0, 0xfeff, DSPInterpreter::andf, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
{"ORI", 0x0260, 0xfeff, DSPInterpreter::ori, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
{"ORF", 0x02e0, 0xfeff, DSPInterpreter::orf, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false}, // Hermes: ??? (has it commented out)
|
||||
|
||||
{"ADDI", 0x0200, 0xfeff, DSPInterpreter::addi, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false}, // F|RES: missing S64
|
||||
{"CMPI", 0x0280, 0xfeff, DSPInterpreter::cmpi, nop, 2, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
{"ILRR", 0x0210, 0xfefc, DSPInterpreter::ilrr, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_PRG, 1, 0, 0, 0x0003}}, false},
|
||||
{"ILRRD", 0x0214, 0xfefc, DSPInterpreter::ilrrd, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_PRG, 1, 0, 0, 0x0003}}, false}, // Hermes doesn't list this
|
||||
{"ILRRI", 0x0218, 0xfefc, DSPInterpreter::ilrri, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_PRG, 1, 0, 0, 0x0003}}, false},
|
||||
|
@ -174,10 +178,8 @@ const DSPOPCTemplate opcodes[] =
|
|||
{"LOOPI", 0x1000, 0xff00, DSPInterpreter::loopi, nop, 1, 1, {{P_IMM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"BLOOPI", 0x1100, 0xff00, DSPInterpreter::bloopi, nop, 2, 2, {{P_IMM, 1, 0, 0, 0x00ff}, {P_ADDR_I, 2, 1, 0, 0xffff}}, false},
|
||||
|
||||
//2
|
||||
{"LRS", 0x2000, 0xf800, DSPInterpreter::lrs, nop, 1, 2, {{P_REG18, 1, 0, 8, 0x0700}, {P_MEM, 1, 0, 0, 0x00ff}}, false},
|
||||
{"SRS", 0x2800, 0xf800, DSPInterpreter::srs, nop, 1, 2, {{P_MEM, 1, 0, 0, 0x00ff}, {P_REG18, 1, 0, 8, 0x0700}}, false},
|
||||
|
||||
{"ADDARN", 0x0010, 0xfff0, DSPInterpreter::addarn, nop, 1, 2, {{P_REG, 1, 0, 0, 0x0003}, {P_REG04, 1, 0, 2, 0x000c}}, false},
|
||||
|
||||
// opcodes that can be extended
|
||||
// extended opcodes, note size of opcode will be set to 0
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ void clr(const UDSPInstruction& opc)
|
|||
u8 reg = (opc.hex >> 11) & 0x1;
|
||||
|
||||
dsp_set_long_acc(reg, 0);
|
||||
Update_SR_Register64(0);
|
||||
Update_SR_Register64((s64)0); // really?
|
||||
zeroWriteBackLog();
|
||||
}
|
||||
|
||||
|
|
|
@ -455,7 +455,7 @@ void maddx(const UDSPInstruction& opc)
|
|||
|
||||
u16 val1 = (sreg == 0) ? dsp_get_ax_l(0) : dsp_get_ax_h(0);
|
||||
u16 val2 = (treg == 0) ? dsp_get_ax_l(1) : dsp_get_ax_h(1);
|
||||
s64 prod = dsp_multiply_add(val1, val2);
|
||||
s64 prod = dsp_multiply_add(val1, val2, true);
|
||||
|
||||
zeroWriteBackLog();
|
||||
dsp_set_long_prod(prod);
|
||||
|
@ -474,7 +474,7 @@ void msubx(const UDSPInstruction& opc)
|
|||
|
||||
u16 val1 = (sreg == 0) ? dsp_get_ax_l(0) : dsp_get_ax_h(0);
|
||||
u16 val2 = (treg == 0) ? dsp_get_ax_l(1) : dsp_get_ax_h(1);
|
||||
s64 prod = dsp_multiply_sub(val1, val2);
|
||||
s64 prod = dsp_multiply_sub(val1, val2, true);
|
||||
|
||||
zeroWriteBackLog();
|
||||
dsp_set_long_prod(prod);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="Dolphin"
|
||||
ProjectGUID="{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
|
||||
RootNamespace="DolphinWX"
|
||||
|
@ -91,7 +91,7 @@
|
|||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/Dolphin.exe""
|
||||
OutputFile="../../../Binary/Win32/Dolphin.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
|
@ -208,13 +208,13 @@
|
|||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/Dolphin.exe""
|
||||
OutputFile="../../../Binary/x64/Dolphin.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="false"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
BaseAddress="0x00400000"
|
||||
|
@ -321,7 +321,7 @@
|
|||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/TLBID:1"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/DolphinD.exe""
|
||||
OutputFile="../../../Binary/Win32/DolphinD.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
|
@ -432,7 +432,7 @@
|
|||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/TLBID:1"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/DolphinD.exe""
|
||||
OutputFile="../../../Binary/x64/DolphinD.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
|
@ -546,7 +546,7 @@
|
|||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NODEFAULTLIB:msvcrt.lib
/NODEFAULTLIB:libcmtd.lib"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/DolphinDF.exe""
|
||||
OutputFile="../../../Binary/Win32/DolphinDF.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
|
@ -659,7 +659,7 @@
|
|||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/DolphinDF.exe"
|
||||
OutputFile="../../../Binary/x64/DolphinDF.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
|
@ -773,7 +773,7 @@
|
|||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/Dolphin.exeIL""
|
||||
OutputFile="../../../Binary/Win32/DolphinIL.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
|
@ -889,7 +889,7 @@
|
|||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile=""$(SolutionDir)../Binary/$(PlatformName)/DolphinIL.exe""
|
||||
OutputFile="../../../Binary/x64/DolphinIL.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
|
|
|
@ -116,8 +116,8 @@ void CARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED (event))
|
|||
|
||||
if (pieces.size() == 2 && pieces[0].size() == 8 && pieces[1].size() == 8)
|
||||
{
|
||||
u32 addr = strtoul(pieces[0].c_str(), NULL, 16);
|
||||
u32 value = strtoul(pieces[1].c_str(), NULL, 16);
|
||||
u32 addr = strtol(pieces[0].c_str(), NULL, 16);
|
||||
u32 value = strtol(pieces[1].c_str(), NULL, 16);
|
||||
// Decrypted code
|
||||
tempEntries.push_back(ActionReplay::AREntry(addr, value));
|
||||
}
|
||||
|
|
|
@ -145,11 +145,11 @@ int abc = 0;
|
|||
switch(wParam)
|
||||
{
|
||||
// Stop
|
||||
case WM_USER_STOP:
|
||||
case OPENGL_WM_USER_STOP:
|
||||
main_frame->DoStop();
|
||||
return 0;
|
||||
|
||||
case WM_USER_CREATE:
|
||||
case OPENGL_WM_USER_CREATE:
|
||||
// We don't have a local setting for bRenderToMain but we can detect it this way instead
|
||||
//PanicAlert("main call %i %i %i %i", lParam, (HWND)Core::GetWindowHandle(), MSWGetParent_((HWND)Core::GetWindowHandle()), (HWND)this->GetHWND());
|
||||
if (lParam == NULL)
|
||||
|
@ -232,7 +232,6 @@ EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
|
|||
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
|
||||
EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow)
|
||||
EVT_MENU(IDM_INFO, CFrame::OnShow_InfoWindow)
|
||||
EVT_MENU(IDM_RESTART, CFrame::OnRestart)
|
||||
EVT_MENU(IDM_CHANGEDISC, CFrame::OnChangeDisc)
|
||||
EVT_MENU(IDM_LOAD_WII_MENU, CFrame::OnLoadWiiMenu)
|
||||
EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen)
|
||||
|
@ -304,7 +303,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
|
||||
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
|
||||
, UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
|
||||
, bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false)
|
||||
, bRenderToMain(true), bFloatLogWindow(false), bFloatConsoleWindow(false)
|
||||
, HaveLeds(false), HaveSpeakers(false)
|
||||
, m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0)
|
||||
#if wxUSE_TIMER
|
||||
|
@ -495,24 +494,6 @@ void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
|
|||
Close(true);
|
||||
}
|
||||
|
||||
void CFrame::OnRestart(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
wxMessageBox(wxT("Please stop the current game before restarting."), wxT("Notice"), wxOK, this);
|
||||
return;
|
||||
}
|
||||
// Get exe path and restart
|
||||
#ifdef _WIN32
|
||||
char Str[MAX_PATH + 1];
|
||||
DWORD Size = sizeof(Str)/sizeof(char);
|
||||
DWORD n = GetModuleFileNameA(NULL, Str, Size);
|
||||
ShellExecuteA(NULL, "open", Str, g_pCodeWindow ? "" : "-d", NULL, SW_SHOW);
|
||||
#endif
|
||||
|
||||
Close(true);
|
||||
}
|
||||
|
||||
// --------
|
||||
// Events
|
||||
|
||||
|
@ -691,7 +672,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
|||
#ifdef _WIN32
|
||||
if(event.GetKeyCode() == 'M', '3', '4', '5', '6', '7') // Send this to the video plugin WndProc
|
||||
{
|
||||
PostMessage((HWND)Core::GetWindowHandle(), WM_USER, WM_USER_KEYDOWN, event.GetKeyCode());
|
||||
PostMessage((HWND)Core::GetWindowHandle(), WM_USER, OPENGL_WM_USER_KEYDOWN, event.GetKeyCode());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -250,7 +250,6 @@ class CFrame : public wxFrame
|
|||
#endif
|
||||
// Event functions
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnRestart(wxCommandEvent& WXUNUSED (event));
|
||||
void OnHelp(wxCommandEvent& event);
|
||||
void OnToolBar(wxCommandEvent& event);
|
||||
void OnAuiToolBar(wxAuiToolBarEvent& event);
|
||||
|
|
|
@ -127,12 +127,6 @@ void CFrame::ToggleConsole(bool bShow, int i)
|
|||
#ifdef _WIN32
|
||||
ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener();
|
||||
|
||||
// For developers: Use this to get a regular separate console window
|
||||
/*
|
||||
if(!GetConsoleWindow()) Console->Open(); else ShowWindow(GetConsoleWindow(), SW_SHOW);
|
||||
return;
|
||||
*/
|
||||
|
||||
if (bShow)
|
||||
{
|
||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat(" >>> Show\n").c_str());
|
||||
|
@ -754,7 +748,7 @@ void CFrame::ResizeConsole()
|
|||
wxBorder = 2;
|
||||
Border = 4;
|
||||
LowerBorder = 6;
|
||||
MenuBar = 26; // Including upper border
|
||||
MenuBar = 30; // Including upper border
|
||||
ScrollBar = 19;
|
||||
}
|
||||
else // XP
|
||||
|
|
|
@ -121,8 +121,6 @@ void CFrame::CreateMenu()
|
|||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(IDM_RESTART, g_pCodeWindow ? _T("Restart in regular mode") : _T("Restart in debugging mode"));
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
|
||||
m_MenuBar->Append(fileMenu, _T("&File"));
|
||||
|
||||
|
|
|
@ -57,8 +57,7 @@ void wxInfoWindow::Init_ChildControls()
|
|||
|
||||
|
||||
Info.append(StringFromFormat(
|
||||
"\n\n_-Computer Information-_\n\n%s\n%s\n%s\n\n_-Dolphin Information-_\n\n%s\n\n%s\n\n",
|
||||
Summarize_OS().c_str(),
|
||||
"\n\n%s\n%s\n%s\n\n%s\n\n",
|
||||
Summarize_Drives().c_str(),
|
||||
Summarize_CPU().c_str(),
|
||||
Summarize_Plug().c_str(),
|
||||
|
|
|
@ -234,7 +234,7 @@ void CLogWindow::OnClear(wxCommandEvent& WXUNUSED (event))
|
|||
for (int i = 0; i < msgQueueSize; i++)
|
||||
msgQueue.pop();
|
||||
m_LogSection.Leave();
|
||||
|
||||
|
||||
m_console->ClearScreen();
|
||||
NOTICE_LOG(CONSOLE, "Console cleared");
|
||||
NotifyUpdate();
|
||||
|
@ -517,12 +517,11 @@ void CLogWindow::UpdateLog()
|
|||
m_LogTimer->Start(UPDATETIME);
|
||||
}
|
||||
|
||||
// Receive log messages
|
||||
void CLogWindow::Log(LogTypes::LOG_LEVELS level, const char *text)
|
||||
{
|
||||
m_LogSection.Enter();
|
||||
// Remove the first message if the queue is big
|
||||
//if (msgQueue.size() >= 200) msgQueue.pop();
|
||||
if (msgQueue.size() >= 100)
|
||||
msgQueue.pop();
|
||||
msgQueue.push(std::pair<u8, wxString>((u8)level, wxString::FromAscii(text)));
|
||||
m_LogSection.Leave();
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#ifndef __SUMMARIZE_H__
|
||||
#define __SUMMARIZE_H__
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
std::string Summarize_Plug()
|
||||
{
|
||||
return StringFromFormat(
|
||||
|
@ -106,7 +104,7 @@ std::string Summarize_CPU()
|
|||
{
|
||||
return StringFromFormat(
|
||||
"Processor Information: \n%s\n",
|
||||
cpu_info.Summarize_long().c_str()
|
||||
cpu_info.Summarize().c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -126,66 +124,4 @@ std::string Summarize_Drives()
|
|||
return drive;
|
||||
}
|
||||
|
||||
|
||||
std::string Summarize_OS(void)
|
||||
{
|
||||
|
||||
std::string operatingSystem;
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
OSVERSIONINFO osver;
|
||||
osver.dwOSVersionInfoSize = sizeof(osver);
|
||||
|
||||
if (GetVersionEx(&osver))
|
||||
{
|
||||
switch(osver.dwMajorVersion)
|
||||
{
|
||||
case 6:
|
||||
switch(osver.dwMinorVersion)
|
||||
{
|
||||
case 1:
|
||||
if(osver.dwPlatformId == VER_NT_WORKSTATION)
|
||||
operatingSystem = "Windows 7";
|
||||
else
|
||||
operatingSystem += "Windows Server 2008 R2";
|
||||
break;
|
||||
case 0:
|
||||
if(osver.dwPlatformId == VER_NT_WORKSTATION)
|
||||
operatingSystem = "Windows Vista";
|
||||
else
|
||||
operatingSystem = "Windows Server 2008";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
switch(osver.dwMinorVersion)
|
||||
{
|
||||
case 2:
|
||||
if(GetSystemMetrics(SM_SERVERR2) != 0)
|
||||
operatingSystem = "Windows Server 2003 R2";
|
||||
else
|
||||
operatingSystem = "Windows Server 2003";
|
||||
break;
|
||||
case 1:
|
||||
operatingSystem = "Windows XP";
|
||||
break;
|
||||
case 0:
|
||||
operatingSystem = "Windows 2000";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include "linux/version.h"
|
||||
operatingSystem = UTS_RELEASE;
|
||||
#endif
|
||||
#endif
|
||||
return StringFromFormat("Operating System: %s",operatingSystem);
|
||||
}
|
||||
|
||||
|
||||
#endif //__SUMMARIZE_H__
|
||||
#endif //__SUMMARIZE_H__
|
|
@ -35,63 +35,46 @@
|
|||
#define _SDL_MAIN_ // Avoid certain declarations in SDL.h
|
||||
#include "SDL.h" // Local
|
||||
#include "XInput.h"
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <dinput.h>
|
||||
#pragma comment(lib, "dxguid.lib")
|
||||
#pragma comment(lib, "dinput8.lib")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// Definitions
|
||||
// -------------------
|
||||
int g_LastPad = 0;
|
||||
|
||||
|
||||
|
||||
namespace InputCommon
|
||||
{
|
||||
|
||||
|
||||
// Definitions
|
||||
// -------------------
|
||||
int g_LastPad = 0;
|
||||
int NumDIDevices = 0;
|
||||
|
||||
|
||||
// Reset and search for devices
|
||||
|
||||
|
||||
|
||||
// Search attached devices. Populate joyinfo for all attached physical devices.
|
||||
// -----------------------
|
||||
bool SearchDevicesReset(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads)
|
||||
bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads, int &_NumGoodPads)
|
||||
{
|
||||
// This is needed to update SDL_NumJoysticks
|
||||
if (SDL_WasInit(0))
|
||||
SDL_Quit();
|
||||
|
||||
return SearchDevices(_joyinfo, _NumPads);
|
||||
}
|
||||
|
||||
// Initialize if not previously initialized
|
||||
// -----------------------
|
||||
bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads)
|
||||
{
|
||||
// Init Joystick + Haptic (force feedback) subsystem on SDL 1.3
|
||||
if (!SDL_WasInit(0))
|
||||
{
|
||||
#if SDL_VERSION_ATLEAST(1, 3, 0) && !defined(_WIN32)
|
||||
NOTICE_LOG(PAD, "SDL_Init | HAPTIC");
|
||||
#if SDL_VERSION_ATLEAST(1, 3, 0)
|
||||
if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC) < 0)
|
||||
#else
|
||||
//NOTICE_LOG(PAD, "SDL_Init");
|
||||
if (SDL_Init(SDL_INIT_JOYSTICK) < 0)
|
||||
#endif
|
||||
{
|
||||
PanicAlert("Could not initialize SDL: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear joyinfo
|
||||
_joyinfo.clear();
|
||||
// Get device status
|
||||
int numjoy = SDL_NumJoysticks();
|
||||
for (int i = 0; i < numjoy; i++ )
|
||||
{
|
||||
{
|
||||
CONTROLLER_INFO Tmp;
|
||||
|
||||
Tmp.joy = SDL_JoystickOpen(i);
|
||||
|
@ -103,160 +86,39 @@ bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &_NumPads)
|
|||
Tmp.Name = SDL_JoystickName(i);
|
||||
|
||||
// Check if the device is okay
|
||||
if ( !( Tmp.NumAxes == 0
|
||||
if ( Tmp.NumAxes == 0
|
||||
&& Tmp.NumBalls == 0
|
||||
&& Tmp.NumButtons == 0
|
||||
&& Tmp.NumHats == 0)
|
||||
&& Tmp.NumHats == 0
|
||||
)
|
||||
{
|
||||
_joyinfo.push_back(Tmp);
|
||||
Tmp.Good = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (SDL_JoystickOpened(i)) SDL_JoystickClose(Tmp.joy);
|
||||
}
|
||||
_NumGoodPads++;
|
||||
Tmp.Good = true;
|
||||
}
|
||||
|
||||
_joyinfo.push_back(Tmp);
|
||||
|
||||
// We have now read the values we need so we close the device
|
||||
if (SDL_JoystickOpened(i)) SDL_JoystickClose(_joyinfo[i].joy);
|
||||
}
|
||||
|
||||
_NumPads = (int)_joyinfo.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Show the current pad status
|
||||
// -----------------
|
||||
std::string ShowStatus(int Slot, int Device, CONTROLLER_MAPPING PadMapping[], CONTROLLER_STATE PadState[],
|
||||
std::vector<InputCommon::CONTROLLER_INFO> joyinfo)
|
||||
{
|
||||
CONTROLLER_MAPPING_NEW _PadMapping[4];
|
||||
CONTROLLER_STATE_NEW _PadState[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
_PadMapping[i].ID = PadMapping[i].ID;
|
||||
_PadMapping[i].Name = PadMapping[i].Name;
|
||||
_PadState[i].joy = PadState[i].joy;
|
||||
}
|
||||
return DoShowStatus(Slot, Device, _PadMapping, _PadState, joyinfo);
|
||||
}
|
||||
std::string DoShowStatus(int Slot, int Device,
|
||||
CONTROLLER_MAPPING_NEW PadMapping[], CONTROLLER_STATE_NEW PadState[],
|
||||
std::vector<InputCommon::CONTROLLER_INFO> joyinfo)
|
||||
{
|
||||
// Save the physical device
|
||||
int ID = PadMapping[Slot].ID;
|
||||
// Make local shortcut
|
||||
SDL_Joystick *joy = PadState[Slot].joy;
|
||||
|
||||
// Make shortcuts for all pads
|
||||
SDL_Joystick *joy0 = PadState[0].joy;
|
||||
SDL_Joystick *joy1 = PadState[1].joy;
|
||||
SDL_Joystick *joy2 = PadState[2].joy;
|
||||
SDL_Joystick *joy3 = PadState[3].joy;
|
||||
|
||||
// Temporary storage
|
||||
std::string
|
||||
StrAllHandles, StrAllName,
|
||||
StrHandles, StrId, StrName,
|
||||
StrAxes, StrHats, StrBut;
|
||||
int value;
|
||||
|
||||
// All devices
|
||||
int numjoy = SDL_NumJoysticks();
|
||||
for (int i = 0; i < numjoy; i++ )
|
||||
{
|
||||
SDL_Joystick *AllJoy = SDL_JoystickOpen(i);
|
||||
StrAllHandles += StringFromFormat(" %i:%06i", i, AllJoy);
|
||||
StrAllName += StringFromFormat("Name %i: %s\n", i, SDL_JoystickName(i));
|
||||
}
|
||||
|
||||
// Get handles
|
||||
for(int i = 0; i < joyinfo.size(); i++)
|
||||
{
|
||||
StrHandles += StringFromFormat(" %i:%06i", i, joyinfo.at(i).joy);
|
||||
StrId += StringFromFormat(" %i:%i", i, joyinfo.at(i).ID);
|
||||
StrName += StringFromFormat("Name %i:%s\n", i, joyinfo.at(i).Name.c_str());
|
||||
}
|
||||
|
||||
// Get status
|
||||
int Axes = joyinfo[Device].NumAxes;
|
||||
int Balls = joyinfo[Device].NumBalls;
|
||||
int Hats = joyinfo[Device].NumHats;
|
||||
int Buttons = joyinfo[Device].NumButtons;
|
||||
|
||||
// Update the internal values
|
||||
SDL_JoystickUpdate();
|
||||
|
||||
// Go through all axes and read out their values
|
||||
for(int i = 0; i < Axes; i++)
|
||||
{
|
||||
value = SDL_JoystickGetAxis(joy, i);
|
||||
StrAxes += StringFromFormat(" %i:%06i", i, value);
|
||||
}
|
||||
for(int i = 0;i < Hats; i++)
|
||||
{
|
||||
value = SDL_JoystickGetHat(joy, i);
|
||||
StrHats += StringFromFormat(" %i:%i", i, value);
|
||||
}
|
||||
for(int i = 0;i < Buttons; i++)
|
||||
{
|
||||
value = SDL_JoystickGetButton(joy, i);
|
||||
StrBut += StringFromFormat(" %i:%i", i+1, value);
|
||||
}
|
||||
|
||||
return StringFromFormat(
|
||||
"All devices:\n"
|
||||
"Handles: %s\n"
|
||||
"%s"
|
||||
|
||||
"\nAll pads:\n"
|
||||
"Handles: %s\n"
|
||||
"ID: %s\n"
|
||||
"%s"
|
||||
|
||||
"\nAll slots:\n"
|
||||
"ID: %i %i %i %i\n"
|
||||
"Name: '%s' '%s' '%s' '%s'\n"
|
||||
//"Controllertype: %i %i %i %i\n"
|
||||
//"SquareToCircle: %i %i %i %i\n\n"
|
||||
#ifdef _WIN32
|
||||
"Handles: %i %i %i %i\n"
|
||||
//"XInput: %i %i %i\n"
|
||||
#endif
|
||||
|
||||
"\nThis pad:\n"
|
||||
"Handle: %06i\n"
|
||||
"ID: %i\n"
|
||||
//"Slot: %i\n"
|
||||
"Axes: %s\n"
|
||||
"Hats: %s\n"
|
||||
"But: %s\n"
|
||||
"Device: Ax: %i Balls:%i Hats:%i But:%i",
|
||||
StrAllHandles.c_str(), StrAllName.c_str(),
|
||||
StrHandles.c_str(), StrId.c_str(), StrName.c_str(),
|
||||
|
||||
PadMapping[0].ID, PadMapping[1].ID, PadMapping[2].ID, PadMapping[3].ID,
|
||||
PadMapping[0].Name.c_str(), PadMapping[1].Name.c_str(), PadMapping[2].Name.c_str(), PadMapping[3].Name.c_str(),
|
||||
//PadMapping[0].controllertype, PadMapping[1].controllertype, PadMapping[2].controllertype, PadMapping[3].controllertype,
|
||||
//PadMapping[0].bSquareToCircle, PadMapping[1].bSquareToCircle, PadMapping[2].bSquareToCircle, PadMapping[3].bSquareToCircle,
|
||||
#ifdef _WIN32
|
||||
joy0, joy1, joy2, joy3,
|
||||
//PadState[PadMapping[0].ID].joy, PadState[PadMapping[1].ID].joy, PadState[PadMapping[2].ID].joy, PadState[PadMapping[3].ID].joy,
|
||||
//XInput::IsConnected(0), XInput::GetXI(0, InputCommon::XI_TRIGGER_L), XInput::GetXI(0, InputCommon::XI_TRIGGER_R),
|
||||
joy,
|
||||
#endif
|
||||
//Slot,
|
||||
ID,
|
||||
StrAxes.c_str(), StrHats.c_str(), StrBut.c_str(),
|
||||
Axes, Balls, Hats, Buttons
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Supporting functions
|
||||
// ====================
|
||||
// ----------------
|
||||
|
||||
// Read current joystick status
|
||||
/* --------------------
|
||||
/* ----------------
|
||||
The value PadMapping[].buttons[] is the number of the assigned joypad button,
|
||||
PadState[].buttons[] is the status of the button, it becomes 0 (no pressed) or 1 (pressed) */
|
||||
|
||||
|
@ -278,15 +140,10 @@ void ReadButton(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, int
|
|||
Input: The virtual device 0, 1, 2 or 3
|
||||
Function: Updates the PadState struct with the current pad status. The input value "controller" is
|
||||
for a virtual controller 0 to 3. */
|
||||
void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping)
|
||||
{
|
||||
if (SDL_JoystickEventState(SDL_QUERY) == SDL_ENABLE) return;
|
||||
//NOTICE_LOG(PAD, "SDL_JoystickEventState: %s", (SDL_JoystickEventState(SDL_QUERY) == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_IGNORE");
|
||||
|
||||
void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, int Controller, int NumButtons)
|
||||
{
|
||||
// Update the gamepad status
|
||||
SDL_JoystickUpdate();
|
||||
// Read info
|
||||
int NumButtons = SDL_JoystickNumButtons(_PadState.joy);
|
||||
|
||||
// Update axis states. It doesn't hurt much if we happen to ask for nonexisting axises here.
|
||||
_PadState.axis[CTL_MAIN_X] = SDL_JoystickGetAxis(_PadState.joy, _PadMapping.axis[CTL_MAIN_X]);
|
||||
|
@ -349,13 +206,12 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping)
|
|||
}
|
||||
|
||||
#ifdef SHOW_PAD_STATUS
|
||||
/*
|
||||
// Show the status of all connected pads
|
||||
//ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
||||
//if ((g_LastPad == 0 && _PadMapping.ID == 0) || Controller < g_LastPad) Console->ClearScreen();
|
||||
//if ((g_LastPad == 0 && Controller == 0) || Controller < g_LastPad) Console->ClearScreen();
|
||||
g_LastPad = Controller;
|
||||
NOTICE_LOG(CONSOLE,
|
||||
"Pad | Number:%i Handle:%i\n"
|
||||
"Pad | Number:%i Enabled:%i Handle:%i\n"
|
||||
"Main Stick | X:%03i Y:%03i\n"
|
||||
"C Stick | X:%03i Y:%03i\n"
|
||||
"Trigger | Type:%s DigitalL:%i DigitalR:%i AnalogL:%03i AnalogR:%03i HalfPress:%i\n"
|
||||
|
@ -363,7 +219,7 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping)
|
|||
"D-Pad | Type:%s Hat:%i U:%i D:%i\n"
|
||||
"======================================================\n",
|
||||
|
||||
_PadMapping.ID, _PadState.joy,
|
||||
Controller, _PadMapping.enabled, _PadState.joy,
|
||||
|
||||
_PadState.axis[InputCommon::CTL_MAIN_X], _PadState.axis[InputCommon::CTL_MAIN_Y],
|
||||
_PadState.axis[InputCommon::CTL_SUB_X], _PadState.axis[InputCommon::CTL_SUB_Y],
|
||||
|
@ -379,7 +235,6 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping)
|
|||
_PadState.dpad,
|
||||
_PadState.dpad2[InputCommon::CTL_D_PAD_UP], _PadState.dpad2[InputCommon::CTL_D_PAD_DOWN]
|
||||
);
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -408,23 +263,18 @@ bool AvoidValues(int value, bool NoTriggerFilter)
|
|||
|
||||
// Detect a pressed button
|
||||
// ---------------------
|
||||
void GetButton(SDL_Joystick *joy, int ControllerID,
|
||||
void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int hats,
|
||||
int &KeyboardKey, int &value, int &type, int &pressed, bool &Succeed, bool &Stop,
|
||||
bool LeftRight, bool Axis, bool XInput, bool Button, bool Hat, bool NoTriggerFilter)
|
||||
{
|
||||
// It needs the wxWidgets excape keycode
|
||||
static const int WXK_ESCAPE = 27;
|
||||
|
||||
// Save info
|
||||
int buttons = SDL_JoystickNumButtons(joy);
|
||||
int axes = SDL_JoystickNumAxes(joy);;
|
||||
int hats = SDL_JoystickNumHats(joy);;
|
||||
|
||||
// Update the internal status
|
||||
SDL_JoystickUpdate();
|
||||
|
||||
// For the triggers we accept both a digital or an analog button
|
||||
if (Axis)
|
||||
if(Axis)
|
||||
{
|
||||
for(int i = 0; i < axes; i++)
|
||||
{
|
||||
|
@ -439,7 +289,7 @@ void GetButton(SDL_Joystick *joy, int ControllerID,
|
|||
}
|
||||
|
||||
// Check for a hat
|
||||
if (Hat)
|
||||
if(Hat)
|
||||
{
|
||||
for(int i = 0; i < hats; i++)
|
||||
{
|
||||
|
@ -520,41 +370,5 @@ void GetButton(SDL_Joystick *joy, int ControllerID,
|
|||
|
||||
|
||||
|
||||
// **********************************************
|
||||
|
||||
|
||||
|
||||
// Search for DirectInput devices
|
||||
// ----------------
|
||||
#ifdef _WIN32
|
||||
BOOL CALLBACK EnumDICallback(const DIDEVICEINSTANCE* pInst, VOID* pContext)
|
||||
{
|
||||
NumDIDevices++;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
int SearchDIDevices()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
LPDIRECTINPUT8 g_pObject;
|
||||
LPDIRECTINPUTDEVICE8 g_pDevice;
|
||||
DIPROPDWORD dipdw;
|
||||
HRESULT hr;
|
||||
NumDIDevices = 0;
|
||||
|
||||
// Register with the DirectInput subsystem and get a pointer to a IDirectInput interface we can use.
|
||||
if (FAILED(hr = DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&g_pObject, NULL)))
|
||||
return 0;
|
||||
|
||||
// Look for a device
|
||||
if (FAILED(hr = g_pObject->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumDICallback, NULL, DIEDFL_ATTACHEDONLY)))
|
||||
return 0;
|
||||
return NumDIDevices;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
} // InputCommon
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#endif
|
||||
|
||||
#include "Common.h" // Common
|
||||
#include "StringUtil.h"
|
||||
|
||||
|
||||
|
||||
namespace InputCommon
|
||||
|
@ -62,7 +62,7 @@ namespace InputCommon
|
|||
|
||||
// Settings
|
||||
// ----------
|
||||
// Show a status window with the detected devices etc
|
||||
// Show a status window with the detected axes, buttons and so on
|
||||
//#define SHOW_PAD_STATUS
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ struct CONTROLLER_STATE // GC PAD INFO/STATE
|
|||
int dpad; // Automatic SDL D-Pad (8 directions + neutral)
|
||||
int dpad2[4]; // D-pad using buttons
|
||||
int axis[6]; // 2 x 2 Axes (Main & Sub)
|
||||
int halfpress; // L and R triggers half pressed
|
||||
int halfpress; // Halfpress... you know, like not fully pressed ;)...
|
||||
SDL_Joystick *joy; // SDL joystick device
|
||||
};
|
||||
|
||||
|
@ -95,7 +95,6 @@ struct CONTROLLER_MAPPING // GC PAD MAPPING
|
|||
int halfpress; // (See above)
|
||||
int deadzone; // Deadzone... what else?
|
||||
int ID; // SDL joystick device ID
|
||||
std::string Name; // SDL joystick device name
|
||||
int controllertype; // Hat: Hat or custom buttons
|
||||
int triggertype; // Triggers range
|
||||
std::string SRadius, SDiagonal, SRadiusC, SDiagonalC;
|
||||
|
@ -112,6 +111,7 @@ struct CONTROLLER_INFO // CONNECTED WINDOWS DEVICES INFO
|
|||
int NumHats; // Amount of Hats (POV)
|
||||
std::string Name; // Joypad/stickname
|
||||
int ID; // SDL joystick device ID
|
||||
bool Good; // Pad is good (it has at least one button or axis)
|
||||
SDL_Joystick *joy; // SDL joystick device
|
||||
};
|
||||
enum
|
||||
|
@ -220,7 +220,6 @@ struct CONTROLLER_MAPPING_NEW // GC PAD MAPPING
|
|||
int DeadZoneL; // Analog 1 Deadzone
|
||||
int DeadZoneR; // Analog 2 Deadzone
|
||||
int ID; // SDL joystick device ID
|
||||
std::string Name; // SDL joystick device name
|
||||
int controllertype; // D-Pad type: Hat or custom buttons
|
||||
int triggertype; // SDL or XInput trigger
|
||||
std::string SDiagonal;
|
||||
|
@ -237,14 +236,9 @@ struct CONTROLLER_MAPPING_NEW // GC PAD MAPPING
|
|||
// ---------
|
||||
|
||||
// General functions
|
||||
bool SearchDevicesReset(std::vector<CONTROLLER_INFO> &_joyinfo, int &NumPads);
|
||||
bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &NumPads);
|
||||
std::string ShowStatus(int Slot, int Device, CONTROLLER_MAPPING PadMapping[], CONTROLLER_STATE PadState[],
|
||||
std::vector<InputCommon::CONTROLLER_INFO> joyinfo);
|
||||
std::string DoShowStatus(int Slot, int Device, CONTROLLER_MAPPING_NEW PadMapping[], CONTROLLER_STATE_NEW PadState[],
|
||||
std::vector<InputCommon::CONTROLLER_INFO> joyinfo);
|
||||
void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping);
|
||||
void GetButton(SDL_Joystick*, int, int&,int&,int&,int&,bool&,bool&, bool,bool,bool,bool,bool,bool);
|
||||
bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &NumPads, int &NumGoodPads);
|
||||
void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, int controller, int NumButtons);
|
||||
void GetButton(SDL_Joystick*, int,int,int,int, int&,int&,int&,int&,bool&,bool&, bool,bool,bool,bool,bool,bool);
|
||||
|
||||
// Value conversion
|
||||
float Deg2Rad(float Deg);
|
||||
|
@ -262,9 +256,7 @@ std::string VKToString(int keycode);
|
|||
extern int g_LastPad;
|
||||
#endif
|
||||
|
||||
// DirectInput
|
||||
extern int NumDIDevices;
|
||||
int SearchDIDevices();
|
||||
|
||||
|
||||
} // InputCommon
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ void PixelShaderManager::SetConstants()
|
|||
break;
|
||||
case 2:
|
||||
// 24 bits
|
||||
ftemp[0] = ffrac/65536.0f; ftemp[1] = ffrac/256.0f; ftemp[2] = ffrac; ftemp[3] = 0;
|
||||
ftemp[0] = ffrac/65536.0f; ftemp[1] = ffrac/256.0f; ftemp[2] = ffrac; ftemp[3] = ffrac/16777216.0f;
|
||||
break;
|
||||
}
|
||||
SetPSConstant4fv(C_ZBIAS, ftemp);
|
||||
|
|
|
@ -60,25 +60,6 @@ int TexDecoder_GetTexelSizeInNibbles(int format)
|
|||
case GX_TF_C8: return 2;
|
||||
case GX_TF_C14X2: return 4;
|
||||
case GX_TF_CMPR: return 1;
|
||||
case GX_CTF_R4: return 1;
|
||||
case GX_CTF_RA4: return 2;
|
||||
case GX_CTF_RA8: return 4;
|
||||
case GX_CTF_YUVA8: return 8;
|
||||
case GX_CTF_A8: return 2;
|
||||
case GX_CTF_R8: return 2;
|
||||
case GX_CTF_G8: return 2;
|
||||
case GX_CTF_B8: return 2;
|
||||
case GX_CTF_RG8: return 4;
|
||||
case GX_CTF_GB8: return 4;
|
||||
|
||||
case GX_TF_Z8: return 2;
|
||||
case GX_TF_Z16: return 4;
|
||||
case GX_TF_Z24X8: return 8;
|
||||
|
||||
case GX_CTF_Z4: return 1;
|
||||
case GX_CTF_Z8M: return 2;
|
||||
case GX_CTF_Z8L: return 2;
|
||||
case GX_CTF_Z16L: return 4;
|
||||
default: return 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue