Second and final pass of clearing out tabs.

This commit is contained in:
Lioncash committed 2014-02-17 02:19:41 -05:00
1 parent a8ca2c6cc2
commit 3fd87a7636
242 files changed
+1706 -1702

No files matched your search

+6 -6
View File
@@ -370,11 +370,11 @@ bool batchdecrypt(u32 *codes, u16 size)
tmparray[1] = 0;
tmparray[2] = 4; // Skip crc
tmparray[3] = size;
getbitstring(tmparray,tmparray2+1,11); // Game id
getbitstring(tmparray,tmparray2+2,17); // Code id
getbitstring(tmparray,tmparray2+3,1); // Master code
getbitstring(tmparray,tmparray2+4,1); // Unknown
getbitstring(tmparray,tmparray2+5,2); // Region
getbitstring(tmparray,tmparray2+1,11); // Game id
getbitstring(tmparray,tmparray2+2,17); // Code id
getbitstring(tmparray,tmparray2+3,1); // Master code
getbitstring(tmparray,tmparray2+4,1); // Unknown
getbitstring(tmparray,tmparray2+5,2); // Region
// Grab gameid and region from the last decrypted code
// Maybe check this against dolphin's GameID? - "code is for wrong game" type msg
@@ -473,7 +473,7 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
{
// Commented out since we just send the code anyways and hope for the best XD
//PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\n"
// "First Code in Block(should be verification code):\n%s", vCodes[0].c_str());
// "First Code in Block(should be verification code):\n%s", vCodes[0].c_str());
for (i = 0; i < (vCodes.size()<<1); i+=2)
{
+6 -6
View File
@@ -195,7 +195,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, bool forceLoad
{
// Encrypted AR code
// Decryption is done in "blocks", so we must push blocks into a vector,
// then send to decrypt when a new block is encountered, or if it's the last block.
// then send to decrypt when a new block is encountered, or if it's the last block.
encryptedLines.push_back(pieces[0]+pieces[1]+pieces[2]);
}
}
@@ -293,7 +293,7 @@ bool RunCode(const ARCode &arcode)
// after a conditional code, skip lines if needed
if (skip_count)
{
if (skip_count > 0) // skip x lines
if (skip_count > 0) // skip x lines
{
LogInfo("Line skipped");
--skip_count;
@@ -302,13 +302,13 @@ bool RunCode(const ARCode &arcode)
{
// skip all lines
LogInfo("All Lines skipped");
return true; // don't need to iterate through the rest of the ops
return true; // don't need to iterate through the rest of the ops
}
else if (-CONDTIONAL_ALL_LINES_UNTIL == skip_count)
{
// skip until a "00000000 40000000" line is reached
LogInfo("Line skipped");
if (0 == addr && 0x40000000 == data) // check for an endif line
if (addr == 0 && 0x40000000 == data) // check for an endif line
skip_count = 0;
}
@@ -642,7 +642,7 @@ bool Subtype_AddCode(const ARAddr addr, const u32 data)
LogInfo("--------");
const u32 read = Memory::Read_U32(new_addr);
const float fread = *((float*)&read) + (float)data; // data contains an integer value
const float fread = *((float*)&read) + (float)data; // data contains an integer value
const u32 newval = *((u32*)&fread);
Memory::Write_U32(newval, new_addr);
LogInfo("Old Value %08x", read);
@@ -928,7 +928,7 @@ bool CompareValues(const u32 val1, const u32 val2, const int type)
case CONDTIONAL_AND:
LogInfo("Type 7: If And");
return !!(val1 & val2); // bitwise AND
return !!(val1 & val2); // bitwise AND
break;
default: LogInfo("Unknown Compare type");
+74 -74
View File
@@ -49,37 +49,37 @@ bool CBoot::EmulatedBS2_GC()
// Write necessary values
// Here we write values to memory that the apploader does not take care of. Game info goes
// to 0x80000000 according to yagcd 4.2.
// to 0x80000000 according to YAGCD 4.2.
DVDInterface::DVDRead(0x00000000, 0x80000000, 0x20); // write disc info
Memory::Write_U32(0x0D15EA5E, 0x80000020); // booted from bootrom. 0xE5207C22 = booted from jtag
Memory::Write_U32(Memory::REALRAM_SIZE, 0x80000028); // Physical Memory Size (24MB on retail)
// TODO determine why some games fail when using a retail id. (Seem to take different EXI paths, see ikaruga for example)
Memory::Write_U32(0x10000006, 0x8000002C); // Console type - DevKit (retail ID == 0x00000003) see yagcd 4.2.1.1.2
Memory::Write_U32(0x0D15EA5E, 0x80000020); // Booted from bootrom. 0xE5207C22 = booted from jtag
Memory::Write_U32(Memory::REALRAM_SIZE, 0x80000028); // Physical Memory Size (24MB on retail)
// TODO determine why some games fail when using a retail ID. (Seem to take different EXI paths, see Ikaruga for example)
Memory::Write_U32(0x10000006, 0x8000002C); // Console type - DevKit (retail ID == 0x00000003) see YAGCD 4.2.1.1.2
Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC
? 0 : 1, 0x800000CC); // fake the VI Init of the IPL (yagcd 4.2.1.4)
? 0 : 1, 0x800000CC); // Fake the VI Init of the IPL (YAGCD 4.2.1.4)
Memory::Write_U32(0x01000000, 0x800000d0); // ARAM Size. 16MB main + 4/16/32MB external (retail consoles have no external ARAM)
Memory::Write_U32(0x01000000, 0x800000d0); // ARAM Size. 16MB main + 4/16/32MB external (retail consoles have no external ARAM)
Memory::Write_U32(0x09a7ec80, 0x800000F8); // Bus Clock Speed
Memory::Write_U32(0x1cf7c580, 0x800000FC); // CPU Clock Speed
Memory::Write_U32(0x09a7ec80, 0x800000F8); // Bus Clock Speed
Memory::Write_U32(0x1cf7c580, 0x800000FC); // CPU Clock Speed
Memory::Write_U32(0x4c000064, 0x80000300); // write default DFI Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000800); // write default FPU Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000C00); // write default Syscall Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000300); // Write default DFI Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000800); // Write default FPU Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000C00); // Write default Syscall Handler: rfi
Memory::Write_U64((u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8); // preset time base ticks
Memory::Write_U64((u64)CEXIIPL::GetGCTime() * (u64)40500000, 0x800030D8); // Preset time base ticks
// HIO checks this
//Memory::Write_U16(0x8200, 0x000030e6); // Console type
//Memory::Write_U16(0x8200, 0x000030e6); // Console type
HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader
// Load Apploader to Memory - The apploader is hardcoded to begin at 0x2440 on the disc,
// but the size can differ between discs. Compare with yagcd chap 13.
// but the size can differ between discs. Compare with YAGCD chap 13.
u32 iAppLoaderOffset = 0x2440;
u32 iAppLoaderEntry = VolumeHandler::Read32(iAppLoaderOffset + 0x10);
u32 iAppLoaderSize = VolumeHandler::Read32(iAppLoaderOffset + 0x14) + VolumeHandler::Read32(iAppLoaderOffset + 0x18);
u32 iAppLoaderEntry = VolumeHandler::Read32(iAppLoaderOffset + 0x10);
u32 iAppLoaderSize = VolumeHandler::Read32(iAppLoaderOffset + 0x14) + VolumeHandler::Read32(iAppLoaderOffset + 0x18);
if ((iAppLoaderEntry == (u32)-1) || (iAppLoaderSize == (u32)-1))
{
INFO_LOG(BOOT, "GC BS2: Not running apploader!");
@@ -90,9 +90,9 @@ bool CBoot::EmulatedBS2_GC()
// Setup pointers like real BS2 does
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC)
{
PowerPC::ppcState.gpr[1] = 0x81566550; // StackPointer, used to be set to 0x816ffff0
PowerPC::ppcState.gpr[2] = 0x81465cc0; // global pointer to Small Data Area 2 Base (haven't seen anything use it...meh)
PowerPC::ppcState.gpr[13] = 0x81465320; // global pointer to Small Data Area Base (Luigi's Mansion's apploader uses it)
PowerPC::ppcState.gpr[1] = 0x81566550; // StackPointer, used to be set to 0x816ffff0
PowerPC::ppcState.gpr[2] = 0x81465cc0; // Global pointer to Small Data Area 2 Base (haven't seen anything use it...meh)
PowerPC::ppcState.gpr[13] = 0x81465320; // Global pointer to Small Data Area Base (Luigi's Mansion's apploader uses it)
}
else
{
@@ -131,9 +131,9 @@ bool CBoot::EmulatedBS2_GC()
RunFunction(iAppLoaderMain);
u32 iRamAddress = Memory::ReadUnchecked_U32(0x81300004);
u32 iLength = Memory::ReadUnchecked_U32(0x81300008);
u32 iDVDOffset = Memory::ReadUnchecked_U32(0x8130000c);
u32 iRamAddress = Memory::ReadUnchecked_U32(0x81300004);
u32 iLength = Memory::ReadUnchecked_U32(0x81300008);
u32 iDVDOffset = Memory::ReadUnchecked_U32(0x8130000c);
INFO_LOG(MASTER_LOG, "DVDRead: offset: %08x memOffset: %08x length: %i", iDVDOffset, iRamAddress, iLength);
DVDInterface::DVDRead(iDVDOffset, iRamAddress, iLength);
@@ -232,55 +232,55 @@ bool CBoot::SetupWiiMemory(IVolume::ECountry country)
Wiibrew. These values are needed for the games to function correctly. A few
values in this region will also be placed here by the game as it boots.
They are:
0x80000038 Start of FST
0x8000003c Size of FST Size
0x80000060 Copyright code
0x80000038 Start of FST
0x8000003c Size of FST Size
0x80000060 Copyright code
*/
DVDInterface::DVDRead(0x00000000, 0x00000000, 0x20); // Game Code
Memory::Write_U32(0x0D15EA5E, 0x00000020); // Another magic word
Memory::Write_U32(0x00000001, 0x00000024); // Unknown
Memory::Write_U32(Memory::REALRAM_SIZE, 0x00000028); // MEM1 size 24MB
Memory::Write_U32(0x00000023, 0x0000002c); // Production Board Model
Memory::Write_U32(0x00000000, 0x00000030); // Init
Memory::Write_U32(0x817FEC60, 0x00000034); // Init
Memory::Write_U32(0x0D15EA5E, 0x00000020); // Another magic word
Memory::Write_U32(0x00000001, 0x00000024); // Unknown
Memory::Write_U32(Memory::REALRAM_SIZE, 0x00000028); // MEM1 size 24MB
Memory::Write_U32(0x00000023, 0x0000002c); // Production Board Model
Memory::Write_U32(0x00000000, 0x00000030); // Init
Memory::Write_U32(0x817FEC60, 0x00000034); // Init
// 38, 3C should get start, size of FST through apploader
Memory::Write_U32(0x38a00040, 0x00000060); // Exception init
Memory::Write_U32(0x8008f7b8, 0x000000e4); // Thread Init
Memory::Write_U32(Memory::REALRAM_SIZE, 0x000000f0); // "Simulated memory size" (debug mode?)
Memory::Write_U32(0x8179b500, 0x000000f4); // __start
Memory::Write_U32(0x0e7be2c0, 0x000000f8); // Bus speed
Memory::Write_U32(0x2B73A840, 0x000000fc); // CPU speed
Memory::Write_U16(0x0000, 0x000030e6); // Console type
Memory::Write_U32(0x00000000, 0x000030c0); // EXI
Memory::Write_U32(0x00000000, 0x000030c4); // EXI
Memory::Write_U32(0x00000000, 0x000030dc); // Time
Memory::Write_U32(0x00000000, 0x000030d8); // Time
Memory::Write_U16(0x8201, 0x000030e6); // Dev console / debug capable
Memory::Write_U32(0x00000000, 0x000030f0); // Apploader
Memory::Write_U32(0x01800000, 0x00003100); // BAT
Memory::Write_U32(0x01800000, 0x00003104); // BAT
Memory::Write_U32(0x00000000, 0x0000310c); // Init
Memory::Write_U32(0x8179d500, 0x00003110); // Init
Memory::Write_U32(0x04000000, 0x00003118); // Unknown
Memory::Write_U32(0x04000000, 0x0000311c); // BAT
Memory::Write_U32(0x93400000, 0x00003120); // BAT
Memory::Write_U32(0x90000800, 0x00003124); // Init - MEM2 low
Memory::Write_U32(0x93ae0000, 0x00003128); // Init - MEM2 high
Memory::Write_U32(0x93ae0000, 0x00003130); // IOS MEM2 low
Memory::Write_U32(0x93b00000, 0x00003134); // IOS MEM2 high
Memory::Write_U32(0x00000012, 0x00003138); // Console type
Memory::Write_U32(0x38a00040, 0x00000060); // Exception init
Memory::Write_U32(0x8008f7b8, 0x000000e4); // Thread Init
Memory::Write_U32(Memory::REALRAM_SIZE, 0x000000f0); // "Simulated memory size" (debug mode?)
Memory::Write_U32(0x8179b500, 0x000000f4); // __start
Memory::Write_U32(0x0e7be2c0, 0x000000f8); // Bus speed
Memory::Write_U32(0x2B73A840, 0x000000fc); // CPU speed
Memory::Write_U16(0x0000, 0x000030e6); // Console type
Memory::Write_U32(0x00000000, 0x000030c0); // EXI
Memory::Write_U32(0x00000000, 0x000030c4); // EXI
Memory::Write_U32(0x00000000, 0x000030dc); // Time
Memory::Write_U32(0x00000000, 0x000030d8); // Time
Memory::Write_U16(0x8201, 0x000030e6); // Dev console / debug capable
Memory::Write_U32(0x00000000, 0x000030f0); // Apploader
Memory::Write_U32(0x01800000, 0x00003100); // BAT
Memory::Write_U32(0x01800000, 0x00003104); // BAT
Memory::Write_U32(0x00000000, 0x0000310c); // Init
Memory::Write_U32(0x8179d500, 0x00003110); // Init
Memory::Write_U32(0x04000000, 0x00003118); // Unknown
Memory::Write_U32(0x04000000, 0x0000311c); // BAT
Memory::Write_U32(0x93400000, 0x00003120); // BAT
Memory::Write_U32(0x90000800, 0x00003124); // Init - MEM2 low
Memory::Write_U32(0x93ae0000, 0x00003128); // Init - MEM2 high
Memory::Write_U32(0x93ae0000, 0x00003130); // IOS MEM2 low
Memory::Write_U32(0x93b00000, 0x00003134); // IOS MEM2 high
Memory::Write_U32(0x00000012, 0x00003138); // Console type
// 40 is copied from 88 after running apploader
Memory::Write_U32(0x00090204, 0x00003140); // IOS revision (IOS9, v2.4)
Memory::Write_U32(0x00062507, 0x00003144); // IOS date in USA format (June 25, 2007)
Memory::Write_U16(0x0113, 0x0000315e); // Apploader
Memory::Write_U32(0x0000FF16, 0x00003158); // DDR ram vendor code
Memory::Write_U32(0x00000000, 0x00003160); // Init semaphore (sysmenu waits for this to clear)
Memory::Write_U32(0x00090204, 0x00003188); // Expected IOS revision
Memory::Write_U32(0x00090204, 0x00003140); // IOS revision (IOS9, v2.4)
Memory::Write_U32(0x00062507, 0x00003144); // IOS date in USA format (June 25, 2007)
Memory::Write_U16(0x0113, 0x0000315e); // Apploader
Memory::Write_U32(0x0000FF16, 0x00003158); // DDR ram vendor code
Memory::Write_U32(0x00000000, 0x00003160); // Init semaphore (sysmenu waits for this to clear)
Memory::Write_U32(0x00090204, 0x00003188); // Expected IOS revision
Memory::Write_U8(0x80, 0x0000315c); // OSInit
Memory::Write_U16(0x0000, 0x000030e0); // PADInit
Memory::Write_U32(0x80000000, 0x00003184); // GameID Address
Memory::Write_U8(0x80, 0x0000315c); // OSInit
Memory::Write_U16(0x0000, 0x000030e0); // PADInit
Memory::Write_U32(0x80000000, 0x00003184); // GameID Address
// Fake the VI Init of the IPL
Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC);
@@ -321,13 +321,13 @@ bool CBoot::EmulatedBS2_Wii()
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);
m_MSR.FP = 1;
Memory::Write_U32(0x4c000064, 0x80000300); // write default DFI Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000800); // write default FPU Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000C00); // write default Syscall Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000300); // Write default DFI Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000800); // Write default FPU Handler: rfi
Memory::Write_U32(0x4c000064, 0x80000C00); // Write default Syscall Handler: rfi
HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader
HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader
PowerPC::ppcState.gpr[1] = 0x816ffff0; // StackPointer
PowerPC::ppcState.gpr[1] = 0x816ffff0; // StackPointer
u32 iAppLoaderOffset = 0x2440; // 0x1c40;
@@ -372,9 +372,9 @@ bool CBoot::EmulatedBS2_Wii()
RunFunction(iAppLoaderMain);
u32 iRamAddress = Memory::ReadUnchecked_U32(0x81300004);
u32 iLength = Memory::ReadUnchecked_U32(0x81300008);
u32 iDVDOffset = Memory::ReadUnchecked_U32(0x8130000c) << 2;
u32 iRamAddress = Memory::ReadUnchecked_U32(0x81300004);
u32 iLength = Memory::ReadUnchecked_U32(0x81300008);
u32 iDVDOffset = Memory::ReadUnchecked_U32(0x8130000c) << 2;
INFO_LOG(BOOT, "DVDRead: offset: %08x memOffset: %08x length: %i", iDVDOffset, iRamAddress, iLength);
DVDInterface::DVDRead(iDVDOffset, iRamAddress, iLength);
+1 -1
View File
@@ -66,7 +66,7 @@ public:
return GetPtr(segments[segment].p_offset);
}
u32 GetSectionAddr(SectionID section) const { return sectionAddrs[section]; }
int GetSectionSize(SectionID section) const { return sections[section].sh_size; }
int GetSectionSize(SectionID section) const { return sections[section].sh_size; }
SectionID GetSectionByName(const char *name, int firstSection = 0) const; //-1 for not found
bool DidRelocate() {
+3 -3
View File
@@ -259,7 +259,7 @@ void Stop() // - Hammertime!
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping Emu thread ...").c_str());
g_EmuThread.join(); // Wait for emuthread to close.
g_EmuThread.join(); // Wait for emuthread to close.
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Main Emu thread stopped").c_str());
@@ -678,7 +678,7 @@ void UpdateTitle()
float Speed = (float) (DrawnVideo * (100 * 1000.0) / (VideoInterface::TargetRefreshRate * ElapseTime));
// Settings are shown the same for both extended and summary info
std::string SSettings = StringFromFormat("%s %s | %s | %s", cpu_core_base->GetName(), _CoreParameter.bCPUThread ? "DC" : "SC",
std::string SSettings = StringFromFormat("%s %s | %s | %s", cpu_core_base->GetName(), _CoreParameter.bCPUThread ? "DC" : "SC",
g_video_backend->GetDisplayName().c_str(), _CoreParameter.bDSPHLE ? "HLE" : "LLE");
// Use extended or summary information. The summary information does not print the ticks data,
@@ -708,7 +708,7 @@ void UpdateTitle()
_CoreParameter.bSkipIdle ? "~" : "",
TicksPercentage);
#else // Summary information
#else // Summary information
std::string SFPS;
if (Movie::IsPlayingInput())
SFPS = StringFromFormat("VI: %u/%u - Frame: %u/%u - FPS: %.0f - VPS: %.0f - %.0f%%", (u32)Movie::g_currentFrame, (u32)Movie::g_totalFrames, (u32)Movie::g_currentInputCount, (u32)Movie::g_totalInputCount, FPS, VPS, Speed);
+3 -2
View File
@@ -97,7 +97,7 @@ void SCoreStartupParameter::LoadDefaults()
bJITOff = false; // debugger only settings
bJITLoadStoreOff = false;
bJITLoadStoreFloatingOff = false;
bJITLoadStorePairedOff = false; // XXX not 64-bit clean
bJITLoadStorePairedOff = false; // XXX not 64-bit clean
bJITFloatingPointOff = false;
bJITIntegerOff = false;
bJITPairedOff = false;
@@ -271,7 +271,8 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
delete pVolume;
}
else
{ // null pVolume means that we are loading from nand folder (Most Likely Wii Menu)
{
// null pVolume means that we are loading from nand folder (Most Likely Wii Menu)
// if this is the second boot we would be using the Name and id of the last title
m_strName.clear();
m_strUniqueID.clear();
+2 -2
View File
@@ -395,8 +395,8 @@ void Advance()
{
if (first->time <= globalTimer)
{
// LOG(POWERPC, "[Scheduler] %s (%lld, %lld) ",
// event_types[first->type].name ? event_types[first->type].name : "?", (u64)globalTimer, (u64)first->time);
//LOG(POWERPC, "[Scheduler] %s (%lld, %lld) ",
// event_types[first->type].name ? event_types[first->type].name : "?", (u64)globalTimer, (u64)first->time);
Event* evt = first;
first = first->next;
event_types[evt->type].callback(evt->userdata, (int)(globalTimer - evt->time));
+3 -3
View File
@@ -16,12 +16,12 @@
bool Assemble(const char *text, std::vector<u16> &code, bool force)
{
AssemblerSettings settings;
// settings.pc = 0;
// settings.pc = 0;
// settings.decode_registers = false;
// settings.decode_names = false;
settings.force = force;
// settings.print_tabs = false;
// settings.ext_separator = '\'';
// settings.print_tabs = false;
// settings.ext_separator = '\'';
// TODO: fix the terrible api of the assembler.
DSPAssembler assembler(settings);
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_interpreter.cpp
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+2 -2
View File
@@ -3,7 +3,7 @@
filename: DSPCore.h
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
@@ -168,7 +168,7 @@
#define SR_MUL_UNSIGNED 0x8000 // 0 = normal. 1 = unsigned (CLR15, SET15) If set, treats ax?.l as unsigned (MULX family only).
// This should be the bits affected by CMP. Does not include logic zero.
#define SR_CMP_MASK 0x3f
#define SR_CMP_MASK 0x3f
// exceptions vector
#define EXP_STOVF 1 // 0x0002 stack under/over flow
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_interface.h
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_interface.h
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: opcodes.h
project: GameCube DSP Tool (gcdsp)
created: 2005.03.04
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_opcodes_helper.h
project: GameCube DSP Tool (gcdsp)
created: 2005.03.04
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_interpreter.cpp
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_memory.cpp
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_memory.h
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_registers.cpp
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -3,7 +3,7 @@
filename: gdsp_registers.h
project: GCemu
created: 2004-6-18
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie & Tratax
+1 -1
View File
@@ -35,7 +35,7 @@ enum partype_t
P_REGM19 = P_REG | 0x1910, // used in multiply instructions
P_REG1A = P_REG | 0x1a80,
P_REG1C = P_REG | 0x1c00,
// P_ACC = P_REG | 0x1c10, // used for global accum (gcdsptool's value)
// P_ACC = P_REG | 0x1c10, // used for global accum (gcdsptool's value)
P_ACCL = P_REG | 0x1c00, // used for low part of accum
P_ACCM = P_REG | 0x1e00, // used for mid part of accum
// The following are not in gcdsptool
+2 -2
View File
@@ -832,7 +832,7 @@ void lsr16(const UDSPInstruction opc)
u8 areg = (opc >> 8) & 0x1;
u64 acc = dsp_get_long_acc(areg);
acc &= 0x000000FFFFFFFFFFULL; // Lop off the extraneous sign extension our 64-bit fake accum causes
acc &= 0x000000FFFFFFFFFFULL; // Lop off the extraneous sign extension our 64-bit fake accum causes
acc >>= 16;
zeroWriteBackLog();
@@ -887,7 +887,7 @@ void lsr(const UDSPInstruction opc)
u8 rreg = (opc >> 8) & 0x01;
u16 shift;
u64 acc = dsp_get_long_acc(rreg);
acc &= 0x000000FFFFFFFFFFULL; // Lop off the extraneous sign extension our 64-bit fake accum causes
acc &= 0x000000FFFFFFFFFFULL; // Lop off the extraneous sign extension our 64-bit fake accum causes
if ((opc & 0x3f) == 0)
shift = 0;
+4 -4
View File
@@ -3,7 +3,7 @@
$Id: assemble.cpp,v 1.3 2008-11-11 01:04:26 wntrmute Exp $
project: GameCube DSP Tool (gcdsp)
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
@@ -817,11 +817,11 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
if (c == 0x0a || c == 0x0d || c == ';')
c = 0x00;
if (c == 0x09) // tabs to spaces
if (c == 0x09) // tabs to spaces
c = ' ';
if (c == '"')
upper = !upper;
if (upper && c >= 'a' && c <= 'z') // convert to uppercase
if (upper && c >= 'a' && c <= 'z') // convert to uppercase
c = c - 'a' + 'A';
line[i] = c;
if (c == 0)
@@ -847,7 +847,7 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
if (valid)
{
label = std::string(line).substr(0, col_pos);
ptr += col_pos + 1;
ptr += col_pos + 1;
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
project: GameCube DSP Tool (gcdsp)
created: 2005.03.04
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
@@ -121,7 +121,7 @@ private:
LabelMap labels;
u32 code_line;
u32 code_line;
bool failed;
std::string last_error_str;
err_t last_error;
+2 -2
View File
@@ -3,7 +3,7 @@
filename: disassemble.cpp
project: GameCube DSP Tool (gcdsp)
created: 2005.03.04
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
@@ -221,7 +221,7 @@ bool DSPDisassembler::DisOpcode(const u16 *binbuf, int base_addr, int pass, u16
break;
}
}
const DSPOPCTemplate fake_op = {"CW", 0x0000, 0x0000, nop, NULL, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false, false, false, false, false};
const DSPOPCTemplate fake_op = {"CW", 0x0000, 0x0000, nop, NULL, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false, false, false, false, false};
if (!opc)
opc = &fake_op;
+1 -1
View File
@@ -2,7 +2,7 @@
project: GameCube DSP Tool (gcdsp)
created: 2005.03.04
mail: [email protected]
mail: [email protected]
Copyright (c) 2005 Duddie
+6 -6
View File
@@ -190,12 +190,12 @@ void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory &cpMe
case DIRECT:
switch (colComp[i])
{
case FORMAT_16B_565: size = 2; break;
case FORMAT_24B_888: size = 3; break;
case FORMAT_32B_888x: size = 4; break;
case FORMAT_16B_4444: size = 2; break;
case FORMAT_24B_6666: size = 3; break;
case FORMAT_32B_8888: size = 4; break;
case FORMAT_16B_565: size = 2; break;
case FORMAT_24B_888: size = 3; break;
case FORMAT_32B_888x: size = 4; break;
case FORMAT_16B_4444: size = 2; break;
case FORMAT_24B_6666: size = 3; break;
case FORMAT_32B_8888: size = 4; break;
default: _assert_(0); break;
}
break;
+3 -3
View File
@@ -309,8 +309,8 @@ void FifoPlayer::WriteFifo(u8 *data, u32 start, u32 end)
void FifoPlayer::SetupFifo()
{
WriteCP(0x02, 0); // disable read, BP, interrupts
WriteCP(0x04, 7); // clear overflow, underflow, metrics
WriteCP(0x02, 0); // disable read, BP, interrupts
WriteCP(0x04, 7); // clear overflow, underflow, metrics
const FifoFrameInfo& frame = m_File->GetFrame(m_CurrentFrame);
@@ -344,7 +344,7 @@ void FifoPlayer::SetupFifo()
FlushWGP();
WritePI(20, frame.fifoStart);
WriteCP(0x02, 17); // enable read & GP link
WriteCP(0x02, 17); // enable read & GP link
}
void FifoPlayer::LoadMemory()
+1 -1
View File
@@ -161,4 +161,4 @@ void RunCodeHandler()
}
}
} // namespace Gecko
} // namespace Gecko
+1 -1
View File
@@ -45,4 +45,4 @@ namespace Gecko
bool RunActiveCodes();
void RunCodeHandler();
} // namespace Gecko
} // namespace Gecko
+1 -1
View File
@@ -29,7 +29,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
if (line.empty())
continue;
std::istringstream ss(line);
std::istringstream ss(line);
switch ((line)[0])
{
+2 -2
View File
@@ -112,7 +112,7 @@ void PatchFunctions()
}
}
// CBreakPoints::AddBreakPoint(0x8000D3D0, false);
// CBreakPoints::AddBreakPoint(0x8000D3D0, false);
}
void Execute(u32 _CurrentPC, u32 _Instruction)
@@ -127,7 +127,7 @@ void Execute(u32 _CurrentPC, u32 _Instruction)
PanicAlert("HLE system tried to call an undefined HLE function %i.", FunctionIndex);
}
// _dbg_assert_msg_(HLE,NPC == LR, "Broken HLE function (doesn't set NPC)", OSPatches[pos].m_szPatchName);
// _dbg_assert_msg_(HLE,NPC == LR, "Broken HLE function (doesn't set NPC)", OSPatches[pos].m_szPatchName);
}
u32 GetFunctionIndex(u32 addr)
+1 -1
View File
@@ -332,7 +332,7 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples
{
frac &= 0xffff;
l1 = l2; //current
l1 = l2; //current
l2 = pcm[pos * 2]; //next
}
+9 -9
View File
@@ -376,15 +376,15 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
}
// Update DSP related flags
g_dspState.DSPControl.DSPReset = tmpControl.DSPReset;
g_dspState.DSPControl.DSPAssertInt = tmpControl.DSPAssertInt;
g_dspState.DSPControl.DSPHalt = tmpControl.DSPHalt;
g_dspState.DSPControl.DSPInit = tmpControl.DSPInit;
g_dspState.DSPControl.DSPReset = tmpControl.DSPReset;
g_dspState.DSPControl.DSPAssertInt = tmpControl.DSPAssertInt;
g_dspState.DSPControl.DSPHalt = tmpControl.DSPHalt;
g_dspState.DSPControl.DSPInit = tmpControl.DSPInit;
// Interrupt (mask)
g_dspState.DSPControl.AID_mask = tmpControl.AID_mask;
g_dspState.DSPControl.ARAM_mask = tmpControl.ARAM_mask;
g_dspState.DSPControl.DSP_mask = tmpControl.DSP_mask;
g_dspState.DSPControl.AID_mask = tmpControl.AID_mask;
g_dspState.DSPControl.ARAM_mask = tmpControl.ARAM_mask;
g_dspState.DSPControl.DSP_mask = tmpControl.DSP_mask;
// Interrupt
if (tmpControl.AID) g_dspState.DSPControl.AID = 0;
@@ -392,8 +392,8 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
if (tmpControl.DSP) g_dspState.DSPControl.DSP = 0;
// unknown
g_dspState.DSPControl.unk3 = tmpControl.unk3;
g_dspState.DSPControl.pad = tmpControl.pad;
g_dspState.DSPControl.unk3 = tmpControl.unk3;
g_dspState.DSPControl.pad = tmpControl.pad;
if (g_dspState.DSPControl.pad != 0)
{
PanicAlert("DSPInterface (w) g_dspState.DSPControl (CC00500A) gets a value with junk in the padding %08x", val);
@@ -34,7 +34,7 @@ CUCode_AX::~CUCode_AX()
{
if (m_run_on_thread)
{
m_cmdlist_size = (u16)-1; // Special value to signal end
m_cmdlist_size = (u16)-1; // Special value to signal end
NotifyAXThread();
m_axthread.join();
}
@@ -94,7 +94,7 @@ void CUCode_AX::AXThread()
m_cmdlist_cv.wait(lk);
}
if (m_cmdlist_size == (u16)-1) // End of thread signal
if (m_cmdlist_size == (u16)-1) // End of thread signal
break;
m_processing.lock();
@@ -202,7 +202,7 @@ void CUCode_AX::HandleCommandList()
SetMainLR(HILO_TO_32(addr));
break;
case CMD_UNK_08: curr_idx += 10; break; // TODO: check
case CMD_UNK_08: curr_idx += 10; break; // TODO: check
case CMD_MIX_AUXB_NOWRITE:
addr_hi = m_cmdlist[curr_idx++];
@@ -41,10 +41,10 @@ void CUCode_AXWii::HandleCommandList()
u32 pb_addr = 0;
// WARN_LOG(DSPHLE, "Command list:");
// for (u32 i = 0; m_cmdlist[i] != CMD_END; ++i)
// WARN_LOG(DSPHLE, "%04x", m_cmdlist[i]);
// WARN_LOG(DSPHLE, "-------------");
// WARN_LOG(DSPHLE, "Command list:");
// for (u32 i = 0; m_cmdlist[i] != CMD_END; ++i)
// WARN_LOG(DSPHLE, "%04x", m_cmdlist[i]);
// WARN_LOG(DSPHLE, "-------------");
u32 curr_idx = 0;
bool end = false;
@@ -65,7 +65,7 @@ protected:
void UploadAUXMixLRSC(int aux_id, u32* addresses, u16 volume);
void OutputSamples(u32 lr_addr, u32 surround_addr, u16 volume,
bool upload_auxc);
void OutputWMSamples(u32* addresses); // 4 addresses
void OutputWMSamples(u32* addresses); // 4 addresses
private:
enum CmdType
@@ -193,7 +193,7 @@ u16 AcceleratorGetSample()
switch (acc_pb->audio_addr.sample_format)
{
case 0x00: // ADPCM
case 0x00: // ADPCM
{
// ADPCM decoding, not much to explain here.
if ((*acc_cur_addr & 15) == 0)
@@ -225,14 +225,14 @@ u16 AcceleratorGetSample()
break;
}
case 0x0A: // 16-bit PCM audio
case 0x0A: // 16-bit PCM audio
ret = (DSP::ReadARAM(*acc_cur_addr * 2) << 8) | DSP::ReadARAM(*acc_cur_addr * 2 + 1);
acc_pb->adpcm.yn2 = acc_pb->adpcm.yn1;
acc_pb->adpcm.yn1 = ret;
*acc_cur_addr += 1;
break;
case 0x19: // 8-bit PCM audio
case 0x19: // 8-bit PCM audio
ret = DSP::ReadARAM(*acc_cur_addr) << 8;
acc_pb->adpcm.yn2 = acc_pb->adpcm.yn1;
acc_pb->adpcm.yn1 = ret;
@@ -126,7 +126,7 @@ void CUCode_Zelda::HandleMail(u32 _uMail)
void CUCode_Zelda::HandleMail_LightVersion(u32 _uMail)
{
//ERROR_LOG(DSPHLE, "Light version mail %08X, list in progress: %s, step: %i/%i",
// _uMail, m_bListInProgress ? "yes":"no", m_step, m_numSteps);
// _uMail, m_bListInProgress ? "yes":"no", m_step, m_numSteps);
if (m_bSyncCmdPending)
{
@@ -199,11 +199,11 @@ void CUCode_Zelda::HandleMail_SMSVersion(u32 _uMail)
if (m_CurBuffer == m_NumBuffers)
{
m_rMailHandler.PushMail(DSP_FRAME_END);
// DSP::GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP);
// DSP::GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP);
soundStream->GetMixer()->SetHLEReady(true);
DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync");
// soundStream->Update(); //do it in this thread to avoid sync problems
// soundStream->Update(); //do it in this thread to avoid sync problems
m_bSyncCmdPending = false;
}
@@ -333,7 +333,7 @@ void CUCode_Zelda::HandleMail_NormalVersion(u32 _uMail)
soundStream->GetMixer()->SetHLEReady(true);
DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync");
// soundStream->Update(); //do it in this thread to avoid sync problems
// soundStream->Update(); //do it in this thread to avoid sync problems
m_bSyncCmdPending = false;
}
@@ -487,9 +487,9 @@ void CUCode_Zelda::RenderAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _Righ
}
// XK: Use this to disable MIDI music (GREAT for testing). Also kills some sound FX.
//if(PB.SoundType == 0x0d00) {
// PB.NeedsReset = 0;
// return;
//if (PB.SoundType == 0x0d00) {
// PB.NeedsReset = 0;
// return;
//}
// The Resample calls actually don't resample yet.
@@ -500,18 +500,18 @@ void CUCode_Zelda::RenderAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _Righ
// First jump table at ZWW: 2a6
switch (PB.Format)
{
case 0x0005: // AFC with extra low bitrate (32:5 compression).
case 0x0009: // AFC with normal bitrate (32:9 compression).
case 0x0005: // AFC with extra low bitrate (32:5 compression).
case 0x0009: // AFC with normal bitrate (32:9 compression).
RenderVoice_AFC(PB, m_ResampleBuffer + 4, _Size);
Resample(PB, _Size, m_ResampleBuffer + 4, m_VoiceBuffer, true);
break;
case 0x0008: // PCM8 - normal PCM 8-bit audio. Used in Mario Kart DD + very little in Zelda WW.
case 0x0008: // PCM8 - normal PCM 8-bit audio. Used in Mario Kart DD + very little in Zelda WW.
RenderVoice_PCM8(PB, m_ResampleBuffer + 4, _Size);
Resample(PB, _Size, m_ResampleBuffer + 4, m_VoiceBuffer, true);
break;
case 0x0010: // PCM16 - normal PCM 16-bit audio.
case 0x0010: // PCM16 - normal PCM 16-bit audio.
RenderVoice_PCM16(PB, m_ResampleBuffer + 4, _Size);
Resample(PB, _Size, m_ResampleBuffer + 4, m_VoiceBuffer, true);
break;
@@ -535,10 +535,10 @@ void CUCode_Zelda::RenderAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _Righ
default:
// Second jump table
// TODO: Cases to find examples of:
// -0x0002
// -0x0003
// -0x0006
// -0x000a
// -0x0002
// -0x0003
// -0x0006
// -0x000a
switch (PB.Format)
{
// Synthesized sounds
@@ -547,8 +547,7 @@ void CUCode_Zelda::RenderAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _Righ
RenderSynth_RectWave(PB, m_VoiceBuffer, _Size);
break;
case 0x0001: // Example: "Denied" sound when trying to pull out a sword
// indoors in ZWW
case 0x0001: // Example: "Denied" sound when trying to pull out a sword indoors in ZWW
RenderSynth_SawWave(PB, m_VoiceBuffer, _Size);
break;
+1 -1
View File
@@ -9,7 +9,7 @@
// TODO: Get rid of this file.
#define PROFILE 0
#define PROFILE 0
#if PROFILE
void ProfilerDump(u64 _count);
+28 -28
View File
@@ -87,7 +87,7 @@ union UDICVR
u32 Hex;
struct
{
u32 CVR : 1; // 0: Cover closed 1: Cover open
u32 CVR : 1; // 0: Cover closed 1: Cover open
u32 CVRINTMASK : 1; // 1: Interrupt enabled
u32 CVRINT : 1; // r 1: Interrupt requested w 1: Interrupt clear
u32 : 29;
@@ -249,17 +249,17 @@ void TransferComplete(u64 userdata, int cyclesLate)
void Init()
{
m_DISR.Hex = 0;
m_DICVR.Hex = 0;
m_DICMDBUF[0].Hex= 0;
m_DICMDBUF[1].Hex= 0;
m_DICMDBUF[2].Hex= 0;
m_DIMAR.Hex = 0;
m_DILENGTH.Hex = 0;
m_DICR.Hex = 0;
m_DIIMMBUF.Hex = 0;
m_DICFG.Hex = 0;
m_DICFG.CONFIG = 1; // Disable bootrom descrambler
m_DISR.Hex = 0;
m_DICVR.Hex = 0;
m_DICMDBUF[0].Hex = 0;
m_DICMDBUF[1].Hex = 0;
m_DICMDBUF[2].Hex = 0;
m_DIMAR.Hex = 0;
m_DILENGTH.Hex = 0;
m_DICR.Hex = 0;
m_DIIMMBUF.Hex = 0;
m_DICFG.Hex = 0;
m_DICFG.CONFIG = 1; // Disable bootrom descrambler
AudioPos = 0;
LoopStart = 0;
@@ -412,10 +412,10 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
MMIO::ComplexWrite<u32>([](u32, u32 val) {
UDISR tmpStatusReg(val);
m_DISR.DEINITMASK = tmpStatusReg.DEINITMASK;
m_DISR.TCINTMASK = tmpStatusReg.TCINTMASK;
m_DISR.BRKINTMASK = tmpStatusReg.BRKINTMASK;
m_DISR.BREAK = tmpStatusReg.BREAK;
m_DISR.DEINITMASK = tmpStatusReg.DEINITMASK;
m_DISR.TCINTMASK = tmpStatusReg.TCINTMASK;
m_DISR.BRKINTMASK = tmpStatusReg.BRKINTMASK;
m_DISR.BREAK = tmpStatusReg.BREAK;
if (tmpStatusReg.DEINT)
m_DISR.DEINT = 0;
@@ -503,10 +503,10 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
void UpdateInterrupts()
{
if ((m_DISR.DEINT & m_DISR.DEINITMASK) ||
(m_DISR.TCINT & m_DISR.TCINTMASK) ||
(m_DISR.BRKINT & m_DISR.BRKINTMASK) ||
(m_DICVR.CVRINT & m_DICVR.CVRINTMASK))
if ((m_DISR.DEINT & m_DISR.DEINITMASK) ||
(m_DISR.TCINT & m_DISR.TCINTMASK) ||
(m_DISR.BRKINT & m_DISR.BRKINTMASK) ||
(m_DICVR.CVRINT & m_DICVR.CVRINTMASK))
{
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_DI, true);
}
@@ -523,10 +523,10 @@ void GenerateDIInterrupt(DI_InterruptType _DVDInterrupt)
{
switch(_DVDInterrupt)
{
case INT_DEINT: m_DISR.DEINT = 1; break;
case INT_TCINT: m_DISR.TCINT = 1; break;
case INT_BRKINT: m_DISR.BRKINT = 1; break;
case INT_CVRINT: m_DICVR.CVRINT = 1; break;
case INT_DEINT: m_DISR.DEINT = 1; break;
case INT_TCINT: m_DISR.TCINT = 1; break;
case INT_BRKINT: m_DISR.BRKINT = 1; break;
case INT_CVRINT: m_DICVR.CVRINT = 1; break;
}
UpdateInterrupts();
@@ -534,7 +534,7 @@ void GenerateDIInterrupt(DI_InterruptType _DVDInterrupt)
void ExecuteCommand(UDICR& _DICR)
{
// _dbg_assert_(DVDINTERFACE, _DICR.RW == 0); // only DVD to Memory
// _dbg_assert_(DVDINTERFACE, _DICR.RW == 0); // only DVD to Memory
int GCAM = ((SConfig::GetInstance().m_SIDevice[0] == SIDEVICE_AM_BASEBOARD)
&& (SConfig::GetInstance().m_EXIDevice[2] == EXIDEVICE_AM_BASEBOARD))
? 1 : 0;
@@ -825,9 +825,9 @@ void ExecuteCommand(UDICR& _DICR)
break;
// Audio Stream (Immediate)
// m_DICMDBUF[0].CMDBYTE1 = subcommand
// m_DICMDBUF[1].Hex << 2 = offset on disc
// m_DICMDBUF[2].Hex = Length of the stream
// m_DICMDBUF[0].CMDBYTE1 = Subcommand
// m_DICMDBUF[1].Hex << 2 = Offset on disc
// m_DICMDBUF[2].Hex = Length of the stream
case 0xE1:
{
u32 pos = m_DICMDBUF[1].Hex << 2;
+7 -7
View File
@@ -29,15 +29,15 @@ void Init()
g_Channels[i] = new CEXIChannel(i);
if (Movie::IsPlayingInput() && Movie::IsUsingMemcard() && Movie::IsConfigSaved())
g_Channels[0]->AddDevice(EXIDEVICE_MEMORYCARD, 0); // SlotA
g_Channels[0]->AddDevice(EXIDEVICE_MEMORYCARD, 0); // SlotA
else if(Movie::IsPlayingInput() && !Movie::IsUsingMemcard() && Movie::IsConfigSaved())
g_Channels[0]->AddDevice(EXIDEVICE_NONE, 0); // SlotA
g_Channels[0]->AddDevice(EXIDEVICE_NONE, 0); // SlotA
else
g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[0], 0); // SlotA
g_Channels[0]->AddDevice(EXIDEVICE_MASKROM, 1);
g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[2], 2); // Serial Port 1
g_Channels[1]->AddDevice(SConfig::GetInstance().m_EXIDevice[1], 0); // SlotB
g_Channels[2]->AddDevice(EXIDEVICE_AD16, 0);
g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[0], 0); // SlotA
g_Channels[0]->AddDevice(EXIDEVICE_MASKROM, 1);
g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[2], 2); // Serial Port 1
g_Channels[1]->AddDevice(SConfig::GetInstance().m_EXIDevice[1], 0); // SlotB
g_Channels[2]->AddDevice(EXIDEVICE_AD16, 0);
changeDevice = CoreTiming::RegisterEvent("ChangeEXIDevice", ChangeDeviceCallback);
}
+2 -2
View File
@@ -43,7 +43,7 @@ u32 IEXIDevice::ImmRead(u32 _uSize)
void IEXIDevice::DMAWrite(u32 _uAddr, u32 _uSize)
{
// _dbg_assert_(EXPANSIONINTERFACE, 0);
// _dbg_assert_(EXPANSIONINTERFACE, 0);
while (_uSize--)
{
u8 uByte = Memory::Read_U8(_uAddr++);
@@ -53,7 +53,7 @@ void IEXIDevice::DMAWrite(u32 _uAddr, u32 _uSize)
void IEXIDevice::DMARead(u32 _uAddr, u32 _uSize)
{
// _dbg_assert_(EXPANSIONINTERFACE, 0);
// _dbg_assert_(EXPANSIONINTERFACE, 0);
while (_uSize--)
{
u8 uByte = 0;
+1 -1
View File
@@ -136,7 +136,7 @@ void GeckoSockServer::ClientThread()
if (client.Send(&packet[0], packet.size()) == sf::Socket::Disconnected)
client_running = false;
}
} // unlock transfer
} // unlock transfer
if (did_nothing)
Common::YieldCPU();
+1 -1
View File
@@ -179,7 +179,7 @@ void CEXIMic::SetCS(int cs)
void CEXIMic::UpdateNextInterruptTicks()
{
next_int_ticks = CoreTiming::GetTicks() +
(SystemTimers::GetTicksPerSecond() / sample_rate) * buff_size_samples;
(SystemTimers::GetTicksPerSecond() / sample_rate) * buff_size_samples;
}
bool CEXIMic::IsInterruptSet()
+4 -3
View File
@@ -824,7 +824,7 @@ u32 GCMemcard::ImportGciInternal(FILE* gcih, const char *inputFile, const std::s
gci.ReadBytes(tmp, 0xD);
if (!strcasecmp(fileType.c_str(), ".gcs"))
{
if (!memcmp(tmp, "GCSAVE", 6)) // Header must be uppercase
if (!memcmp(tmp, "GCSAVE", 6)) // Header must be uppercase
offset = GCS;
else
return GCSFAIL;
@@ -988,7 +988,8 @@ void GCMemcard::Gcs_SavConvert(DEntry &tempDEntry, int saveType, int length)
switch(saveType)
{
case GCS:
{ // field containing the Block count as displayed within
{
// field containing the Block count as displayed within
// the GameSaves software is not stored in the GCS file.
// It is stored only within the corresponding GSV file.
// If the GCS file is added without using the GameSaves software,
@@ -1269,7 +1270,7 @@ void GCMemcard::FormatInternal(GCMC_Header &GCP)
p_hdr->SramBias = g_SRAM.counter_bias;
p_hdr->SramLang = g_SRAM.lang;
// TODO: determine the purpose of Unk2 1 works for slot A, 0 works for both slot A and slot B
*(u32*)&p_hdr->Unk2 = 0; // = _viReg[55]; static vu16* const _viReg = (u16*)0xCC002000;
*(u32*)&p_hdr->Unk2 = 0; // = _viReg[55]; static vu16* const _viReg = (u16*)0xCC002000;
*(u16*)&p_hdr->deviceID = 0;
calc_checksumsBE((u16*)p_hdr, 0xFE, &p_hdr->Checksum, &p_hdr->Checksum_Inv);
+3 -3
View File
@@ -53,7 +53,7 @@ bool bMMU = false;
// Init() declarations
// ----------------
// Store the MemArena here
u8* base = NULL;
u8* base = NULL;
// The MemArena class
MemArena g_arena;
@@ -127,7 +127,7 @@ static const MemoryView views[] =
// Don't map any memory for the EFB. We want all access to this area to go
// through the hardware access handlers.
#ifndef _M_X64
// {&m_pEFB, &m_pVirtualEFB, 0xC8000000, EFB_SIZE, 0},
// {&m_pEFB, &m_pVirtualEFB, 0xC8000000, EFB_SIZE, 0},
#endif
{&m_pL1Cache, &m_pVirtualL1Cache, 0xE0000000, L1_CACHE_SIZE, 0},
@@ -166,7 +166,7 @@ void DoState(PointerWrap &p)
{
bool wii = SConfig::GetInstance().m_LocalCoreStartupParameter.bWii;
p.DoArray(m_pPhysicalRAM, RAM_SIZE);
// p.DoArray(m_pVirtualEFB, EFB_SIZE);
//p.DoArray(m_pVirtualEFB, EFB_SIZE);
p.DoArray(m_pVirtualL1Cache, L1_CACHE_SIZE);
p.DoMarker("Memory RAM");
if (bFakeVMEM)
+34 -33
View File
@@ -35,15 +35,15 @@ namespace Memory
// EFB RE
/*
GXPeekZ
80322de8: rlwinm r0, r3, 2, 14, 29 (0003fffc) a = x << 2 & 0x3fffc
80322dec: oris r0, r0, 0xC800 a |= 0xc8000000
80322df0: rlwinm r3, r0, 0, 20, 9 (ffc00fff) x = a & 0xffc00fff
80322df4: rlwinm r0, r4, 12, 4, 19 (0ffff000) a = (y << 12) & 0x0ffff000;
80322df8: or r0, r3, r0 a |= x;
80322dfc: rlwinm r0, r0, 0, 10, 7 (ff3fffff) a &= 0xff3fffff
80322e00: oris r3, r0, 0x0040 x = a | 0x00400000
80322e04: lwz r0, 0 (r3) r0 = *r3
80322e08: stw r0, 0 (r5) z =
80322de8: rlwinm r0, r3, 2, 14, 29 (0003fffc) a = x << 2 & 0x3fffc
80322dec: oris r0, r0, 0xC800 a |= 0xc8000000
80322df0: rlwinm r3, r0, 0, 20, 9 (ffc00fff) x = a & 0xffc00fff
80322df4: rlwinm r0, r4, 12, 4, 19 (0ffff000) a = (y << 12) & 0x0ffff000;
80322df8: or r0, r3, r0 a |= x;
80322dfc: rlwinm r0, r0, 0, 10, 7 (ff3fffff) a &= 0xff3fffff
80322e00: oris r3, r0, 0x0040 x = a | 0x00400000
80322e04: lwz r0, 0 (r3) r0 = *r3
80322e08: stw r0, 0 (r5) z =
80322e0c: blr
*/
@@ -148,11 +148,12 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
// reason we end up in this function:
if (em_address == 0xCC008000)
{
switch (sizeof(T)) {
case 1: GPFifo::Write8((u8)data, em_address); return;
case 2: GPFifo::Write16((u16)data, em_address); return;
case 4: GPFifo::Write32((u32)data, em_address); return;
case 8: GPFifo::Write64((u64)data, em_address); return;
switch (sizeof(T))
{
case 1: GPFifo::Write8((u8)data, em_address); return;
case 2: GPFifo::Write16((u16)data, em_address); return;
case 4: GPFifo::Write32((u32)data, em_address); return;
case 8: GPFifo::Write64((u64)data, em_address); return;
}
}
if ((em_address & 0xC8000000) == 0xC8000000)
@@ -466,23 +467,23 @@ void WriteUnchecked_U32(const u32 _iValue, const u32 _Address)
// *********************************************************************************
/*
* PearPC
* ppc_mmu.cc
* PearPC
* ppc_mmu.cc
*
* Copyright (C) 2003, 2004 Sebastian Biallas ([email protected])
* Copyright (C) 2003, 2004 Sebastian Biallas ([email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 for more details.
* 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 for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
@@ -503,8 +504,8 @@ void WriteUnchecked_U32(const u32 _iValue, const u32 _Address)
#define EA_SR(v) (((v)>>28)&0xf)
#define EA_PageIndex(v) (((v)>>12)&0xffff)
#define EA_Offset(v) ((v)&0xfff)
#define EA_API(v) (((v)>>22)&0x3f)
#define EA_Offset(v) ((v)&0xfff)
#define EA_API(v) (((v)>>22)&0x3f)
#define PA_RPN(v) (((v)>>12)&0xfffff)
#define PA_Offset(v) ((v)&0xfff)
@@ -759,10 +760,10 @@ u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag)
u32 sr = PowerPC::ppcState.sr[EA_SR(_Address)];
u32 offset = EA_Offset(_Address); // 12 bit
u32 page_index = EA_PageIndex(_Address); // 16 bit
u32 VSID = SR_VSID(sr); // 24 bit
u32 api = EA_API(_Address); // 6 bit (part of page_index)
u32 offset = EA_Offset(_Address); // 12 bit
u32 page_index = EA_PageIndex(_Address); // 16 bit
u32 VSID = SR_VSID(sr); // 24 bit
u32 api = EA_API(_Address); // 6 bit (part of page_index)
u8* pRAM = GetPointer(0);
+12 -12
View File
@@ -98,10 +98,10 @@ union USIChannelIn_Lo
// SI Channel
struct SSIChannel
{
USIChannelOut m_Out;
USIChannelOut m_Out;
USIChannelIn_Hi m_InHi;
USIChannelIn_Lo m_InLo;
ISIDevice* m_pDevice;
ISIDevice* m_pDevice;
};
// SI Poll: Controls how often a device is polled
@@ -333,19 +333,19 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
MMIO::ComplexWrite<u32>([](u32, u32 val) {
USIComCSR tmpComCSR(val);
g_ComCSR.CHANNEL = tmpComCSR.CHANNEL;
g_ComCSR.INLNGTH = tmpComCSR.INLNGTH;
g_ComCSR.OUTLNGTH = tmpComCSR.OUTLNGTH;
g_ComCSR.CHANNEL = tmpComCSR.CHANNEL;
g_ComCSR.INLNGTH = tmpComCSR.INLNGTH;
g_ComCSR.OUTLNGTH = tmpComCSR.OUTLNGTH;
g_ComCSR.RDSTINTMSK = tmpComCSR.RDSTINTMSK;
g_ComCSR.TCINTMSK = tmpComCSR.TCINTMSK;
g_ComCSR.TCINTMSK = tmpComCSR.TCINTMSK;
g_ComCSR.COMERR = 0;
g_ComCSR.COMERR = 0;
if (tmpComCSR.RDSTINT) g_ComCSR.RDSTINT = 0;
if (tmpComCSR.TCINT) g_ComCSR.TCINT = 0;
if (tmpComCSR.RDSTINT) g_ComCSR.RDSTINT = 0;
if (tmpComCSR.TCINT) g_ComCSR.TCINT = 0;
// be careful: run si-buffer after updating the INT flags
if (tmpComCSR.TSTART) RunSIBuffer();
if (tmpComCSR.TSTART) RunSIBuffer();
UpdateInterrupts();
})
);
@@ -424,8 +424,8 @@ void GenerateSIInterrupt(SIInterruptType _SIInterrupt)
{
switch(_SIInterrupt)
{
case INT_RDSTINT: g_ComCSR.RDSTINT = 1; break;
case INT_TCINT: g_ComCSR.TCINT = 1; break;
case INT_RDSTINT: g_ComCSR.RDSTINT = 1; break;
case INT_TCINT: g_ComCSR.TCINT = 1; break;
}
UpdateInterrupts();
+1 -1
View File
@@ -41,7 +41,7 @@ SRAM sram_dump_german = {{
0x00,
0x01,
0x3C,
0x12, 0xD5, 0xEA, 0xD3, 0x00, 0xFA, 0x2D, 0x33, 0x13, 0x41, 0x26, 0x03,
0x12, 0xD5, 0xEA, 0xD3, 0x00, 0xFA, 0x2D, 0x33, 0x13, 0x41, 0x26, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
+3 -3
View File
@@ -20,15 +20,15 @@ Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
3. This notice may not be removed or altered from any source
distribution.
+1 -1
View File
@@ -115,7 +115,7 @@ int et_CP;
int et_AudioDMA;
int et_DSP;
int et_IPC_HLE;
int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default
int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default
int et_Throttle;
// These are badly educated guesses
+7 -6
View File
@@ -7,7 +7,8 @@
#include "../InputCommon/InputConfig.h"
#include "ChunkFile.h"
enum {
enum
{
WIIMOTE_CHAN_0 = 0,
WIIMOTE_CHAN_1,
WIIMOTE_CHAN_2,
@@ -18,14 +19,14 @@ enum {
};
#define WIIMOTE_INI_NAME "WiimoteNew"
#define WIIMOTE_INI_NAME "WiimoteNew"
enum
{
WIIMOTE_SRC_NONE = 0,
WIIMOTE_SRC_EMU = 1,
WIIMOTE_SRC_REAL = 2,
WIIMOTE_SRC_HYBRID = 3, // emu + real
WIIMOTE_SRC_NONE = 0,
WIIMOTE_SRC_EMU = 1,
WIIMOTE_SRC_REAL = 2,
WIIMOTE_SRC_HYBRID = 3, // emu + real
};
extern unsigned int g_wiimote_sources[MAX_BBMOTES];
@@ -9,9 +9,9 @@ namespace WiimoteEmu
// Extension device IDs to be written to the last bytes of the extension reg
// The id for nothing inserted
static const u8 nothing_id[] = { 0x00, 0x00, 0x00, 0x00, 0x2e, 0x2e };
static const u8 nothing_id[] = { 0x00, 0x00, 0x00, 0x00, 0x2e, 0x2e };
// The id for a partially inserted extension
static const u8 partially_id[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
static const u8 partially_id[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
Attachment::Attachment( const char* const _name, WiimoteEmu::ExtensionReg& _reg )
: name( _name ), reg( _reg )
@@ -8,7 +8,7 @@
namespace WiimoteEmu
{
static const u8 guitar_id[] = { 0x00, 0x00, 0xa4, 0x20, 0x01, 0x03 };
static const u8 guitar_id[] = { 0x00, 0x00, 0xa4, 0x20, 0x01, 0x03 };
static const u16 guitar_fret_bitmasks[] =
{
@@ -82,7 +82,7 @@ void Guitar::GetState(u8* const data, const bool focus)
}
// TODO: touch bar, probably not
gdata->tb = 0x0F; // not touched
gdata->tb = 0x0F; // not touched
// whammy bar
u8 whammy;
@@ -358,27 +358,27 @@ void Spy(Wiimote* wm_, const void* data_, size_t size_)
//if(((((u8*)&wm->m_reg_ext)[0xf0] == 0xaa) || ((u8*)&wm->m_reg_motion_plus)[0xf0] == 0xaa) && rdr->address>>8 < 0xf0) {
//if(!wm->GetMotionPlusActive() && ((u8*)&wm->m_reg_ext)[0xf0] == 0xaa && rdr->address>>8 < 0xf0) {
//if(!wm->GetMotionPlusActive() && ((u8*)&wm->m_reg_ext)[0xf0] == 0xaa) {
// SWARN_LOG(CONSOLE, "key %s", ArrayToString(((u8*)&wm->m_ext_key), sizeof(wm->m_ext_key), 0, 30).c_str());
// SWARN_LOG(CONSOLE, "decrypt %s", ArrayToString(rdr->data, rdr->size+1, 0, 30).c_str());
// wiimote_decrypt(&wm->m_ext_key, rdr->data, dataReply[2]&0xffff, rdr->size+1);
// SWARN_LOG(CONSOLE, "decrypt %s", ArrayToString(rdr->data, rdr->size+1, 0, 30).c_str());
// decrypted = true;
// SWARN_LOG(CONSOLE, "key %s", ArrayToString(((u8*)&wm->m_ext_key), sizeof(wm->m_ext_key), 0, 30).c_str());
// SWARN_LOG(CONSOLE, "decrypt %s", ArrayToString(rdr->data, rdr->size+1, 0, 30).c_str());
// wiimote_decrypt(&wm->m_ext_key, rdr->data, dataReply[2]&0xffff, rdr->size+1);
// SWARN_LOG(CONSOLE, "decrypt %s", ArrayToString(rdr->data, rdr->size+1, 0, 30).c_str());
// decrypted = true;
//}
// save data
if (!emu && !rdr->error)
{
//if (dataReply[1] == 0xa4 && wm->GetMotionPlusActive())
//memcpy(&((u8*)&wm->m_reg_motion_plus)[rdr->address>>8], rdr->data, rdr->size+1);
// memcpy(&((u8*)&wm->m_reg_motion_plus)[rdr->address>>8], rdr->data, rdr->size+1);
//if (dataReply[1] == 0xa4 && !wm->GetMotionPlusActive())
//if (dataReply[1] == 0xa4)
// memcpy(&((u8*)&wm->m_reg_ext)[rdr->address>>8], rdr->data, rdr->size+1);
// memcpy(&((u8*)&wm->m_reg_ext)[rdr->address>>8], rdr->data, rdr->size+1);
//if (!wm->GetMotionPlusActive() && wm->GetMotionPlusAttached())
//if (dataReply[1] == 0xa6)
// memcpy(&((u8*)&wm->m_reg_motion_plus)[rdr->address>>8], rdr->data, rdr->size+1);
// memcpy(&((u8*)&wm->m_reg_motion_plus)[rdr->address>>8], rdr->data, rdr->size+1);
//INFO_LOG(CONSOLE, "Saving[0x%2x:0x%2x]: %s", dataReply[1], rdr->address>>8, ArrayToString(rdr->data, rdr->size+1).c_str());
}
@@ -395,39 +395,41 @@ void Spy(Wiimote* wm_, const void* data_, size_t size_)
// decrypt
//if(((u8*)&wm->m_reg_ext)[0xf0] == 0xaa) {
// wiimote_decrypt(&wm->m_ext_key, &data[0x07], 0x00, (data[4] >> 0x04) + 1);
// wiimote_decrypt(&wm->m_ext_key, &data[0x07], 0x00, (data[4] >> 0x04) + 1);
//if (wm->m_extension->name == "NUNCHUCK") {
// INFO_LOG(CONSOLE, "\nGame got the Nunchuck calibration:\n");
// INFO_LOG(CONSOLE, "Cal_zero.x: %i\n", data[7 + 0]);
// INFO_LOG(CONSOLE, "Cal_zero.y: %i\n", data[7 + 1]);
// INFO_LOG(CONSOLE, "Cal_zero.z: %i\n", data[7 + 2]);
// INFO_LOG(CONSOLE, "Cal_g.x: %i\n", data[7 + 4]);
// INFO_LOG(CONSOLE, "Cal_g.y: %i\n", data[7 + 5]);
// INFO_LOG(CONSOLE, "Cal_g.z: %i\n", data[7 + 6]);
// INFO_LOG(CONSOLE, "Js.Max.x: %i\n", data[7 + 8]);
// INFO_LOG(CONSOLE, "Js.Min.x: %i\n", data[7 + 9]);
// INFO_LOG(CONSOLE, "Js.Center.x: %i\n", data[7 + 10]);
// INFO_LOG(CONSOLE, "Js.Max.y: %i\n", data[7 + 11]);
// INFO_LOG(CONSOLE, "Js.Min.y: %i\n", data[7 + 12]);
// INFO_LOG(CONSOLE, "JS.Center.y: %i\n\n", data[7 + 13]);
//if (wm->m_extension->name == "NUNCHUCK")
//{
// INFO_LOG(CONSOLE, "\nGame got the Nunchuck calibration:\n");
// INFO_LOG(CONSOLE, "Cal_zero.x: %i\n", data[7 + 0]);
// INFO_LOG(CONSOLE, "Cal_zero.y: %i\n", data[7 + 1]);
// INFO_LOG(CONSOLE, "Cal_zero.z: %i\n", data[7 + 2]);
// INFO_LOG(CONSOLE, "Cal_g.x: %i\n", data[7 + 4]);
// INFO_LOG(CONSOLE, "Cal_g.y: %i\n", data[7 + 5]);
// INFO_LOG(CONSOLE, "Cal_g.z: %i\n", data[7 + 6]);
// INFO_LOG(CONSOLE, "Js.Max.x: %i\n", data[7 + 8]);
// INFO_LOG(CONSOLE, "Js.Min.x: %i\n", data[7 + 9]);
// INFO_LOG(CONSOLE, "Js.Center.x: %i\n", data[7 + 10]);
// INFO_LOG(CONSOLE, "Js.Max.y: %i\n", data[7 + 11]);
// INFO_LOG(CONSOLE, "Js.Min.y: %i\n", data[7 + 12]);
// INFO_LOG(CONSOLE, "JS.Center.y: %i\n\n", data[7 + 13]);
//}
//else // g_Config.bClassicControllerConnected {
// INFO_LOG(CONSOLE, "\nGame got the Classic Controller calibration:\n");
// INFO_LOG(CONSOLE, "Lx.Max: %i\n", data[7 + 0]);
// INFO_LOG(CONSOLE, "Lx.Min: %i\n", data[7 + 1]);
// INFO_LOG(CONSOLE, "Lx.Center: %i\n", data[7 + 2]);
// INFO_LOG(CONSOLE, "Ly.Max: %i\n", data[7 + 3]);
// INFO_LOG(CONSOLE, "Ly.Min: %i\n", data[7 + 4]);
// INFO_LOG(CONSOLE, "Ly.Center: %i\n", data[7 + 5]);
// INFO_LOG(CONSOLE, "Rx.Max.x: %i\n", data[7 + 6]);
// INFO_LOG(CONSOLE, "Rx.Min.x: %i\n", data[7 + 7]);
// INFO_LOG(CONSOLE, "Rx.Center.x: %i\n", data[7 + 8]);
// INFO_LOG(CONSOLE, "Ry.Max.y: %i\n", data[7 + 9]);
// INFO_LOG(CONSOLE, "Ry.Min: %i\n", data[7 + 10]);
// INFO_LOG(CONSOLE, "Ry.Center: %i\n\n", data[7 + 11]);
// INFO_LOG(CONSOLE, "Lt.Neutral: %i\n", data[7 + 12]);
// INFO_LOG(CONSOLE, "Rt.Neutral %i\n\n", data[7 + 13]);
//else // g_Config.bClassicControllerConnected
//{
// INFO_LOG(CONSOLE, "\nGame got the Classic Controller calibration:\n");
// INFO_LOG(CONSOLE, "Lx.Max: %i\n", data[7 + 0]);
// INFO_LOG(CONSOLE, "Lx.Min: %i\n", data[7 + 1]);
// INFO_LOG(CONSOLE, "Lx.Center: %i\n", data[7 + 2]);
// INFO_LOG(CONSOLE, "Ly.Max: %i\n", data[7 + 3]);
// INFO_LOG(CONSOLE, "Ly.Min: %i\n", data[7 + 4]);
// INFO_LOG(CONSOLE, "Ly.Center: %i\n", data[7 + 5]);
// INFO_LOG(CONSOLE, "Rx.Max.x: %i\n", data[7 + 6]);
// INFO_LOG(CONSOLE, "Rx.Min.x: %i\n", data[7 + 7]);
// INFO_LOG(CONSOLE, "Rx.Center.x: %i\n", data[7 + 8]);
// INFO_LOG(CONSOLE, "Ry.Max.y: %i\n", data[7 + 9]);
// INFO_LOG(CONSOLE, "Ry.Min: %i\n", data[7 + 10]);
// INFO_LOG(CONSOLE, "Ry.Center: %i\n\n", data[7 + 11]);
// INFO_LOG(CONSOLE, "Lt.Neutral: %i\n", data[7 + 12]);
// INFO_LOG(CONSOLE, "Rt.Neutral %i\n\n", data[7 + 13]);
//}
// save values
+14 -15
View File
@@ -44,7 +44,7 @@ namespace WiimoteEmu
static const u8 eeprom_data_0[] = {
// IR, maybe more
// assuming last 2 bytes are checksum
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00, // messing up the checksum on purpose
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00, // messing up the checksum on purpose
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00,
// Accelerometer
// 0g x,y,z, 1g x,y,z, idk, last byte is a checksum
@@ -131,7 +131,7 @@ void EmulateTilt(AccelData* const accel
// 180 degrees
tilt_group->GetState(&roll, &pitch, 0, focus ? PI : 0);
unsigned int ud = 0, lr = 0, fb = 0;
unsigned int ud = 0, lr = 0, fb = 0;
// some notes that no one will understand but me :p
// left, forward, up
@@ -156,7 +156,7 @@ void EmulateTilt(AccelData* const accel
(&accel->x)[fb] = sin(pitch)*sgn[fb];
}
#define SWING_INTENSITY 2.5f//-uncalibrated(aprox) 0x40-calibrated
#define SWING_INTENSITY 2.5f//-uncalibrated(aprox) 0x40-calibrated
void EmulateSwing(AccelData* const accel
, ControllerEmu::Force* const swing_group
@@ -169,9 +169,9 @@ void EmulateSwing(AccelData* const accel
u8 axis_map[3];
// determine which axis is which direction
axis_map[0] = upright ? (sideways ? 0 : 1) : 2; // up/down
axis_map[1] = sideways; // left|right
axis_map[2] = upright ? 2 : (sideways ? 0 : 1); // forward/backward
axis_map[0] = upright ? (sideways ? 0 : 1) : 2; // up/down
axis_map[1] = sideways; // left|right
axis_map[2] = upright ? 2 : (sideways ? 0 : 1); // forward/backward
// some orientations have up as positive, some as negative
// same with forward
@@ -263,7 +263,7 @@ Wiimote::Wiimote( const unsigned int index )
: m_index(index)
, ir_sin(0)
, ir_cos(1)
// , m_sound_stream( NULL )
// , m_sound_stream( NULL )
{
// ---- set up all the controls ----
@@ -329,7 +329,7 @@ std::string Wiimote::GetName() const
}
// if windows is focused or background input is enabled
#define HAS_FOCUS (Host_RendererHasFocus() || (m_options->settings[0]->value != 0))
#define HAS_FOCUS (Host_RendererHasFocus() || (m_options->settings[0]->value != 0))
bool Wiimote::Step()
{
@@ -469,9 +469,8 @@ void Wiimote::GetIRData(u8* const data, bool use_accel)
nsin=0;
ncos=1;
}
// PanicAlert("%d %d %d\nx:%f\nz:%f\nsin:%f\ncos:%f",accel->x,accel->y,accel->z,ax,az,sin,cos);
//PanicAlert("%d %d %d\n%d %d %d\n%d %d %d",accel->x,accel->y,accel->z,calib->zero_g.x,calib->zero_g.y,calib->zero_g.z,
// calib->one_g.x,calib->one_g.y,calib->one_g.z);
// PanicAlert("%d %d %d\nx:%f\nz:%f\nsin:%f\ncos:%f",accel->x,accel->y,accel->z,ax,az,sin,cos);
// PanicAlert("%d %d %d\n%d %d %d\n%d %d %d",accel->x,accel->y,accel->z,calib->zero_g.x,calib->zero_g.y,calib->zero_g.z, calib->one_g.x,calib->one_g.y,calib->one_g.z);
}
else
{
@@ -530,9 +529,9 @@ void Wiimote::GetIRData(u8* const data, bool use_accel)
x[i]=(u16)round((v[i].x+1)/2*(camWidth-1));
y[i]=(u16)round((v[i].y+1)/2*(camHeight-1));
}
// PanicAlert("%f %f\n%f %f\n%f %f\n%f %f\n%d %d\n%d %d\n%d %d\n%d %d",
// v[0].x,v[0].y,v[1].x,v[1].y,v[2].x,v[2].y,v[3].x,v[3].y,
// x[0],y[0],x[1],y[1],x[2],y[2],x[3],y[38]);
// PanicAlert("%f %f\n%f %f\n%f %f\n%f %f\n%d %d\n%d %d\n%d %d\n%d %d",
// v[0].x,v[0].y,v[1].x,v[1].y,v[2].x,v[2].y,v[3].x,v[3].y,
// x[0],y[0],x[1],y[1],x[2],y[2],x[3],y[38]);
}
// Fill report with valid data when full handshake was done
if (m_reg_ir.data[0x30])
@@ -895,7 +894,7 @@ void Wiimote::LoadDefaults(const ControllerInterface& ciface)
{
ControllerEmu::LoadDefaults(ciface);
#define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str)
#define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str)
// Buttons
#if defined HAVE_X11 && HAVE_X11
+2 -2
View File
@@ -347,8 +347,8 @@ struct wm_speaker_data
// Custom structs
/**
* @struct accel_t
* @brief Accelerometer struct. For any device with an accelerometer.
* @struct accel_t
* @brief Accelerometer struct. For any device with an accelerometer.
*/
struct accel_cal
{
+3 -3
View File
@@ -19,7 +19,7 @@
// Used for pair up
#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WINXPSP2
#define NTDDI_VERSION NTDDI_WINXPSP2
#include <bthdef.h>
#include <BluetoothAPIs.h>
@@ -49,7 +49,7 @@ typedef DWORD (__stdcall *PBth_BluetoothGetRadioInfo)(HANDLE, PBLUETOOTH_RADIO_I
typedef DWORD (__stdcall *PBth_BluetoothRemoveDevice)(const BLUETOOTH_ADDRESS*);
typedef DWORD (__stdcall *PBth_BluetoothSetServiceState)(HANDLE, const BLUETOOTH_DEVICE_INFO*, const GUID*, DWORD);
typedef DWORD (__stdcall *PBth_BluetoothAuthenticateDevice)(HWND, HANDLE, BLUETOOTH_DEVICE_INFO*, PWCHAR, ULONG);
typedef DWORD (__stdcall *PBth_BluetoothEnumerateInstalledServices)(HANDLE, BLUETOOTH_DEVICE_INFO*, DWORD*, GUID*);
typedef DWORD (__stdcall *PBth_BluetoothEnumerateInstalledServices)(HANDLE, BLUETOOTH_DEVICE_INFO*, DWORD*, GUID*);
PHidD_GetHidGuid HidD_GetHidGuid = NULL;
PHidD_GetAttributes HidD_GetAttributes = NULL;
@@ -244,7 +244,7 @@ void WiimoteScanner::FindWiimotes(std::vector<Wiimote*> & found_wiimotes, Wiimot
// Don't mind me, just a random sleep to fix stuff on Windows
//if (!wiimotes.empty())
// SLEEP(2000);
// SLEEP(2000);
}
int CheckDeviceType_Write(HANDLE &dev_handle, const u8* buf, size_t size, int attempts)
@@ -97,7 +97,7 @@ public:
protected:
Report m_last_input_report;
u16 m_channel;
u16 m_channel;
private:
void ClearReadQueue();
@@ -123,8 +123,8 @@ private:
std::mutex m_thread_ready_mutex;
std::condition_variable m_thread_ready_cond;
Common::FifoQueue<Report> m_read_reports;
Common::FifoQueue<Report> m_write_reports;
Common::FifoQueue<Report> m_read_reports;
Common::FifoQueue<Report> m_write_reports;
Common::Timer m_last_audio_report;
};
+4 -4
View File
@@ -53,10 +53,10 @@ u16 cksum(const u16 *buffer, int length)
int icmp_echo_req(const u32 s, const sockaddr_in *addr, const u8 *data, const u32 data_length)
{
memset(workspace, 0, sizeof(workspace));
icmp_hdr *header = (icmp_hdr *)workspace;
header->type = ICMP_ECHOREQ;
header->code = 0;
header->checksum = 0;
icmp_hdr *header = (icmp_hdr *)workspace;
header->type = ICMP_ECHOREQ;
header->code = 0;
header->checksum = 0;
memcpy(&header->id, data, data_length);
header->checksum = cksum((u16 *)header, ICMP_HDR_LEN + data_length);
+2 -2
View File
@@ -72,8 +72,8 @@ IWII_IPC_HLE_Device* es_handles[ES_MAX_COUNT];
typedef std::deque<u32> ipc_msg_queue;
static ipc_msg_queue request_queue; // ppc -> arm
static ipc_msg_queue reply_queue; // arm -> ppc
static ipc_msg_queue request_queue; // ppc -> arm
static ipc_msg_queue reply_queue; // arm -> ppc
static std::mutex s_reply_queue;
static int enque_reply;
@@ -16,8 +16,8 @@
#define FS_EINVAL (u32)-4 // Invalid argument Invalid FD
#define FS_ENOENT (u32)-6 // File not found
#define FS_EBUSY (u32)-8 // Resource busy
#define FS_EIO (u32)-12 // Returned on ECC error
#define FS_ENOMEM (u32)-22 // Alloc failed during request
#define FS_EIO (u32)-12 // Returned on ECC error
#define FS_ENOMEM (u32)-22 // Alloc failed during request
#define FS_EFATAL (u32)-101 // Fatal error
#define FS_EACCESS (u32)-102 // Permission denied
#define FS_ECORRUPT (u32)-103 // returned for "corrupted" NAND
@@ -33,7 +33,7 @@
#define FS_EDIRDEPTH (u32)-116 // Max directory depth exceeded
#define FS_EBUSY2 (u32)-118 // Resource busy
//#define FS_EFATAL (u32)-119 // Fatal error not used by IOS as fatal ERROR
#define FS_EESEXHAUSTED (u32)-1016 // Max of 2 ES handles at a time
#define FS_EESEXHAUSTED (u32)-1016 // Max of 2 ES handles at a time
// A struct for IOS ioctlv calls
struct SIOCtlVBuffer
@@ -24,8 +24,8 @@
using namespace DVDInterface;
#define DI_COVER_REG_INITIALIZED 0 // Should be 4, but doesn't work correctly...
#define DI_COVER_REG_NO_DISC 1
#define DI_COVER_REG_INITIALIZED 0 // Should be 4, but doesn't work correctly...
#define DI_COVER_REG_NO_DISC 1
CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string& _rDeviceName )
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
@@ -72,11 +72,11 @@ bool CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress, bool _bForce)
bool CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress)
{
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
u32 Command = Memory::Read_U32(BufferIn) >> 24;
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
u32 Command = Memory::Read_U32(BufferIn) >> 24;
DEBUG_LOG(WII_IPC_DVD, "IOCtl Command(0x%08x) BufferIn(0x%08x, 0x%x) BufferOut(0x%08x, 0x%x)",
Command, BufferIn, BufferInSize, BufferOut, BufferOutSize);
@@ -453,8 +453,8 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
int CWII_IPC_HLE_Device_di::GetCmdDelay(u32 _CommandAddress)
{
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 Command = Memory::Read_U32(BufferIn) >> 24;
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 Command = Memory::Read_U32(BufferIn) >> 24;
// Hacks below
@@ -477,14 +477,14 @@ int CWII_IPC_HLE_Device_di::GetCmdDelay(u32 _CommandAddress)
return SystemTimers::GetTicksPerSecond() / 146;
break;
// case DVDLowAudioBufferConfig:
// case DVDLowInquiry:
// case DVDLowReadDiskID:
// case DVDLowWaitForCoverClose:
// case DVDLowGetCoverReg:
// case DVDLowGetCoverStatus:
// case DVDLowReset:
// case DVDLowClosePartition:
// case DVDLowAudioBufferConfig:
// case DVDLowInquiry:
// case DVDLowReadDiskID:
// case DVDLowWaitForCoverClose:
// case DVDLowGetCoverReg:
// case DVDLowGetCoverStatus:
// case DVDLowReset:
// case DVDLowClosePartition:
default:
// random numbers here!
// More than ~1/2000th of a second hangs DKCR with DSP HLE, maybe.
@@ -66,7 +66,7 @@ void HLE_IPC_CreateVirtualFATFilesystem()
}
CWII_IPC_HLE_Device_FileIO::CWII_IPC_HLE_Device_FileIO(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName, false) // not a real hardware
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName, false) // not a real hardware
, m_Mode(0)
, m_SeekPos(0)
{
@@ -148,7 +148,7 @@ File::IOFile CWII_IPC_HLE_Device_FileIO::OpenFile()
bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
{
u32 ReturnValue = FS_RESULT_FATAL;
u32 ReturnValue = FS_RESULT_FATAL;
const s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
const s32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
@@ -210,8 +210,8 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress)
{
u32 ReturnValue = FS_EACCESS;
const u32 Address = Memory::Read_U32(_CommandAddress + 0xC); // Read to this memory address
const u32 Size = Memory::Read_U32(_CommandAddress + 0x10);
const u32 Address = Memory::Read_U32(_CommandAddress + 0xC); // Read to this memory address
const u32 Size = Memory::Read_U32(_CommandAddress + 0x10);
if (auto file = OpenFile())
@@ -249,9 +249,8 @@ bool CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_FileIO::Write(u32 _CommandAddress)
{
u32 ReturnValue = FS_EACCESS;
const u32 Address = Memory::Read_U32(_CommandAddress + 0xC); // Write data from this memory address
const u32 Size = Memory::Read_U32(_CommandAddress + 0x10);
const u32 Address = Memory::Read_U32(_CommandAddress + 0xC); // Write data from this memory address
const u32 Size = Memory::Read_U32(_CommandAddress + 0x10);
if (auto file = OpenFile())
{
@@ -857,12 +857,12 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
case IOCTL_ES_ENCRYPT:
{
u32 keyIndex = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
u8* IV = Memory::GetPointer(Buffer.InBuffer[1].m_Address);
u8* source = Memory::GetPointer(Buffer.InBuffer[2].m_Address);
u32 size = Buffer.InBuffer[2].m_Size;
u8* newIV = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address);
u32 keyIndex = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
u8* IV = Memory::GetPointer(Buffer.InBuffer[1].m_Address);
u8* source = Memory::GetPointer(Buffer.InBuffer[2].m_Address);
u32 size = Buffer.InBuffer[2].m_Size;
u8* newIV = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address);
aes_context AES_ctx;
aes_setkey_enc(&AES_ctx, keyTable[keyIndex], 128);
@@ -988,7 +988,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(0, _CommandAddress + 0x4);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH %016" PRIx64 " %08x %016" PRIx64 " %08x %016" PRIx64 " %04x", TitleID,view,ticketid,devicetype,titleid,access);
// IOCTL_ES_LAUNCH 0001000248414341 00000001 0001c0fef3df2cfa 00000000 0001000248414341 ffff
// IOCTL_ES_LAUNCH 0001000248414341 00000001 0001c0fef3df2cfa 00000000 0001000248414341 ffff
// This is necessary because Reset(true) above deleted this object. Ew.
@@ -1016,7 +1016,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
{
WARN_LOG(WII_IPC_ES, "IOCTL_ES_GETDEVICECERT");
_dbg_assert_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1);
u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
EcWii &ec = EcWii::GetInstance();
get_ng_cert(destination, ec.getNgId(), ec.getNgKeyId(), ec.getNgPriv(), ec.getNgSig());
@@ -17,7 +17,7 @@
#include "../VolumeHandler.h"
#define MAX_NAME (12)
#define MAX_NAME 12
static Common::replace_v replacements;
@@ -205,7 +205,7 @@ bool CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress)
libusb_submit_transfer(transfer);
//DEBUG_LOG(WII_IPC_HID, "HID::IOCtl(Control)(%02X, %02X) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)",
// bmRequestType, bRequest, BufferIn, BufferInSize, BufferOut, BufferOutSize);
// bmRequestType, bRequest, BufferIn, BufferInSize, BufferOut, BufferOutSize);
// It's the async way!
return false;
@@ -237,7 +237,7 @@ bool CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress)
libusb_submit_transfer(transfer);
//DEBUG_LOG(WII_IPC_HID, "HID::IOCtl(Interrupt %s)(%d,%d,%X) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)",
// Parameter == IOCTL_HID_INTERRUPT_IN ? "In" : "Out", endpoint, length, data, BufferIn, BufferInSize, BufferOut, BufferOutSize);
// Parameter == IOCTL_HID_INTERRUPT_IN ? "In" : "Out", endpoint, length, data, BufferIn, BufferInSize, BufferOut, BufferOutSize);
// It's the async way!
return false;
@@ -951,9 +951,9 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
}
// No need to change fd or events as they are input only.
//Memory::Write_U32(ufds[i].fd, BufferOut + 0xc*i); //fd
//Memory::Write_U32(events, BufferOut + 0xc*i + 4); //events
Memory::Write_U32(revents, BufferOut + 0xc*i + 8); //revents
//Memory::Write_U32(ufds[i].fd, BufferOut + 0xc*i); //fd
//Memory::Write_U32(events, BufferOut + 0xc*i + 4); //events
Memory::Write_U32(revents, BufferOut + 0xc*i + 8); //revents
DEBUG_LOG(WII_IPC_NET, "IOCTL_SO_POLL socket %d revents %08X events %08X", i, revents, ufds[i].events);
}
@@ -1030,7 +1030,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
}
//ERROR_LOG(WII_IPC_NET, "\n%s",
// ArrayToString(Memory::GetPointer(BufferOut), BufferOutSize, 16).c_str());
// ArrayToString(Memory::GetPointer(BufferOut), BufferOutSize, 16).c_str());
ReturnValue = 0;
}
else
@@ -254,7 +254,7 @@ public:
s32 CheckNwc24Config(void)
{
if (Magic() != 0x57634366) /* 'WcCf' magic */
if (Magic() != 0x57634366) /* 'WcCf' magic */
{
ERROR_LOG(WII_IPC_WC24, "Magic mismatch");
return -14;
@@ -204,10 +204,10 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
break;
}
// INFO_LOG(WII_IPC_SD, "InBuffer");
// DumpCommands(BufferIn, BufferInSize / 4, LogTypes::WII_IPC_SD);
// INFO_LOG(WII_IPC_SD, "OutBuffer");
// DumpCommands(BufferOut, BufferOutSize/4, LogTypes::WII_IPC_SD);
// INFO_LOG(WII_IPC_SD, "InBuffer");
// DumpCommands(BufferIn, BufferInSize / 4, LogTypes::WII_IPC_SD);
// INFO_LOG(WII_IPC_SD, "OutBuffer");
// DumpCommands(BufferOut, BufferOutSize/4, LogTypes::WII_IPC_SD);
if (ReturnValue == RET_EVENT_REGISTER)
{
@@ -333,7 +333,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
case SEND_CSD:
DEBUG_LOG(WII_IPC_SD, "SEND_CSD");
// <WntrMute> shuffle2_, OCR: 0x80ff8000 CID: 0x38a00000 0x480032d5 0x3c608030 0x8803d420
// CSD: 0xff928040 0xc93efbcf 0x325f5a83 0x00002600
// CSD: 0xff928040 0xc93efbcf 0x325f5a83 0x00002600
// Values used currently are from lpfaint99
Memory::Write_U32(0x80168000, _BufferOut);
@@ -150,7 +150,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::Close(u32 _CommandAddress, bool _bForc
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtl(u32 _CommandAddress)
{
//ERROR_LOG(WII_IPC_WIIMOTE, "Passing ioctl to ioctlv");
return IOCtlV(_CommandAddress); //hack
return IOCtlV(_CommandAddress); // FIXME: Hack
}
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
@@ -333,8 +333,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendACLPacket(u16 _ConnectionHandle, u
DEBUG_LOG(WII_IPC_WIIMOTE, "ACL endpoint valid, sending packet to %08x", m_ACLEndpoint.m_address);
hci_acldata_hdr_t* pHeader = (hci_acldata_hdr_t*)Memory::GetPointer(m_ACLEndpoint.m_buffer);
pHeader->con_handle = HCI_MK_CON_HANDLE(_ConnectionHandle, HCI_PACKET_START, HCI_POINT2POINT);
pHeader->length = _Size;
pHeader->con_handle = HCI_MK_CON_HANDLE(_ConnectionHandle, HCI_PACKET_START, HCI_POINT2POINT);
pHeader->length = _Size;
// Write the packet to the buffer
memcpy((u8*)pHeader + sizeof(hci_acldata_hdr_t), _pData, pHeader->length);
@@ -607,9 +607,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventConnectionComplete(const bdad
static char s_szLinkType[][128] =
{
{ "HCI_LINK_SCO 0x00 - Voice"},
{ "HCI_LINK_ACL 0x01 - Data"},
{ "HCI_LINK_eSCO 0x02 - eSCO"},
{ "HCI_LINK_SCO 0x00 - Voice"},
{ "HCI_LINK_ACL 0x01 - Data"},
{ "HCI_LINK_eSCO 0x02 - eSCO"},
};
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventConnectionComplete");
@@ -642,9 +642,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRequestConnection(CWII_IPC_HL
static char LinkType[][128] =
{
{ "HCI_LINK_SCO 0x00 - Voice"},
{ "HCI_LINK_ACL 0x01 - Data" },
{ "HCI_LINK_eSCO 0x02 - eSCO" },
{ "HCI_LINK_SCO 0x00 - Voice"},
{ "HCI_LINK_ACL 0x01 - Data" },
{ "HCI_LINK_eSCO 0x02 - eSCO" },
};
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestConnection");
@@ -218,7 +218,7 @@ private:
// Execute HCI Message
void ExecuteHCICommandMessage(const SHCICommandMessage& _rCtrlMessage);
// OGF 0x01 Link control commands and return parameters
// OGF 0x01 - Link control commands and return parameters
void CommandWriteInquiryMode(u8* _Input);
void CommandWritePageScanType(u8* _Input);
void CommandHostBufferSize(u8* _Input);
@@ -237,11 +237,11 @@ private:
void CommandDeleteStoredLinkKey(u8* _Input);
void CommandChangeConPacketType(u8* _Input);
// OGF 0x02 Link policy commands and return parameters
// OGF 0x02 - Link policy commands and return parameters
void CommandWriteLinkPolicy(u8* _Input);
void CommandSniffMode(u8* _Input);
// OGF 0x03 Host Controller and Baseband commands and return parameters
// OGF 0x03 - Host Controller and Baseband commands and return parameters
void CommandReset(u8* _Input);
void CommandWriteLocalName(u8* _Input);
void CommandWritePageTimeOut(u8* _Input);
@@ -253,13 +253,13 @@ private:
void CommandWriteInquiryScanType(u8* _Input);
void CommandWriteLinkSupervisionTimeout(u8* _Input);
// OGF 0x04 Informational commands and return parameters
// OGF 0x04 - Informational commands and return parameters
void CommandReadBufferSize(u8* _Input);
void CommandReadLocalVer(u8* _Input);
void CommandReadLocalFeatures(u8* _Input);
void CommandReadBDAdrr(u8* _Input);
// OGF 0x3F Vendor specific
// OGF 0x3F - Vendor specific
void CommandVendorSpecific_FC4C(u8* _Input, u32 _Size);
void CommandVendorSpecific_FC4F(u8* _Input, u32 _Size);
@@ -404,7 +404,7 @@ void CWII_IPC_HLE_WiiMote::ReceiveConnectionResponse(u8 _Ident, u8* _pData, u32
INFO_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConnectionResponse");
DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rsp->dcid);
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
DEBUG_LOG(WII_IPC_WIIMOTE, " Status: 0x%04x", rsp->status);
_dbg_assert_(WII_IPC_WIIMOTE, rsp->result == L2CAP_SUCCESS);
@@ -503,7 +503,7 @@ void CWII_IPC_HLE_WiiMote::ReceiveConfigurationResponse(u8 _Ident, u8* _pData, u
INFO_LOG(WII_IPC_WIIMOTE, "[L2CAP] ReceiveConfigurationResponse");
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", rsp->flags);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
_dbg_assert_(WII_IPC_WIIMOTE, rsp->result == L2CAP_SUCCESS);
@@ -609,8 +609,8 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush
if (MTU == 0)
MTU = rChannel.MTU;
pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t);
pOptions->type = L2CAP_OPT_MTU;
pOptions->length = L2CAP_OPT_MTU_SIZE;
pOptions->type = L2CAP_OPT_MTU;
pOptions->length = L2CAP_OPT_MTU_SIZE;
*(u16*)&Buffer[Offset] = MTU; Offset += L2CAP_OPT_MTU_SIZE;
DEBUG_LOG(WII_IPC_WIIMOTE, " MTU: 0x%04x", MTU);
}
@@ -620,8 +620,8 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush
if (FlushTimeOut == 0)
FlushTimeOut = rChannel.FlushTimeOut;
pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t);
pOptions->type = L2CAP_OPT_FLUSH_TIMO;
pOptions->length = L2CAP_OPT_FLUSH_TIMO_SIZE;
pOptions->type = L2CAP_OPT_FLUSH_TIMO;
pOptions->length = L2CAP_OPT_FLUSH_TIMO_SIZE;
*(u16*)&Buffer[Offset] = FlushTimeOut; Offset += L2CAP_OPT_FLUSH_TIMO_SIZE;
DEBUG_LOG(WII_IPC_WIIMOTE, " FlushTimeOut: 0x%04x", FlushTimeOut);
}
@@ -734,8 +734,8 @@ int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID)
void CWII_IPC_HLE_WiiMote::SDPSendServiceAttributeResponse(u16 cid, u16 TransactionID, u32 ServiceHandle,
u16 startAttrID, u16 endAttrID,
u16 MaximumAttributeByteCount, u8* pContinuationState)
u16 startAttrID, u16 endAttrID,
u16 MaximumAttributeByteCount, u8* pContinuationState)
{
if (ServiceHandle != 0x10000)
{
@@ -744,7 +744,7 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceAttributeResponse(u16 cid, u16 Transact
}
// _dbg_assert_(WII_IPC_WIIMOTE, ServiceHandle == 0x10000);
// _dbg_assert_(WII_IPC_WIIMOTE, ServiceHandle == 0x10000);
u32 contState = ParseCont(pContinuationState);
@@ -767,12 +767,12 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceAttributeResponse(u16 cid, u16 Transact
pHeader->length = (u16)(Offset - sizeof(l2cap_hdr_t));
m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, pHeader->length + sizeof(l2cap_hdr_t));
// Debugger::PrintDataBuffer(LogTypes::WIIMOTE, DataFrame, pHeader->length + sizeof(l2cap_hdr_t), "test response: ");
// Debugger::PrintDataBuffer(LogTypes::WIIMOTE, DataFrame, pHeader->length + sizeof(l2cap_hdr_t), "test response: ");
}
void CWII_IPC_HLE_WiiMote::HandleSDP(u16 cid, u8* _pData, u32 _Size)
{
// Debugger::PrintDataBuffer(LogTypes::WIIMOTE, _pData, _Size, "HandleSDP: ");
// Debugger::PrintDataBuffer(LogTypes::WIIMOTE, _pData, _Size, "HandleSDP: ");
CBigEndianBuffer buffer(_pData);
@@ -51,8 +51,8 @@ public:
bool LinkChannel();
void ResetChannels();
void Activate(bool ready);
void ExecuteL2capCmd(u8* _pData, u32 _Size); // From CPU
void ReceiveL2capData(u16 scid, const void* _pData, u32 _Size); // From wiimote
void ExecuteL2capCmd(u8* _pData, u32 _Size); // From CPU
void ReceiveL2capData(u16 scid, const void* _pData, u32 _Size); // From wiimote
int NetPlay_GetWiimoteNum(int _number);
+2 -2
View File
@@ -192,8 +192,8 @@ void WiiSocket::update(bool read, bool write, bool except)
{
case IOCTL_SO_FCNTL:
{
u32 cmd = Memory::Read_U32(BufferIn + 4);
u32 arg = Memory::Read_U32(BufferIn + 8);
u32 cmd = Memory::Read_U32(BufferIn + 4);
u32 arg = Memory::Read_U32(BufferIn + 8);
ReturnValue = _fcntl(cmd, arg);
break;
}
+2 -2
View File
@@ -187,7 +187,7 @@ private:
public:
WiiSocket() : fd(-1), nonBlock(false) {}
~WiiSocket();
void operator=(WiiSocket const&); // Don't implement
void operator=(WiiSocket const&); // Don't implement
};
@@ -200,7 +200,7 @@ public:
static WiiSockMan& getInstance()
{
static WiiSockMan instance; // Guaranteed to be destroyed.
return instance; // Instantiated on first use.
return instance; // Instantiated on first use.
}
void Update();
static void EnqueueReply(u32 CommandAddress, s32 ReturnValue);
+1 -1
View File
@@ -879,7 +879,7 @@ u32 CEXIIPL::NetPlay_GetGCTime()
std::lock_guard<std::mutex> lk(crit_netplay_client);
if (netplay_client)
return NETPLAY_INITIAL_GCTIME; // watev
return NETPLAY_INITIAL_GCTIME; // watev
else
return 0;
}
+6 -5
View File
@@ -60,10 +60,10 @@ enum
NP_MSG_PLAYER_PING_DATA = 0xE2,
};
typedef u8 MessageId;
typedef u8 PlayerId;
typedef s8 PadMapping;
typedef u32 FrameNum;
typedef u8 MessageId;
typedef u8 PlayerId;
typedef s8 PadMapping;
typedef u32 FrameNum;
enum
{
@@ -72,6 +72,7 @@ enum
CON_ERR_VERSION_MISMATCH = 3
};
namespace NetPlay {
namespace NetPlay
{
bool IsNetPlayRunning();
};
+2 -2
View File
@@ -211,7 +211,7 @@ unsigned int NetPlayServer::OnConnect(sf::SocketTCP& socket)
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
m_players[socket] = player;
std::lock_guard<std::recursive_mutex> lks(m_crit.send);
UpdatePadMapping(); // sync pad mappings with everyone
UpdatePadMapping(); // sync pad mappings with everyone
UpdateWiimoteMapping();
}
@@ -486,7 +486,7 @@ void NetPlayServer::SendChatMessage(const std::string& msg)
{
sf::Packet spac;
spac << (MessageId)NP_MSG_CHAT_MESSAGE;
spac << (PlayerId)0; // server id always 0
spac << (PlayerId)0; // server id always 0
spac << msg;
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
+1 -1
View File
@@ -79,7 +79,7 @@ private:
PadMapping m_pad_map[4];
PadMapping m_wiimote_map[4];
std::map<sf::SocketTCP, Client> m_players;
std::map<sf::SocketTCP, Client> m_players;
struct
{
+9 -9
View File
@@ -492,13 +492,13 @@ static void gdb_read_registers()
wbe32hex(bufptr + i*8, riPS0(i));
}
bufptr += 32 * 8;
wbe32hex(bufptr, PC); bufptr += 4;
wbe32hex(bufptr, MSR); bufptr += 4;
wbe32hex(bufptr, GetCR()); bufptr += 4;
wbe32hex(bufptr, LR); bufptr += 4;
wbe32hex(bufptr, PC); bufptr += 4;
wbe32hex(bufptr, MSR); bufptr += 4;
wbe32hex(bufptr, GetCR()); bufptr += 4;
wbe32hex(bufptr, LR); bufptr += 4;
wbe32hex(bufptr, CTR); bufptr += 4;
wbe32hex(bufptr, CTR); bufptr += 4;
wbe32hex(bufptr, PowerPC::ppcState.spr[SPR_XER]); bufptr += 4;
// MQ register not used.
wbe32hex(bufptr, 0x0BADC0DE); bufptr += 4;
@@ -841,10 +841,10 @@ void gdb_init(u32 port)
saddr_client.sin_addr.s_addr = ntohl(saddr_client.sin_addr.s_addr);
/*if (((saddr_client.sin_addr.s_addr >> 24) & 0xff) != 127 ||
* ((saddr_client.sin_addr.s_addr >> 16) & 0xff) != 0 ||
* ((saddr_client.sin_addr.s_addr >> 8) & 0xff) != 0 ||
* ((saddr_client.sin_addr.s_addr >> 0) & 0xff) != 1)
* ERROR_LOG(GDB_STUB, "gdb: incoming connection not from localhost");
* ((saddr_client.sin_addr.s_addr >> 16) & 0xff) != 0 ||
* ((saddr_client.sin_addr.s_addr >> 8) & 0xff) != 0 ||
* ((saddr_client.sin_addr.s_addr >> 0) & 0xff) != 1)
* ERROR_LOG(GDB_STUB, "gdb: incoming connection not from localhost");
*/
close(tmpsock);
tmpsock = -1;
+13 -13
View File
@@ -259,10 +259,10 @@ union UGeckoInstruction
};
struct
{
u32 : 17;
u32 : 17;
// Field mask, identifies the FPSCR fields to be updated by mtfsf
u32 FM : 8;
u32 : 7;
u32 FM : 8;
u32 : 7;
};
// paired single quantized load/store
@@ -289,7 +289,7 @@ union UGeckoInstruction
struct
{
u32 : 11;
u32 : 11;
// Number of bytes to use in lswi/stswi (0 means 32 bytes)
u32 NB : 5;
};
@@ -774,15 +774,15 @@ enum
};
// Exceptions
#define EXCEPTION_DECREMENTER 0x00000001
#define EXCEPTION_SYSCALL 0x00000002
#define EXCEPTION_EXTERNAL_INT 0x00000004
#define EXCEPTION_DSI 0x00000008
#define EXCEPTION_ISI 0x00000010
#define EXCEPTION_ALIGNMENT 0x00000020
#define EXCEPTION_FPU_UNAVAILABLE 0x00000040
#define EXCEPTION_PROGRAM 0x00000080
#define EXCEPTION_PERFORMANCE_MONITOR 0x00000100
#define EXCEPTION_DECREMENTER 0x00000001
#define EXCEPTION_SYSCALL 0x00000002
#define EXCEPTION_EXTERNAL_INT 0x00000004
#define EXCEPTION_DSI 0x00000008
#define EXCEPTION_ISI 0x00000010
#define EXCEPTION_ALIGNMENT 0x00000020
#define EXCEPTION_FPU_UNAVAILABLE 0x00000040
#define EXCEPTION_PROGRAM 0x00000080
#define EXCEPTION_PERFORMANCE_MONITOR 0x00000100
inline s32 SignExt16(s16 x) {return (s32)(s16)x;}
inline s32 SignExt26(u32 x) {return x & 0x2000000 ? (s32)(x | 0xFC000000) : (s32)(x);}
@@ -60,7 +60,7 @@ public:
static void fnmaddsx(UGeckoInstruction _inst);
static void fnmsubsx(UGeckoInstruction _inst);
static void fresx(UGeckoInstruction _inst);
// static void fsqrtsx(UGeckoInstruction _inst);
//static void fsqrtsx(UGeckoInstruction _inst);
static void fsubsx(UGeckoInstruction _inst);
static void fabsx(UGeckoInstruction _inst);
static void fcmpo(UGeckoInstruction _inst);
@@ -40,9 +40,9 @@ void Interpreter::fcmpo(UGeckoInstruction _inst)
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
FPSCR.FX = 1;
@@ -71,9 +71,9 @@ void Interpreter::fcmpu(UGeckoInstruction _inst)
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
compareResult = 1;
@@ -483,7 +483,7 @@ void Interpreter::fsubx(UGeckoInstruction _inst)
void Interpreter::fsubsx(UGeckoInstruction _inst)
{
rPS0(_inst.FD) = rPS1(_inst.FD) = ForceSingle(NI_sub(rPS0(_inst.FA), rPS0(_inst.FB)));
UpdateFPRF(rPS0(_inst.FD));
UpdateFPRF(rPS0(_inst.FD));
if (_inst.Rc) Helper_UpdateCR1(rPS0(_inst.FD));
}
@@ -217,7 +217,7 @@ void Interpreter::cmp(UGeckoInstruction _inst)
s32 a = (s32)m_GPR[_inst.RA];
s32 b = (s32)m_GPR[_inst.RB];
int fTemp = 0x8; // a < b
// if (a < b) fTemp = 0x8; else
// if (a < b) fTemp = 0x8; else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2;
if (GetXER_SO()) PanicAlert("cmp getting overflow flag"); // fTemp |= 0x1
@@ -230,7 +230,7 @@ void Interpreter::cmpl(UGeckoInstruction _inst)
u32 b = m_GPR[_inst.RB];
u32 fTemp = 0x8; // a < b
// if (a < b) fTemp = 0x8;else
// if (a < b) fTemp = 0x8;else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2;
if (GetXER_SO()) PanicAlert("cmpl getting overflow flag"); // fTemp |= 0x1;
@@ -8,43 +8,43 @@
// dequantize table
const float m_dequantizeTable[] =
{
1.0 / (1 << 0), 1.0 / (1 << 1), 1.0 / (1 << 2), 1.0 / (1 << 3),
1.0 / (1 << 4), 1.0 / (1 << 5), 1.0 / (1 << 6), 1.0 / (1 << 7),
1.0 / (1 << 8), 1.0 / (1 << 9), 1.0 / (1 << 10), 1.0 / (1 << 11),
1.0 / (1 << 12), 1.0 / (1 << 13), 1.0 / (1 << 14), 1.0 / (1 << 15),
1.0 / (1 << 16), 1.0 / (1 << 17), 1.0 / (1 << 18), 1.0 / (1 << 19),
1.0 / (1 << 20), 1.0 / (1 << 21), 1.0 / (1 << 22), 1.0 / (1 << 23),
1.0 / (1 << 24), 1.0 / (1 << 25), 1.0 / (1 << 26), 1.0 / (1 << 27),
1.0 / (1 << 28), 1.0 / (1 << 29), 1.0 / (1 << 30), 1.0 / (1 << 31),
(1ULL << 32), (1 << 31), (1 << 30), (1 << 29),
(1 << 28), (1 << 27), (1 << 26), (1 << 25),
(1 << 24), (1 << 23), (1 << 22), (1 << 21),
(1 << 20), (1 << 19), (1 << 18), (1 << 17),
(1 << 16), (1 << 15), (1 << 14), (1 << 13),
(1 << 12), (1 << 11), (1 << 10), (1 << 9),
(1 << 8), (1 << 7), (1 << 6), (1 << 5),
(1 << 4), (1 << 3), (1 << 2), (1 << 1),
1.0 / (1 << 0), 1.0 / (1 << 1), 1.0 / (1 << 2), 1.0 / (1 << 3),
1.0 / (1 << 4), 1.0 / (1 << 5), 1.0 / (1 << 6), 1.0 / (1 << 7),
1.0 / (1 << 8), 1.0 / (1 << 9), 1.0 / (1 << 10), 1.0 / (1 << 11),
1.0 / (1 << 12), 1.0 / (1 << 13), 1.0 / (1 << 14), 1.0 / (1 << 15),
1.0 / (1 << 16), 1.0 / (1 << 17), 1.0 / (1 << 18), 1.0 / (1 << 19),
1.0 / (1 << 20), 1.0 / (1 << 21), 1.0 / (1 << 22), 1.0 / (1 << 23),
1.0 / (1 << 24), 1.0 / (1 << 25), 1.0 / (1 << 26), 1.0 / (1 << 27),
1.0 / (1 << 28), 1.0 / (1 << 29), 1.0 / (1 << 30), 1.0 / (1 << 31),
(1ULL << 32), (1 << 31), (1 << 30), (1 << 29),
(1 << 28), (1 << 27), (1 << 26), (1 << 25),
(1 << 24), (1 << 23), (1 << 22), (1 << 21),
(1 << 20), (1 << 19), (1 << 18), (1 << 17),
(1 << 16), (1 << 15), (1 << 14), (1 << 13),
(1 << 12), (1 << 11), (1 << 10), (1 << 9),
(1 << 8), (1 << 7), (1 << 6), (1 << 5),
(1 << 4), (1 << 3), (1 << 2), (1 << 1),
};
// quantize table
const float m_quantizeTable[] =
{
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
(1 << 8), (1 << 9), (1 << 10), (1 << 11),
(1 << 12), (1 << 13), (1 << 14), (1 << 15),
(1 << 16), (1 << 17), (1 << 18), (1 << 19),
(1 << 20), (1 << 21), (1 << 22), (1 << 23),
(1 << 24), (1 << 25), (1 << 26), (1 << 27),
(1 << 28), (1 << 29), (1 << 30), (1 << 31),
1.0 / (1ULL << 32), 1.0 / (1 << 31), 1.0 / (1 << 30), 1.0 / (1 << 29),
1.0 / (1 << 28), 1.0 / (1 << 27), 1.0 / (1 << 26), 1.0 / (1 << 25),
1.0 / (1 << 24), 1.0 / (1 << 23), 1.0 / (1 << 22), 1.0 / (1 << 21),
1.0 / (1 << 20), 1.0 / (1 << 19), 1.0 / (1 << 18), 1.0 / (1 << 17),
1.0 / (1 << 16), 1.0 / (1 << 15), 1.0 / (1 << 14), 1.0 / (1 << 13),
1.0 / (1 << 12), 1.0 / (1 << 11), 1.0 / (1 << 10), 1.0 / (1 << 9),
1.0 / (1 << 8), 1.0 / (1 << 7), 1.0 / (1 << 6), 1.0 / (1 << 5),
1.0 / (1 << 4), 1.0 / (1 << 3), 1.0 / (1 << 2), 1.0 / (1 << 1),
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
(1 << 8), (1 << 9), (1 << 10), (1 << 11),
(1 << 12), (1 << 13), (1 << 14), (1 << 15),
(1 << 16), (1 << 17), (1 << 18), (1 << 19),
(1 << 20), (1 << 21), (1 << 22), (1 << 23),
(1 << 24), (1 << 25), (1 << 26), (1 << 27),
(1 << 28), (1 << 29), (1 << 30), (1 << 31),
1.0 / (1ULL << 32), 1.0 / (1 << 31), 1.0 / (1 << 30), 1.0 / (1 << 29),
1.0 / (1 << 28), 1.0 / (1 << 27), 1.0 / (1 << 26), 1.0 / (1 << 25),
1.0 / (1 << 24), 1.0 / (1 << 23), 1.0 / (1 << 22), 1.0 / (1 << 21),
1.0 / (1 << 20), 1.0 / (1 << 19), 1.0 / (1 << 18), 1.0 / (1 << 17),
1.0 / (1 << 16), 1.0 / (1 << 15), 1.0 / (1 << 14), 1.0 / (1 << 13),
1.0 / (1 << 12), 1.0 / (1 << 11), 1.0 / (1 << 10), 1.0 / (1 << 9),
1.0 / (1 << 8), 1.0 / (1 << 7), 1.0 / (1 << 6), 1.0 / (1 << 5),
1.0 / (1 << 4), 1.0 / (1 << 3), 1.0 / (1 << 2), 1.0 / (1 << 1),
};
template <class T>
@@ -54,8 +54,7 @@ inline T CLAMP(T a, T bottom, T top) {
return a;
}
void Interpreter::Helper_Quantize(const u32 _Addr, const double _fValue,
const EQuantizeType _quantizeType, const unsigned int _uScale)
void Interpreter::Helper_Quantize(const u32 _Addr, const double _fValue, const EQuantizeType _quantizeType, const unsigned int _uScale)
{
switch (_quantizeType)
{
@@ -98,8 +97,7 @@ void Interpreter::Helper_Quantize(const u32 _Addr, const double _fValue,
}
}
float Interpreter::Helper_Dequantize(const u32 _Addr, const EQuantizeType _quantizeType,
const unsigned int _uScale)
float Interpreter::Helper_Dequantize(const u32 _Addr, const EQuantizeType _quantizeType, const unsigned int _uScale)
{
// dequantize the value
float fResult;
@@ -358,9 +358,9 @@ void Interpreter::ps_cmpu0(UGeckoInstruction _inst)
double fb = rPS0(_inst.FB);
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
compareResult = 1;
@@ -379,9 +379,9 @@ void Interpreter::ps_cmpo0(UGeckoInstruction _inst)
double fb = rPS0(_inst.FB);
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
compareResult = 1;
@@ -407,9 +407,9 @@ void Interpreter::ps_cmpu1(UGeckoInstruction _inst)
double fb = rPS1(_inst.FB);
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
compareResult = 1;
@@ -428,9 +428,9 @@ void Interpreter::ps_cmpo1(UGeckoInstruction _inst)
double fb = rPS1(_inst.FB);
int compareResult;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
if (fa < fb) compareResult = 8;
else if (fa > fb) compareResult = 4;
else if (fa == fb) compareResult = 2;
else
{
compareResult = 1;
@@ -468,6 +468,6 @@ void Interpreter::mffsx(UGeckoInstruction _inst)
// TODO(ector): grab all overflow flags etc and set them in FPSCR
UpdateFPSCR();
riPS0(_inst.FD) = (u64)FPSCR.Hex;
riPS0(_inst.FD) = (u64)FPSCR.Hex;
if (_inst.Rc) PanicAlert("mffsx: inst_.Rc");
}
@@ -310,7 +310,7 @@ static GekkoOPTemplate table59[] =
{18, Interpreter::fdivsx, {"fdivsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 16, 0, 0, 0}}, // TODO
{20, Interpreter::fsubsx, {"fsubsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}},
{21, Interpreter::faddsx, {"faddsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}},
// {22, Interpreter::fsqrtsx, {"fsqrtsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}}, // Not implemented on gekko
//{22, Interpreter::fsqrtsx, {"fsqrtsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}}, // Not implemented on gekko
{24, Interpreter::fresx, {"fresx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}},
{25, Interpreter::fmulsx, {"fmulsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}},
{28, Interpreter::fmsubsx, {"fmsubsx", OPTYPE_FPU, FL_RC_BIT_F | FL_USE_FPU, 0, 0, 0, 0}},
@@ -44,7 +44,7 @@ static GekkoOPTemplate primarytable[] =
{17, &Jit64::sc}, //"sc", OPTYPE_SYSTEM, FL_ENDBLOCK, 1}},
{7, &Jit64::mulli}, //"mulli", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_RC_BIT, 2}},
{8, &Jit64::subfic}, //"subfic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
{8, &Jit64::subfic}, //"subfic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
{10, &Jit64::cmpXX}, //"cmpli", OPTYPE_INTEGER, FL_IN_A | FL_SET_CRn}},
{11, &Jit64::cmpXX}, //"cmpi", OPTYPE_INTEGER, FL_IN_A | FL_SET_CRn}},
{12, &Jit64::reg_imm}, //"addic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
@@ -86,8 +86,8 @@ void Jit64::bx(UGeckoInstruction inst)
if (destination == js.compilerPC)
{
//PanicAlert("Idle loop detected at %08x", destination);
// CALL(ProtectFunction(&CoreTiming::Idle, 0));
// JMP(Asm::testExceptions, true);
// CALL(ProtectFunction(&CoreTiming::Idle, 0));
// JMP(Asm::testExceptions, true);
// make idle loops go faster
js.downcountAmount += 8;
}
@@ -163,7 +163,7 @@ void Jit64::bcctrx(UGeckoInstruction inst)
//NPC = CTR & 0xfffffffc;
MOV(32, R(EAX), M(&CTR));
if (inst.LK_3)
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
AND(32, R(EAX), Imm32(0xFFFFFFFC));
WriteExitDestInEAX();
}
@@ -186,7 +186,7 @@ void Jit64::bcctrx(UGeckoInstruction inst)
AND(32, R(EAX), Imm32(0xFFFFFFFC));
//MOV(32, M(&PC), R(EAX)); => Already done in WriteExitDestInEAX()
if (inst.LK_3)
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
WriteExitDestInEAX();
// Would really like to continue the block here, but it ends. TODO.
SetJumpTarget(b);
@@ -225,9 +225,9 @@ void Jit64::fcmpx(UGeckoInstruction inst)
}
//bool ordered = inst.SUBOP10 == 32;
int a = inst.FA;
int b = inst.FB;
int crf = inst.CRFD;
int a = inst.FA;
int b = inst.FB;
int crf = inst.CRFD;
fpr.Lock(a,b);
fpr.BindToRegister(b, true);
@@ -245,7 +245,7 @@ void Jit64::fcmpx(UGeckoInstruction inst)
}
// if (B != B) or (A != A), goto NaN's jump target
pNaN = J_CC(CC_P);
pNaN = J_CC(CC_P);
if (a != b)
{
@@ -254,7 +254,8 @@ void Jit64::reg_imm(UGeckoInstruction inst)
}
break;
case 15:
if (a == 0) { // lis
if (a == 0) // lis
{
// Merge with next instruction if loading a 32-bits immediate value (lis + addi, lis + ori)
if (!js.isLastInstruction && !Core::g_CoreStartupParameter.bEnableDebugging)
{
@@ -349,7 +350,7 @@ void Jit64::cmpXX(UGeckoInstruction inst)
}
else
{
signedCompare = false; // silence compiler warning
signedCompare = false; // silence compiler warning
PanicAlert("cmpXX");
}
}
@@ -107,11 +107,11 @@ void Jit64::psq_l(UGeckoInstruction inst)
CALLptr(MScaled(EDX, addr_scale, (u32)(u64)asm_routines.pairedLoadQuantized));
ABI_RestoreStack(0);
// MEMCHECK_START // FIXME: MMU does not work here because of unsafe memory access
// MEMCHECK_START // FIXME: MMU does not work here because of unsafe memory access
CVTPS2PD(fpr.RX(inst.RS), R(XMM0));
// MEMCHECK_END
// MEMCHECK_END
gpr.UnlockAll();
gpr.UnlockAllX();
@@ -93,7 +93,7 @@ void Jit64::mfspr(UGeckoInstruction inst)
void Jit64::mtmsr(UGeckoInstruction inst)
{
INSTRUCTION_START
// Don't interpret this, if we do we get thrown out
// Don't interpret this, if we do we get thrown out
//JITDISABLE(bJITSystemRegistersOff)
if (!gpr.R(inst.RS).IsImm())
{
+3 -2
View File
@@ -425,8 +425,9 @@ static void regMarkMemAddress(RegInfo& RI, InstLoc I, InstLoc AI, unsigned OpNum
}
// in 64-bit build, this returns a completely bizarre address sometimes!
static std::pair<OpArg, u32> regBuildMemAddress(RegInfo& RI, InstLoc I,
InstLoc AI, unsigned OpNum, unsigned Size, X64Reg* dest) {
static std::pair<OpArg, u32> regBuildMemAddress(RegInfo& RI, InstLoc I, InstLoc AI,
unsigned OpNum, unsigned Size, X64Reg* dest)
{
if (isImm(*AI)) {
unsigned addr = RI.Build->GetImmValue(AI);
if (Memory::IsRAMAddress(addr)) {
+4 -5
View File
@@ -154,10 +154,10 @@ static inline uint64_t __rdtsc()
return (uint64_t)hi << 32 | lo;
#else
__asm__ __volatile__ (
"xor %%eax,%%eax;"
"push %%ebx;"
"xor %%eax,%%eax;"
"push %%ebx;"
"cpuid;"
"pop %%ebx;"
"pop %%ebx;"
::: "%eax", "%ecx", "%edx");
__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
#endif
@@ -315,7 +315,7 @@ void JitIL::WriteCallInterpreter(UGeckoInstruction inst)
void JitIL::unknown_instruction(UGeckoInstruction inst)
{
// CCPU::Break();
// CCPU::Break();
PanicAlert("unknown_instruction %08x - Fix me ;)", inst.hex);
}
@@ -365,7 +365,6 @@ static void ImHere()
return;
}
DEBUG_LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
// printf("I'm here - PC = %08x , LR = %08x", PC, LR);
been_here[PC] = 1;
}
@@ -46,7 +46,7 @@ static GekkoOPTemplate primarytable[] =
{17, &JitIL::sc}, //"sc", OPTYPE_SYSTEM, FL_ENDBLOCK, 1}},
{7, &JitIL::mulli}, //"mulli", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_RC_BIT, 2}},
{8, &JitIL::subfic}, //"subfic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
{8, &JitIL::subfic}, //"subfic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
{10, &JitIL::cmpXX}, //"cmpli", OPTYPE_INTEGER, FL_IN_A | FL_SET_CRn}},
{11, &JitIL::cmpXX}, //"cmpi", OPTYPE_INTEGER, FL_IN_A | FL_SET_CRn}},
{12, &JitIL::reg_imm}, //"addic", OPTYPE_INTEGER, FL_OUT_D | FL_IN_A | FL_SET_CA}},
+1 -1
View File
@@ -497,7 +497,7 @@ const u8* JitArm::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlo
}
if (memory_exception)
BKPT(0x500);
if (broken_block)
if (broken_block)
{
printf("Broken Block going to 0x%08x\n", nextPC);
WriteExit(nextPC);
Loaded 100 of 242 files, more files were not shown because too many files have changed in this diff. Show more