Merge branch 'master' of https://github.com/hrydgard/ppsspp into StepOut

This commit is contained in:
Kingcom committed 2013-08-12 10:10:53 +02:00
commit fb6c2faae8
47 files changed
+1330 -794

No files matched your search

+2
View File
@@ -898,6 +898,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/scePauth.h
Core/HW/atrac3plus.cpp
Core/HW/atrac3plus.h
Core/HW/AsyncIOManager.cpp
Core/HW/AsyncIOManager.h
Core/HW/MediaEngine.cpp
Core/HW/MediaEngine.h
Core/HW/MpegDemux.cpp
+1
View File
@@ -74,6 +74,7 @@ set(SRCS
HLE/sceParseHttp.cpp
HLE/sceVaudio.cpp
HLE/sceAudiocodec.cpp
HW/AsyncIOManager.cpp
HW/MemoryStick.cpp
HW/MediaEngine.cpp
HW/SasAudio.cpp
+2
View File
@@ -90,6 +90,7 @@ void Config::Load(const char *iniFileName)
cpu->Get("Jit", &bJit, true);
#endif
cpu->Get("SeparateCPUThread", &bSeparateCPUThread, false);
cpu->Get("SeparateIOThread", &bSeparateIOThread, true);
cpu->Get("FastMemory", &bFastMemory, false);
cpu->Get("CPUSpeed", &iLockedCPUSpeed, false);
@@ -228,6 +229,7 @@ void Config::Save()
IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
cpu->Set("Jit", bJit);
cpu->Set("SeparateCPUThread", bSeparateCPUThread);
cpu->Set("SeparateIOThread", bSeparateIOThread);
cpu->Set("FastMemory", bFastMemory);
cpu->Set("CPUSpeed", iLockedCPUSpeed);
+1
View File
@@ -58,6 +58,7 @@ public:
bool bJit;
// Definitely cannot be changed while game is running.
bool bSeparateCPUThread;
bool bSeparateIOThread;
int iLockedCPUSpeed;
bool bAutoSaveSymbolMap;
std::string sReportHost;
+2
View File
@@ -251,6 +251,7 @@
<ClCompile Include="HW\MpegDemux.cpp" />
<ClCompile Include="HW\OMAConvert.cpp" />
<ClCompile Include="HW\SasAudio.cpp" />
<ClCompile Include="HW\AsyncIOManager.cpp" />
<ClCompile Include="Loaders.cpp" />
<ClCompile Include="MemMap.cpp" />
<ClCompile Include="MemmapFunctions.cpp" />
@@ -437,6 +438,7 @@
<ClInclude Include="HW\OMAConvert.h" />
<ClInclude Include="HW\SasAudio.h" />
<ClInclude Include="HW\MemoryStick.h" />
<ClInclude Include="HW\AsyncIOManager.h" />
<ClInclude Include="Loaders.h" />
<ClInclude Include="MemMap.h" />
<ClInclude Include="MIPS\ARM\ArmAsm.h">
+6
View File
@@ -451,6 +451,9 @@
<ClCompile Include="FileSystems\VirtualDiscFileSystem.cpp">
<Filter>FileSystems</Filter>
</ClCompile>
<ClCompile Include="HW\AsyncIOManager.cpp">
<Filter>HW</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ELF\ElfReader.h">
@@ -840,6 +843,9 @@
<ClInclude Include="ThreadEventQueue.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="HW\AsyncIOManager.h">
<Filter>HW</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
+1 -1
View File
@@ -631,7 +631,7 @@ int PSPSaveDialog::Update()
DisplaySaveIcon();
DisplaySaveDataInfo2();
DisplayMessage(d->T("Do you want to overwrite the data?"), true);
DisplayMessage(d->T("Confirm Overwrite","Do you want to overwrite the data?"), true);
DisplayButtons(DS_BUTTON_OK | DS_BUTTON_CANCEL);
DisplayBanner(DB_SAVE);
+2 -2
View File
@@ -411,7 +411,6 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
framebuf = latchedFramebuf;
framebufIsLatched = false;
gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
gpuStats.numFlips++;
}
}
@@ -427,6 +426,8 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
// non-buffered rendering. The interaction with frame skipping seems to need
// some work.
if (gpu->FramebufferDirty()) {
gpuStats.numFlips++;
bool wasSkipped = (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) != 0;
gstate_c.skipDrawReason &= ~SKIPDRAW_SKIPFRAME;
@@ -515,7 +516,6 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
if (topaddr != framebuf.topaddr) {
framebuf = fbstate;
gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
gpuStats.numFlips++;
}
} else {
WARN_LOG(HLE, "%s: PSP_DISPLAY_SETBUF_IMMEDIATE without topaddr?", __FUNCTION__);
+27
View File
@@ -40,6 +40,11 @@ struct GeInterruptData
static std::list<GeInterruptData> ge_pending_cb;
static int geSyncEvent;
static int geInterruptEvent;
static int geCycleEvent;
// Let's try updating 10 times per vblank.
const int geIntervalUs = 1000000 / (60 * 10);
const int geBehindThresholdUs = 1000000 / (60 * 10);
class GeIntrHandler : public IntrHandler
{
@@ -162,6 +167,20 @@ void __GeExecuteInterrupt(u64 userdata, int cyclesLate)
__TriggerInterrupt(PSP_INTR_IMMEDIATE, PSP_GE_INTR, PSP_INTR_SUB_NONE);
}
void __GeCheckCycles(u64 userdata, int cyclesLate)
{
u64 geTicks = gpu->GetTickEstimate();
if (geTicks != 0)
{
if (CoreTiming::GetTicks() > geTicks + usToCycles(geBehindThresholdUs)) {
u64 diff = CoreTiming::GetTicks() - geTicks;
gpu->SyncThread();
CoreTiming::Advance();
}
}
CoreTiming::ScheduleEvent(usToCycles(geIntervalUs), geCycleEvent, 0);
}
void __GeInit()
{
memset(&ge_used_callbacks, 0, sizeof(ge_used_callbacks));
@@ -170,6 +189,12 @@ void __GeInit()
geSyncEvent = CoreTiming::RegisterEvent("GeSyncEvent", &__GeExecuteSync);
geInterruptEvent = CoreTiming::RegisterEvent("GeInterruptEvent", &__GeExecuteInterrupt);
geCycleEvent = CoreTiming::RegisterEvent("GeCycleEvent", &__GeCheckCycles);
// When we're using separate CPU/GPU threads, we need to keep them in sync.
if (IsOnSeparateCPUThread()) {
CoreTiming::ScheduleEvent(usToCycles(geIntervalUs), geCycleEvent, 0);
}
}
void __GeDoState(PointerWrap &p)
@@ -182,6 +207,8 @@ void __GeDoState(PointerWrap &p)
CoreTiming::RestoreRegisterEvent(geSyncEvent, "GeSyncEvent", &__GeExecuteSync);
p.Do(geInterruptEvent);
CoreTiming::RestoreRegisterEvent(geInterruptEvent, "GeInterruptEvent", &__GeExecuteInterrupt);
p.Do(geCycleEvent);
CoreTiming::RestoreRegisterEvent(geCycleEvent, "GeCycleEvent", &__GeCheckCycles);
// Everything else is done in sceDisplay.
p.DoMarker("sceGe");
+202 -64
View File
@@ -16,33 +16,36 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <cstdlib>
#include "native/thread/thread.h"
#include "native/thread/threadutil.h"
#include "Core/Config.h"
#include "Core/System.h"
#include "Core/Host.h"
#include "Core/SaveState.h"
#include "HLE.h"
#include "Core/HLE/HLE.h"
#include "Core/MIPS/MIPS.h"
#include "Core/HW/MemoryStick.h"
#include "Core/HW/AsyncIOManager.h"
#include "Core/CoreTiming.h"
#include "Core/Reporting.h"
#include "../FileSystems/FileSystem.h"
#include "../FileSystems/MetaFileSystem.h"
#include "../FileSystems/ISOFileSystem.h"
#include "../FileSystems/DirectoryFileSystem.h"
#include "Core/FileSystems/FileSystem.h"
#include "Core/FileSystems/MetaFileSystem.h"
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/FileSystems/DirectoryFileSystem.h"
extern "C" {
#include "ext/libkirk/amctrl.h"
};
#include "sceIo.h"
#include "sceRtc.h"
#include "sceKernel.h"
#include "sceKernelMemory.h"
#include "sceKernelThread.h"
#include "Core/HLE/sceIo.h"
#include "Core/HLE/sceRtc.h"
#include "Core/HLE/sceKernel.h"
#include "Core/HLE/sceKernelMemory.h"
#include "Core/HLE/sceKernelThread.h"
// For headless screenshots.
#include "sceDisplay.h"
#include "Core/HLE/sceDisplay.h"
const int ERROR_ERRNO_FILE_NOT_FOUND = 0x80010002;
const int ERROR_ERRNO_FILE_ALREADY_EXISTS = 0x80010011;
@@ -101,7 +104,14 @@ const int PSP_COUNT_FDS = 64;
// TODO: Should be 3, and stdin/stdout/stderr are special values aliased to 0?
const int PSP_MIN_FD = 4;
static int asyncNotifyEvent = -1;
static int syncNotifyEvent = -1;
static SceUID fds[PSP_COUNT_FDS];
static AsyncIOManager ioManager;
static bool ioManagerThreadEnabled = false;
static std::thread *ioManagerThread;
// TODO: Is it better to just put all on the thread?
const int IO_THREAD_MIN_DATA_SIZE = 256;
#define SCE_STM_FDIR 0x1000
#define SCE_STM_FREG 0x2000
@@ -292,6 +302,31 @@ void __IoAsyncNotify(u64 userdata, int cyclesLate) {
}
}
void __IoSyncNotify(u64 userdata, int cyclesLate) {
SceUID threadID = userdata >> 32;
int fd = (int) (userdata & 0xFFFFFFFF);
s64 result = -1;
u32 error;
FileNode *f = __IoGetFd(fd, error);
if (f) {
f->pendingAsyncResult = false;
f->hasAsyncResult = true;
AsyncIOResult managerResult;
if (ioManager.WaitResult(f->handle, managerResult)) {
result = managerResult;
} else {
ERROR_LOG(HLE, "Unable to complete IO operation.");
}
}
SceUID waitID = __KernelGetWaitID(threadID, WAITTYPE_IO, error);
if (waitID == fd && error == 0) {
__KernelResumeThreadFromWait(threadID, result);
}
}
static DirectoryFileSystem *memstickSystem = NULL;
#ifdef ANDROID
static VFSFileSystem *flash0System = NULL;
@@ -299,12 +334,20 @@ static VFSFileSystem *flash0System = NULL;
static DirectoryFileSystem *flash0System = NULL;
#endif
void __IoManagerThread() {
setCurrentThreadName("IOThread");
while (ioManagerThreadEnabled) {
ioManager.RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000));
}
}
void __IoInit() {
INFO_LOG(HLE, "Starting up I/O...");
MemoryStick_SetFatState(PSP_FAT_MEMORYSTICK_STATE_ASSIGNED);
asyncNotifyEvent = CoreTiming::RegisterEvent("IoAsyncNotify", __IoAsyncNotify);
syncNotifyEvent = CoreTiming::RegisterEvent("IoSyncNotify", __IoSyncNotify);
std::string memstickpath;
std::string flash0path;
@@ -324,15 +367,33 @@ void __IoInit() {
__KernelListenThreadEnd(&TellFsThreadEnded);
memset(fds, 0, sizeof(fds));
ioManagerThreadEnabled = g_Config.bSeparateIOThread;
ioManager.SetThreadEnabled(ioManagerThreadEnabled);
if (ioManagerThreadEnabled) {
ioManagerThread = new std::thread(&__IoManagerThread);
}
}
void __IoDoState(PointerWrap &p) {
ioManager.DoState(p);
p.DoArray(fds, ARRAY_SIZE(fds));
p.Do(asyncNotifyEvent);
CoreTiming::RestoreRegisterEvent(asyncNotifyEvent, "IoAsyncNotify", __IoAsyncNotify);
p.Do(syncNotifyEvent);
CoreTiming::RestoreRegisterEvent(syncNotifyEvent, "IoSyncNotify", __IoSyncNotify);
p.DoMarker("sceIo");
}
void __IoShutdown() {
ioManagerThreadEnabled = false;
ioManager.SyncThread();
ioManager.FinishEventLoop();
if (ioManagerThread != NULL) {
delete ioManagerThread;
ioManagerThread = NULL;
}
pspFileSystem.Unmount("ms0:", memstickSystem);
pspFileSystem.Unmount("fatms0:", memstickSystem);
pspFileSystem.Unmount("fatms:", memstickSystem);
@@ -400,6 +461,12 @@ void __IoCompleteAsyncIO(int fd) {
u32 error;
FileNode *f = __IoGetFd(fd, error);
if (f) {
AsyncIOResult managerResult;
if (ioManager.WaitResult(f->handle, managerResult)) {
f->asyncResult = managerResult;
} else {
// It's okay, not all operations are deferred.
}
if (f->callbackID) {
__KernelNotifyCallback(THREAD_CALLBACK_IO, f->callbackID, f->callbackArg);
}
@@ -446,6 +513,14 @@ void __IoSchedAsync(FileNode *f, int fd, int usec) {
f->hasAsyncResult = false;
}
void __IoSchedSync(FileNode *f, int fd, int usec) {
u64 param = ((u64)__KernelGetCurThread()) << 32 | fd;
CoreTiming::ScheduleEvent(usToCycles(usec), syncNotifyEvent, param);
f->pendingAsyncResult = true;
f->hasAsyncResult = false;
}
u32 sceIoGetstat(const char *filename, u32 addr) {
// TODO: Improve timing (although this seems normally slow..)
int usec = 1000;
@@ -525,7 +600,7 @@ u32 npdrmRead(FileNode *f, u8 *data, int size) {
return size;
}
int __IoRead(int id, u32 data_addr, int size) {
bool __IoRead(int &result, int id, u32 data_addr, int size) {
if (id == 3) {
DEBUG_LOG(HLE, "sceIoRead STDIN");
return 0; //stdin
@@ -534,58 +609,88 @@ int __IoRead(int id, u32 data_addr, int size) {
u32 error;
FileNode *f = __IoGetFd(id, error);
if (f) {
if(!(f->openMode & FILEACCESS_READ))
{
return ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
}
else if (Memory::IsValidAddress(data_addr)) {
if (!(f->openMode & FILEACCESS_READ)) {
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
return true;
} else if (Memory::IsValidAddress(data_addr)) {
u8 *data = (u8*) Memory::GetPointer(data_addr);
if(f->npdrm){
return npdrmRead(f, data, size);
}else{
return (int) pspFileSystem.ReadFile(f->handle, data, size);
if (f->npdrm) {
result = npdrmRead(f, data, size);
return true;
} else if (__KernelIsDispatchEnabled() && ioManagerThreadEnabled && size > IO_THREAD_MIN_DATA_SIZE) {
AsyncIOEvent ev = IO_EVENT_READ;
ev.handle = f->handle;
ev.buf = data;
ev.bytes = size;
ioManager.ScheduleOperation(ev);
return false;
} else {
result = (int) pspFileSystem.ReadFile(f->handle, data, size);
return true;
}
} else {
ERROR_LOG(HLE, "sceIoRead Reading into bad pointer %08x", data_addr);
// TODO: Returning 0 because it wasn't being sign-extended in async result before.
// What should this do?
return 0;
result = 0;
return true;
}
} else {
ERROR_LOG(HLE, "sceIoRead ERROR: no file open");
return error;
result = error;
return true;
}
}
u32 sceIoRead(int id, u32 data_addr, int size) {
// TODO: Check id is valid first?
if (!__KernelIsDispatchEnabled() && id > 2)
if (!__KernelIsDispatchEnabled() && id > 2) {
return -1;
int result = __IoRead(id, data_addr, size);
if (result >= 0) {
DEBUG_LOG(HLE, "%x=sceIoRead(%d, %08x, %x)", result, id, data_addr, size);
// TODO: Timing is probably not very accurate, low estimate.
int us = result/100;
if(us==0)
us = 100;
return hleDelayResult(result, "io read", us);
}
else
// TODO: Timing is probably not very accurate, low estimate.
int us = size / 100;
if (us < 100) {
us = 100;
}
int result;
bool complete = __IoRead(result, id, data_addr, size);
if (!complete) {
DEBUG_LOG(HLE, "sceIoRead(%d, %08x, %x): deferring result", id, data_addr, size);
u32 error;
FileNode *f = __IoGetFd(id, error);
__IoSchedSync(f, id, us);
__KernelWaitCurThread(WAITTYPE_IO, id, 0, 0, false, "io read");
return 0;
} else if (result >= 0) {
DEBUG_LOG(HLE, "%x=sceIoRead(%d, %08x, %x)", result, id, data_addr, size);
return hleDelayResult(result, "io read", us);
} else {
return result;
}
}
u32 sceIoReadAsync(int id, u32 data_addr, int size) {
// TODO: Not sure what the correct delay is (and technically we shouldn't read into the buffer yet...)
int us = size / 100;
if (us < 100) {
us = 100;
}
u32 error;
FileNode *f = __IoGetFd(id, error);
if (f) {
f->asyncResult = __IoRead(id, data_addr, size);
// TODO: Not sure what the correct delay is (and technically we shouldn't read into the buffer yet...)
int us = f->asyncResult/100;
if(us==0)
us = 100;
int result;
bool complete = __IoRead(result, id, data_addr, size);
if (complete) {
f->asyncResult = result;
DEBUG_LOG(HLE, "%llx=sceIoReadAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
} else {
DEBUG_LOG(HLE, "sceIoReadAsync(%d, %08x, %x): deferring result", id, data_addr, size);
}
__IoSchedAsync(f, id, us);
DEBUG_LOG(HLE, "%llx=sceIoReadAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
return 0;
} else {
ERROR_LOG(HLE, "sceIoReadAsync: bad file %d", id);
@@ -593,24 +698,37 @@ u32 sceIoReadAsync(int id, u32 data_addr, int size) {
}
}
int __IoWrite(int id, void *data_ptr, int size) {
bool __IoWrite(int &result, int id, void *data_ptr, int size) {
// Let's handle stdout/stderr specially.
if (id == 1 || id == 2) {
const char *str = (const char *) data_ptr;
const int str_size = size == 0 ? 0 : (str[size - 1] == '\n' ? size - 1 : size);
INFO_LOG(HLE, "%s: %.*s", id == 1 ? "stdout" : "stderr", str_size, str);
return size;
result = size;
return true;
}
u32 error;
FileNode *f = __IoGetFd(id, error);
if (f) {
if(!(f->openMode & FILEACCESS_WRITE)) {
return ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
if (!(f->openMode & FILEACCESS_WRITE)) {
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
return true;
}
return (int) pspFileSystem.WriteFile(f->handle, (u8*) data_ptr, size);
if (__KernelIsDispatchEnabled() && ioManagerThreadEnabled && size > IO_THREAD_MIN_DATA_SIZE) {
AsyncIOEvent ev = IO_EVENT_WRITE;
ev.handle = f->handle;
ev.buf = (u8 *) data_ptr;
ev.bytes = size;
ioManager.ScheduleOperation(ev);
return false;
} else {
result = (int) pspFileSystem.WriteFile(f->handle, (u8 *) data_ptr, size);
}
return true;
} else {
ERROR_LOG(HLE, "sceIoWrite ERROR: no file open");
return (s32) error;
result = (s32) error;
return true;
}
}
@@ -619,33 +737,53 @@ u32 sceIoWrite(int id, u32 data_addr, int size) {
if (!__KernelIsDispatchEnabled() && id > 2)
return -1;
int result = __IoWrite(id, Memory::GetPointer(data_addr), size);
if (result >= 0) {
DEBUG_LOG(HLE, "%x=sceIoWrite(%d, %08x, %x)", result, id, data_addr, size);
// TODO: Timing is probably not very accurate, low estimate.
int us = result/100;
if(us==0)
us = 100;
if (__KernelIsDispatchEnabled())
return hleDelayResult(result, "io write", us);
else
return result;
// TODO: Timing is probably not very accurate, low estimate.
int us = size / 100;
if (us < 100) {
us = 100;
}
else
int result;
bool complete = __IoWrite(result, id, Memory::GetPointer(data_addr), size);
if (!complete) {
DEBUG_LOG(HLE, "sceIoWrite(%d, %08x, %x): deferring result", id, data_addr, size);
u32 error;
FileNode *f = __IoGetFd(id, error);
__IoSchedSync(f, id, us);
__KernelWaitCurThread(WAITTYPE_IO, id, 0, 0, false, "io write");
return 0;
} else if (result >= 0) {
DEBUG_LOG(HLE, "%x=sceIoWrite(%d, %08x, %x)", result, id, data_addr, size);
if (__KernelIsDispatchEnabled()) {
return hleDelayResult(result, "io write", us);
} else {
return result;
}
} else {
return result;
}
}
u32 sceIoWriteAsync(int id, u32 data_addr, int size) {
// TODO: Not sure what the correct delay is (and technically we shouldn't read from the buffer yet...)
int us = size / 100;
if (us < 100) {
us = 100;
}
u32 error;
FileNode *f = __IoGetFd(id, error);
if (f) {
f->asyncResult = __IoWrite(id, Memory::GetPointer(data_addr), size);
// TODO: Not sure what the correct delay is (and technically we shouldn't read into the buffer yet...)
int us = f->asyncResult/100;
if(us==0)
us = 100;
int result;
bool complete = __IoWrite(result, id, Memory::GetPointer(data_addr), size);
if (complete) {
f->asyncResult = result;
DEBUG_LOG(HLE, "%llx=sceIoWriteAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
} else {
DEBUG_LOG(HLE, "sceIoWriteAsync(%d, %08x, %x): deferring result", id, data_addr, size);
}
__IoSchedAsync(f, id, us);
DEBUG_LOG(HLE, "%llx=sceIoWriteAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
return 0;
} else {
ERROR_LOG(HLE, "sceIoWriteAsync: bad file %d", id);
+3 -3
View File
@@ -19,9 +19,9 @@
#include <string>
#include "../System.h"
#include "HLE.h"
#include "sceKernel.h"
#include "Core/System.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/sceKernel.h"
void __IoInit();
void __IoDoState(PointerWrap &p);
+97
View File
@@ -0,0 +1,97 @@
// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Core/Reporting.h"
#include "Core/System.h"
#include "Core/HW/AsyncIOManager.h"
#include "Core/FileSystems/MetaFileSystem.h"
void AsyncIOManager::ScheduleOperation(AsyncIOEvent ev) {
lock_guard guard(resultsLock_);
resultsPending_.insert(ev.handle);
ScheduleEvent(ev);
}
bool AsyncIOManager::PopResult(u32 handle, AsyncIOResult &result) {
lock_guard guard(resultsLock_);
if (results_.find(handle) != results_.end()) {
result = results_[handle];
results_.erase(handle);
resultsPending_.erase(handle);
return true;
} else {
return false;
}
}
bool AsyncIOManager::WaitResult(u32 handle, AsyncIOResult &result) {
lock_guard guard(resultsLock_);
ScheduleEvent(IO_EVENT_SYNC);
while (HasEvents() && resultsPending_.find(handle) != resultsPending_.end()) {
if (PopResult(handle, result)) {
return true;
}
resultsWait_.wait_for(resultsLock_, 16);
}
if (PopResult(handle, result)) {
return true;
}
return false;
}
void AsyncIOManager::ProcessEvent(AsyncIOEvent ev) {
switch (ev.type) {
case IO_EVENT_READ:
Read(ev.handle, ev.buf, ev.bytes);
break;
case IO_EVENT_WRITE:
Write(ev.handle, ev.buf, ev.bytes);
break;
default:
ERROR_LOG(HLE, "Unsupported IO event type");
}
}
void AsyncIOManager::Read(u32 handle, u8 *buf, size_t bytes) {
size_t result = pspFileSystem.ReadFile(handle, buf, bytes);
EventResult(handle, result);
}
void AsyncIOManager::Write(u32 handle, u8 *buf, size_t bytes) {
size_t result = pspFileSystem.WriteFile(handle, buf, bytes);
EventResult(handle, result);
}
void AsyncIOManager::EventResult(u32 handle, AsyncIOResult result) {
lock_guard guard(resultsLock_);
if (results_.find(handle) != results_.end()) {
ERROR_LOG_REPORT(HLE, "Overwriting previous result for file action on handle %d", handle);
}
results_[handle] = result;
resultsWait_.notify_one();
}
void AsyncIOManager::DoState(PointerWrap &p) {
SyncThread();
lock_guard guard(resultsLock_);
p.Do(resultsPending_);
p.Do(results_);
p.DoMarker("AsyncIOManager");
}
+75
View File
@@ -0,0 +1,75 @@
// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <map>
#include <set>
#include "native/base/mutex.h"
#include "Core/ThreadEventQueue.h"
class NoBase {
};
enum AsyncIOEventType {
IO_EVENT_INVALID,
IO_EVENT_SYNC,
IO_EVENT_FINISH,
IO_EVENT_READ,
IO_EVENT_WRITE,
};
struct AsyncIOEvent {
AsyncIOEvent(AsyncIOEventType t) : type(t) {}
AsyncIOEventType type;
u32 handle;
u8 *buf;
size_t bytes;
operator AsyncIOEventType() const {
return type;
}
};
// TODO: Something better.
typedef size_t AsyncIOResult;
typedef ThreadEventQueue<NoBase, AsyncIOEvent, AsyncIOEventType, IO_EVENT_INVALID, IO_EVENT_SYNC, IO_EVENT_FINISH> IOThreadEventQueue;
class AsyncIOManager : public IOThreadEventQueue {
public:
void DoState(PointerWrap &p);
void ScheduleOperation(AsyncIOEvent ev);
bool PopResult(u32 handle, AsyncIOResult &result);
bool WaitResult(u32 handle, AsyncIOResult &result);
protected:
virtual void ProcessEvent(AsyncIOEvent ref);
virtual bool ShouldExitEventLoop() {
return coreState == CORE_ERROR || coreState == CORE_POWERDOWN;
}
private:
void Read(u32 handle, u8 *buf, size_t bytes);
void Write(u32 handle, u8 *buf, size_t bytes);
void EventResult(u32 handle, AsyncIOResult result);
recursive_mutex resultsLock_;
condition_variable resultsWait_;
std::set<u32> resultsPending_;
std::map<u32, AsyncIOResult> results_;
};
+8
View File
@@ -112,6 +112,10 @@ IdentifiedFileType Identify_File(std::string &filename)
if (psar_id == 'MUPN') {
return FILETYPE_PSP_ISO_NP;
}
// PS1 PSAR begins with "PSISOIMG0000"
if (psar_id == 'SISP') {
return FILETYPE_PSP_PS1_PBP;
}
// Let's check if we got pointed to a PBP within such a directory.
// If so we just move up and return the directory itself as the game.
@@ -177,6 +181,10 @@ bool LoadFile(std::string &filename, std::string *error_string) {
pspFileSystem.SetStartingDirectory("disc0:/PSP_GAME/USRDIR");
return Load_PSP_ISO(filename.c_str(), error_string);
case FILETYPE_PSP_PS1_PBP:
*error_string = "PS1 EBOOTs are not supported by PPSSPP.";
break;
case FILETYPE_ERROR:
ERROR_LOG(LOADER, "Could not read file");
*error_string = "Error reading file";
+1
View File
@@ -35,6 +35,7 @@ enum IdentifiedFileType {
// Try to reduce support emails...
FILETYPE_ARCHIVE_RAR,
FILETYPE_ARCHIVE_ZIP,
FILETYPE_PSP_PS1_PBP,
FILETYPE_UNKNOWN
};
+11 -5
View File
@@ -592,12 +592,22 @@ namespace MIPSComp
fpr.ReleaseSpillLocksAndDiscardTemps();
}
void Jit::Comp_Vhoriz(u32 op) {
DISABLE;
switch ((op >> 16) & 31) {
case 6: // vfad
break;
case 7: // vavg
break;
}
}
void Jit::Comp_VHdp(u32 op) {
// Similar to vdot
DISABLE;
}
void Jit::Comp_VecDo3(u32 op) {
CONDITIONAL_DISABLE;
@@ -1535,10 +1545,6 @@ namespace MIPSComp
fpr.ReleaseSpillLocksAndDiscardTemps();
}
void Jit::Comp_Vhoriz(u32 op) {
DISABLE;
}
static float sincostemp[2];
void SinCos(float angle) {
+3
View File
@@ -25,6 +25,7 @@
#include "Core/MIPS/MIPSDebugInterface.h"
#include "Core/MIPS/MIPSVFPUUtils.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Core/Reporting.h"
#include "Core/System.h"
#include "Core/HLE/sceDisplay.h"
@@ -203,6 +204,7 @@ void MIPSState::WriteFCR(int reg, int value)
}
else
{
WARN_LOG_REPORT(CPU, "WriteFCR: Unexpected reg %d (value %08x)", reg, value);
// MessageBox(0, "Invalid FCR","...",0);
}
DEBUG_LOG(CPU, "FCR%i written to, value %08x", reg, value);
@@ -222,6 +224,7 @@ u32 MIPSState::ReadFCR(int reg)
}
else
{
WARN_LOG_REPORT(CPU, "ReadFCR: Unexpected reg %d", reg);
// MessageBox(0, "Invalid FCR","...",0);
}
return 0;
+16 -68
View File
@@ -54,7 +54,7 @@ namespace MIPSAnalyst
if (MIPS_GET_RT(opinfo) == reg)
return true;
}
if (opinfo & (IN_RS | IN_RS_ADDR | IN_RS_SHIFT))
if (opinfo & IN_RS)
{
if (MIPS_GET_RS(opinfo) == reg)
return true;
@@ -87,75 +87,26 @@ namespace MIPSAnalyst
}
}
// Temporary, returns true for common ops which have proper flags in the table.
bool IsDelaySlotInfoSafe(u32 op)
{
const char *safeOps[] = {
"addi", "addiu", "slti", "sltiu", "andi", "ori", "xori", "lui",
"lb", "lh", "lwl", "lw", "lbu", "lhu", "lwr",
"sb", "sh", "swl", "sw", "swr",
"sll", "srl", "sra", "sllv", "srlv", "srav",
"add", "addu", "sub", "subu", "and", "or", "xor", "nor",
"slt", "sltu",
};
const char *opName = MIPSGetName(op);
for (size_t i = 0; i < ARRAY_SIZE(safeOps); ++i)
{
if (!strcmp(safeOps[i], opName))
return true;
}
return false;
}
bool IsDelaySlotNiceReg(u32 branchOp, u32 op, int reg1, int reg2)
{
// NOOPs are always nice.
if (op == 0)
return true;
// $0 is never an out reg, it's always 0.
if (reg1 != 0 && GetOutReg(op) == reg1)
return false;
if (reg2 != 0 && GetOutReg(op) == reg2)
return false;
// TODO: Once the flags are all correct on the tables, remove this safety.
if (IsDelaySlotInfoSafe(op))
{
// $0 is never an out reg, it's always 0.
if (reg1 != 0 && GetOutReg(op) == reg1)
return false;
if (reg2 != 0 && GetOutReg(op) == reg2)
return false;
return true;
}
return false;
return true;
}
bool IsDelaySlotNiceVFPU(u32 branchOp, u32 op)
{
// NOOPs are always nice.
if (op == 0)
return true;
// TODO: Once the flags are all correct on the tables, remove this safety.
if (IsDelaySlotInfoSafe(op))
{
// TODO: There may be IS_VFPU cases which are safe...
return (MIPSGetInfo(op) & IS_VFPU) == 0;
}
return false;
// TODO: There may be IS_VFPU cases which are safe...
return (MIPSGetInfo(op) & IS_VFPU) == 0;
}
bool IsDelaySlotNiceFPU(u32 branchOp, u32 op)
{
// NOOPs are always nice.
if (op == 0)
return true;
// TODO: Once the flags are all correct on the tables, remove this safety.
if (IsDelaySlotInfoSafe(op))
return (MIPSGetInfo(op) & OUT_FPUFLAG) == 0;
return false;
return (MIPSGetInfo(op) & OUT_FPUFLAG) == 0;
}
bool IsSyscall(u32 op)
@@ -190,8 +141,7 @@ namespace MIPSAnalyst
int rd = MIPS_GET_RD(op);
if (
((info & IN_RS) && (rs == reg)) ||
((info & IN_RS_SHIFT) && (rs == reg)) ||
((info & IN_RS) && !(info & IN_RS_ADDR) && (rs == reg)) ||
((info & IN_RT) && (rt == reg)))
{
if (regAnal[reg].firstRead == -1)
@@ -293,13 +243,7 @@ namespace MIPSAnalyst
u32 op = Memory::Read_Instruction(addr);
u32 info = MIPSGetInfo(op);
if (
((info & IN_RS) ||
(info & IN_RS_SHIFT) ||
(info & IN_RS_ADDR))
&&
(MIPS_GET_RS(op) == reg)
)
if ((info & IN_RS) && (MIPS_GET_RS(op) == reg))
return true;
if ((info & IN_RT) && (MIPS_GET_RT(op) == reg))
return true;
@@ -644,8 +588,12 @@ namespace MIPSAnalyst
info.dataSize = 2;
break;
case MEMTYPE_WORD:
case MEMTYPE_FLOAT:
info.dataSize = 4;
break;
case MEMTYPE_VQUAD:
info.dataSize = 16;
}
u32 rs = cpu->GetRegValue(0,MIPS_GET_RS(op));
+34 -4
View File
@@ -26,14 +26,16 @@ namespace MIPSCodeUtils
#define FULLOP_JR_RA 0x03e00008
#define OP_SYSCALL 0x0000000c
#define OP_SYSCALL_MASK 0xFC00003F
#define _RS ((op>>21) & 0x1F)
#define _RT ((op>>16) & 0x1F)
u32 GetJumpTarget(u32 addr)
{
u32 op = Memory::Read_Instruction(addr);
if (op)
{
u32 maskedOp = op & 0xFC000000;
if (maskedOp == 0x0C000000 || maskedOp == 0x08000000) //jal
u32 info = MIPSGetInfo(op);
if ((info & IS_JUMP) && (info & IN_IMM26))
{
u32 target = (addr & 0xF0000000) | ((op&0x03FFFFFF) << 2);
return target;
@@ -87,9 +89,37 @@ namespace MIPSCodeUtils
u32 info = MIPSGetInfo(op);
if (info & IS_CONDBRANCH)
{
//TODO: safer check
if ((op & 0xFFFF0000) == 0x10000000)
bool sure;
bool takeBranch;
switch (info & CONDTYPE_MASK)
{
case CONDTYPE_EQ:
sure = _RS == _RT;
takeBranch = true;
break;
case CONDTYPE_NE:
sure = _RS == _RT;
takeBranch = false;
break;
case CONDTYPE_LEZ:
case CONDTYPE_GEZ:
sure = _RS == 0;
takeBranch = true;
break;
case CONDTYPE_LTZ:
case CONDTYPE_GTZ:
sure = _RS == 0;
takeBranch = false;
break;
}
if (sure && takeBranch)
return addr + ((signed short)(op&0xFFFF)<<2);
else if (sure && !takeBranch)
return addr + 8;
else
return INVALIDTARGET;
}
+7 -6
View File
@@ -230,6 +230,7 @@ namespace MIPSInt
int imm = (signed short)(op&0xFFFF)<<2;
u32 addr = PC + imm + 4;
// x, y, z, w, any, all, (invalid), (invalid)
int imm3 = (op>>18)&7;
int val = (currentMIPS->vfpuCtrl[VFPU_CTRL_CC] >> imm3) & 1;
@@ -290,7 +291,7 @@ namespace MIPSInt
_dbg_assert_msg_(CPU,0,"Jump in delay slot :(");
}
int rs = (op>>21)&0x1f;
int rs = _RS;
u32 addr = R(rs);
switch (op & 0x3f)
{
@@ -339,10 +340,10 @@ namespace MIPSInt
void Int_StoreSync(u32 op)
{
s32 imm = (signed short)(op&0xFFFF);
int base = ((op >> 21) & 0x1f);
int rt = (op >> 16) & 0x1f;
u32 addr = R(base) + imm;
int imm = (signed short)(op&0xFFFF);
int rt = _RT;
int rs = _RS;
u32 addr = R(rs) + imm;
switch (op >> 26)
{
@@ -946,7 +947,7 @@ namespace MIPSInt
{
case 0:
if (!reported) {
Reporting::ReportMessage("INTERRUPT instruction hit");
Reporting::ReportMessage("INTERRUPT instruction hit (%08x) at %08x", op, currentMIPS->pc);
WARN_LOG(CPU,"Disable/Enable Interrupt CPU instruction");
reported = 1;
}
+41 -38
View File
@@ -215,31 +215,29 @@ namespace MIPSInt
switch (op >> 26)
{
case 53: //lvl.q/lvr.q
if (addr & 0x3)
{
_dbg_assert_msg_(CPU, 0, "Misaligned lvX.q");
}
if ((op&2) == 0)
{
// It's an LVL
float d[4];
ReadVector(d, V_Quad, vt);
int offset = (addr >> 2) & 3;
for (int i = 0; i < offset + 1; i++)
if (addr & 0x3)
{
d[3 - i] = Memory::Read_Float(addr - i * 4);
_dbg_assert_msg_(CPU, 0, "Misaligned lvX.q");
}
WriteVector(d, V_Quad, vt);
}
else
{
// It's an LVR
float d[4];
ReadVector(d, V_Quad, vt);
int offset = (addr >> 2) & 3;
for (int i = 0; i < (3 - offset) + 1; i++)
if ((op & 2) == 0)
{
d[i] = Memory::Read_Float(addr + 4 * i);
// It's an LVL
for (int i = 0; i < offset + 1; i++)
{
d[3 - i] = Memory::Read_Float(addr - 4 * i);
}
}
else
{
// It's an LVR
for (int i = 0; i < (3 - offset) + 1; i++)
{
d[i] = Memory::Read_Float(addr + 4 * i);
}
}
WriteVector(d, V_Quad, vt);
}
@@ -254,33 +252,32 @@ namespace MIPSInt
break;
case 61: // svl.q/svr.q
if (addr & 0x3)
{
_dbg_assert_msg_(CPU, 0, "Misaligned svX.q");
}
if ((op&2) == 0)
{
// It's an SVL
if (addr & 0x3)
{
_dbg_assert_msg_(CPU, 0, "Misaligned svX.q");
}
float d[4];
ReadVector(d, V_Quad, vt);
int offset = (addr >> 2) & 3;
for (int i = 0; i < offset + 1; i++)
if ((op&2) == 0)
{
Memory::Write_Float(d[3 - i], addr - i * 4);
// It's an SVL
for (int i = 0; i < offset + 1; i++)
{
Memory::Write_Float(d[3 - i], addr - i * 4);
}
}
}
else
{
// It's an SVR
float d[4];
ReadVector(d, V_Quad, vt);
int offset = (addr >> 2) & 3;
for (int i = 0; i < (3 - offset) + 1; i++)
else
{
Memory::Write_Float(d[i], addr + 4 * i);
// It's an SVR
for (int i = 0; i < (3 - offset) + 1; i++)
{
Memory::Write_Float(d[i], addr + 4 * i);
}
}
break;
}
break;
case 62: //sv.q
if (addr & 0xF)
@@ -331,6 +328,8 @@ namespace MIPSInt
case 7: m=one; break; // vmone
default:
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
PC += 4;
EatPrefixes();
return;
}
@@ -353,6 +352,8 @@ namespace MIPSInt
case 7: v=ones; break; //vone
default:
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
PC += 4;
EatPrefixes();
return;
}
float o[4];
@@ -1258,7 +1259,7 @@ namespace MIPSInt
case 1: d[i] = (float)currentMIPS->rng.R32(); break; // vrndi - TODO: copy bits instead?
case 2: d[i] = 1.0f + ((float)currentMIPS->rng.R32() / 0xFFFFFFFF); break; // vrndf1 TODO: make more accurate
case 3: d[i] = 2.0f + 2 * ((float)currentMIPS->rng.R32() / 0xFFFFFFFF); break; // vrndf2 TODO: make more accurate
case 4: d[i] = 0.0f; // Should not get here
default: _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
}
}
ApplyPrefixD(d, sz);
@@ -1354,7 +1355,7 @@ namespace MIPSInt
{
s32 imm = (signed short)(op&0xFFFC);
int vt = ((op >> 16) & 0x1f) | ((op & 3) << 5);
int rs = (op >> 21) & 0x1f;
int rs = _RS;
u32 addr = R(rs) + imm;
switch (op >> 26)
@@ -1532,6 +1533,8 @@ namespace MIPSInt
break;
default:
_dbg_assert_msg_(CPU,0,"unknown min/max op %d", cond);
PC += 4;
EatPrefixes();
return;
}
ApplyPrefixD(d, sz);
+588 -531
View File
File diff suppressed because it is too large. Load diff
+6 -4
View File
@@ -30,10 +30,12 @@
// as long as the other flags are checked,
// there is no way to misinterprete these
// as CONDTYPE_X
#define MEMTYPE_MASK 0x00000003
#define MEMTYPE_MASK 0x00000007
#define MEMTYPE_BYTE 0x00000001
#define MEMTYPE_HWORD 0x00000002
#define MEMTYPE_WORD 0x00000003
#define MEMTYPE_FLOAT 0x00000004
#define MEMTYPE_VQUAD 0x00000005
#define IS_CONDMOVE 0x00000008
#define DELAYSLOT 0x00000010
@@ -43,9 +45,9 @@
#define IS_CONDBRANCH 0x00000100
#define IS_JUMP 0x00000200
#define IN_RS_SHIFT 0x00000400
#define IN_RS_ADDR 0x00000800
#define IN_RS 0x00001000
#define IN_RS 0x00000400
#define IN_RS_ADDR (0x00000800 | IN_RS)
#define IN_RS_SHIFT (0x00001000 | IN_RS)
#define IN_RT 0x00002000
#define IN_SA 0x00004000
#define IN_IMM16 0x00008000
+69
View File
@@ -272,6 +272,73 @@ void Jit::Comp_SVQ(u32 op)
switch (op >> 26)
{
case 53: //lvl.q/lvr.q
{
if (!g_Config.bFastMemory) {
DISABLE;
}
DISABLE;
gpr.BindToRegister(rs, true, true);
gpr.FlushLockX(ECX);
u8 vregs[4];
GetVectorRegs(vregs, V_Quad, vt);
MOV(32, R(EAX), gpr.R(rs));
ADD(32, R(EAX), Imm32(imm));
#ifdef _M_IX86
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
#endif
MOV(32, R(ECX), R(EAX));
SHR(32, R(EAX), Imm8(2));
AND(32, R(EAX), Imm32(0x3));
CMP(32, R(EAX), Imm32(0));
FixupBranch next = J_CC(CC_NE);
fpr.MapRegsV(vregs, V_Quad, MAP_DIRTY);
// Offset = 0
MOVSS(fpr.RX(vregs[3]), MRegSum(RBX, RAX));
FixupBranch skip0 = J();
SetJumpTarget(next);
CMP(32, R(EAX), Imm32(1));
next = J_CC(CC_NE);
// Offset = 1
MOVSS(fpr.RX(vregs[3]), MComplex(RBX, RAX, 1, 4));
MOVSS(fpr.RX(vregs[2]), MComplex(RBX, RAX, 1, 0));
FixupBranch skip1 = J();
SetJumpTarget(next);
CMP(32, R(EAX), Imm32(2));
next = J_CC(CC_NE);
// Offset = 2
MOVSS(fpr.RX(vregs[3]), MComplex(RBX, RAX, 1, 8));
MOVSS(fpr.RX(vregs[2]), MComplex(RBX, RAX, 1, 4));
MOVSS(fpr.RX(vregs[1]), MComplex(RBX, RAX, 1, 0));
FixupBranch skip2 = J();
SetJumpTarget(next);
CMP(32, R(EAX), Imm32(3));
next = J_CC(CC_NE);
// Offset = 3
MOVSS(fpr.RX(vregs[3]), MComplex(RBX, RAX, 1, 12));
MOVSS(fpr.RX(vregs[2]), MComplex(RBX, RAX, 1, 8));
MOVSS(fpr.RX(vregs[1]), MComplex(RBX, RAX, 1, 4));
MOVSS(fpr.RX(vregs[0]), MComplex(RBX, RAX, 1, 0));
SetJumpTarget(next);
SetJumpTarget(skip0);
SetJumpTarget(skip1);
SetJumpTarget(skip2);
gpr.UnlockAll();
fpr.ReleaseSpillLocks();
}
break;
case 54: //lv.q
{
gpr.BindToRegister(rs, true, true);
@@ -337,6 +404,8 @@ void Jit::Comp_SVQ(u32 op)
}
break;
default:
DISABLE;
break;
+3 -2
View File
@@ -22,6 +22,7 @@
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/MIPSCodeUtils.h"
#include "Core/MIPS/MIPSInt.h"
@@ -338,7 +339,7 @@ void Jit::Comp_Generic(u32 op)
ABI_CallFunctionC((void *)func, op);
}
else
_dbg_assert_msg_(JIT, 0, "Trying to compile instruction that can't be interpreted");
ERROR_LOG_REPORT(JIT, "Trying to compile instruction that can't be interpreted");
const int info = MIPSGetInfo(op);
if ((info & IS_VFPU) != 0 && (info & VFPU_NO_PREFIX) == 0)
@@ -352,7 +353,7 @@ void Jit::Comp_Generic(u32 op)
void Jit::WriteExit(u32 destination, int exit_num)
{
if (!Memory::IsValidAddress(destination)) {
ERROR_LOG(JIT, "Trying to write block exit to illegal destination %08x: pc = %08x", destination, currentMIPS->pc);
ERROR_LOG_REPORT(JIT, "Trying to write block exit to illegal destination %08x: pc = %08x", destination, currentMIPS->pc);
}
// If we need to verify coreState and rewind, we may not jump yet.
if (js.afterOp & (JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE))
-10
View File
@@ -165,16 +165,6 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
}
}
void Memcpy(const u32 to_address, const void *from_data, const u32 len)
{
memcpy(GetPointer(to_address), from_data, len);
}
void Memcpy(void *to_data, const u32 from_address, const u32 len)
{
memcpy(to_data,GetPointer(from_address),len);
}
void GetString(std::string& _string, const u32 em_address)
{
char stringBuffer[2048];
+31 -2
View File
@@ -117,6 +117,13 @@ u64 Read_U64(const u32 _Address);
#define _M_ARM
#endif
inline u8* GetPointerUnchecked(const u32 address) {
#if defined(_M_IX86) || defined(_M_ARM32)
return (u8 *)(base + (address & MEMVIEW32_MASK));
#else
return (u8 *)(base + address);
#endif
}
#ifdef SAFE_MEMORY
u32 ReadUnchecked_U32(const u32 _Address);
@@ -212,8 +219,30 @@ inline const char* GetCharPointer(const u32 address) {
}
void Memset(const u32 _Address, const u8 _Data, const u32 _iLength);
void Memcpy(const u32 to_address, const void *from_data, const u32 len);
void Memcpy(void *to_data, const u32 from_address, const u32 len);
inline void Memcpy(const u32 to_address, const void *from_data, const u32 len)
{
u8 *to = GetPointer(to_address);
if (to) {
memcpy(to, from_data, len);
}
// if not, GetPointer will log.
}
inline void Memcpy(void *to_data, const u32 from_address, const u32 len)
{
const u8 *from = GetPointer(from_address);
if (from) {
memcpy(to_data, from, len);
}
// if not, GetPointer will log.
}
inline void MemcpyUnchecked(void *to_data, const u32 from_address, const u32 len)
{
memcpy(to_data, GetPointerUnchecked(from_address), len);
}
template<class T>
void ReadStruct(u32 address, T *ptr)
+2 -2
View File
@@ -20,6 +20,7 @@
#endif
#include "native/thread/thread.h"
#include "native/thread/threadutil.h"
#include "native/base/mutex.h"
#include "Core/MemMap.h"
@@ -42,7 +43,6 @@
#include "Core/PSPLoaders.h"
#include "Core/ELF/ParamSFO.h"
#include "Core/SaveState.h"
#include "Common/Thread.h"
#include "Common/LogManager.h"
#include "GPU/GPUState.h"
@@ -196,7 +196,7 @@ void CPU_Shutdown() {
}
void CPU_RunLoop() {
Common::SetCurrentThreadName("CPUThread");
setCurrentThreadName("CPUThread");
if (!CPU_NextState(CPU_THREAD_PENDING, CPU_THREAD_STARTING)) {
ERROR_LOG(CPU, "CPU thread in unexpected state: %d", cpuThreadState);
return;
+3 -1
View File
@@ -18,6 +18,7 @@
#pragma once
#include "native/base/mutex.h"
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include <deque>
@@ -74,7 +75,7 @@ struct ThreadEventQueue : public B {
}
// Quit the loop if the queue is drained and coreState has tripped, or threading is disabled.
if (coreState != CORE_RUNNING || !threadEnabled_) {
if (ShouldExitEventLoop() || !threadEnabled_) {
return;
}
@@ -104,6 +105,7 @@ struct ThreadEventQueue : public B {
protected:
virtual void ProcessEvent(Event ev) = 0;
virtual bool ShouldExitEventLoop() = 0;
private:
bool threadEnabled_;
+5 -10
View File
@@ -921,7 +921,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
shaderManager_->DirtyUniform(DIRTY_WORLDMATRIX);
}
num++;
gstate.worldmtxnum = (gstate.worldmtxnum & 0xFF000000) | (num & 0xF);
gstate.worldmtxnum = (GE_CMD_WORLDMATRIXNUMBER << 24) | (num & 0xF);
}
break;
@@ -939,7 +939,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
shaderManager_->DirtyUniform(DIRTY_VIEWMATRIX);
}
num++;
gstate.viewmtxnum = (gstate.viewmtxnum & 0xFF000000) | (num & 0xF);
gstate.viewmtxnum = (GE_CMD_VIEWMATRIXNUMBER << 24) | (num & 0xF);
}
break;
@@ -957,7 +957,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
shaderManager_->DirtyUniform(DIRTY_PROJMATRIX | DIRTY_PROJTHROUGHMATRIX);
}
num++;
gstate.projmtxnum = (gstate.projmtxnum & 0xFF000000) | (num & 0xF);
gstate.projmtxnum = (GE_CMD_PROJMATRIXNUMBER << 24) | (num & 0xF);
}
break;
@@ -975,7 +975,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
shaderManager_->DirtyUniform(DIRTY_TEXMATRIX);
}
num++;
gstate.texmtxnum = (gstate.texmtxnum & 0xFF000000) | (num & 0xF);
gstate.texmtxnum = (GE_CMD_TGENMATRIXNUMBER << 24) | (num & 0xF);
}
break;
@@ -993,7 +993,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
shaderManager_->DirtyUniform(DIRTY_BONEMATRIX0 << (num / 12));
}
num++;
gstate.boneMatrixNumber = (gstate.boneMatrixNumber & 0xFF000000) | (num & 0x7F);
gstate.boneMatrixNumber = (GE_CMD_BONEMATRIXNUMBER << 24) | (num & 0x7F);
}
break;
@@ -1120,11 +1120,6 @@ void GLES_GPU::ClearCacheNextFrame() {
textureCache_.ClearNextFrame();
}
inline void GLES_GPU::Flush() {
transformDraw_.Flush();
}
void GLES_GPU::Resized() {
framebufferManager_.Resized();
}
+3 -1
View File
@@ -69,7 +69,9 @@ protected:
virtual void ProcessEvent(GPUEvent ev);
private:
void Flush();
void Flush() {
transformDraw_.Flush();
}
void DoBlockTransfer();
void ApplyDrawState(int prim);
void CheckFlushOp(int cmd, u32 diff);
+3 -2
View File
@@ -392,8 +392,9 @@ void GuessDrawingSize(int &drawing_width, int &drawing_height) {
int fb_stride = gstate.fbwidth & 0x3C0;
GetViewportDimensions(viewport_width, viewport_height);
// Generated FBO shouldn't greate than 512x512
if ( viewport_width > 512 && viewport_height > 512 ) {
// Generated FBO shouldn't greate than 512x512
// Some games like FF Type-0 inits viewport as 0x0
if ( viewport_width > 512 && viewport_height > 512 || viewport_width <= 1 && viewport_height <= 1 ) {
viewport_width = default_width;
viewport_height = default_height;
}
+2 -6
View File
@@ -253,10 +253,6 @@ void TextureCache::NotifyFramebuffer(u32 address, VirtualFramebuffer *framebuffe
}
}
static u32 GetClutAddr() {
return ((gstate.clutaddr & 0xFFFFFF) | ((gstate.clutaddrupper << 8) & 0x0F000000));
}
static u32 GetClutIndex(u32 index) {
const u32 clutBase = gstate.getClutIndexStartPos();
const u32 clutMask = gstate.getClutIndexMask();
@@ -876,10 +872,10 @@ inline bool TextureCache::TexCacheEntry::Matches(u16 dim2, u8 format2, int maxLe
}
void TextureCache::LoadClut() {
u32 clutAddr = GetClutAddr();
u32 clutAddr = ((gstate.clutaddr & 0xFFFFFF) | ((gstate.clutaddrupper << 8) & 0x0F000000));
clutTotalBytes_ = (gstate.loadclut & 0x3f) * 32;
if (Memory::IsValidAddress(clutAddr)) {
Memory::Memcpy(clutBufRaw_, clutAddr, clutTotalBytes_);
Memory::MemcpyUnchecked(clutBufRaw_, clutAddr, clutTotalBytes_);
} else {
memset(clutBufRaw_, 0xFF, clutTotalBytes_);
}
+1 -4
View File
@@ -1109,10 +1109,7 @@ VertexArrayInfo::~VertexArrayInfo() {
glDeleteBuffers(1, &ebo);
}
void TransformDrawEngine::Flush() {
if (!numDrawCalls)
return;
void TransformDrawEngine::DoFlush() {
gpuStats.numFlushes++;
gpuStats.numTrackedVertexArrays = (int)vai_.size();
+8 -1
View File
@@ -100,7 +100,6 @@ public:
void DrawBezier(int ucount, int vcount);
void DrawSpline(int ucount, int vcount, int utype, int vtype);
void DecodeVerts();
void Flush();
void SetShaderManager(ShaderManager *shaderManager) {
shaderManager_ = shaderManager;
}
@@ -122,7 +121,15 @@ public:
// This requires a SetupVertexDecoder call first.
int EstimatePerVertexCost();
// So that this can be inlined
void Flush() {
if (!numDrawCalls)
return;
DoFlush();
}
private:
void DoFlush();
void SoftwareTransformAndDraw(int prim, u8 *decoded, LinkedShader *program, int vertexCount, u32 vertexType, void *inds, int indexType, const DecVtxFormat &decVtxFormat, int maxIndex);
void ApplyDrawState(int prim);
bool IsReallyAClear(int numVerts) const;
+6 -1
View File
@@ -20,7 +20,8 @@ GPUCommon::GPUCommon() :
busyTicks(0),
dumpNextFrame_(false),
dumpThisFrame_(false),
interruptsEnabled_(true)
interruptsEnabled_(true),
curTickEst_(0)
{
memset(dls, 0, sizeof(dls));
for (int i = 0; i < DisplayListMaxCount; ++i) {
@@ -579,6 +580,7 @@ bool GPUCommon::ProcessDLQueue() {
void GPUCommon::ProcessDLQueueInternal() {
startingTicks = CoreTiming::GetTicks();
cyclesExecuted = 0;
UpdateTickEstimate(std::max(busyTicks, startingTicks + cyclesExecuted));
if (startingTicks < busyTicks) {
DEBUG_LOG(HLE, "Can't execute a list yet, still busy for %lld ticks", busyTicks - startingTicks);
@@ -594,6 +596,7 @@ void GPUCommon::ProcessDLQueueInternal() {
easy_guard guard(listLock);
// At the end, we can remove it from the queue and continue.
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
UpdateTickEstimate(std::max(busyTicks, startingTicks + cyclesExecuted));
}
}
@@ -603,6 +606,8 @@ void GPUCommon::ProcessDLQueueInternal() {
drawCompleteTicks = startingTicks + cyclesExecuted;
busyTicks = std::max(busyTicks, drawCompleteTicks);
__GeTriggerSync(WAITTYPE_GEDRAWSYNC, 1, drawCompleteTicks);
// Since the event is in CoreTiming, we're in sync. Just set 0 now.
UpdateTickEstimate(0);
}
void GPUCommon::PreExecuteOp(u32 op, u32 diff) {
+17
View File
@@ -36,6 +36,11 @@ public:
virtual u32 Break(int mode);
virtual void ReapplyGfxState();
virtual u64 GetTickEstimate() {
lock_guard guard(curTickEstLock_);
return curTickEst_;
}
protected:
// To avoid virtual calls to PreExecuteOp().
virtual void FastRunLoop(DisplayList &list) = 0;
@@ -48,6 +53,9 @@ protected:
void ProcessDLQueueInternal();
void ReapplyGfxStateInternal();
virtual void ProcessEvent(GPUEvent ev);
virtual bool ShouldExitEventLoop() {
return coreState != CORE_RUNNING;
}
// Allows early unlocking with a guard. Do not double unlock.
class easy_guard {
@@ -83,6 +91,15 @@ protected:
bool dumpThisFrame_;
bool interruptsEnabled_;
// For CPU/GPU sync.
volatile u64 curTickEst_;
recursive_mutex curTickEstLock_;
virtual void UpdateTickEstimate(u64 value) {
lock_guard guard(curTickEstLock_);
curTickEst_ = value;
}
public:
virtual DisplayList* getList(int listid)
{
+1
View File
@@ -224,6 +224,7 @@ public:
virtual void DeviceLost() = 0;
virtual void ReapplyGfxState() = 0;
virtual void SyncThread() = 0;
virtual u64 GetTickEstimate() = 0;
virtual void DoState(PointerWrap &p) = 0;
// Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*.
+3 -2
View File
@@ -100,6 +100,7 @@ void GameScreen::DrawBackground(UIContext &dc) {
void GameScreen::update(InputState &input) {
UIScreen::update(input);
I18NCategory *g = GetI18NCategory("General");
GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, true);
if (tvTitle_)
@@ -112,9 +113,9 @@ void GameScreen::update(InputState &input) {
if (info->gameSize) {
char temp[256];
sprintf(temp, "Game: %1.1f MB", (float)(info->gameSize) / 1024.f / 1024.f);
sprintf(temp, "%s: %1.1f %s", g->T("Game"), (float) (info->gameSize) / 1024.f / 1024.f, g->T("MB"));
tvGameSize_->SetText(temp);
sprintf(temp, "SaveData: %1.2f MB", (float)(info->saveDataSize) / 1024.f / 1024.f);
sprintf(temp, "%s: %1.2f %s", g->T("SaveData"), (float) (info->saveDataSize) / 1024.f / 1024.f, g->T("MB"));
tvSaveDataSize_->SetText(temp);
}
}
+5 -4
View File
@@ -179,6 +179,7 @@ void GameSettingsScreen::CreateViews() {
I18NCategory *c = GetI18NCategory("Controls");
I18NCategory *a = GetI18NCategory("Audio");
I18NCategory *s = GetI18NCategory("System");
I18NCategory *ms = GetI18NCategory("MainSettings");
Margins actionMenuMargins(0, 0, 15, 0);
@@ -200,7 +201,7 @@ void GameSettingsScreen::CreateViews() {
ViewGroup *graphicsSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *graphicsSettings = new LinearLayout(ORIENT_VERTICAL);
graphicsSettingsScroll->Add(graphicsSettings);
tabHolder->AddTab("Graphics", graphicsSettingsScroll);
tabHolder->AddTab(ms->T("Graphics"), graphicsSettingsScroll);
graphicsSettings->Add(new ItemHeader(gs->T("Rendering Mode")));
#ifndef USING_GLES2
@@ -250,7 +251,7 @@ void GameSettingsScreen::CreateViews() {
ViewGroup *audioSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *audioSettings = new LinearLayout(ORIENT_VERTICAL);
audioSettingsScroll->Add(audioSettings);
tabHolder->AddTab("Audio", audioSettingsScroll);
tabHolder->AddTab(ms->T("Audio"), audioSettingsScroll);
std::string atracString;
atracString.assign(Atrac3plus_Decoder::IsInstalled() ? "Redownload Atrac3+ plugin" : "Download Atrac3+ plugin");
@@ -265,7 +266,7 @@ void GameSettingsScreen::CreateViews() {
ViewGroup *controlsSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *controlsSettings = new LinearLayout(ORIENT_VERTICAL);
controlsSettingsScroll->Add(controlsSettings);
tabHolder->AddTab("Controls", controlsSettingsScroll);
tabHolder->AddTab(ms->T("Controls"), controlsSettingsScroll);
controlsSettings->Add(new CheckBox(&g_Config.bShowTouchControls, c->T("OnScreen", "On-Screen Touch Controls")));
controlsSettings->Add(new CheckBox(&g_Config.bShowAnalogStick, c->T("Show Left Analog Stick")));
controlsSettings->Add(new CheckBox(&g_Config.bAccelerometerToAnalogHoriz, c->T("Tilt", "Tilt to Analog (horizontal)")));
@@ -276,7 +277,7 @@ void GameSettingsScreen::CreateViews() {
ViewGroup *systemSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *systemSettings = new LinearLayout(ORIENT_VERTICAL);
systemSettingsScroll->Add(systemSettings);
tabHolder->AddTab("System", systemSettingsScroll);
tabHolder->AddTab(ms->T("System"), systemSettingsScroll);
systemSettings->Add(new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)")));
systemSettings->Add(new CheckBox(&g_Config.bSeparateCPUThread, s->T("Multithreaded (experimental)")));
systemSettings->Add(new CheckBox(&g_Config.bFastMemory, s->T("Fast Memory", "Fast Memory (Unstable)")));
+19 -14
View File
@@ -35,6 +35,7 @@
#include "UI/ui_atlas.h"
#include "Core/Config.h"
#include "GPU/GPUInterface.h"
#include "i18n/i18n.h"
#ifdef _WIN32
namespace MainWindow {
@@ -338,6 +339,8 @@ void MainScreen::CreateViews() {
// Scrolling action menu to the right.
using namespace UI;
I18NCategory *m = GetI18NCategory("MainMenu");
Margins actionMenuMargins(0, 100, 15, 0);
root_ = new LinearLayout(ORIENT_HORIZONTAL);
@@ -357,9 +360,9 @@ void MainScreen::CreateViews() {
scrollAllGames->Add(tabAllGames);
scrollHomebrew->Add(tabHomebrew);
leftColumn->AddTab("Recent", scrollRecentGames);
leftColumn->AddTab("Games", scrollAllGames);
leftColumn->AddTab("Homebrew & Demos", scrollHomebrew);
leftColumn->AddTab(m->T("Recent"), scrollRecentGames);
leftColumn->AddTab(m->T("Games"), scrollAllGames);
leftColumn->AddTab(m->T("Homebrew & Demos"), scrollHomebrew);
tabRecentGames->OnChoice.Handle(this, &MainScreen::OnGameSelected);
tabAllGames->OnChoice.Handle(this, &MainScreen::OnGameSelected);
@@ -384,12 +387,12 @@ void MainScreen::CreateViews() {
rightColumn->Add(rightColumnItems);
#ifdef _WIN32
rightColumnItems->Add(new Choice("Load..."))->OnClick.Handle(this, &MainScreen::OnLoadFile);
rightColumnItems->Add(new Choice(m->T("Load","Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile);
#endif
rightColumnItems->Add(new Choice("Settings"))->OnClick.Handle(this, &MainScreen::OnSettings);
rightColumnItems->Add(new Choice("Exit"))->OnClick.Handle(this, &MainScreen::OnExit);
rightColumnItems->Add(new Choice("Credits"))->OnClick.Handle(this, &MainScreen::OnCredits);
rightColumnItems->Add(new Choice("Support PPSSPP"))->OnClick.Handle(this, &MainScreen::OnSupport);
rightColumnItems->Add(new Choice(m->T("Settings")))->OnClick.Handle(this, &MainScreen::OnSettings);
rightColumnItems->Add(new Choice(m->T("Exit")))->OnClick.Handle(this, &MainScreen::OnExit);
rightColumnItems->Add(new Choice(m->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
rightColumnItems->Add(new Choice(m->T("Support PPSSPP")))->OnClick.Handle(this, &MainScreen::OnSupport);
}
void MainScreen::sendMessage(const char *message, const char *value) {
@@ -479,6 +482,8 @@ GamePauseScreen::~GamePauseScreen() {
void GamePauseScreen::CreateViews() {
using namespace UI;
Margins actionMenuMargins(0, 100, 15, 0);
I18NCategory *gs = GetI18NCategory("Graphics");
I18NCategory *i = GetI18NCategory("Pause");
root_ = new LinearLayout(ORIENT_HORIZONTAL);
@@ -497,8 +502,8 @@ void GamePauseScreen::CreateViews() {
saveSlots_->AddChoice("4");
saveSlots_->SetSelection(g_Config.iCurrentStateSlot);
leftColumnItems->Add(new Choice("Save State"))->OnClick.Handle(this, &GamePauseScreen::OnSaveState);
leftColumnItems->Add(new Choice("Load State"))->OnClick.Handle(this, &GamePauseScreen::OnLoadState);
leftColumnItems->Add(new Choice(gs->T("Save State")))->OnClick.Handle(this, &GamePauseScreen::OnSaveState);
leftColumnItems->Add(new Choice(gs->T("Load State")))->OnClick.Handle(this, &GamePauseScreen::OnLoadState);
ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
root_->Add(rightColumn);
@@ -506,10 +511,10 @@ void GamePauseScreen::CreateViews() {
ViewGroup *rightColumnItems = new LinearLayout(ORIENT_VERTICAL);
rightColumn->Add(rightColumnItems);
rightColumnItems->Add(new Choice("Continue"))->OnClick.Handle(this, &GamePauseScreen::OnContinue);
rightColumnItems->Add(new Choice("Game Settings"))->OnClick.Handle(this, &GamePauseScreen::OnGameSettings);
rightColumnItems->Add(new Choice("Main Settings"))->OnClick.Handle(this, &GamePauseScreen::OnMainSettings);
rightColumnItems->Add(new Choice("Exit to menu"))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
rightColumnItems->Add(new Choice(i->T("Continue")))->OnClick.Handle(this, &GamePauseScreen::OnContinue);
rightColumnItems->Add(new Choice(i->T("Game Settings")))->OnClick.Handle(this, &GamePauseScreen::OnGameSettings);
rightColumnItems->Add(new Choice(i->T("Main Settings")))->OnClick.Handle(this, &GamePauseScreen::OnMainSettings);
rightColumnItems->Add(new Choice(i->T("Exit to menu")))->OnClick.Handle(this, &GamePauseScreen::OnExitToMenu);
}
UI::EventReturn GamePauseScreen::OnMainSettings(UI::EventParams &e) {
+5 -3
View File
@@ -253,6 +253,7 @@ void MenuScreen::render() {
VLinear vlinear(dp_xres + xoff, 100, 20);
I18NCategory *m = GetI18NCategory("MainMenu");
I18NCategory *p = GetI18NCategory("Plugin");
if (UIButton(GEN_ID, vlinear, w, 0, m->T("Load", "Load..."), ALIGN_RIGHT)) {
#if defined(USING_QT_UI) && !defined(MEEGO_EDITION_HARMATTAN)
@@ -312,7 +313,7 @@ void MenuScreen::render() {
}
if (showAtracShortcut_) {
if (UIButton(GEN_ID, Pos(10,dp_yres - 10), 500, 50, "Download audio plugin", ALIGN_BOTTOMLEFT)) {
if (UIButton(GEN_ID, Pos(10, dp_yres - 10), 500, 50, p->T("Download audio plugin"), ALIGN_BOTTOMLEFT)) {
screenManager()->push(new PluginScreen());
}
}
@@ -844,6 +845,7 @@ void AudioScreen::render() {
I18NCategory *g = GetI18NCategory("General");
I18NCategory *a = GetI18NCategory("Audio");
I18NCategory *p = GetI18NCategory("Plugin");
ui_draw2d.SetFontScale(1.5f, 1.5f);
ui_draw2d.DrawTextShadow(UBUNTU24, a->T("Audio Settings"), dp_xres / 2, 10, 0xFFFFFFFF, ALIGN_HCENTER);
@@ -866,7 +868,7 @@ void AudioScreen::render() {
// Show the download button even if not installed - might want to upgrade.
VLinear vlinear(30, 400, 20);
std::string atracString;
atracString.assign(Atrac3plus_Decoder::IsInstalled() ? "Redownload Atrac3+ plugin" : "Download Atrac3+ plugin");
atracString.assign(Atrac3plus_Decoder::IsInstalled() ? p->T("Redownload Atrac3+ plugin") : p->T("Download Atrac3+ plugin"));
if (UIButton(GEN_ID, vlinear, 400, 0, a->T(atracString.c_str()), ALIGN_LEFT)) {
screenManager()->push(new PluginScreen());
}
@@ -1544,7 +1546,7 @@ void SystemScreen::render() {
char nickname[512];
memset(nickname, 0, sizeof(nickname));
sprintf(nickname, "%s %s", s->T("System Nickname: "), g_Config.sNickName.c_str());
sprintf(nickname, "%s %s", s->T("System Nickname:"), g_Config.sNickName.c_str());
ui_draw2d.DrawTextShadow(UBUNTU24, nickname, x, y += stride, 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinearNick(x + 400, y, 10);
+1 -1
View File
@@ -48,7 +48,7 @@ void PluginScreen::CreateViews() {
Margins textMargins(20,17);
Margins buttonMargins(10,10);
root_->Add(new TextView(UBUNTU24, "Atrac3+ Audio Support", ALIGN_HCENTER, 1.5f, new LinearLayoutParams(textMargins)));
root_->Add(new TextView(UBUNTU24, p->T("Atrac3+ Audio Support"), ALIGN_HCENTER, 1.5f, new LinearLayoutParams(textMargins)));
ViewGroup *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
LinearLayout *scrollContents = new LinearLayout(ORIENT_VERTICAL);
+4
View File
@@ -847,6 +847,7 @@ void CtrlDisAsmView::updateStatusBarText()
sprintf(text,"[%08X] = %04X",info.dataAddress,Memory::Read_U16(info.dataAddress));
break;
case 4:
// TODO: Could also be a float...
{
u32 data = Memory::Read_U32(info.dataAddress);
const char* addressSymbol = debugger->findSymbolForAddress(data);
@@ -858,6 +859,9 @@ void CtrlDisAsmView::updateStatusBarText()
}
break;
}
case 16:
// TODO: vector
break;
}
}
}
+1
View File
@@ -186,6 +186,7 @@ LOCAL_SRC_FILES := \
$(SRC)/Core/ELF/PrxDecrypter.cpp \
$(SRC)/Core/ELF/ParamSFO.cpp \
$(SRC)/Core/HW/atrac3plus.cpp \
$(SRC)/Core/HW/AsyncIOManager.cpp \
$(SRC)/Core/HW/MemoryStick.cpp \
$(SRC)/Core/HW/MpegDemux.cpp.arm \
$(SRC)/Core/HW/OMAConvert.cpp.arm \
+1 -1
Submodule lang updated: 7c2893ed0c...12a1a4ed1d.
+1 -1
Submodule native updated: 0c8692bc44...549ef026fe.