Browse Source

* Updated libogcfpc to ver.1.8.8

git-svn-id: trunk@19339 -
Legolas 14 years ago
parent
commit
fe84a76d0a

+ 12 - 4
packages/libogcfpc/src/asndlib.pp

@@ -21,10 +21,18 @@ const
   SND_UNUSED = 0;  (*!< This voice is available for use.  *)
   SND_UNUSED = 0;  (*!< This voice is available for use.  *)
   SND_WORKING = 1;  (*!< This voice is currently in progress.  *)
   SND_WORKING = 1;  (*!< This voice is currently in progress.  *)
   SND_WAITING = 2;  (*!< This voice is currently in progress and waiting to one SND_AddVoice() function (the voice handler is called continuously)  *)
   SND_WAITING = 2;  (*!< This voice is currently in progress and waiting to one SND_AddVoice() function (the voice handler is called continuously)  *)
-  VOICE_MONO_8BIT = 0;
-  VOICE_MONO_16BIT = 1;
-  VOICE_STEREO_8BIT = 2;
-  VOICE_STEREO_16BIT = 3;
+
+  VOICE_MONO_8BIT       = 0;
+  VOICE_MONO_16BIT      = 1;
+  VOICE_MONO_16BIT_BE   = 1;
+  VOICE_STEREO_8BIT     = 2;
+  VOICE_STEREO_16BIT    = 3;
+  VOICE_STEREO_16BIT_BE = 3;
+  VOICE_MONO_8BIT_U     = 4;
+  VOICE_MONO_16BIT_LE   = 5;
+  VOICE_STEREO_8BIT_U   = 6;
+  VOICE_STEREO_16BIT_LE = 7;
+
   MIN_VOLUME = 0;
   MIN_VOLUME = 0;
   MID_VOLUME = 127;
   MID_VOLUME = 127;
   MAX_VOLUME = 255;
   MAX_VOLUME = 255;

+ 1 - 1
packages/libogcfpc/src/di/di.inc

@@ -66,7 +66,7 @@ procedure DI_Close; cdecl; external;
 function DI_GetStatus: cint; cdecl; external;
 function DI_GetStatus: cint; cdecl; external;
 
 
 function DI_Identify(id: PDI_DriveID): cint; cdecl; external;
 function DI_Identify(id: PDI_DriveID): cint; cdecl; external;
-
+function DI_CheckDVDSupport(): cint; cdecl; external;
 function DI_ReadDiscID(id: pcuint64): cint; cdecl; external;
 function DI_ReadDiscID(id: pcuint64): cint; cdecl; external;
 function DI_GetError(error: Pcuint32): cint; cdecl; external;
 function DI_GetError(error: Pcuint32): cint; cdecl; external;
 function DI_GetCoverRegister(status: Pcuint32): cint; cdecl; external;
 function DI_GetCoverRegister(status: Pcuint32): cint; cdecl; external;

+ 0 - 2
packages/libogcfpc/src/fat.pp

@@ -13,8 +13,6 @@ uses
 function fatInit(cacheSize: cuint32; setAsDefaultDevice: cbool): cbool; cdecl; external;
 function fatInit(cacheSize: cuint32; setAsDefaultDevice: cbool): cbool; cdecl; external;
 function fatInitDefault: cbool; cdecl; external;
 function fatInitDefault: cbool; cdecl; external;
 
 
-type
-  PDISC_INTERFACE = ^DISC_INTERFACE;
 function fatMountSimple(name_: pcchar; interface_: PDISC_INTERFACE): cbool; cdecl; external;
 function fatMountSimple(name_: pcchar; interface_: PDISC_INTERFACE): cbool; cdecl; external;
 
 
 function fatMount(name_: pcchar; interface_: PDISC_INTERFACE; startSector: sec_t; cacheSize, SectorsPerPage: cuint32): cbool; cdecl; external;
 function fatMount(name_: pcchar; interface_: PDISC_INTERFACE; startSector: sec_t; cacheSize, SectorsPerPage: cuint32): cbool; cdecl; external;

+ 4 - 4
packages/libogcfpc/src/iso9660.pp

@@ -8,14 +8,14 @@ unit iso9660;
 interface
 interface
 
 
 uses
 uses
-  ctypes, gctypes;
+  ctypes, gctypes, gccore;
 
 
 const
 const
   ISO_MAXPATHLEN = 128;
   ISO_MAXPATHLEN = 128;
 
 
-function ISO9660_Mount: cbool; cdecl; external;
-function ISO9660_Unmount: cbool; cdecl; external;
-function ISO9660_LastAccess: cuint64; cdecl; external;
+function ISO9660_Mount(const name: pcchar; const disc_interface: PDISC_INTERFACE): cbool; cdecl; external;
+function ISO9660_Unmount(const name: pcchar): cbool; cdecl; external;
+function ISO9660_GetVolumeLabel(const name: pcchar): pcchar; cdecl; external;
 
 
 implementation
 implementation
 
 

+ 0 - 6
packages/libogcfpc/src/network.pp

@@ -133,12 +133,6 @@ type
   end;
   end;
   P_fd_set = ^_fd_set;
   P_fd_set = ^_fd_set;
 
 
-  timeval = record
-    tv_sec: cint32;
-    tv_usec: cint32;
-  end;
-  Ptimeval = ^timeval;
-
 procedure FD_SET(n: longint; var p: _fd_set); inline;
 procedure FD_SET(n: longint; var p: _fd_set); inline;
 procedure FD_CLR(n: longint; var p: _fd_set); inline;
 procedure FD_CLR(n: longint; var p: _fd_set); inline;
 function FD_ISSET(n: longint; p: _fd_set): boolean; inline;
 function FD_ISSET(n: longint; p: _fd_set): boolean; inline;

+ 5 - 0
packages/libogcfpc/src/ogc/cache.inc

@@ -32,6 +32,11 @@ procedure ICSync; cdecl; external;
 
 
 procedure ICFlashInvalidate; cdecl; external;
 procedure ICFlashInvalidate; cdecl; external;
 
 
+
+{$ifdef HW_RVL}
+procedure L2Enhance(); cdecl; external;
+{$endif}
+
 procedure ICEnable; cdecl; external;
 procedure ICEnable; cdecl; external;
 
 
 procedure ICDisable; cdecl; external;
 procedure ICDisable; cdecl; external;

+ 1 - 0
packages/libogcfpc/src/ogc/disc_io.inc

@@ -32,6 +32,7 @@ type
   end;
   end;
 
 
   DISC_INTERFACE = DISC_INTERFACE_STRUCT;
   DISC_INTERFACE = DISC_INTERFACE_STRUCT;
+  PDISC_INTERFACE = ^DISC_INTERFACE;
 {$ENDIF}
 {$ENDIF}
 
 
 
 

+ 0 - 2
packages/libogcfpc/src/ogc/ipc.inc

@@ -30,8 +30,6 @@ type
 
 
 function iosCreateHeap(size: cint32): cint32; cdecl; external;
 function iosCreateHeap(size: cint32): cint32; cdecl; external;
 
 
-function iosDestroyHeap(hid: cint32): cint32; cdecl; external;
-
 function iosAlloc(hid, size: cint32): pointer; cdecl; external;
 function iosAlloc(hid, size: cint32): pointer; cdecl; external;
 
 
 procedure iosFree(hid: cint32; ptr: pointer); cdecl; external;
 procedure iosFree(hid: cint32; ptr: pointer); cdecl; external;

+ 3 - 6
packages/libogcfpc/src/ogc/tpl.inc

@@ -14,16 +14,13 @@ type
 
 
 function TPL_OpenTPLFromFile(tdf: PTPLFile; file_name: pcchar): cint32; cdecl; external;
 function TPL_OpenTPLFromFile(tdf: PTPLFile; file_name: pcchar): cint32; cdecl; external;
 
 
-function TPL_OpenTPLFromMemory(tdf: PTPLFile; const memory: pointer; len: cuint32)
-  : cint32; cdecl; external;
+function TPL_OpenTPLFromMemory(tdf: PTPLFile; memory: pointer; len: cuint32): cint32; cdecl; external;
 
 
 function TPL_GetTexture(tdf: PTPLFile; id: cint32; texObj: PGXTexObj): cint32; cdecl; external;
 function TPL_GetTexture(tdf: PTPLFile; id: cint32; texObj: PGXTexObj): cint32; cdecl; external;
 
 
-function TPL_GetTextureCI(tdf: PTPLFile; id: cint32; texObj: PGXTexObj;
-  tlutObj: PGXTlutObj; tluts: cuint8): cint32; cdecl; external;
+function TPL_GetTextureCI(tdf: PTPLFile; id: cint32; texObj: PGXTexObj; tlutObj: PGXTlutObj; tluts: cuint8): cint32; cdecl; external;
 
 
-function TPL_GetTextureInfo(tdf: PTPLFile; id: cint32; fmt: pcuint32;
-  width, height: pcuint16): cint32; cdecl; external;
+function TPL_GetTextureInfo(tdf: PTPLFile; id: cint32; fmt: pcuint32; width, height: pcuint16): cint32; cdecl; external;
 
 
 procedure TPL_CloseTPLFile(tdf: PTPLFile); cdecl; external;
 procedure TPL_CloseTPLFile(tdf: PTPLFile); cdecl; external;
 {$ENDIF OGC_INTERFACE}
 {$ENDIF OGC_INTERFACE}

+ 39 - 12
packages/libogcfpc/src/ogc/usb.inc

@@ -14,15 +14,24 @@ const
   USB_REPTYPE_INPUT = $01;
   USB_REPTYPE_INPUT = $01;
   USB_REPTYPE_OUTPUT = $02;
   USB_REPTYPE_OUTPUT = $02;
   USB_REPTYPE_FEATURE = $03;
   USB_REPTYPE_FEATURE = $03;
-  USB_REQTYPE_GET = $A1;
-  USB_REQTYPE_SET = $21;
+
   USB_DT_DEVICE = $01;
   USB_DT_DEVICE = $01;
   USB_DT_CONFIG = $02;
   USB_DT_CONFIG = $02;
   USB_DT_STRING = $03;
   USB_DT_STRING = $03;
   USB_DT_INTERFACE = $04;
   USB_DT_INTERFACE = $04;
   USB_DT_ENDPOINT = $05;
   USB_DT_ENDPOINT = $05;
+  USB_DT_DEVICE_QUALIFIER      = $06;
+  USB_DT_OTHER_SPEED_CONFIG    = $07;
+  USB_DT_INTERFACE_POWER       = $08;
+  USB_DT_OTG                   = $09;
+  USB_DT_DEBUG                 = $10;
+  USB_DT_INTERFACE_ASSOCIATION = $11;  
   USB_DT_HID = $21;
   USB_DT_HID = $21;
   USB_DT_REPORT = $22;
   USB_DT_REPORT = $22;
+  USB_DT_PHYSICAL					 = $23;
+  USB_DT_CLASS_SPECIFIC_INTERFACE = $24;
+  USB_DT_CLASS_SPECIFIC_ENDPOINT  = $25;
+  USB_DT_HUB                      = $29;
 
 
   USB_REQ_GETSTATUS = $00;
   USB_REQ_GETSTATUS = $00;
   USB_REQ_CLEARFEATURE = $01;
   USB_REQ_CLEARFEATURE = $01;
@@ -32,13 +41,16 @@ const
   USB_REQ_SETDESCRIPTOR = $07;
   USB_REQ_SETDESCRIPTOR = $07;
   USB_REQ_GETCONFIG = $08;
   USB_REQ_GETCONFIG = $08;
   USB_REQ_SETCONFIG = $09;
   USB_REQ_SETCONFIG = $09;
-  USB_REQ_GETINTERFACE = $0a;
-  USB_REQ_SETINTERFACE = $0b;
-  USB_REQ_SYNCFRAME = $0c;
-  USB_REQ_GETPROTOCOL = $03;
-  USB_REQ_SETPROTOCOL = $0B;
+  USB_REQ_GETINTERFACE = $0A;
+  USB_REQ_SETINTERFACE = $0B;
+  USB_REQ_SYNCFRAME = $0C;
   USB_REQ_GETREPORT = $01;
   USB_REQ_GETREPORT = $01;
+  USB_REQ_GETIDLE = $02;  
+  USB_REQ_GETPROTOCOL = $03;
   USB_REQ_SETREPORT = $09;
   USB_REQ_SETREPORT = $09;
+  USB_REQ_SETIDLE = $0A;
+  USB_REQ_SETPROTOCOL = $0B;
+
 
 
   USB_DT_DEVICE_SIZE = 18;
   USB_DT_DEVICE_SIZE = 18;
   USB_DT_CONFIG_SIZE = 9;
   USB_DT_CONFIG_SIZE = 9;
@@ -58,6 +70,14 @@ const
   USB_CTRLTYPE_REC_INTERFACE = 1;
   USB_CTRLTYPE_REC_INTERFACE = 1;
   USB_CTRLTYPE_REC_ENDPOINT = 2;
   USB_CTRLTYPE_REC_ENDPOINT = 2;
   USB_CTRLTYPE_REC_OTHER = 3;
   USB_CTRLTYPE_REC_OTHER = 3;
