o_append implemented

This commit is contained in:
Nekotekina 2015-04-24 17:06:30 +03:00
parent 2f4d6fc2a1
commit ed6fb7cc43
7 changed files with 37 additions and 43 deletions

View file

@ -7,9 +7,6 @@
#include "Emu/System.h"
#include "Utilities/Log.h"
#undef CreateFile
#undef CopyFile
std::vector<std::string> simplify_path_blocks(const std::string& path)
{
// fmt::tolower() removed

View file

@ -45,9 +45,6 @@ struct VFSManagerEntry
std::vector<std::string> simplify_path_blocks(const std::string& path);
std::string simplify_path(const std::string& path, bool is_dir, bool is_ps3);
#undef CreateFile
#undef CopyFile
struct VFS
{
~VFS();

View file

@ -6,15 +6,15 @@
extern Module cellAvconfExt;
int cellVideoOutConvertCursorColor()
s32 cellVideoOutConvertCursorColor()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;
}
int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
s32 cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
{
cellAvconfExt.Warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize_addr=0x%x)", videoOut, screenSize.addr());
cellAvconfExt.Warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize=*0x%x)", videoOut, screenSize);
if (videoOut != CELL_VIDEO_OUT_PRIMARY)
{
@ -23,8 +23,8 @@ int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
//TODO: Use virtual screen size
#ifdef _WIN32
HDC screen = GetDC(NULL);
float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * 0.0393f);
//HDC screen = GetDC(NULL);
//float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * 0.0393f);
#else
// TODO: Linux implementation, without using wx
// float diagonal = roundf(sqrtf((powf(wxGetDisplaySizeMM().GetWidth(), 2) + powf(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393f);
@ -32,22 +32,20 @@ int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
if (Ini.GS3DTV.GetValue())
{
#ifdef _WIN32
*screenSize = diagonal;
#endif
*screenSize = 24.0f;
return CELL_OK;
}
return CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET;
}
int cellVideoOutGetGamma()
s32 cellVideoOutGetGamma()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;
}
int cellVideoOutSetGamma()
s32 cellVideoOutSetGamma()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;

View file

@ -1,6 +1,6 @@
#include "stdafx.h"
#include "Utilities/rPlatform.h"
#include "Utilities/StrFmt.h"
#include "Utilities/simpleini/SimpleIni.h"
#include "Ini.h"
#include <cctype>
@ -8,6 +8,7 @@
#define DEF_CONFIG_NAME "./rpcs3.ini"
//TODO: make thread safe/remove static singleton
CSimpleIniCaseA *getIniFile()
{
static bool inited = false;
@ -98,7 +99,7 @@ static std::string WindowInfoToString(const WindowInfo& wind)
//Ini
Ini::Ini()
{
m_Config = getIniFile();
m_config = getIniFile();
}
Ini::~Ini()
@ -109,55 +110,55 @@ Ini::~Ini()
//TODO: saving the file after each change seems like overkill but that's how wx did it
void Ini::Save(const std::string& section, const std::string& key, int value)
{
m_Config->SetLongValue(section.c_str(), key.c_str(), value);
static_cast<CSimpleIniCaseA*>(m_config)->SetLongValue(section.c_str(), key.c_str(), value);
saveIniFile();
}
void Ini::Save(const std::string& section, const std::string& key, bool value)
{
m_Config->SetBoolValue(section.c_str(), key.c_str(), value);
static_cast<CSimpleIniCaseA*>(m_config)->SetBoolValue(section.c_str(), key.c_str(), value);
saveIniFile();
}
void Ini::Save(const std::string& section, const std::string& key, std::pair<int, int> value)
{
m_Config->SetValue(section.c_str(), key.c_str(), SizeToString(value).c_str());
static_cast<CSimpleIniCaseA*>(m_config)->SetValue(section.c_str(), key.c_str(), SizeToString(value).c_str());
saveIniFile();
}
void Ini::Save(const std::string& section, const std::string& key, const std::string& value)
{
m_Config->SetValue(section.c_str(), key.c_str(), value.c_str());
static_cast<CSimpleIniCaseA*>(m_config)->SetValue(section.c_str(), key.c_str(), value.c_str());
saveIniFile();
}
void Ini::Save(const std::string& section, const std::string& key, WindowInfo value)
{
m_Config->SetValue(section.c_str(), key.c_str(), WindowInfoToString(value).c_str());
static_cast<CSimpleIniCaseA*>(m_config)->SetValue(section.c_str(), key.c_str(), WindowInfoToString(value).c_str());
saveIniFile();
}
int Ini::Load(const std::string& section, const std::string& key, const int def_value)
{
return m_Config->GetLongValue(section.c_str(), key.c_str(), def_value);
return static_cast<CSimpleIniCaseA*>(m_config)->GetLongValue(section.c_str(), key.c_str(), def_value);
}
bool Ini::Load(const std::string& section, const std::string& key, const bool def_value)
{
return StringToBool(m_Config->GetValue(section.c_str(), key.c_str(), BoolToString(def_value).c_str()));
return StringToBool(static_cast<CSimpleIniCaseA*>(m_config)->GetValue(section.c_str(), key.c_str(), BoolToString(def_value).c_str()));
}
std::pair<int, int> Ini::Load(const std::string& section, const std::string& key, const std::pair<int, int> def_value)
{
return StringToSize(m_Config->GetValue(section.c_str(), key.c_str(), SizeToString(def_value).c_str()));
return StringToSize(static_cast<CSimpleIniCaseA*>(m_config)->GetValue(section.c_str(), key.c_str(), SizeToString(def_value).c_str()));
}
std::string Ini::Load(const std::string& section, const std::string& key, const std::string& def_value)
{
return std::string(m_Config->GetValue(section.c_str(), key.c_str(), def_value.c_str()));
return std::string(static_cast<CSimpleIniCaseA*>(m_config)->GetValue(section.c_str(), key.c_str(), def_value.c_str()));
}
WindowInfo Ini::Load(const std::string& section, const std::string& key, const WindowInfo& def_value)
{
return StringToWindowInfo(m_Config->GetValue(section.c_str(), key.c_str(), WindowInfoToString(def_value).c_str()));
return StringToWindowInfo(static_cast<CSimpleIniCaseA*>(m_config)->GetValue(section.c_str(), key.c_str(), WindowInfoToString(def_value).c_str()));
}

View file

@ -1,11 +1,5 @@
#pragma once
#include <utility>
#include "Utilities/simpleini/SimpleIni.h"
//TODO: make thread safe/remove static singleton
CSimpleIniCaseA *getIniFile();
//TODO: move this to the gui module
struct WindowInfo
{
@ -26,7 +20,7 @@ public:
virtual ~Ini();
protected:
CSimpleIniCaseA *m_Config;
void* m_config;
Ini();