copy homebuttonLib from oot-vc (#2960)

* initial copy of hbm from sdk_2009-12-11

* some more nw4hbm cleanup

* nw4hbm db mostly done

* nw4hbm snd copied from oot-vc

* nw4hbm ut copied

* nw4hbm lyt copied

* nw4hbm copied, mostly matching usa 1.0

* setup nw4hbm debug define

* fix HBMDataInfo struct

* add rvl sdk card lib
This commit is contained in:
TakaRikka
2025-12-16 06:55:07 -08:00
committed by GitHub
parent c8104b6d62
commit 8185d87f85
235 changed files with 32438 additions and 320 deletions
@@ -0,0 +1,8 @@
#ifndef STD_NEW_H_
#define STD_NEW_H_
#include <stdio.h>
inline void* (operator new)(size_t, void *ptr) { return ptr; }
#endif
@@ -39,6 +39,14 @@ inline float tan(float num) {
return ::i_tanf(num);
}
inline float tanf(float num) {
return ::i_tanf(num);
}
inline float acos(float num) {
return ::acosf(num);
}
inline float pow(float x, float y) {
return ::pow(x, y);
}
@@ -6,6 +6,14 @@
namespace std {
using ::strlen;
using ::strcpy;
using ::wcslen;
using ::strncpy;
using ::strcmp;
using ::strncmp;
using ::strcat;
using ::memset;
using ::memcpy;
inline char* strchr(char* str, int c) {
return ::strchr(str, c);
@@ -15,8 +15,17 @@ int snprintf(char* s, size_t n, const char* format, ...);
int vsnprintf(char* s, size_t n, const char* format, va_list arg);
int vprintf(const char* format, va_list arg);
int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg);
#if defined(__cplusplus)
namespace std {
extern "C" { using ::vsnprintf; }
extern "C" { using ::vswprintf; }
}
#endif
#ifdef __cplusplus
}
#endif
#endif /* _MSL_COMMON_PRINTF_H */
#endif /* _MSL_COMMON_PRINTF_H */
@@ -2,6 +2,7 @@
#define _MSL_COMMON_STRING_H
#include "stddef.h"
#include "ansi_files.h"
#ifdef __cplusplus
extern "C" {
@@ -22,6 +23,8 @@ char* strncpy(char* dst, const char* src, size_t n);
char* strcpy(char* dst, const char* src);
size_t strlen(const char* str);
size_t wcslen(const wchar_t* s);
#ifdef __cplusplus
};
#endif
@@ -1000,7 +1000,7 @@ static int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* Wr
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
} else {
long_double_num = va_arg(arg, f64);
long_double_num = va_arg(arg, double);
}
if (!(buff_ptr = float2str(long_double_num, buff + 512, format))) {
@@ -1015,7 +1015,7 @@ static int __pformatter(void* (*WriteProc)(void*, const char*, size_t), void* Wr
if (format.argument_options == long_double_argument) {
long_double_num = va_arg(arg, long double);
} else {
long_double_num = va_arg(arg, f64);
long_double_num = va_arg(arg, double);
}
if (!(buff_ptr = double2hex(long_double_num, buff + 512, format))) {
@@ -1,7 +1,9 @@
#ifndef __VA_ARG_H
#define __VA_ARG_H
#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct __va_list_struct {
char gpr;
@@ -13,11 +15,7 @@ typedef struct __va_list_struct {
typedef _va_list_struct __va_list[1];
#ifdef __cplusplus
extern "C" void* __va_arg(_va_list_struct*, int);
#else
void* __va_arg(_va_list_struct*, int);
#endif
#ifndef __MWERKS__
#define __builtin_va_info(...)
@@ -37,4 +35,12 @@ void* __va_arg(_va_list_struct*, int);
#define __va_copy(a, b) (*(a) = *(b))
#if defined(__cplusplus)
namespace std { extern "C" { using ::va_list; } }
#endif
#ifdef __cplusplus
}
#endif
#endif /* __VA_ARG_H */