MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / open_msg_dialog

Function open_msg_dialog

ps3fw/cellMsgDialog.cpp:165–311  ·  view source on GitHub ↗

wrapper to call for other hle dialogs

Source from the content-addressed store, hash-verified

163
164// wrapper to call for other hle dialogs
165error_code open_msg_dialog(bool is_blocking, u32 type, vm::cptr<char> msgString, msg_dialog_source source, vm::ptr<CellMsgDialogCallback> callback, vm::ptr<void> userData, vm::ptr<void> extParam, s32* return_code)
166{
167 cellSysutil.notice("open_msg_dialog(is_blocking=%d, type=0x%x, msgString=%s, source=%s, callback=*0x%x, userData=*0x%x, extParam=*0x%x, return_code=*0x%x)", is_blocking, type, msgString, source, callback, userData, extParam, return_code);
168
169 const MsgDialogType _type{type};
170
171 if (return_code)
172 {
173 *return_code = CELL_MSGDIALOG_BUTTON_NONE;
174 }
175
176 if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>())
177 {
178 if (manager->get<rsx::overlays::message_dialog>())
179 {
180 return CELL_SYSUTIL_ERROR_BUSY;
181 }
182
183 if (s32 ret = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0); ret < 0)
184 {
185 return CellSysutilError{ret + 0u};
186 }
187
188 const auto notify = std::make_shared<atomic_t<u32>>(0);
189
190 const auto res = manager->create<rsx::overlays::message_dialog>()->show(is_blocking, msgString.get_ptr(), _type, source, [callback, userData, &return_code, is_blocking, notify](s32 status)
191 {
192 if (is_blocking && return_code)
193 {
194 *return_code = status;
195 }
196
197 sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0);
198
199 if (callback)
200 {
201 sysutil_register_cb([=](ppu_thread& ppu) -> s32
202 {
203 callback(ppu, status, userData);
204 return CELL_OK;
205 });
206 }
207
208 if (is_blocking && notify)
209 {
210 *notify = 1;
211 notify->notify_one();
212 }
213 });
214
215 // Wait for on_close
216 while (is_blocking && !Emu.IsStopped() && !*notify)
217 {
218 notify->wait(false, atomic_wait_timeout{1'000'000});
219 }
220
221 return res;
222 }

Callers 9

open_exit_dialogFunction · 0.85
cellMsgDialogOpen2Function · 0.85
run_threadMethod · 0.85
cellHddGameCheckFunction · 0.85
cellGameDataCheckCreate2Function · 0.85
select_and_deleteFunction · 0.85
error_code savedata_opFunction · 0.85
ExecMethod · 0.85

Calls 15

sysutil_send_system_cmdFunction · 0.85
sysutil_register_cbFunction · 0.85
get_current_cpu_threadFunction · 0.85
is_stoppedFunction · 0.85
yieldFunction · 0.85
IsStoppedMethod · 0.80
SetInterceptedFunction · 0.50
showMethod · 0.45
get_ptrMethod · 0.45
notify_oneMethod · 0.45
waitMethod · 0.45
makeMethod · 0.45

Tested by

no test coverage detected