Merge pull request #142 from Tilka/clang-modernize
Run clang-modernize and manually fix the result
This commit is contained in:
commit
633dc75e85
|
@ -22,7 +22,7 @@ void AOSound::SoundLoop()
|
|||
format.rate = m_mixer->GetSampleRate();
|
||||
format.byte_format = AO_FMT_LITTLE;
|
||||
|
||||
device = ao_open_live(default_driver, &format, NULL /* no options */);
|
||||
device = ao_open_live(default_driver, &format, nullptr /* no options */);
|
||||
if (!device)
|
||||
{
|
||||
PanicAlertT("AudioCommon: Error opening AO device.\n");
|
||||
|
@ -73,7 +73,7 @@ void AOSound::Stop()
|
|||
|
||||
ao_shutdown();
|
||||
|
||||
device = NULL;
|
||||
device = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ public:
|
|||
|
||||
virtual ~AOSound();
|
||||
|
||||
virtual bool Start();
|
||||
virtual bool Start() override;
|
||||
|
||||
virtual void SoundLoop();
|
||||
virtual void SoundLoop() override;
|
||||
|
||||
virtual void Stop();
|
||||
virtual void Stop() override;
|
||||
|
||||
static bool isValid() {
|
||||
return true;
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual void Update();
|
||||
virtual void Update() override;
|
||||
|
||||
#else
|
||||
public:
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#define BUFFER_SIZE_MAX 8192
|
||||
#define BUFFER_SIZE_BYTES (BUFFER_SIZE_MAX*2*2)
|
||||
|
||||
AlsaSound::AlsaSound(CMixer *mixer) : SoundStream(mixer), thread_data(0), handle(NULL), frames_to_deliver(FRAME_COUNT_MIN)
|
||||
AlsaSound::AlsaSound(CMixer *mixer) : SoundStream(mixer), thread_data(0), handle(nullptr), frames_to_deliver(FRAME_COUNT_MIN)
|
||||
{
|
||||
mix_buffer = new u8[BUFFER_SIZE_BYTES];
|
||||
}
|
||||
|
@ -204,11 +204,11 @@ bool AlsaSound::AlsaInit()
|
|||
|
||||
void AlsaSound::AlsaShutdown()
|
||||
{
|
||||
if (handle != NULL)
|
||||
if (handle != nullptr)
|
||||
{
|
||||
snd_pcm_drop(handle);
|
||||
snd_pcm_close(handle);
|
||||
handle = NULL;
|
||||
handle = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ public:
|
|||
AlsaSound(CMixer *mixer);
|
||||
virtual ~AlsaSound();
|
||||
|
||||
virtual bool Start();
|
||||
virtual void SoundLoop();
|
||||
virtual void Stop();
|
||||
virtual bool Start() override;
|
||||
virtual void SoundLoop() override;
|
||||
virtual void Stop() override;
|
||||
|
||||
static bool isValid() {
|
||||
return true;
|
||||
|
@ -30,7 +30,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual void Update();
|
||||
virtual void Update() override;
|
||||
|
||||
private:
|
||||
bool AlsaInit();
|
||||
|
|
|
@ -40,8 +40,8 @@ bool CoreAudioSound::Start()
|
|||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
component = FindNextComponent(NULL, &desc);
|
||||
if (component == NULL) {
|
||||
component = FindNextComponent(nullptr, &desc);
|
||||
if (component == nullptr) {
|
||||
ERROR_LOG(AUDIO, "error finding audio component");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ float* design_fir(unsigned int *n, float* fc, float opt)
|
|||
float fc1; // Cutoff frequencies
|
||||
|
||||
// Sanity check
|
||||
if(*n==0) return NULL;
|
||||
if(*n==0) return nullptr;
|
||||
MathUtil::Clamp(&fc[0],float(0.001),float(1));
|
||||
|
||||
float *w=(float*)calloc(sizeof(float),*n);
|
||||
|
@ -188,7 +188,7 @@ void done(void)
|
|||
{
|
||||
free(filter_coefs_lfe);
|
||||
}
|
||||
filter_coefs_lfe = NULL;
|
||||
filter_coefs_lfe = nullptr;
|
||||
}
|
||||
|
||||
float* calc_coefficients_125Hz_lowpass(int rate)
|
||||
|
@ -378,5 +378,5 @@ void dpl2reset()
|
|||
{
|
||||
olddelay = -1;
|
||||
oldfreq = 0;
|
||||
filter_coefs_lfe = NULL;
|
||||
filter_coefs_lfe = nullptr;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ bool DSound::CreateBuffer()
|
|||
dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&pcmwf;
|
||||
dsbdesc.guid3DAlgorithm = DS3DALG_DEFAULT;
|
||||
|
||||
HRESULT res = ds->CreateSoundBuffer(&dsbdesc, &dsBuffer, NULL);
|
||||
HRESULT res = ds->CreateSoundBuffer(&dsbdesc, &dsBuffer, nullptr);
|
||||
if (SUCCEEDED(res))
|
||||
{
|
||||
dsBuffer->SetCurrentPosition(0);
|
||||
|
@ -43,7 +43,7 @@ bool DSound::CreateBuffer()
|
|||
{
|
||||
// Failed.
|
||||
PanicAlertT("Sound buffer creation failed: %08x", res);
|
||||
dsBuffer = NULL;
|
||||
dsBuffer = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ void DSound::SetVolume(int volume)
|
|||
// This is in "dBA attenuation" from 0 to -10000, logarithmic
|
||||
m_volume = (int)floor(log10((float)volume) * 5000.0f) - 10000;
|
||||
|
||||
if (dsBuffer != NULL)
|
||||
if (dsBuffer != nullptr)
|
||||
dsBuffer->SetVolume(m_volume);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ void DSound::Clear(bool mute)
|
|||
{
|
||||
m_muted = mute;
|
||||
|
||||
if (dsBuffer != NULL)
|
||||
if (dsBuffer != nullptr)
|
||||
{
|
||||
if (m_muted)
|
||||
{
|
||||
|
|
|
@ -21,12 +21,12 @@ public:
|
|||
|
||||
virtual ~NullSound() {}
|
||||
|
||||
virtual bool Start();
|
||||
virtual void SoundLoop();
|
||||
virtual void SetVolume(int volume);
|
||||
virtual void Stop();
|
||||
virtual void Clear(bool mute);
|
||||
virtual bool Start() override;
|
||||
virtual void SoundLoop() override;
|
||||
virtual void SetVolume(int volume) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Clear(bool mute) override;
|
||||
static bool isValid() { return true; }
|
||||
virtual bool usesMixer() const { return true; }
|
||||
virtual void Update();
|
||||
virtual void Update() override;
|
||||
};
|
||||
|
|
|
@ -17,17 +17,17 @@ bool OpenALStream::Start()
|
|||
{
|
||||
bool bReturn = false;
|
||||
|
||||
ALDeviceList *pDeviceList = new ALDeviceList();
|
||||
if ((pDeviceList) && (pDeviceList->GetNumDevices()))
|
||||
ALDeviceList pDeviceList;
|
||||
if (pDeviceList.GetNumDevices())
|
||||
{
|
||||
char *defDevName = pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice());
|
||||
char *defDevName = pDeviceList.GetDeviceName(pDeviceList.GetDefaultDevice());
|
||||
|
||||
WARN_LOG(AUDIO, "Found OpenAL device %s", defDevName);
|
||||
|
||||
ALCdevice *pDevice = alcOpenDevice(defDevName);
|
||||
if (pDevice)
|
||||
{
|
||||
ALCcontext *pContext = alcCreateContext(pDevice, NULL);
|
||||
ALCcontext *pContext = alcCreateContext(pDevice, nullptr);
|
||||
if (pContext)
|
||||
{
|
||||
// Used to determine an appropriate period size (2x period = total buffer size)
|
||||
|
@ -49,7 +49,6 @@ bool OpenALStream::Start()
|
|||
{
|
||||
PanicAlertT("OpenAL: can't open device %s", defDevName);
|
||||
}
|
||||
delete pDeviceList;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -84,7 +83,7 @@ void OpenALStream::Stop()
|
|||
ALCcontext *pContext = alcGetCurrentContext();
|
||||
ALCdevice *pDevice = alcGetContextsDevice(pContext);
|
||||
|
||||
alcMakeContextCurrent(NULL);
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(pContext);
|
||||
alcCloseDevice(pDevice);
|
||||
}
|
||||
|
|
|
@ -44,21 +44,21 @@ class OpenALStream: public SoundStream
|
|||
{
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
public:
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL)
|
||||
OpenALStream(CMixer *mixer, void *hWnd = nullptr)
|
||||
: SoundStream(mixer)
|
||||
, uiSource(0)
|
||||
{}
|
||||
|
||||
virtual ~OpenALStream() {}
|
||||
|
||||
virtual bool Start();
|
||||
virtual void SoundLoop();
|
||||
virtual void SetVolume(int volume);
|
||||
virtual void Stop();
|
||||
virtual void Clear(bool mute);
|
||||
virtual bool Start() override;
|
||||
virtual void SoundLoop() override;
|
||||
virtual void SetVolume(int volume) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Clear(bool mute) override;
|
||||
static bool isValid() { return true; }
|
||||
virtual bool usesMixer() const { return true; }
|
||||
virtual void Update();
|
||||
virtual void Update() override;
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
|
|
|
@ -17,7 +17,7 @@ static SLEngineItf engineEngine;
|
|||
static SLObjectItf outputMixObject;
|
||||
|
||||
// buffer queue player interfaces
|
||||
static SLObjectItf bqPlayerObject = NULL;
|
||||
static SLObjectItf bqPlayerObject = nullptr;
|
||||
static SLPlayItf bqPlayerPlay;
|
||||
static SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;
|
||||
static SLMuteSoloItf bqPlayerMuteSolo;
|
||||
|
@ -32,7 +32,7 @@ static int curBuffer = 0;
|
|||
|
||||
static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) {
|
||||
assert(bq == bqPlayerBufferQueue);
|
||||
assert(NULL == context);
|
||||
assert(nullptr == context);
|
||||
|
||||
short *nextBuffer = buffer[curBuffer];
|
||||
int nextSize = sizeof(buffer[0]);
|
||||
|
@ -53,7 +53,7 @@ bool OpenSLESStream::Start()
|
|||
{
|
||||
SLresult result;
|
||||
// create engine
|
||||
result = slCreateEngine(&engineObject, 0, NULL, 0, NULL, NULL);
|
||||
result = slCreateEngine(&engineObject, 0, nullptr, 0, nullptr, nullptr);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
@ -79,7 +79,7 @@ bool OpenSLESStream::Start()
|
|||
|
||||
// configure audio sink
|
||||
SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, outputMixObject};
|
||||
SLDataSink audioSnk = {&loc_outmix, NULL};
|
||||
SLDataSink audioSnk = {&loc_outmix, nullptr};
|
||||
|
||||
// create audio player
|
||||
const SLInterfaceID ids[2] = {SL_IID_BUFFERQUEUE, SL_IID_VOLUME};
|
||||
|
@ -94,7 +94,7 @@ bool OpenSLESStream::Start()
|
|||
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_BUFFERQUEUE,
|
||||
&bqPlayerBufferQueue);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, NULL);
|
||||
result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, nullptr);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
@ -113,22 +113,22 @@ bool OpenSLESStream::Start()
|
|||
|
||||
void OpenSLESStream::Stop()
|
||||
{
|
||||
if (bqPlayerObject != NULL) {
|
||||
if (bqPlayerObject != nullptr) {
|
||||
(*bqPlayerObject)->Destroy(bqPlayerObject);
|
||||
bqPlayerObject = NULL;
|
||||
bqPlayerPlay = NULL;
|
||||
bqPlayerBufferQueue = NULL;
|
||||
bqPlayerMuteSolo = NULL;
|
||||
bqPlayerVolume = NULL;
|
||||
bqPlayerObject = nullptr;
|
||||
bqPlayerPlay = nullptr;
|
||||
bqPlayerBufferQueue = nullptr;
|
||||
bqPlayerMuteSolo = nullptr;
|
||||
bqPlayerVolume = nullptr;
|
||||
}
|
||||
if (outputMixObject != NULL) {
|
||||
if (outputMixObject != nullptr) {
|
||||
(*outputMixObject)->Destroy(outputMixObject);
|
||||
outputMixObject = NULL;
|
||||
outputMixObject = nullptr;
|
||||
}
|
||||
if (engineObject != NULL) {
|
||||
if (engineObject != nullptr) {
|
||||
(*engineObject)->Destroy(engineObject);
|
||||
engineObject = NULL;
|
||||
engineEngine = NULL;
|
||||
engineObject = nullptr;
|
||||
engineEngine = nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@ class OpenSLESStream : public SoundStream
|
|||
{
|
||||
#ifdef ANDROID
|
||||
public:
|
||||
OpenSLESStream(CMixer *mixer, void *hWnd = NULL)
|
||||
OpenSLESStream(CMixer *mixer, void *hWnd = nullptr)
|
||||
: SoundStream(mixer)
|
||||
{};
|
||||
|
||||
|
@ -27,6 +27,6 @@ private:
|
|||
Common::Event soundSyncEvent;
|
||||
#else
|
||||
public:
|
||||
OpenSLESStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {}
|
||||
OpenSLESStream(CMixer *mixer, void *hWnd = nullptr): SoundStream(mixer) {}
|
||||
#endif // HAVE_OPENSL
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ void PulseAudio::SoundLoop()
|
|||
if (PulseInit())
|
||||
{
|
||||
while (m_run_thread.load() && m_pa_connected == 1 && m_pa_error >= 0)
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL);
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
|
||||
|
||||
if(m_pa_error < 0)
|
||||
ERROR_LOG(AUDIO, "PulseAudio error: %s", pa_strerror(m_pa_error));
|
||||
|
@ -66,12 +66,12 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_ml = pa_mainloop_new();
|
||||
m_pa_mlapi = pa_mainloop_get_api(m_pa_ml);
|
||||
m_pa_ctx = pa_context_new(m_pa_mlapi, "dolphin-emu");
|
||||
m_pa_error = pa_context_connect(m_pa_ctx, NULL, PA_CONTEXT_NOFLAGS, NULL);
|
||||
m_pa_error = pa_context_connect(m_pa_ctx, nullptr, PA_CONTEXT_NOFLAGS, nullptr);
|
||||
pa_context_set_state_callback(m_pa_ctx, StateCallback, this);
|
||||
|
||||
// wait until we're connected to the pulseaudio server
|
||||
while (m_pa_connected == 0 && m_pa_error >= 0)
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL);
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
|
||||
|
||||
if (m_pa_connected == 2 || m_pa_error < 0)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ bool PulseAudio::PulseInit()
|
|||
ss.format = PA_SAMPLE_S16LE;
|
||||
ss.channels = 2;
|
||||
ss.rate = m_mixer->GetSampleRate();
|
||||
m_pa_s = pa_stream_new(m_pa_ctx, "Playback", &ss, NULL);
|
||||
m_pa_s = pa_stream_new(m_pa_ctx, "Playback", &ss, nullptr);
|
||||
pa_stream_set_write_callback(m_pa_s, WriteCallback, this);
|
||||
pa_stream_set_underflow_callback(m_pa_s, UnderflowCallback, this);
|
||||
|
||||
|
@ -97,7 +97,7 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_ba.prebuf = -1; // start as early as possible
|
||||
m_pa_ba.tlength = BUFFER_SIZE; // designed latency, only change this flag for low latency output
|
||||
pa_stream_flags flags = pa_stream_flags(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY | PA_STREAM_AUTO_TIMING_UPDATE);
|
||||
m_pa_error = pa_stream_connect_playback(m_pa_s, NULL, &m_pa_ba, flags, NULL, NULL);
|
||||
m_pa_error = pa_stream_connect_playback(m_pa_s, nullptr, &m_pa_ba, flags, nullptr, nullptr);
|
||||
if (m_pa_error < 0)
|
||||
{
|
||||
ERROR_LOG(AUDIO, "PulseAudio failed to initialize: %s", pa_strerror(m_pa_error));
|
||||
|
@ -135,7 +135,7 @@ void PulseAudio::StateCallback(pa_context* c)
|
|||
void PulseAudio::UnderflowCallback(pa_stream* s)
|
||||
{
|
||||
m_pa_ba.tlength += BUFFER_SIZE;
|
||||
pa_stream_set_buffer_attr(s, &m_pa_ba, NULL, NULL);
|
||||
pa_stream_set_buffer_attr(s, &m_pa_ba, nullptr, nullptr);
|
||||
|
||||
WARN_LOG(AUDIO, "pulseaudio underflow, new latency: %d bytes", m_pa_ba.tlength);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
return; // error will be printed from main loop
|
||||
|
||||
m_mixer->Mix((s16*) buffer, length / sizeof(s16) / CHANNEL_COUNT);
|
||||
m_pa_error = pa_stream_write(s, buffer, length, NULL, 0, PA_SEEK_RELATIVE);
|
||||
m_pa_error = pa_stream_write(s, buffer, length, nullptr, 0, PA_SEEK_RELATIVE);
|
||||
}
|
||||
|
||||
// Callbacks that forward to internal methods (required because PulseAudio is a C API).
|
||||
|
|
|
@ -20,21 +20,21 @@ class PulseAudio : public SoundStream
|
|||
public:
|
||||
PulseAudio(CMixer *mixer);
|
||||
|
||||
virtual bool Start();
|
||||
virtual void Stop();
|
||||
virtual bool Start() override;
|
||||
virtual void Stop() override;
|
||||
|
||||
static bool isValid() {return true;}
|
||||
|
||||
virtual bool usesMixer() const {return true;}
|
||||
|
||||
virtual void Update();
|
||||
virtual void Update() override;
|
||||
|
||||
void StateCallback(pa_context *c);
|
||||
void WriteCallback(pa_stream *s, size_t length);
|
||||
void UnderflowCallback(pa_stream *s);
|
||||
|
||||
private:
|
||||
virtual void SoundLoop();
|
||||
virtual void SoundLoop() override;
|
||||
|
||||
bool PulseInit();
|
||||
void PulseShutdown();
|
||||
|
|
|
@ -11,7 +11,7 @@ enum {BUF_SIZE = 32*1024};
|
|||
WaveFileWriter::WaveFileWriter():
|
||||
skip_silence(false),
|
||||
audio_size(0),
|
||||
conv_buffer(NULL)
|
||||
conv_buffer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ XAudio2::XAudio2(CMixer *mixer)
|
|||
: SoundStream(mixer)
|
||||
, m_mastering_voice(nullptr)
|
||||
, m_volume(1.0f)
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ XAudio2_7::XAudio2_7(CMixer *mixer)
|
|||
: SoundStream(mixer)
|
||||
, m_mastering_voice(nullptr)
|
||||
, m_volume(1.0f)
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -50,13 +50,13 @@ ALDeviceList::ALDeviceList()
|
|||
defaultDeviceIndex = 0;
|
||||
|
||||
// grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices
|
||||
//if (LoadOAL10Library(NULL, &ALFunction) == TRUE) {
|
||||
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
|
||||
//if (LoadOAL10Library(nullptr, &ALFunction) == TRUE) {
|
||||
if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
const char *devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
|
||||
for (s32 index = 0; devices != NULL && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
const char *devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single nullptr, list terminated with double nullptr)
|
||||
for (s32 index = 0; devices != nullptr && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
{
|
||||
if (strcmp(defaultDeviceName, devices) == 0)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ ALDeviceList::ALDeviceList()
|
|||
ALCdevice *device = alcOpenDevice(devices);
|
||||
if (device)
|
||||
{
|
||||
ALCcontext *context = alcCreateContext(device, NULL);
|
||||
ALCcontext *context = alcCreateContext(device, nullptr);
|
||||
if (context)
|
||||
{
|
||||
alcMakeContextCurrent(context);
|
||||
|
@ -79,7 +79,7 @@ ALDeviceList::ALDeviceList()
|
|||
bNewName = false;
|
||||
}
|
||||
}
|
||||
if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0))
|
||||
if ((bNewName) && (actualDeviceName != nullptr) && (strlen(actualDeviceName) > 0))
|
||||
{
|
||||
ALDeviceInfo.bSelected = true;
|
||||
ALDeviceInfo.strDeviceName = actualDeviceName;
|
||||
|
@ -120,7 +120,7 @@ ALDeviceList::ALDeviceList()
|
|||
|
||||
vDeviceInfo.push_back(ALDeviceInfo);
|
||||
}
|
||||
alcMakeContextCurrent(NULL);
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(context);
|
||||
}
|
||||
alcCloseDevice(device);
|
||||
|
@ -163,7 +163,7 @@ char * ALDeviceList::GetDeviceName(s32 index)
|
|||
if (index < GetNumDevices())
|
||||
return (char *)vDeviceInfo[index].strDeviceName.c_str();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -14,7 +14,7 @@ const char procfile[] = "/proc/cpuinfo";
|
|||
char *GetCPUString()
|
||||
{
|
||||
const char marker[] = "Hardware\t: ";
|
||||
char *cpu_string = 0;
|
||||
char *cpu_string = nullptr;
|
||||
// Count the number of processor lines in /proc/cpuinfo
|
||||
char buf[1024];
|
||||
|
||||
|
@ -38,7 +38,7 @@ char *GetCPUString()
|
|||
unsigned char GetCPUImplementer()
|
||||
{
|
||||
const char marker[] = "CPU implementer\t: ";
|
||||
char *implementer_string = 0;
|
||||
char *implementer_string = nullptr;
|
||||
unsigned char implementer = 0;
|
||||
char buf[1024];
|
||||
|
||||
|
@ -65,7 +65,7 @@ unsigned char GetCPUImplementer()
|
|||
unsigned short GetCPUPart()
|
||||
{
|
||||
const char marker[] = "CPU part\t: ";
|
||||
char *part_string = 0;
|
||||
char *part_string = nullptr;
|
||||
unsigned short part = 0;
|
||||
char buf[1024];
|
||||
|
||||
|
@ -105,11 +105,11 @@ bool CheckCPUFeature(const char *feature)
|
|||
continue;
|
||||
char *featurestring = buf + sizeof(marker) - 1;
|
||||
char *token = strtok(featurestring, " ");
|
||||
while (token != NULL)
|
||||
while (token != nullptr)
|
||||
{
|
||||
if (strstr(token, feature))
|
||||
return true;
|
||||
token = strtok(NULL, " ");
|
||||
token = strtok(nullptr, " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -710,7 +710,7 @@ protected:
|
|||
size_t region_size;
|
||||
|
||||
public:
|
||||
ARMXCodeBlock() : region(NULL), region_size(0) {}
|
||||
ARMXCodeBlock() : region(nullptr), region_size(0) {}
|
||||
virtual ~ARMXCodeBlock() { if (region) FreeCodeSpace(); }
|
||||
|
||||
// Call this before you generate any code.
|
||||
|
@ -735,7 +735,7 @@ public:
|
|||
{
|
||||
#ifndef __SYMBIAN32__
|
||||
FreeMemoryPages(region, region_size);
|
||||
region = NULL;
|
||||
region = nullptr;
|
||||
#endif
|
||||
region_size = 0;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ void MemChecks::AddFromStrings(const TMemChecksStr& mcstrs)
|
|||
|
||||
void MemChecks::Add(const TMemCheck& _rMemoryCheck)
|
||||
{
|
||||
if (GetMemCheck(_rMemoryCheck.StartAddress) == 0)
|
||||
if (GetMemCheck(_rMemoryCheck.StartAddress) == nullptr)
|
||||
m_MemChecks.push_back(_rMemoryCheck);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ TMemCheck *MemChecks::GetMemCheck(u32 address)
|
|||
}
|
||||
|
||||
// none found
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc)
|
||||
|
|
|
@ -41,7 +41,7 @@ std::vector<std::string> cdio_get_devices()
|
|||
{
|
||||
std::vector<std::string> drives;
|
||||
|
||||
const DWORD buffsize = GetLogicalDriveStrings(0, NULL);
|
||||
const DWORD buffsize = GetLogicalDriveStrings(0, nullptr);
|
||||
std::vector<TCHAR> buff(buffsize);
|
||||
if (GetLogicalDriveStrings(buffsize, buff.data()) == buffsize - 1)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ std::vector<std::string> cdio_get_devices()
|
|||
return( drives );
|
||||
|
||||
classes_to_match = IOServiceMatching( kIOCDMediaClass );
|
||||
if( classes_to_match == NULL )
|
||||
if( classes_to_match == nullptr )
|
||||
return( drives );
|
||||
|
||||
CFDictionarySetValue( classes_to_match,
|
||||
|
@ -101,7 +101,7 @@ std::vector<std::string> cdio_get_devices()
|
|||
IORegistryEntryCreateCFProperty( next_media,
|
||||
CFSTR( kIOBSDNameKey ), kCFAllocatorDefault,
|
||||
0 );
|
||||
if( str_bsd_path == NULL )
|
||||
if( str_bsd_path == nullptr )
|
||||
{
|
||||
IOObjectRelease( next_media );
|
||||
continue;
|
||||
|
@ -118,7 +118,7 @@ std::vector<std::string> cdio_get_devices()
|
|||
sizeof(psz_buf) - dev_path_length,
|
||||
kCFStringEncodingASCII))
|
||||
{
|
||||
if(psz_buf != NULL)
|
||||
if(psz_buf != nullptr)
|
||||
{
|
||||
std::string str = psz_buf;
|
||||
drives.push_back(str);
|
||||
|
@ -151,7 +151,7 @@ static struct
|
|||
{ "/dev/acd%d", 0, 27 },
|
||||
{ "/dev/cd%d", 0, 27 },
|
||||
#endif
|
||||
{ NULL, 0, 0 }
|
||||
{ nullptr, 0, 0 }
|
||||
};
|
||||
|
||||
// Returns true if a device is a block or char device and not a symbolic link
|
||||
|
@ -196,7 +196,7 @@ std::vector<std::string> cdio_get_devices ()
|
|||
for (unsigned int j = checklist[i].num_min; j <= checklist[i].num_max; ++j)
|
||||
{
|
||||
std::string drive = StringFromFormat(checklist[i].format, j);
|
||||
if (is_cdrom(drive, NULL))
|
||||
if (is_cdrom(drive, nullptr))
|
||||
{
|
||||
drives.push_back(std::move(drive));
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ public:
|
|||
void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end=0)
|
||||
{
|
||||
LinkedListItem<T>* list_cur = list_start;
|
||||
LinkedListItem<T>* prev = 0;
|
||||
LinkedListItem<T>* prev = nullptr;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ public:
|
|||
{
|
||||
if (mode == MODE_READ)
|
||||
{
|
||||
cur->next = 0;
|
||||
cur->next = nullptr;
|
||||
list_cur = cur;
|
||||
if (prev)
|
||||
prev->next = cur;
|
||||
|
@ -239,13 +239,13 @@ public:
|
|||
if (mode == MODE_READ)
|
||||
{
|
||||
if (prev)
|
||||
prev->next = 0;
|
||||
prev->next = nullptr;
|
||||
if (list_end)
|
||||
*list_end = prev;
|
||||
if (list_cur)
|
||||
{
|
||||
if (list_start == list_cur)
|
||||
list_start = 0;
|
||||
list_start = nullptr;
|
||||
do
|
||||
{
|
||||
LinkedListItem<T>* next = list_cur->next;
|
||||
|
@ -393,7 +393,7 @@ public:
|
|||
}
|
||||
|
||||
// Get data
|
||||
u8 *ptr = 0;
|
||||
u8 *ptr = nullptr;
|
||||
PointerWrap p(&ptr, PointerWrap::MODE_MEASURE);
|
||||
_class.DoState(p);
|
||||
size_t const sz = (size_t)ptr;
|
||||
|
|
|
@ -127,7 +127,7 @@ inline u64 _rotr64(u64 x, unsigned int shift){
|
|||
// Restore the global locale
|
||||
_configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
|
||||
}
|
||||
else if(new_locale != NULL)
|
||||
else if(new_locale != nullptr)
|
||||
{
|
||||
// Configure the thread to set the locale only for this thread
|
||||
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
ConsoleListener::ConsoleListener()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
hConsole = NULL;
|
||||
hConsole = nullptr;
|
||||
bUseColor = true;
|
||||
#else
|
||||
bUseColor = isatty(fileno(stdout));
|
||||
|
@ -68,19 +68,19 @@ void ConsoleListener::UpdateHandle()
|
|||
void ConsoleListener::Close()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (hConsole == NULL)
|
||||
if (hConsole == nullptr)
|
||||
return;
|
||||
FreeConsole();
|
||||
hConsole = NULL;
|
||||
hConsole = nullptr;
|
||||
#else
|
||||
fflush(NULL);
|
||||
fflush(nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ConsoleListener::IsOpen()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return (hConsole != NULL);
|
||||
return (hConsole != nullptr);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
|
@ -280,11 +280,11 @@ void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text)
|
|||
{
|
||||
// First 10 chars white
|
||||
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
|
||||
WriteConsole(hConsole, Text, 10, &cCharsWritten, NULL);
|
||||
WriteConsole(hConsole, Text, 10, &cCharsWritten, nullptr);
|
||||
Text += 10;
|
||||
}
|
||||
SetConsoleTextAttribute(hConsole, Color);
|
||||
WriteConsole(hConsole, Text, (DWORD)strlen(Text), &cCharsWritten, NULL);
|
||||
WriteConsole(hConsole, Text, (DWORD)strlen(Text), &cCharsWritten, nullptr);
|
||||
#else
|
||||
char ColorAttr[16] = "";
|
||||
char ResetAttr[16] = "";
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
#ifdef _WIN32
|
||||
COORD GetCoordinates(int BytesRead, int BufferWidth);
|
||||
#endif
|
||||
void Log(LogTypes::LOG_LEVELS, const char *Text);
|
||||
void Log(LogTypes::LOG_LEVELS, const char *Text) override;
|
||||
void ClearScreen(bool Cursor = true);
|
||||
|
||||
private:
|
||||
|
|
|
@ -316,7 +316,7 @@ void point_mul(u8 *d, const u8 *a, const u8 *b) // a is bignum
|
|||
static void silly_random(u8 * rndArea, u8 count)
|
||||
{
|
||||
u16 i;
|
||||
srand((unsigned) (time(NULL)));
|
||||
srand((unsigned) (time(nullptr)));
|
||||
|
||||
for(i=0;i<count;i++)
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ static void InitSymbolPath( PSTR lpszSymbolPath, PCSTR lpszIniPath )
|
|||
}
|
||||
|
||||
// Add user defined path
|
||||
if ( lpszIniPath != NULL )
|
||||
if ( lpszIniPath != nullptr )
|
||||
if ( lpszIniPath[0] != '\0' )
|
||||
{
|
||||
strcat( lpszSymbolPath, ";" );
|
||||
|
@ -140,7 +140,7 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
|
|||
DWORD dwSymSize = 10000;
|
||||
TCHAR lpszUnDSymbol[BUFFERSIZE]=_T("?");
|
||||
CHAR lpszNonUnicodeUnDSymbol[BUFFERSIZE]="?";
|
||||
LPTSTR lpszParamSep = NULL;
|
||||
LPTSTR lpszParamSep = nullptr;
|
||||
LPTSTR lpszParsed = lpszUnDSymbol;
|
||||
PIMAGEHLP_SYMBOL pSym = (PIMAGEHLP_SYMBOL)GlobalAlloc( GMEM_FIXED, dwSymSize );
|
||||
|
||||
|
@ -193,13 +193,13 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
|
|||
|
||||
// Let's go through the stack, and modify the function prototype, and insert the actual
|
||||
// parameter values from the stack
|
||||
if ( _tcsstr( lpszUnDSymbol, _T("(void)") ) == NULL && _tcsstr( lpszUnDSymbol, _T("()") ) == NULL)
|
||||
if ( _tcsstr( lpszUnDSymbol, _T("(void)") ) == nullptr && _tcsstr( lpszUnDSymbol, _T("()") ) == nullptr)
|
||||
{
|
||||
ULONG index = 0;
|
||||
for( ; ; index++ )
|
||||
{
|
||||
lpszParamSep = _tcschr( lpszParsed, _T(',') );
|
||||
if ( lpszParamSep == NULL )
|
||||
if ( lpszParamSep == nullptr )
|
||||
break;
|
||||
|
||||
*lpszParamSep = _T('\0');
|
||||
|
@ -211,7 +211,7 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
|
|||
}
|
||||
|
||||
lpszParamSep = _tcschr( lpszParsed, _T(')') );
|
||||
if ( lpszParamSep != NULL )
|
||||
if ( lpszParamSep != nullptr )
|
||||
{
|
||||
*lpszParamSep = _T('\0');
|
||||
|
||||
|
@ -254,7 +254,7 @@ static BOOL GetSourceInfoFromAddress( UINT address, LPTSTR lpszSourceInfo )
|
|||
PCSTR2LPTSTR( lineInfo.FileName, lpszFileName );
|
||||
TCHAR fname[_MAX_FNAME];
|
||||
TCHAR ext[_MAX_EXT];
|
||||
_tsplitpath(lpszFileName, NULL, NULL, fname, ext);
|
||||
_tsplitpath(lpszFileName, nullptr, nullptr, fname, ext);
|
||||
_stprintf( lpszSourceInfo, _T("%s%s(%d)"), fname, ext, lineInfo.LineNumber );
|
||||
ret = TRUE;
|
||||
}
|
||||
|
@ -338,11 +338,11 @@ void StackTrace( HANDLE hThread, const char* lpszMessage, FILE *file )
|
|||
hProcess,
|
||||
hThread,
|
||||
&callStack,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
SymFunctionTableAccess,
|
||||
SymGetModuleBase,
|
||||
NULL);
|
||||
nullptr);
|
||||
|
||||
if ( index == 0 )
|
||||
continue;
|
||||
|
@ -393,11 +393,11 @@ void StackTrace(HANDLE hThread, const char* lpszMessage, FILE *file, DWORD eip,
|
|||
hProcess,
|
||||
hThread,
|
||||
&callStack,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
SymFunctionTableAccess,
|
||||
SymGetModuleBase,
|
||||
NULL);
|
||||
nullptr);
|
||||
|
||||
if ( index == 0 )
|
||||
continue;
|
||||
|
|
|
@ -65,8 +65,8 @@ public:
|
|||
ElementPtr *tmpptr = m_read_ptr;
|
||||
// advance the read pointer
|
||||
m_read_ptr = AtomicLoad(tmpptr->next);
|
||||
// set the next element to NULL to stop the recursive deletion
|
||||
tmpptr->next = NULL;
|
||||
// set the next element to nullptr to stop the recursive deletion
|
||||
tmpptr->next = nullptr;
|
||||
delete tmpptr; // this also deletes the element
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
ElementPtr *tmpptr = m_read_ptr;
|
||||
m_read_ptr = AtomicLoadAcquire(tmpptr->next);
|
||||
t = std::move(tmpptr->current);
|
||||
tmpptr->next = NULL;
|
||||
tmpptr->next = nullptr;
|
||||
delete tmpptr;
|
||||
return true;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ private:
|
|||
class ElementPtr
|
||||
{
|
||||
public:
|
||||
ElementPtr() : next(NULL) {}
|
||||
ElementPtr() : next(nullptr) {}
|
||||
|
||||
~ElementPtr()
|
||||
{
|
||||
|
|
|
@ -150,7 +150,7 @@ bool CreateDir(const std::string &path)
|
|||
{
|
||||
INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str());
|
||||
#ifdef _WIN32
|
||||
if (::CreateDirectory(UTF8ToTStr(path).c_str(), NULL))
|
||||
if (::CreateDirectory(UTF8ToTStr(path).c_str(), nullptr))
|
||||
return true;
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_ALREADY_EXISTS)
|
||||
|
@ -250,7 +250,7 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename)
|
|||
auto df = UTF8ToTStr(destFilename);
|
||||
// The Internet seems torn about whether ReplaceFile is atomic or not.
|
||||
// Hopefully it's atomic enough...
|
||||
if (ReplaceFile(df.c_str(), sf.c_str(), NULL, REPLACEFILE_IGNORE_MERGE_ERRORS, NULL, NULL))
|
||||
if (ReplaceFile(df.c_str(), sf.c_str(), nullptr, REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr))
|
||||
return true;
|
||||
// Might have failed because the destination doesn't exist.
|
||||
if (GetLastError() == ERROR_FILE_NOT_FOUND)
|
||||
|
@ -481,7 +481,7 @@ u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry)
|
|||
FSTEntry entry;
|
||||
const std::string virtualName(TStrToUTF8(ffd.cFileName));
|
||||
#else
|
||||
struct dirent dirent, *result = NULL;
|
||||
struct dirent dirent, *result = nullptr;
|
||||
|
||||
DIR *dirp = opendir(directory.c_str());
|
||||
if (!dirp)
|
||||
|
@ -549,7 +549,7 @@ bool DeleteDirRecursively(const std::string &directory)
|
|||
{
|
||||
const std::string virtualName(TStrToUTF8(ffd.cFileName));
|
||||
#else
|
||||
struct dirent dirent, *result = NULL;
|
||||
struct dirent dirent, *result = nullptr;
|
||||
DIR *dirp = opendir(directory.c_str());
|
||||
if (!dirp)
|
||||
return false;
|
||||
|
@ -623,7 +623,7 @@ void CopyDir(const std::string &source_path, const std::string &dest_path)
|
|||
{
|
||||
const std::string virtualName(TStrToUTF8(ffd.cFileName));
|
||||
#else
|
||||
struct dirent dirent, *result = NULL;
|
||||
struct dirent dirent, *result = nullptr;
|
||||
DIR *dirp = opendir(source_path.c_str());
|
||||
if (!dirp) return;
|
||||
|
||||
|
@ -660,11 +660,11 @@ std::string GetCurrentDir()
|
|||
{
|
||||
char *dir;
|
||||
// Get the current working directory (getcwd uses malloc)
|
||||
if (!(dir = __getcwd(NULL, 0))) {
|
||||
if (!(dir = __getcwd(nullptr, 0))) {
|
||||
|
||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
|
||||
GetLastErrorMsg());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
std::string strDir = dir;
|
||||
free(dir);
|
||||
|
@ -682,11 +682,11 @@ std::string GetTempFilenameForAtomicWrite(const std::string &path)
|
|||
std::string abs = path;
|
||||
#ifdef _WIN32
|
||||
TCHAR absbuf[MAX_PATH];
|
||||
if (_tfullpath(absbuf, UTF8ToTStr(path).c_str(), MAX_PATH) != NULL)
|
||||
if (_tfullpath(absbuf, UTF8ToTStr(path).c_str(), MAX_PATH) != nullptr)
|
||||
abs = TStrToUTF8(absbuf);
|
||||
#else
|
||||
char absbuf[PATH_MAX];
|
||||
if (realpath(path.c_str(), absbuf) != NULL)
|
||||
if (realpath(path.c_str(), absbuf) != nullptr)
|
||||
abs = absbuf;
|
||||
#endif
|
||||
return abs + ".xxx";
|
||||
|
@ -715,7 +715,7 @@ std::string& GetExeDirectory()
|
|||
if (DolphinPath.empty())
|
||||
{
|
||||
TCHAR Dolphin_exe_Path[2048];
|
||||
GetModuleFileName(NULL, Dolphin_exe_Path, 2048);
|
||||
GetModuleFileName(nullptr, Dolphin_exe_Path, 2048);
|
||||
DolphinPath = TStrToUTF8(Dolphin_exe_Path);
|
||||
DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\'));
|
||||
}
|
||||
|
@ -767,14 +767,14 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
|
|||
HKEY hkey;
|
||||
DWORD local = 0;
|
||||
TCHAR configPath[MAX_PATH] = {0};
|
||||
if (RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Dolphin Emulator"), NULL, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Dolphin Emulator"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD size = 4;
|
||||
if (RegQueryValueEx(hkey, TEXT("LocalUserConfig"), NULL, NULL, reinterpret_cast<LPBYTE>(&local), &size) != ERROR_SUCCESS)
|
||||
if (RegQueryValueEx(hkey, TEXT("LocalUserConfig"), nullptr, nullptr, reinterpret_cast<LPBYTE>(&local), &size) != ERROR_SUCCESS)
|
||||
local = 0;
|
||||
|
||||
size = MAX_PATH;
|
||||
if (RegQueryValueEx(hkey, TEXT("UserConfigPath"), NULL, NULL, (LPBYTE)configPath, &size) != ERROR_SUCCESS)
|
||||
if (RegQueryValueEx(hkey, TEXT("UserConfigPath"), nullptr, nullptr, (LPBYTE)configPath, &size) != ERROR_SUCCESS)
|
||||
configPath[0] = 0;
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
|
|||
|
||||
// Get Program Files path in case we need it.
|
||||
TCHAR my_documents[MAX_PATH];
|
||||
bool my_documents_found = SUCCEEDED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, my_documents));
|
||||
bool my_documents_found = SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_MYDOCUMENTS, nullptr, SHGFP_TYPE_CURRENT, my_documents));
|
||||
|
||||
if (local) // Case 1-2
|
||||
paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
|
@ -960,7 +960,7 @@ bool ReadFileToString(const char *filename, std::string &str)
|
|||
}
|
||||
|
||||
IOFile::IOFile()
|
||||
: m_file(NULL), m_good(true)
|
||||
: m_file(nullptr), m_good(true)
|
||||
{}
|
||||
|
||||
IOFile::IOFile(std::FILE* file)
|
||||
|
@ -968,7 +968,7 @@ IOFile::IOFile(std::FILE* file)
|
|||
{}
|
||||
|
||||
IOFile::IOFile(const std::string& filename, const char openmode[])
|
||||
: m_file(NULL), m_good(true)
|
||||
: m_file(nullptr), m_good(true)
|
||||
{
|
||||
Open(filename, openmode);
|
||||
}
|
||||
|
@ -979,7 +979,7 @@ IOFile::~IOFile()
|
|||
}
|
||||
|
||||
IOFile::IOFile(IOFile&& other)
|
||||
: m_file(NULL), m_good(true)
|
||||
: m_file(nullptr), m_good(true)
|
||||
{
|
||||
Swap(other);
|
||||
}
|
||||
|
@ -1014,14 +1014,14 @@ bool IOFile::Close()
|
|||
if (!IsOpen() || 0 != std::fclose(m_file))
|
||||
m_good = false;
|
||||
|
||||
m_file = NULL;
|
||||
m_file = nullptr;
|
||||
return m_good;
|
||||
}
|
||||
|
||||
std::FILE* IOFile::ReleaseHandle()
|
||||
{
|
||||
std::FILE* const ret = m_file;
|
||||
m_file = NULL;
|
||||
m_file = nullptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ public:
|
|||
bool Close();
|
||||
|
||||
template <typename T>
|
||||
bool ReadArray(T* data, size_t length, size_t* pReadBytes = NULL)
|
||||
bool ReadArray(T* data, size_t length, size_t* pReadBytes = nullptr)
|
||||
{
|
||||
size_t read_bytes = 0;
|
||||
if (!IsOpen() || length != (read_bytes = std::fread(data, sizeof(T), length, m_file)))
|
||||
|
@ -198,11 +198,11 @@ public:
|
|||
return WriteArray(reinterpret_cast<const char*>(data), length);
|
||||
}
|
||||
|
||||
bool IsOpen() { return NULL != m_file; }
|
||||
bool IsOpen() { return nullptr != m_file; }
|
||||
|
||||
// m_good is set to false when a read, write or other function fails
|
||||
bool IsGood() { return m_good; }
|
||||
operator void*() { return m_good ? m_file : NULL; }
|
||||
operator void*() { return m_good ? m_file : nullptr; }
|
||||
|
||||
std::FILE* ReleaseHandle();
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ const IniFile::Section* IniFile::GetSection(const std::string& sectionName) cons
|
|||
for (const Section& sect : sections)
|
||||
if (!strcasecmp(sect.name.c_str(), sectionName.c_str()))
|
||||
return (&(sect));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IniFile::Section* IniFile::GetSection(const std::string& sectionName)
|
||||
|
@ -220,7 +220,7 @@ IniFile::Section* IniFile::GetSection(const std::string& sectionName)
|
|||
for (Section& sect : sections)
|
||||
if (!strcasecmp(sect.name.c_str(), sectionName.c_str()))
|
||||
return (&(sect));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IniFile::Section* IniFile::GetOrCreateSection(const std::string& sectionName)
|
||||
|
@ -335,7 +335,7 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data)
|
|||
|
||||
if (in.fail()) return false;
|
||||
|
||||
Section* current_section = NULL;
|
||||
Section* current_section = nullptr;
|
||||
while (!in.eof())
|
||||
{
|
||||
char templine[MAX_BYTES];
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
// good header, read some key/value pairs
|
||||
K key;
|
||||
|
||||
V *value = NULL;
|
||||
V *value = nullptr;
|
||||
u32 value_size;
|
||||
u32 entry_number;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
LogManager *LogManager::m_logManager = NULL;
|
||||
LogManager *LogManager::m_logManager = nullptr;
|
||||
|
||||
LogManager::LogManager()
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ void LogManager::Init()
|
|||
void LogManager::Shutdown()
|
||||
{
|
||||
delete m_logManager;
|
||||
m_logManager = NULL;
|
||||
m_logManager = nullptr;
|
||||
}
|
||||
|
||||
LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable)
|
||||
|
|
|
@ -29,7 +29,7 @@ class FileLogListener : public LogListener
|
|||
public:
|
||||
FileLogListener(const char *filename);
|
||||
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg);
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg) override;
|
||||
|
||||
bool IsValid() { return !m_logfile.fail(); }
|
||||
bool IsEnabled() const { return m_enable; }
|
||||
|
@ -46,7 +46,7 @@ private:
|
|||
class DebuggerLogListener : public LogListener
|
||||
{
|
||||
public:
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg);
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg) override;
|
||||
};
|
||||
|
||||
class LogContainer
|
||||
|
|
|
@ -52,7 +52,7 @@ int AshmemCreateFileMapping(const char *name, size_t size)
|
|||
void MemArena::GrabLowMemSpace(size_t size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, (DWORD)(size), NULL);
|
||||
hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, (DWORD)(size), nullptr);
|
||||
#elif defined(ANDROID)
|
||||
fd = AshmemCreateFileMapping("Dolphin-emu", size);
|
||||
if (fd < 0)
|
||||
|
@ -190,9 +190,9 @@ static bool Memory_TryBase(u8 *base, const MemoryView *views, int num_views, u32
|
|||
for (int i = 0; i < num_views; i++)
|
||||
{
|
||||
if (views[i].out_ptr_low)
|
||||
*views[i].out_ptr_low = 0;
|
||||
*views[i].out_ptr_low = nullptr;
|
||||
if (views[i].out_ptr)
|
||||
*views[i].out_ptr = 0;
|
||||
*views[i].out_ptr = nullptr;
|
||||
}
|
||||
|
||||
int i;
|
||||
|
@ -255,13 +255,13 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena
|
|||
{
|
||||
PanicAlert("MemoryMap_Setup: Failed finding a memory base.");
|
||||
exit(0);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
// Try a whole range of possible bases. Return once we got a valid one.
|
||||
u32 max_base_addr = 0x7FFF0000 - 0x31000000;
|
||||
u8 *base = NULL;
|
||||
u8 *base = nullptr;
|
||||
|
||||
for (u32 base_addr = 0x40000; base_addr < max_base_addr; base_addr += 0x40000)
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ void MemoryMap_Shutdown(const MemoryView *views, int num_views, u32 flags, MemAr
|
|||
{
|
||||
arena->ReleaseView(*outptr, view->size);
|
||||
freeset.insert(*outptr);
|
||||
*outptr = NULL;
|
||||
*outptr = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ void* AllocateExecutableMemory(size_t size, bool low)
|
|||
#if defined(_WIN32)
|
||||
void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
#else
|
||||
static char *map_hint = 0;
|
||||
static char *map_hint = nullptr;
|
||||
#if defined(__x86_64__) && !defined(MAP_32BIT)
|
||||
// This OS has no flag to enforce allocation below the 4 GB boundary,
|
||||
// but if we hint that we want a low address it is very likely we will
|
||||
|
@ -56,9 +56,9 @@ void* AllocateExecutableMemory(size_t size, bool low)
|
|||
#if defined(__FreeBSD__)
|
||||
if (ptr == MAP_FAILED)
|
||||
{
|
||||
ptr = NULL;
|
||||
ptr = nullptr;
|
||||
#else
|
||||
if (ptr == NULL)
|
||||
if (ptr == nullptr)
|
||||
{
|
||||
#endif
|
||||
PanicAlert("Failed to allocate executable memory");
|
||||
|
@ -88,14 +88,14 @@ void* AllocateMemoryPages(size_t size)
|
|||
#ifdef _WIN32
|
||||
void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
|
||||
#else
|
||||
void* ptr = mmap(0, size, PROT_READ | PROT_WRITE,
|
||||
void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE,
|
||||
MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
#endif
|
||||
|
||||
// printf("Mapped memory at %p (size %ld)\n", ptr,
|
||||
// (unsigned long)size);
|
||||
|
||||
if (ptr == NULL)
|
||||
if (ptr == nullptr)
|
||||
PanicAlert("Failed to allocate raw memory");
|
||||
|
||||
return ptr;
|
||||
|
@ -106,7 +106,7 @@ void* AllocateAlignedMemory(size_t size,size_t alignment)
|
|||
#ifdef _WIN32
|
||||
void* ptr = _aligned_malloc(size,alignment);
|
||||
#else
|
||||
void* ptr = NULL;
|
||||
void* ptr = nullptr;
|
||||
#ifdef ANDROID
|
||||
ptr = memalign(alignment, size);
|
||||
#else
|
||||
|
@ -118,7 +118,7 @@ void* AllocateAlignedMemory(size_t size,size_t alignment)
|
|||
// printf("Mapped memory at %p (size %ld)\n", ptr,
|
||||
// (unsigned long)size);
|
||||
|
||||
if (ptr == NULL)
|
||||
if (ptr == nullptr)
|
||||
PanicAlert("Failed to allocate aligned memory");
|
||||
|
||||
return ptr;
|
||||
|
@ -185,7 +185,7 @@ std::string MemUsage()
|
|||
// Print information about the memory usage of the process.
|
||||
|
||||
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID);
|
||||
if (NULL == hProcess) return "MemUsage Error";
|
||||
if (nullptr == hProcess) return "MemUsage Error";
|
||||
|
||||
if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc)))
|
||||
Ret = StringFromFormat("%s K", ThousandSeparate(pmc.WorkingSetSize / 1024, 7).c_str());
|
||||
|
|
|
@ -21,9 +21,9 @@ const char* GetLastErrorMsg()
|
|||
#ifdef _WIN32
|
||||
static __declspec(thread) char err_str[buff_size] = {};
|
||||
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
err_str, buff_size, NULL);
|
||||
err_str, buff_size, nullptr);
|
||||
#else
|
||||
static __thread char err_str[buff_size] = {};
|
||||
|
||||
|
|
|
@ -72,9 +72,9 @@ public:
|
|||
#if defined(_WIN32) && defined(USE_CONDITION_VARIABLES)
|
||||
InitializeConditionVariable(&m_handle);
|
||||
#elif defined(_WIN32)
|
||||
m_handle = CreateEvent(NULL, false, false, NULL);
|
||||
m_handle = CreateEvent(nullptr, false, false, nullptr);
|
||||
#else
|
||||
pthread_cond_init(&m_handle, NULL);
|
||||
pthread_cond_init(&m_handle, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
#ifdef _WIN32
|
||||
InitializeSRWLock(&m_handle);
|
||||
#else
|
||||
pthread_mutex_init(&m_handle, NULL);
|
||||
pthread_mutex_init(&m_handle, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public:
|
|||
typedef Mutex mutex_type;
|
||||
|
||||
unique_lock()
|
||||
: pm(NULL), owns(false)
|
||||
: pm(nullptr), owns(false)
|
||||
{}
|
||||
|
||||
/*explicit*/ unique_lock(mutex_type& m)
|
||||
|
@ -290,11 +290,11 @@ public:
|
|||
unique_lock(const unique_lock&) /*= delete*/;
|
||||
|
||||
unique_lock(unique_lock&& other)
|
||||
: pm(NULL), owns(false)
|
||||
: pm(nullptr), owns(false)
|
||||
{
|
||||
#else
|
||||
unique_lock(const unique_lock& u)
|
||||
: pm(NULL), owns(false)
|
||||
: pm(nullptr), owns(false)
|
||||
{
|
||||
// ugly const_cast to get around lack of rvalue references
|
||||
unique_lock& other = const_cast<unique_lock&>(u);
|
||||
|
@ -335,7 +335,7 @@ public:
|
|||
{
|
||||
auto const ret = mutex();
|
||||
|
||||
pm = NULL;
|
||||
pm = nullptr;
|
||||
owns = false;
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -193,7 +193,7 @@ public:
|
|||
WaitForSingleObject(m_handle, INFINITE);
|
||||
detach();
|
||||
#else
|
||||
pthread_join(m_id.m_thread, NULL);
|
||||
pthread_join(m_id.m_thread, nullptr);
|
||||
m_id = id();
|
||||
#endif
|
||||
}
|
||||
|
@ -238,9 +238,9 @@ private:
|
|||
void StartThread(F* param)
|
||||
{
|
||||
#ifdef USE_BEGINTHREADEX
|
||||
m_handle = (HANDLE)_beginthreadex(NULL, 0, &RunAndDelete<F>, param, 0, &m_id.m_thread);
|
||||
m_handle = (HANDLE)_beginthreadex(nullptr, 0, &RunAndDelete<F>, param, 0, &m_id.m_thread);
|
||||
#elif defined(_WIN32)
|
||||
m_handle = CreateThread(NULL, 0, &RunAndDelete<F>, param, 0, &m_id.m_thread);
|
||||
m_handle = CreateThread(nullptr, 0, &RunAndDelete<F>, param, 0, &m_id.m_thread);
|
||||
#else
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
// faster than sscanf
|
||||
bool AsciiToHex(const char* _szValue, u32& result)
|
||||
{
|
||||
char *endptr = NULL;
|
||||
char *endptr = nullptr;
|
||||
const u32 value = strtoul(_szValue, &endptr, 16);
|
||||
|
||||
if (!endptr || *endptr)
|
||||
|
@ -66,7 +66,7 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
|
|||
// will be present in the middle of a multibyte sequence.
|
||||
//
|
||||
// This is why we lookup an ANSI (cp1252) locale here and use _vsnprintf_l.
|
||||
static locale_t c_locale = NULL;
|
||||
static locale_t c_locale = nullptr;
|
||||
if (!c_locale)
|
||||
c_locale = _create_locale(LC_ALL, ".1252");
|
||||
writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args);
|
||||
|
@ -89,7 +89,7 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
|
|||
std::string StringFromFormat(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *buf = NULL;
|
||||
char *buf = nullptr;
|
||||
#ifdef _WIN32
|
||||
int required = 0;
|
||||
|
||||
|
@ -159,7 +159,7 @@ std::string StripQuotes(const std::string& s)
|
|||
|
||||
bool TryParse(const std::string &str, u32 *const output)
|
||||
{
|
||||
char *endptr = NULL;
|
||||
char *endptr = nullptr;
|
||||
|
||||
// Reset errno to a value other than ERANGE
|
||||
errno = 0;
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
|
||||
void SymbolDB::List()
|
||||
{
|
||||
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
|
||||
for (const auto& func : functions)
|
||||
{
|
||||
DEBUG_LOG(OSHLE, "%s @ %08x: %i bytes (hash %08x) : %i calls",
|
||||
iter->second.name.c_str(), iter->second.address,
|
||||
iter->second.size, iter->second.hash,
|
||||
iter->second.numCalls);
|
||||
func.second.name.c_str(), func.second.address,
|
||||
func.second.size, func.second.hash,
|
||||
func.second.numCalls);
|
||||
}
|
||||
INFO_LOG(OSHLE, "%lu functions known in this program above.",
|
||||
(unsigned long)functions.size());
|
||||
|
@ -46,7 +46,7 @@ Symbol *SymbolDB::GetSymbolFromName(const char *name)
|
|||
if (!strcmp(func.second.name.c_str(), name))
|
||||
return &func.second;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SymbolDB::AddCompleteSymbol(const Symbol &symbol)
|
||||
|
|
|
@ -79,8 +79,8 @@ protected:
|
|||
public:
|
||||
SymbolDB() {}
|
||||
virtual ~SymbolDB() {}
|
||||
virtual Symbol *GetSymbolFromAddr(u32 addr) { return 0; }
|
||||
virtual Symbol *AddFunction(u32 startAddr) { return 0;}
|
||||
virtual Symbol *GetSymbolFromAddr(u32 addr) { return nullptr; }
|
||||
virtual Symbol *AddFunction(u32 startAddr) { return nullptr;}
|
||||
|
||||
void AddCompleteSymbol(const Symbol &symbol);
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
if (iter != checksumToFunction.end())
|
||||
return iter->second;
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const XFuncMap &Symbols() const {return functions;}
|
||||
|
|
|
@ -27,7 +27,7 @@ u32 Timer::GetTimeMs()
|
|||
return timeGetTime();
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
(void)gettimeofday(&t, nullptr);
|
||||
return ((u32)(t.tv_sec * 1000 + t.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ std::string Timer::GetTimeFormatted()
|
|||
return StringFromFormat("%s:%03i", tmp, tp.millitm);
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
(void)gettimeofday(&t, nullptr);
|
||||
return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ double Timer::GetDoubleTime()
|
|||
(void)::ftime(&tp);
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
(void)gettimeofday(&t, nullptr);
|
||||
#endif
|
||||
// Get continuous timestamp
|
||||
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970();
|
||||
|
|
|
@ -265,7 +265,7 @@ protected:
|
|||
inline void Write64(u64 value) {*(u64*)code = (value); code += 8;}
|
||||
|
||||
public:
|
||||
XEmitter() { code = NULL; }
|
||||
XEmitter() { code = nullptr; }
|
||||
XEmitter(u8 *code_ptr) { code = code_ptr; }
|
||||
virtual ~XEmitter() {}
|
||||
|
||||
|
@ -773,7 +773,7 @@ protected:
|
|||
size_t region_size;
|
||||
|
||||
public:
|
||||
XCodeBlock() : region(NULL), region_size(0) {}
|
||||
XCodeBlock() : region(nullptr), region_size(0) {}
|
||||
virtual ~XCodeBlock() { if (region) FreeCodeSpace(); }
|
||||
|
||||
// Call this before you generate any code.
|
||||
|
@ -797,7 +797,7 @@ public:
|
|||
void FreeCodeSpace()
|
||||
{
|
||||
FreeMemoryPages(region, region_size);
|
||||
region = NULL;
|
||||
region = nullptr;
|
||||
region_size = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ enum
|
|||
};
|
||||
|
||||
// pointer to the code currently being run, (used by log messages that include the code name)
|
||||
static ARCode const* current_code = NULL;
|
||||
static ARCode const* current_code = nullptr;
|
||||
|
||||
static bool b_RanOnce = false;
|
||||
static std::vector<ARCode> arCodes;
|
||||
|
|
|
@ -81,6 +81,6 @@ void InstallExceptionHandler()
|
|||
sa.sa_sigaction = &sigsegv_handler;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
sigaction(SIGSEGV, &sa, nullptr);
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
@ -125,7 +125,7 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
|
|||
bool CBoot::LoadMapFromFilename()
|
||||
{
|
||||
std::string strMapFilename;
|
||||
bool found = FindMapFile(&strMapFilename, NULL);
|
||||
bool found = FindMapFile(&strMapFilename, nullptr);
|
||||
if (found && g_symbolDB.LoadMap(strMapFilename.c_str()))
|
||||
{
|
||||
UpdateDebugger_MapLoaded();
|
||||
|
@ -201,7 +201,7 @@ bool CBoot::BootUp()
|
|||
case SCoreStartupParameter::BOOT_ISO:
|
||||
{
|
||||
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_StartupPara.m_strFilename);
|
||||
if (pVolume == NULL)
|
||||
if (pVolume == nullptr)
|
||||
break;
|
||||
|
||||
bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
||||
|
|
|
@ -30,10 +30,10 @@ public:
|
|||
// Tries to find a map file for the current game by looking first in the
|
||||
// local user directory, then in the shared user directory.
|
||||
//
|
||||
// If existing_map_file is not NULL and a map file exists, it is set to the
|
||||
// If existing_map_file is not nullptr and a map file exists, it is set to the
|
||||
// path to the existing map file.
|
||||
//
|
||||
// If writable_map_file is not NULL, it is set to the path to where a map
|
||||
// If writable_map_file is not nullptr, it is set to the path to where a map
|
||||
// file should be saved.
|
||||
//
|
||||
// Returns true if a map file exists, false if none could be found.
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
private:
|
||||
static void RunFunction(u32 _iAddr);
|
||||
|
||||
static void UpdateDebugger_MapLoaded(const char* _gameID = NULL);
|
||||
static void UpdateDebugger_MapLoaded(const char* _gameID = nullptr);
|
||||
|
||||
static bool LoadMapFromFilename();
|
||||
static bool Boot_ELF(const char *filename);
|
||||
|
|
|
@ -34,13 +34,13 @@ CDolLoader::~CDolLoader()
|
|||
for (auto& sect : text_section)
|
||||
{
|
||||
delete [] sect;
|
||||
sect = NULL;
|
||||
sect = nullptr;
|
||||
}
|
||||
|
||||
for (auto& sect : data_section)
|
||||
{
|
||||
delete [] sect;
|
||||
sect = NULL;
|
||||
sect = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,9 @@ void CDolLoader::Initialize(u8* _pBuffer, u32 _Size)
|
|||
p[i] = Common::swap32(p[i]);
|
||||
|
||||
for (auto& sect : text_section)
|
||||
sect = NULL;
|
||||
sect = nullptr;
|
||||
for (auto& sect : data_section)
|
||||
sect = NULL;
|
||||
sect = nullptr;
|
||||
|
||||
u32 HID4_pattern = 0x7c13fba6;
|
||||
u32 HID4_mask = 0xfc1fffff;
|
||||
|
|
|
@ -90,7 +90,7 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
|
|||
|
||||
// DOL
|
||||
const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(ContentLoader.GetBootIndex());
|
||||
if (pContent == NULL)
|
||||
if (pContent == nullptr)
|
||||
return false;
|
||||
|
||||
WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename);
|
||||
|
@ -119,7 +119,7 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
|
|||
|
||||
// Load patches and run startup patches
|
||||
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_pFilename);
|
||||
if (pVolume != NULL)
|
||||
if (pVolume != nullptr)
|
||||
PatchEngine::LoadPatches();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -82,7 +82,7 @@ ElfReader::ElfReader(void *ptr)
|
|||
const char *ElfReader::GetSectionName(int section) const
|
||||
{
|
||||
if (sections[section].sh_type == SHT_NULL)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
int nameOffset = sections[section].sh_name;
|
||||
char *ptr = (char*)GetSectionDataPtr(header->e_shstrndx);
|
||||
|
@ -90,7 +90,7 @@ const char *ElfReader::GetSectionName(int section) const
|
|||
if (ptr)
|
||||
return ptr + nameOffset;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ElfReader::LoadInto(u32 vaddr)
|
||||
|
@ -181,7 +181,7 @@ SectionID ElfReader::GetSectionByName(const char *name, int firstSection) const
|
|||
{
|
||||
const char *secname = GetSectionName(i);
|
||||
|
||||
if (secname != NULL && strcmp(name, secname) == 0)
|
||||
if (secname != nullptr && strcmp(name, secname) == 0)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -51,11 +51,11 @@ public:
|
|||
const u8 *GetSectionDataPtr(int section) const
|
||||
{
|
||||
if (section < 0 || section >= header->e_shnum)
|
||||
return 0;
|
||||
return nullptr;
|
||||
if (sections[section].sh_type != SHT_NOBITS)
|
||||
return GetPtr(sections[section].sh_offset);
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
bool IsCodeSection(int section) const
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ void SConfig::Init()
|
|||
void SConfig::Shutdown()
|
||||
{
|
||||
delete m_Instance;
|
||||
m_Instance = NULL;
|
||||
m_Instance = nullptr;
|
||||
}
|
||||
|
||||
SConfig::~SConfig()
|
||||
|
|
|
@ -79,7 +79,7 @@ void EmuThread();
|
|||
bool g_bStopping = false;
|
||||
bool g_bHwInit = false;
|
||||
bool g_bStarted = false;
|
||||
void *g_pWindowHandle = NULL;
|
||||
void *g_pWindowHandle = nullptr;
|
||||
std::string g_stateFileName;
|
||||
std::thread g_EmuThread;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "DiscIO/VolumeCreator.h"
|
||||
|
||||
SCoreStartupParameter::SCoreStartupParameter()
|
||||
: hInstance(0),
|
||||
: hInstance(nullptr),
|
||||
bEnableDebugging(false), bAutomaticStart(false), bBootToPause(false),
|
||||
bJITNoBlockCache(false), bJITBlockLinking(true),
|
||||
bJITOff(false),
|
||||
|
@ -125,7 +125,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
|||
}
|
||||
|
||||
std::string Extension;
|
||||
SplitPath(m_strFilename, NULL, NULL, &Extension);
|
||||
SplitPath(m_strFilename, nullptr, nullptr, &Extension);
|
||||
if (!strcasecmp(Extension.c_str(), ".gcm") ||
|
||||
!strcasecmp(Extension.c_str(), ".iso") ||
|
||||
!strcasecmp(Extension.c_str(), ".wbfs") ||
|
||||
|
@ -135,7 +135,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
|||
{
|
||||
m_BootType = BOOT_ISO;
|
||||
DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(m_strFilename);
|
||||
if (pVolume == NULL)
|
||||
if (pVolume == nullptr)
|
||||
{
|
||||
if (bootDrive)
|
||||
PanicAlertT("Could not read \"%s\". "
|
||||
|
@ -223,7 +223,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
|||
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(m_strFilename);
|
||||
const DiscIO::INANDContentLoader& ContentLoader = DiscIO::CNANDContentManager::Access().GetNANDLoader(m_strFilename);
|
||||
|
||||
if (ContentLoader.GetContentByIndex(ContentLoader.GetBootIndex()) == NULL)
|
||||
if (ContentLoader.GetContentByIndex(ContentLoader.GetBootIndex()) == nullptr)
|
||||
{
|
||||
//WAD is valid yet cannot be booted. Install instead.
|
||||
u64 installed = DiscIO::CNANDContentManager::Access().Install_WiiWAD(m_strFilename);
|
||||
|
|
|
@ -43,7 +43,7 @@ static std::mutex tsWriteLock;
|
|||
Common::FifoQueue<BaseEvent, false> tsQueue;
|
||||
|
||||
// event pools
|
||||
Event *eventPool = 0;
|
||||
Event *eventPool = nullptr;
|
||||
|
||||
int downcount, slicelength;
|
||||
int maxSliceLength = MAX_SLICE_LENGTH;
|
||||
|
@ -59,7 +59,7 @@ u64 fakeTBStartTicks;
|
|||
int ev_lost;
|
||||
|
||||
|
||||
void (*advanceCallback)(int cyclesExecuted) = NULL;
|
||||
void (*advanceCallback)(int cyclesExecuted) = nullptr;
|
||||
|
||||
Event* GetNewEvent()
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ void ClearPendingEvents()
|
|||
|
||||
void AddEventToQueue(Event* ne)
|
||||
{
|
||||
Event* prev = NULL;
|
||||
Event* prev = nullptr;
|
||||
Event** pNext = &first;
|
||||
for(;;)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ static const char *err_string[] =
|
|||
};
|
||||
|
||||
DSPAssembler::DSPAssembler(const AssemblerSettings &settings) :
|
||||
gdg_buffer(NULL),
|
||||
gdg_buffer(nullptr),
|
||||
m_cur_addr(0),
|
||||
m_cur_pass(0),
|
||||
m_current_param(0),
|
||||
|
@ -127,7 +127,7 @@ bool DSPAssembler::Assemble(const char *text, std::vector<u16> &code, std::vecto
|
|||
|
||||
if(gdg_buffer) {
|
||||
free(gdg_buffer);
|
||||
gdg_buffer = NULL;
|
||||
gdg_buffer = nullptr;
|
||||
}
|
||||
|
||||
last_error_str = "(no errors)";
|
||||
|
@ -310,7 +310,7 @@ char *DSPAssembler::FindBrackets(char *src, char *dst)
|
|||
}
|
||||
if (count)
|
||||
ShowError(ERR_NO_MATCHING_BRACKETS);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Bizarre in-place expression evaluator.
|
||||
|
@ -323,7 +323,7 @@ u32 DSPAssembler::ParseExpression(const char *ptr)
|
|||
char *s_buffer = (char *)malloc(1024);
|
||||
strcpy(s_buffer, ptr);
|
||||
|
||||
while ((pbuf = FindBrackets(s_buffer, d_buffer)) != NULL)
|
||||
while ((pbuf = FindBrackets(s_buffer, d_buffer)) != nullptr)
|
||||
{
|
||||
val = ParseExpression(d_buffer);
|
||||
sprintf(d_buffer, "%s%d%s", s_buffer, val, pbuf);
|
||||
|
@ -359,14 +359,14 @@ u32 DSPAssembler::ParseExpression(const char *ptr)
|
|||
d_buffer[i] = c;
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "+")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "+")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) + ParseExpression(pbuf+1);
|
||||
sprintf(d_buffer, "%d", val);
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "-")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "-")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) - ParseExpression(pbuf+1);
|
||||
|
@ -378,28 +378,28 @@ u32 DSPAssembler::ParseExpression(const char *ptr)
|
|||
sprintf(d_buffer, "%d", val);
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "*")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "*")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) * ParseExpression(pbuf+1);
|
||||
sprintf(d_buffer, "%d", val);
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "/")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "/")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) / ParseExpression(pbuf+1);
|
||||
sprintf(d_buffer, "%d", val);
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "|")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "|")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) | ParseExpression(pbuf+1);
|
||||
sprintf(d_buffer, "%d", val);
|
||||
}
|
||||
|
||||
while ((pbuf = strstr(d_buffer, "&")) != NULL)
|
||||
while ((pbuf = strstr(d_buffer, "&")) != nullptr)
|
||||
{
|
||||
*pbuf = 0x0;
|
||||
val = ParseExpression(d_buffer) & ParseExpression(pbuf+1);
|
||||
|
@ -420,7 +420,7 @@ u32 DSPAssembler::GetParams(char *parstr, param_t *par)
|
|||
tmpstr = strtok(tmpstr, ",\x00");
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if (tmpstr == NULL)
|
||||
if (tmpstr == nullptr)
|
||||
break;
|
||||
tmpstr = skip_spaces(tmpstr);
|
||||
if (strlen(tmpstr) == 0)
|
||||
|
@ -463,7 +463,7 @@ u32 DSPAssembler::GetParams(char *parstr, param_t *par)
|
|||
par[i].type = P_VAL;
|
||||
break;
|
||||
}
|
||||
tmpstr = strtok(NULL, ",\x00");
|
||||
tmpstr = strtok(nullptr, ",\x00");
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ const opc_t *DSPAssembler::FindOpcode(const char *opcode, u32 par_count, const o
|
|||
}
|
||||
}
|
||||
ShowError(ERR_UNKNOWN_OPCODE);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// weird...
|
||||
|
@ -780,8 +780,8 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
|
|||
//printf("A: %s\n", line);
|
||||
code_line++;
|
||||
|
||||
param_t params[10] = {{0, P_NONE, NULL}};
|
||||
param_t params_ext[10] = {{0, P_NONE, NULL}};
|
||||
param_t params[10] = {{0, P_NONE, nullptr}};
|
||||
param_t params_ext[10] = {{0, P_NONE, nullptr}};
|
||||
|
||||
bool upper = true;
|
||||
for (int i = 0; i < LINEBUF_SIZE; i++)
|
||||
|
@ -851,33 +851,33 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
|
|||
}
|
||||
}
|
||||
|
||||
char *opcode = NULL;
|
||||
char *opcode = nullptr;
|
||||
opcode = strtok(ptr, " ");
|
||||
char *opcode_ext = NULL;
|
||||
char *opcode_ext = nullptr;
|
||||
|
||||
u32 params_count = 0;
|
||||
u32 params_count_ext = 0;
|
||||
if (opcode)
|
||||
{
|
||||
if ((opcode_ext = strstr(opcode, "'")) != NULL)
|
||||
if ((opcode_ext = strstr(opcode, "'")) != nullptr)
|
||||
{
|
||||
opcode_ext[0] = '\0';
|
||||
opcode_ext++;
|
||||
if (strlen(opcode_ext) == 0)
|
||||
opcode_ext = NULL;
|
||||
opcode_ext = nullptr;
|
||||
}
|
||||
// now we have opcode and label
|
||||
|
||||
params_count = 0;
|
||||
params_count_ext = 0;
|
||||
|
||||
char *paramstr = strtok(NULL, "\0");
|
||||
char *paramstr_ext = 0;
|
||||
char *paramstr = strtok(nullptr, "\0");
|
||||
char *paramstr_ext = nullptr;
|
||||
// there is valid opcode so probably we have parameters
|
||||
|
||||
if (paramstr)
|
||||
{
|
||||
if ((paramstr_ext = strstr(paramstr, ":")) != NULL)
|
||||
if ((paramstr_ext = strstr(paramstr, ":")) != nullptr)
|
||||
{
|
||||
paramstr_ext[0] = '\0';
|
||||
paramstr_ext++;
|
||||
|
@ -899,14 +899,14 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
|
|||
if (strcmp(opcode, "EQU") == 0)
|
||||
{
|
||||
lval = params[0].val;
|
||||
opcode = NULL;
|
||||
opcode = nullptr;
|
||||
}
|
||||
}
|
||||
if (pass == 1)
|
||||
labels.RegisterLabel(label, lval);
|
||||
}
|
||||
|
||||
if (opcode == NULL)
|
||||
if (opcode == nullptr)
|
||||
continue;
|
||||
|
||||
// check if opcode is reserved compiler word
|
||||
|
@ -981,7 +981,7 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
|
|||
|
||||
VerifyParams(opc, params, params_count);
|
||||
|
||||
const opc_t *opc_ext = NULL;
|
||||
const opc_t *opc_ext = nullptr;
|
||||
// Check for opcode extensions.
|
||||
if (opc->extended)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
// one for each word of code, indicating the source assembler code line number it came from.
|
||||
|
||||
// If returns false, call GetErrorString to get some text to present to the user.
|
||||
bool Assemble(const char *text, std::vector<u16> &code, std::vector<int> *line_numbers = NULL);
|
||||
bool Assemble(const char *text, std::vector<u16> &code, std::vector<int> *line_numbers = nullptr);
|
||||
|
||||
std::string GetErrorString() const { return last_error_str; }
|
||||
err_t GetError() const { return last_error; }
|
||||
|
@ -103,8 +103,8 @@ private:
|
|||
void InitPass(int pass);
|
||||
bool AssembleFile(const char *fname, int pass);
|
||||
|
||||
void ShowError(err_t err_code, const char *extra_info = NULL);
|
||||
// void ShowWarning(err_t err_code, const char *extra_info = NULL);
|
||||
void ShowError(err_t err_code, const char *extra_info = nullptr);
|
||||
// void ShowWarning(err_t err_code, const char *extra_info = nullptr);
|
||||
|
||||
char *FindBrackets(char *src, char *dst);
|
||||
const opc_t *FindOpcode(const char *opcode, u32 par_count, const opc_t * const opcod, int opcod_size);
|
||||
|
|
|
@ -114,7 +114,7 @@ void CodeToHeader(const std::vector<u16> &code, std::string _filename,
|
|||
header.reserve(code_padded.size() * 4);
|
||||
header.append("#define NUM_UCODES 1\n\n");
|
||||
std::string filename;
|
||||
SplitPath(_filename, NULL, &filename, NULL);
|
||||
SplitPath(_filename, nullptr, &filename, nullptr);
|
||||
header.append(StringFromFormat("const char* UCODE_NAMES[NUM_UCODES] = {\"%s\"};\n\n", filename.c_str()));
|
||||
header.append("const unsigned short dsp_code[NUM_UCODES][0x1000] = {\n");
|
||||
|
||||
|
@ -151,7 +151,7 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
|
|||
for (u32 i = 0; i < numCodes; i++)
|
||||
{
|
||||
std::string filename;
|
||||
if (! SplitPath(filenames->at(i), NULL, &filename, NULL))
|
||||
if (! SplitPath(filenames->at(i), nullptr, &filename, nullptr))
|
||||
filename = filenames->at(i);
|
||||
header.append(StringFromFormat("\t\"%s\",\n", filename.c_str()));
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ DSPBreakpoints dsp_breakpoints;
|
|||
DSPCoreState core_state = DSPCORE_STOP;
|
||||
u16 cyclesLeft = 0;
|
||||
bool init_hax = false;
|
||||
DSPEmitter *dspjit = NULL;
|
||||
DSPEmitter *dspjit = nullptr;
|
||||
Common::Event step_event;
|
||||
|
||||
static bool LoadRom(const char *fname, int size_in_words, u16 *rom)
|
||||
|
@ -133,7 +133,7 @@ static void DSPCore_FreeMemoryPages()
|
|||
FreeMemoryPages(g_dsp.iram, DSP_IRAM_BYTE_SIZE);
|
||||
FreeMemoryPages(g_dsp.dram, DSP_DRAM_BYTE_SIZE);
|
||||
FreeMemoryPages(g_dsp.coef, DSP_COEF_BYTE_SIZE);
|
||||
g_dsp.irom = g_dsp.iram = g_dsp.dram = g_dsp.coef = NULL;
|
||||
g_dsp.irom = g_dsp.iram = g_dsp.dram = g_dsp.coef = nullptr;
|
||||
}
|
||||
|
||||
bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
|
||||
|
@ -142,7 +142,7 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
|
|||
g_dsp.step_counter = 0;
|
||||
cyclesLeft = 0;
|
||||
init_hax = false;
|
||||
dspjit = NULL;
|
||||
dspjit = nullptr;
|
||||
|
||||
g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE);
|
||||
g_dsp.iram = (u16*)AllocateMemoryPages(DSP_IRAM_BYTE_SIZE);
|
||||
|
@ -218,7 +218,7 @@ void DSPCore_Shutdown()
|
|||
|
||||
if(dspjit) {
|
||||
delete dspjit;
|
||||
dspjit = NULL;
|
||||
dspjit = nullptr;
|
||||
}
|
||||
DSPCore_FreeMemoryPages();
|
||||
}
|
||||
|
|
|
@ -208,8 +208,8 @@ bool DSPDisassembler::DisOpcode(const u16 *binbuf, int base_addr, int pass, u16
|
|||
|
||||
const u32 op1 = binbuf[*pc & 0x0fff];
|
||||
|
||||
const DSPOPCTemplate *opc = NULL;
|
||||
const DSPOPCTemplate *opc_ext = NULL;
|
||||
const DSPOPCTemplate *opc = nullptr;
|
||||
const DSPOPCTemplate *opc_ext = nullptr;
|
||||
|
||||
// find opcode
|
||||
for (int j = 0; j < opcodes_size; j++)
|
||||
|
@ -222,7 +222,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, nullptr, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false, false, false, false, false};
|
||||
if (!opc)
|
||||
opc = &fake_op;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ using namespace Gen;
|
|||
|
||||
DSPEmitter::DSPEmitter() : gpr(*this), storeIndex(-1), storeIndex2(-1)
|
||||
{
|
||||
m_compiledCode = NULL;
|
||||
m_compiledCode = nullptr;
|
||||
|
||||
AllocCodeSpace(COMPILED_CODE_SIZE);
|
||||
|
||||
|
@ -37,7 +37,7 @@ DSPEmitter::DSPEmitter() : gpr(*this), storeIndex(-1), storeIndex2(-1)
|
|||
for(int i = 0x0000; i < MAX_BLOCKS; i++)
|
||||
{
|
||||
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||
blockLinks[i] = 0;
|
||||
blockLinks[i] = nullptr;
|
||||
blockSize[i] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void DSPEmitter::ClearIRAM()
|
|||
for(int i = 0x0000; i < 0x1000; i++)
|
||||
{
|
||||
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||
blockLinks[i] = 0;
|
||||
blockLinks[i] = nullptr;
|
||||
blockSize[i] = 0;
|
||||
unresolvedJumps[i].clear();
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ void DSPEmitter::ClearIRAMandDSPJITCodespaceReset()
|
|||
for(int i = 0x0000; i < 0x10000; i++)
|
||||
{
|
||||
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||
blockLinks[i] = 0;
|
||||
blockLinks[i] = nullptr;
|
||||
blockSize[i] = 0;
|
||||
unresolvedJumps[i].clear();
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ void DSPEmitter::Compile(u16 start_addr)
|
|||
{
|
||||
// Mark the block to be recompiled again
|
||||
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||
blockLinks[i] = 0;
|
||||
blockLinks[i] = nullptr;
|
||||
blockSize[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ const DSPOPCTemplate opcodes[] =
|
|||
};
|
||||
|
||||
const DSPOPCTemplate cw =
|
||||
{"CW", 0x0000, 0x0000, nop, NULL, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false, false, false, false, false};
|
||||
{"CW", 0x0000, 0x0000, nop, nullptr, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false, false, false, false, false};
|
||||
|
||||
// extended opcodes
|
||||
|
||||
|
@ -353,43 +353,43 @@ const pdlabel_t pdlabels[] =
|
|||
{0xffae, "COEF_A1_7", "COEF_A1_7",},
|
||||
{0xffaf, "COEF_A2_7", "COEF_A2_7",},
|
||||
|
||||
{0xffb0, "0xffb0", 0,},
|
||||
{0xffb1, "0xffb1", 0,},
|
||||
{0xffb2, "0xffb2", 0,},
|
||||
{0xffb3, "0xffb3", 0,},
|
||||
{0xffb4, "0xffb4", 0,},
|
||||
{0xffb5, "0xffb5", 0,},
|
||||
{0xffb6, "0xffb6", 0,},
|
||||
{0xffb7, "0xffb7", 0,},
|
||||
{0xffb8, "0xffb8", 0,},
|
||||
{0xffb9, "0xffb9", 0,},
|
||||
{0xffba, "0xffba", 0,},
|
||||
{0xffbb, "0xffbb", 0,},
|
||||
{0xffbc, "0xffbc", 0,},
|
||||
{0xffbd, "0xffbd", 0,},
|
||||
{0xffbe, "0xffbe", 0,},
|
||||
{0xffbf, "0xffbf", 0,},
|
||||
{0xffb0, "0xffb0", nullptr,},
|
||||
{0xffb1, "0xffb1", nullptr,},
|
||||
{0xffb2, "0xffb2", nullptr,},
|
||||
{0xffb3, "0xffb3", nullptr,},
|
||||
{0xffb4, "0xffb4", nullptr,},
|
||||
{0xffb5, "0xffb5", nullptr,},
|
||||
{0xffb6, "0xffb6", nullptr,},
|
||||
{0xffb7, "0xffb7", nullptr,},
|
||||
{0xffb8, "0xffb8", nullptr,},
|
||||
{0xffb9, "0xffb9", nullptr,},
|
||||
{0xffba, "0xffba", nullptr,},
|
||||
{0xffbb, "0xffbb", nullptr,},
|
||||
{0xffbc, "0xffbc", nullptr,},
|
||||
{0xffbd, "0xffbd", nullptr,},
|
||||
{0xffbe, "0xffbe", nullptr,},
|
||||
{0xffbf, "0xffbf", nullptr,},
|
||||
|
||||
{0xffc0, "0xffc0", 0,},
|
||||
{0xffc1, "0xffc1", 0,},
|
||||
{0xffc2, "0xffc2", 0,},
|
||||
{0xffc3, "0xffc3", 0,},
|
||||
{0xffc4, "0xffc4", 0,},
|
||||
{0xffc5, "0xffc5", 0,},
|
||||
{0xffc6, "0xffc6", 0,},
|
||||
{0xffc7, "0xffc7", 0,},
|
||||
{0xffc8, "0xffc8", 0,},
|
||||
{0xffc0, "0xffc0", nullptr,},
|
||||
{0xffc1, "0xffc1", nullptr,},
|
||||
{0xffc2, "0xffc2", nullptr,},
|
||||
{0xffc3, "0xffc3", nullptr,},
|
||||
{0xffc4, "0xffc4", nullptr,},
|
||||
{0xffc5, "0xffc5", nullptr,},
|
||||
{0xffc6, "0xffc6", nullptr,},
|
||||
{0xffc7, "0xffc7", nullptr,},
|
||||
{0xffc8, "0xffc8", nullptr,},
|
||||
{0xffc9, "DSCR", "DSP DMA Control Reg",},
|
||||
{0xffca, "0xffca", 0,},
|
||||
{0xffca, "0xffca", nullptr,},
|
||||
{0xffcb, "DSBL", "DSP DMA Block Length",},
|
||||
{0xffcc, "0xffcc", 0,},
|
||||
{0xffcc, "0xffcc", nullptr,},
|
||||
{0xffcd, "DSPA", "DSP DMA DMEM Address",},
|
||||
{0xffce, "DSMAH", "DSP DMA Mem Address H",},
|
||||
{0xffcf, "DSMAL", "DSP DMA Mem Address L",},
|
||||
|
||||
{0xffd0, "0xffd0",0,},
|
||||
{0xffd0, "0xffd0",nullptr,},
|
||||
{0xffd1, "SampleFormat", "SampleFormat",},
|
||||
{0xffd2, "0xffd2",0,},
|
||||
{0xffd2, "0xffd2",nullptr,},
|
||||
{0xffd3, "UnkZelda", "Unk Zelda reads/writes from/to it",},
|
||||
{0xffd4, "ACSAH", "Accelerator start address H",},
|
||||
{0xffd5, "ACSAL", "Accelerator start address L",},
|
||||
|
@ -402,36 +402,36 @@ const pdlabel_t pdlabels[] =
|
|||
{0xffdc, "yn2", "yn2",},
|
||||
{0xffdd, "ARAM", "Direct Read from ARAM (uses ADPCM)",},
|
||||
{0xffde, "GAIN", "Gain",},
|
||||
{0xffdf, "0xffdf", 0,},
|
||||
{0xffdf, "0xffdf", nullptr,},
|
||||
|
||||
{0xffe0, "0xffe0",0,},
|
||||
{0xffe1, "0xffe1",0,},
|
||||
{0xffe2, "0xffe2",0,},
|
||||
{0xffe3, "0xffe3",0,},
|
||||
{0xffe4, "0xffe4",0,},
|
||||
{0xffe5, "0xffe5",0,},
|
||||
{0xffe6, "0xffe6",0,},
|
||||
{0xffe7, "0xffe7",0,},
|
||||
{0xffe8, "0xffe8",0,},
|
||||
{0xffe9, "0xffe9",0,},
|
||||
{0xffea, "0xffea",0,},
|
||||
{0xffeb, "0xffeb",0,},
|
||||
{0xffec, "0xffec",0,},
|
||||
{0xffed, "0xffed",0,},
|
||||
{0xffee, "0xffee",0,},
|
||||
{0xffe0, "0xffe0",nullptr,},
|
||||
{0xffe1, "0xffe1",nullptr,},
|
||||
{0xffe2, "0xffe2",nullptr,},
|
||||
{0xffe3, "0xffe3",nullptr,},
|
||||
{0xffe4, "0xffe4",nullptr,},
|
||||
{0xffe5, "0xffe5",nullptr,},
|
||||
{0xffe6, "0xffe6",nullptr,},
|
||||
{0xffe7, "0xffe7",nullptr,},
|
||||
{0xffe8, "0xffe8",nullptr,},
|
||||
{0xffe9, "0xffe9",nullptr,},
|
||||
{0xffea, "0xffea",nullptr,},
|
||||
{0xffeb, "0xffeb",nullptr,},
|
||||
{0xffec, "0xffec",nullptr,},
|
||||
{0xffed, "0xffed",nullptr,},
|
||||
{0xffee, "0xffee",nullptr,},
|
||||
{0xffef, "AMDM", "ARAM DMA Request Mask",},
|
||||
|
||||
{0xfff0, "0xfff0",0,},
|
||||
{0xfff1, "0xfff1",0,},
|
||||
{0xfff2, "0xfff2",0,},
|
||||
{0xfff3, "0xfff3",0,},
|
||||
{0xfff4, "0xfff4",0,},
|
||||
{0xfff5, "0xfff5",0,},
|
||||
{0xfff6, "0xfff6",0,},
|
||||
{0xfff7, "0xfff7",0,},
|
||||
{0xfff8, "0xfff8",0,},
|
||||
{0xfff9, "0xfff9",0,},
|
||||
{0xfffa, "0xfffa",0,},
|
||||
{0xfff0, "0xfff0",nullptr,},
|
||||
{0xfff1, "0xfff1",nullptr,},
|
||||
{0xfff2, "0xfff2",nullptr,},
|
||||
{0xfff3, "0xfff3",nullptr,},
|
||||
{0xfff4, "0xfff4",nullptr,},
|
||||
{0xfff5, "0xfff5",nullptr,},
|
||||
{0xfff6, "0xfff6",nullptr,},
|
||||
{0xfff7, "0xfff7",nullptr,},
|
||||
{0xfff8, "0xfff8",nullptr,},
|
||||
{0xfff9, "0xfff9",nullptr,},
|
||||
{0xfffa, "0xfffa",nullptr,},
|
||||
{0xfffb, "DIRQ", "DSP IRQ Request",},
|
||||
{0xfffc, "DMBH", "DSP Mailbox H",},
|
||||
{0xfffd, "DMBL", "DSP Mailbox L",},
|
||||
|
@ -492,7 +492,7 @@ const char* pdname(u16 val)
|
|||
{
|
||||
static char tmpstr[12]; // nasty
|
||||
|
||||
for (auto& pdlabel : pdlabels)
|
||||
for (const pdlabel_t& pdlabel : pdlabels)
|
||||
{
|
||||
if (pdlabel.addr == val)
|
||||
return pdlabel.name;
|
||||
|
@ -527,31 +527,37 @@ void InitInstructionTable()
|
|||
{
|
||||
extOpTable[i] = &cw;
|
||||
|
||||
for (auto& ext : opcodes_ext)
|
||||
for (const DSPOPCTemplate& ext : opcodes_ext)
|
||||
{
|
||||
u16 mask = ext.opcode_mask;
|
||||
if ((mask & i) == ext.opcode)
|
||||
{
|
||||
if (extOpTable[i] == &cw)
|
||||
{
|
||||
extOpTable[i] = &ext;
|
||||
}
|
||||
else
|
||||
{
|
||||
//if the entry already in the table
|
||||
//is a strict subset, allow it
|
||||
if ((extOpTable[i]->opcode_mask | ext.opcode_mask) != extOpTable[i]->opcode_mask)
|
||||
{
|
||||
ERROR_LOG(DSPLLE, "opcode ext table place %d already in use by %s when inserting %s", i, extOpTable[i]->name, ext.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// op table
|
||||
for (int i = 0; i < OPTABLE_SIZE; i++)
|
||||
opTable[i] = &cw;
|
||||
for (const DSPOPCTemplate*& opcode : opTable)
|
||||
{
|
||||
opcode = &cw;
|
||||
}
|
||||
|
||||
for (int i = 0; i < OPTABLE_SIZE; i++)
|
||||
{
|
||||
for (auto& opcode : opcodes)
|
||||
for (const DSPOPCTemplate& opcode : opcodes)
|
||||
{
|
||||
u16 mask = opcode.opcode_mask;
|
||||
if ((mask & i) == opcode.opcode)
|
||||
|
@ -564,6 +570,8 @@ void InitInstructionTable()
|
|||
}
|
||||
}
|
||||
|
||||
for (int i=0; i < WRITEBACKLOGSIZE; i++)
|
||||
writeBackLogIdx[i] = -1;
|
||||
for (int& elem : writeBackLogIdx)
|
||||
{
|
||||
elem = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ static void WriteBlockLink(DSPEmitter& emitter, u16 dest)
|
|||
// Jump directly to the called block if it has already been compiled.
|
||||
if (!(dest >= emitter.startAddr && dest <= emitter.compilePC))
|
||||
{
|
||||
if (emitter.blockLinks[dest] != 0 )
|
||||
if (emitter.blockLinks[dest] != nullptr )
|
||||
{
|
||||
emitter.gpr.flushRegs();
|
||||
// Check if we have enough cycles to execute the next block
|
||||
|
|
|
@ -71,7 +71,7 @@ static void *reg_ptr(int reg)
|
|||
#endif
|
||||
default:
|
||||
_assert_msg_(DSPLLE, 0, "cannot happen");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ static void *reg_ptr(int reg)
|
|||
DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
||||
: emitter(_emitter), temporary(false), merged(false)
|
||||
{
|
||||
for(auto& xreg : xregs)
|
||||
for (X64CachedReg& xreg : xregs)
|
||||
{
|
||||
xreg.guest_reg = DSP_REG_STATIC;
|
||||
xreg.pushed = false;
|
||||
|
@ -475,7 +475,7 @@ void DSPJitRegCache::pushRegs()
|
|||
}
|
||||
|
||||
int push_count = 0;
|
||||
for(auto& xreg : xregs)
|
||||
for (X64CachedReg& xreg : xregs)
|
||||
{
|
||||
if (xreg.guest_reg == DSP_REG_USED)
|
||||
push_count++;
|
||||
|
@ -533,7 +533,7 @@ void DSPJitRegCache::popRegs() {
|
|||
emitter.MOV(32, M(&ebp_store), R(EBP));
|
||||
#endif
|
||||
int push_count = 0;
|
||||
for(auto& xreg : xregs)
|
||||
for (X64CachedReg& xreg : xregs)
|
||||
{
|
||||
if (xreg.pushed)
|
||||
{
|
||||
|
@ -1062,9 +1062,8 @@ X64Reg DSPJitRegCache::spillXReg()
|
|||
{
|
||||
int max_use_ctr_diff = 0;
|
||||
X64Reg least_recent_use_reg = INVALID_REG;
|
||||
for(size_t i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||
for (X64Reg reg : alloc_order)
|
||||
{
|
||||
X64Reg reg = alloc_order[i];
|
||||
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
||||
!regs[xregs[reg].guest_reg].used)
|
||||
{
|
||||
|
@ -1084,9 +1083,8 @@ X64Reg DSPJitRegCache::spillXReg()
|
|||
}
|
||||
|
||||
//just choose one.
|
||||
for(size_t i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||
for (X64Reg reg : alloc_order)
|
||||
{
|
||||
X64Reg reg = alloc_order[i];
|
||||
if (xregs[reg].guest_reg <= DSP_REG_MAX_MEM_BACKED &&
|
||||
!regs[xregs[reg].guest_reg].used)
|
||||
{
|
||||
|
@ -1118,7 +1116,7 @@ void DSPJitRegCache::spillXReg(X64Reg reg)
|
|||
|
||||
X64Reg DSPJitRegCache::findFreeXReg()
|
||||
{
|
||||
for(auto& x : alloc_order)
|
||||
for (X64Reg x : alloc_order)
|
||||
{
|
||||
if (xregs[x].guest_reg == DSP_REG_NONE)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ void DSPEmitter::dsp_reg_stack_push(int stack_reg)
|
|||
MOVZX(32, 8, EAX, R(AL));
|
||||
#endif
|
||||
MOV(16, MComplex(EAX, EAX, 1,
|
||||
PtrOffset(&g_dsp.reg_stack[stack_reg][0],0)), R(tmp1));
|
||||
PtrOffset(&g_dsp.reg_stack[stack_reg][0],nullptr)), R(tmp1));
|
||||
gpr.putXReg(tmp1);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ void DSPEmitter::dsp_reg_stack_pop(int stack_reg)
|
|||
MOVZX(32, 8, EAX, R(AL));
|
||||
#endif
|
||||
MOV(16, R(tmp1), MComplex(EAX, EAX, 1,
|
||||
PtrOffset(&g_dsp.reg_stack[stack_reg][0],0)));
|
||||
PtrOffset(&g_dsp.reg_stack[stack_reg][0],nullptr)));
|
||||
MOV(16, M(&g_dsp.r.st[stack_reg]), R(tmp1));
|
||||
gpr.putXReg(tmp1);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "Core/Debugger/Dump.h"
|
||||
|
||||
CDump::CDump(const char* _szFilename) :
|
||||
m_pData(NULL)
|
||||
m_pData(nullptr)
|
||||
{
|
||||
File::IOFile pStream(_szFilename, "rb");
|
||||
if (pStream)
|
||||
|
@ -25,10 +25,10 @@ CDump::CDump(const char* _szFilename) :
|
|||
|
||||
CDump::~CDump(void)
|
||||
{
|
||||
if (m_pData != NULL)
|
||||
if (m_pData != nullptr)
|
||||
{
|
||||
delete[] m_pData;
|
||||
m_pData = NULL;
|
||||
m_pData = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,32 +14,32 @@ class PPCDebugInterface : public DebugInterface
|
|||
{
|
||||
public:
|
||||
PPCDebugInterface(){}
|
||||
virtual void Disassemble(unsigned int address, char *dest, int max_size) final;
|
||||
virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final;
|
||||
virtual int GetInstructionSize(int /*instruction*/) final {return 4;}
|
||||
virtual bool IsAlive() final;
|
||||
virtual bool IsBreakpoint(unsigned int address) final;
|
||||
virtual void SetBreakpoint(unsigned int address) final;
|
||||
virtual void ClearBreakpoint(unsigned int address) final;
|
||||
virtual void ClearAllBreakpoints() final;
|
||||
virtual void ToggleBreakpoint(unsigned int address) final;
|
||||
virtual void ClearAllMemChecks() final;
|
||||
virtual bool IsMemCheck(unsigned int address) final;
|
||||
virtual void ToggleMemCheck(unsigned int address) final;
|
||||
virtual unsigned int ReadMemory(unsigned int address) final;
|
||||
virtual void Disassemble(unsigned int address, char *dest, int max_size) final override;
|
||||
virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final override;
|
||||
virtual int GetInstructionSize(int /*instruction*/) final override {return 4;}
|
||||
virtual bool IsAlive() final override;
|
||||
virtual bool IsBreakpoint(unsigned int address) final override;
|
||||
virtual void SetBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearAllBreakpoints() final override;
|
||||
virtual void ToggleBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearAllMemChecks() final override;
|
||||
virtual bool IsMemCheck(unsigned int address) final override;
|
||||
virtual void ToggleMemCheck(unsigned int address) final override;
|
||||
virtual unsigned int ReadMemory(unsigned int address) final override;
|
||||
|
||||
enum {
|
||||
EXTRAMEM_ARAM = 1,
|
||||
};
|
||||
virtual unsigned int ReadExtraMemory(int memory, unsigned int address) final;
|
||||
virtual unsigned int ReadInstruction(unsigned int address) final;
|
||||
virtual unsigned int GetPC() final;
|
||||
virtual void SetPC(unsigned int address) final;
|
||||
virtual void Step() final {}
|
||||
virtual void BreakNow() final;
|
||||
virtual void RunToBreakpoint() final;
|
||||
virtual void InsertBLR(unsigned int address, unsigned int value) final;
|
||||
virtual int GetColor(unsigned int address) final;
|
||||
virtual std::string GetDescription(unsigned int address) final;
|
||||
virtual void ShowJitResults(u32 address) final;
|
||||
virtual unsigned int ReadExtraMemory(int memory, unsigned int address) final override;
|
||||
virtual unsigned int ReadInstruction(unsigned int address) final override;
|
||||
virtual unsigned int GetPC() final override;
|
||||
virtual void SetPC(unsigned int address) final override;
|
||||
virtual void Step() final override {}
|
||||
virtual void BreakNow() final override;
|
||||
virtual void RunToBreakpoint() final override;
|
||||
virtual void InsertBLR(unsigned int address, unsigned int value) final override;
|
||||
virtual int GetColor(unsigned int address) final override;
|
||||
virtual std::string GetDescription(unsigned int address) final override;
|
||||
virtual void ShowJitResults(u32 address) final override;
|
||||
};
|
||||
|
|
|
@ -52,8 +52,7 @@ bool FifoDataFile::Save(const char *filename)
|
|||
|
||||
// Add space for frame list
|
||||
u64 frameListOffset = file.Tell();
|
||||
for (size_t i = 0; i < m_Frames.size(); i++)
|
||||
PadFile(sizeof(FileFrameInfo), file);
|
||||
PadFile(m_Frames.size() * sizeof(FileFrameInfo), file);
|
||||
|
||||
u64 bpMemOffset = file.Tell();
|
||||
file.WriteArray(m_BPMem, BP_MEM_SIZE);
|
||||
|
@ -130,7 +129,7 @@ FifoDataFile *FifoDataFile::Load(const std::string &filename, bool flagsOnly)
|
|||
File::IOFile file;
|
||||
file.Open(filename, "rb");
|
||||
if (!file)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
FileHeader header;
|
||||
file.ReadBytes(&header, sizeof(header));
|
||||
|
@ -138,7 +137,7 @@ FifoDataFile *FifoDataFile::Load(const std::string &filename, bool flagsOnly)
|
|||
if (header.fileId != FILE_ID || header.min_loader_version > VERSION_NUMBER)
|
||||
{
|
||||
file.Close();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FifoDataFile* dataFile = new FifoDataFile;
|
||||
|
@ -196,10 +195,8 @@ FifoDataFile *FifoDataFile::Load(const std::string &filename, bool flagsOnly)
|
|||
|
||||
void FifoDataFile::PadFile(u32 numBytes, File::IOFile& file)
|
||||
{
|
||||
FILE *handle = file.GetHandle();
|
||||
|
||||
for (u32 i = 0; i < numBytes; ++i)
|
||||
fputc(0, handle);
|
||||
const u8 zero = 0;
|
||||
fwrite(&zero, sizeof(zero), numBytes, file.GetHandle());
|
||||
}
|
||||
|
||||
void FifoDataFile::SetFlag(u32 flag, bool set)
|
||||
|
@ -219,8 +216,7 @@ u64 FifoDataFile::WriteMemoryUpdates(const std::vector<MemoryUpdate> &memUpdates
|
|||
{
|
||||
// Add space for memory update list
|
||||
u64 updateListOffset = file.Tell();
|
||||
for (size_t i = 0; i < memUpdates.size(); i++)
|
||||
PadFile(sizeof(FileMemoryUpdate), file);
|
||||
PadFile(memUpdates.size() * sizeof(FileMemoryUpdate), file);
|
||||
|
||||
for (unsigned int i = 0; i < memUpdates.size(); ++i)
|
||||
{
|
||||
|
|
|
@ -39,13 +39,13 @@ bool FifoPlayer::Open(const std::string& filename)
|
|||
if (m_FileLoadedCb)
|
||||
m_FileLoadedCb();
|
||||
|
||||
return (m_File != NULL);
|
||||
return (m_File != nullptr);
|
||||
}
|
||||
|
||||
void FifoPlayer::Close()
|
||||
{
|
||||
delete m_File;
|
||||
m_File = NULL;
|
||||
m_File = nullptr;
|
||||
|
||||
m_FrameRangeStart = 0;
|
||||
m_FrameRangeEnd = 0;
|
||||
|
@ -158,9 +158,9 @@ FifoPlayer::FifoPlayer() :
|
|||
m_ObjectRangeStart(0),
|
||||
m_ObjectRangeEnd(10000),
|
||||
m_EarlyMemoryUpdates(false),
|
||||
m_FileLoadedCb(NULL),
|
||||
m_FrameWrittenCb(NULL),
|
||||
m_File(NULL)
|
||||
m_FileLoadedCb(nullptr),
|
||||
m_FrameWrittenCb(nullptr),
|
||||
m_File(nullptr)
|
||||
{
|
||||
m_Loop = SConfig::GetInstance().m_LocalCoreStartupParameter.bLoopFifoReplay;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ void FifoPlayer::WriteAllMemoryUpdates()
|
|||
|
||||
void FifoPlayer::WriteMemory(const MemoryUpdate& memUpdate)
|
||||
{
|
||||
u8 *mem = NULL;
|
||||
u8 *mem = nullptr;
|
||||
|
||||
if (memUpdate.address & 0x10000000)
|
||||
mem = &Memory::m_pEXRAM[memUpdate.address & Memory::EXRAM_MASK];
|
||||
|
|
|
@ -16,7 +16,7 @@ using namespace FifoAnalyzer;
|
|||
|
||||
FifoRecordAnalyzer::FifoRecordAnalyzer() :
|
||||
m_DrawingObject(false),
|
||||
m_BpMem(NULL)
|
||||
m_BpMem(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ FifoRecorder::FifoRecorder() :
|
|||
m_WasRecording(false),
|
||||
m_RequestedRecordingEnd(false),
|
||||
m_RecordFramesRemaining(0),
|
||||
m_FinishedCb(NULL),
|
||||
m_File(NULL),
|
||||
m_FinishedCb(nullptr),
|
||||
m_File(nullptr),
|
||||
m_SkipNextData(true),
|
||||
m_SkipFutureData(true),
|
||||
m_FrameEnded(false),
|
||||
m_Ram(NULL),
|
||||
m_ExRam(NULL)
|
||||
m_Ram(nullptr),
|
||||
m_ExRam(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void PatchFunctions()
|
|||
for (u32 i = 0; i < sizeof(OSPatches) / sizeof(SPatch); i++)
|
||||
{
|
||||
Symbol *symbol = g_symbolDB.GetSymbolFromName(OSPatches[i].m_szPatchName);
|
||||
if (symbol > 0)
|
||||
if (symbol)
|
||||
{
|
||||
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ void PatchFunctions()
|
|||
for (size_t i = 1; i < sizeof(OSBreakPoints) / sizeof(SPatch); i++)
|
||||
{
|
||||
Symbol *symbol = g_symbolDB.GetSymbolFromName(OSPatches[i].m_szPatchName);
|
||||
if (symbol > 0)
|
||||
if (symbol)
|
||||
{
|
||||
PowerPC::breakpoints.Add(symbol->address, false);
|
||||
INFO_LOG(OSHLE, "Adding BP to %s %08x", OSBreakPoints[i].m_szPatchName, symbol->address);
|
||||
|
@ -159,7 +159,7 @@ bool IsEnabled(int flags)
|
|||
u32 UnPatch(std::string patchName)
|
||||
{
|
||||
Symbol *symbol = g_symbolDB.GetSymbolFromName(patchName.c_str());
|
||||
if (symbol > 0)
|
||||
if (symbol)
|
||||
{
|
||||
for (u32 addr = symbol->address; addr < symbol->address + symbol->size; addr += 4)
|
||||
{
|
||||
|
|
|
@ -120,7 +120,7 @@ void ReadThreadHandler(CEXIETHERNET* self)
|
|||
struct timeval timeout;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 50000;
|
||||
if (select(self->fd + 1, &rfds, NULL, NULL, &timeout) <= 0)
|
||||
if (select(self->fd + 1, &rfds, nullptr, nullptr, &timeout) <= 0)
|
||||
continue;
|
||||
|
||||
int readBytes = read(self->fd, self->mRecvBuffer, BBA_RECV_SIZE);
|
||||
|
|
|
@ -35,7 +35,7 @@ bool IsTAPDevice(const TCHAR *guid)
|
|||
DWORD data_type;
|
||||
|
||||
len = sizeof(enum_name);
|
||||
status = RegEnumKeyEx(netcard_key, i, enum_name, &len, NULL, NULL, NULL, NULL);
|
||||
status = RegEnumKeyEx(netcard_key, i, enum_name, &len, nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
if (status == ERROR_NO_MORE_ITEMS)
|
||||
break;
|
||||
|
@ -53,13 +53,13 @@ bool IsTAPDevice(const TCHAR *guid)
|
|||
else
|
||||
{
|
||||
len = sizeof(component_id);
|
||||
status = RegQueryValueEx(unit_key, component_id_string, NULL,
|
||||
status = RegQueryValueEx(unit_key, component_id_string, nullptr,
|
||||
&data_type, (LPBYTE)component_id, &len);
|
||||
|
||||
if (!(status != ERROR_SUCCESS || data_type != REG_SZ))
|
||||
{
|
||||
len = sizeof(net_cfg_instance_id);
|
||||
status = RegQueryValueEx(unit_key, net_cfg_instance_id_string, NULL,
|
||||
status = RegQueryValueEx(unit_key, net_cfg_instance_id_string, nullptr,
|
||||
&data_type, (LPBYTE)net_cfg_instance_id, &len);
|
||||
|
||||
if (status == ERROR_SUCCESS && data_type == REG_SZ)
|
||||
|
@ -106,7 +106,7 @@ bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids)
|
|||
|
||||
len = sizeof(enum_name);
|
||||
status = RegEnumKeyEx(control_net_key, i, enum_name,
|
||||
&len, NULL, NULL, NULL, NULL);
|
||||
&len, nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
if (status == ERROR_NO_MORE_ITEMS)
|
||||
break;
|
||||
|
@ -122,7 +122,7 @@ bool GetGUIDs(std::vector<std::basic_string<TCHAR>>& guids)
|
|||
if (status == ERROR_SUCCESS)
|
||||
{
|
||||
len = sizeof(name_data);
|
||||
status = RegQueryValueEx(connection_key, name_string, NULL,
|
||||
status = RegQueryValueEx(connection_key, name_string, nullptr,
|
||||
&name_type, (LPBYTE)name_data, &len);
|
||||
|
||||
if (status != ERROR_SUCCESS || name_type != REG_SZ)
|
||||
|
@ -199,7 +199,7 @@ bool CEXIETHERNET::Activate()
|
|||
/* get driver version info */
|
||||
ULONG info[3];
|
||||
if (DeviceIoControl(mHAdapter, TAP_IOCTL_GET_VERSION,
|
||||
&info, sizeof(info), &info, sizeof(info), &len, NULL))
|
||||
&info, sizeof(info), &info, sizeof(info), &len, nullptr))
|
||||
{
|
||||
INFO_LOG(SP1, "TAP-Win32 Driver Version %d.%d %s",
|
||||
info[0], info[1], info[2] ? "(DEBUG)" : "");
|
||||
|
@ -217,7 +217,7 @@ bool CEXIETHERNET::Activate()
|
|||
/* set driver media status to 'connected' */
|
||||
ULONG status = TRUE;
|
||||
if (!DeviceIoControl(mHAdapter, TAP_IOCTL_SET_MEDIA_STATUS,
|
||||
&status, sizeof(status), &status, sizeof(status), &len, NULL))
|
||||
&status, sizeof(status), &status, sizeof(status), &len, nullptr))
|
||||
{
|
||||
ERROR_LOG(SP1, "WARNING: The TAP-Win32 driver rejected a"
|
||||
"TAP_IOCTL_SET_MEDIA_STATUS DeviceIoControl call.");
|
||||
|
@ -283,7 +283,7 @@ bool CEXIETHERNET::RecvInit()
|
|||
{
|
||||
// Set up recv event
|
||||
|
||||
if ((mHRecvEvent = CreateEvent(NULL, false, false, NULL)) == NULL)
|
||||
if ((mHRecvEvent = CreateEvent(nullptr, false, false, nullptr)) == nullptr)
|
||||
{
|
||||
ERROR_LOG(SP1, "Failed to create recv event:%x", GetLastError());
|
||||
return false;
|
||||
|
|
|
@ -18,20 +18,20 @@
|
|||
namespace
|
||||
{
|
||||
static Common::Event m_StepEvent;
|
||||
static Common::Event *m_SyncEvent = NULL;
|
||||
static Common::Event *m_SyncEvent = nullptr;
|
||||
static std::mutex m_csCpuOccupied;
|
||||
}
|
||||
|
||||
void CCPU::Init(int cpu_core)
|
||||
{
|
||||
PowerPC::Init(cpu_core);
|
||||
m_SyncEvent = NULL;
|
||||
m_SyncEvent = nullptr;
|
||||
}
|
||||
|
||||
void CCPU::Shutdown()
|
||||
{
|
||||
PowerPC::Shutdown();
|
||||
m_SyncEvent = NULL;
|
||||
m_SyncEvent = nullptr;
|
||||
}
|
||||
|
||||
void CCPU::Run()
|
||||
|
@ -68,7 +68,7 @@ reswitch:
|
|||
if (m_SyncEvent)
|
||||
{
|
||||
m_SyncEvent->Set();
|
||||
m_SyncEvent = NULL;
|
||||
m_SyncEvent = nullptr;
|
||||
}
|
||||
Host_UpdateDisasmDialog();
|
||||
break;
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
static void Reset();
|
||||
|
||||
// StepOpcode (Steps one Opcode)
|
||||
static void StepOpcode(Common::Event *event = 0);
|
||||
static void StepOpcode(Common::Event *event = nullptr);
|
||||
|
||||
// one step only
|
||||
static void SingleStep();
|
||||
|
|
|
@ -174,7 +174,7 @@ struct ARAMInfo
|
|||
wii_mode = false;
|
||||
size = ARAM_SIZE;
|
||||
mask = ARAM_MASK;
|
||||
ptr = NULL;
|
||||
ptr = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -282,12 +282,12 @@ void Shutdown()
|
|||
if (!g_ARAM.wii_mode)
|
||||
{
|
||||
FreeMemoryPages(g_ARAM.ptr, g_ARAM.size);
|
||||
g_ARAM.ptr = NULL;
|
||||
g_ARAM.ptr = nullptr;
|
||||
}
|
||||
|
||||
dsp_emulator->Shutdown();
|
||||
delete dsp_emulator;
|
||||
dsp_emulator = NULL;
|
||||
dsp_emulator = nullptr;
|
||||
}
|
||||
|
||||
void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
DSPHLE::DSPHLE()
|
||||
{
|
||||
m_InitMixer = false;
|
||||
soundStream = NULL;
|
||||
soundStream = nullptr;
|
||||
}
|
||||
|
||||
// Mailbox utility
|
||||
|
@ -46,8 +46,8 @@ bool DSPHLE::Initialize(void *hWnd, bool bWii, bool bDSPThread)
|
|||
{
|
||||
m_hWnd = hWnd;
|
||||
m_bWii = bWii;
|
||||
m_pUCode = NULL;
|
||||
m_lastUCode = NULL;
|
||||
m_pUCode = nullptr;
|
||||
m_lastUCode = nullptr;
|
||||
m_bHalt = false;
|
||||
m_bAssertInt = false;
|
||||
|
||||
|
@ -74,7 +74,7 @@ void DSPHLE::DSP_Update(int cycles)
|
|||
{
|
||||
// This is called OFTEN - better not do anything expensive!
|
||||
// ~1/6th as many cycles as the period PPC-side.
|
||||
if (m_pUCode != NULL)
|
||||
if (m_pUCode != nullptr)
|
||||
m_pUCode->Update(cycles / 6);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ u32 DSPHLE::DSP_UpdateRate()
|
|||
{
|
||||
// AX HLE uses 3ms (Wii) or 5ms (GC) timing period
|
||||
int fields = VideoInterface::GetNumFields();
|
||||
if (m_pUCode != NULL)
|
||||
if (m_pUCode != nullptr)
|
||||
return (SystemTimers::GetTicksPerSecond() / 1000) * m_pUCode->GetUpdateMs() / fields;
|
||||
else
|
||||
return SystemTimers::GetTicksPerSecond() / 1000;
|
||||
|
@ -90,7 +90,7 @@ u32 DSPHLE::DSP_UpdateRate()
|
|||
|
||||
void DSPHLE::SendMailToDSP(u32 _uMail)
|
||||
{
|
||||
if (m_pUCode != NULL) {
|
||||
if (m_pUCode != nullptr) {
|
||||
DEBUG_LOG(DSP_MAIL, "CPU writes 0x%08x", _uMail);
|
||||
m_pUCode->HandleMail(_uMail);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ void DSPHLE::SetUCode(u32 _crc)
|
|||
{
|
||||
delete m_pUCode;
|
||||
|
||||
m_pUCode = NULL;
|
||||
m_pUCode = nullptr;
|
||||
m_MailHandler.Clear();
|
||||
m_pUCode = UCodeFactory(_crc, this, m_bWii);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ void DSPHLE::SwapUCode(u32 _crc)
|
|||
{
|
||||
m_MailHandler.Clear();
|
||||
|
||||
if (m_lastUCode == NULL)
|
||||
if (m_lastUCode == nullptr)
|
||||
{
|
||||
m_lastUCode = m_pUCode;
|
||||
m_pUCode = UCodeFactory(_crc, this, m_bWii);
|
||||
|
@ -126,7 +126,7 @@ void DSPHLE::SwapUCode(u32 _crc)
|
|||
{
|
||||
delete m_pUCode;
|
||||
m_pUCode = m_lastUCode;
|
||||
m_lastUCode = NULL;
|
||||
m_lastUCode = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ void DSPHLE::DoState(PointerWrap &p)
|
|||
AudioCommon::PauseAndLock(false);
|
||||
soundStream->Stop();
|
||||
delete soundStream;
|
||||
soundStream = NULL;
|
||||
soundStream = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ void CUCode_AX::ProcessPBList(u32 pb_addr)
|
|||
ApplyUpdatesForMs(curr_ms, (u16*)&pb, pb.updates.num_updates, updates);
|
||||
|
||||
ProcessVoice(pb, buffers, spms, ConvertMixerControl(pb.mixer_control),
|
||||
m_coeffs_available ? m_coeffs : NULL);
|
||||
m_coeffs_available ? m_coeffs : nullptr);
|
||||
|
||||
// Forward the buffers
|
||||
for (u32 i = 0; i < sizeof (buffers.ptrs) / sizeof (buffers.ptrs[0]); ++i)
|
||||
|
@ -482,7 +482,7 @@ void CUCode_AX::ProcessPBList(u32 pb_addr)
|
|||
|
||||
void CUCode_AX::MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr)
|
||||
{
|
||||
int* buffers[3] = { 0 };
|
||||
int* buffers[3] = { nullptr };
|
||||
|
||||
switch (aux_id)
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@ CUCode_AXWii::CUCode_AXWii(DSPHLE *dsp_hle, u32 l_CRC)
|
|||
: CUCode_AX(dsp_hle, l_CRC),
|
||||
m_last_main_volume(0x8000)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
m_last_aux_volumes[i] = 0x8000;
|
||||
for (u16& volume : m_last_aux_volumes)
|
||||
volume = 0x8000;
|
||||
|
||||
WARN_LOG(DSPHLE, "Instantiating CUCode_AXWii");
|
||||
|
||||
|
@ -467,7 +467,7 @@ void CUCode_AXWii::ProcessPBList(u32 pb_addr)
|
|||
ApplyUpdatesForMs(curr_ms, (u16*)&pb, num_updates, updates);
|
||||
ProcessVoice(pb, buffers, 32,
|
||||
ConvertMixerControl(HILO_TO_32(pb.mixer_control)),
|
||||
m_coeffs_available ? m_coeffs : NULL);
|
||||
m_coeffs_available ? m_coeffs : nullptr);
|
||||
|
||||
// Forward the buffers
|
||||
for (u32 i = 0; i < sizeof (buffers.ptrs) / sizeof (buffers.ptrs[0]); ++i)
|
||||
|
@ -479,7 +479,7 @@ void CUCode_AXWii::ProcessPBList(u32 pb_addr)
|
|||
{
|
||||
ProcessVoice(pb, buffers, 96,
|
||||
ConvertMixerControl(HILO_TO_32(pb.mixer_control)),
|
||||
m_coeffs_available ? m_coeffs : NULL);
|
||||
m_coeffs_available ? m_coeffs : nullptr);
|
||||
}
|
||||
|
||||
WritePB(pb_addr, pb);
|
||||
|
@ -493,7 +493,7 @@ void CUCode_AXWii::MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr, u16
|
|||
GenerateVolumeRamp(volume_ramp, m_last_aux_volumes[aux_id], volume, 96);
|
||||
m_last_aux_volumes[aux_id] = volume;
|
||||
|
||||
int* buffers[3] = { 0 };
|
||||
int* buffers[3] = { nullptr };
|
||||
int* main_buffers[3] = {
|
||||
m_samples_left,
|
||||
m_samples_right,
|
||||
|
|
|
@ -99,7 +99,7 @@ IUCode* UCodeFactory(u32 _CRC, DSPHLE *dsp_hle, bool bWii)
|
|||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool IUCode::NeedsResumeMail()
|
||||
|
|
|
@ -14,25 +14,25 @@ class DSPDebugInterface : public DebugInterface
|
|||
{
|
||||
public:
|
||||
DSPDebugInterface(){}
|
||||
virtual void Disassemble(unsigned int address, char *dest, int max_size) final;
|
||||
virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final;
|
||||
virtual int GetInstructionSize(int instruction) final {return 1;}
|
||||
virtual bool IsAlive() final;
|
||||
virtual bool IsBreakpoint(unsigned int address) final;
|
||||
virtual void SetBreakpoint(unsigned int address) final;
|
||||
virtual void ClearBreakpoint(unsigned int address) final;
|
||||
virtual void ClearAllBreakpoints() final;
|
||||
virtual void ToggleBreakpoint(unsigned int address) final;
|
||||
virtual void ClearAllMemChecks() final;
|
||||
virtual bool IsMemCheck(unsigned int address) final;
|
||||
virtual void ToggleMemCheck(unsigned int address) final;
|
||||
virtual unsigned int ReadMemory(unsigned int address) final;
|
||||
virtual unsigned int ReadInstruction(unsigned int address) final;
|
||||
virtual unsigned int GetPC() final;
|
||||
virtual void SetPC(unsigned int address) final;
|
||||
virtual void Step() final {}
|
||||
virtual void RunToBreakpoint() final;
|
||||
virtual void InsertBLR(unsigned int address, unsigned int value) final;
|
||||
virtual int GetColor(unsigned int address) final;
|
||||
virtual std::string GetDescription(unsigned int address) final;
|
||||
virtual void Disassemble(unsigned int address, char *dest, int max_size) final override;
|
||||
virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final override;
|
||||
virtual int GetInstructionSize(int instruction) final override {return 1;}
|
||||
virtual bool IsAlive() final override;
|
||||
virtual bool IsBreakpoint(unsigned int address) final override;
|
||||
virtual void SetBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearAllBreakpoints() final override;
|
||||
virtual void ToggleBreakpoint(unsigned int address) final override;
|
||||
virtual void ClearAllMemChecks() final override;
|
||||
virtual bool IsMemCheck(unsigned int address) final override;
|
||||
virtual void ToggleMemCheck(unsigned int address) final override;
|
||||
virtual unsigned int ReadMemory(unsigned int address) final override;
|
||||
virtual unsigned int ReadInstruction(unsigned int address) final override;
|
||||
virtual unsigned int GetPC() final override;
|
||||
virtual void SetPC(unsigned int address) final override;
|
||||
virtual void Step() final override {}
|
||||
virtual void RunToBreakpoint() final override;
|
||||
virtual void InsertBLR(unsigned int address, unsigned int value) final override;
|
||||
virtual int GetColor(unsigned int address) final override;
|
||||
virtual std::string GetDescription(unsigned int address) final override;
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
DSPLLE::DSPLLE()
|
||||
{
|
||||
soundStream = NULL;
|
||||
soundStream = nullptr;
|
||||
m_InitMixer = false;
|
||||
m_bIsRunning = false;
|
||||
m_cycle_count = 0;
|
||||
|
@ -95,7 +95,7 @@ void DSPLLE::DoState(PointerWrap &p)
|
|||
AudioCommon::PauseAndLock(false);
|
||||
soundStream->Stop();
|
||||
delete soundStream;
|
||||
soundStream = NULL;
|
||||
soundStream = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,24 +15,24 @@ class DSPLLE : public DSPEmulator
|
|||
public:
|
||||
DSPLLE();
|
||||
|
||||
virtual bool Initialize(void *hWnd, bool bWii, bool bDSPThread);
|
||||
virtual void Shutdown();
|
||||
virtual bool IsLLE() { return true; }
|
||||
virtual bool Initialize(void *hWnd, bool bWii, bool bDSPThread) override;
|
||||
virtual void Shutdown() override;
|
||||
virtual bool IsLLE() override { return true; }
|
||||
|
||||
virtual void DoState(PointerWrap &p);
|
||||
virtual void PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
||||
virtual void DoState(PointerWrap &p) override;
|
||||
virtual void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) override;
|
||||
|
||||
virtual void DSP_WriteMailBoxHigh(bool _CPUMailbox, unsigned short);
|
||||
virtual void DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short);
|
||||
virtual unsigned short DSP_ReadMailBoxHigh(bool _CPUMailbox);
|
||||
virtual unsigned short DSP_ReadMailBoxLow(bool _CPUMailbox);
|
||||
virtual unsigned short DSP_ReadControlRegister();
|
||||
virtual unsigned short DSP_WriteControlRegister(unsigned short);
|
||||
virtual void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples);
|
||||
virtual void DSP_Update(int cycles);
|
||||
virtual void DSP_StopSoundStream();
|
||||
virtual void DSP_ClearAudioBuffer(bool mute);
|
||||
virtual u32 DSP_UpdateRate();
|
||||
virtual void DSP_WriteMailBoxHigh(bool _CPUMailbox, unsigned short) override;
|
||||
virtual void DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short) override;
|
||||
virtual unsigned short DSP_ReadMailBoxHigh(bool _CPUMailbox) override;
|
||||
virtual unsigned short DSP_ReadMailBoxLow(bool _CPUMailbox) override;
|
||||
virtual unsigned short DSP_ReadControlRegister() override;
|
||||
virtual unsigned short DSP_WriteControlRegister(unsigned short) override;
|
||||
virtual void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples) override;
|
||||
virtual void DSP_Update(int cycles) override;
|
||||
virtual void DSP_StopSoundStream() override;
|
||||
virtual void DSP_ClearAudioBuffer(bool mute) override;
|
||||
virtual u32 DSP_UpdateRate() override;
|
||||
|
||||
private:
|
||||
static void dsp_thread(DSPLLE* lpParameter);
|
||||
|
|
|
@ -70,7 +70,7 @@ Symbol *DSPSymbolDB::GetSymbolFromAddr(u32 addr)
|
|||
return &func.second;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// lower case only
|
||||
|
|
|
@ -47,7 +47,7 @@ void Shutdown()
|
|||
for (auto& channel : g_Channels)
|
||||
{
|
||||
delete channel;
|
||||
channel = NULL;
|
||||
channel = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex)
|
|||
if (device)
|
||||
return device;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Unused (?!)
|
||||
|
|
|
@ -87,7 +87,7 @@ void CEXIChannel::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
|||
|
||||
IEXIDevice* pDevice = GetDevice(m_Status.CHIP_SELECT ^ newStatus.CHIP_SELECT);
|
||||
m_Status.CHIP_SELECT = newStatus.CHIP_SELECT;
|
||||
if (pDevice != NULL)
|
||||
if (pDevice != nullptr)
|
||||
pDevice->SetCS(m_Status.CHIP_SELECT);
|
||||
|
||||
CoreTiming::ScheduleEvent_Threadsafe_Immediate(updateInterrupts, 0);
|
||||
|
@ -110,7 +110,7 @@ void CEXIChannel::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
|||
if (m_Control.TSTART)
|
||||
{
|
||||
IEXIDevice* pDevice = GetDevice(m_Status.CHIP_SELECT);
|
||||
if (pDevice == NULL)
|
||||
if (pDevice == nullptr)
|
||||
return;
|
||||
|
||||
if (m_Control.DMA == 0)
|
||||
|
@ -216,7 +216,7 @@ IEXIDevice* CEXIChannel::GetDevice(const u8 chip_select)
|
|||
case 2: return m_pDevices[1].get();
|
||||
case 4: return m_pDevices[2].get();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CEXIChannel::Update()
|
||||
|
@ -273,5 +273,5 @@ IEXIDevice* CEXIChannel::FindDevice(TEXIDevices device_type, int customIndex)
|
|||
if (device)
|
||||
return device;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
// F A C T O R Y
|
||||
IEXIDevice* EXIDevice_Create(TEXIDevices device_type, const int channel_num)
|
||||
{
|
||||
IEXIDevice* result = NULL;
|
||||
IEXIDevice* result = nullptr;
|
||||
|
||||
switch (device_type)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ IEXIDevice* EXIDevice_Create(TEXIDevices device_type, const int channel_num)
|
|||
break;
|
||||
}
|
||||
|
||||
if (result != NULL)
|
||||
if (result != nullptr)
|
||||
result->m_deviceType = device_type;
|
||||
|
||||
return result;
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
virtual void SetCS(int) {}
|
||||
virtual void DoState(PointerWrap&) {}
|
||||
virtual void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) {}
|
||||
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex=-1) { return (device_type == m_deviceType) ? this : NULL; }
|
||||
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex=-1) { return (device_type == m_deviceType) ? this : nullptr; }
|
||||
|
||||
// Update
|
||||
virtual void Update() {}
|
||||
|
|
|
@ -130,7 +130,7 @@ CEXIIPL::~CEXIIPL()
|
|||
}
|
||||
|
||||
FreeMemoryPages(m_pIPL, ROM_SIZE);
|
||||
m_pIPL = NULL;
|
||||
m_pIPL = nullptr;
|
||||
|
||||
// SRAM
|
||||
File::IOFile file(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM, "wb");
|
||||
|
|
|
@ -13,9 +13,9 @@ public:
|
|||
CEXIIPL();
|
||||
virtual ~CEXIIPL();
|
||||
|
||||
virtual void SetCS(int _iCS);
|
||||
bool IsPresent();
|
||||
void DoState(PointerWrap &p);
|
||||
virtual void SetCS(int _iCS) override;
|
||||
bool IsPresent() override;
|
||||
void DoState(PointerWrap &p) override;
|
||||
|
||||
static u32 GetGCTime();
|
||||
static u32 NetPlay_GetGCTime();
|
||||
|
@ -62,7 +62,7 @@ private:
|
|||
int m_count;
|
||||
bool m_FontsLoaded;
|
||||
|
||||
virtual void TransferByte(u8 &_uByte);
|
||||
virtual void TransferByte(u8 &_uByte) override;
|
||||
bool IsWriteCommand() const { return !!(m_uAddress & (1 << 31)); }
|
||||
u32 CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; }
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ void innerFlush(FlushData* data)
|
|||
if (!pFile)
|
||||
{
|
||||
std::string dir;
|
||||
SplitPath(data->filename, &dir, 0, 0);
|
||||
SplitPath(data->filename, &dir, nullptr, nullptr);
|
||||
if (!File::IsDirectory(dir))
|
||||
File::CreateFullPath(dir);
|
||||
pFile.Open(data->filename, "wb");
|
||||
|
@ -166,7 +166,7 @@ CEXIMemoryCard::~CEXIMemoryCard()
|
|||
CoreTiming::RemoveEvent(et_this_card);
|
||||
Flush(true);
|
||||
delete[] memory_card_content;
|
||||
memory_card_content = NULL;
|
||||
memory_card_content = nullptr;
|
||||
|
||||
if (flushThread.joinable())
|
||||
{
|
||||
|
@ -482,8 +482,8 @@ void CEXIMemoryCard::DoState(PointerWrap &p)
|
|||
IEXIDevice* CEXIMemoryCard::FindDevice(TEXIDevices device_type, int customIndex)
|
||||
{
|
||||
if (device_type != m_deviceType)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if (customIndex != card_index)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ class CEXIMic : public IEXIDevice
|
|||
public:
|
||||
CEXIMic(const int index);
|
||||
virtual ~CEXIMic();
|
||||
void SetCS(int cs);
|
||||
bool IsInterruptSet();
|
||||
bool IsPresent();
|
||||
void SetCS(int cs) override;
|
||||
bool IsInterruptSet() override;
|
||||
bool IsPresent() override;
|
||||
|
||||
private:
|
||||
static u8 const exi_id[];
|
||||
|
@ -93,7 +93,7 @@ public:
|
|||
int samples_avail;
|
||||
|
||||
protected:
|
||||
virtual void TransferByte(u8 &byte);
|
||||
virtual void TransferByte(u8 &byte) override;
|
||||
};
|
||||
|
||||
#else // HAVE_PORTAUDIO
|
||||
|
|
|
@ -34,7 +34,7 @@ GCMemcard::GCMemcard(const char *filename, bool forceCreation, bool sjis)
|
|||
{
|
||||
//This function can be removed once more about hdr is known and we can check for a valid header
|
||||
std::string fileType;
|
||||
SplitPath(filename, NULL, NULL, &fileType);
|
||||
SplitPath(filename, nullptr, nullptr, &fileType);
|
||||
if (strcasecmp(fileType.c_str(), ".raw") && strcasecmp(fileType.c_str(), ".gcp"))
|
||||
{
|
||||
PanicAlertT("File has the extension \"%s\"\nvalid extensions are (.raw/.gcp)", fileType.c_str());
|
||||
|
@ -814,7 +814,7 @@ u32 GCMemcard::ImportGciInternal(FILE* gcih, const char *inputFile, const std::s
|
|||
File::IOFile gci(gcih);
|
||||
unsigned int offset;
|
||||
std::string fileType;
|
||||
SplitPath(inputFile, NULL, NULL, &fileType);
|
||||
SplitPath(inputFile, nullptr, nullptr, &fileType);
|
||||
|
||||
if (!strcasecmp(fileType.c_str(), ".gci"))
|
||||
offset = GCI;
|
||||
|
@ -913,7 +913,7 @@ u32 GCMemcard::ExportGci(u8 index, const char *fileName, const std::string &dire
|
|||
gci.Open(fileName, "wb");
|
||||
|
||||
std::string fileType;
|
||||
SplitPath(fileName, NULL, NULL, &fileType);
|
||||
SplitPath(fileName, nullptr, nullptr, &fileType);
|
||||
if (!strcasecmp(fileType.c_str(), ".gcs"))
|
||||
{
|
||||
offset = GCS;
|
||||
|
|
|
@ -53,7 +53,7 @@ bool bMMU = false;
|
|||
// Init() declarations
|
||||
// ----------------
|
||||
// Store the MemArena here
|
||||
u8* base = NULL;
|
||||
u8* base = nullptr;
|
||||
|
||||
// The MemArena class
|
||||
MemArena g_arena;
|
||||
|
@ -121,8 +121,8 @@ bool IsInitialized()
|
|||
static const MemoryView views[] =
|
||||
{
|
||||
{&m_pRAM, &m_pPhysicalRAM, 0x00000000, RAM_SIZE, 0},
|
||||
{NULL, &m_pVirtualCachedRAM, 0x80000000, RAM_SIZE, MV_MIRROR_PREVIOUS},
|
||||
{NULL, &m_pVirtualUncachedRAM, 0xC0000000, RAM_SIZE, MV_MIRROR_PREVIOUS},
|
||||
{nullptr, &m_pVirtualCachedRAM, 0x80000000, RAM_SIZE, MV_MIRROR_PREVIOUS},
|
||||
{nullptr, &m_pVirtualUncachedRAM, 0xC0000000, RAM_SIZE, MV_MIRROR_PREVIOUS},
|
||||
|
||||
// Don't map any memory for the EFB. We want all access to this area to go
|
||||
// through the hardware access handlers.
|
||||
|
@ -134,8 +134,8 @@ static const MemoryView views[] =
|
|||
{&m_pFakeVMEM, &m_pVirtualFakeVMEM, 0x7E000000, FAKEVMEM_SIZE, MV_FAKE_VMEM},
|
||||
|
||||
{&m_pEXRAM, &m_pPhysicalEXRAM, 0x10000000, EXRAM_SIZE, MV_WII_ONLY},
|
||||
{NULL, &m_pVirtualCachedEXRAM, 0x90000000, EXRAM_SIZE, MV_WII_ONLY | MV_MIRROR_PREVIOUS},
|
||||
{NULL, &m_pVirtualUncachedEXRAM, 0xD0000000, EXRAM_SIZE, MV_WII_ONLY | MV_MIRROR_PREVIOUS},
|
||||
{nullptr, &m_pVirtualCachedEXRAM, 0x90000000, EXRAM_SIZE, MV_WII_ONLY | MV_MIRROR_PREVIOUS},
|
||||
{nullptr, &m_pVirtualUncachedEXRAM, 0xD0000000, EXRAM_SIZE, MV_WII_ONLY | MV_MIRROR_PREVIOUS},
|
||||
};
|
||||
static const int num_views = sizeof(views) / sizeof(MemoryView);
|
||||
|
||||
|
@ -185,7 +185,7 @@ void Shutdown()
|
|||
if (bFakeVMEM) flags |= MV_FAKE_VMEM;
|
||||
MemoryMap_Shutdown(views, num_views, flags, &g_arena);
|
||||
g_arena.ReleaseSpace();
|
||||
base = NULL;
|
||||
base = nullptr;
|
||||
delete mmio_mapping;
|
||||
INFO_LOG(MEMMAP, "Memory system shut down.");
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ void WriteBigEData(const u8 *_pData, const u32 _Address, const size_t _iSize)
|
|||
void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
|
||||
{
|
||||
u8 *ptr = GetPointer(_Address);
|
||||
if (ptr != NULL)
|
||||
if (ptr != nullptr)
|
||||
{
|
||||
memset(ptr,_iValue,_iLength);
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ void DMA_LCToMemory(const u32 _MemAddr, const u32 _CacheAddr, const u32 _iNumBlo
|
|||
const u8 *src = GetCachePtr() + (_CacheAddr & 0x3FFFF);
|
||||
u8 *dst = GetPointer(_MemAddr);
|
||||
|
||||
if ((dst != NULL) && (src != NULL) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
|
||||
if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
|
||||
{
|
||||
memcpy(dst, src, 32 * _iNumBlocks);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ void DMA_MemoryToLC(const u32 _CacheAddr, const u32 _MemAddr, const u32 _iNumBlo
|
|||
const u8 *src = GetPointer(_MemAddr);
|
||||
u8 *dst = GetCachePtr() + (_CacheAddr & 0x3FFFF);
|
||||
|
||||
if ((dst != NULL) && (src != NULL) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
|
||||
if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
|
||||
{
|
||||
memcpy(dst, src, 32 * _iNumBlocks);
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ u8 *GetPointer(const u32 _Address)
|
|||
|
||||
ERROR_LOG(MEMMAP, "Unknown Pointer %#8x PC %#8x LR %#8x", _Address, PC, LR);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ void GenerateSIInterrupt(SIInterruptType _SIInterrupt)
|
|||
void RemoveDevice(int _iDeviceNumber)
|
||||
{
|
||||
delete g_Channel[_iDeviceNumber].m_pDevice;
|
||||
g_Channel[_iDeviceNumber].m_pDevice = NULL;
|
||||
g_Channel[_iDeviceNumber].m_pDevice = nullptr;
|
||||
}
|
||||
|
||||
void AddDevice(ISIDevice* pDevice)
|
||||
|
|
|
@ -85,20 +85,20 @@ public:
|
|||
CSIDevice_GCController(SIDevices device, int _iDeviceNumber);
|
||||
|
||||
// Run the SI Buffer
|
||||
virtual int RunBuffer(u8* _pBuffer, int _iLength);
|
||||
virtual int RunBuffer(u8* _pBuffer, int _iLength) override;
|
||||
|
||||
// Send and Receive pad input from network
|
||||
static bool NetPlay_GetInput(u8 numPAD, SPADStatus status, u32 *PADStatus);
|
||||
static u8 NetPlay_InGamePadToLocalPad(u8 numPAD);
|
||||
|
||||
// Return true on new data
|
||||
virtual bool GetData(u32& _Hi, u32& _Low);
|
||||
virtual bool GetData(u32& _Hi, u32& _Low) override;
|
||||
|
||||
// Send a command directly
|
||||
virtual void SendCommand(u32 _Cmd, u8 _Poll);
|
||||
virtual void SendCommand(u32 _Cmd, u8 _Poll) override;
|
||||
|
||||
// Savestate support
|
||||
virtual void DoState(PointerWrap& p);
|
||||
virtual void DoState(PointerWrap& p) override;
|
||||
};
|
||||
|
||||
|
||||
|
@ -108,7 +108,7 @@ class CSIDevice_TaruKonga : public CSIDevice_GCController
|
|||
public:
|
||||
CSIDevice_TaruKonga(SIDevices device, int _iDeviceNumber) : CSIDevice_GCController(device, _iDeviceNumber) { }
|
||||
|
||||
virtual bool GetData(u32& _Hi, u32& _Low)
|
||||
virtual bool GetData(u32& _Hi, u32& _Low) override
|
||||
{
|
||||
CSIDevice_GCController::GetData(_Hi, _Low);
|
||||
_Hi &= ~PAD_USE_ORIGIN << 16;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue