diff --git a/include/wiidrc/wiidrc.h b/include/wiidrc/wiidrc.h new file mode 100644 index 0000000..32657f0 --- /dev/null +++ b/include/wiidrc/wiidrc.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2017 FIX94 + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ +#ifndef _WIIDRC_H_ +#define _WIIDRC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +struct WiiDRCData { + s16 xAxisL; + s16 xAxisR; + s16 yAxisL; + s16 yAxisR; + u16 button; + u8 battery; + u8 extra; +}; + +#define WIIDRC_BUTTON_A 0x8000 +#define WIIDRC_BUTTON_B 0x4000 +#define WIIDRC_BUTTON_X 0x2000 +#define WIIDRC_BUTTON_Y 0x1000 +#define WIIDRC_BUTTON_LEFT 0x0800 +#define WIIDRC_BUTTON_RIGHT 0x0400 +#define WIIDRC_BUTTON_UP 0x0200 +#define WIIDRC_BUTTON_DOWN 0x0100 +#define WIIDRC_BUTTON_ZL 0x0080 +#define WIIDRC_BUTTON_ZR 0x0040 +#define WIIDRC_BUTTON_L 0x0020 +#define WIIDRC_BUTTON_R 0x0010 +#define WIIDRC_BUTTON_PLUS 0x0008 +#define WIIDRC_BUTTON_MINUS 0x0004 +#define WIIDRC_BUTTON_HOME 0x0002 +#define WIIDRC_BUTTON_SYNC 0x0001 + +#define WIIDRC_EXTRA_BUTTON_L3 0x80 +#define WIIDRC_EXTRA_BUTTON_R3 0x40 +#define WIIDRC_EXTRA_BUTTON_TV 0x20 +#define WIIDRC_EXTRA_OVERLAY_TV 0x10 +#define WIIDRC_EXTRA_OVERLAY_POWER 0x01 + +bool WiiDRC_Init(); +bool WiiDRC_Inited(); +bool WiiDRC_Recalibrate(); +bool WiiDRC_ScanPads(); +bool WiiDRC_Connected(); +bool WiiDRC_ShutdownRequested(); +const u8 *WiiDRC_GetRawI2CAddr(); +const struct WiiDRCData *WiiDRC_Data(); +u32 WiiDRC_ButtonsUp(); +u32 WiiDRC_ButtonsDown(); +u32 WiiDRC_ButtonsHeld(); +s16 WiiDRC_lStickX(); +s16 WiiDRC_lStickY(); +s16 WiiDRC_rStickX(); +s16 WiiDRC_rStickY(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/libwiidrc.a b/lib/libwiidrc.a new file mode 100644 index 0000000..2aff744 Binary files /dev/null and b/lib/libwiidrc.a differ diff --git a/source/libpng/pngu/pngu.c b/source/libpng/pngu/pngu.c index 2f6a3b2..a52b6d3 100644 --- a/source/libpng/pngu/pngu.c +++ b/source/libpng/pngu/pngu.c @@ -11,7 +11,7 @@ More info : http://frontier-dev.net #include #include "pngu.h" #include - +#include // Constants #define PNGU_SOURCE_BUFFER 1 diff --git a/source/sys.c b/source/sys.c index ebb8fb4..e84ab28 100644 --- a/source/sys.c +++ b/source/sys.c @@ -12,8 +12,8 @@ /* Variables */ static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys"; - -void __Sys_ResetCallback(void) +u32 boot2version; +void __Sys_ResetCallback(__attribute__((unused)) u32 irq, __attribute__((unused)) void *ctx) { /* Reboot console */ Sys_Reboot(); diff --git a/source/sys.h b/source/sys.h index 419ed68..766bffe 100644 --- a/source/sys.h +++ b/source/sys.h @@ -1,7 +1,7 @@ #ifndef _SYS_H_ #define _SYS_H_ -u32 boot2version; +extern u32 boot2version; /* Prototypes */ bool isIOSstub(u8 ios_number); bool loadIOS(int ios); diff --git a/source/title.c b/source/title.c index 76fe3a6..fb6b00d 100644 --- a/source/title.c +++ b/source/title.c @@ -62,7 +62,7 @@ s32 Title_FakesignTMD(signed_blob *p_tmd) sha1 hash; /* Modify TMD fill field */ - tmd_data->fill3 = fill; + tmd_data->fill2 = fill; /* Calculate hash */ SHA1((u8 *)tmd_data, TMD_SIZE(tmd_data), hash);