diff --git a/NEWS.md b/NEWS.md index bf5daa621..181437955 100644 --- a/NEWS.md +++ b/NEWS.md @@ -58,10 +58,11 @@ Changes since v4.406: * File extensions .iso, .gcm, .cso, and .ciso are supported. * The game list now colorizes game names based on their file format: * Black: 1:1 full rip - * Dark Brown: Shrunken GCM + * Dark Brown: Shrunken * Green: Extracted FST * Blue: CISO * Purple: Multi-Game + * Dark Yellow: Oversized * Fixed an issue where pressing the Home button in the Settings menu after changing a setting crashed the loader. * Grayed out settings that don't apply to the current system, e.g. Wii U diff --git a/common/include/NintendontVersion.h b/common/include/NintendontVersion.h index 22a0e2bb2..8278e0658 100644 --- a/common/include/NintendontVersion.h +++ b/common/include/NintendontVersion.h @@ -2,7 +2,7 @@ #define __NINTENDONT_VERSION_H__ #define NIN_MAJOR_VERSION 6 -#define NIN_MINOR_VERSION 501 +#define NIN_MINOR_VERSION 503 #define NIN_VERSION ((NIN_MAJOR_VERSION << 16) | NIN_MINOR_VERSION) diff --git a/controllerconfigs/controller_Qanba_Drone_N2.ini b/controllerconfigs/controller_Qanba_Drone_N2.ini new file mode 100644 index 000000000..47fbfa2ed --- /dev/null +++ b/controllerconfigs/controller_Qanba_Drone_N2.ini @@ -0,0 +1,51 @@ +[Controller (QANBA DRONE ARCADE JOYSTICK / PS4 mode)] +VID=2c22 +PID=2000 +Polltype=1 +DPAD=1 +DigitalLR=0 +A=05,80 +B=05,10 +X=06,02 +Y=05,20 +Z=06,01 +L=05,40 +R=06,08 +S=06,20 +Up=05,00 +Right=05,02 +Left=05,06 +Down=05,04 +UpLeft=05,07 +DownLeft=05,05 +DownRight=05,03 +RightUp=05,01 +Power=06,10 +StickX=1 +StickY=2 +CStickX=3 +CStickY=4 +MultiIn=0 +LAnalog=0 +RAnalog=0 + +#QANBA DRONE ARCADE JOYSTICK for Nintendon't +#--------------------------------------------- +#Controller Type: Arcade-style +#Rumble Support: No +#Special Features: Turbo button, Switch button for Analog/D-Pad + + +#Button Setup: +# Joystick: GameCube D-Pad +# Green LED Mode button: Control Stick +# Red LED Mode button: C Stick +# Button Square: B +# Button Triangle: A +# Button R1: X +# Button X: Y +# Button O: L +# Button R2: R +# Button L1: Z +# Button Option: Start/Pause +# Button Share: Power off \ No newline at end of file diff --git a/controllerconfigs/controller_brook_zero_pi_easy.ini b/controllerconfigs/controller_brook_zero_pi_easy.ini new file mode 100644 index 000000000..8a62367c5 --- /dev/null +++ b/controllerconfigs/controller_brook_zero_pi_easy.ini @@ -0,0 +1,30 @@ +[Brook Zero Pi Easy fighting board] +VID=0F0D +PID=00AA +Polltype=1 +DPAD=1 +DigitalLR=1 +MultiIn=0 +LAnalog=0 +RAnalog=0 +Power=1,10 +Left=2,06 +Down=2,04 +Right=2,02 +Up=2,00 +RightUp=2,01 +DownRight=2,03 +DownLeft=2,05 +UpLeft=2,07 +A=0,08 +B=0,01 +X=0,20 +Y=0,02 +Z=0,10 +L=0,80 +R=0,40 +S=1,02 +StickX=3 +StickY=4 +CStickX=5 +CStickY=6 \ No newline at end of file diff --git a/controllerconfigs/controller_ps4.ini b/controllerconfigs/controller_ps4.ini index 178bd8515..4be26707f 100644 --- a/controllerconfigs/controller_ps4.ini +++ b/controllerconfigs/controller_ps4.ini @@ -26,4 +26,11 @@ StickY=2 CStickX=3 CStickY=4 LAnalog=8 -RAnalog=9 \ No newline at end of file +RAnalog=9 +Rumble=1 +RumbleType=1 +RumbleDataLen=06 +RumbleDataOn=05,01,00,00,FF,FF +RumbleDataOff=05,01,00,00,00,00 +RumbleTransferLen=06 +RumbleTransfers=1 \ No newline at end of file diff --git a/controllerconfigs/controller_ps4v2.ini b/controllerconfigs/controller_ps4v2.ini index 4c65db27f..0e69521d1 100644 --- a/controllerconfigs/controller_ps4v2.ini +++ b/controllerconfigs/controller_ps4v2.ini @@ -26,4 +26,11 @@ StickY=2 CStickX=3 CStickY=4 LAnalog=8 -RAnalog=9 \ No newline at end of file +RAnalog=9 +Rumble=1 +RumbleType=1 +RumbleDataLen=06 +RumbleDataOn=05,01,00,00,FF,FF +RumbleDataOff=05,01,00,00,00,00 +RumbleTransferLen=06 +RumbleTransfers=1 \ No newline at end of file diff --git a/controllerconfigs/controller_ps5_edge.ini b/controllerconfigs/controller_ps5_edge.ini new file mode 100644 index 000000000..a0ab8d4d7 --- /dev/null +++ b/controllerconfigs/controller_ps5_edge.ini @@ -0,0 +1,29 @@ +[DualSense Edge] +VID=054C +PID=0DF2 +Polltype=1 +DPAD=1 +DigitalLR=2 +Power=9,10 +A=8,40 +B=8,20 +X=8,80 +Y=8,10 +Z=9,02 +L=9,04 +R=9,08 +S=9,20 +Left=8,06 +Down=8,04 +Right=8,02 +Up=8,00 +RightUp=8,01 +DownRight=8,03 +DownLeft=8,05 +UpLeft=8,07 +StickX=1 +StickY=2 +CStickX=3 +CStickY=4 +LAnalog=5 +RAnalog=6 diff --git a/controllerconfigs/controllers.zip b/controllerconfigs/controllers.zip index 6503768ee..aacb32ad6 100644 Binary files a/controllerconfigs/controllers.zip and b/controllerconfigs/controllers.zip differ diff --git a/kernel/DI.c b/kernel/DI.c index 96fdbd776..41a6d221e 100644 --- a/kernel/DI.c +++ b/kernel/DI.c @@ -590,13 +590,6 @@ void DIUpdateRegisters( void ) #endif memcpy( NetworkCMDBuffer + roffset, (void*)Buffer, Length ); } - // Max GC disc offset - if( Offset >= 0x57058000 ) - { - dbgprintf("Unhandled Media Board Write\n"); - dbgprintf("GCAM:Write( 0x%08x, 0x%08x, 0x%08x )\n", Offset, Length, Buffer|0x80000000 ); - Shutdown(); - } DIOK = 2; } break; case 0xAB: @@ -758,13 +751,6 @@ void DIUpdateRegisters( void ) } else { - // Max GC disc offset - if( Offset >= 0x57058000 ) - { - dbgprintf("Unhandled Read\n"); - dbgprintf("DIP:DVDRead%02X( 0x%08x, 0x%08x, 0x%08x )\n", DIcommand, Offset, Length, rawAddr ); - Shutdown(); - } if( Buffer < 0x01800000 || // Valid GC Buffer rawAddr == 0x931C1800 ) //PSO Ep.III Hack { diff --git a/kernel/HID.c b/kernel/HID.c index bcab215bf..3557892bc 100644 --- a/kernel/HID.c +++ b/kernel/HID.c @@ -724,6 +724,9 @@ static s32 HIDInterruptMessage(u32 isKBreq, u8 *Data, u32 Length, u32 Endpoint, } void HIDGCInit() { + // Needed for some adapters clone + HIDControlMessage(0, NULL, 0, USB_REQTYPE_INTERFACE_SET, USB_REQ_SETPROTOCOL, 1, 0, NULL); + s32 ret = HIDInterruptMessage(0, gcbuf, 1, bEndpointAddressOut, 0, NULL); if( ret < 0 ) { diff --git a/kernel/HID_controllers.h b/kernel/HID_controllers.h index 67b4b57dd..fdc38d332 100644 --- a/kernel/HID_controllers.h +++ b/kernel/HID_controllers.h @@ -118,9 +118,16 @@ u8 RumbleDataOn_0079_0006[14] = { 0x51, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xfa u8 RumbleDataOff_0079_0006[14] = { 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00 }; u8 RumbleDataOn_0810_0001[5] = { 0x01, 0x00, 0x00, 0x7f, 0x7f }; u8 RumbleDataOff_0810_0001[5] = { 0x01, 0x00, 0x00, 0x00, 0x00 }; +u8 RumbleDataOn_054C_05C4[6] = { 0x05, 0x01, 0x00, 0x00, 0xff, 0xff }; +u8 RumbleDataOff_054C_05C4[6] = { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00 }; +u8 RumbleDataOn_054C_09CC[6] = { 0x05, 0x01, 0x00, 0x00, 0xff, 0xff }; +u8 RumbleDataOff_054C_09CC[6] = { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00 }; + rumble DefRumble[] = { { 0x0079, 0x0006, 1, 14, 2, 7, RumbleDataOn_0079_0006, RumbleDataOff_0079_0006 }, + { 0x054C, 0x05C4, 1, 6, 1, 6, RumbleDataOn_054C_05C4, RumbleDataOff_054C_05C4 }, + { 0x054C, 0x09CC, 1, 6, 1, 6, RumbleDataOn_054C_09CC, RumbleDataOff_054C_09CC }, { 0x0810, 0x0001, 0, 5, 1, 5, RumbleDataOn_0810_0001, RumbleDataOff_0810_0001 }, }; diff --git a/kernel/Patch.c b/kernel/Patch.c index e3cb959fe..0bca7cf2e 100644 --- a/kernel/Patch.c +++ b/kernel/Patch.c @@ -472,6 +472,7 @@ static void Patch31A0( void ) u32 CurBuf = read32(0x319C); //create jump for it PatchB(PatchOffset, 0x319C); + sync_after_write((void *)0x319C, 4); if ((CurBuf & 0xFC000002) == 0x40000000) { u32 Orig = CurBuf; @@ -1444,7 +1445,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset ) PatchBL(PatchCopy(SonicRidersCopy, SonicRidersCopy_size), SONICRIDERS_HOOK_PAL); dbgprintf("Patch:Patched Sonic Riders _Main.rel PAL\r\n"); } /* Agressive Timer Patches for Nintendo Puzzle Collection */ - else if( (GAME_ID) == 0x47505A4A && useipl == 0 ) + else if( (TITLE_ID) == 0x47505A && useipl == 0 ) { u32 t; for(t = 0; t < Length; t+=4) //make sure its patched at all times @@ -1698,7 +1699,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset ) { if(TITLE_ID == 0x474D34 || TITLE_ID == 0x474B59 || TITLE_ID == 0x475445) bbaEmuWanted = 1; - else if(GAME_ID == 0x4748454A || isPSO) + else if(TITLE_ID == 0x474845 || isPSO) bbaEmuWanted = 2; } else @@ -3885,7 +3886,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset ) write32(SO_HSP_LOC+0x18, SOShift << 16 | SOCurrentTotalFDs); write32(SO_HSP_LOC+0x1C, 0); //needs to be inited sync_after_write((void*)SO_HSP_LOC, 0x20); - if(GAME_ID == 0x4748454A) + if(TITLE_ID == 0x474845) { if(read32(0x6E88) == 0x4804E39D) { @@ -3901,7 +3902,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset ) } } } - else if(GAME_ID == 0x4748454A && read32(0x5DD4) == 0x480AF13D) + else if(TITLE_ID == 0x474845 && read32(0x5DD4) == 0x480AF13D) { write32(0x5DCC, 0x3C600402); write32(0x5DD0, 0x60630200); diff --git a/kernel/PatchCodes.h b/kernel/PatchCodes.h index c8f34bce6..20d14e787 100644 --- a/kernel/PatchCodes.h +++ b/kernel/PatchCodes.h @@ -62,6 +62,7 @@ #include "asm/SOClose.h" #include "asm/SOListen.h" #include "asm/SOAccept.h" +#include "asm/SOConnect.h" #include "asm/SOBind.h" #include "asm/SOShutdown.h" #include "asm/SORecvFrom.h" diff --git a/kernel/asm/SOConnect.S b/kernel/asm/SOConnect.S new file mode 100644 index 000000000..45571e62d --- /dev/null +++ b/kernel/asm/SOConnect.S @@ -0,0 +1,8 @@ +#include +.include "constants.inc" + +SOConnect: + lis 0, SOConnectAddr@h + ori 0, 0, SOConnectAddr@l + mtctr 0 + bctr \ No newline at end of file diff --git a/kernel/asm/constants.inc b/kernel/asm/constants.inc index 3ed3b5116..989910a12 100644 --- a/kernel/asm/constants.inc +++ b/kernel/asm/constants.inc @@ -113,6 +113,7 @@ along with this program. If not, see . .set DHCP_get_gateway_Addr, IOSInterfaceAddr+0xA4 .set DHCP_get_dns_Addr, IOSInterfaceAddr+0xA8 .set DHCP_release_Addr, IOSInterfaceAddr+0xAC +.set SOConnectAddr, IOSInterfaceAddr+0xB0 /** Disc Interface **/ diff --git a/kernel/patches.c b/kernel/patches.c index 0746a21a2..bb6a742d4 100644 --- a/kernel/patches.c +++ b/kernel/patches.c @@ -586,6 +586,7 @@ static FuncPattern NinSOPatterns[] = { 0x30C, 69, 11, 27, 23, 10, SOCleanup, SOCleanup_size, "SOCleanup", "B", FGROUP_SOCleanup, 0 }, { 0x668, 133, 17, 45, 50, 16, SOSocket, SOSocket_size, "SOSocket", NULL, FGROUP_NONE, 0 }, { 0x454, 82, 23, 26, 28, 23, SOClose, SOClose_size, "__SOClose", NULL, FGROUP_NONE, 0 }, + { 0x154, 13, 13, 13, 13, 1, SOConnect, SOConnect_size, "SOConnect", NULL, FGROUP_NONE, 0 }, { 0x128, 15, 6, 4, 21, 3, SOListen, SOListen_size, "SOListen", NULL, FGROUP_NONE, 0 }, { 0x2BC, 44, 15, 18, 29, 6, SOAccept, SOAccept_size, "SOAccept", NULL, FGROUP_NONE, 0 }, { 0x120, 15, 4, 5, 25, 5, SOBind, SOBind_size, "SOBind", NULL, FGROUP_NONE, 0 }, diff --git a/loader/boot.dol b/loader/boot.dol new file mode 100644 index 000000000..12e0db0eb Binary files /dev/null and b/loader/boot.dol differ diff --git a/loader/include/menu.h b/loader/include/menu.h index 9728cece8..0c86bd272 100644 --- a/loader/include/menu.h +++ b/loader/include/menu.h @@ -34,6 +34,7 @@ typedef enum GIFLAG_FORMAT_FST = (2 << 0), // Extracted FST GIFLAG_FORMAT_CISO = (3 << 0), // CISO format GIFLAG_FORMAT_MULTI = (4 << 0), // Multi-game disc + GIFLAG_FORMAT_OVER = (5 << 0), // Oversized GIFLAG_FORMAT_MASK = (7 << 0), // Game region. (from bi2.bin) diff --git a/loader/loader.dol b/loader/loader.dol index 6d5f047a4..e7d99c69e 100644 Binary files a/loader/loader.dol and b/loader/loader.dol differ diff --git a/loader/source/ShowGameInfo.c b/loader/source/ShowGameInfo.c index 1a2971827..23305d8d8 100644 --- a/loader/source/ShowGameInfo.c +++ b/loader/source/ShowGameInfo.c @@ -177,7 +177,7 @@ static void DrawGameInfoScreen(const gameinfo *gi, const MD5VerifyState_t *md5) "Extracted FST", "Compressed ISO (Hermes uLoader format)", "Multi-Game Disc", - "Unknown (5)", + "Oversized", "Unknown (6)", "Unknown (7)", }; diff --git a/loader/source/menu.c b/loader/source/menu.c index 9ca452e47..9fb94634e 100644 --- a/loader/source/menu.c +++ b/loader/source/menu.c @@ -66,7 +66,7 @@ const u32 DiscFormatColors[8] = 0x00551AFF, // Extracted FST 0x001A55FF, // CISO 0x551A55FF, // Multi-Game - GRAY, // undefined + 0x55551AFF, // Oversized (dark yellow) GRAY, // undefined GRAY, // undefined }; @@ -193,6 +193,11 @@ static bool IsDiscImageValid(const char *filename, int discNumber, gameinfo *gi) // Full 1:1 GameCube image. gi->Flags = GIFLAG_FORMAT_FULL; } + else if (in.obj.objsize > 1459978240) + { + // Oversized GameCube image. + gi->Flags = GIFLAG_FORMAT_OVER; + } else { // Shrunken GameCube image. @@ -735,6 +740,7 @@ static bool UpdateGameSelectMenu(MenuCtx *ctx) PrintFormat(DEFAULT_SIZE, DiscFormatColors[2], MENU_POS_X+(21*10), MENU_POS_Y + 20*3, "FST"); PrintFormat(DEFAULT_SIZE, DiscFormatColors[3], MENU_POS_X+(25*10), MENU_POS_Y + 20*3, "CISO"); PrintFormat(DEFAULT_SIZE, DiscFormatColors[4], MENU_POS_X+(30*10), MENU_POS_Y + 20*3, "Multi"); + PrintFormat(DEFAULT_SIZE, DiscFormatColors[5], MENU_POS_X+(36*10), MENU_POS_Y + 20*3, "Over"); // Starting position. int gamelist_y = MENU_POS_Y + 20*5 + 10; diff --git a/loader/source/ppc/IOSInterface/source/_crt0.S b/loader/source/ppc/IOSInterface/source/_crt0.S index 99b539429..ea2d28828 100644 --- a/loader/source/ppc/IOSInterface/source/_crt0.S +++ b/loader/source/ppc/IOSInterface/source/_crt0.S @@ -45,6 +45,7 @@ .extern DHCP_get_gateway .extern DHCP_get_dns .extern DHCP_release + .extern SOConnect .globl __start __start: @@ -95,6 +96,7 @@ __start: b DHCP_get_gateway b DHCP_get_dns b DHCP_release + b SOConnect # just some helper functions .globl disableIRQs diff --git a/loader/source/ppc/PADReadGC/source/PADReadGC.c b/loader/source/ppc/PADReadGC/source/PADReadGC.c index 4157767ee..e4f4cfa3c 100644 --- a/loader/source/ppc/PADReadGC/source/PADReadGC.c +++ b/loader/source/ppc/PADReadGC/source/PADReadGC.c @@ -183,7 +183,7 @@ u32 PADRead(u32 calledByGame) if(drcbutton & WIIDRC_BUTTON_HOME) goto DoExit; //write in mapped out buttons Pad[WiiUGamepadSlot].button = button; - if((Pad[WiiUGamepadSlot].button&0x1030) == 0x1030) //reset by pressing start, Z, R + if((Pad[WiiUGamepadSlot].button&0x1900) == 0x1900) //reset by pressing A, Y, Start { /* reset status 3 */ *RESET_STATUS = 0x3DEA; @@ -301,8 +301,8 @@ u32 PADRead(u32 calledByGame) Pad[chan].triggerRight = 0; } - /* exit by pressing B,Z,R,PAD_BUTTON_DOWN */ - if((Pad[chan].button&0x234) == 0x234) + /* exit by pressing L, R, Start */ + if((Pad[chan].button&0x1060) == 0x1060) { goto DoExit; } @@ -346,7 +346,7 @@ u32 PADRead(u32 calledByGame) tempStick = -0x80; Pad[chan].substickY = (s8)tempStick; - if((Pad[chan].button&0x1030) == 0x1030) //reset by pressing start, Z, R + if((Pad[chan].button&0x1900) == 0x1900) //reset by pressing A, Y, Start { /* reset status 3 */ *RESET_STATUS = 0x3DEA; @@ -548,7 +548,7 @@ u32 PADRead(u32 calledByGame) button |= PAD_BUTTON_START; Pad[chan].button = button; - if((Pad[chan].button&0x1030) == 0x1030) //reset by pressing start, Z, R + if((Pad[chan].button&0x1900) == 0x1900) //reset by pressing A, Y, Start { /* reset status 3 */ *RESET_STATUS = 0x3DEA; @@ -1444,12 +1444,12 @@ u32 PADRead(u32 calledByGame) Pad[chan].stickY = Pad[chan].triggerLeft; #endif - //exit by pressing B,Z,R,PAD_BUTTON_DOWN - if((Pad[chan].button&0x234) == 0x234) + //exit by pressing L, R, Start + if((Pad[chan].button&0x1060) == 0x1060) { goto DoExit; } - if((Pad[chan].button&0x1030) == 0x1030) //reset by pressing start, Z, R + if((Pad[chan].button&0x1900) == 0x1900) //reset by pressing A, Y, Start { /* reset status 3 */ *RESET_STATUS = 0x3DEA;