mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-06 12:40:24 +00:00
Merge pull request #1539 from Stevoisiak/newImprovedFormatting
Various formatting and consistency fixes
This commit is contained in:
commit
e789920340
@ -12,7 +12,7 @@ class SoundStream
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
CMixer *m_mixer;
|
CMixer* m_mixer;
|
||||||
// We set this to shut down the sound thread.
|
// We set this to shut down the sound thread.
|
||||||
// 0=keep playing, 1=stop playing NOW.
|
// 0=keep playing, 1=stop playing NOW.
|
||||||
volatile int threadData;
|
volatile int threadData;
|
||||||
@ -21,11 +21,11 @@ protected:
|
|||||||
bool m_muted;
|
bool m_muted;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
|
SoundStream(CMixer* mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {}
|
||||||
virtual ~SoundStream() { delete m_mixer; }
|
virtual ~SoundStream() { delete m_mixer; }
|
||||||
|
|
||||||
static bool isValid() { return false; }
|
static bool isValid() { return false; }
|
||||||
virtual CMixer *GetMixer() const { return m_mixer; }
|
virtual CMixer* GetMixer() const { return m_mixer; }
|
||||||
virtual bool Start() { return false; }
|
virtual bool Start() { return false; }
|
||||||
virtual void SetVolume(int) {}
|
virtual void SetVolume(int) {}
|
||||||
virtual void SoundLoop() {}
|
virtual void SoundLoop() {}
|
||||||
@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
virtual void StartLogAudio(const std::string& filename)
|
virtual void StartLogAudio(const std::string& filename)
|
||||||
{
|
{
|
||||||
if (! m_logAudio)
|
if (!m_logAudio)
|
||||||
{
|
{
|
||||||
m_logAudio = true;
|
m_logAudio = true;
|
||||||
g_wave_writer.Start(filename, m_mixer->GetSampleRate());
|
g_wave_writer.Start(filename, m_mixer->GetSampleRate());
|
||||||
|
@ -174,7 +174,7 @@ bool XAudio2::Start()
|
|||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
// callback doesn't seem to run on a specific cpu anyways
|
// callback doesn't seem to run on a specific CPU anyways
|
||||||
IXAudio2* xaudptr;
|
IXAudio2* xaudptr;
|
||||||
if (FAILED(hr = ((XAudio2Create_t)PXAudio2Create)(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
if (FAILED(hr = ((XAudio2Create_t)PXAudio2Create)(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@ bool XAudio2_7::Start()
|
|||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
// callback doesn't seem to run on a specific cpu anyways
|
// callback doesn't seem to run on a specific CPU anyways
|
||||||
IXAudio2* xaudptr;
|
IXAudio2* xaudptr;
|
||||||
if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
|
||||||
{
|
{
|
||||||
|
@ -28,17 +28,17 @@ private:
|
|||||||
s32 filterIndex;
|
s32 filterIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ALDeviceList ();
|
ALDeviceList();
|
||||||
~ALDeviceList ();
|
~ALDeviceList();
|
||||||
s32 GetNumDevices();
|
s32 GetNumDevices();
|
||||||
char *GetDeviceName(s32 index);
|
char* GetDeviceName(s32 index);
|
||||||
void GetDeviceVersion(s32 index, s32 *major, s32 *minor);
|
void GetDeviceVersion(s32 index, s32* major, s32* minor);
|
||||||
u32 GetMaxNumSources(s32 index);
|
u32 GetMaxNumSources(s32 index);
|
||||||
bool IsExtensionSupported(s32 index, char *szExtName);
|
bool IsExtensionSupported(s32 index, char* szExtName);
|
||||||
s32 GetDefaultDevice();
|
s32 GetDefaultDevice();
|
||||||
void FilterDevicesMinVer(s32 major, s32 minor);
|
void FilterDevicesMinVer(s32 major, s32 minor);
|
||||||
void FilterDevicesMaxVer(s32 major, s32 minor);
|
void FilterDevicesMaxVer(s32 major, s32 minor);
|
||||||
void FilterDevicesExtension(char *szExtName);
|
void FilterDevicesExtension(char* szExtName);
|
||||||
void ResetFilters();
|
void ResetFilters();
|
||||||
s32 GetFirstFilteredDevice();
|
s32 GetFirstFilteredDevice();
|
||||||
s32 GetNextFilteredDevice();
|
s32 GetNextFilteredDevice();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
|
||||||
// Detect the cpu, so we'll know which optimizations to use
|
// Detect the CPU, so we'll know which optimizations to use
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -78,11 +78,11 @@ struct CPUInfo
|
|||||||
// Call Detect()
|
// Call Detect()
|
||||||
explicit CPUInfo();
|
explicit CPUInfo();
|
||||||
|
|
||||||
// Turn the cpu info into a string we can show
|
// Turn the CPU info into a string we can show
|
||||||
std::string Summarize();
|
std::string Summarize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Detects the various cpu features
|
// Detects the various CPU features
|
||||||
void Detect();
|
void Detect();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under GPLv2
|
// Licensed under GPLv2
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
|
||||||
// see IniFile.h
|
// see IniFile.h
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -292,7 +291,6 @@ bool IniFile::GetLines(const std::string& sectionName, std::vector<std::string>*
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IniFile::SortSections()
|
void IniFile::SortSections()
|
||||||
{
|
{
|
||||||
sections.sort();
|
sections.sort();
|
||||||
|
@ -81,7 +81,7 @@ CPUInfo::CPUInfo()
|
|||||||
Detect();
|
Detect();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detects the various cpu features
|
// Detects the various CPU features
|
||||||
void CPUInfo::Detect()
|
void CPUInfo::Detect()
|
||||||
{
|
{
|
||||||
memset(this, 0, sizeof(*this));
|
memset(this, 0, sizeof(*this));
|
||||||
@ -104,7 +104,7 @@ void CPUInfo::Detect()
|
|||||||
int cpu_id[4];
|
int cpu_id[4];
|
||||||
memset(brand_string, 0, sizeof(brand_string));
|
memset(brand_string, 0, sizeof(brand_string));
|
||||||
|
|
||||||
// Detect CPU's CPUID capabilities, and grab cpu string
|
// Detect CPU's CPUID capabilities, and grab CPU string
|
||||||
__cpuid(cpu_id, 0x00000000);
|
__cpuid(cpu_id, 0x00000000);
|
||||||
u32 max_std_fn = cpu_id[0]; // EAX
|
u32 max_std_fn = cpu_id[0]; // EAX
|
||||||
*((int *)brand_string) = cpu_id[1];
|
*((int *)brand_string) = cpu_id[1];
|
||||||
@ -225,7 +225,7 @@ void CPUInfo::Detect()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn the cpu info into a string we can show
|
// Turn the CPU info into a string we can show
|
||||||
std::string CPUInfo::Summarize()
|
std::string CPUInfo::Summarize()
|
||||||
{
|
{
|
||||||
std::string sum(cpu_string);
|
std::string sum(cpu_string);
|
||||||
|
@ -568,7 +568,7 @@ void XEmitter::NOP(size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XEmitter::PAUSE() {Write8(0xF3); NOP();} //use in tight spinloops for energy saving on some cpu
|
void XEmitter::PAUSE() {Write8(0xF3); NOP();} //use in tight spinloops for energy saving on some CPU
|
||||||
void XEmitter::CLC() {CheckFlags(); Write8(0xF8);} //clear carry
|
void XEmitter::CLC() {CheckFlags(); Write8(0xF8);} //clear carry
|
||||||
void XEmitter::CMC() {CheckFlags(); Write8(0xF5);} //flip carry
|
void XEmitter::CMC() {CheckFlags(); Write8(0xF5);} //flip carry
|
||||||
void XEmitter::STC() {CheckFlags(); Write8(0xF9);} //set carry
|
void XEmitter::STC() {CheckFlags(); Write8(0xF9);} //set carry
|
||||||
|
@ -385,7 +385,7 @@ public:
|
|||||||
void SetJumpTarget(const FixupBranch &branch);
|
void SetJumpTarget(const FixupBranch &branch);
|
||||||
|
|
||||||
void SETcc(CCFlags flag, OpArg dest);
|
void SETcc(CCFlags flag, OpArg dest);
|
||||||
// Note: CMOV brings small if any benefit on current cpus.
|
// Note: CMOV brings small if any benefit on current CPUs.
|
||||||
void CMOVcc(int bits, X64Reg dest, OpArg src, CCFlags flag);
|
void CMOVcc(int bits, X64Reg dest, OpArg src, CCFlags flag);
|
||||||
|
|
||||||
// Fences
|
// Fences
|
||||||
|
@ -305,7 +305,7 @@ bool CBoot::EmulatedBS2_Wii()
|
|||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Faking Wii BS2...");
|
INFO_LOG(BOOT, "Faking Wii BS2...");
|
||||||
|
|
||||||
// setup wii memory
|
// setup Wii memory
|
||||||
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
||||||
if (VolumeHandler::IsValid())
|
if (VolumeHandler::IsValid())
|
||||||
CountryCode = VolumeHandler::GetVolume()->GetCountry();
|
CountryCode = VolumeHandler::GetVolume()->GetCountry();
|
||||||
|
@ -86,7 +86,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
|
|||||||
|
|
||||||
if (titleID == TITLEID_SYSMENU)
|
if (titleID == TITLEID_SYSMENU)
|
||||||
HLE_IPC_CreateVirtualFATFilesystem();
|
HLE_IPC_CreateVirtualFATFilesystem();
|
||||||
// setup wii mem
|
// setup Wii memory
|
||||||
if (!SetupWiiMemory(ContentLoader.GetCountry()))
|
if (!SetupWiiMemory(ContentLoader.GetCountry()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ bool BootCore(const std::string& _rFilename)
|
|||||||
StartUp.bRunCompareClient = false;
|
StartUp.bRunCompareClient = false;
|
||||||
StartUp.bRunCompareServer = false;
|
StartUp.bRunCompareServer = false;
|
||||||
|
|
||||||
// This is saved seperately from everything because it can be changed in SConfig::AutoSetup()
|
// This is saved separately from everything because it can be changed in SConfig::AutoSetup()
|
||||||
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;
|
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;
|
||||||
|
|
||||||
// If for example the ISO file is bad we return here
|
// If for example the ISO file is bad we return here
|
||||||
|
@ -104,10 +104,10 @@ struct SConfig : NonCopyable
|
|||||||
|
|
||||||
SysConf* m_SYSCONF;
|
SysConf* m_SYSCONF;
|
||||||
|
|
||||||
// save settings
|
// Save settings
|
||||||
void SaveSettings();
|
void SaveSettings();
|
||||||
|
|
||||||
// load settings
|
// Load settings
|
||||||
void LoadSettings();
|
void LoadSettings();
|
||||||
|
|
||||||
// Return the permanent and somewhat globally used instance of this struct
|
// Return the permanent and somewhat globally used instance of this struct
|
||||||
|
@ -358,7 +358,7 @@ void EmuThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pad::Initialize(s_window_handle);
|
Pad::Initialize(s_window_handle);
|
||||||
// Load and Init Wiimotes - only if we are booting in wii mode
|
// Load and Init Wiimotes - only if we are booting in Wii mode
|
||||||
if (core_parameter.bWii)
|
if (core_parameter.bWii)
|
||||||
{
|
{
|
||||||
Wiimote::Initialize(s_window_handle, !s_state_filename.empty());
|
Wiimote::Initialize(s_window_handle, !s_state_filename.empty());
|
||||||
@ -398,7 +398,7 @@ void EmuThread()
|
|||||||
Host_UpdateDisasmDialog();
|
Host_UpdateDisasmDialog();
|
||||||
Host_UpdateMainFrame();
|
Host_UpdateMainFrame();
|
||||||
|
|
||||||
// Determine the cpu thread function
|
// Determine the CPU thread function
|
||||||
void (*cpuThreadFunc)(void);
|
void (*cpuThreadFunc)(void);
|
||||||
if (core_parameter.m_BootType == SCoreStartupParameter::BOOT_DFF)
|
if (core_parameter.m_BootType == SCoreStartupParameter::BOOT_DFF)
|
||||||
cpuThreadFunc = FifoPlayerThread;
|
cpuThreadFunc = FifoPlayerThread;
|
||||||
@ -582,15 +582,15 @@ bool PauseAndLock(bool doLock, bool unpauseOnUnlock)
|
|||||||
if (doLock ? s_pause_and_lock_depth++ : --s_pause_and_lock_depth)
|
if (doLock ? s_pause_and_lock_depth++ : --s_pause_and_lock_depth)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// first pause or unpause the cpu
|
// first pause or unpause the CPU
|
||||||
bool wasUnpaused = CCPU::PauseAndLock(doLock, unpauseOnUnlock);
|
bool wasUnpaused = CCPU::PauseAndLock(doLock, unpauseOnUnlock);
|
||||||
ExpansionInterface::PauseAndLock(doLock, unpauseOnUnlock);
|
ExpansionInterface::PauseAndLock(doLock, unpauseOnUnlock);
|
||||||
|
|
||||||
// audio has to come after cpu, because cpu thread can wait for audio thread (m_throttle).
|
// audio has to come after CPU, because CPU thread can wait for audio thread (m_throttle).
|
||||||
AudioCommon::PauseAndLock(doLock, unpauseOnUnlock);
|
AudioCommon::PauseAndLock(doLock, unpauseOnUnlock);
|
||||||
DSP::GetDSPEmulator()->PauseAndLock(doLock, unpauseOnUnlock);
|
DSP::GetDSPEmulator()->PauseAndLock(doLock, unpauseOnUnlock);
|
||||||
|
|
||||||
// video has to come after cpu, because cpu thread can wait for video thread (s_efbAccessRequested).
|
// video has to come after CPU, because CPU thread can wait for video thread (s_efbAccessRequested).
|
||||||
g_video_backend->PauseAndLock(doLock, unpauseOnUnlock);
|
g_video_backend->PauseAndLock(doLock, unpauseOnUnlock);
|
||||||
return wasUnpaused;
|
return wasUnpaused;
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,9 @@ void Shutdown();
|
|||||||
std::string StopMessage(bool, std::string);
|
std::string StopMessage(bool, std::string);
|
||||||
|
|
||||||
bool IsRunning();
|
bool IsRunning();
|
||||||
bool IsRunningAndStarted(); // is running and the cpu loop has been entered
|
bool IsRunningAndStarted(); // is running and the CPU loop has been entered
|
||||||
bool IsRunningInCurrentThread(); // this tells us whether we are running in the cpu thread.
|
bool IsRunningInCurrentThread(); // this tells us whether we are running in the CPU thread.
|
||||||
bool IsCPUThread(); // this tells us whether we are the cpu thread.
|
bool IsCPUThread(); // this tells us whether we are the CPU thread.
|
||||||
bool IsGPUThread();
|
bool IsGPUThread();
|
||||||
|
|
||||||
void SetState(EState _State);
|
void SetState(EState _State);
|
||||||
|
@ -253,7 +253,7 @@ static void AddEventToQueue(Event* ne)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This must be run ONLY from within the cpu thread
|
// This must be run ONLY from within the CPU thread
|
||||||
// cyclesIntoFuture may be VERY inaccurate if called from anything else
|
// cyclesIntoFuture may be VERY inaccurate if called from anything else
|
||||||
// than Advance
|
// than Advance
|
||||||
void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
|
void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||||
|
@ -153,7 +153,7 @@ u16 dsp_read_accelerator()
|
|||||||
// TODO: Take GAIN into account
|
// TODO: Take GAIN into account
|
||||||
// adpcm = 0, pcm8 = 0x100, pcm16 = 0x800
|
// adpcm = 0, pcm8 = 0x100, pcm16 = 0x800
|
||||||
// games using pcm8 : Phoenix Wright Ace Attorney (Wiiware), Megaman 9-10 (WiiWare)
|
// games using pcm8 : Phoenix Wright Ace Attorney (Wiiware), Megaman 9-10 (WiiWare)
|
||||||
// games using pcm16: gc sega games, ...
|
// games using pcm16: GC Sega games, ...
|
||||||
|
|
||||||
// Check for loop.
|
// Check for loop.
|
||||||
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
|
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
|
||||||
|
@ -182,7 +182,7 @@
|
|||||||
#define EXP_4 4 // 0x0008
|
#define EXP_4 4 // 0x0008
|
||||||
#define EXP_ACCOV 5 // 0x000a accelerator address overflow
|
#define EXP_ACCOV 5 // 0x000a accelerator address overflow
|
||||||
#define EXP_6 6 // 0x000c
|
#define EXP_6 6 // 0x000c
|
||||||
#define EXP_INT 7 // 0x000e external int (message from cpu)
|
#define EXP_INT 7 // 0x000e external int (message from CPU)
|
||||||
|
|
||||||
struct DSP_Regs
|
struct DSP_Regs
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,6 @@ public:
|
|||||||
// calls must be balanced and non-recursive (once with doLock true, then once with doLock false).
|
// calls must be balanced and non-recursive (once with doLock true, then once with doLock false).
|
||||||
// intended (but not required) to be called from another thread,
|
// intended (but not required) to be called from another thread,
|
||||||
// e.g. when the GUI thread wants to make sure everything is paused so that it can create a savestate.
|
// e.g. when the GUI thread wants to make sure everything is paused so that it can create a savestate.
|
||||||
// the return value is whether the cpu was unpaused before the call.
|
// the return value is whether the CPU was unpaused before the call.
|
||||||
static bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
static bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
||||||
};
|
};
|
||||||
|
@ -135,10 +135,10 @@ struct ARAM_DMA
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// So we may abstract gc/wii differences a little
|
// So we may abstract GC/Wii differences a little
|
||||||
struct ARAMInfo
|
struct ARAMInfo
|
||||||
{
|
{
|
||||||
bool wii_mode; // wii EXRAM is managed in Memory:: so we need to skip statesaving, etc
|
bool wii_mode; // Wii EXRAM is managed in Memory:: so we need to skip statesaving, etc
|
||||||
u32 size;
|
u32 size;
|
||||||
u32 mask;
|
u32 mask;
|
||||||
u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc...
|
u8* ptr; // aka audio ram, auxiliary ram, MEM2, EXRAM, etc...
|
||||||
@ -645,7 +645,7 @@ static void Do_ARAM_DMA()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// (shuffle2) I still don't believe that this hack is actually needed... :(
|
// (shuffle2) I still don't believe that this hack is actually needed... :(
|
||||||
// Maybe the wii sports ucode is processed incorrectly?
|
// Maybe the Wii Sports ucode is processed incorrectly?
|
||||||
// (LM) It just means that dsp reads via '0xffdd' on WII can end up in EXRAM or main RAM
|
// (LM) It just means that dsp reads via '0xffdd' on WII can end up in EXRAM or main RAM
|
||||||
u8 ReadARAM(u32 _iAddress)
|
u8 ReadARAM(u32 _iAddress)
|
||||||
{
|
{
|
||||||
|
@ -185,7 +185,7 @@ void DSPHLE::DoState(PointerWrap &p)
|
|||||||
m_MailHandler.DoState(p);
|
m_MailHandler.DoState(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mailbox fuctions
|
// Mailbox functions
|
||||||
unsigned short DSPHLE::DSP_ReadMailBoxHigh(bool _CPUMailbox)
|
unsigned short DSPHLE::DSP_ReadMailBoxHigh(bool _CPUMailbox)
|
||||||
{
|
{
|
||||||
if (_CPUMailbox)
|
if (_CPUMailbox)
|
||||||
@ -237,7 +237,7 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other DSP fuctions
|
// Other DSP functions
|
||||||
u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value)
|
u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value)
|
||||||
{
|
{
|
||||||
DSP::UDSPControl Temp(_Value);
|
DSP::UDSPControl Temp(_Value);
|
||||||
|
@ -312,7 +312,7 @@ struct AXPBWii
|
|||||||
u16 pad[12]; // align us, captain! (32B)
|
u16 pad[12]; // align us, captain! (32B)
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: All these enums have changed a lot for wii
|
// TODO: All these enums have changed a lot for Wii
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
AUDIOFORMAT_ADPCM = 0,
|
AUDIOFORMAT_ADPCM = 0,
|
||||||
|
@ -38,22 +38,22 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
|
|||||||
INFO_LOG(DSPHLE, "Switching to GBA ucode");
|
INFO_LOG(DSPHLE, "Switching to GBA ucode");
|
||||||
return new GBAUCode(dsphle, crc);
|
return new GBAUCode(dsphle, crc);
|
||||||
|
|
||||||
case 0x3ad3b7ac: // Naruto3, Paper Mario - The Thousand Year Door
|
case 0x3ad3b7ac: // Naruto 3, Paper Mario - The Thousand Year Door
|
||||||
case 0x3daf59b9: // Alien Hominid
|
case 0x3daf59b9: // Alien Hominid
|
||||||
case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball 1/2,cubivore,puzzlecollection,wario,
|
case 0x4e8a8b21: // spdemo, Crazy Taxi, 18 Wheeler, Disney, Monkeyball 1/2, Cubivore, Nintendo Puzzle Collection, Wario,
|
||||||
// capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat,
|
// Capcom vs. SNK 2, Naruto 2, Lost Kingdoms, Star Fox, Mario Party 4, Mortal Kombat,
|
||||||
// smugglers run warzone, smash brothers, sonic mega collection, ZooCube
|
// Smugglers Run Warzone, Smash Brothers, Sonic Mega Collection, ZooCube
|
||||||
// nddemo, starfox
|
// nddemo, Star Fox
|
||||||
case 0x07f88145: // bustamove, ikaruga, fzero, robotech battle cry, star soldier, soul calibur2,
|
case 0x07f88145: // bustamove, Ikaruga, F-Zero GX, Robotech Battle Cry, Star Soldier, Soul Calibur 2,
|
||||||
// Zelda:OOT, Tony hawk, viewtiful joe
|
// Zelda:OOT, Tony Hawk, Viewtiful Joe
|
||||||
case 0xe2136399: // billy hatcher, dragonballz, mario party 5, TMNT, ava1080
|
case 0xe2136399: // Billy Hatcher, Dragon Ball Z, Mario Party 5, TMNT, 1080° Avalanche
|
||||||
case 0x3389a79e: // MP1/MP2 Wii (Metroid Prime Trilogy)
|
case 0x3389a79e: // MP1/MP2 Wii (Metroid Prime Trilogy)
|
||||||
INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", crc);
|
INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", crc);
|
||||||
return new AXUCode(dsphle, crc);
|
return new AXUCode(dsphle, crc);
|
||||||
|
|
||||||
case 0x6ba3b3ea: // IPL - PAL
|
case 0x6ba3b3ea: // IPL - PAL
|
||||||
case 0x24b22038: // IPL - NTSC/NTSC-JAP
|
case 0x24b22038: // IPL - NTSC/NTSC-JAP
|
||||||
case 0x42f64ac4: // Luigi
|
case 0x42f64ac4: // Luigi's Mansion
|
||||||
case 0x4be6a5cb: // AC, Pikmin
|
case 0x4be6a5cb: // AC, Pikmin
|
||||||
INFO_LOG(DSPHLE, "CRC %08x: JAC (early Zelda) ucode chosen", crc);
|
INFO_LOG(DSPHLE, "CRC %08x: JAC (early Zelda) ucode chosen", crc);
|
||||||
return new ZeldaUCode(dsphle, crc);
|
return new ZeldaUCode(dsphle, crc);
|
||||||
@ -61,7 +61,7 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
|
|||||||
case 0x6CA33A6D: // DK Jungle Beat
|
case 0x6CA33A6D: // DK Jungle Beat
|
||||||
case 0x86840740: // Zelda WW - US
|
case 0x86840740: // Zelda WW - US
|
||||||
case 0x56d36052: // Mario Sunshine
|
case 0x56d36052: // Mario Sunshine
|
||||||
case 0x2fcdf1ec: // Mario Kart, zelda 4 swords
|
case 0x2fcdf1ec: // Mario Kart, Zelda 4 Swords
|
||||||
case 0x267fd05a: // Pikmin PAL
|
case 0x267fd05a: // Pikmin PAL
|
||||||
INFO_LOG(DSPHLE, "CRC %08x: Zelda ucode chosen", crc);
|
INFO_LOG(DSPHLE, "CRC %08x: Zelda ucode chosen", crc);
|
||||||
return new ZeldaUCode(dsphle, crc);
|
return new ZeldaUCode(dsphle, crc);
|
||||||
@ -76,8 +76,8 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii)
|
|||||||
|
|
||||||
case 0x2ea36ce6: // Some Wii demos
|
case 0x2ea36ce6: // Some Wii demos
|
||||||
case 0x5ef56da3: // AX demo
|
case 0x5ef56da3: // AX demo
|
||||||
case 0x347112ba: // raving rabbits
|
case 0x347112ba: // Raving Rabbids
|
||||||
case 0xfa450138: // wii sports - PAL
|
case 0xfa450138: // Wii Sports - PAL
|
||||||
case 0xadbc06bd: // Elebits
|
case 0xadbc06bd: // Elebits
|
||||||
case 0x4cc52064: // Bleach: Versus Crusade
|
case 0x4cc52064: // Bleach: Versus Crusade
|
||||||
case 0xd9c4bf34: // WiiMenu
|
case 0xd9c4bf34: // WiiMenu
|
||||||
|
@ -146,7 +146,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// These map CRC to behaviour.
|
// These map CRC to behavior.
|
||||||
|
|
||||||
// DMA version
|
// DMA version
|
||||||
// - sound data transferred using DMA instead of accelerator
|
// - sound data transferred using DMA instead of accelerator
|
||||||
@ -173,7 +173,7 @@ private:
|
|||||||
{
|
{
|
||||||
case 0x6ba3b3ea: // IPL - PAL
|
case 0x6ba3b3ea: // IPL - PAL
|
||||||
case 0x24b22038: // IPL - NTSC/NTSC-JAP
|
case 0x24b22038: // IPL - NTSC/NTSC-JAP
|
||||||
case 0x42f64ac4: // Luigi
|
case 0x42f64ac4: // Luigi's Mansion
|
||||||
case 0x4be6a5cb: // AC, Pikmin NTSC
|
case 0x4be6a5cb: // AC, Pikmin NTSC
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@ -296,7 +296,7 @@ void CEXIIPL::TransferByte(u8& _uByte)
|
|||||||
case REGION_WRTC0:
|
case REGION_WRTC0:
|
||||||
case REGION_WRTC1:
|
case REGION_WRTC1:
|
||||||
case REGION_WRTC2:
|
case REGION_WRTC2:
|
||||||
// WII only RTC flags... afaik just the wii menu initialize it
|
// WII only RTC flags... afaik just the Wii menu initialize it
|
||||||
default:
|
default:
|
||||||
if ((m_uAddress >> 6) < ROM_SIZE)
|
if ((m_uAddress >> 6) < ROM_SIZE)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ private:
|
|||||||
int ring_pos;
|
int ring_pos;
|
||||||
u8 ring_buffer[64 * sample_size];
|
u8 ring_buffer[64 * sample_size];
|
||||||
|
|
||||||
// 0 to disable interrupts, else it will be checked against current cpu ticks
|
// 0 to disable interrupts, else it will be checked against current CPU ticks
|
||||||
// to determine if interrupt should be raised
|
// to determine if interrupt should be raised
|
||||||
u64 next_int_ticks;
|
u64 next_int_ticks;
|
||||||
void UpdateNextInterruptTicks();
|
void UpdateNextInterruptTicks();
|
||||||
|
@ -190,7 +190,7 @@ static const char *Debug_GetInterruptName(u32 _causemask)
|
|||||||
|
|
||||||
void SetInterrupt(u32 _causemask, bool _bSet)
|
void SetInterrupt(u32 _causemask, bool _bSet)
|
||||||
{
|
{
|
||||||
// TODO(ector): add sanity check that current thread id is cpu thread
|
// TODO(ector): add sanity check that current thread id is CPU thread
|
||||||
|
|
||||||
if (_bSet && !(m_InterruptCause & _causemask))
|
if (_bSet && !(m_InterruptCause & _causemask))
|
||||||
{
|
{
|
||||||
|
@ -270,7 +270,7 @@ void Init()
|
|||||||
g_StatusReg.Hex = 0;
|
g_StatusReg.Hex = 0;
|
||||||
|
|
||||||
g_EXIClockCount.Hex = 0;
|
g_EXIClockCount.Hex = 0;
|
||||||
//g_EXIClockCount.LOCK = 1; // Supposedly set on reset, but logs from real wii don't look like it is...
|
//g_EXIClockCount.LOCK = 1; // Supposedly set on reset, but logs from real Wii don't look like it is...
|
||||||
memset(g_SIBuffer, 0, 128);
|
memset(g_SIBuffer, 0, 128);
|
||||||
|
|
||||||
changeDevice = CoreTiming::RegisterEvent("ChangeSIDevice", ChangeDeviceCallback);
|
changeDevice = CoreTiming::RegisterEvent("ChangeSIDevice", ChangeDeviceCallback);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "Core/HW/SI_DeviceDanceMat.h"
|
#include "Core/HW/SI_DeviceDanceMat.h"
|
||||||
#include "Core/HW/SystemTimers.h"
|
#include "Core/HW/SystemTimers.h"
|
||||||
|
|
||||||
// --- Dance mat gamecube controller ---
|
// --- Dance mat GameCube controller ---
|
||||||
CSIDevice_DanceMat::CSIDevice_DanceMat(SIDevices device, int _iDeviceNumber)
|
CSIDevice_DanceMat::CSIDevice_DanceMat(SIDevices device, int _iDeviceNumber)
|
||||||
: ISIDevice(device, _iDeviceNumber)
|
: ISIDevice(device, _iDeviceNumber)
|
||||||
, m_TButtonComboStart(0)
|
, m_TButtonComboStart(0)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "Core/HW/SI_Device.h"
|
#include "Core/HW/SI_Device.h"
|
||||||
#include "InputCommon/GCPadStatus.h"
|
#include "InputCommon/GCPadStatus.h"
|
||||||
|
|
||||||
// standard gamecube controller
|
// standard GameCube controller
|
||||||
class CSIDevice_DanceMat : public ISIDevice
|
class CSIDevice_DanceMat : public ISIDevice
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "Core/HW/SI_DeviceGCController.h"
|
#include "Core/HW/SI_DeviceGCController.h"
|
||||||
#include "Core/HW/SystemTimers.h"
|
#include "Core/HW/SystemTimers.h"
|
||||||
|
|
||||||
// --- standard gamecube controller ---
|
// --- standard GameCube controller ---
|
||||||
CSIDevice_GCController::CSIDevice_GCController(SIDevices device, int _iDeviceNumber)
|
CSIDevice_GCController::CSIDevice_GCController(SIDevices device, int _iDeviceNumber)
|
||||||
: ISIDevice(device, _iDeviceNumber)
|
: ISIDevice(device, _iDeviceNumber)
|
||||||
, m_TButtonComboStart(0)
|
, m_TButtonComboStart(0)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "InputCommon/GCPadStatus.h"
|
#include "InputCommon/GCPadStatus.h"
|
||||||
|
|
||||||
|
|
||||||
// standard gamecube controller
|
// standard GameCube controller
|
||||||
class CSIDevice_GCController : public ISIDevice
|
class CSIDevice_GCController : public ISIDevice
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "Core/HW/SI_DeviceGCSteeringWheel.h"
|
#include "Core/HW/SI_DeviceGCSteeringWheel.h"
|
||||||
#include "Core/HW/SystemTimers.h"
|
#include "Core/HW/SystemTimers.h"
|
||||||
|
|
||||||
// --- standard gamecube controller ---
|
// --- standard GameCube controller ---
|
||||||
CSIDevice_GCSteeringWheel::CSIDevice_GCSteeringWheel(SIDevices device, int _iDeviceNumber)
|
CSIDevice_GCSteeringWheel::CSIDevice_GCSteeringWheel(SIDevices device, int _iDeviceNumber)
|
||||||
: ISIDevice(device, _iDeviceNumber)
|
: ISIDevice(device, _iDeviceNumber)
|
||||||
, m_TButtonComboStart(0)
|
, m_TButtonComboStart(0)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "Core/HW/SI_Device.h"
|
#include "Core/HW/SI_Device.h"
|
||||||
#include "InputCommon/GCPadStatus.h"
|
#include "InputCommon/GCPadStatus.h"
|
||||||
|
|
||||||
// standard gamecube controller
|
// standard GameCube controller
|
||||||
class CSIDevice_GCSteeringWheel : public ISIDevice
|
class CSIDevice_GCSteeringWheel : public ISIDevice
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
@ -237,7 +237,7 @@ void Init()
|
|||||||
// System internal sample rate is fixed at 32KHz * 4 (16bit Stereo) / 32 bytes DMA
|
// System internal sample rate is fixed at 32KHz * 4 (16bit Stereo) / 32 bytes DMA
|
||||||
AUDIO_DMA_PERIOD = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32);
|
AUDIO_DMA_PERIOD = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32);
|
||||||
|
|
||||||
// Emulated gekko <-> flipper bus speed ratio (cpu clock / flipper clock)
|
// Emulated gekko <-> flipper bus speed ratio (CPU clock / flipper clock)
|
||||||
CP_PERIOD = GetTicksPerSecond() / 10000;
|
CP_PERIOD = GetTicksPerSecond() / 10000;
|
||||||
|
|
||||||
Common::Timer::IncreaseResolution();
|
Common::Timer::IncreaseResolution();
|
||||||
|
@ -1085,7 +1085,7 @@ void Wiimote::ReadData(const wm_read_data* const rd)
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// read mem to be sent to wii
|
// read memory to be sent to Wii
|
||||||
memcpy(block, m_eeprom + address, size);
|
memcpy(block, m_eeprom + address, size);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -331,7 +331,7 @@ bool Wiimote::Step()
|
|||||||
if (!m_read_requests.empty())
|
if (!m_read_requests.empty())
|
||||||
{
|
{
|
||||||
ReadRequest& rr = m_read_requests.front();
|
ReadRequest& rr = m_read_requests.front();
|
||||||
// send up to 16 bytes to the wii
|
// send up to 16 bytes to the Wii
|
||||||
SendReadDataReply(rr);
|
SendReadDataReply(rr);
|
||||||
//SendReadDataReply(rr.channel, rr);
|
//SendReadDataReply(rr.channel, rr);
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ struct wm_report
|
|||||||
struct wm_leds
|
struct wm_leds
|
||||||
{
|
{
|
||||||
u8 rumble : 1;
|
u8 rumble : 1;
|
||||||
// real wii also sets bit 0x2 (unknown purpose)
|
// real Wii also sets bit 0x2 (unknown purpose)
|
||||||
u8 : 3;
|
u8 : 3;
|
||||||
u8 leds : 4;
|
u8 leds : 4;
|
||||||
};
|
};
|
||||||
@ -347,7 +347,7 @@ struct wm_leds
|
|||||||
struct wm_report_mode
|
struct wm_report_mode
|
||||||
{
|
{
|
||||||
u8 rumble : 1;
|
u8 rumble : 1;
|
||||||
// unsure what "all_the_time" actually is, the real wii does set it (bit 0x2)
|
// unsure what "all_the_time" actually is, the real Wii does set it (bit 0x2)
|
||||||
u8 all_the_time : 1;
|
u8 all_the_time : 1;
|
||||||
u8 continuous : 1;
|
u8 continuous : 1;
|
||||||
u8 : 5;
|
u8 : 5;
|
||||||
|
@ -167,7 +167,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
|
|||||||
{
|
{
|
||||||
case DVDLowInquiry:
|
case DVDLowInquiry:
|
||||||
{
|
{
|
||||||
// (shuffle2) Taken from my wii
|
// (shuffle2) Taken from my Wii
|
||||||
Memory::Write_U32(0x00000002, _BufferOut);
|
Memory::Write_U32(0x00000002, _BufferOut);
|
||||||
Memory::Write_U32(0x20060526, _BufferOut + 4);
|
Memory::Write_U32(0x20060526, _BufferOut + 4);
|
||||||
// This was in the oubuf even though this cmd is only supposed to reply with 64bits
|
// This was in the oubuf even though this cmd is only supposed to reply with 64bits
|
||||||
|
@ -84,7 +84,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
|
|||||||
{
|
{
|
||||||
case IOCTLV_READ_DIR:
|
case IOCTLV_READ_DIR:
|
||||||
{
|
{
|
||||||
// the wii uses this function to define the type (dir or file)
|
// the Wii uses this function to define the type (dir or file)
|
||||||
std::string DirName(HLE_IPC_BuildFilename(Memory::GetString(
|
std::string DirName(HLE_IPC_BuildFilename(Memory::GetString(
|
||||||
CommandBuffer.InBuffer[0].m_Address, CommandBuffer.InBuffer[0].m_Size)));
|
CommandBuffer.InBuffer[0].m_Address, CommandBuffer.InBuffer[0].m_Size)));
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ bool CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
ERROR CODES:
|
ERROR CODES:
|
||||||
-4 Cant find device specified
|
-4 Can't find device specified
|
||||||
*/
|
*/
|
||||||
|
|
||||||
u32 dev_num = Memory::Read_U32(BufferIn+0x10);
|
u32 dev_num = Memory::Read_U32(BufferIn+0x10);
|
||||||
|
@ -785,7 +785,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
|
|||||||
optval[4], optval[5],optval[6], optval[7], optval[8], optval[9], optval[10], optval[11], optval[12], optval[13], optval[14],
|
optval[4], optval[5],optval[6], optval[7], optval[8], optval[9], optval[10], optval[11], optval[12], optval[13], optval[14],
|
||||||
optval[15], optval[16], optval[17], optval[18], optval[19]);
|
optval[15], optval[16], optval[17], optval[18], optval[19]);
|
||||||
|
|
||||||
//TODO: bug booto about this, 0x2005 most likely timeout related, default value on wii is , 0x2001 is most likely tcpnodelay
|
//TODO: bug booto about this, 0x2005 most likely timeout related, default value on Wii is , 0x2001 is most likely tcpnodelay
|
||||||
if (level == 6 && (optname == 0x2005 || optname == 0x2001))
|
if (level == 6 && (optname == 0x2005 || optname == 0x2001))
|
||||||
{
|
{
|
||||||
ReturnValue = 0;
|
ReturnValue = 0;
|
||||||
|
@ -531,14 +531,14 @@ private:
|
|||||||
// Seconds between 1.1.1970 and 4.1.2008 16:00:38
|
// Seconds between 1.1.1970 and 4.1.2008 16:00:38
|
||||||
static const u64 wii_bias = 0x477E5826;
|
static const u64 wii_bias = 0x477E5826;
|
||||||
|
|
||||||
// Returns seconds since wii epoch
|
// Returns seconds since Wii epoch
|
||||||
// +/- any bias set from IOCTL_NW24_SET_UNIVERSAL_TIME
|
// +/- any bias set from IOCTL_NW24_SET_UNIVERSAL_TIME
|
||||||
u64 GetAdjustedUTC() const
|
u64 GetAdjustedUTC() const
|
||||||
{
|
{
|
||||||
return Common::Timer::GetTimeSinceJan1970() - wii_bias + utcdiff;
|
return Common::Timer::GetTimeSinceJan1970() - wii_bias + utcdiff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the difference between what the wii thinks is UTC and
|
// Store the difference between what the Wii thinks is UTC and
|
||||||
// what the host OS thinks
|
// what the host OS thinks
|
||||||
void SetAdjustedUTC(u64 wii_utc)
|
void SetAdjustedUTC(u64 wii_utc)
|
||||||
{
|
{
|
||||||
|
@ -542,16 +542,16 @@ bool NetPlayClient::GetNetPads(const u8 pad_nb, GCPadStatus* pad_status)
|
|||||||
{
|
{
|
||||||
// The interface for this is extremely silly.
|
// The interface for this is extremely silly.
|
||||||
//
|
//
|
||||||
// Imagine a physical device that links three Gamecubes together
|
// Imagine a physical device that links three GameCubes together
|
||||||
// and emulates NetPlay that way. Which GameCube controls which
|
// and emulates NetPlay that way. Which GameCube controls which
|
||||||
// in-game controllers can be configured on the device (m_pad_map)
|
// in-game controllers can be configured on the device (m_pad_map)
|
||||||
// but which sockets on each individual GameCube should be used
|
// but which sockets on each individual GameCube should be used
|
||||||
// to control which players? The solution that Dolphin uses is
|
// to control which players? The solution that Dolphin uses is
|
||||||
// that we hardcode the knowledge that they go in order, so if
|
// that we hardcode the knowledge that they go in order, so if
|
||||||
// you have a 3P game with three gamecubes, then every single
|
// you have a 3P game with three GameCubes, then every single
|
||||||
// controller should be plugged into slot 1.
|
// controller should be plugged into slot 1.
|
||||||
//
|
//
|
||||||
// If you have a 4P game, then one of the Gamecubes will have
|
// If you have a 4P game, then one of the GameCubes will have
|
||||||
// a controller plugged into slot 1, and another in slot 2.
|
// a controller plugged into slot 1, and another in slot 2.
|
||||||
//
|
//
|
||||||
// The slot number is the "local" pad number, and what player
|
// The slot number is the "local" pad number, and what player
|
||||||
|
@ -120,7 +120,7 @@ void Interpreter::rfid(UGeckoInstruction _inst)
|
|||||||
m_EndBlock = true;
|
m_EndBlock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sc isn't really used for anything important in gc games (just for a write barrier) so we really don't have to emulate it.
|
// sc isn't really used for anything important in GameCube games (just for a write barrier) so we really don't have to emulate it.
|
||||||
// We do it anyway, though :P
|
// We do it anyway, though :P
|
||||||
void Interpreter::sc(UGeckoInstruction _inst)
|
void Interpreter::sc(UGeckoInstruction _inst)
|
||||||
{
|
{
|
||||||
|
@ -160,7 +160,7 @@ enum Opcode
|
|||||||
InterpreterBranch,
|
InterpreterBranch,
|
||||||
|
|
||||||
IdleBranch, // branch operation belonging to idle loop
|
IdleBranch, // branch operation belonging to idle loop
|
||||||
ShortIdleLoop, // Idle loop seen in homebrew like wii mahjong,
|
ShortIdleLoop, // Idle loop seen in homebrew like Wii mahjong,
|
||||||
// just a branch
|
// just a branch
|
||||||
|
|
||||||
// used for exception checking, at least until someone
|
// used for exception checking, at least until someone
|
||||||
|
@ -34,8 +34,8 @@ void EnableCompression(bool compression);
|
|||||||
bool ReadHeader(const std::string& filename, StateHeader& header);
|
bool ReadHeader(const std::string& filename, StateHeader& header);
|
||||||
|
|
||||||
// These don't happen instantly - they get scheduled as events.
|
// These don't happen instantly - they get scheduled as events.
|
||||||
// ...But only if we're not in the main cpu thread.
|
// ...But only if we're not in the main CPU thread.
|
||||||
// If we're in the main cpu thread then they run immediately instead
|
// If we're in the main CPU thread then they run immediately instead
|
||||||
// because some things (like Lua) need them to run immediately.
|
// because some things (like Lua) need them to run immediately.
|
||||||
// Slots from 0-99.
|
// Slots from 0-99.
|
||||||
void Save(int slot, bool wait = false);
|
void Save(int slot, bool wait = false);
|
||||||
|
@ -36,7 +36,7 @@ const u32 kBlobCookie = 0xB10BC001;
|
|||||||
struct CompressedBlobHeader // 32 bytes
|
struct CompressedBlobHeader // 32 bytes
|
||||||
{
|
{
|
||||||
u32 magic_cookie; //0xB10BB10B
|
u32 magic_cookie; //0xB10BB10B
|
||||||
u32 sub_type; // gc image, whatever
|
u32 sub_type; // GC image, whatever
|
||||||
u64 compressed_data_size;
|
u64 compressed_data_size;
|
||||||
u64 data_size;
|
u64 data_size;
|
||||||
u32 block_size;
|
u32 block_size;
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
|
||||||
// DiscScrubber removes the garbage data from discs (currently wii only) which
|
// DiscScrubber removes the garbage data from discs (currently Wii only) which
|
||||||
// is on the disc due to encryption
|
// is on the disc due to encryption
|
||||||
|
|
||||||
// It could be adapted to gc discs, but the gain is most likely negligible,
|
// It could be adapted to GameCube discs, but the gain is most likely negligible,
|
||||||
// and having 1:1 backups of discs is always nice when they are reasonably sized
|
// and having 1:1 backups of discs is always nice when they are reasonably sized
|
||||||
|
|
||||||
// Note: the technique is inspired by Wiiscrubber, but much simpler - intentionally :)
|
// Note: the technique is inspired by Wiiscrubber, but much simpler - intentionally :)
|
||||||
|
@ -86,7 +86,7 @@ private:
|
|||||||
|
|
||||||
u32 m_totalNameSize;
|
u32 m_totalNameSize;
|
||||||
|
|
||||||
// gc has no shift, wii has 2 bit shift
|
// GameCube has no shift, Wii has 2 bit shift
|
||||||
u32 m_addressShift;
|
u32 m_addressShift;
|
||||||
|
|
||||||
// first address on disk containing file data
|
// first address on disk containing file data
|
||||||
|
@ -46,18 +46,15 @@ bool CVolumeWiiCrypted::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const
|
|||||||
// Medal Of Honor Heroes 2 read this DVD offset for PartitionsInfo
|
// Medal Of Honor Heroes 2 read this DVD offset for PartitionsInfo
|
||||||
// and, PartitionsInfo is not encrypted, let's read it directly.
|
// and, PartitionsInfo is not encrypted, let's read it directly.
|
||||||
if (!m_pReader->Read(_Offset, _Length, _pBuffer))
|
if (!m_pReader->Read(_Offset, _Length, _pBuffer))
|
||||||
{
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const
|
bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const
|
||||||
{
|
{
|
||||||
if (m_pReader == nullptr)
|
if (m_pReader == nullptr)
|
||||||
{
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
|
||||||
|
|
||||||
while (_Length > 0)
|
while (_Length > 0)
|
||||||
{
|
{
|
||||||
@ -118,16 +115,12 @@ void CVolumeWiiCrypted::GetTMD(u8* _pBuffer, u32 * _sz) const
|
|||||||
std::string CVolumeWiiCrypted::GetUniqueID() const
|
std::string CVolumeWiiCrypted::GetUniqueID() const
|
||||||
{
|
{
|
||||||
if (m_pReader == nullptr)
|
if (m_pReader == nullptr)
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
char ID[7];
|
char ID[7];
|
||||||
|
|
||||||
if (!Read(0, 6, (u8*)ID))
|
if (!Read(0, 6, (u8*)ID))
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
ID[6] = '\0';
|
ID[6] = '\0';
|
||||||
|
|
||||||
@ -149,16 +142,12 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const
|
|||||||
std::string CVolumeWiiCrypted::GetMakerID() const
|
std::string CVolumeWiiCrypted::GetMakerID() const
|
||||||
{
|
{
|
||||||
if (m_pReader == nullptr)
|
if (m_pReader == nullptr)
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
char makerID[3];
|
char makerID[3];
|
||||||
|
|
||||||
if (!Read(0x4, 0x2, (u8*)&makerID))
|
if (!Read(0x4, 0x2, (u8*)&makerID))
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
makerID[2] = '\0';
|
makerID[2] = '\0';
|
||||||
|
|
||||||
@ -181,16 +170,12 @@ std::vector<std::string> CVolumeWiiCrypted::GetNames() const
|
|||||||
u32 CVolumeWiiCrypted::GetFSTSize() const
|
u32 CVolumeWiiCrypted::GetFSTSize() const
|
||||||
{
|
{
|
||||||
if (m_pReader == nullptr)
|
if (m_pReader == nullptr)
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
u32 size;
|
u32 size;
|
||||||
|
|
||||||
if (!Read(0x428, 0x4, (u8*)&size))
|
if (!Read(0x428, 0x4, (u8*)&size))
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@ -198,16 +183,12 @@ u32 CVolumeWiiCrypted::GetFSTSize() const
|
|||||||
std::string CVolumeWiiCrypted::GetApploaderDate() const
|
std::string CVolumeWiiCrypted::GetApploaderDate() const
|
||||||
{
|
{
|
||||||
if (m_pReader == nullptr)
|
if (m_pReader == nullptr)
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
char date[16];
|
char date[16];
|
||||||
|
|
||||||
if (!Read(0x2440, 0x10, (u8*)&date))
|
if (!Read(0x2440, 0x10, (u8*)&date))
|
||||||
{
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
|
||||||
|
|
||||||
date[10] = '\0';
|
date[10] = '\0';
|
||||||
|
|
||||||
@ -217,25 +198,17 @@ std::string CVolumeWiiCrypted::GetApploaderDate() const
|
|||||||
u64 CVolumeWiiCrypted::GetSize() const
|
u64 CVolumeWiiCrypted::GetSize() const
|
||||||
{
|
{
|
||||||
if (m_pReader)
|
if (m_pReader)
|
||||||
{
|
|
||||||
return m_pReader->GetDataSize();
|
return m_pReader->GetDataSize();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 CVolumeWiiCrypted::GetRawSize() const
|
u64 CVolumeWiiCrypted::GetRawSize() const
|
||||||
{
|
{
|
||||||
if (m_pReader)
|
if (m_pReader)
|
||||||
{
|
|
||||||
return m_pReader->GetRawSize();
|
return m_pReader->GetRawSize();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVolumeWiiCrypted::CheckIntegrity() const
|
bool CVolumeWiiCrypted::CheckIntegrity() const
|
||||||
|
@ -62,7 +62,7 @@ u8* WiiWAD::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset
|
|||||||
if (_Size > 0)
|
if (_Size > 0)
|
||||||
{
|
{
|
||||||
u8* pTmpBuffer = new u8[_Size];
|
u8* pTmpBuffer = new u8[_Size];
|
||||||
_dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Cant allocate memory for WAD entry");
|
_dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Can't allocate memory for WAD entry");
|
||||||
|
|
||||||
if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
|
if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
|
||||||
{
|
{
|
||||||
@ -123,7 +123,7 @@ bool WiiWAD::IsWiiWAD(const std::string& name)
|
|||||||
CBlobBigEndianReader big_endian_reader(*blob_reader);
|
CBlobBigEndianReader big_endian_reader(*blob_reader);
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
// check for wii wad
|
// check for Wii wad
|
||||||
if (big_endian_reader.Read32(0x00) == 0x20)
|
if (big_endian_reader.Read32(0x00) == 0x20)
|
||||||
{
|
{
|
||||||
u32 wad_type = big_endian_reader.Read32(0x04);
|
u32 wad_type = big_endian_reader.Read32(0x04);
|
||||||
|
@ -307,8 +307,8 @@ void CGameListCtrl::Update()
|
|||||||
InsertColumn(COLUMN_TITLE, _("Title"));
|
InsertColumn(COLUMN_TITLE, _("Title"));
|
||||||
|
|
||||||
// Instead of showing the notes + the company, which is unknown with
|
// Instead of showing the notes + the company, which is unknown with
|
||||||
// wii titles We show in the same column : company for GC games and
|
// Wii titles We show in the same column : company for GC games and
|
||||||
// description for wii/wad games
|
// description for Wii/wad games
|
||||||
InsertColumn(COLUMN_NOTES, _("Notes"));
|
InsertColumn(COLUMN_NOTES, _("Notes"));
|
||||||
InsertColumn(COLUMN_ID, _("ID"));
|
InsertColumn(COLUMN_ID, _("ID"));
|
||||||
InsertColumn(COLUMN_COUNTRY, "");
|
InsertColumn(COLUMN_COUNTRY, "");
|
||||||
@ -448,14 +448,13 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
|
|||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
if (!std::getline(titlestxt, line) && titlestxt.eof())
|
if (!std::getline(titlestxt, line) && titlestxt.eof())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID())
|
if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID())
|
||||||
{
|
{
|
||||||
name = line.substr(rISOFile.GetUniqueID().size() + 3);
|
name = line.substr(rISOFile.GetUniqueID().size() + 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
titlestxt.close();
|
titlestxt.close();
|
||||||
}
|
}
|
||||||
@ -684,7 +683,7 @@ void CGameListCtrl::OnColBeginDrag(wxListEvent& event)
|
|||||||
event.Veto();
|
event.Veto();
|
||||||
}
|
}
|
||||||
|
|
||||||
const GameListItem *CGameListCtrl::GetISO(size_t index) const
|
const GameListItem* CGameListCtrl::GetISO(size_t index) const
|
||||||
{
|
{
|
||||||
if (index < m_ISOFiles.size())
|
if (index < m_ISOFiles.size())
|
||||||
return m_ISOFiles[index];
|
return m_ISOFiles[index];
|
||||||
@ -692,14 +691,14 @@ const GameListItem *CGameListCtrl::GetISO(size_t index) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGameListCtrl *caller;
|
static CGameListCtrl* caller;
|
||||||
static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
|
static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
|
||||||
{
|
{
|
||||||
// return 1 if item1 > item2
|
// return 1 if item1 > item2
|
||||||
// return -1 if item1 < item2
|
// return -1 if item1 < item2
|
||||||
// return 0 for identity
|
// return 0 for identity
|
||||||
const GameListItem *iso1 = caller->GetISO(item1);
|
const GameListItem* iso1 = caller->GetISO(item1);
|
||||||
const GameListItem *iso2 = caller->GetISO(item2);
|
const GameListItem* iso2 = caller->GetISO(item2);
|
||||||
|
|
||||||
return CompareGameListItems(iso1, iso2, sortData);
|
return CompareGameListItems(iso1, iso2, sortData);
|
||||||
}
|
}
|
||||||
@ -900,7 +899,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
if (GetSelectedItemCount() == 1)
|
if (GetSelectedItemCount() == 1)
|
||||||
{
|
{
|
||||||
const GameListItem *selected_iso = GetSelectedISO();
|
const GameListItem* selected_iso = GetSelectedISO();
|
||||||
if (selected_iso)
|
if (selected_iso)
|
||||||
{
|
{
|
||||||
wxMenu popupMenu;
|
wxMenu popupMenu;
|
||||||
@ -990,7 +989,7 @@ const GameListItem * CGameListCtrl::GetSelectedISO()
|
|||||||
|
|
||||||
void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1001,7 +1000,7 @@ void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
void CGameListCtrl::OnOpenSaveFolder(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnOpenSaveFolder(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
std::string path = iso->GetWiiFSPath();
|
std::string path = iso->GetWiiFSPath();
|
||||||
@ -1011,7 +1010,7 @@ void CGameListCtrl::OnOpenSaveFolder(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
void CGameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1027,7 +1026,7 @@ void CGameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED (event))
|
|||||||
// Save this file as the default file
|
// Save this file as the default file
|
||||||
void CGameListCtrl::OnSetDefaultISO(wxCommandEvent& event)
|
void CGameListCtrl::OnSetDefaultISO(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso) return;
|
if (!iso) return;
|
||||||
|
|
||||||
if (event.IsChecked())
|
if (event.IsChecked())
|
||||||
@ -1049,7 +1048,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
|
|||||||
{
|
{
|
||||||
if (GetSelectedItemCount() == 1)
|
if (GetSelectedItemCount() == 1)
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
if (wxMessageBox(_("Are you sure you want to delete this file? It will be gone forever!"),
|
if (wxMessageBox(_("Are you sure you want to delete this file? It will be gone forever!"),
|
||||||
@ -1068,7 +1067,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
for (int i = 0; i < selected; i++)
|
for (int i = 0; i < selected; i++)
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
File::Delete(iso->GetFileName());
|
File::Delete(iso->GetFileName());
|
||||||
}
|
}
|
||||||
Update();
|
Update();
|
||||||
@ -1078,7 +1077,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1089,7 +1088,7 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1130,23 +1129,23 @@ void CGameListCtrl::CompressSelection(bool _compress)
|
|||||||
bool all_good = true;
|
bool all_good = true;
|
||||||
|
|
||||||
{
|
{
|
||||||
wxProgressDialog progressDialog(
|
wxProgressDialog progressDialog(
|
||||||
_compress ? _("Compressing ISO") : _("Decompressing ISO"),
|
_compress ? _("Compressing ISO") : _("Decompressing ISO"),
|
||||||
_("Working..."),
|
_("Working..."),
|
||||||
1000,
|
1000,
|
||||||
this,
|
this,
|
||||||
wxPD_APP_MODAL |
|
wxPD_APP_MODAL |
|
||||||
wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
|
wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME |
|
||||||
wxPD_SMOOTH
|
wxPD_SMOOTH
|
||||||
);
|
);
|
||||||
|
|
||||||
m_currentItem = 0;
|
m_currentItem = 0;
|
||||||
m_numberItem = GetSelectedItemCount();
|
m_numberItem = GetSelectedItemCount();
|
||||||
for (u32 i=0; i < m_numberItem; i++)
|
for (u32 i=0; i < m_numberItem; i++)
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (iso->GetPlatform() == GameListItem::WII_WAD || iso->GetFileName().rfind(".wbfs") != std::string::npos)
|
if (iso->GetPlatform() == GameListItem::WII_WAD || iso->GetFileName().rfind(".wbfs") != std::string::npos)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!iso->IsCompressed() && _compress)
|
if (!iso->IsCompressed() && _compress)
|
||||||
{
|
{
|
||||||
@ -1200,7 +1199,7 @@ void CGameListCtrl::CompressSelection(bool _compress)
|
|||||||
OutputFileName.c_str(), &MultiCompressCB, &progressDialog);
|
OutputFileName.c_str(), &MultiCompressCB, &progressDialog);
|
||||||
}
|
}
|
||||||
m_currentItem++;
|
m_currentItem++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!all_good)
|
if (!all_good)
|
||||||
@ -1217,7 +1216,7 @@ void CGameListCtrl::CompressCB(const std::string& text, float percent, void* arg
|
|||||||
|
|
||||||
void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
|
void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1297,7 +1296,7 @@ void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
|
|||||||
|
|
||||||
void CGameListCtrl::OnChangeDisc(wxCommandEvent& WXUNUSED(event))
|
void CGameListCtrl::OnChangeDisc(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
const GameListItem *iso = GetSelectedISO();
|
const GameListItem* iso = GetSelectedISO();
|
||||||
if (!iso || !Core::IsRunning())
|
if (!iso || !Core::IsRunning())
|
||||||
return;
|
return;
|
||||||
DVDInterface::ChangeDisc(WxStrToStr(iso->GetFileName()));
|
DVDInterface::ChangeDisc(WxStrToStr(iso->GetFileName()));
|
||||||
@ -1324,7 +1323,6 @@ void CGameListCtrl::AutomaticColumnWidth()
|
|||||||
}
|
}
|
||||||
else if (GetColumnCount() > 0)
|
else if (GetColumnCount() > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int resizable = rc.GetWidth() - (
|
int resizable = rc.GetWidth() - (
|
||||||
GetColumnWidth(COLUMN_PLATFORM)
|
GetColumnWidth(COLUMN_PLATFORM)
|
||||||
+ GetColumnWidth(COLUMN_BANNER)
|
+ GetColumnWidth(COLUMN_BANNER)
|
||||||
|
@ -62,9 +62,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
|||||||
if (!DiscIO::IsVolumeWadFile(pVolume))
|
if (!DiscIO::IsVolumeWadFile(pVolume))
|
||||||
m_Platform = DiscIO::IsVolumeWiiDisc(pVolume) ? WII_DISC : GAMECUBE_DISC;
|
m_Platform = DiscIO::IsVolumeWiiDisc(pVolume) ? WII_DISC : GAMECUBE_DISC;
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_Platform = WII_WAD;
|
m_Platform = WII_WAD;
|
||||||
}
|
|
||||||
|
|
||||||
m_volume_names = pVolume->GetNames();
|
m_volume_names = pVolume->GetNames();
|
||||||
|
|
||||||
@ -165,9 +163,7 @@ bool GameListItem::LoadFromCache()
|
|||||||
void GameListItem::SaveToCache()
|
void GameListItem::SaveToCache()
|
||||||
{
|
{
|
||||||
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
|
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
|
||||||
{
|
|
||||||
File::CreateDir(File::GetUserPath(D_CACHE_IDX));
|
File::CreateDir(File::GetUserPath(D_CACHE_IDX));
|
||||||
}
|
|
||||||
|
|
||||||
CChunkFileReader::Save<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);
|
CChunkFileReader::Save<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWiiDisc) // Only one language with wii banners
|
if (IsWiiDisc) // Only one language with Wii banners
|
||||||
{
|
{
|
||||||
m_Lang->SetSelection(0);
|
m_Lang->SetSelection(0);
|
||||||
m_Lang->Disable();
|
m_Lang->Disable();
|
||||||
|
@ -167,7 +167,7 @@ bool DolphinApp::OnInit()
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
wxCMD_LINE_OPTION, "e", "exec",
|
wxCMD_LINE_OPTION, "e", "exec",
|
||||||
"Loads the specified file (DOL,ELF,GCM,ISO,WAD)",
|
"Loads the specified file (ELF, DOL, GCM, ISO, WBFS, CISO, GCZ, WAD)",
|
||||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -396,7 +396,7 @@ void DolphinApp::InitLanguageSupport()
|
|||||||
|
|
||||||
void DolphinApp::OnEndSession(wxCloseEvent& event)
|
void DolphinApp::OnEndSession(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
// Close if we've recieved wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
|
// Close if we've received wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
|
||||||
if (!event.CanVeto())
|
if (!event.CanVeto())
|
||||||
{
|
{
|
||||||
main_frame->Close(true);
|
main_frame->Close(true);
|
||||||
@ -464,7 +464,7 @@ void* Host_GetRenderHandle()
|
|||||||
return main_frame->GetRenderHandle();
|
return main_frame->GetRenderHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
// OK, this thread boundary is DANGEROUS on linux
|
// OK, this thread boundary is DANGEROUS on Linux
|
||||||
// wxPostEvent / wxAddPendingEvent is the solution.
|
// wxPostEvent / wxAddPendingEvent is the solution.
|
||||||
void Host_NotifyMapLoaded()
|
void Host_NotifyMapLoaded()
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ static const char LINE_GS_COMMON[] =
|
|||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
|
||||||
// Apply TexOffset to all tex coordinates in the vertex.
|
// Apply TexOffset to all tex coordinates in the vertex.
|
||||||
// They can each be enabled seperately.
|
// They can each be enabled separately.
|
||||||
"#if NUM_TEXCOORDS >= 1\n"
|
"#if NUM_TEXCOORDS >= 1\n"
|
||||||
"r0.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
|
"r0.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
|
||||||
"r1.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
|
"r1.tex0.x += Params.TexOffset * Params.TexOffsetEnable[0];\n"
|
||||||
|
@ -402,7 +402,7 @@ void TextureCache::DisableStage(unsigned int stage)
|
|||||||
|
|
||||||
void TextureCache::SetStage ()
|
void TextureCache::SetStage ()
|
||||||
{
|
{
|
||||||
// -1 is the initial value as we don't know which testure should be bound
|
// -1 is the initial value as we don't know which texture should be bound
|
||||||
if (s_ActiveTexture != (u32)-1)
|
if (s_ActiveTexture != (u32)-1)
|
||||||
glActiveTexture(GL_TEXTURE0 + s_ActiveTexture);
|
glActiveTexture(GL_TEXTURE0 + s_ActiveTexture);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ static void CreatePrograms()
|
|||||||
{
|
{
|
||||||
/* TODO: Accuracy Improvements
|
/* TODO: Accuracy Improvements
|
||||||
*
|
*
|
||||||
* This shader doesn't really match what the gamecube does interally in the
|
* This shader doesn't really match what the GameCube does internally in the
|
||||||
* copy pipeline.
|
* copy pipeline.
|
||||||
* 1. It uses Opengl's built in filtering when yscaling, someone could work
|
* 1. It uses Opengl's built in filtering when yscaling, someone could work
|
||||||
* out how the copypipeline does it's filtering and implement it correctly
|
* out how the copypipeline does it's filtering and implement it correctly
|
||||||
@ -62,7 +62,7 @@ static void CreatePrograms()
|
|||||||
* 2. Deflickering isn't implemented, a futher filtering over 3 lines.
|
* 2. Deflickering isn't implemented, a futher filtering over 3 lines.
|
||||||
* Isn't really needed on non-interlaced monitors (and would lower quality;
|
* Isn't really needed on non-interlaced monitors (and would lower quality;
|
||||||
* But hey, accuracy!)
|
* But hey, accuracy!)
|
||||||
* 3. Flipper's YUYV conversion implements a 3 pixel horozontal blur on the
|
* 3. Flipper's YUYV conversion implements a 3 pixel horizontal blur on the
|
||||||
* UV channels, centering the U channel on the Left pixel and the V channel
|
* UV channels, centering the U channel on the Left pixel and the V channel
|
||||||
* on the Right pixel.
|
* on the Right pixel.
|
||||||
* The current implementation Centers both UV channels at the same place
|
* The current implementation Centers both UV channels at the same place
|
||||||
@ -101,7 +101,7 @@ static void CreatePrograms()
|
|||||||
*
|
*
|
||||||
* The YVYU to RGB conversion here matches the RGB to YUYV done above, but
|
* The YVYU to RGB conversion here matches the RGB to YUYV done above, but
|
||||||
* if a game modifies or adds images to the XFB then it should be using the
|
* if a game modifies or adds images to the XFB then it should be using the
|
||||||
* same algorithm as the flipper, and could result in slight colour inaccuracies
|
* same algorithm as the flipper, and could result in slight color inaccuracies
|
||||||
* when run back through this shader.
|
* when run back through this shader.
|
||||||
*/
|
*/
|
||||||
const char *VProgramYuyvToRgb =
|
const char *VProgramYuyvToRgb =
|
||||||
@ -253,9 +253,9 @@ static void EncodeToRamUsingShader(GLuint srcTexture,
|
|||||||
{
|
{
|
||||||
// writing to a texture of a different size
|
// writing to a texture of a different size
|
||||||
// also copy more then one block line, so the different strides matters
|
// also copy more then one block line, so the different strides matters
|
||||||
// copy into one pbo first, map this buffer, and then memcpy into gc memory
|
// copy into one pbo first, map this buffer, and then memcpy into GC memory
|
||||||
// in this way, we only have one vram->ram transfer, but maybe a bigger
|
// in this way, we only have one vram->ram transfer, but maybe a bigger
|
||||||
// cpu overhead because of the pbo
|
// CPU overhead because of the pbo
|
||||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, s_PBO);
|
glBindBuffer(GL_PIXEL_PACK_BUFFER, s_PBO);
|
||||||
glBufferData(GL_PIXEL_PACK_BUFFER, dstSize, nullptr, GL_STREAM_READ);
|
glBufferData(GL_PIXEL_PACK_BUFFER, dstSize, nullptr, GL_STREAM_READ);
|
||||||
glReadPixels(0, 0, (GLsizei)dstWidth, (GLsizei)dstHeight, GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
|
glReadPixels(0, 0, (GLsizei)dstWidth, (GLsizei)dstHeight, GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
|
||||||
@ -340,7 +340,7 @@ void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* des
|
|||||||
glUniform4f(s_rgbToYuyvUniform_loc, static_cast<float>(sourceRc.left), static_cast<float>(sourceRc.top),
|
glUniform4f(s_rgbToYuyvUniform_loc, static_cast<float>(sourceRc.left), static_cast<float>(sourceRc.top),
|
||||||
static_cast<float>(sourceRc.right), static_cast<float>(sourceRc.bottom));
|
static_cast<float>(sourceRc.right), static_cast<float>(sourceRc.bottom));
|
||||||
|
|
||||||
// We enable linear filtering, because the gamecube does filtering in the vertical direction when
|
// We enable linear filtering, because the GameCube does filtering in the vertical direction when
|
||||||
// yscale is enabled.
|
// yscale is enabled.
|
||||||
// Otherwise we get jaggies when a game uses yscaling (most PAL games)
|
// Otherwise we get jaggies when a game uses yscaling (most PAL games)
|
||||||
EncodeToRamUsingShader(srcTexture, destAddr, dstWidth / 2, dstHeight, dstWidth*dstHeight*2, true);
|
EncodeToRamUsingShader(srcTexture, destAddr, dstWidth / 2, dstHeight, dstWidth*dstHeight*2, true);
|
||||||
|
@ -540,7 +540,7 @@ namespace EfbInterface
|
|||||||
{
|
{
|
||||||
// YU pixel
|
// YU pixel
|
||||||
xfb_in_ram[x].Y = scanline[i].Y + 16;
|
xfb_in_ram[x].Y = scanline[i].Y + 16;
|
||||||
// we mix our color difrences in 10 bit space so it will round more accurately
|
// we mix our color differences in 10 bit space so it will round more accurately
|
||||||
// U[i] = 1/4 * U[i-1] + 1/2 * U[i] + 1/4 * U[i+1]
|
// U[i] = 1/4 * U[i-1] + 1/2 * U[i] + 1/4 * U[i+1]
|
||||||
xfb_in_ram[x].UV = 128 + ((scanline[i-1].U + (scanline[i].U << 1) + scanline[i+1].U) >> 2);
|
xfb_in_ram[x].UV = 128 + ((scanline[i-1].U + (scanline[i].U << 1) + scanline[i+1].U) >> 2);
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ namespace EfbInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Like CopyToXFB, but we copy directly into the opengl colour texture without going via GameCube main memory or doing a yuyv conversion
|
// Like CopyToXFB, but we copy directly into the opengl color texture without going via GameCube main memory or doing a yuyv conversion
|
||||||
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
|
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
|
||||||
{
|
{
|
||||||
if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT)
|
if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT)
|
||||||
|
@ -73,7 +73,7 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
|
|||||||
|
|
||||||
png_init_io(png_ptr, fp.GetHandle());
|
png_init_io(png_ptr, fp.GetHandle());
|
||||||
|
|
||||||
// Write header (8 bit colour depth)
|
// Write header (8 bit color depth)
|
||||||
png_set_IHDR(png_ptr, info_ptr, width, height,
|
png_set_IHDR(png_ptr, info_ptr, width, height,
|
||||||
8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
|
8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
|
||||||
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user