source: ps2launchargs/source/uLaunchELF/launchelf.h@ 1134

Last change on this file since 1134 was 1102, checked in by iritscen, 7 years ago

A few tweaks to ps2launchargs:

  • Added LAUNCHELF.CNF, which allows me to specify a color for highlighted menu items in uLE that a colorblind person can see more easily.
  • Customized version string of uLE as it appears in upper-right of UI.
  • The LaunchArgs.txt in the source folder no longer uses incorrect argument syntax, and now simply matches the one in the main folder.
  • Updated Instructions.rtf in minor ways.
  • Property svn:executable set to *
File size: 11.4 KB
Line 
1#ifndef LAUNCHELF_H
2#define LAUNCHELF_H
3
4#define ULE_VERSION "v4.40h+args" // Iritscen: Added "+args"
5#define ULE_VERDATE "2010.02.12"
6
7#include <stdio.h>
8#include <tamtypes.h>
9#include <sifcmd.h>
10#include <kernel.h>
11#include <sifrpc.h>
12#include <loadfile.h>
13#include <string.h>
14#include <malloc.h>
15#include <libhdd.h>
16#include <libmc.h>
17#include <libpad.h>
18#include <fileio.h>
19#include <sys/stat.h>
20#include <iopheap.h>
21#include <errno.h>
22#include <fileXio_rpc.h>
23#include <iopcontrol.h>
24#include <stdarg.h>
25#include <sbv_patches.h>
26#include <slib.h>
27#include <smem.h>
28#include <smod.h>
29#include <sys/fcntl.h>
30#include <debug.h>
31#include <gsKit.h>
32#include <dmaKit.h>
33#include <cdvd_rpc.h>
34#include "cd.h"
35//#include "mass_rpc.h" //disused in switch to usbhdfsd
36#include "iopmod_name.h"
37#include <libjpg.h>
38#include <libkbd.h>
39#include <floatlib.h>
40#include "hdl_rpc.h"
41
42#define TRUE 1
43#define FALSE 0
44
45enum { // cnfmode values for getFilePath in browsing for configurable file paths
46 NON_CNF = 0, // Normal browser mode, not configuration mode
47 LK_ELF_CNF, // Normal ELF choice for launch keys
48 USBD_IRX_CNF, // USBD.IRX choice for startup
49 SKIN_CNF, // Skin JPG choice
50 GUI_SKIN_CNF, // GUI Skin JPG choice
51 USBKBD_IRX_CNF, // USB keyboard IRX choice (only PS2SDK)
52 KBDMAP_FILE_CNF, // USB keyboard mapping table choice
53 CNF_PATH_CNF, // CNF Path override choice
54 TEXT_CNF, // No restriction choice
55 DIR_CNF, // Directory choice
56 JPG_CNF, // Jpg viewer choice
57 USBMASS_IRX_CNF, // USB_MASS.IRX choice for startup
58 LANG_CNF, // Language file choice
59 FONT_CNF, // Font file choice ( .fnt )
60 SAVE_CNF, // Generic Save choice (with or without selected file)
61 CNFMODE_CNT // Total number of cnfmode values defined
62};
63
64enum
65{
66 SCREEN_MARGIN = 16,
67 FONT_WIDTH = 8,
68 FONT_HEIGHT = 16,
69 LINE_THICKNESS = 3,
70
71 MAX_NAME = 256,
72 MAX_PATH = 1025,
73 MAX_ENTRY = 2048,
74 MAX_PARTITIONS=500,
75 MAX_MENU_TITLE = 40,
76 MAX_ELF_TITLE = 72,
77 MAX_TEXT_LINE = 80
78};
79
80typedef struct
81{
82 char CNF_Path[MAX_PATH];
83 char LK_Path[16][MAX_PATH];
84 char LK_Title[16][MAX_ELF_TITLE];
85 int LK_Flag[16];
86 char Misc[64];
87 char Misc_PS2Disc[64];
88 char Misc_FileBrowser[64];
89 char Misc_PS2Browser[64];
90 char Misc_PS2Net[64];
91 char Misc_PS2PowerOff[64];
92 char Misc_HddManager[64];
93 char Misc_TextEditor[64];
94 char Misc_JpgViewer[64];
95 char Misc_Configure[64];
96 char Misc_Load_CNFprev[64];
97 char Misc_Load_CNFnext[64];
98 char Misc_Set_CNF_Path[64];
99 char Misc_Load_CNF[64];
100 char Misc_ShowFont[64];
101 char Misc_Debug_Info[64];
102 char Misc_About_uLE[64];
103 char usbd_file[MAX_PATH];
104 char usbkbd_file[MAX_PATH];
105 char usbmass_file[MAX_PATH];
106 char kbdmap_file[MAX_PATH];
107 char skin[MAX_PATH];
108 char GUI_skin[MAX_PATH];
109 char Menu_Title[MAX_MENU_TITLE+1];
110 char lang_file[MAX_PATH];
111 char font_file[MAX_PATH];
112 int Menu_Frame;
113 int Show_Menu;
114 int timeout;
115 int Hide_Paths;
116 u64 color[8];
117 int screen_x;
118 int screen_y;
119 int discControl;
120 int interlace;
121 int resetIOP;
122 int numCNF;
123 int swapKeys;
124 int HOSTwrite;
125 int Brightness;
126 int TV_mode;
127 int Popup_Opaque;
128 int Init_Delay;
129 int usbkbd_used;
130 int Show_Titles;
131 int PathPad_Lock;
132 int JpgView_Timer;
133 int JpgView_Trans;
134 int JpgView_Full;
135 int PSU_HugeNames;
136 int PSU_DateNames;
137 int PSU_NoOverwrite;
138 int FB_NoIcons;
139} SETTING;
140
141typedef struct
142{
143 int ip[4];
144 int nm[4];
145 int gw[4];
146} data_ip_struct;
147
148extern char LaunchElfDir[MAX_PATH], LastDir[MAX_NAME];
149
150/* main.c */
151extern int TV_mode;
152extern int swapKeys;
153extern int GUI_active;// Skin and Main Skin switch
154extern CdvdDiscType_t cdmode; //Last detected disc type
155
156void load_vmcfs(void);
157void load_ps2host(void);
158void loadCdModules(void);
159void loadUsbModules(void);
160void loadHddModules(void);
161void loadHdlInfoModule(void);
162void setupPowerOff(void);
163int uLE_related(char *pathout, char *pathin);
164int uLE_detect_TV_mode();
165int exists(char *path);
166int uLE_cdDiscValid(void);
167int uLE_cdStop(void);
168
169/* elf.c */
170int checkELFheader(char *filename);
171void RunLoaderElf(char *filename, char *);
172
173/* draw.c */
174#define BACKGROUND_PIC 0
175#define PREVIEW_PIC 1
176#define JPG_PIC 2
177#define THUMB_PIC 3
178#define PREVIEW_GUI 4
179
180#define FOLDER 0
181#define WARNING 1
182
183unsigned char icon_folder[1024];
184unsigned char icon_warning[1024];
185
186extern GSGLOBAL *gsGlobal;
187extern GSTEXTURE TexSkin, TexPreview, TexPicture, TexThumb[MAX_ENTRY], TexIcon[2];
188extern int testskin, testsetskin, testjpg, testthumb;
189extern float PicWidth, PicHeight, PicW, PicH, PicCoeff;
190extern int SCREEN_WIDTH;
191extern int SCREEN_HEIGHT;
192extern int SCREEN_X;
193extern int SCREEN_Y;
194extern int Menu_start_x;
195extern int Menu_title_y;
196extern int Menu_message_y;
197extern int Frame_start_y;
198extern int Menu_start_y;
199extern int Menu_end_y;
200extern int Frame_end_y;
201extern int Menu_tooltip_y;
202extern u64 BrightColor;
203extern int PicRotate, FullScreen;
204extern u8 FontBuffer[256*16];
205
206void setScrTmp(const char *msg0, const char *msg1);
207void drawSprite( u64 color, int x1, int y1, int x2, int y2 );
208void drawPopSprite( u64 color, int x1, int y1, int x2, int y2 );
209void drawOpSprite( u64 color, int x1, int y1, int x2, int y2 );
210void drawMsg(const char *msg);
211void drawLastMsg(void);
212void setupGS(int gs_vmode);
213void updateScreenMode(int adapt_XY);
214void clrScr(u64 color);
215void setBrightness(int Brightness);
216void loadSkin(int Picture, char *Path, int ThumbNum);
217void drawScr(void);
218void drawFrame(int x1, int y1, int x2, int y2, u64 color);
219void drawChar(unsigned int c, int x, int y, u64 colour);
220int printXY(const unsigned char *s, int x, int y, u64 colour, int draw, int space);
221int printXY_sjis(const unsigned char *s, int x, int y, u64 colour, int);
222u8 *transcpy_sjis(u8 *d, u8 *s);
223void loadIcon(void);
224int loadFont(char *path_arg);
225//Comment out WriteFont_C when not used (also requires patch in draw.c)
226//int WriteFont_C(char *pathname);
227
228/* pad.c */
229#define PAD_R3_V0 0x010000
230#define PAD_R3_V1 0x020000
231#define PAD_R3_H0 0x040000
232#define PAD_R3_H1 0x080000
233#define PAD_L3_V0 0x100000
234#define PAD_L3_V1 0x200000
235#define PAD_L3_H0 0x400000
236#define PAD_L3_H1 0x800000
237
238extern u32 joy_value;
239extern u32 new_pad;
240int setupPad(void);
241int readpad(void);
242int readpad_no_KB(void);
243int readpad_noRepeat(void);
244void waitPadReady(int port, int slot);
245void waitAnyPadReady(void);
246
247/* config.c */
248#define TV_mode_AUTO 0
249#define TV_mode_NTSC 1
250#define TV_mode_PAL 2
251
252extern char PathPad[30][MAX_PATH];
253extern SETTING *setting;
254void initConfig(void);
255int loadConfig(char *, char *); //0==OK, -1==load failed
256void config(char *, char *);
257int get_CNF_string(unsigned char **CNF_p_p,
258 unsigned char **name_p_p,
259 unsigned char **value_p_p); //main CNF name,value parser
260unsigned char *preloadCNF(char *path); //loads file into RAM it allocates
261
262/* filer.c */
263typedef struct{
264 char name[MAX_NAME];
265 char title[32*2+1];
266 mcTable stats;
267} FILEINFO;
268
269#define MOUNT_LIMIT 4
270extern char mountedParty[MOUNT_LIMIT][MAX_NAME];
271extern int latestMount;
272extern int vmcMounted[2];
273extern int vmc_PartyIndex[2]; //PFS index for each VMC, unless -1
274extern int Party_vmcIndex[MOUNT_LIMIT]; //VMC index for each PFS, unless -1
275extern int nparties; //Clearing this causes FileBrowser to refresh party list
276extern unsigned char *elisaFnt;
277char *PathPad_menu(const char *path);
278int getFilePath(char *out, const int cnfmode);
279void initHOST(void);
280char *makeHostPath(char *dp, char*sp);
281int ynDialog(const char *message);
282void nonDialog(char *message);
283int keyboard(char *out, int max);
284void genInit(void);
285void genLimObjName(char *uLE_path, int reserve);
286int genFixPath(char *uLE_path, char *gen_path);
287int genOpen(char *path, int mode);
288int genLseek(int fd, int where, int how);
289int genRead(int fd, void *buf, int size);
290int genWrite(int fd, void *buf, int size);
291int genClose(int fd);
292int genDopen(char *path);
293int genDclose(int fd);
294int genRemove(char *path);
295int genRmdir(char *path);
296int mountParty(const char *party);
297void unmountParty(int party_ix);
298void unmountAll(void);
299int setFileList(const char *path, const char *ext, FILEINFO *files, int cnfmode);
300
301/* hdd.c */
302void DebugDisp(char *Message);
303void hddManager(void);
304
305/* editor.c */
306void TextEditor(void);
307
308/* timer.c */
309extern u64 WaitTime;
310extern u64 CurrTime;
311
312void TimerInit(void);
313u64 Timer(void);
314void TimerEnd(void);
315
316/* jpgviewer.c */
317void JpgViewer(void);
318
319/* lang.c */
320typedef struct Language{
321 u8* String;
322} Language;
323
324enum {
325#define lang(id, name, value) LANG_##name,
326#include "lang.h"
327#undef lang
328 LANG_COUNT
329};
330
331#define LNG(name) Lang_String[LANG_##name].String
332#define LNG_DEF(name) Lang_Default[LANG_##name].String
333
334extern Language Lang_String[];
335extern Language Lang_Default[];
336extern Language *External_Lang_Buffer;
337
338void Init_Default_Language(void);
339void Load_External_Language(void);
340
341/* font_uLE.c */
342
343extern unsigned char font_uLE[];
344enum {
345//0x100-0x109 are 5 double width characters for D-Pad buttons, which are accessed as:
346//"ÿ0"==Circle "ÿ1"==Cross "ÿ2"==Square "ÿ3"==Triangle "ÿ4"==filled Square
347 RIGHT_CUR = 0x10A, //Triangle pointing left, for use to the right of an item
348 LEFT_CUR = 0x10B, //Triangle pointing right, for use to the left of an item
349 UP_ARROW = 0x10C, //Arrow pointing up
350 DN_ARROW = 0x10D, //Arrow pointing up
351 LT_ARROW = 0x10E, //Arrow pointing up
352 RT_ARROW = 0x10F, //Arrow pointing up
353 TEXT_CUR = 0x110, //Vertical bar, for use between two text characters
354 UL_ARROW = 0x111, //Arrow pointing up and to the left, from a vertical start.
355 BR_SPLIT = 0x112, //Splits rectangle from BL to TR with BR portion filled
356 BL_SPLIT = 0x113, //Splits rectangle from TL to BR with BL portion filled
357//0x114-0x11B are 4 double width characters for D-Pad buttons, which are accessed as:
358//"ÿ:"==Right "ÿ;"==Down "ÿ<"==Left "ÿ="==Up
359//0x11C-0x123 are 4 doubled characters used as normal/marked folder/file icons
360 ICON_FOLDER = 0x11C,
361 ICON_M_FOLDER = 0x11E,
362 ICON_FILE = 0x120,
363 ICON_M_FILE = 0x122,
364 FONT_COUNT= 0x124 //Total number of characters in font
365};
366
367/* makeicon.c */
368int make_icon(char* icontext,char* filename);
369int make_iconsys(char* title,char* iconname, char* filename);
370
371
372//vmcfs definitions
373
374// The devctl commands: 0x56 == V, 0x4D == M, 0x43 == C, 0x01, 0x02, ... == command number.
375#define DEVCTL_VMCFS_CLEAN 0x564D4301 // Set as free all fat cluster corresponding to a none existing object. ( Object are just marked as none existing but not removed from fat table when rmdir or remove fonctions are call. This allow to recover a deleted file. )
376#define DEVCTL_VMCFS_CKFREE 0x564D4302 // Check free space available on vmc.
377
378// The ioctl commands: 0x56 == V, 0x4D == M, 0x43 == C, 0x01, 0x02, ... == command number.
379#define IOCTL_VMCFS_RECOVER 0x564D4303 // Recover an object marked as none existing. ( data must be a valid path to an object in vmc file )
380
381// Vmc format enum
382typedef enum {
383 FORMAT_FULL,
384 FORMAT_FAST
385} Vmc_Format_Enum;
386
387
388// chkesr_rpc.c
389extern int chkesr_rpc_Init(void);
390extern int Check_ESR_Disc(void);
391
392//USB_mass definitions for multiple drive usage
393
394#define USB_MASS_MAX_DRIVES 10
395
396extern char USB_mass_ix[10];
397extern int USB_mass_max_drives;
398extern u64 USB_mass_scan_time;
399extern int USB_mass_scanned;
400extern int USB_mass_loaded; //0==none, 1==internal, 2==external
401
402#endif
Note: See TracBrowser for help on using the repository browser.