+  
+  USB_REQTYPE_INTERFACE_GET		= (USB_CTRLTYPE_DIR_DEVICE2HOST or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_INTERFACE);
+  USB_REQTYPE_INTERFACE_SET		= (USB_CTRLTYPE_DIR_HOST2DEVICE or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_INTERFACE);
+  USB_REQTYPE_ENDPOINT_GET		= (USB_CTRLTYPE_DIR_DEVICE2HOST or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_ENDPOINT);
+  USB_REQTYPE_ENDPOINT_SET		= (USB_CTRLTYPE_DIR_HOST2DEVICE or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_ENDPOINT);
+  
+  
+  
   USB_FEATURE_ENDPOINT_HALT = 0;
   USB_FEATURE_ENDPOINT_HALT = 0;
   USB_ENDPOINT_INTERRUPT = $03;
   USB_ENDPOINT_INTERRUPT = $03;
   USB_ENDPOINT_IN = $80;
   USB_ENDPOINT_IN = $80;
@@ -88,7 +108,7 @@ type
     bInterfaceProtocol : cuint8;
     bInterfaceProtocol : cuint8;
     iInterface : cuint8;
     iInterface : cuint8;
     extra : pcuint8;
     extra : pcuint8;
-    extra_size : cuint8;
+    extra_size : cuint16;
     endpoints : P_usbendpointdesc;
     endpoints : P_usbendpointdesc;
   end;
   end;
   usb_interfacedesc = _usbinterfacedesc;
   usb_interfacedesc = _usbinterfacedesc;
@@ -139,7 +159,7 @@ type
     //		u8 bDescriptorType;
     //		u8 bDescriptorType;
     //		u16 wDescriptorLength;
     //		u16 wDescriptorLength;
     //	} descr[1];
     //	} descr[1];
-    descr: record
+    descr: packed record
       bDescriptorType: cuint8;
       bDescriptorType: cuint8;
       wDescriptorLength: cuint16;
       wDescriptorLength: cuint16;
     end;
     end;
@@ -179,8 +199,8 @@ function USB_GetDescriptors(fd: cint32; udd: Pusb_devdesc): cint32; cdecl; exter
 
 
 procedure USB_FreeDescriptors(udd: Pusb_devdesc); cdecl; external;
 procedure USB_FreeDescriptors(udd: Pusb_devdesc); cdecl; external;
 
 
-function USB_GetHIDDescriptor(fd: cint32; uhd: Pusb_hiddesc): cint32; cdecl; external;
-
+function USB_GetGenericDescriptor(fd: cint32; _type, _index, _interface: cuint8; data: pointer; size: cuint32): cint32; cdecl; external;
+function USB_GetHIDDescriptor(fd: cint32; _interface: cuint8; uhd: pusb_hiddesc; size: cuint32): cint32; cdecl; external;
 
 
 function USB_GetDeviceDescription(fd: cint32; devdesc: Pusb_devdesc): cint32; cdecl; external;
 function USB_GetDeviceDescription(fd: cint32; devdesc: Pusb_devdesc): cint32; cdecl; external;
 
 
@@ -193,6 +213,9 @@ function USB_SuspendDevice(fd: cint32): cint32; cdecl; external;
 
 
 function USB_ResumeDevice(fd: cint32): cint32; cdecl; external;
 function USB_ResumeDevice(fd: cint32): cint32; cdecl; external;
 
 
+function USB_ReadIsoMsg(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer): cint32; cdecl; external;
+function USB_ReadIsoMsgAsync(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer; cb: usbcallback; userdata: pointer): cint32; cdecl; external;
+
 
 
 function USB_ReadIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
 function USB_ReadIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
   rpData: pointer): cint32; cdecl; external;
   rpData: pointer): cint32; cdecl; external;
@@ -215,6 +238,10 @@ function USB_ReadCtrlMsgAsync(fd: cint32; bmRequestType, bmRequest: cuint8;
   wValue, wIndex, wLength: cuint16; rpData: pointer; cb: usbcallback;
   wValue, wIndex, wLength: cuint16; rpData: pointer; cb: usbcallback;
   usrdata: pointer): cint32; cdecl; external;
   usrdata: pointer): cint32; cdecl; external;
 
 
