Skip to content

Commit 364c626

Browse files
authored
Changes from spm-core (#23)
Breaking: None Other: - ptrdiff and intptr types in common.h - float_t/double_t and ceil in math.h - IOS_Write - RelSection type - seq_titleMain type
1 parent d7c7b7c commit 364c626

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

include/common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@ typedef int BOOL;
146146

147147
#define wchar_t s16
148148
typedef wchar_t wchar16_t;
149+
150+
typedef s32 ptrdiff_t;
151+
typedef s32 intptr_t;
152+
typedef u32 uintptr_t;
149153
#else
150154
#include <stddef.h>
151155
#include <stdbool.h>
156+
#include <stdint.h>
152157

153158
// wchar_t is 32-bit in GCC but 16-bit in CW
154159
typedef s16 wchar16_t;

include/msl/math.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
CPP_WRAPPER(msl::math)
66

7+
typedef float float_t;
8+
typedef double double_t;
9+
710
#define PI 3.141592653589793f
811
#define PIx2 (PI * 2.0f)
912

@@ -23,4 +26,7 @@ double sqrt(double x);
2326
#define fabsf(x) __fabsf(x)
2427
#define abs(x) __abs(x)
2528

29+
double ceil(double x);
30+
#define ceilf(x) ((f32)ceil(x))
31+
2632
CPP_WRAPPER_END()

include/wii/ipc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ s32 IOS_Close(s32 fd);
5252
UNKNOWN_FUNCTION(IOS_ReadAsync);
5353
s32 IOS_Read(s32 fd, void * dest, u32 length);
5454
UNKNOWN_FUNCTION(IOS_WriteAsync);
55-
UNKNOWN_FUNCTION(IOS_Write);
55+
s32 IOS_Write(s32 fd, const void * data, u32 length);
5656
UNKNOWN_FUNCTION(IOS_SeekAsync);
5757
UNKNOWN_FUNCTION(IOS_IoctlAsync);
5858
s32 IOS_Ioctl(s32 fd, s32 command, void * buf, u32 bufSize, void * ioBuf, u32 ioBufSize);

include/wii/os/OSModule.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ CPP_WRAPPER(wii::os)
66

77
typedef void (RelExportFunc)();
88

9+
typedef struct
10+
{
11+
union
12+
{
13+
u32 offset;
14+
void * address;
15+
};
16+
u32 size;
17+
} RelSection;
18+
919
// Unions are offsets in file then pointers after OSLink
1020
typedef struct _RelHeader
1121
{
@@ -16,7 +26,7 @@ typedef struct _RelHeader
1626
union
1727
{
1828
u32 sectionInfoOffset;
19-
void * sectionInfo;
29+
RelSection * sectionInfo;
2030
};
2131
union
2232
{

linker/spm.eu0.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@
462462
// more
463463

464464
// seq_title.c
465+
8017b250:seq_titleMain
465466
8017bc4c:getNextDanMapname
466467
// more
467468

0 commit comments

Comments
 (0)