mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
handle empty callback returns
This commit is contained in:
parent
08c581947d
commit
8debdfcd09
6 changed files with 91 additions and 43 deletions
|
@ -394,9 +394,11 @@ error_code cellOskDialogSetSeparateWindowOption(vm::ptr<CellOskDialogSeparateWin
|
||||||
return CELL_OSKDIALOG_ERROR_PARAM;
|
return CELL_OSKDIALOG_ERROR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto osk = _get_osk_dialog(true);
|
if (auto osk = _get_osk_dialog(true))
|
||||||
osk->use_seperate_windows = true;
|
{
|
||||||
osk->osk_continuous_mode = (CellOskDialogContinuousMode)(u32)windowOption->continuousMode;
|
osk->use_seperate_windows = true;
|
||||||
|
osk->osk_continuous_mode = (CellOskDialogContinuousMode)(u32)windowOption->continuousMode;
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -523,8 +525,10 @@ error_code cellOskDialogExtRegisterConfirmWordFilterCallback(vm::ptr<cellOskDial
|
||||||
return CELL_OSKDIALOG_ERROR_PARAM;
|
return CELL_OSKDIALOG_ERROR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto osk = _get_osk_dialog(true);
|
if (auto osk = _get_osk_dialog(true))
|
||||||
osk->osk_confirm_callback = pCallback;
|
{
|
||||||
|
osk->osk_confirm_callback = pCallback;
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,7 +538,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
|
||||||
lv2_obj::sleep(ppu);
|
lv2_obj::sleep(ppu);
|
||||||
|
|
||||||
// Display Save Data List asynchronously in the GUI thread.
|
// Display Save Data List asynchronously in the GUI thread.
|
||||||
selected = Emu.GetCallbacks().get_save_dialog()->ShowSaveDataList(save_entries, focused, operation, listSet);
|
if (auto save_dialog = Emu.GetCallbacks().get_save_dialog())
|
||||||
|
{
|
||||||
|
selected = save_dialog->ShowSaveDataList(save_entries, focused, operation, listSet);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selected = -2;
|
||||||
|
}
|
||||||
|
|
||||||
// Reschedule
|
// Reschedule
|
||||||
if (ppu.check_state())
|
if (ppu.check_state())
|
||||||
|
|
|
@ -598,7 +598,10 @@ error_code sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, vm::pt
|
||||||
*details = SceNpTrophyDetails();
|
*details = SceNpTrophyDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
Emu.GetCallbacks().get_trophy_notification_dialog()->ShowTrophyNotification(*details, trophyIconData);
|
if (auto trophy_notification_dialog = Emu.GetCallbacks().get_trophy_notification_dialog())
|
||||||
|
{
|
||||||
|
trophy_notification_dialog->ShowTrophyNotification(*details, trophyIconData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
|
@ -6,7 +6,14 @@
|
||||||
|
|
||||||
GSRender::GSRender()
|
GSRender::GSRender()
|
||||||
{
|
{
|
||||||
m_frame = Emu.GetCallbacks().get_gs_frame().release();
|
if (auto gs_frame = Emu.GetCallbacks().get_gs_frame())
|
||||||
|
{
|
||||||
|
m_frame = gs_frame.release();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_frame = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GSRender::~GSRender()
|
GSRender::~GSRender()
|
||||||
|
|
|
@ -430,25 +430,28 @@ namespace rsx
|
||||||
virtual void create()
|
virtual void create()
|
||||||
{
|
{
|
||||||
dlg = Emu.GetCallbacks().get_msg_dialog();
|
dlg = Emu.GetCallbacks().get_msg_dialog();
|
||||||
dlg->type.se_normal = true;
|
if (dlg)
|
||||||
dlg->type.bg_invisible = true;
|
|
||||||
dlg->type.progress_bar_count = 2;
|
|
||||||
dlg->ProgressBarSetTaskbarIndex(-1); // -1 to combine all progressbars in the taskbar progress
|
|
||||||
dlg->on_close = [](s32 status)
|
|
||||||
{
|
{
|
||||||
Emu.CallAfter([]()
|
dlg->type.se_normal = true;
|
||||||
|
dlg->type.bg_invisible = true;
|
||||||
|
dlg->type.progress_bar_count = 2;
|
||||||
|
dlg->ProgressBarSetTaskbarIndex(-1); // -1 to combine all progressbars in the taskbar progress
|
||||||
|
dlg->on_close = [](s32 status)
|
||||||
{
|
{
|
||||||
Emu.Stop();
|
Emu.CallAfter([]()
|
||||||
|
{
|
||||||
|
Emu.Stop();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ref_cnt++;
|
||||||
|
|
||||||
|
Emu.CallAfter([&]()
|
||||||
|
{
|
||||||
|
dlg->Create("Preloading cached shaders from disk.\nPlease wait...", "Shader Compilation");
|
||||||
|
ref_cnt--;
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
ref_cnt++;
|
|
||||||
|
|
||||||
Emu.CallAfter([&]()
|
|
||||||
{
|
|
||||||
dlg->Create("Preloading cached shaders from disk.\nPlease wait...", "Shader Compilation");
|
|
||||||
ref_cnt--;
|
|
||||||
});
|
|
||||||
|
|
||||||
while (ref_cnt.load() && !Emu.IsStopped())
|
while (ref_cnt.load() && !Emu.IsStopped())
|
||||||
{
|
{
|
||||||
|
@ -458,6 +461,11 @@ namespace rsx
|
||||||
|
|
||||||
virtual void update_msg(u32 index, u32 processed, u32 entry_count)
|
virtual void update_msg(u32 index, u32 processed, u32 entry_count)
|
||||||
{
|
{
|
||||||
|
if (!dlg)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ref_cnt++;
|
ref_cnt++;
|
||||||
|
|
||||||
Emu.CallAfter([&, index, processed, entry_count]()
|
Emu.CallAfter([&, index, processed, entry_count]()
|
||||||
|
@ -470,6 +478,11 @@ namespace rsx
|
||||||
|
|
||||||
virtual void inc_value(u32 index, u32 value)
|
virtual void inc_value(u32 index, u32 value)
|
||||||
{
|
{
|
||||||
|
if (!dlg)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ref_cnt++;
|
ref_cnt++;
|
||||||
|
|
||||||
Emu.CallAfter([&, index, value]()
|
Emu.CallAfter([&, index, value]()
|
||||||
|
@ -481,6 +494,11 @@ namespace rsx
|
||||||
|
|
||||||
virtual void set_limit(u32 index, u32 limit)
|
virtual void set_limit(u32 index, u32 limit)
|
||||||
{
|
{
|
||||||
|
if (!dlg)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ref_cnt++;
|
ref_cnt++;
|
||||||
|
|
||||||
Emu.CallAfter([&, index, limit]()
|
Emu.CallAfter([&, index, limit]()
|
||||||
|
|
|
@ -379,22 +379,25 @@ void Emulator::Init()
|
||||||
|
|
||||||
// Initialize message dialog
|
// Initialize message dialog
|
||||||
std::shared_ptr<MsgDialogBase> dlg = Emu.GetCallbacks().get_msg_dialog();
|
std::shared_ptr<MsgDialogBase> dlg = Emu.GetCallbacks().get_msg_dialog();
|
||||||
dlg->type.se_normal = true;
|
if (dlg)
|
||||||
dlg->type.bg_invisible = true;
|
|
||||||
dlg->type.progress_bar_count = 1;
|
|
||||||
dlg->on_close = [](s32 status)
|
|
||||||
{
|
{
|
||||||
Emu.CallAfter([]()
|
dlg->type.se_normal = true;
|
||||||
|
dlg->type.bg_invisible = true;
|
||||||
|
dlg->type.progress_bar_count = 1;
|
||||||
|
dlg->on_close = [](s32 status)
|
||||||
{
|
{
|
||||||
// Abort everything
|
Emu.CallAfter([]()
|
||||||
Emu.Stop();
|
{
|
||||||
});
|
// Abort everything
|
||||||
};
|
Emu.Stop();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Emu.CallAfter([=]()
|
Emu.CallAfter([=]()
|
||||||
{
|
{
|
||||||
dlg->Create(+g_progr, +g_progr);
|
dlg->Create(+g_progr, +g_progr);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
u64 ftotal = 0;
|
u64 ftotal = 0;
|
||||||
u64 fdone = 0;
|
u64 fdone = 0;
|
||||||
|
@ -432,9 +435,12 @@ void Emulator::Init()
|
||||||
if (ptotal)
|
if (ptotal)
|
||||||
fmt::append(progr, " module %u of %u", pdone, ptotal);
|
fmt::append(progr, " module %u of %u", pdone, ptotal);
|
||||||
|
|
||||||
dlg->SetMsg(+g_progr);
|
if (dlg)
|
||||||
dlg->ProgressBarSetMsg(0, progr);
|
{
|
||||||
dlg->ProgressBarInc(0, delta);
|
dlg->SetMsg(+g_progr);
|
||||||
|
dlg->ProgressBarSetMsg(0, progr);
|
||||||
|
dlg->ProgressBarInc(0, delta);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,10 +459,13 @@ void Emulator::Init()
|
||||||
g_progr_ptotal -= pdone;
|
g_progr_ptotal -= pdone;
|
||||||
g_progr_pdone -= pdone;
|
g_progr_pdone -= pdone;
|
||||||
|
|
||||||
Emu.CallAfter([=]
|
if (dlg)
|
||||||
{
|
{
|
||||||
dlg->Close(true);
|
Emu.CallAfter([=]
|
||||||
});
|
{
|
||||||
|
dlg->Close(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue