mirror of https://github.com/zeldaret/tp.git
add MSL_C/stdio.h (#317)
This commit is contained in:
parent
472340e2d6
commit
f5fc527d39
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class J2DPrint {
|
||||
|
|
|
|||
|
|
@ -104,9 +104,9 @@ typedef struct _FILE {
|
|||
} FILE;
|
||||
|
||||
typedef struct _files {
|
||||
FILE stdin;
|
||||
FILE stdout;
|
||||
FILE stderr;
|
||||
FILE _stdin;
|
||||
FILE _stdout;
|
||||
FILE _stderr;
|
||||
FILE empty;
|
||||
} files;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef MSL_STDIO_H_
|
||||
#define MSL_STDIO_H_
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/FILE_POS.h"
|
||||
#include "MSL_C/MSL_Common/Src/char_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/direct_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/file_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
|
||||
#define stdin (&__files._stdin)
|
||||
#define stdout (&__files._stdout)
|
||||
#define stderr (&__files._stderr)
|
||||
|
||||
#endif
|
||||
|
|
@ -1,27 +1,23 @@
|
|||
#ifndef MSL_STRING_H_
|
||||
#define MSL_STRING_H_
|
||||
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
|
||||
// TODO: move to MSL_C/
|
||||
extern "C" {
|
||||
void memcpy(void*, const void*, s32);
|
||||
void* memset(void* dest, int ch, u32 count);
|
||||
void memcpy(void*, const void*, size_t);
|
||||
void* memset(void* dest, int ch, size_t count);
|
||||
char* strrchr(const char* s, int c);
|
||||
char* strchr(const char* s, int c);
|
||||
int strncmp(const char* s1, const char* s2, u32 n);
|
||||
int strncmp(const char* s1, const char* s2, size_t n);
|
||||
int strcmp(const char* s1, const char* s2);
|
||||
int stricmp(const char*, const char*);
|
||||
char* strcat(char* dest, const char* source);
|
||||
char* strncpy(char* dest, const char* source, u32 n);
|
||||
char* strncpy(char* dest, const char* source, size_t n);
|
||||
char* strcpy(char* dest, const char* source);
|
||||
u32 strlen(const char* s);
|
||||
size_t strlen(const char* s);
|
||||
int tolower(int);
|
||||
int sprintf(char*, const char*, ...);
|
||||
int printf(const char*, ...);
|
||||
int snprintf(char*, u32, const char*, ...);
|
||||
size_t vsnprintf(char* buffer, size_t buffer_size, const char* format, va_list args);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef D_SAVE_D_SAVE_H
|
||||
#define D_SAVE_D_SAVE_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef M_DO_M_DO_PRINTF_H
|
||||
#define M_DO_M_DO_PRINTF_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/char_io.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "m_Do/m_Do_main.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "JSystem/J2DGraph/J2DPrint.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
/* 8043428C-80434298 060FAC 000C+00 5/6 0/0 0/0 .bss sThreadList__9JKRThread */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "JSystem/JUtility/JUTVideo.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@
|
|||
#include "JSystem/JUtility/JUTDbPrint.h"
|
||||
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
|
||||
#include "JSystem/JUtility/JUTVideo.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
|
||||
/* 802E0148-802E0190 2DAA88 0048+00 1/1 0/0 0/0 .text __ct__10JUTDbPrintFP7JUTFontP7JKRHeap */
|
||||
JUTDbPrint::JUTDbPrint(JUTFont* pFont, JKRHeap* pHeap) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
//
|
||||
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "JSystem/JUtility/JUTDirectFile.h"
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "MSL_C/MSL_Common/Src/float.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ extern files __files = {
|
|||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stdout,
|
||||
&__files._stdout,
|
||||
},
|
||||
{
|
||||
1,
|
||||
|
|
@ -79,7 +79,7 @@ extern files __files = {
|
|||
__write_console,
|
||||
__close_console,
|
||||
NULL,
|
||||
&__files.stderr,
|
||||
&__files._stderr,
|
||||
},
|
||||
{
|
||||
2,
|
||||
|
|
@ -121,7 +121,7 @@ extern files __files = {
|
|||
|
||||
/* 8036307C-80363124 35D9BC 00A8+00 0/0 1/1 0/0 .text __close_all */
|
||||
void __close_all(void) {
|
||||
FILE* file = &__files.stdin;
|
||||
FILE* file = &__files._stdin;
|
||||
FILE* last_file;
|
||||
|
||||
__begin_critical_region(2);
|
||||
|
|
@ -150,7 +150,7 @@ void __close_all(void) {
|
|||
/* 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;
|
||||
FILE* file = &__files._stdin;
|
||||
|
||||
while (file) {
|
||||
if (file->file_mode.file_kind != 0 && fflush(file)) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
#include "rel/d/a/d_a_set_bgobj/d_a_set_bgobj.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/d_procname.h"
|
||||
|
||||
/* 80485F00-80485F0C 000000 0009+03 1/1 0/0 0/0 .rodata l_specName */
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "DynamicLink.h"
|
||||
#include "JSystem/JKernel/JKRDvdRipper.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "dolphin/types.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/d_item.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/d_timer.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/com/d_com_static.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/d_demo.h"
|
||||
#include "dol2asm.h"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "d/d_name.h"
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "MSL_C/MSL_Common/Src/extras.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "d/d_stage.h"
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "SSystem/SComponent/c_malloc.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/com/d_com_static.h"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "d/event/d_event_manager.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/d_camera.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/file/d_file_sel_info.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "d/menu/d_menu_save.h"
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/file/d_file_sel_info.h"
|
||||
#include "d/file/d_file_sel_warning.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/msg/d_msg_class.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/msg/d_msg_object.h"
|
||||
#include "d/msg/d_msg_unit.h"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "d/msg/d_msg_object.h"
|
||||
#include "d/msg/d_msg_out_font.h"
|
||||
#include "JSystem/JGadget/binary.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/msg/d_msg_unit.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "d/kankyo/d_kankyo.h"
|
||||
#include "d/meter/d_meter2_info.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/particle/d_particle.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "d/s/d_s_room.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/s/d_s_play.h"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "d/save/d_save.h"
|
||||
#include "d/save/d_save_init.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "Z2AudioLib/Z2AudioMgr.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/meter/d_meter2_info.h"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
*/
|
||||
|
||||
#include "m_Do/m_Do_MemCardRWmng.h"
|
||||
#include "MSL_C/MSL_Common/Src/printf.h"
|
||||
#include "MSL_C/MSL_Common/Src/string.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include "JSystem/JKernel/JKRAssertHeap.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "SSystem/SComponent/c_lib.h"
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
*/
|
||||
|
||||
#include "m_Do/m_Do_printf.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "dolphin/base/PPCArch.h"
|
||||
#include "MSL_C/MSL_Common/Src/file_io.h"
|
||||
|
||||
/* 80450B98-80450B9C -00001 0004+00 0/0 6/6 0/0 .sbss None */
|
||||
u8 __OSReport_disable;
|
||||
|
|
@ -37,7 +37,7 @@ asm void OSSwitchFiberEx(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32
|
|||
|
||||
/* 800067C8-800067F4 001108 002C+00 3/3 0/0 0/0 .text my_PutString__FPCc */
|
||||
void my_PutString(const char* string) {
|
||||
fputs(string, &__files.stdout);
|
||||
fputs(string, stdout);
|
||||
}
|
||||
|
||||
/* 800067F4-80006814 001134 0020+00 3/3 0/0 0/0 .text OSVAttention__FPCcP16__va_list_struct */
|
||||
|
|
@ -178,7 +178,7 @@ void OSReport_FatalError(char* fmt, ...) {
|
|||
OSVAttention(fmt, args);
|
||||
my_PutString("***** FATAL ERROR *****\n\x1B[m");
|
||||
OSReportForceEnableOff();
|
||||
fflush(&__files.stdout);
|
||||
fflush(stdout);
|
||||
print_errors++;
|
||||
|
||||
va_end(args);
|
||||
|
|
@ -195,7 +195,7 @@ void OSReport_Error(char* fmt, ...) {
|
|||
OSVReport(fmt, args);
|
||||
my_PutString("\x1B[m");
|
||||
OSReportForceEnableOff();
|
||||
fflush(&__files.stdout);
|
||||
fflush(stdout);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
|
@ -211,7 +211,7 @@ void OSReport_Warning(char* fmt, ...) {
|
|||
OSVAttention(fmt, args);
|
||||
my_PutString("\x1B[m");
|
||||
OSReportForceEnableOff();
|
||||
fflush(&__files.stdout);
|
||||
fflush(stdout);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "msg/scrn/d_msg_scrn_explain.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
//
|
||||
|
||||
#include "msg/scrn/d_msg_scrn_light.h"
|
||||
#include "MSL_C/stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue