Macros | |
#define | IPENDING *((unsigned int*)0x1f801070) |
#define | IMASK *((unsigned int*)0x1f801074) |
#define | RCNT_COUNT(x) *((unsigned int*)(0x1f801100 + (x<<4))) |
#define | RCNT_MODE(x) *((unsigned int*)(0x1f801104 + (x<<4))) |
#define | RCNT_TARGET(x) *((unsigned int*)(0x1f801108 + (x<<4))) |
Functions | |
int * | vblank_handler () |
int * | rcnt_handler () |
void | _internal_cdromlib_init (void) |
void | _96_remove (void) |
void | _96_init (void) |
void | InitCARD (void) |
void | StartCARD (void) |
void | StopCARD (void) |
void | _bu_init (void) |
void | BIOSWarmReboot (void) |
void | PSX_InitEx (unsigned int flags) |
Initialize library (extended version) | |
void | PSX_Init (void) |
Initialize library. | |
void | PSX_DeInit (void) |
Deinitialize library. | |
void | PSX_ReadPad (unsigned short *padbuf, unsigned short *padbuf2) |
Reads the status of the buttons of the two joypads. | |
void | PSX_PollPad (int pad_num, psx_pad_state *pad_state) |
Polls a joypad for information. | |
void | PSX_GetSysInfo (struct psx_info *info) |
Takes a pointer to a struct psx_info structure, and fills it with information about the PlayStation on which the program is running. | |
int | get_real_file_size (char *name) |
This function is like get_file_size() but doesn't round the file size to the block size. | |
int | get_file_size (char *name) |
Gets the file size of the file named "name". | |
int | SetRCnt (int spec, unsigned short target, unsigned int mode) |
Set root counter (documentation TO DO) | |
int | GetRCnt (int spec) |
Get root counter (documentation TO DO) | |
int | StartRCnt (int spec) |
Start root counter (documentation TO DO) | |
int | StopRCnt (int spec) |
Stop root counter (documentation TO DO) | |
void | SetVBlankHandler (void(*callback)()) |
Sets an handler function for the VBlank interrupt. | |
void | RemoveVBlankHandler (void) |
Removes a previously set VBlank handler. | |
void | SetRCntHandler (void(*callback)(), int spec, unsigned short target) |
void | RemoveRCntHandler (int spec) |
const char * | GetSystemRomVersion (void) |
Returns a pointer to a zero-terminated string which contains the system ROM version. | |
int | PSX_RestoreBiosState (void) |
Restores BIOS state to the one prior the initialization of the library. | |
unsigned int | PSX_GetInitFlags (void) |
Gets the bitmask for the flags passed to PSX_InitEx() | |
void | PSX_WarmReboot (void) |
Variables | |
const char * | sysromver_unavail = "System ROM Version Unavailable" |
unsigned char | padread_buf [2][8] |
void(* | vblank_handler_callback )() |
void(* | rcnt_handler_callback )() |
unsigned int | rcnt_handler_evfield |
unsigned char | psxsdkPadArr [PAD_READ_RAW_SIZE] |
#define IMASK *((unsigned int*)0x1f801074) |
#define IPENDING *((unsigned int*)0x1f801070) |
#define RCNT_COUNT | ( | x | ) | *((unsigned int*)(0x1f801100 + (x<<4))) |
#define RCNT_MODE | ( | x | ) | *((unsigned int*)(0x1f801104 + (x<<4))) |
#define RCNT_TARGET | ( | x | ) | *((unsigned int*)(0x1f801108 + (x<<4))) |
void _96_init | ( | void | ) |
void _96_remove | ( | void | ) |
void _bu_init | ( | void | ) |
void _internal_cdromlib_init | ( | void | ) |
void BIOSWarmReboot | ( | void | ) |
int get_file_size | ( | char * | name | ) |
Gets the file size of the file named "name".
It is actually just a wrapper around firstfile. It rounds the file size to the block size (2048).
name | FIle name string |
int get_real_file_size | ( | char * | name | ) |
This function is like get_file_size() but doesn't round the file size to the block size.
name | File name string |
int GetRCnt | ( | int | spec | ) |
Get root counter (documentation TO DO)
spec | Spec |
const char* GetSystemRomVersion | ( | void | ) |
Returns a pointer to a zero-terminated string which contains the system ROM version.
void InitCARD | ( | void | ) |
void PSX_DeInit | ( | void | ) |
Deinitialize library.
unsigned int PSX_GetInitFlags | ( | void | ) |
Gets the bitmask for the flags passed to PSX_InitEx()
void PSX_GetSysInfo | ( | struct psx_info * | info | ) |
void PSX_Init | ( | void | ) |
Initialize library.
void PSX_InitEx | ( | unsigned int | flags | ) |
Initialize library (extended version)
flags contains a bitmask specifying which flags are enabled
PSX_Init() is the same as PSX_InitEx(PSX_INIT_CD)
flags | Flag bitmask (flags are to be OR'd) |
void PSX_PollPad | ( | int | pad_num, |
psx_pad_state * | pad_state | ||
) |
Polls a joypad for information.
pad_num | Number of the pad to poll (0 = pad #1, 1 = pad #2, etc.) |
pad_state | Pointer to a psx_pad_state structure in which to store information for the pad. |
void PSX_ReadPad | ( | unsigned short * | padbuf, |
unsigned short * | padbuf2 | ||
) |
Reads the status of the buttons of the two joypads.
Takes two pointers for 16-bit bitmasks, one for the first player's joypad, and one for the second one. Their bits are updated to show which buttons were pressed.
This function only supplies basic functionality, adequate for a normal digital pad.
If more advanced functionality is desired, use PSX_PollPad() instead of this function.
padbuf | Pointer to 16-bit variable where bitmask for pad #1 will be stored. If NULL is passed, this argument is ignored. |
padbuf2 | Pointer to 16-bit variable where bitmask for pad #2 will be stored If NULL is passed, this argument is ignored. |
int PSX_RestoreBiosState | ( | void | ) |
Restores BIOS state to the one prior the initialization of the library.
This function can only be used if PSX_InitEx() was called with the PSX_INIT_SAVESTATE flag. It is usually called by PSX_DeInit() automatically, so unless you know what you are doing, you do not need to call it yourself.
void PSX_WarmReboot | ( | void | ) |
int* rcnt_handler | ( | ) |
void RemoveRCntHandler | ( | int | spec | ) |
void RemoveVBlankHandler | ( | void | ) |
Removes a previously set VBlank handler.
If SetVBlankHandler() was not called before, calling this function has no effect.
int SetRCnt | ( | int | spec, |
unsigned short | target, | ||
unsigned int | mode | ||
) |
Set root counter (documentation TO DO)
spec | Spec |
target | Target |
mode | mode |
void SetRCntHandler | ( | void(*)() | callback, |
int | spec, | ||
unsigned short | target | ||
) |
void SetVBlankHandler | ( | void(*)() | h | ) |
Sets an handler function for the VBlank interrupt.
Used for simple, inaccurate timing - the handler function gets called 60 times a second in NTSC video mode and 50 times a second in PAL video mode.
While most games use the VBlank interrupt for timing as they don't require high precision and have mechanisms to keep up with the different speed in PAL or NTSC video mode, for precise timing VBlank is inadequate. It is better to look at root counters if you desire precision.
If there is already a VBlank handler set, this function replaces the current handler with the specified one.
h | Pointer to (new) VBlank handler function |
void StartCARD | ( | void | ) |
int StartRCnt | ( | int | spec | ) |
Start root counter (documentation TO DO)
spec | Spec |
void StopCARD | ( | void | ) |
int StopRCnt | ( | int | spec | ) |
Stop root counter (documentation TO DO)
spec | Spec |
int* vblank_handler | ( | ) |
unsigned char padread_buf[2][8] |
unsigned char psxsdkPadArr[PAD_READ_RAW_SIZE] |
void(* rcnt_handler_callback)() |
unsigned int rcnt_handler_evfield |
const char* sysromver_unavail = "System ROM Version Unavailable" |
void(* vblank_handler_callback)() |