mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
some MSL_C work (#192)
* wip * bunch of MSL_C files thanks to pikmin2 decomp for their work * format / asm * progress * fix * fix remove-asm to work with C files * init / start
This commit is contained in:
@@ -11,18 +11,18 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void fseek();
|
||||
extern "C" static void _fseek();
|
||||
extern "C" void ftell();
|
||||
void fseek();
|
||||
static void _fseek();
|
||||
void ftell();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __flush_buffer();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" extern u8 errno[4 + 4 /* padding */];
|
||||
void __flush_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
extern u8 errno[4 + 4 /* padding */];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -11,20 +11,20 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void exit();
|
||||
extern "C" void abort();
|
||||
extern "C" extern u8 data_804519A0[8];
|
||||
void exit();
|
||||
void abort();
|
||||
extern u8 data_804519A0[8];
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void _ExitProcess();
|
||||
extern "C" void __destroy_global_chain();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" void __kill_critical_regions();
|
||||
extern "C" void raise();
|
||||
void _ExitProcess();
|
||||
void __destroy_global_chain();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void __kill_critical_regions();
|
||||
void raise();
|
||||
SECTION_DTORS10 extern void* const __destroy_global_chain_reference;
|
||||
|
||||
//
|
||||
@@ -35,18 +35,23 @@ SECTION_DTORS10 extern void* const __destroy_global_chain_reference;
|
||||
/* 8044D440-8044D540 07A160 0100+00 2/2 0/0 0/0 .bss __atexit_funcs */
|
||||
static u8 __atexit_funcs[256];
|
||||
|
||||
/* 80451990-80451994 000E90 0004+00 2/2 0/0 0/0 .sbss __aborting */
|
||||
static u8 __aborting[4];
|
||||
/* ############################################################################################## */
|
||||
/* 804519A0-804519A8 000EA0 0008+00 0/0 1/1 0/0 .sbss None */
|
||||
extern u8 data_804519A0[8];
|
||||
u8 data_804519A0[8];
|
||||
|
||||
/* 80451994-80451998 000E94 0004+00 2/2 0/0 0/0 .sbss __atexit_curr_func */
|
||||
static u8 __atexit_curr_func[4];
|
||||
/* 8045199C-804519A0 000E9C 0004+00 2/2 0/0 0/0 .sbss __console_exit */
|
||||
static u8 __console_exit[4];
|
||||
|
||||
/* 80451998-8045199C 000E98 0004+00 1/1 1/1 0/0 .sbss __stdio_exit */
|
||||
extern u8 __stdio_exit[4];
|
||||
u8 __stdio_exit[4];
|
||||
|
||||
/* 8045199C-804519A0 000E9C 0004+00 2/2 0/0 0/0 .sbss __console_exit */
|
||||
static u8 __console_exit[4];
|
||||
/* 80451994-80451998 000E94 0004+00 2/2 0/0 0/0 .sbss __atexit_curr_func */
|
||||
static u8 __atexit_curr_func[4];
|
||||
|
||||
/* 80451990-80451994 000E90 0004+00 2/2 0/0 0/0 .sbss __aborting */
|
||||
static u8 __aborting[4];
|
||||
|
||||
/* 803629CC-80362ABC 35D30C 00F0+00 0/0 2/2 0/0 .text exit */
|
||||
#pragma push
|
||||
@@ -67,8 +72,3 @@ asm void abort() {
|
||||
#include "asm/MSL_C/MSL_Common/Src/abort_exit/abort.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804519A0-804519A8 000EA0 0008+00 0/0 1/1 0/0 .sbss None */
|
||||
extern u8 data_804519A0[8];
|
||||
u8 data_804519A0[8];
|
||||
@@ -11,20 +11,20 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void free();
|
||||
extern "C" void __pool_free();
|
||||
extern "C" static void deallocate_from_fixed_pools();
|
||||
extern "C" static void deallocate_from_var_pools();
|
||||
void free();
|
||||
void __pool_free();
|
||||
static void deallocate_from_fixed_pools();
|
||||
static void deallocate_from_var_pools();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memset();
|
||||
extern "C" void __sys_free();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" extern u8 data_804519A0[8];
|
||||
void __sys_free();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
extern u8 data_804519A0[8];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -0,0 +1,181 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/ansi_files
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
unsigned int __flush_all();
|
||||
void __close_all();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void free(FILE*);
|
||||
void __end_critical_region(int);
|
||||
void __begin_critical_region(int);
|
||||
int fflush(FILE*);
|
||||
void fclose(FILE*);
|
||||
int __close_console(unsigned int);
|
||||
int __write_console(int, int, int*, int);
|
||||
int __read_console(unsigned int, unsigned int, unsigned int*);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D778-8044D878 07A498 0100+00 1/0 0/0 0/0 .bss stdin_buff */
|
||||
static u8 stdin_buff[0x100];
|
||||
|
||||
/* 8044D678-8044D778 07A398 0100+00 1/0 0/0 0/0 .bss stdout_buff */
|
||||
static u8 stdout_buff[0x100];
|
||||
|
||||
/* 8044D578-8044D678 07A298 0100+00 1/0 0/0 0/0 .bss stderr_buff */
|
||||
static u8 stderr_buff[0x100];
|
||||
|
||||
/* 803D29B0-803D2AF0 -00001 0140+00 3/2 15/15 0/0 .data __files */
|
||||
SECTION_DATA extern files __files = {
|
||||
{0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdin_buff,
|
||||
0x00000100,
|
||||
stdin_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stdout},
|
||||
{1,
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdout_buff,
|
||||
0x00000100,
|
||||
stdout_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stderr},
|
||||
{2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stderr_buff,
|
||||
0x00000100,
|
||||
stderr_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.empty},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0},
|
||||
{0, 0}, 0, NULL, 0x00000000, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL},
|
||||
};
|
||||
|
||||
/* 8036300C-8036307C 35D94C 0070+00 0/0 2/2 0/0 .text __flush_all */
|
||||
unsigned int __flush_all(void) {
|
||||
unsigned int ret = 0;
|
||||
FILE* file = &__files.stdin;
|
||||
|
||||
while (file) {
|
||||
if (file->file_mode.file_kind != 0 && fflush(file)) {
|
||||
ret = -1;
|
||||
}
|
||||
file = file->next_file;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 8036307C-80363124 35D9BC 00A8+00 0/0 1/1 0/0 .text __close_all */
|
||||
void __close_all(void) {
|
||||
FILE* file = &__files.stdin;
|
||||
FILE* last_file;
|
||||
|
||||
__begin_critical_region(2);
|
||||
|
||||
while (file != NULL) {
|
||||
if (file->file_mode.file_kind != CLOSED_FILE) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
last_file = file;
|
||||
file = file->next_file;
|
||||
|
||||
if (last_file->flag) {
|
||||
free(last_file);
|
||||
} else {
|
||||
last_file->file_mode.file_kind = UNAVAILABLE_FILE;
|
||||
if (file != NULL && file->flag) {
|
||||
last_file->next_file = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__end_critical_region(2);
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/ansi_files
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __flush_all();
|
||||
extern "C" void __close_all();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void free();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" void fflush();
|
||||
extern "C" void fclose();
|
||||
extern "C" bool __close_console();
|
||||
extern "C" void __write_console();
|
||||
extern "C" void __read_console();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8044D578-8044D678 07A298 0100+00 1/0 0/0 0/0 .bss stderr_buff */
|
||||
extern "C" u8 stderr_buff[256];
|
||||
|
||||
/* 8044D678-8044D778 07A398 0100+00 1/0 0/0 0/0 .bss stdout_buff */
|
||||
extern "C" u8 stdout_buff[256];
|
||||
|
||||
/* 8044D778-8044D878 07A498 0100+00 1/0 0/0 0/0 .bss stdin_buff */
|
||||
extern "C" u8 stdin_buff[256];
|
||||
|
||||
/* 803D29B0-803D2AF0 -00001 0140+00 3/2 15/15 0/0 .data __files */
|
||||
SECTION_DATA extern files __files = {{0,
|
||||
0x0A800000,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdin_buff,
|
||||
0x00000100,
|
||||
stdin_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stdout},
|
||||
{1,
|
||||
0x12800000,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stdout_buff,
|
||||
0x00000100,
|
||||
stdout_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stderr},
|
||||
{2,
|
||||
0x10800000,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
0,
|
||||
stderr_buff,
|
||||
0x00000100,
|
||||
stderr_buff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
__read_console,
|
||||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.empty},
|
||||
{0, 0x00000000, 0, 0, 0, 0, {0, 0}, {0, 0},
|
||||
0, NULL, 0x00000000, NULL, 0, 0, 0, 0,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL}};
|
||||
|
||||
/* 8044D578-8044D678 07A298 0100+00 1/0 0/0 0/0 .bss stderr_buff */
|
||||
static u8 stderr_buff[256];
|
||||
|
||||
/* 8044D678-8044D778 07A398 0100+00 1/0 0/0 0/0 .bss stdout_buff */
|
||||
static u8 stdout_buff[256];
|
||||
|
||||
/* 8044D778-8044D878 07A498 0100+00 1/0 0/0 0/0 .bss stdin_buff */
|
||||
static u8 stdin_buff[256];
|
||||
|
||||
/* 8036300C-8036307C 35D94C 0070+00 0/0 2/2 0/0 .text __flush_all */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __flush_all() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/ansi_files/__flush_all.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8036307C-80363124 35D9BC 00A8+00 0/0 1/1 0/0 .text __close_all */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __close_all() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/ansi_files/__close_all.s"
|
||||
}
|
||||
#pragma pop
|
||||
@@ -11,8 +11,8 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void div();
|
||||
extern "C" void abs();
|
||||
void div();
|
||||
void abs();
|
||||
|
||||
//
|
||||
// External References:
|
||||
@@ -11,8 +11,8 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __flush_buffer();
|
||||
extern "C" void __prep_buffer();
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
|
||||
//
|
||||
// External References:
|
||||
@@ -11,19 +11,19 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __put_char();
|
||||
void __put_char();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __flush_buffer();
|
||||
extern "C" void __prep_buffer();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" void fseek();
|
||||
extern "C" void __stdio_atexit();
|
||||
extern "C" void fwide();
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void fseek();
|
||||
void __stdio_atexit();
|
||||
void fwide();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -11,7 +11,7 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" extern u8 __upper_map[256];
|
||||
extern unsigned char __upper_map[256];
|
||||
|
||||
//
|
||||
// External References:
|
||||
@@ -23,7 +23,7 @@ extern "C" extern u8 __upper_map[256];
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803D2C18-803D2D18 02FD38 0100+00 0/0 3/3 0/0 .data __ctype_map */
|
||||
SECTION_DATA extern u8 __ctype_map[256] = {
|
||||
SECTION_DATA extern unsigned char __ctype_map[256] = {
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
@@ -43,7 +43,7 @@ SECTION_DATA extern u8 __ctype_map[256] = {
|
||||
};
|
||||
|
||||
/* 803D2D18-803D2E18 02FE38 0100+00 1/1 3/3 0/0 .data __lower_map */
|
||||
SECTION_DATA extern u8 __lower_map[256] = {
|
||||
SECTION_DATA extern unsigned char __lower_map[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
|
||||
@@ -63,18 +63,19 @@ SECTION_DATA extern u8 __lower_map[256] = {
|
||||
};
|
||||
|
||||
/* 80365470-80365494 35FDB0 0024+00 0/0 4/4 0/0 .text tolower */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int tolower(int) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/ctype/tolower.s"
|
||||
int tolower(int __c) {
|
||||
{
|
||||
if (__c == -1) {
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
return (unsigned int)__lower_map[__c & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803D2E18-803D2F18 02FF38 0100+00 0/0 1/1 0/0 .data __upper_map */
|
||||
SECTION_DATA extern u8 __upper_map[256] = {
|
||||
SECTION_DATA extern unsigned char __upper_map[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
|
||||
@@ -11,22 +11,22 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __fwrite();
|
||||
extern "C" void fwrite();
|
||||
void __fwrite();
|
||||
void fwrite();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
extern "C" void __flush_buffer();
|
||||
extern "C" void __prep_buffer();
|
||||
extern "C" void __end_critical_region();
|
||||
extern "C" void __begin_critical_region();
|
||||
extern "C" void fseek();
|
||||
extern "C" void __memrchr();
|
||||
extern "C" void __stdio_atexit();
|
||||
extern "C" void fwide();
|
||||
void __flush_buffer();
|
||||
void __prep_buffer();
|
||||
void __end_critical_region();
|
||||
void __begin_critical_region();
|
||||
void fseek();
|
||||
void __memrchr();
|
||||
void __stdio_atexit();
|
||||
void fwide();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -0,0 +1,10 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/errno
|
||||
//
|
||||
|
||||
#include "errno.h"
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804519A8-804519B0 000EA8 0004+04 0/0 6/6 0/0 .sbss errno */
|
||||
int errno;
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/errno
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/errno.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" extern u8 errno[4 + 4 /* padding */];
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804519A8-804519B0 000EA8 0004+04 0/0 6/6 0/0 .sbss errno */
|
||||
extern u8 errno[4 + 4 /* padding */];
|
||||
u8 errno[4 + 4 /* padding */];
|
||||
@@ -11,15 +11,15 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void strnicmp();
|
||||
extern "C" void stricmp();
|
||||
void strnicmp();
|
||||
void stricmp();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __msl_strnicmp();
|
||||
extern "C" extern u8 __lower_map[256];
|
||||
void __msl_strnicmp();
|
||||
extern u8 __lower_map[256];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -11,19 +11,19 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __msl_strnicmp();
|
||||
extern "C" void fflush();
|
||||
extern "C" void fclose();
|
||||
void __msl_strnicmp();
|
||||
void fflush();
|
||||
void fclose();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void free();
|
||||
extern "C" void __flush_all();
|
||||
extern "C" void __flush_buffer();
|
||||
extern "C" void ftell();
|
||||
extern "C" extern u8 __lower_map[256];
|
||||
void free();
|
||||
void __flush_all();
|
||||
void __flush_buffer();
|
||||
void ftell();
|
||||
extern u8 __lower_map[256];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -11,11 +11,11 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" extern u32 __float_nan;
|
||||
extern "C" extern u32 __float_huge;
|
||||
extern "C" extern u32 __float_max;
|
||||
extern "C" extern u32 __float_epsilon;
|
||||
extern "C" extern f32 data_80450AF0;
|
||||
extern u32 __float_nan;
|
||||
extern u32 __float_huge;
|
||||
extern u32 __float_max;
|
||||
extern u32 __float_epsilon;
|
||||
extern f32 data_80450AF0;
|
||||
|
||||
//
|
||||
// External References:
|
||||
@@ -11,13 +11,13 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void wcstombs();
|
||||
void wcstombs();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void strncpy();
|
||||
void strncpy();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/mem
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/mem.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
unsigned char* __memrchr(unsigned char*, unsigned char, size_t);
|
||||
void* memchr(unsigned char*, int, size_t);
|
||||
void* memmove(void* dst, const void* src, size_t len);
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
void __copy_longs_rev_unaligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_unaligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_rev_aligned(void* dst, const void* src, size_t len);
|
||||
void __copy_longs_aligned(void* dst, const void* src, size_t len);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036608C-803660D8 3609CC 004C+00 0/0 19/19 5/5 .text memcmp */
|
||||
int memcmp(const void* __s1, const void* __s2, size_t __n) {
|
||||
const unsigned char* val1 = ((const unsigned char*)__s1 - 1);
|
||||
const unsigned char* val2 = ((const unsigned char*)__s2 - 1);
|
||||
|
||||
size_t size = __n + 1;
|
||||
while (--size > 0) {
|
||||
if (*++val1 != *++val2) {
|
||||
return val1[0] < val2[0] ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 803660D8-80366104 360A18 002C+00 0/0 1/1 0/0 .text __memrchr */
|
||||
unsigned char* __memrchr(unsigned char* s, unsigned char c, size_t n) {
|
||||
int n_count;
|
||||
size_t char_check;
|
||||
|
||||
char_check = (unsigned char)c;
|
||||
s = &s[n];
|
||||
n_count = n + 1;
|
||||
while (--n_count) {
|
||||
if (*--s == char_check) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 80366104-80366130 360A44 002C+00 0/0 1/1 0/0 .text memchr */
|
||||
void* memchr(unsigned char* s, int c, size_t n) {
|
||||
int n_count;
|
||||
size_t char_check;
|
||||
|
||||
char_check = (unsigned char)c;
|
||||
s = &s[-1];
|
||||
n_count = n + 1;
|
||||
while (--n_count) {
|
||||
if (*++s == char_check) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 80366130-803661FC 360A70 00CC+00 0/0 2/2 0/0 .text memmove */
|
||||
void* memmove(void* dst, const void* src, size_t len) {
|
||||
unsigned char* csrc;
|
||||
unsigned char* cdst;
|
||||
|
||||
int reverse = (unsigned int)src < (unsigned int)dst;
|
||||
|
||||
if (len >= 32) {
|
||||
if (((unsigned int)dst ^ (unsigned int)src) & 3) {
|
||||
if (!reverse) {
|
||||
__copy_longs_unaligned(dst, src, len);
|
||||
} else {
|
||||
__copy_longs_rev_unaligned(dst, src, len);
|
||||
}
|
||||
} else {
|
||||
if (!reverse) {
|
||||
__copy_longs_aligned(dst, src, len);
|
||||
} else {
|
||||
__copy_longs_rev_aligned(dst, src, len);
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
} else {
|
||||
if (!reverse) {
|
||||
csrc = ((unsigned char*)src) - 1;
|
||||
cdst = ((unsigned char*)dst) - 1;
|
||||
len++;
|
||||
|
||||
while (--len > 0) {
|
||||
*++cdst = *++csrc;
|
||||
}
|
||||
} else {
|
||||
csrc = (unsigned char*)src + len;
|
||||
cdst = (unsigned char*)dst + len;
|
||||
len++;
|
||||
|
||||
while (--len > 0) {
|
||||
*--cdst = *--csrc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: MSL_Common/Src/mem
|
||||
//
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/mem.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __memrchr();
|
||||
extern "C" void memchr();
|
||||
extern "C" void memmove();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __copy_longs_rev_unaligned();
|
||||
extern "C" void __copy_longs_unaligned();
|
||||
extern "C" void __copy_longs_rev_aligned();
|
||||
extern "C" void __copy_longs_aligned();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8036608C-803660D8 3609CC 004C+00 0/0 19/19 5/5 .text memcmp */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int memcmp(const void*, const void*, size_t) {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem/memcmp.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 803660D8-80366104 360A18 002C+00 0/0 1/1 0/0 .text __memrchr */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __memrchr() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem/__memrchr.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80366104-80366130 360A44 002C+00 0/0 1/1 0/0 .text memchr */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void memchr() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem/memchr.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 80366130-803661FC 360A70 00CC+00 0/0 2/2 0/0 .text memmove */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void memmove() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/mem/memmove.s"
|
||||
}
|
||||
#pragma pop
|
||||
@@ -11,10 +11,10 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __copy_longs_rev_unaligned();
|
||||
extern "C" void __copy_longs_unaligned();
|
||||
extern "C" void __copy_longs_rev_aligned();
|
||||
extern "C" void __copy_longs_aligned();
|
||||
void __copy_longs_rev_unaligned();
|
||||
void __copy_longs_unaligned();
|
||||
void __copy_longs_rev_aligned();
|
||||
void __copy_longs_aligned();
|
||||
|
||||
//
|
||||
// External References:
|
||||
@@ -11,25 +11,20 @@
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __stdio_atexit();
|
||||
void __stdio_atexit();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __close_all();
|
||||
extern "C" extern u8 __stdio_exit[4];
|
||||
void __close_all(void);
|
||||
extern void (*__stdio_exit)(void);
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 803664CC-803664DC 360E0C 0010+00 0/0 2/2 0/0 .text __stdio_atexit */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __stdio_atexit() {
|
||||
nofralloc
|
||||
#include "asm/MSL_C/MSL_Common/Src/misc_io/__stdio_atexit.s"
|
||||
void __stdio_atexit() {
|
||||
__stdio_exit = __close_all;
|
||||
}
|
||||
#pragma pop
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user