Fixes for compiling with modern DevKitPPC versions

This commit is contained in:
Peter0x44 2022-04-19 11:39:21 +01:00
parent e270886303
commit 26f884578e
No known key found for this signature in database
GPG Key ID: A8DEAD1A4BB82440
6 changed files with 72 additions and 5 deletions

67
include/wiidrc/wiidrc.h Normal file
View File

@ -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

BIN
lib/libwiidrc.a Normal file

Binary file not shown.

View File

@ -11,7 +11,7 @@ More info : http://frontier-dev.net
#include <malloc.h>
#include "pngu.h"
#include <png.h>
#include <string.h>
// Constants
#define PNGU_SOURCE_BUFFER 1

View File

@ -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();

View File

@ -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);

View File

@ -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);