Vid Kid - Template

Sections

Home

Samsung N505 Hack

Dreamcast Karaoke

MAME and Console Controllers

PSX Peripheral Bus Library

PSX Memory Card Tools

PSX Controller Tools

Download PSX Peripheral Bus Library v1.4 DJGPP/Linux (11.9 Kbytes) 17/01/00

Download PSX Peripheral Bus Library v1.4 Win32 DLL (27.6 Kbytes) 17/01/00

Abstract

The PSX Peripheral Bus Library contains the basic set of functions you will need to communicate with Playstation peripherals through DirectPad Pro, MegaTap and PlaySave (tested, not yet working) parallel port interfaces.

The library also serves as an information base for communicating with Playstation peripherals.

The PSX Peripheral Bus Library came about as a result of me writing lots of little tools for Playstation Controllers and Memory Cards, all of which shared a lot of the same code.

The library was originally written for DOS / DJGPP, but has since been ported to Linux and Win32. I have also recently built a Win32 DLL which hopefully will enable native parallel port adaptor support in PSXGameEdit.

The library is currently used by a set of Memory Card tools and a set of Controller tools I have written. The basic code also forms the basis of an Allegro joystick driver, which will probably be updated to use psxpblib in the near future.

Details

There are four groups of psxpblib functions, low level communications, high level communications, Controller communications and Memory Card communications.

You should only ever need to use the Controller and Memory Card functions. If you find yourself using the high level functions then the library needs expanding, and if you find yourself using the low level functions then I've probably got something wrong ;)

Low level communications:

  • The psx_dat and psx_ack functions read the state of the data and ack signals. The psx_clk, psx_att and psx_cmd functions set the state of the clk att and cmd signals. The psx_delay function doesn't need explaining ;)

High level communications:

  • The psx_sendinit function grabs the attention of a peripheral. The psx_sendbyte function sends a complete command to a peripheral. The psx_sendstring function sends a series of commands to a peripheral. The psx_sendclose function ends communications with a peripheral.

Controller communications:

  • The psx_controller_detect function returns the id (1 to 14) of a controller if there is one present, otherwise it returns -1. A list of controller ids can be found in psxpblib.h. psx_controller_read returns a pointer to a structure containing the data sent by a Controller if present, otherwise NULL. The best source of information for understanding the data returned by various controllers is currently the Allegro psx joystick driver code. I intend to update T. Fujita's FAQ with all the new controller information sometime soon.

Memory Card communications:

  • A Memory Card is divided into 16 blocks, the first of which is the directory (a FAT of sorts). Each block is divided into 64 frames, and a frame is 128 bytes long.
  • psx_memcard_read_frame reads an entire frame from a Memory Card, returning NULL on an error. psx_memcard_write_frame writes an entire frame to a Memory Card, returning -1 on an error.
  • psx_memcard_read_block reads an entire block from a Memory Card, returning NULL on an error. psx_memcard_write_block writes an entire block to a Memory Card, returning -1 on an error.
  • psx_mcb_read_dir returns a pointer to a structure containing the information regarding a single block from the directory. psx_mcb_read_dat returns a pointer to a structure containing the information regarding a single block from the block itself. psx_mcb_info_merge merges these two structures into a single structure. psx_mcb_read_info returns a pointer to a structure containing the information regarding a single block from both the directory and the block itself.

These tools are for the DirectPad Pro, MegaTap and PlaySave parallel port interfaces. See DirectPad Pro, PlaySave and Simon Nield's site for wiring schematics. I would recommend using a power supply similar to Simon's which supplies +3.5V DC, and NOT +5.0V DC as in the DirectPad Pro schematics.

I would also recommend that if you are about to build a psx controller parallel port interface that you buy an extension lead and a Multi tap, and rewire the extension lead as port one of the DirectPad Pro interface. This is just about the easiest way to connect four controllers, and then you can read Memory Cards through the Multi tap too ;)

Further details are included in the psxpblib.txt file, found in the archive.


Made With Notepad
Made With Notepad
Content Copyright Richard Davies 2003
Graphics Copyright Weebl 2003
Best Viewed With Any Browser
Best Viewed With Any Browser