Sponsored Links

Sponsored Links

Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 49



  1. #31
    Registered User evilsperm's Avatar
    Join Date
    Sep 2007
    Posts
    476
    Sponsored Links
    Sponsored Links
    Quote Originally Posted by Xalcker View Post
    Anyone getting black screen after power->eject with blackcat?
    Your PS3 is not on firmware 3.41

  2. #32
    Registered User Pantheon's Avatar
    Join Date
    Sep 2010
    Posts
    3
    Sponsored Links
    Sponsored Links
    I would also like to mention that BlackcatUSB itself has a built in firmware changer. And it does not require you to have JAVA installed.

    With the software open, it will automatically connect and allow you to update firmware.

  3. #33
    Senior Member EiKii's Avatar
    Join Date
    Mar 2010
    Posts
    333
    Sponsored Links
    Sponsored Links
    well let's hope for a faster release to psp, but even if it is i would still get the blackcat

    where are they shipping the devices from?

  4. #34
    Registered User luffyone's Avatar
    Join Date
    Sep 2010
    Posts
    11
    From the cities I see cited on the site it looks like the US.

  5. #35
    Registered User ldh888's Avatar
    Join Date
    Sep 2010
    Posts
    9
    Yeah, 26 USD same here. still waiting my blackcat compare 26 usd to buy a psj.. its cheap.. LOL

  6. #36
    Registered User luffyone's Avatar
    Join Date
    Sep 2010
    Posts
    11
    Some ideas for a possible psp port here: [Register or Login to view links]

    Code:
    #include <pspkernel.h>
        #include <pspsdk.h>
        #include <pspusb.h>
        #include <pspusbbus.h>
        #include <string.h>
        #include "descriptors.h"
        #include "psgroove.h"
    
        #define PSGROOVE_DRIVERNAME "PsGrooveDriver"
        #define PSGROOVE_DRIVERPID  (0x1C9)
    
        /*------------------------------------------------------------------------------*/
        /* USB driver define                                             */
        /*------------------------------------------------------------------------------*/
        enum UsbEvents {
           USB_EVENT_ATTACH  = 1,
           USB_EVENT_DETACH  = 2,
           USB_EVENT_ASYNC   = 4,
           USB_EVENT_CONNECT = 8,
           USB_EVENT_ALL     = 0xFFFFFFFF
        };
    
        enum UsbTransEvents {
           USB_TRANSEVENT_BULKOUT_DONE = 1,
           USB_TRANSEVENT_BULKIN_DONE  = 2,
        };
    
        /*------------------------------------------------------------------------------*/
        /* USB HUB device descriptor                                       */
        /*------------------------------------------------------------------------------*/
        struct DeviceDescriptor devdesc_hub = {
           .bLength            = 0x12,
           .bDescriptorType    = 0x01,
           .bcdUSB             = 0x0002, //? 0x0200
           .bDeviceClass       = 0x09,
           .bDeviceSubClass    = 0x00,
           .bDeviceProtocol    = 0x01,
           .bMaxPacketSize     = 0x08,
           .idVendor           = 0xAAAA,
           .idProduct          = 0xCCCC,
           .bcdDevice          = 0x0001, //? 0x0100
           .iManufacturer      = 0x00,
           .iProduct           = 0x00,
           .iSerialNumber      = 0x00,
           .bNumConfigurations = 0x01
        };
    
        /*------------------------------------------------------------------------------*/
        /* USB HUB configuration descriptor                                    */
        /*------------------------------------------------------------------------------*/
        struct ConfigDescriptor confdesc_hub = {
           .bLength             = 0x09,
           .bDescriptorType     = 0x02,
           .wTotalLength        = 0x1900, //? 0x0019
           .bNumInterfaces      = 0x01,
           .bConfigurationValue = 0x01,
           .iConfiguration      = 0x00,
           .bmAttributes        = 0xE0,
           .bMaxPower           = 0x32
        };
    
        /*------------------------------------------------------------------------------*/
        /* USB HUB interface descriptor                                    */
        /*------------------------------------------------------------------------------*/
        struct InterfaceDescriptor interdesc_hub = {
           .bLength            = 0x09,
           .bDescriptorType    = 0x04,
           .bInterfaceNumber   = 0x00,
           .bAlternateSetting  = 0x00,
           .bNumEndpoints      = 0x01,
           .bInterfaceClass    = 0x09,
           .bInterfaceSubClass = 0x00,
           .bInterfaceProtocol = 0x00,
           .iInterface         = 0x00
        };
    
        /*------------------------------------------------------------------------------*/
        /* USB HUB endpoint descriptor                                       */
        /*------------------------------------------------------------------------------*/
        struct EndpointDescriptor endpdesc_hub = {
           .bLength          = 0x07,
           .bDescriptorType  = 0x05,
           .bEndpointAddress = 0x81,
           .bmAttributes     = 0x03,
           .wMaxPacketSize   = 0x100,
           .bInterval        = 0x0C
        };
    
        /*------------------------------------------------------------------------------*/
        /* USB HUB string description                                       */
        /*------------------------------------------------------------------------------*/
        static struct StringDescriptor HUBStringDescriptor = { 0x09, 0x29, {0x06, 0xA9, 0x00, 0x32, 0x64, 0x00, 0xff} };
    
        /*------------------------------------------------------------------------------*/
        /* USB driver work                                                */
        /*------------------------------------------------------------------------------*/
        static struct UsbEndpoint UsbEndpoint[3] = { {0,0,0}, {1,0,0}, {2,0,0} };
        static struct UsbInterface UsbInterface = { 0xFFFFFFFF, 0, 1, }; //I don't know what is this
        static struct UsbData UsbData[2];
        static SceUID UsbMainEventFlag = -1;
        static SceUID UsbTransEventFlag = -1;
        static SceUID UsbMainSemaphore = -1;
        static SceUID UsbMainThreadID = -1;
    
        /*------------------------------------------------------------------------------*/
        /* Pre declarations                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbMainThread( SceSize size, void *argp );
        unsigned short PsGroove_GetDescription(unsigned char DescriptorType, unsigned char DescriptorNumber, unsigned short wLength, const void** const DescriptorAddress)
        void PsGroove_UnhandledControlRequest(struct DeviceRequest USB_ControlRequest);
        /*------------------------------------------------------------------------------*/
        /* UsbRequest                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbRequest( int arg1, int arg2, struct DeviceRequest *req )
        {
           unsigned char DescriptorType = (req->wValue >> 8)
           unsigned char DescriptorNumber = ((req->wValue && 0xFF)
           unsigned short wLength = req->wLength;
           void* DataAddress = NULL;   
           unsigned short size = 0;
    
           if (req->bRequest == 0x06) {//GetDescriptor Request
              if ( (size = psgroove_getDescription(DescriptorType, DescriptorNumber, wLength, &DataAddress)) > 0 )
                 if (UsbWriteData(DataAddress, size) < size)
                    return -1;
           }
           else { //Other request
              PsGroove_UnhandledControlRequest(*req);
           }
    
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbUnknown                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbUnknown( int arg1, int arg2, int arg3 )
        {
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbAttach                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbAttach( int speed, void *arg2, void *arg3 )
        {
           sceKernelSetEventFlag( UsbMainEventFlag, USB_EVENT_ATTACH );
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbDetach                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbDetach( int arg1, int arg2, int arg3 )
        {
           DisplayEnable();
           sceKernelSetEventFlag( UsbMainEventFlag, USB_EVENT_DETACH );
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbStartFunc                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbStartFunc( int size, void *p )
        {
           memset( UsbData, 0, sizeof(UsbData) );
           memcpy( UsbData[0].devdesc, &devdesc_hub, sizeof(devdesc_hub) );
           UsbData[0].config.pconfdesc = &UsbData[0].confdesc;
           UsbData[0].config.pinterfaces = &UsbData[0].interfaces;
           UsbData[0].config.pinterdesc = &UsbData[0].interdesc;
           UsbData[0].config.pendp = &UsbData[0].endp[0];
           memcpy( UsbData[0].confdesc.desc, &confdesc_hub,  sizeof(confdesc_hub) );
           UsbData[0].confdesc.pinterfaces = &UsbData[0].interfaces;
           UsbData[0].interfaces.pinterdesc[0] = &UsbData[0].interdesc;
           UsbData[0].interfaces.intcount = 1;
           memcpy( UsbData[0].interdesc.desc, &interdesc_hub, sizeof(interdesc_hub) );
           UsbData[0].interdesc.pendp = &UsbData[0].endp[0];
           memcpy( UsbData[0].endp[0].desc, &endpdesc_hhub, sizeof(endpdesc_hub) );
           //memcpy( UsbData[0].endp[1].desc, &endpdesc_hi[1], sizeof(endpdesc_hub[1]) );
           //memcpy( UsbData[0].endp[2].desc, &endpdesc_hi[2], sizeof(endpdesc_hub[2]) );
    
           memcpy( UsbData[1].devdesc, &devdesc_hub, sizeof(devdesc_hub) );
           UsbData[1].config.pconfdesc = &UsbData[0].confdesc;
           UsbData[1].config.pinterfaces = &UsbData[0].interfaces;
           UsbData[1].config.pinterdesc = &UsbData[0].interdesc;
           UsbData[1].config.pendp = &UsbData[0].endp[0];
           memcpy( UsbData[1].confdesc.desc, &confdesc_hub,  sizeof(confdesc_hub) );
           UsbData[1].confdesc.pinterfaces = &UsbData[0].interfaces;
           UsbData[1].interfaces.pinterdesc[0] = &UsbData[0].interdesc;
           UsbData[1].interfaces.intcount = 1;
           memcpy( UsbData[1].interdesc.desc, &interdesc_hub, sizeof(interdesc_hub) );
           UsbData[1].interdesc.pendp = &UsbData[0].endp[0];
           memcpy( UsbData[1].endp[0].desc, &endpdesc_hhub, sizeof(endpdesc_hub) );
           //memcpy( UsbData[1].endp[1].desc, &endpdesc_hi[1], sizeof(endpdesc_hub[1]) );
           //memcpy( UsbData[1].endp[2].desc, &endpdesc_hi[2], sizeof(endpdesc_hub[2]) );
           
    
           UsbMainEventFlag = sceKernelCreateEventFlag( "USBMainEvent", 0x200, 0, NULL );
           if ( UsbMainEventFlag < 0 ){ return( -1 ); }
           UsbTransEventFlag = sceKernelCreateEventFlag( "USBEventTrans", 0x200, 0, NULL );
           if ( UsbTransEventFlag < 0 ){ return( -1 ); }
           UsbMainSemaphore = sceKernelCreateSema( "USBSemaphore", 0, 1, 1, NULL );
           if ( UsbMainSemaphore < 0 ){ return( -1 ); }
           UsbMainThreadID = sceKernelCreateThread( "USBMainThread", UsbMainThread, 10, 0x10000, 0, NULL );
           if ( UsbMainThreadID < 0 ){ return( -1 ); }
           sceKernelStartThread( UsbMainThreadID, 0, NULL );
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbStopFunc                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbStopFunc( int size, void *p )
        {
           if ( UsbMainThreadID >= 0 ){ sceKernelTerminateDeleteThread( UsbMainThreadID ); }
           UsbMainThreadID = -1;
           if ( UsbMainEventFlag >= 0 ){ sceKernelDeleteEventFlag( UsbMainEventFlag ); }
           UsbMainEventFlag = -1;
           if ( UsbTransEventFlag >= 0 ){ sceKernelDeleteEventFlag( UsbTransEventFlag ); }
           UsbTransEventFlag = -1;
           if ( UsbMainSemaphore >= 0 ){ sceKernelDeleteSema( UsbMainSemaphore ); }
           UsbMainSemaphore = -1;
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* USB driver structure                                             */
        /*------------------------------------------------------------------------------*/
        struct UsbDriver UsbDriver = {
           PSGROOVE_DRIVERNAME,
           4,
           UsbEndpoint,
           &UsbInterface,
           &UsbData[0].devdesc[0],
           &UsbData[0].config,
           &UsbData[1].devdesc[0],
           &UsbData[1].config,
           &StringDescriptor,
           UsbRequest,
           UsbUnknown,
           UsbAttach,
           UsbDetach,
           0,
           UsbStartFunc,
           UsbStopFunc,
           NULL
        };
    
        /********************************************************************************/
        /*------------------------------------------------------------------------------*/
        /* usb thread work                                                */
        /*------------------------------------------------------------------------------*/
        static int UsbReady = 0;
        static struct UsbdDeviceReq UsbBulkinReq;
        static struct UsbdDeviceReq UsbBulkoutReq;
        static char UsbBuff[64*1024] __attribute__((aligned(64)));
        static char UsbAsyncBuff[512] __attribute__((aligned(64)));
    
        /*------------------------------------------------------------------------------*/
        /* UsbBulkinReqDone                                                */
        /*------------------------------------------------------------------------------*/
        static int UsbBulkinReqDone( struct UsbdDeviceReq *req, int arg2, int arg3 )
        {
           sceKernelSetEventFlag( UsbTransEventFlag, USB_TRANSEVENT_BULKIN_DONE );
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* SetUsbBulkinReq                                                */
        /*------------------------------------------------------------------------------*/
        static int SetUsbBulkinReq( void *data, int size )
        {
           sceKernelDcacheWritebackRange( data, size );
           memset( &UsbBulkinReq, 0, sizeof(UsbBulkinReq) );
           UsbBulkinReq.endp = &UsbEndpoint[1];
           UsbBulkinReq.data = data;
           UsbBulkinReq.size = size;
           UsbBulkinReq.func = UsbBulkinReqDone;
           sceKernelClearEventFlag( UsbTransEventFlag, ~USB_TRANSEVENT_BULKIN_DONE );
           return( sceUsbbdReqSend( &UsbBulkinReq ) );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbBulkoutReqDone                                             */
        /*------------------------------------------------------------------------------*/
        static int UsbBulkoutReqDone( struct UsbdDeviceReq *req, int arg2, int arg3 )
        {
           sceKernelSetEventFlag( UsbTransEventFlag, USB_TRANSEVENT_BULKOUT_DONE );
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* SetUsbBulkoutReq                                                */
        /*------------------------------------------------------------------------------*/
        static int SetUsbBulkoutReq( void *data, int size )
        {
           u32 upper_size = (size + 0x3F) & 0xFFFFFFC0;
    
           sceKernelDcacheInvalidateRange( data, upper_size );
           memset( &UsbBulkoutReq, 0, sizeof(UsbBulkoutReq) );
           UsbBulkoutReq.endp = &UsbEndpoint[2];
           UsbBulkoutReq.data = data;
           UsbBulkoutReq.size = size;
           UsbBulkoutReq.func = UsbBulkoutReqDone;
           sceKernelClearEventFlag( UsbTransEventFlag, ~USB_TRANSEVENT_BULKOUT_DONE );
           return( sceUsbbdReqRecv( &UsbBulkoutReq ) );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbReadData                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbReadData( void *data, int data_size )
        {
           u32 result;
           int read_size = 0;
    
           while ( read_size < data_size ){
              int rest_size = data_size - read_size;
              if ( rest_size > sizeof(UsbBuff) ){ rest_size = sizeof(UsbBuff); }
              SetUsbBulkoutReq( UsbBuff, rest_size );
              int ret = sceKernelWaitEventFlag( UsbTransEventFlag, USB_TRANSEVENT_BULKOUT_DONE,
                                        PSP_EVENT_WAITOR | PSP_EVENT_WAITCLEAR, &result, NULL );
              if ( ret == 0 ){
                 if ( (UsbBulkoutReq.retcode == 0) && (UsbBulkoutReq.recvsize > 0) ){
                    read_size += UsbBulkoutReq.recvsize;
                    memcpy( data, UsbBuff, UsbBulkoutReq.recvsize );
                    data += UsbBulkoutReq.recvsize;
                 } else {
                    return( -1 );
                 }
              } else {
                 return( -1 );
              }
           }
           return( read_size );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbWriteData                                                   */
        /*------------------------------------------------------------------------------*/
        static int UsbWriteData( const void *data, int data_size )
        {
           u32 result;
           int write_size = 0;
    
           if ( (u32)data & 0x3F ){
              while ( write_size < data_size ){
                 int rest_size = data_size - write_size;
                 if ( rest_size > sizeof(UsbBuff) ){ rest_size = sizeof(UsbBuff); }
                 memcpy( UsbBuff, data, rest_size );
                 SetUsbBulkinReq( UsbBuff, rest_size );
                 int ret = sceKernelWaitEventFlag( UsbTransEventFlag, USB_TRANSEVENT_BULKIN_DONE,
                                           PSP_EVENT_WAITOR | PSP_EVENT_WAITCLEAR, &result, NULL );
                 if ( ret == 0 ){
                    if ( (UsbBulkinReq.retcode == 0) && (UsbBulkinReq.recvsize > 0) ){
                       write_size += UsbBulkinReq.recvsize;
                       data += UsbBulkinReq.recvsize;
                    } else {
                       return( -1 );
                    }
                 } else {
                    return( -1 );
                 }
              }
           } else {
              while ( write_size < data_size ){
                 int rest_size = data_size - write_size;
                 if ( rest_size > sizeof(UsbBuff) ){ rest_size = sizeof(UsbBuff); }
                 SetUsbBulkinReq( (char *)data, rest_size );
                 int ret = sceKernelWaitEventFlag( UsbTransEventFlag, USB_TRANSEVENT_BULKIN_DONE,
                                           PSP_EVENT_WAITOR | PSP_EVENT_WAITCLEAR, &result, NULL );
                 if ( ret == 0 ){
                    if ( (UsbBulkinReq.retcode == 0) && (UsbBulkinReq.recvsize > 0) ){
                       write_size += UsbBulkinReq.recvsize;
                       data += UsbBulkinReq.recvsize;
                    } else {
                       return( -1 );
                    }
                 } else {
                    return( -1 );
                 }
              }
           }
           return( write_size );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbMainThread                                                */
        /*------------------------------------------------------------------------------*/
        static int UsbMainThread( SceSize size, void *argp )
        {
           int ret;
           u32 result;
    
           while( 1 ){
              ret = sceKernelWaitEventFlag( UsbMainEventFlag,
                                     USB_EVENT_ATTACH | USB_EVENT_DETACH | USB_EVENT_ASYNC,
                                     PSP_EVENT_WAITOR | PSP_EVENT_WAITCLEAR, &result, NULL );
              if ( ret < 0 ){ sceKernelExitDeleteThread( 0 ); }
              if ( result & USB_EVENT_DETACH ){
                 UsbReady = 0;
                 sceKernelClearEventFlag( UsbMainEventFlag, ~USB_EVENT_CONNECT );
              }
              if ( result & USB_EVENT_ATTACH ){
                 UsbReady = 0;
                 sceKernelClearEventFlag( UsbMainEventFlag, ~USB_EVENT_CONNECT );
              }
           }
           return( 0 );
        }
    
        /********************************************************************************/
        /*------------------------------------------------------------------------------*/
        /* UsbbdRegister                                                */
        /*------------------------------------------------------------------------------*/
        void UsbbdRegister( void )
        {
           sceUsbbdRegister( &UsbDriver );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbbdUnregister                                                */
        /*------------------------------------------------------------------------------*/
        void UsbbdUnregister( void )
        {
           sceUsbbdUnregister( &UsbDriver );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbStart                                                      */
        /*------------------------------------------------------------------------------*/
        int UsbStart( void )
        {
           int ret;
    
           ret = sceUsbStart( PSP_USBBUS_DRIVERNAME, 0, 0 );
           if ( ret != 0 ){ return( -1 ); }
           ret = sceUsbStart( PSGROOVE_DRIVERNAME, 0, 0 );
           if ( ret != 0 ){ return( -1 ); }
           ret = sceUsbActivate( PSGROOVE_DRIVERPID );
           if ( ret != 0 ){ return( -1 ); }
    
           //TODO: Check if it is the right place
           PsGroove_Start();
    
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbStop                                                      */
        /*------------------------------------------------------------------------------*/
        int UsbStop( void )
        {
           int ret;
    
           ret = sceUsbDeactivate( PSGROOVE_DRIVERPID );
           if ( ret != 0 ){ return( -1 ); }
           ret = sceUsbStop( PSGROOVE_DRIVERNAME, 0, 0 );
           if ( ret != 0 ){ return( -1 ); }
           ret = sceUsbStop( PSP_USBBUS_DRIVERNAME, 0, 0 );
           if ( ret != 0 ){ return( -1 ); }
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbResume                                                   */
        /*------------------------------------------------------------------------------*/
        int UsbResume( void )
        {
           int ret;
    
           ret = sceUsbActivate( PSGROOVE_DRIVERPID );
           if ( ret != 0 ){ return( -1 ); }
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbSuspend                                                   */
        /*------------------------------------------------------------------------------*/
        int UsbSuspend( void )
        {
           int ret;
    
           ret = sceUsbDeactivate( PSGROOVE_DRIVERPID );
           if ( ret != 0 ){ return( -1 ); }
           return( 0 );
        }
    
        /*------------------------------------------------------------------------------*/
        /* UsbWait                                                      */
        /*------------------------------------------------------------------------------*/
        int UsbWait( void )
        {
           int ret;
    
           while ( UsbMainEventFlag < 0 ){ sceKernelDelayThread( 100000 ); }
           ret = sceKernelWaitEventFlag( UsbMainEventFlag, USB_EVENT_CONNECT,
                                  PSP_EVENT_WAITOR, NULL, NULL );
           return( 0 );
        }

    Code:
        /********************************************************************************/
        /*------------------------------------------------------------------------------*/
        /* PsGroove Emulation                                             */
        /*------------------------------------------------------------------------------*/
    
        /*------------------------------------------------------------------------------*/
        #define PORT_EMPTY 0x0100   /* powered only */
        #define PORT_FULL 0x0103    /* connected, enabled, powered, full-speed */
        #define C_PORT_CONN  0x0001 /* connection */
        #define C_PORT_RESET 0x0010 /* reset */
        #define C_PORT_NONE  0x0000 /* no change */
        unsigned short port_status[6] = { PORT_EMPTY, PORT_EMPTY, PORT_EMPTY, PORT_EMPTY, PORT_EMPTY, PORT_EMPTY };
        unsigned short port_change[6] = { C_PORT_NONE, C_PORT_NONE, C_PORT_NONE, C_PORT_NONE, C_PORT_NONE, C_PORT_NONE };
        enum {
           init,
           wait_hub_ready,
           hub_ready,
           p1_wait_reset,
           p1_wait_enumerate,
           p1_ready,
           p2_wait_reset,
           p2_wait_enumerate,
           p2_ready,
           p3_wait_reset,
           p3_wait_enumerate,
           p3_ready,
           p2_wait_disconnect,
           p4_wait_connect,
           p4_wait_reset,
           p4_wait_enumerate,
           p4_ready,
           p5_wait_reset,
           p5_wait_enumerate,
           p5_challenged,
           p5_responded,
           p3_wait_disconnect,
           p3_disconnected,
           p5_wait_disconnect,
           p5_disconnected,
           p4_wait_disconnect,
           p4_disconnected,
           p1_wait_disconnect,
           p1_disconnected,
           p6_wait_reset,
           p6_wait_enumerate,
           done,
        } state = init;
    
        unsigned char hub_int_response = 0x00;
        unsigned char hub_int_force_data0 = 0;
        int last_port_conn_clear = 0;
        int last_port_reset_clear = 0;
    
        unsigned char port_addr[7] = { -1, -1, -1, -1, -1, -1, -1 };
        unsigned char port_cur = -1;
    
        /*------------------------------------------------------------------------------*/
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_Timer                                          */
        /*------------------------------------------------------------------------------*/
        volatile unsigned char expire = 0; /* counts down every 10 milliseconds */
        void PsGroove_Timer( void )
        {
           if (expire > 0)
              expire--;
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_Panic                                          */
        /*------------------------------------------------------------------------------*/
        void PsGroove_Panic()
        {
           //TODO: Don't Panic!
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_PsGroove_Switch_Port                                          */
        /*------------------------------------------------------------------------------*/
        void PsGroove_PsGroove_Switch_Port(int8_t port)
        {
           if (port_cur == port) return;
           port_cur = port;
           if (port_addr[port] < 0)
              port_addr[port] = 0;
    
           //TODO: I can't port this two lines
           //UDADDR = port_addr[port] & 0x7f;
           //UDADDR |= (1 << ADDEN);
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_PsGroove_Connect_Port                                          */
        /*------------------------------------------------------------------------------*/
        void PsGroove_PsGroove_Connect_Port(int port)
        {
           last_port_reset_clear = 0;
           hub_int_response = (1 << port);
           port_status[port - 1] = PORT_FULL;
           port_change[port - 1] = C_PORT_CONN;
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_PsGroove_Disconnect_Port                                          */
        /*------------------------------------------------------------------------------*/
        void PsGroove_PsGroove_Disconnect_Port(int port)
        {
           last_port_conn_clear = 0;
           hub_int_response = (1 << port);
           port_status[port - 1] = PORT_EMPTY;
           port_change[port - 1] = C_PORT_CONN;
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_GetDescription                                          */
        /*------------------------------------------------------------------------------*/
        unsigned short PsGroove_GetDescription(unsigned char DescriptorType, unsigned char DescriptorNumber, unsigned short wLength,  const void** const DescriptorAddress)
        {
           void* Address = NULL;
           unsigned short Size = 0;
    
           switch(DescriptorType)
           {
           case 0x01: //DTYPE_Device
              switch (port_cur) {
              //case 0:
              //   Address = (void *) HUB_Device_Descriptor;
              //   Size    = sizeof(HUB_Device_Descriptor);
              //   break;
              case 1:
                 Address = (void *) port1_device_descriptor;
                 Size    = sizeof(port1_device_descriptor);
                 break;
              case 2:
                 Address = (void *) port2_device_descriptor;
                 Size    = sizeof(port2_device_descriptor);
                 break;
              case 3:
                 Address = (void *) port3_device_descriptor;
                 Size    = sizeof(port3_device_descriptor);
                 break;
              case 4:
                 Address = (void *) port4_device_descriptor;
                 Size    = sizeof(port4_device_descriptor);
                 break;
              case 5:
                 Address = (void *) port5_device_descriptor;
                 Size    = sizeof(port5_device_descriptor);
                 break;
              case 6:
                 Address = (void *) port6_device_descriptor;
                 Size    = sizeof(port6_device_descriptor);
                 break;
              }
              break;
           case 0x02: //DTYPE_Configuration
              switch (port_cur) {
              //case 0:
              //   Address = (void *) HUB_Config_Descriptor;
              //   Size    = sizeof(HUB_Config_Descriptor);
              //   break;
              case 1:
                 // 4 configurations are the same.
                 // For the initial 8-byte request, we give a different
                 // length response than in the full request.
                 if (DescriptorNumber < 4) {
                    if (wLength == 8) {
                       Address = (void *) port1_short_config_descriptor;
                       Size    = sizeof(port1_short_config_descriptor);
                    } else {
                       Address = (void *) port1_config_descriptor;
                       Size    = sizeof(port1_config_descriptor);
                    }
                    if (DescriptorNumber == 3 && wLength > 8) {
                       state = p1_ready;
                       expire = 10;
                    }
                 }
                 break;
              case 2:
                 // only 1 config
                 Address = (void *) port2_config_descriptor;
                 Size    = sizeof(port2_config_descriptor);
                 state = p2_ready;
                 expire = 15;
                 break;
              case 3:
                 // 2 configurations are the same
                 Address = (void *) port3_config_descriptor;
                 Size    = sizeof(port3_config_descriptor);
                 if (DescriptorNumber == 1 && wLength > 8) {
                    state = p3_ready;
                    expire = 10;
                 }
                 break;
              case 4:
                 // 3 configurations
                 if (DescriptorNumber == 0) {
                    Address = (void *) port4_config_descriptor_1;
                    Size    = sizeof(port4_config_descriptor_1);
                 } else if (DescriptorNumber == 1) {
                    if (wLength == 8) {
                       Address = (void *) port4_short_config_descriptor_2;
                       Size    = sizeof(port4_short_config_descriptor_2);
                    } else {
                       Address = (void *) port4_config_descriptor_2;
                       Size    = sizeof(port4_config_descriptor_2);
                    }
                 } else if (DescriptorNumber == 2) {
                    Address = (void *) port4_config_descriptor_3;
                    Size    = sizeof(port4_config_descriptor_3);
                    if (wLength > 8) {
                       state = p4_ready;
                       expire = 20;  // longer seems to help this one?
                    }
                 }
                 break;
              case 5:
                 // 1 config
                 Address = (void *) port5_config_descriptor;
                 Size    = sizeof(port5_config_descriptor);
                 break;
              case 6:
                 // 1 config
                 Address = (void *) port6_config_descriptor;
                 Size    = sizeof(port6_config_descriptor);
                 break;
              }
              break;
           //case 0x29: // HUB descriptor (always to port 0 we'll assume)
           //   switch (port_cur) {
           //   case 0:
           //      Address = (void *) HUB_Hub_Descriptor;
           //      Size    = sizeof(HUB_Hub_Descriptor);
           //      break;
              }
              break;
           }
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_UnhandledControlRequest                                          */
        /*------------------------------------------------------------------------------*/
        void PsGroove_UnhandledControlRequest(struct DeviceRequest USB_ControlRequest)
        {
           if (port_cur == 6 && USB_ControlRequest.bRequest == 0xAA) {
              /* holy crap, it worked! */
              //Endpoint_ClearSETUP();
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
              state = done;
              return;
           }      
    
           if (port_cur == 5 && USB_ControlRequest.bRequest == 11 /*REQ_SetInterface*/)
           {
              /* can ignore this */
              //Endpoint_ClearSETUP();
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
              return;
           }
    
           if (port_cur == 0 &&
               USB_ControlRequest.bmRequestType == 0xA0 &&
               USB_ControlRequest.bRequest == 0x00 &&  // GET HUB STATUS
               USB_ControlRequest.wValue == 0x00 &&
               USB_ControlRequest.wIndex == 0x00 &&
               USB_ControlRequest.wLength == 0x04) {
              //Endpoint_ClearSETUP();
              //Endpoint_Write_Word_LE(0x0000); // wHubStatus
              //Endpoint_Write_Word_LE(0x0000); // wHubChange
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
              unsigned short* Empty = {0x0000, 0x0000};
              UsbWriteData(Empty, 4); // wHubStatus, wHubChange
              return;
           }
    
           if (port_cur == 0 &&
               USB_ControlRequest.bmRequestType == 0xA3 && 
               USB_ControlRequest.bRequest == 0x00 &&   //  GET PORT STATUS
               USB_ControlRequest.wValue == 0x00 &&
               USB_ControlRequest.wLength == 0x04) {
              unsigned char p = USB_ControlRequest.wIndex;
              if (p < 1 || p > 6) return;
    
              //Endpoint_ClearSETUP();
              //Endpoint_Write_Word_LE(port_status[p - 1]); // wHubStatus
              //Endpoint_Write_Word_LE(port_change[p - 1]); // wHubChange
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
    
              unsigned char* Package = {port_status[p - 1], port_status[p], port_change[p - 1], port_change[p]};
              UsbWriteData(Package, 4); // wHubStatus, wHubChange
              return;
           }
    
           if (port_cur == 0 &&
               USB_ControlRequest.bmRequestType == 0x23 &&
               USB_ControlRequest.bRequest == 0x03 && // SET_FEATURE
               USB_ControlRequest.wLength == 0x00) {
              unsigned char p = USB_ControlRequest.wIndex;
              if (p < 1 || p > 6) return;
    
              //Endpoint_ClearSETUP();
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
    
              switch(USB_ControlRequest.wValue) {
              case 0x0008: // PORT_POWER
                 if (p == 6 && state == init) {
                    /* after the 6th port is powered, wait a bit and continue */
                    state = hub_ready;
                    expire = 15;
                 }
                 break;
              case 0x0004: // PORT_RESET
                 hub_int_response = (1 << p);
                 port_change[p - 1] |= C_PORT_RESET;
                 break;
              }
              return;
           }
    
           if (port_cur == 0 &&
               USB_ControlRequest.bmRequestType == 0x23 &&
               USB_ControlRequest.bRequest == 0x01 && // CLEAR_FEATURE
               USB_ControlRequest.wLength == 0x00) {
              unsigned char p = USB_ControlRequest.wIndex;
              if (p < 1 || p > 6) return;
    
              //Endpoint_ClearSETUP();
              //Endpoint_ClearIN();
              //Endpoint_ClearStatusStage();
    
              switch(USB_ControlRequest.wValue) {
              case 0x0010: // C_PORT_CONNECTION
                 port_change[p - 1] &= ~C_PORT_CONN;
                 last_port_conn_clear = p;
                 break;
              case 0x0014: // C_PORT_RESET
                 port_change[p - 1] &= ~C_PORT_RESET;
                 last_port_reset_clear = p;
                 break;
              }
              return;
           }
    
           PsGroove_Panic();
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_JIG_Task                                                */
        /*------------------------------------------------------------------------------*/
        const unsigned char jig_response[64] = {
           0x80, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xee, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xee, 0x88,
           0x80, 0x00, 0x00, 0x00, 0x00, 0x33, 0xe7, 0x20, 0xe8, 0x83, 0xff, 0xf0, 0xe8, 0x63, 0xff, 0xf8,
           0xe8, 0xa3, 0x00, 0x18, 0x38, 0x63, 0x10, 0x00, 0x7c, 0x04, 0x28, 0x00, 0x40, 0x82, 0xff, 0xf4,
           0x38, 0xc3, 0xf0, 0x20, 0x7c, 0xc9, 0x03, 0xa6, 0x4e, 0x80, 0x04, 0x20, 0x04, 0x00, 0x00, 0x00,
        };
        void PsGroove_JIG_Task(void)
        {
           static int bytes_out = 0, bytes_in = 0;
           unsigned char buffer[0x100];
           
           //Endpoint_Discard_Stream(8, NO_STREAM_CALLBACK);
            UsbReadData(buffer, 8);
           bytes_out += 8;
           if (bytes_out >= 64)
           {
              state = p5_challenged;
              expire = 50; // was 90
           }
           
            if (state == p5_challenged && expire == 0)
           {
              if (bytes_in < 64) {
                 UsbWriteData(&jig_response[bytes_in], 8);
                 bytes_in += 8;
                 if (bytes_in >= 64) {
                    state = p5_responded;
                    expire = 15;
                 }
              }
           }
        }
    
        /*------------------------------------------------------------------------------*/
        /*PsGroove_Start                                                */
        /*------------------------------------------------------------------------------*/
        void PsGroove_Start()
        {
           //TODO: start the timer.... (PsGroove_Timer each 10 ms.)
           state = init;
           PsGroove_PsGroove_Switch_Port(0);
    
           for (;;)
           {
              /*if (port_cur == 0)
                 HUB_Task();*/
    
              if (port_cur == 5)
                 PsGroove_JIG_Task();
    
    
              // connect 1
              if (state == hub_ready && expire == 0)
              {
                 PsGroove_Connect_Port(1);
                 state = p1_wait_reset;
              }
    
              if (state == p1_wait_reset && last_port_reset_clear == 1)
              {
                 PsGroove_Switch_Port(1);
                 state = p1_wait_enumerate;
              }
    
              // connect 2
              if (state == p1_ready && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Connect_Port(2);
                 state = p2_wait_reset;
              }
    
              if (state == p2_wait_reset && last_port_reset_clear == 2)
              {
                 PsGroove_Switch_Port(2);
                 state = p2_wait_enumerate;
              }
    
              // connect 3
              if (state == p2_ready && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Connect_Port(3);
                 state = p3_wait_reset;
              }
    
              if (state == p3_wait_reset && last_port_reset_clear == 3)
              {
                 PsGroove_Switch_Port(3);
                 state = p3_wait_enumerate;
              }
    
              // disconnect 2
              if (state == p3_ready && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Disconnect_Port(2);
                 state = p2_wait_disconnect;
              }
    
              if (state == p2_wait_disconnect && last_port_conn_clear == 2)
              {
                 state = p4_wait_connect;
                 expire = 15;
              }
    
              // connect 4
              if (state == p4_wait_connect && expire == 0)
              {
                 PsGroove_Connect_Port(4);
                 state = p4_wait_reset;
              }
    
              if (state == p4_wait_reset && last_port_reset_clear == 4)
              {
                 PsGroove_Switch_Port(4);
                 state = p4_wait_enumerate;
              }
    
              // connect 5
              if (state == p4_ready && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 /* When first connecting port 5, we need to
                    have the wrong data toggle for the PS3 to
                    respond */
                 hub_int_force_data0 = 1;
                 PsGroove_Connect_Port(5);
                 state = p5_wait_reset;
              }
    
              if (state == p5_wait_reset && last_port_reset_clear == 5)
              {
                 PsGroove_Switch_Port(5);
                 state = p5_wait_enumerate;
              }
    
              // disconnect 3
              if (state == p5_responded && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 /* Need wrong data toggle again */
                 hub_int_force_data0 = 1;
                 PsGroove_Disconnect_Port(3);
                 state = p3_wait_disconnect;
              }
    
              if (state == p3_wait_disconnect && last_port_conn_clear == 3)
              {
                 state = p3_disconnected;
                 expire = 45;
              }
    
              // disconnect 5
              if (state == p3_disconnected && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Disconnect_Port(5);
                 state = p5_wait_disconnect;
              }
    
              if (state == p5_wait_disconnect && last_port_conn_clear == 5)
              {
                 state = p5_disconnected;
                 expire = 20;
              }
    
              // disconnect 4
              if (state == p5_disconnected && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Disconnect_Port(4);
                 state = p4_wait_disconnect;
              }
    
              if (state == p4_wait_disconnect && last_port_conn_clear == 4)
              {
                 state = p4_disconnected;
                 expire = 20;
              }
    
              // disconnect 1
              if (state == p4_disconnected && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Disconnect_Port(1);
                 state = p1_wait_disconnect;
              }
    
              if (state == p1_wait_disconnect && last_port_conn_clear == 1)
              {
                 state = p1_disconnected;
                 expire = 20;
              }
    
              // connect 6
              if (state == p1_disconnected && expire == 0)
              {
                 PsGroove_Switch_Port(0);
                 PsGroove_Connect_Port(6);
                 state = p6_wait_reset;
              }
    
              if (state == p6_wait_reset && last_port_reset_clear == 6)
              {
                 PsGroove_Switch_Port(6);
                 state = p6_wait_enumerate;
              }
    
              // done
              if (state == done)
              {
                 //TODO: Great!
              }
           }
        }
    It seems this guy has tried some to give an idea that maybe someone with enough knowledge can develop further.

  7. #37
    Registered User chesteruhi's Avatar
    Join Date
    Sep 2010
    Posts
    4
    All BlackcatUSBs (from version 1.2 on) use the same microcontroller (AT90USB162) and use the same software, drivers, and avr firmware. The only difference in the pcb versions is cosmetic. So the BlackcatUSBs will all work no need to worry which one your buying,. I have confirmed this. So purchase away before there all gone!

    [Register or Login to view links]

    I have attached a newer blackcatusb-fixed-leds hex for flashing and the manager pkg.

    This hex is recompiled with working leds, the blue led now lights up once exploit is running blue led turns off "basically lets you know you did everything right"

    Also thanks evilsperm for your well written instructions I have included these with the zip.

    Thank You!
    Attached Files Attached Files

  8. #38
    Registered User gldntch's Avatar
    Join Date
    Sep 2010
    Posts
    1

    For those who are having trouble programming AT90USBKEY

    Sharing a little solution to flashing an AT90USBkey (specificallyAT90USB1287 -However it should work for all ATMEL AVR boards).

    First downoad the FLIP Software here:[Register or Login to view links]

    Second: You have to put your AT90USB device in programming mode: When you are ready to start programming the device you will need to do a hard reset of the AT90USBKey. To do a hard reset of the key do the following:

    Press both “RST” and “HWB” push buttons down simultaneously
    First release the “RST” push button
    Then release the “HWB” push button
    When this is done one of the following will likely occur:
    a) You will be prompted for drivers for the new device.
    b) The system will already support the device.

    Case (b) is most likely going to occur if the device is left in its original configuration. To ensure that the device is in fact connected and detected, check the listing of devices on your machine.

    Remaining piece of the flashing can be following from the guides section. Good Luck!

  9. #39
    Contributor darksithlord's Avatar
    Join Date
    May 2008
    Posts
    12
    I'm only seeing one button on mine and tibias the red one on top it says on the board nit is version 1.6 so any help getting this working would be greatly appreciated.

  10. #40
    Registered User malibuman's Avatar
    Join Date
    Sep 2010
    Posts
    1
    Quote Originally Posted by proskopina View Post
    1. Put the black cat in DFU mode by flipping the switches to 1 and 2 then connect it to your PC and press the reset button on the blackcat.
    2. Open up device manager
    3. Click Action in the menu bar and add new legacy hardware
    4. Click install the hardware that I select manually.
    5. Highlight Show all devices and click next
    6. Click Have Disk, then browse to C:\Program Files (x86)\Atmel\Flip 3.4.1\usb\
    7. Select atmel_usb_dfu.inf
    8. After the driver installs just hit the reset button on the blackcat again and it will show up correctly.
    9. Now open up Atmel Flip and select device at90usb162 from the little microchip in the top left
    10. now click the usb icon and click usb, then click connect.
    11. Load the hex file and flash.
    12. flip the 1 and 2 switches back to operational mode and your done
    I want to thank you for that little tutorial. I was having trouble with my blackcat yesterday and remembered reading this. That done the trick.

 

Sponsored Links
Page 4 of 5 FirstFirst ... 2345 LastLast
Affiliates - Contact Us - PS3 Downloads - Privacy Statement - Site Rules - Top - © 2014 PlayStation 3 News