+function USB_WriteIsoMsg(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer): cint32; cdecl; external;
+function USB_WriteIsoMsgAsync(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer; cb: usbcallback; userdata: pointer): cint32; cdecl; external;
+
+
 
 
 function USB_WriteIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
 function USB_WriteIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
   rpData: pointer): cint32; cdecl; external;
   rpData: pointer): cint32; cdecl; external;
@@ -250,7 +277,7 @@ function USB_ClearHalt(fd: cint32; endpointAddress: cuint8): cint32; cdecl; exte
 function USB_GetDeviceList(descr_buffer: Pusb_device_entry;
 function USB_GetDeviceList(descr_buffer: Pusb_device_entry;
   num_descr, interface_class: cuint8; cnt_descr: pcuint8): cint32; cdecl; external;
   num_descr, interface_class: cuint8; cnt_descr: pcuint8): cint32; cdecl; external;
 
 
-function USB_GetAsciiString(fd: cint32; wIndex, wLangID, wLength: cuint16; rpData: pointer): cint32; cdecl; external;
+function USB_GetAsciiString(fd: cint32; bIndex: cuint8; wLangID, wLength: cuint16; rpData: pointer): cint32; cdecl; external;
 
 
 
 
 {$endif HW_RVL}
 {$endif HW_RVL}

+ 1 - 0
packages/libogcfpc/src/ogc/usbmouse.inc

@@ -8,6 +8,7 @@ type
     button : cuint8;
     button : cuint8;
     rx : cint;
     rx : cint;
     ry : cint;
     ry : cint;
+    rz : cint;
   end;
   end;
   Pmouse_event = ^mouse_event;
   Pmouse_event = ^mouse_event;
 
 

+ 16 - 1
packages/libogcfpc/src/ogc/usbstorage.inc

@@ -41,6 +41,20 @@ type
   end;
   end;
   pusbstorage_handle = ^usbstorage_handle;
   pusbstorage_handle = ^usbstorage_handle;
 
 
+const
+  B_RAW_DEVICE_DATA_IN = $01;
+  B_RAW_DEVICE_COMMAND = 0;
+
+type 
+  raw_device_command = record
+    command: array [0..15] of cuint8;
+    command_length: cuint8;
+    flags: cuint8;
+    scsi_status: cuint8;
+    data: pointer;
+    data_length: cint;
+  end;
+  praw_device_command = ^raw_device_command;
 
 
 function USBStorage_Initialize(): cint32; cdecl; external;
 function USBStorage_Initialize(): cint32; cdecl; external;
 
 
@@ -51,7 +65,8 @@ function USBStorage_Reset(dev: pusbstorage_handle): cint32; cdecl; external;
 function USBStorage_GetMaxLUN(dev: pusbstorage_handle): cint32; cdecl; external;
 function USBStorage_GetMaxLUN(dev: pusbstorage_handle): cint32; cdecl; external;
 function USBStorage_MountLUN(dev: pusbstorage_handle; lun: cuint8): cint32; cdecl; external;
 function USBStorage_MountLUN(dev: pusbstorage_handle; lun: cuint8): cint32; cdecl; external;
 function USBStorage_Suspend(dev: pusbstorage_handle): cint32; cdecl; external;
 function USBStorage_Suspend(dev: pusbstorage_handle): cint32; cdecl; external;
-
+function USBStorage_IsDVD(): cint32; cdecl; external;
+function USBStorage_ioctl(request: cint; args: array of const): cint; cdecl; external;
 function USBStorage_ReadCapacity(dev: pusbstorage_handle; lun: cuint8; sector_size, n_sectors: pcuint32): cint32; cdecl; external;
 function USBStorage_ReadCapacity(dev: pusbstorage_handle; lun: cuint8; sector_size, n_sectors: pcuint32): cint32; cdecl; external;
 function USBStorage_Read(dev: pusbstorage_handle; lun: cuint8; sector: cuint32; n_sectors: cuint16; buffer: pcuint8): cint32; cdecl; external;
 function USBStorage_Read(dev: pusbstorage_handle; lun: cuint8; sector: cuint32; n_sectors: cuint16; buffer: pcuint8): cint32; cdecl; external;
 function USBStorage_Write(dev: pusbstorage_handle; lun: cuint8; sector: cuint32; n_sectors: cuint16; const buffer: pcuint8): cint32; cdecl; external;
 function USBStorage_Write(dev: pusbstorage_handle; lun: cuint8; sector: cuint32; n_sectors: cuint16; const buffer: pcuint8): cint32; cdecl; external;