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:
TakaRikka
2022-04-24 13:02:50 +02:00
committed by GitHub
parent a1099217d6
commit 589cc12296
154 changed files with 2388 additions and 3088 deletions
+26 -26
View File
@@ -4,15 +4,15 @@
//
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JGeometry.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "JSystem/JSupport/JSUMemoryStream.h"
#include "JSystem/J2DGraph/J2DMaterialFactory.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DPictureEx.h"
#include "JSystem/J2DGraph/J2DTextBoxEx.h"
#include "JSystem/J2DGraph/J2DWindowEx.h"
#include "JSystem/J2DGraph/J2DPictureEx.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DMaterialFactory.h"
#include "JSystem/JGeometry.h"
#include "JSystem/JSupport/JSUMemoryStream.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Forward References:
@@ -356,12 +356,12 @@ bool J2DScreen::getScreenInformation(JSURandomInputStream* stream) {
* makeHierarchyPanes__9J2DScreenFP7J2DPaneP20JSURandomInputStreamUlP10JKRArchive */
// goto can probably be replaced
s32 J2DScreen::makeHierarchyPanes(J2DPane* basePane, JSURandomInputStream* stream, u32 param_2,
JKRArchive* archive) {
JKRArchive* archive) {
J2DScrnBlockHeader header;
J2DPane* next_pane = basePane;
do {
loop:
loop:
stream->peek(&header, sizeof(J2DScrnBlockHeader));
switch (header.mTag) {
@@ -382,7 +382,7 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* basePane, JSURandomInputStream* strea
case 'TEX1':
J2DResReference* texRes = getResReference(stream, param_2);
mTexRes = texRes;
if (texRes != NULL) {
goto loop;
}
@@ -390,7 +390,7 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* basePane, JSURandomInputStream* strea
case 'FNT1':
J2DResReference* fntRes = getResReference(stream, param_2);
mFontRes = fntRes;
if (fntRes != NULL) {
goto loop;
}
@@ -407,8 +407,7 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* basePane, JSURandomInputStream* strea
} else {
next_pane = createPane(header, stream, basePane, param_2, archive);
}
}
while (next_pane != NULL);
} while (next_pane != NULL);
return 2;
}
@@ -452,7 +451,7 @@ J2DPane* J2DScreen::createPane(J2DScrnBlockHeader const& header, JSURandomInputS
case 'TBX2':
if (param_3 & 0x1F0000) {
newPane = new J2DTextBoxEx(basePane, stream, param_3, mMaterials);
break;
break;
}
newPane = new J2DTextBox(basePane, stream, param_3, mMaterials);
break;
@@ -465,7 +464,7 @@ J2DPane* J2DScreen::createPane(J2DScrnBlockHeader const& header, JSURandomInputS
stream->seek(start, JSUStreamSeekFrom_SET);
break;
}
return newPane;
}
@@ -508,7 +507,8 @@ void J2DScreen::draw(f32 param_0, f32 param_1, J2DGrafContext const* grafCtx) {
GXSetVtxDesc(GX_VA_TEX0, GX_NONE);
GXSetCullMode(GX_CULL_NONE);
GXSetNumTexGens(0);
GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
GX_AF_NONE);
for (int i = 0; i < 4; i++) {
GXSetTevSwapModeTable((GXTevSwapSel)i, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
}
@@ -628,8 +628,7 @@ asm J2DResReference* J2DScreen::getResReference(JSURandomInputStream* param_0, u
* createMaterial__9J2DScreenFP20JSURandomInputStreamUlP10JKRArchive */
// nametab section has issues
#ifdef NONMATCHING
bool J2DScreen::createMaterial(JSURandomInputStream* stream, u32 param_1,
JKRArchive* archive) {
bool J2DScreen::createMaterial(JSURandomInputStream* stream, u32 param_1, JKRArchive* archive) {
s32 position = stream->getPosition();
J2DScrnBlockHeader header;
@@ -655,7 +654,8 @@ bool J2DScreen::createMaterial(JSURandomInputStream* stream, u32 param_1,
}
if (param_1 & 0x1F0000) {
u32 offset = buffer[0x14] << 0x18 | buffer[0x15] << 0x10 | buffer[0x16] << 8 | buffer[0x17];
u32 offset =
buffer[0x14] << 0x18 | buffer[0x15] << 0x10 | buffer[0x16] << 8 | buffer[0x17];
char* sec = (char*)buffer + offset;
u16* sec_s = (u16*)sec + *(u16*)sec;
@@ -726,7 +726,7 @@ void* J2DScreen::getNameResource(char const* resName) {
/* 802F9690-802F9704 2F3FD0 0074+00 0/0 30/30 3/3 .text animation__9J2DScreenFv */
void J2DScreen::animation() {
animationPane(mTransform);
for (u16 i = 0; i < mMaterialNum; i++) {
mMaterials[i].animation();
}
@@ -741,7 +741,7 @@ void J2DScreen::setAnimation(J2DAnmColor* anmColor) {
u16 matID = anmColor->getUpdateMaterialID(i);
if (matID < mMaterialNum) {
mMaterials[matID].setAnimation(anmColor);
}
}
}
}
@@ -755,7 +755,7 @@ void J2DScreen::setAnimation(J2DAnmTextureSRTKey* anmSRTKey) {
u16 matID = anmSRTKey->getUpdateMaterialID(i);
if (matID < mMaterialNum) {
mMaterials[matID].setAnimation(anmSRTKey);
}
}
}
}
@@ -769,7 +769,7 @@ void J2DScreen::setAnimation(J2DAnmTexPattern* anmPattern) {
u16 matID = anmPattern->getUpdateMaterialID(i);
if (matID < mMaterialNum) {
mMaterials[matID].setAnimation(anmPattern);
}
}
}
}
@@ -783,7 +783,7 @@ void J2DScreen::setAnimation(J2DAnmTevRegKey* anmRegKey) {
u16 matID = anmRegKey->getCRegUpdateMaterialID(i);
if (matID < mMaterialNum) {
mMaterials[matID].setAnimation(anmRegKey);
}
}
}
u16 kMatNum = anmRegKey->getKRegUpdateMaterialNum();
@@ -791,7 +791,7 @@ void J2DScreen::setAnimation(J2DAnmTevRegKey* anmRegKey) {
u16 matID = anmRegKey->getKRegUpdateMaterialID(i);
if (matID < mMaterialNum) {
mMaterials[matID].setAnimation(anmRegKey);
}
}
}
}
@@ -810,7 +810,7 @@ void J2DScreen::setAnimation(J2DAnmVisibilityFull* anmVisibility) {
/* 802F99E8-802F9A18 2F4328 0030+00 1/0 0/0 0/0 .text
* createPane__9J2DScreenFRC18J2DScrnBlockHeaderP20JSURandomInputStreamP7J2DPaneUl */
J2DPane* J2DScreen::createPane(J2DScrnBlockHeader const& header, JSURandomInputStream* stream,
J2DPane* basePane, u32 param_3) {
J2DPane* basePane, u32 param_3) {
return createPane(header, stream, basePane, param_3, NULL);
}
@@ -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:
+181
View File
@@ -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);
}
-142
View File
@@ -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:
+10
View File
@@ -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;
-27
View File
@@ -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:
+124
View File
@@ -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;
}
-69
View File
@@ -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:

Some files were not shown because too many files have changed in this diff Show More