PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
psxbios.h
Go to the documentation of this file.
1 /*
2  * PSXSDK: Bios functions
3  */
4 
5 #ifndef _PSXBIOS_H
6 #define _PSXBIOS_H
7 
8 /* Joypad functions */
9 
10 extern void PAD_init(unsigned long mode, unsigned long *pad_buf);
11 extern int PAD_dr(void);
12 
13 /* ROM information functions */
14 
20 unsigned long GetKernelDate(void);
21 
28 const char *GetKernelRomVersion(void);
29 
36 const char *GetSystemRomVersion(void);
37 
46 unsigned int GetRamSize(void);
47 
48 /* Interrupt/Exception functions */
49 
50 /*void Exception();*/
51 
56 void EnterCriticalSection(void);
57 
62 void ExitCriticalSection(void);
63 
64 void SysEnqIntRP(int index, unsigned int *buf);
65 void SysDeqIntRP(int index, unsigned int *buf);
66 
67 void ResetEntryInt(void);
68 
69 
73 struct DIRENTRY
74 {
76  char name[20];
78  unsigned int attr;
80  int size;
82  struct DIRENTRY *next;
84  unsigned char system[8];
85 };
86 
96 struct DIRENTRY *firstfile(char *name, struct DIRENTRY *dirent);
97 
107 struct DIRENTRY *nextfile(struct DIRENTRY *dir);
108 
117 int get_file_size(char *name);
118 
126 int get_real_file_size(char *name);
127 
128 void InitHeap(void *block , int size);
129 void FlushCache(void);
130 
131 void SetRCntHandler(void (*callback)(), int spec, unsigned short target);
132 void RemoveRCntHandler(int spec);
133 
144 int OpenEvent(
145  int desc, // Cause descriptor
146  int spec, // Event type
147  int mode, // Mode
148  int *(*func)(void) // Pointer to callback function
149 );
150 
157 int EnableEvent(unsigned int event);
158 
165 int CloseEvent(unsigned int event);
166 
173 int DisableEvent(unsigned int event);
174 
183 int DeliverEvent(unsigned int ev1, // Cause descriptor
184  int ev2); // Event class
185 
192 int TestEvent(unsigned int event);
193 
200 int WaitEvent(unsigned int event);
201 
213 void LoadExec(char *name, int argc, char **argv);
214 
215 #endif