2015-05-25 05:11:41 -06:00
|
|
|
// Copyright 2003 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2015-05-25 05:11:41 -06:00
|
|
|
// Refer to the license.txt file included.
|
2009-07-05 20:10:26 -06:00
|
|
|
|
|
|
|
// Stubs to make DSPCore compile as part of DSPSpy.
|
|
|
|
|
2010-08-14 02:53:05 -06:00
|
|
|
/*
|
2009-07-05 20:10:26 -06:00
|
|
|
#include <stdio.h>
|
2015-03-01 06:52:09 -07:00
|
|
|
#include <stdlib.h>
|
2009-07-05 20:10:26 -06:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Thread.h"
|
|
|
|
|
|
|
|
void *AllocateMemoryPages(size_t size)
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
return malloc(size);
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
void FreeMemoryPages(void *pages, size_t size)
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
free(pages);
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
void WriteProtectMemory(void* ptr, size_t size, bool allowExecute)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DSPHost_OnThread()
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
return false;
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Well, it's just RAM right? :)
|
|
|
|
u8 DSPHost_ReadHostMemory(u32 address)
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
u8 *ptr = (u8*)address;
|
|
|
|
return *ptr;
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
void DSPHost_WriteHostMemory(u8 value, u32 addr) {}
|
|
|
|
|
|
|
|
|
|
|
|
void DSPHost_CodeLoaded(const u8 *code, int size)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace Common
|
|
|
|
{
|
|
|
|
|
|
|
|
CriticalSection::CriticalSection(int)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
CriticalSection::~CriticalSection()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CriticalSection::Enter()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CriticalSection::Leave()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
namespace File
|
|
|
|
{
|
|
|
|
|
|
|
|
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
FILE *f = fopen(filename, text_file ? "w" : "wb");
|
|
|
|
if (!f)
|
|
|
|
return false;
|
|
|
|
size_t len = str.size();
|
|
|
|
if (len != fwrite(str.data(), 1, str.size(), f))
|
|
|
|
{
|
|
|
|
fclose(f);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
fclose(f);
|
|
|
|
return true;
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ReadFileToString(bool text_file, const char *filename, std::string &str)
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
FILE *f = fopen(filename, text_file ? "r" : "rb");
|
|
|
|
if (!f)
|
|
|
|
return false;
|
|
|
|
fseeko(f, 0, SEEK_END);
|
|
|
|
size_t len = ftello(f);
|
|
|
|
fseeko(f, 0, SEEK_SET);
|
|
|
|
char *buf = new char[len + 1];
|
|
|
|
buf[fread(buf, 1, len, f)] = 0;
|
|
|
|
str = std::string(buf, len);
|
|
|
|
fclose(f);
|
|
|
|
delete [] buf;
|
|
|
|
return true;
|
2009-07-05 20:10:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-08-14 02:53:05 -06:00
|
|
|
|
2014-12-20 20:04:31 -07:00
|
|
|
*/
|