Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added msgdialog support

  • Loading branch information...
commit 4a0ee0bfd35d96f267578ba9b4a8b758fb4b2127 1 parent 43301b6
@Estwald Estwald authored
View
53 psl1ght/include/sysutil/msgdialog.h
@@ -0,0 +1,53 @@
+#pragma once
+
+#include <psl1ght/types.h>
+#include <stdlib.h>
+
+EXTERN_BEGIN
+
+
+typedef enum {
+
+ MSGDIALOG_ERROR = 0,
+ MSGDIALOG_NORMAL = 1,
+ MSGDIALOG_MUTE_ON = 2,
+ MSGDIALOG_BACKGROUND_INVISIBLE = 4,
+ MSGDIALOG_BUTTON_TYPE_YESNO = 16,
+ MSGDIALOG_BUTTON_TYPE_OK = 32,
+ MSGDIALOG_DISABLE_CANCEL_ON = 128,
+ MSGDIALOG_DEFAULT_CURSOR_NO = 256,
+
+ MSGDIALOG_SINGLE_PROGRESSBAR = 4096,
+ MSGDIALOG_DOUBLE_PROGRESSBAR = 8192
+
+} msgtype;
+
+typedef enum {
+
+ MSGDIALOG_BUTTON_NONE = -1,
+ MSGDIALOG_BUTTON_INVALID,
+ MSGDIALOG_BUTTON_OK,
+ MSGDIALOG_BUTTON_YES = 1,
+ MSGDIALOG_BUTTON_NO,
+ MSGDIALOG_BUTTON_ESCAPE
+
+} msgbutton;
+
+typedef void (*MsgDialog)(msgbutton button, void *userdata);
+
+s32 MsgDialogOpen(msgtype type, const char * msg, MsgDialog func, void * userdata, void *unused);
+s32 MsgDialogOpen_ex(msgtype type, const char * msg, opd32 * func, void * userdata, void *unused);
+s32 MsgDialogClose(void);
+s32 MsgDialogDelayedClose(float ms);
+
+s32 MsgDialogErrorCode(u32 errorcode, MsgDialog func, void * userdata, void *unused);
+s32 MsgDialogErrorCode_ex(u32 errorcode, opd32 * func, void * userdata, void *unused);
+
+#define PROGRESSBAR_INDEX0 0
+#define PROGRESSBAR_INDEX1 1
+
+s32 MsgDialogProgressBarMessage(u32 index, const char * msg);
+s32 MsgDialogResetProgressBar(u32 index);
+s32 MsgDialogIncProgressBar(u32 index, u32 percent);
+
+EXTERN_END
View
11 psl1ght/libc-glue-ppu/source/libsysutil.c
@@ -1,6 +1,17 @@
#include "sysutil/events.h"
+#include "sysutil/msgdialog.h"
s32 sysRegisterCallback(sysEventSlot slot, sysCallback func, void * userdata)
{
return sysRegisterCallback_ex(slot, OPD32(func), userdata);
}
+
+s32 MsgDialogOpen(u32 type, const char * msg, MsgDialog func, void * userdata, void *unused)
+{
+ return MsgDialogOpen_ex(type, msg, OPD32(func), userdata, unused);
+}
+
+s32 MsgDialogErrorCode(u32 errorcode, MsgDialog func, void * userdata, void *unused)
+{
+ return MsgDialogErrorCode_ex(errorcode, OPD32(func), userdata, unused);
+}
View
7 psl1ght/sprx/libsysutil/exports.h
@@ -4,3 +4,10 @@ EXPORT(videoGetState, 0x887572d5);
EXPORT(sysRegisterCallback_ex, 0x9d98afa0);
EXPORT(sysCheckCallback, 0x189a74da);
EXPORT(sysUnregisterCallback, 0x02ff3c1b);
+EXPORT(MsgDialogOpen_ex, 0x7603d3db);
+EXPORT(MsgDialogClose, 0x62b0f803);
+EXPORT(MsgDialogDelayedClose, 0x20543730);
+EXPORT(MsgDialogErrorCode_ex, 0x3e22cb4b);
+EXPORT(MsgDialogProgressBarMessage, 0x9d6af72a);
+EXPORT(MsgDialogResetProgressBar, 0x7bc2c8a8);
+EXPORT(MsgDialogIncProgressBar, 0x94862702);
Please sign in to comment.
Something went wrong with that request. Please try again.