Merge branch 'master' into TemporaryHackishBranch

This commit is contained in:
LunaMoo committed 2017-12-10 06:25:18 +01:00
commit a2e784f185
15 files changed
+91 -6

No files matched your search

+1 -1
View File
@@ -1979,7 +1979,7 @@ void ARM64XEmitter::MOVI2R(ARM64Reg Rd, u64 imm, bool optimize)
u64 aligned_pc = (u64)GetCodePointer() & ~0xFFF;
s64 aligned_offset = (s64)imm - (s64)aligned_pc;
if (Count(upload_part) > 1 && abs64(aligned_offset) < 0xFFFFFFFFLL)
if (Count(upload_part) > 1 && abs64(aligned_offset) < 0x7FFFFFFFLL)
{
// Immediate we are loading is within 4GB of our aligned range
// Most likely a address that we can load in one or two instructions
+1
View File
@@ -63,6 +63,7 @@ public:
virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title) {return false;}
virtual void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) {}
virtual void SendUIMessage(const std::string &message, const std::string &value) {}
// Used for headless.
virtual bool ShouldSkipUI() { return false; }
+1
View File
@@ -248,6 +248,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {
//in case we didn't go through EmuScreen::boot
g_Config.loadGameConfig(id);
host->SendUIMessage("config_loaded", "");
INFO_LOG(LOADER,"Loading %s...", bootpath.c_str());
return __KernelLoadExec(bootpath.c_str(), 0, error_string);
}
+3
View File
@@ -328,6 +328,9 @@ void TextureCacheCommon::SetTexture(bool force) {
TexCache::iterator iter = cache_.find(cachekey);
TexCacheEntry *entry = nullptr;
// Note: It's necessary to reset needshadertexclamp, for otherwise DIRTY_TEXCLAMP won't get set later.
// Should probably revisit how this works..
gstate_c.SetNeedShaderTexclamp(false);
gstate_c.skipDrawReason &= ~SKIPDRAW_BAD_FB_TEXTURE;
if (gstate_c.bgraTexture != isBgraBackend_) {
+8
View File
@@ -156,6 +156,14 @@ void DrawEngineGLES::RestoreVAO() {
}
}
void DrawEngineGLES::DeviceLost() {
DestroyDeviceObjects();
}
void DrawEngineGLES::DeviceRestore() {
InitDeviceObjects();
}
void DrawEngineGLES::InitDeviceObjects() {
if (bufferNameCache_.empty()) {
bufferNameCache_.resize(VERTEXCACHE_NAME_CACHE_SIZE);
+6 -2
View File
@@ -119,8 +119,9 @@ public:
fragmentTestCache_ = testCache;
}
void RestoreVAO();
void InitDeviceObjects();
void DestroyDeviceObjects();
void DeviceLost();
void DeviceRestore();
void ClearTrackedVertexArrays() override;
void DecimateTrackedVertexArrays();
@@ -151,6 +152,9 @@ public:
void DecimateBuffers();
private:
void InitDeviceObjects();
void DestroyDeviceObjects();
void DoFlush();
void ApplyDrawState(int prim);
void ApplyDrawStateLate();
+2 -1
View File
@@ -391,7 +391,7 @@ void GPU_GLES::DeviceLost() {
textureCacheGL_->Clear(false);
fragmentTestCache_.Clear(false);
depalShaderCache_.Clear();
drawEngine_.ClearTrackedVertexArrays();
drawEngine_.DeviceLost();
framebufferManagerGL_->DeviceLost();
}
@@ -404,6 +404,7 @@ void GPU_GLES::DeviceRestore() {
textureCacheGL_->DeviceRestore(draw_);
framebufferManagerGL_->DeviceRestore(draw_);
drawEngine_.DeviceRestore();
}
void GPU_GLES::Reinitialize() {
+1 -1
View File
@@ -948,7 +948,7 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
// TODO: We really, really should avoid calling glGetError.
GLenum err = glGetError();
if (err == GL_OUT_OF_MEMORY) {
WARN_LOG(G3D, "Texture cache ran out of GPU memory; switching to low memory mode");
WARN_LOG_REPORT(G3D, "Texture cache ran out of GPU memory; switching to low memory mode");
lowMemoryMode_ = true;
decimationCounter_ = 0;
Decimate();
+5 -1
View File
@@ -144,7 +144,6 @@ void EmuScreen::bootGame(const std::string &filename) {
return;
}
bootComplete();
RecreateViews();
}
return;
}
@@ -155,6 +154,8 @@ void EmuScreen::bootGame(const std::string &filename) {
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, filename, 0);
if (info && !info->id.empty()) {
g_Config.loadGameConfig(info->id);
// Reset views in case controls are in a different place.
RecreateViews();
}
invalid_ = true;
@@ -356,6 +357,9 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
bootPending_ = true;
gamePath_ = value;
}
} else if (!strcmp(message, "config_loaded")) {
// In case we need to position touch controls differently.
RecreateViews();
} else if (!strcmp(message, "control mapping") && screenManager()->topScreen() == this) {
UpdateUIState(UISTATE_MENU);
releaseButtons();
+8
View File
@@ -53,6 +53,10 @@ public:
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override {
osm.Show(message, duration, color, -1, true, id);
}
void SendUIMessage(const std::string &message, const std::string &value) override {
NativeMessageReceived(message.c_str(), value.c_str());
}
};
#if !defined(MOBILE_DEVICE) && defined(USING_QT_UI)
@@ -134,6 +138,10 @@ public:
osm.Show(message, duration, color, -1, true, id);
}
void SendUIMessage(const std::string &message, const std::string &value) override {
NativeMessageReceived(message.c_str(), value.c_str());
}
bool GPUDebuggingActive()
{
auto dialogDisplayList = mainWindow->GetDialogDisplaylist();
+4
View File
@@ -371,3 +371,7 @@ void WindowsHost::ToggleDebugConsoleVisibility() {
void WindowsHost::NotifyUserMessage(const std::string &message, float duration, u32 color, const char *id) {
osm.Show(message, duration, color, -1, true, id);
}
void WindowsHost::SendUIMessage(const std::string &message, const std::string &value) {
NativeMessageReceived(message.c_str(), value.c_str());
}
+1
View File
@@ -65,6 +65,7 @@ public:
bool CreateDesktopShortcut(std::string argumentPath, std::string title) override;
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override;
void SendUIMessage(const std::string &message, const std::string &value) override;
std::shared_ptr<KeyboardDevice> keyboard;
+40
View File
@@ -12,6 +12,46 @@ void Tween::Apply(View *view) {
DoApply(view, pos);
}
template <typename Value>
void TweenBase<Value>::PersistData(PersistStatus status, std::string anonId, PersistMap &storage) {
struct TweenData {
float start;
float duration;
Value from;
Value to;
bool finishApplied;
};
PersistBuffer &buffer = storage["TweenBase::" + anonId];
switch (status) {
case UI::PERSIST_SAVE:
buffer.resize(sizeof(TweenData) / sizeof(int));
{
TweenData &data = *(TweenData *)&buffer[0];
data.start = start_;
data.duration = duration_;
data.from = from_;
data.to = to_;
data.finishApplied = finishApplied_;
}
break;
case UI::PERSIST_RESTORE:
if (buffer.size() >= sizeof(TweenData) / sizeof(int)) {
TweenData data = *(TweenData *)&buffer[0];
start_ = data.start;
duration_ = data.duration;
from_ = data.from;
to_ = data.to;
finishApplied_ = data.finishApplied;
}
break;
}
}
template void TweenBase<uint32_t>::PersistData(PersistStatus status, std::string anonId, PersistMap &storage);
template void TweenBase<Visibility>::PersistData(PersistStatus status, std::string anonId, PersistMap &storage);
uint32_t ColorTween::Current(float pos) {
return colorBlend(to_, from_, pos);
}
+5
View File
@@ -23,6 +23,8 @@ public:
return finishApplied_ && time_now() >= start_ + duration_;
}
virtual void PersistData(PersistStatus status, std::string anonId, PersistMap &storage) = 0;
protected:
float DurationOffset() {
return time_now() - start_;
@@ -41,6 +43,7 @@ protected:
};
// This is the class all tweens inherit from. Shouldn't be used directly, see below.
// Note: Value cannot safely be a pointer (without overriding PersistData.)
template <typename Value>
class TweenBase: public Tween {
public:
@@ -102,6 +105,8 @@ public:
return Current(Position());
}
void PersistData(PersistStatus status, std::string anonId, PersistMap &storage) override;
protected:
virtual Value Current(float pos) = 0;
+5
View File
@@ -224,6 +224,11 @@ void View::PersistData(PersistStatus status, std::string anonId, PersistMap &sto
}
break;
}
ITOA stringify;
for (int i = 0; i < (int)tweens_.size(); ++i) {
tweens_[i]->PersistData(status, tag + "/" + stringify.p((int)i), storage);
}
}
Point View::GetFocusPosition(FocusDirection dir) {