From 589cc12296ae7253c62655859a5eef92ee42dbaf Mon Sep 17 00:00:00 2001 From: TakaRikka <38417346+TakaRikka@users.noreply.github.com> Date: Sun, 24 Apr 2022 04:02:50 -0700 Subject: [PATCH] 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 --- Makefile | 14 + Progress.md | 10 +- .../MSL_Common/Src/ansi_files/__close_all.s | 47 ---- .../MSL_Common/Src/ansi_files/__flush_all.s | 32 --- asm/MSL_C/MSL_Common/Src/ctype/tolower.s | 11 - asm/MSL_C/MSL_Common/Src/mem/__memrchr.s | 14 - asm/MSL_C/MSL_Common/Src/mem/memchr.s | 14 - asm/MSL_C/MSL_Common/Src/mem/memcmp.s | 22 -- asm/MSL_C/MSL_Common/Src/mem/memmove.s | 64 ----- .../MSL_Common/Src/misc_io/__stdio_atexit.s | 5 - asm/MSL_C/MSL_Common/Src/string/strcat.s | 14 - asm/MSL_C/MSL_Common/Src/string/strchr.s | 15 - asm/MSL_C/MSL_Common/Src/string/strcmp.s | 88 ------ asm/MSL_C/MSL_Common/Src/string/strcpy.s | 53 ---- asm/MSL_C/MSL_Common/Src/string/strlen.s | 9 - asm/MSL_C/MSL_Common/Src/string/strncmp.s | 21 -- asm/MSL_C/MSL_Common/Src/string/strncpy.s | 22 -- asm/MSL_C/MSL_Common/Src/string/strrchr.s | 22 -- asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s | 43 --- .../Double_precision/e_fmod/__ieee754_fmod.s | 250 ----------------- asm/MSL_C/Math/Double_precision/s_ceil/ceil.s | 94 ------- .../Double_precision/s_copysign/copysign.s | 11 - asm/MSL_C/Math/Double_precision/s_cos/cos.s | 62 ----- .../Math/Double_precision/s_floor/floor.s | 95 ------- .../Math/Double_precision/s_frexp/frexp.s | 40 --- asm/MSL_C/Math/Double_precision/s_modf/modf.s | 70 ----- asm/MSL_C/Math/Double_precision/s_sin/sin.s | 63 ----- asm/MSL_C/Math/Double_precision/s_tan/tan.s | 34 --- asm/MSL_C/Math/Double_precision/w_acos/acos.s | 9 - asm/MSL_C/Math/Double_precision/w_asin/asin.s | 9 - .../Math/Double_precision/w_atan2/atan2.s | 9 - asm/MSL_C/Math/Double_precision/w_exp/exp.s | 9 - asm/MSL_C/Math/Double_precision/w_fmod/fmod.s | 9 - asm/MSL_C/Math/Double_precision/w_pow/pow.s | 9 - asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s | 9 - asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s | 10 - asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s | 10 - asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s | 10 - asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s | 10 - .../Src/uart_console_io_gcn/__write_console.s | 57 ---- asm/init/TRK_memcpy.s | 12 - asm/init/TRK_memset.s | 13 - asm/init/__TRK_reset.s | 12 - asm/init/__check_pad3.s | 18 -- asm/init/__fill_mem.s | 56 ---- asm/init/__set_debug_bba.s | 4 - asm/init/memcpy.s | 26 -- asm/init/memset.s | 13 - include/DynamicLink.h | 4 +- include/JSystem/J2DGraph/J2DMatBlock.h | 25 +- include/JSystem/J2DGraph/J2DMaterial.h | 1 - include/JSystem/J2DGraph/J2DScreen.h | 4 +- include/JSystem/JKernel/JKRArchive.h | 2 +- include/JSystem/JKernel/JKRFileLoader.h | 2 +- include/JSystem/JSupport/JSUMemoryStream.h | 4 +- include/MSL_C/MSL_Common/Src/ansi_files.h | 65 +++-- include/MSL_C/MSL_Common/Src/char_io.h | 10 +- include/MSL_C/MSL_Common/Src/ctype.h | 8 +- include/MSL_C/MSL_Common/Src/float.h | 1 + include/MSL_C/MSL_Common/Src/mem.h | 10 +- include/MSL_C/MSL_Common/Src/printf.h | 18 +- include/MSL_C/MSL_Common/Src/string.h | 10 +- include/MSL_C/math.h | 74 ++--- include/Runtime.PPCEABI.H/__va_arg.h | 16 +- include/dol2asm.h | 25 ++ include/{MSL_C/MSL_Common/Src => }/errno.h | 2 +- include/fdlibm.h | 228 ++++++++++++++++ libs/JSystem/J2DGraph/J2DScreen.cpp | 52 ++-- .../Src/{FILE_POS.cpp => FILE_POS.c} | 14 +- .../Src/{abort_exit.cpp => abort_exit.c} | 40 +-- .../MSL_Common/Src/{alloc.cpp => alloc.c} | 16 +- libs/MSL_C/MSL_Common/Src/ansi_files.c | 181 ++++++++++++ libs/MSL_C/MSL_Common/Src/ansi_files.cpp | 142 ---------- .../MSL_Common/Src/{arith.cpp => arith.c} | 4 +- .../Src/{buffer_io.cpp => buffer_io.c} | 4 +- .../MSL_Common/Src/{char_io.cpp => char_io.c} | 16 +- .../MSL_Common/Src/{ctype.cpp => ctype.c} | 23 +- .../Src/{direct_io.cpp => direct_io.c} | 20 +- libs/MSL_C/MSL_Common/Src/errno.c | 10 + libs/MSL_C/MSL_Common/Src/errno.cpp | 27 -- .../MSL_Common/Src/{extras.cpp => extras.c} | 8 +- .../MSL_Common/Src/{file_io.cpp => file_io.c} | 16 +- .../MSL_Common/Src/{float.cpp => float.c} | 10 +- .../Src/{mbstring.cpp => mbstring.c} | 4 +- libs/MSL_C/MSL_Common/Src/mem.c | 124 +++++++++ libs/MSL_C/MSL_Common/Src/mem.cpp | 69 ----- .../Src/{mem_funcs.cpp => mem_funcs.c} | 8 +- .../MSL_Common/Src/{misc_io.cpp => misc_io.c} | 15 +- .../MSL_Common/Src/{printf.cpp => printf.c} | 50 ++-- .../MSL_Common/Src/{scanf.cpp => scanf.c} | 2 +- .../MSL_Common/Src/{signal.cpp => signal.c} | 8 +- libs/MSL_C/MSL_Common/Src/string.c | 257 ++++++++++++++++++ libs/MSL_C/MSL_Common/Src/string.cpp | 98 ------- .../MSL_Common/Src/{strtoul.cpp => strtoul.c} | 14 +- libs/MSL_C/MSL_Common/Src/wchar_io.c | 44 +++ libs/MSL_C/MSL_Common/Src/wchar_io.cpp | 32 --- .../Src/{ansi_fp.cpp => ansi_fp.c} | 22 +- libs/MSL_C/Makefile | 120 ++++---- .../Double_precision/{e_acos.cpp => e_acos.c} | 6 +- .../Double_precision/{e_asin.cpp => e_asin.c} | 6 +- .../{e_atan2.cpp => e_atan2.c} | 4 +- .../Double_precision/{e_exp.cpp => e_exp.c} | 2 +- libs/MSL_C/Math/Double_precision/e_fmod.c | 167 ++++++++++++ libs/MSL_C/Math/Double_precision/e_fmod.cpp | 39 --- .../Double_precision/{e_pow.cpp => e_pow.c} | 10 +- .../{e_rem_pio2.cpp => e_rem_pio2.c} | 4 +- .../Double_precision/{e_sqrt.cpp => e_sqrt.c} | 6 +- .../Double_precision/{k_cos.cpp => k_cos.c} | 2 +- .../{k_rem_pio2.cpp => k_rem_pio2.c} | 10 +- .../Double_precision/{k_sin.cpp => k_sin.c} | 2 +- .../Double_precision/{k_tan.cpp => k_tan.c} | 2 +- .../Double_precision/{s_atan.cpp => s_atan.c} | 2 +- libs/MSL_C/Math/Double_precision/s_ceil.c | 90 ++++++ libs/MSL_C/Math/Double_precision/s_ceil.cpp | 41 --- libs/MSL_C/Math/Double_precision/s_copysign.c | 30 ++ .../Math/Double_precision/s_copysign.cpp | 32 --- libs/MSL_C/Math/Double_precision/s_cos.c | 81 ++++++ libs/MSL_C/Math/Double_precision/s_cos.cpp | 42 --- libs/MSL_C/Math/Double_precision/s_floor.c | 89 ++++++ libs/MSL_C/Math/Double_precision/s_floor.cpp | 41 --- libs/MSL_C/Math/Double_precision/s_frexp.c | 57 ++++ libs/MSL_C/Math/Double_precision/s_frexp.cpp | 36 --- .../{s_ldexp.cpp => s_ldexp.c} | 4 +- libs/MSL_C/Math/Double_precision/s_modf.c | 79 ++++++ libs/MSL_C/Math/Double_precision/s_modf.cpp | 32 --- libs/MSL_C/Math/Double_precision/s_sin.c | 82 ++++++ libs/MSL_C/Math/Double_precision/s_sin.cpp | 42 --- libs/MSL_C/Math/Double_precision/s_tan.c | 73 +++++ libs/MSL_C/Math/Double_precision/s_tan.cpp | 41 --- libs/MSL_C/Math/Double_precision/w_acos.c | 6 + libs/MSL_C/Math/Double_precision/w_acos.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_asin.c | 6 + libs/MSL_C/Math/Double_precision/w_asin.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_atan2.c | 6 + libs/MSL_C/Math/Double_precision/w_atan2.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_exp.c | 6 + libs/MSL_C/Math/Double_precision/w_exp.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_fmod.c | 6 + libs/MSL_C/Math/Double_precision/w_fmod.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_pow.c | 6 + libs/MSL_C/Math/Double_precision/w_pow.cpp | 34 --- libs/MSL_C/Math/Double_precision/w_sqrt.c | 6 + libs/MSL_C/Math/Double_precision/w_sqrt.cpp | 34 --- ...mecube.cpp => critical_regions.gamecube.c} | 6 +- libs/MSL_C/PPC_EABI/Src/math_ppc.c | 42 +++ libs/MSL_C/PPC_EABI/Src/math_ppc.cpp | 70 ----- libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c | 61 +++++ .../PPC_EABI/Src/uart_console_io_gcn.cpp | 47 ---- obj_files.mk | 1 + src/DynamicLink.cpp | 2 +- src/__start.c | 61 +++++ src/f_pc/f_pc_manager.cpp | 2 +- src/{init.cpp => init.c} | 228 ++++++++-------- tools/tp.py | 10 +- 154 files changed, 2388 insertions(+), 3088 deletions(-) delete mode 100644 asm/MSL_C/MSL_Common/Src/ansi_files/__close_all.s delete mode 100644 asm/MSL_C/MSL_Common/Src/ansi_files/__flush_all.s delete mode 100644 asm/MSL_C/MSL_Common/Src/ctype/tolower.s delete mode 100644 asm/MSL_C/MSL_Common/Src/mem/__memrchr.s delete mode 100644 asm/MSL_C/MSL_Common/Src/mem/memchr.s delete mode 100644 asm/MSL_C/MSL_Common/Src/mem/memcmp.s delete mode 100644 asm/MSL_C/MSL_Common/Src/mem/memmove.s delete mode 100644 asm/MSL_C/MSL_Common/Src/misc_io/__stdio_atexit.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strcat.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strchr.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strcmp.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strcpy.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strlen.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strncmp.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strncpy.s delete mode 100644 asm/MSL_C/MSL_Common/Src/string/strrchr.s delete mode 100644 asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s delete mode 100644 asm/MSL_C/Math/Double_precision/e_fmod/__ieee754_fmod.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_ceil/ceil.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_copysign/copysign.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_cos/cos.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_floor/floor.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_frexp/frexp.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_modf/modf.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_sin/sin.s delete mode 100644 asm/MSL_C/Math/Double_precision/s_tan/tan.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_acos/acos.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_asin/asin.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_atan2/atan2.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_exp/exp.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_fmod/fmod.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_pow/pow.s delete mode 100644 asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s delete mode 100644 asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s delete mode 100644 asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s delete mode 100644 asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s delete mode 100644 asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s delete mode 100644 asm/MSL_C/PPC_EABI/Src/uart_console_io_gcn/__write_console.s delete mode 100644 asm/init/TRK_memcpy.s delete mode 100644 asm/init/TRK_memset.s delete mode 100644 asm/init/__TRK_reset.s delete mode 100644 asm/init/__check_pad3.s delete mode 100644 asm/init/__fill_mem.s delete mode 100644 asm/init/__set_debug_bba.s delete mode 100644 asm/init/memcpy.s delete mode 100644 asm/init/memset.s rename include/{MSL_C/MSL_Common/Src => }/errno.h (78%) create mode 100644 include/fdlibm.h rename libs/MSL_C/MSL_Common/Src/{FILE_POS.cpp => FILE_POS.c} (80%) rename libs/MSL_C/MSL_Common/Src/{abort_exit.cpp => abort_exit.c} (84%) rename libs/MSL_C/MSL_Common/Src/{alloc.cpp => alloc.c} (86%) create mode 100644 libs/MSL_C/MSL_Common/Src/ansi_files.c delete mode 100644 libs/MSL_C/MSL_Common/Src/ansi_files.cpp rename libs/MSL_C/MSL_Common/Src/{arith.cpp => arith.c} (94%) rename libs/MSL_C/MSL_Common/Src/{buffer_io.cpp => buffer_io.c} (92%) rename libs/MSL_C/MSL_Common/Src/{char_io.cpp => char_io.c} (74%) rename libs/MSL_C/MSL_Common/Src/{ctype.cpp => ctype.c} (93%) rename libs/MSL_C/MSL_Common/Src/{direct_io.cpp => direct_io.c} (71%) create mode 100644 libs/MSL_C/MSL_Common/Src/errno.c delete mode 100644 libs/MSL_C/MSL_Common/Src/errno.cpp rename libs/MSL_C/MSL_Common/Src/{extras.cpp => extras.c} (85%) rename libs/MSL_C/MSL_Common/Src/{file_io.cpp => file_io.c} (80%) rename libs/MSL_C/MSL_Common/Src/{float.cpp => float.c} (85%) rename libs/MSL_C/MSL_Common/Src/{mbstring.cpp => mbstring.c} (93%) create mode 100644 libs/MSL_C/MSL_Common/Src/mem.c delete mode 100644 libs/MSL_C/MSL_Common/Src/mem.cpp rename libs/MSL_C/MSL_Common/Src/{mem_funcs.cpp => mem_funcs.c} (89%) rename libs/MSL_C/MSL_Common/Src/{misc_io.cpp => misc_io.c} (54%) rename libs/MSL_C/MSL_Common/Src/{printf.cpp => printf.c} (93%) rename libs/MSL_C/MSL_Common/Src/{scanf.cpp => scanf.c} (94%) rename libs/MSL_C/MSL_Common/Src/{signal.cpp => signal.c} (84%) create mode 100644 libs/MSL_C/MSL_Common/Src/string.c delete mode 100644 libs/MSL_C/MSL_Common/Src/string.cpp rename libs/MSL_C/MSL_Common/Src/{strtoul.cpp => strtoul.c} (89%) create mode 100644 libs/MSL_C/MSL_Common/Src/wchar_io.c delete mode 100644 libs/MSL_C/MSL_Common/Src/wchar_io.cpp rename libs/MSL_C/MSL_Common_Embedded/Src/{ansi_fp.cpp => ansi_fp.c} (94%) rename libs/MSL_C/Math/Double_precision/{e_acos.cpp => e_acos.c} (96%) rename libs/MSL_C/Math/Double_precision/{e_asin.cpp => e_asin.c} (96%) rename libs/MSL_C/Math/Double_precision/{e_atan2.cpp => e_atan2.c} (97%) rename libs/MSL_C/Math/Double_precision/{e_exp.cpp => e_exp.c} (99%) create mode 100644 libs/MSL_C/Math/Double_precision/e_fmod.c delete mode 100644 libs/MSL_C/Math/Double_precision/e_fmod.cpp rename libs/MSL_C/Math/Double_precision/{e_pow.cpp => e_pow.c} (97%) rename libs/MSL_C/Math/Double_precision/{e_rem_pio2.cpp => e_rem_pio2.c} (98%) rename libs/MSL_C/Math/Double_precision/{e_sqrt.cpp => e_sqrt.c} (86%) rename libs/MSL_C/Math/Double_precision/{k_cos.cpp => k_cos.c} (98%) rename libs/MSL_C/Math/Double_precision/{k_rem_pio2.cpp => k_rem_pio2.c} (94%) rename libs/MSL_C/Math/Double_precision/{k_sin.cpp => k_sin.c} (97%) rename libs/MSL_C/Math/Double_precision/{k_tan.cpp => k_tan.c} (98%) rename libs/MSL_C/Math/Double_precision/{s_atan.cpp => s_atan.c} (99%) create mode 100644 libs/MSL_C/Math/Double_precision/s_ceil.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_ceil.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_copysign.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_copysign.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_cos.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_cos.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_floor.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_floor.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_frexp.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_frexp.cpp rename libs/MSL_C/Math/Double_precision/{s_ldexp.cpp => s_ldexp.c} (96%) create mode 100644 libs/MSL_C/Math/Double_precision/s_modf.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_modf.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_sin.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_sin.cpp create mode 100644 libs/MSL_C/Math/Double_precision/s_tan.c delete mode 100644 libs/MSL_C/Math/Double_precision/s_tan.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_acos.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_acos.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_asin.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_asin.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_atan2.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_atan2.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_exp.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_exp.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_fmod.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_fmod.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_pow.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_pow.cpp create mode 100644 libs/MSL_C/Math/Double_precision/w_sqrt.c delete mode 100644 libs/MSL_C/Math/Double_precision/w_sqrt.cpp rename libs/MSL_C/PPC_EABI/Src/{critical_regions.gamecube.cpp => critical_regions.gamecube.c} (85%) create mode 100644 libs/MSL_C/PPC_EABI/Src/math_ppc.c delete mode 100644 libs/MSL_C/PPC_EABI/Src/math_ppc.cpp create mode 100644 libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c delete mode 100644 libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.cpp create mode 100644 src/__start.c rename src/{init.cpp => init.c} (94%) diff --git a/Makefile b/Makefile index 5d5d377d5f..29a4813924 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,14 @@ LDFLAGS := -unused -map $(MAP) -fp hard -nodefaults -w off # Compiler flags CFLAGS += -Cpp_exceptions off -proc gekko -fp hard -O3 -nodefaults -str pool,readonly,reuse -RTTI off -maxerrors 5 -enum int $(INCLUDES) +# O4,p for init.c +$(BUILD_DIR)/src/init.o: CFLAGS := -Cpp_exceptions off -proc gekko -fp hard -O4,p -nodefaults -str pool,readonly,reuse -RTTI off -maxerrors 5 -enum int $(INCLUDES) + +# __start.c needs mwcc 1.2.5 and O4,p +$(BUILD_DIR)/src/__start.o: CFLAGS := -Cpp_exceptions off -proc gekko -fp hard -O4,p -nodefaults -str pool,readonly,reuse -RTTI off -maxerrors 5 -enum int $(INCLUDES) +$(BUILD_DIR)/src/__start.o: MWCC_VERSION := 1.2.5 +$(BUILD_DIR)/src/__start.o: CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe + # elf2dol needs to know these in order to calculate sbss correctly. SDATA_PDHR := 9 SBSS_PDHR := 10 @@ -169,6 +177,12 @@ rungame: game dolphin-emu $(BUILD_DIR)/game/sys/main.dol # +$(BUILD_DIR)/%.o: %.c + @mkdir -p $(@D) + @echo building... $< + @$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).c + @$(CC) $(CFLAGS) -c -o $@ $(basename $@).c + $(BUILD_DIR)/%.o: %.cpp @mkdir -p $(@D) @echo building... $< diff --git a/Progress.md b/Progress.md index 63d46eba57..f3f6b2f419 100644 --- a/Progress.md +++ b/Progress.md @@ -4,25 +4,25 @@ Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -.init | 86.402027% | 8184 | 9472 +.init | 91.849662% | 8700 | 9472 .extab | 100.000000% | 96 | 96 .extabindex | 100.000000% | 96 | 96 -.text | 12.024877% | 432480 | 3596544 +.text | 12.154891% | 437156 | 3596544 .ctors | 100.000000% | 448 | 448 .dtors | 100.000000% | 32 | 32 .rodata | 100.000000% | 193856 | 193856 .data | 100.000000% | 197632 | 197632 .sdata | 100.000000% | 1408 | 1408 .sdata2 | 100.000000% | 20832 | 20832 -Total | 21.273061% | 855320 | 4020672 +Total | 21.402193% | 860512 | 4020672 ## Total Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -main.dol | 21.273061% | 855320 | 4020672 +main.dol | 21.402193% | 860512 | 4020672 RELs | 33.172039% | 3814892 | 11500324 -Total | 30.089641% | 4670212 | 15520996 +Total | 30.123093% | 4675404 | 15520996 ## RELs diff --git a/asm/MSL_C/MSL_Common/Src/ansi_files/__close_all.s b/asm/MSL_C/MSL_Common/Src/ansi_files/__close_all.s deleted file mode 100644 index f8e07591b8..0000000000 --- a/asm/MSL_C/MSL_Common/Src/ansi_files/__close_all.s +++ /dev/null @@ -1,47 +0,0 @@ -lbl_8036307C: -/* 8036307C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80363080 7C 08 02 A6 */ mflr r0 -/* 80363084 3C 80 80 3D */ lis r4, __files@ha /* 0x803D29B0@ha */ -/* 80363088 38 60 00 02 */ li r3, 2 -/* 8036308C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80363090 38 04 29 B0 */ addi r0, r4, __files@l /* 0x803D29B0@l */ -/* 80363094 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80363098 7C 1F 03 78 */ mr r31, r0 -/* 8036309C 48 00 23 CD */ bl __begin_critical_region -/* 803630A0 48 00 00 60 */ b lbl_80363100 -lbl_803630A4: -/* 803630A4 A0 1F 00 04 */ lhz r0, 4(r31) -/* 803630A8 54 00 D7 7F */ rlwinm. r0, r0, 0x1a, 0x1d, 0x1f -/* 803630AC 41 82 00 0C */ beq lbl_803630B8 -/* 803630B0 7F E3 FB 78 */ mr r3, r31 -/* 803630B4 48 00 29 45 */ bl fclose -lbl_803630B8: -/* 803630B8 7F E3 FB 78 */ mr r3, r31 -/* 803630BC 83 FF 00 4C */ lwz r31, 0x4c(r31) -/* 803630C0 88 03 00 0C */ lbz r0, 0xc(r3) -/* 803630C4 28 00 00 00 */ cmplwi r0, 0 -/* 803630C8 41 82 00 0C */ beq lbl_803630D4 -/* 803630CC 4B FF FA 8D */ bl free -/* 803630D0 48 00 00 30 */ b lbl_80363100 -lbl_803630D4: -/* 803630D4 A0 03 00 04 */ lhz r0, 4(r3) -/* 803630D8 38 80 00 03 */ li r4, 3 -/* 803630DC 50 80 35 F2 */ rlwimi r0, r4, 6, 0x17, 0x19 -/* 803630E0 28 1F 00 00 */ cmplwi r31, 0 -/* 803630E4 B0 03 00 04 */ sth r0, 4(r3) -/* 803630E8 41 82 00 18 */ beq lbl_80363100 -/* 803630EC 88 1F 00 0C */ lbz r0, 0xc(r31) -/* 803630F0 28 00 00 00 */ cmplwi r0, 0 -/* 803630F4 41 82 00 0C */ beq lbl_80363100 -/* 803630F8 38 00 00 00 */ li r0, 0 -/* 803630FC 90 03 00 4C */ stw r0, 0x4c(r3) -lbl_80363100: -/* 80363100 28 1F 00 00 */ cmplwi r31, 0 -/* 80363104 40 82 FF A0 */ bne lbl_803630A4 -/* 80363108 38 60 00 02 */ li r3, 2 -/* 8036310C 48 00 23 59 */ bl __end_critical_region -/* 80363110 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80363114 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80363118 7C 08 03 A6 */ mtlr r0 -/* 8036311C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80363120 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/ansi_files/__flush_all.s b/asm/MSL_C/MSL_Common/Src/ansi_files/__flush_all.s deleted file mode 100644 index 1747aa3fac..0000000000 --- a/asm/MSL_C/MSL_Common/Src/ansi_files/__flush_all.s +++ /dev/null @@ -1,32 +0,0 @@ -lbl_8036300C: -/* 8036300C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80363010 7C 08 02 A6 */ mflr r0 -/* 80363014 3C 60 80 3D */ lis r3, __files@ha /* 0x803D29B0@ha */ -/* 80363018 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036301C 38 03 29 B0 */ addi r0, r3, __files@l /* 0x803D29B0@l */ -/* 80363020 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80363024 3B E0 00 00 */ li r31, 0 -/* 80363028 93 C1 00 08 */ stw r30, 8(r1) -/* 8036302C 7C 1E 03 78 */ mr r30, r0 -/* 80363030 48 00 00 28 */ b lbl_80363058 -lbl_80363034: -/* 80363034 A0 1E 00 04 */ lhz r0, 4(r30) -/* 80363038 54 00 D7 7F */ rlwinm. r0, r0, 0x1a, 0x1d, 0x1f -/* 8036303C 41 82 00 18 */ beq lbl_80363054 -/* 80363040 7F C3 F3 78 */ mr r3, r30 -/* 80363044 48 00 28 7D */ bl fflush -/* 80363048 2C 03 00 00 */ cmpwi r3, 0 -/* 8036304C 41 82 00 08 */ beq lbl_80363054 -/* 80363050 3B E0 FF FF */ li r31, -1 -lbl_80363054: -/* 80363054 83 DE 00 4C */ lwz r30, 0x4c(r30) -lbl_80363058: -/* 80363058 28 1E 00 00 */ cmplwi r30, 0 -/* 8036305C 40 82 FF D8 */ bne lbl_80363034 -/* 80363060 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80363064 7F E3 FB 78 */ mr r3, r31 -/* 80363068 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 8036306C 83 C1 00 08 */ lwz r30, 8(r1) -/* 80363070 7C 08 03 A6 */ mtlr r0 -/* 80363074 38 21 00 10 */ addi r1, r1, 0x10 -/* 80363078 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/ctype/tolower.s b/asm/MSL_C/MSL_Common/Src/ctype/tolower.s deleted file mode 100644 index 178464e47f..0000000000 --- a/asm/MSL_C/MSL_Common/Src/ctype/tolower.s +++ /dev/null @@ -1,11 +0,0 @@ -lbl_80365470: -/* 80365470 2C 03 FF FF */ cmpwi r3, -1 -/* 80365474 40 82 00 0C */ bne lbl_80365480 -/* 80365478 38 60 FF FF */ li r3, -1 -/* 8036547C 4E 80 00 20 */ blr -lbl_80365480: -/* 80365480 3C 80 80 3D */ lis r4, __lower_map@ha /* 0x803D2D18@ha */ -/* 80365484 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 80365488 38 64 2D 18 */ addi r3, r4, __lower_map@l /* 0x803D2D18@l */ -/* 8036548C 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80365490 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/mem/__memrchr.s b/asm/MSL_C/MSL_Common/Src/mem/__memrchr.s deleted file mode 100644 index 7341f2ba77..0000000000 --- a/asm/MSL_C/MSL_Common/Src/mem/__memrchr.s +++ /dev/null @@ -1,14 +0,0 @@ -lbl_803660D8: -/* 803660D8 54 84 06 3E */ clrlwi r4, r4, 0x18 -/* 803660DC 7C 63 2A 14 */ add r3, r3, r5 -/* 803660E0 38 A5 00 01 */ addi r5, r5, 1 -/* 803660E4 48 00 00 10 */ b lbl_803660F4 -lbl_803660E8: -/* 803660E8 8C 03 FF FF */ lbzu r0, -1(r3) -/* 803660EC 7C 00 20 40 */ cmplw r0, r4 -/* 803660F0 4D 82 00 20 */ beqlr -lbl_803660F4: -/* 803660F4 34 A5 FF FF */ addic. r5, r5, -1 -/* 803660F8 40 82 FF F0 */ bne lbl_803660E8 -/* 803660FC 38 60 00 00 */ li r3, 0 -/* 80366100 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/mem/memchr.s b/asm/MSL_C/MSL_Common/Src/mem/memchr.s deleted file mode 100644 index 0c037e050e..0000000000 --- a/asm/MSL_C/MSL_Common/Src/mem/memchr.s +++ /dev/null @@ -1,14 +0,0 @@ -lbl_80366104: -/* 80366104 54 84 06 3E */ clrlwi r4, r4, 0x18 -/* 80366108 38 63 FF FF */ addi r3, r3, -1 -/* 8036610C 38 A5 00 01 */ addi r5, r5, 1 -/* 80366110 48 00 00 10 */ b lbl_80366120 -lbl_80366114: -/* 80366114 8C 03 00 01 */ lbzu r0, 1(r3) -/* 80366118 7C 00 20 40 */ cmplw r0, r4 -/* 8036611C 4D 82 00 20 */ beqlr -lbl_80366120: -/* 80366120 34 A5 FF FF */ addic. r5, r5, -1 -/* 80366124 40 82 FF F0 */ bne lbl_80366114 -/* 80366128 38 60 00 00 */ li r3, 0 -/* 8036612C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/mem/memcmp.s b/asm/MSL_C/MSL_Common/Src/mem/memcmp.s deleted file mode 100644 index c68fda2e9c..0000000000 --- a/asm/MSL_C/MSL_Common/Src/mem/memcmp.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_8036608C: -/* 8036608C 38 C3 FF FF */ addi r6, r3, -1 -/* 80366090 38 E4 FF FF */ addi r7, r4, -1 -/* 80366094 38 85 00 01 */ addi r4, r5, 1 -/* 80366098 48 00 00 30 */ b lbl_803660C8 -lbl_8036609C: -/* 8036609C 8C 66 00 01 */ lbzu r3, 1(r6) -/* 803660A0 8C 07 00 01 */ lbzu r0, 1(r7) -/* 803660A4 7C 03 00 40 */ cmplw r3, r0 -/* 803660A8 41 82 00 20 */ beq lbl_803660C8 -/* 803660AC 88 86 00 00 */ lbz r4, 0(r6) -/* 803660B0 38 60 00 01 */ li r3, 1 -/* 803660B4 88 07 00 00 */ lbz r0, 0(r7) -/* 803660B8 7C 04 00 40 */ cmplw r4, r0 -/* 803660BC 4C 80 00 20 */ bgelr -/* 803660C0 38 60 FF FF */ li r3, -1 -/* 803660C4 4E 80 00 20 */ blr -lbl_803660C8: -/* 803660C8 34 84 FF FF */ addic. r4, r4, -1 -/* 803660CC 40 82 FF D0 */ bne lbl_8036609C -/* 803660D0 38 60 00 00 */ li r3, 0 -/* 803660D4 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/mem/memmove.s b/asm/MSL_C/MSL_Common/Src/mem/memmove.s deleted file mode 100644 index 40b4ea4e48..0000000000 --- a/asm/MSL_C/MSL_Common/Src/mem/memmove.s +++ /dev/null @@ -1,64 +0,0 @@ -lbl_80366130: -/* 80366130 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80366134 7C 08 02 A6 */ mflr r0 -/* 80366138 28 05 00 20 */ cmplwi r5, 0x20 -/* 8036613C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80366140 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80366144 7C 7F 1B 78 */ mr r31, r3 -/* 80366148 7F E6 22 78 */ xor r6, r31, r4 -/* 8036614C 7C C0 00 34 */ cntlzw r0, r6 -/* 80366150 7F E0 00 30 */ slw r0, r31, r0 -/* 80366154 54 07 0F FE */ srwi r7, r0, 0x1f -/* 80366158 41 80 00 40 */ blt lbl_80366198 -/* 8036615C 54 C0 07 BF */ clrlwi. r0, r6, 0x1e -/* 80366160 41 82 00 1C */ beq lbl_8036617C -/* 80366164 2C 07 00 00 */ cmpwi r7, 0 -/* 80366168 40 82 00 0C */ bne lbl_80366174 -/* 8036616C 48 00 01 3D */ bl __copy_longs_unaligned -/* 80366170 48 00 00 20 */ b lbl_80366190 -lbl_80366174: -/* 80366174 48 00 00 89 */ bl __copy_longs_rev_unaligned -/* 80366178 48 00 00 18 */ b lbl_80366190 -lbl_8036617C: -/* 8036617C 2C 07 00 00 */ cmpwi r7, 0 -/* 80366180 40 82 00 0C */ bne lbl_8036618C -/* 80366184 48 00 02 8D */ bl __copy_longs_aligned -/* 80366188 48 00 00 08 */ b lbl_80366190 -lbl_8036618C: -/* 8036618C 48 00 01 DD */ bl __copy_longs_rev_aligned -lbl_80366190: -/* 80366190 7F E3 FB 78 */ mr r3, r31 -/* 80366194 48 00 00 54 */ b lbl_803661E8 -lbl_80366198: -/* 80366198 2C 07 00 00 */ cmpwi r7, 0 -/* 8036619C 40 82 00 28 */ bne lbl_803661C4 -/* 803661A0 38 64 FF FF */ addi r3, r4, -1 -/* 803661A4 38 9F FF FF */ addi r4, r31, -1 -/* 803661A8 38 A5 00 01 */ addi r5, r5, 1 -/* 803661AC 48 00 00 0C */ b lbl_803661B8 -lbl_803661B0: -/* 803661B0 8C 03 00 01 */ lbzu r0, 1(r3) -/* 803661B4 9C 04 00 01 */ stbu r0, 1(r4) -lbl_803661B8: -/* 803661B8 34 A5 FF FF */ addic. r5, r5, -1 -/* 803661BC 40 82 FF F4 */ bne lbl_803661B0 -/* 803661C0 48 00 00 24 */ b lbl_803661E4 -lbl_803661C4: -/* 803661C4 7C 64 2A 14 */ add r3, r4, r5 -/* 803661C8 7C 9F 2A 14 */ add r4, r31, r5 -/* 803661CC 38 A5 00 01 */ addi r5, r5, 1 -/* 803661D0 48 00 00 0C */ b lbl_803661DC -lbl_803661D4: -/* 803661D4 8C 03 FF FF */ lbzu r0, -1(r3) -/* 803661D8 9C 04 FF FF */ stbu r0, -1(r4) -lbl_803661DC: -/* 803661DC 34 A5 FF FF */ addic. r5, r5, -1 -/* 803661E0 40 82 FF F4 */ bne lbl_803661D4 -lbl_803661E4: -/* 803661E4 7F E3 FB 78 */ mr r3, r31 -lbl_803661E8: -/* 803661E8 80 01 00 14 */ lwz r0, 0x14(r1) -/* 803661EC 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 803661F0 7C 08 03 A6 */ mtlr r0 -/* 803661F4 38 21 00 10 */ addi r1, r1, 0x10 -/* 803661F8 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/misc_io/__stdio_atexit.s b/asm/MSL_C/MSL_Common/Src/misc_io/__stdio_atexit.s deleted file mode 100644 index c620050000..0000000000 --- a/asm/MSL_C/MSL_Common/Src/misc_io/__stdio_atexit.s +++ /dev/null @@ -1,5 +0,0 @@ -lbl_803664CC: -/* 803664CC 3C 60 80 36 */ lis r3, __close_all@ha /* 0x8036307C@ha */ -/* 803664D0 38 03 30 7C */ addi r0, r3, __close_all@l /* 0x8036307C@l */ -/* 803664D4 90 0D 94 18 */ stw r0, __stdio_exit(r13) -/* 803664D8 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strcat.s b/asm/MSL_C/MSL_Common/Src/string/strcat.s deleted file mode 100644 index d3f7076497..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strcat.s +++ /dev/null @@ -1,14 +0,0 @@ -lbl_80368ABC: -/* 80368ABC 38 84 FF FF */ addi r4, r4, -1 -/* 80368AC0 38 A3 FF FF */ addi r5, r3, -1 -lbl_80368AC4: -/* 80368AC4 8C 05 00 01 */ lbzu r0, 1(r5) -/* 80368AC8 28 00 00 00 */ cmplwi r0, 0 -/* 80368ACC 40 82 FF F8 */ bne lbl_80368AC4 -/* 80368AD0 38 A5 FF FF */ addi r5, r5, -1 -lbl_80368AD4: -/* 80368AD4 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368AD8 28 00 00 00 */ cmplwi r0, 0 -/* 80368ADC 9C 05 00 01 */ stbu r0, 1(r5) -/* 80368AE0 40 82 FF F4 */ bne lbl_80368AD4 -/* 80368AE4 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strchr.s b/asm/MSL_C/MSL_Common/Src/string/strchr.s deleted file mode 100644 index 836c4292ff..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strchr.s +++ /dev/null @@ -1,15 +0,0 @@ -lbl_80368924: -/* 80368924 38 63 FF FF */ addi r3, r3, -1 -/* 80368928 54 80 06 3E */ clrlwi r0, r4, 0x18 -/* 8036892C 48 00 00 0C */ b lbl_80368938 -lbl_80368930: -/* 80368930 7C 04 00 40 */ cmplw r4, r0 -/* 80368934 4D 82 00 20 */ beqlr -lbl_80368938: -/* 80368938 8C 83 00 01 */ lbzu r4, 1(r3) -/* 8036893C 28 04 00 00 */ cmplwi r4, 0 -/* 80368940 40 82 FF F0 */ bne lbl_80368930 -/* 80368944 28 00 00 00 */ cmplwi r0, 0 -/* 80368948 4D 82 00 20 */ beqlr -/* 8036894C 38 60 00 00 */ li r3, 0 -/* 80368950 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strcmp.s b/asm/MSL_C/MSL_Common/Src/string/strcmp.s deleted file mode 100644 index 8a78f9b64c..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strcmp.s +++ /dev/null @@ -1,88 +0,0 @@ -lbl_80368994: -/* 80368994 88 A3 00 00 */ lbz r5, 0(r3) -/* 80368998 88 04 00 00 */ lbz r0, 0(r4) -/* 8036899C 7C 00 28 51 */ subf. r0, r0, r5 -/* 803689A0 41 82 00 0C */ beq lbl_803689AC -/* 803689A4 7C 03 03 78 */ mr r3, r0 -/* 803689A8 4E 80 00 20 */ blr -lbl_803689AC: -/* 803689AC 54 80 07 BE */ clrlwi r0, r4, 0x1e -/* 803689B0 54 66 07 BE */ clrlwi r6, r3, 0x1e -/* 803689B4 7C 00 30 40 */ cmplw r0, r6 -/* 803689B8 40 82 00 CC */ bne lbl_80368A84 -/* 803689BC 28 06 00 00 */ cmplwi r6, 0 -/* 803689C0 41 82 00 58 */ beq lbl_80368A18 -/* 803689C4 28 05 00 00 */ cmplwi r5, 0 -/* 803689C8 40 82 00 0C */ bne lbl_803689D4 -/* 803689CC 38 60 00 00 */ li r3, 0 -/* 803689D0 4E 80 00 20 */ blr -lbl_803689D4: -/* 803689D4 20 06 00 03 */ subfic r0, r6, 3 -/* 803689D8 7C 09 03 A6 */ mtctr r0 -/* 803689DC 28 00 00 00 */ cmplwi r0, 0 -/* 803689E0 41 82 00 30 */ beq lbl_80368A10 -lbl_803689E4: -/* 803689E4 8C A3 00 01 */ lbzu r5, 1(r3) -/* 803689E8 8C 04 00 01 */ lbzu r0, 1(r4) -/* 803689EC 7C 00 28 51 */ subf. r0, r0, r5 -/* 803689F0 41 82 00 0C */ beq lbl_803689FC -/* 803689F4 7C 03 03 78 */ mr r3, r0 -/* 803689F8 4E 80 00 20 */ blr -lbl_803689FC: -/* 803689FC 28 05 00 00 */ cmplwi r5, 0 -/* 80368A00 40 82 00 0C */ bne lbl_80368A0C -/* 80368A04 38 60 00 00 */ li r3, 0 -/* 80368A08 4E 80 00 20 */ blr -lbl_80368A0C: -/* 80368A0C 42 00 FF D8 */ bdnz lbl_803689E4 -lbl_80368A10: -/* 80368A10 38 63 00 01 */ addi r3, r3, 1 -/* 80368A14 38 84 00 01 */ addi r4, r4, 1 -lbl_80368A18: -/* 80368A18 80 E3 00 00 */ lwz r7, 0(r3) -/* 80368A1C 3C A0 80 81 */ lis r5, 0x8081 /* 0x80808080@ha */ -/* 80368A20 38 C5 80 80 */ addi r6, r5, 0x8080 /* 0x80808080@l */ -/* 80368A24 81 04 00 00 */ lwz r8, 0(r4) -/* 80368A28 3C A7 FE FF */ addis r5, r7, 0xfeff -/* 80368A2C 38 05 FE FF */ addi r0, r5, -257 -/* 80368A30 7C 00 30 39 */ and. r0, r0, r6 -/* 80368A34 40 82 00 38 */ bne lbl_80368A6C -/* 80368A38 48 00 00 1C */ b lbl_80368A54 -lbl_80368A3C: -/* 80368A3C 84 E3 00 04 */ lwzu r7, 4(r3) -/* 80368A40 85 04 00 04 */ lwzu r8, 4(r4) -/* 80368A44 3C A7 FE FF */ addis r5, r7, 0xfeff -/* 80368A48 38 05 FE FF */ addi r0, r5, -257 -/* 80368A4C 7C 00 30 39 */ and. r0, r0, r6 -/* 80368A50 40 82 00 1C */ bne lbl_80368A6C -lbl_80368A54: -/* 80368A54 7C 07 40 40 */ cmplw r7, r8 -/* 80368A58 41 82 FF E4 */ beq lbl_80368A3C -/* 80368A5C 38 60 FF FF */ li r3, -1 -/* 80368A60 4C 81 00 20 */ blelr -/* 80368A64 38 60 00 01 */ li r3, 1 -/* 80368A68 4E 80 00 20 */ blr -lbl_80368A6C: -/* 80368A6C 88 A3 00 00 */ lbz r5, 0(r3) -/* 80368A70 88 04 00 00 */ lbz r0, 0(r4) -/* 80368A74 7C 00 28 51 */ subf. r0, r0, r5 -/* 80368A78 41 82 00 0C */ beq lbl_80368A84 -/* 80368A7C 7C 03 03 78 */ mr r3, r0 -/* 80368A80 4E 80 00 20 */ blr -lbl_80368A84: -/* 80368A84 28 05 00 00 */ cmplwi r5, 0 -/* 80368A88 40 82 00 0C */ bne lbl_80368A94 -/* 80368A8C 38 60 00 00 */ li r3, 0 -/* 80368A90 4E 80 00 20 */ blr -lbl_80368A94: -/* 80368A94 8C A3 00 01 */ lbzu r5, 1(r3) -/* 80368A98 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368A9C 7C 00 28 51 */ subf. r0, r0, r5 -/* 80368AA0 41 82 00 0C */ beq lbl_80368AAC -/* 80368AA4 7C 03 03 78 */ mr r3, r0 -/* 80368AA8 4E 80 00 20 */ blr -lbl_80368AAC: -/* 80368AAC 28 05 00 00 */ cmplwi r5, 0 -/* 80368AB0 40 82 FF E4 */ bne lbl_80368A94 -/* 80368AB4 38 60 00 00 */ li r3, 0 -/* 80368AB8 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strcpy.s b/asm/MSL_C/MSL_Common/Src/string/strcpy.s deleted file mode 100644 index d931444aeb..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strcpy.s +++ /dev/null @@ -1,53 +0,0 @@ -lbl_80368B2C: -/* 80368B2C 54 60 07 BE */ clrlwi r0, r3, 0x1e -/* 80368B30 54 85 07 BE */ clrlwi r5, r4, 0x1e -/* 80368B34 7C 00 28 40 */ cmplw r0, r5 -/* 80368B38 7C 67 1B 78 */ mr r7, r3 -/* 80368B3C 40 82 00 84 */ bne lbl_80368BC0 -/* 80368B40 28 05 00 00 */ cmplwi r5, 0 -/* 80368B44 41 82 00 40 */ beq lbl_80368B84 -/* 80368B48 88 04 00 00 */ lbz r0, 0(r4) -/* 80368B4C 28 00 00 00 */ cmplwi r0, 0 -/* 80368B50 98 07 00 00 */ stb r0, 0(r7) -/* 80368B54 4D 82 00 20 */ beqlr -/* 80368B58 20 05 00 03 */ subfic r0, r5, 3 -/* 80368B5C 7C 09 03 A6 */ mtctr r0 -/* 80368B60 28 00 00 00 */ cmplwi r0, 0 -/* 80368B64 41 82 00 18 */ beq lbl_80368B7C -lbl_80368B68: -/* 80368B68 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368B6C 28 00 00 00 */ cmplwi r0, 0 -/* 80368B70 9C 07 00 01 */ stbu r0, 1(r7) -/* 80368B74 4D 82 00 20 */ beqlr -/* 80368B78 42 00 FF F0 */ bdnz lbl_80368B68 -lbl_80368B7C: -/* 80368B7C 38 E7 00 01 */ addi r7, r7, 1 -/* 80368B80 38 84 00 01 */ addi r4, r4, 1 -lbl_80368B84: -/* 80368B84 81 04 00 00 */ lwz r8, 0(r4) -/* 80368B88 3C A0 80 81 */ lis r5, 0x8081 /* 0x80808080@ha */ -/* 80368B8C 38 C5 80 80 */ addi r6, r5, 0x8080 /* 0x80808080@l */ -/* 80368B90 3C A8 FE FF */ addis r5, r8, 0xfeff -/* 80368B94 38 05 FE FF */ addi r0, r5, -257 -/* 80368B98 7C 00 30 39 */ and. r0, r0, r6 -/* 80368B9C 40 82 00 24 */ bne lbl_80368BC0 -/* 80368BA0 38 E7 FF FC */ addi r7, r7, -4 -lbl_80368BA4: -/* 80368BA4 95 07 00 04 */ stwu r8, 4(r7) -/* 80368BA8 85 04 00 04 */ lwzu r8, 4(r4) -/* 80368BAC 3C A8 FE FF */ addis r5, r8, 0xfeff -/* 80368BB0 38 05 FE FF */ addi r0, r5, -257 -/* 80368BB4 7C 00 30 39 */ and. r0, r0, r6 -/* 80368BB8 41 82 FF EC */ beq lbl_80368BA4 -/* 80368BBC 38 E7 00 04 */ addi r7, r7, 4 -lbl_80368BC0: -/* 80368BC0 88 04 00 00 */ lbz r0, 0(r4) -/* 80368BC4 28 00 00 00 */ cmplwi r0, 0 -/* 80368BC8 98 07 00 00 */ stb r0, 0(r7) -/* 80368BCC 4D 82 00 20 */ beqlr -lbl_80368BD0: -/* 80368BD0 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368BD4 28 00 00 00 */ cmplwi r0, 0 -/* 80368BD8 9C 07 00 01 */ stbu r0, 1(r7) -/* 80368BDC 40 82 FF F4 */ bne lbl_80368BD0 -/* 80368BE0 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strlen.s b/asm/MSL_C/MSL_Common/Src/string/strlen.s deleted file mode 100644 index e6de2d16ba..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strlen.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_80368BE4: -/* 80368BE4 38 83 FF FF */ addi r4, r3, -1 -/* 80368BE8 38 60 FF FF */ li r3, -1 -lbl_80368BEC: -/* 80368BEC 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368BF0 38 63 00 01 */ addi r3, r3, 1 -/* 80368BF4 28 00 00 00 */ cmplwi r0, 0 -/* 80368BF8 40 82 FF F4 */ bne lbl_80368BEC -/* 80368BFC 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strncmp.s b/asm/MSL_C/MSL_Common/Src/string/strncmp.s deleted file mode 100644 index fc8fb779dd..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strncmp.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80368954: -/* 80368954 38 63 FF FF */ addi r3, r3, -1 -/* 80368958 38 84 FF FF */ addi r4, r4, -1 -/* 8036895C 38 C5 00 01 */ addi r6, r5, 1 -/* 80368960 48 00 00 24 */ b lbl_80368984 -lbl_80368964: -/* 80368964 8C 03 00 01 */ lbzu r0, 1(r3) -/* 80368968 8C A4 00 01 */ lbzu r5, 1(r4) -/* 8036896C 7C 00 28 40 */ cmplw r0, r5 -/* 80368970 41 82 00 0C */ beq lbl_8036897C -/* 80368974 7C 65 00 50 */ subf r3, r5, r0 -/* 80368978 4E 80 00 20 */ blr -lbl_8036897C: -/* 8036897C 28 00 00 00 */ cmplwi r0, 0 -/* 80368980 41 82 00 0C */ beq lbl_8036898C -lbl_80368984: -/* 80368984 34 C6 FF FF */ addic. r6, r6, -1 -/* 80368988 40 82 FF DC */ bne lbl_80368964 -lbl_8036898C: -/* 8036898C 38 60 00 00 */ li r3, 0 -/* 80368990 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strncpy.s b/asm/MSL_C/MSL_Common/Src/string/strncpy.s deleted file mode 100644 index f37ed2e980..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strncpy.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_80368AE8: -/* 80368AE8 38 84 FF FF */ addi r4, r4, -1 -/* 80368AEC 38 C3 FF FF */ addi r6, r3, -1 -/* 80368AF0 38 A5 00 01 */ addi r5, r5, 1 -/* 80368AF4 48 00 00 2C */ b lbl_80368B20 -lbl_80368AF8: -/* 80368AF8 8C 04 00 01 */ lbzu r0, 1(r4) -/* 80368AFC 28 00 00 00 */ cmplwi r0, 0 -/* 80368B00 9C 06 00 01 */ stbu r0, 1(r6) -/* 80368B04 40 82 00 1C */ bne lbl_80368B20 -/* 80368B08 38 00 00 00 */ li r0, 0 -/* 80368B0C 48 00 00 08 */ b lbl_80368B14 -lbl_80368B10: -/* 80368B10 9C 06 00 01 */ stbu r0, 1(r6) -lbl_80368B14: -/* 80368B14 34 A5 FF FF */ addic. r5, r5, -1 -/* 80368B18 40 82 FF F8 */ bne lbl_80368B10 -/* 80368B1C 4E 80 00 20 */ blr -lbl_80368B20: -/* 80368B20 34 A5 FF FF */ addic. r5, r5, -1 -/* 80368B24 40 82 FF D4 */ bne lbl_80368AF8 -/* 80368B28 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/string/strrchr.s b/asm/MSL_C/MSL_Common/Src/string/strrchr.s deleted file mode 100644 index cc5edd4af6..0000000000 --- a/asm/MSL_C/MSL_Common/Src/string/strrchr.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_803688DC: -/* 803688DC 38 A3 FF FF */ addi r5, r3, -1 -/* 803688E0 54 80 06 3E */ clrlwi r0, r4, 0x18 -/* 803688E4 38 60 00 00 */ li r3, 0 -/* 803688E8 48 00 00 10 */ b lbl_803688F8 -lbl_803688EC: -/* 803688EC 7C 04 00 40 */ cmplw r4, r0 -/* 803688F0 40 82 00 08 */ bne lbl_803688F8 -/* 803688F4 7C A3 2B 78 */ mr r3, r5 -lbl_803688F8: -/* 803688F8 8C 85 00 01 */ lbzu r4, 1(r5) -/* 803688FC 28 04 00 00 */ cmplwi r4, 0 -/* 80368900 40 82 FF EC */ bne lbl_803688EC -/* 80368904 28 03 00 00 */ cmplwi r3, 0 -/* 80368908 4C 82 00 20 */ bnelr -/* 8036890C 28 00 00 00 */ cmplwi r0, 0 -/* 80368910 41 82 00 0C */ beq lbl_8036891C -/* 80368914 38 60 00 00 */ li r3, 0 -/* 80368918 4E 80 00 20 */ blr -lbl_8036891C: -/* 8036891C 7C A3 2B 78 */ mr r3, r5 -/* 80368920 4E 80 00 20 */ blr diff --git a/asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s b/asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s deleted file mode 100644 index f13b54ed25..0000000000 --- a/asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s +++ /dev/null @@ -1,43 +0,0 @@ -lbl_80369114: -/* 80369114 28 03 00 00 */ cmplwi r3, 0 -/* 80369118 41 82 00 10 */ beq lbl_80369128 -/* 8036911C A0 03 00 04 */ lhz r0, 4(r3) -/* 80369120 54 00 D7 7F */ rlwinm. r0, r0, 0x1a, 0x1d, 0x1f -/* 80369124 40 82 00 0C */ bne lbl_80369130 -lbl_80369128: -/* 80369128 38 60 00 00 */ li r3, 0 -/* 8036912C 4E 80 00 20 */ blr -lbl_80369130: -/* 80369130 88 A3 00 05 */ lbz r5, 5(r3) -/* 80369134 54 A0 E7 BE */ rlwinm r0, r5, 0x1c, 0x1e, 0x1f -/* 80369138 2C 00 00 01 */ cmpwi r0, 1 -/* 8036913C 41 82 00 58 */ beq lbl_80369194 -/* 80369140 40 80 00 10 */ bge lbl_80369150 -/* 80369144 2C 00 00 00 */ cmpwi r0, 0 -/* 80369148 40 80 00 14 */ bge lbl_8036915C -/* 8036914C 4E 80 00 20 */ blr -lbl_80369150: -/* 80369150 2C 00 00 03 */ cmpwi r0, 3 -/* 80369154 4C 80 00 20 */ bgelr -/* 80369158 48 00 00 34 */ b lbl_8036918C -lbl_8036915C: -/* 8036915C 2C 04 00 00 */ cmpwi r4, 0 -/* 80369160 40 81 00 14 */ ble lbl_80369174 -/* 80369164 38 00 00 02 */ li r0, 2 -/* 80369168 50 05 26 B6 */ rlwimi r5, r0, 4, 0x1a, 0x1b -/* 8036916C 98 A3 00 05 */ stb r5, 5(r3) -/* 80369170 48 00 00 14 */ b lbl_80369184 -lbl_80369174: -/* 80369174 40 80 00 10 */ bge lbl_80369184 -/* 80369178 38 00 00 01 */ li r0, 1 -/* 8036917C 50 05 26 B6 */ rlwimi r5, r0, 4, 0x1a, 0x1b -/* 80369180 98 A3 00 05 */ stb r5, 5(r3) -lbl_80369184: -/* 80369184 7C 83 23 78 */ mr r3, r4 -/* 80369188 4E 80 00 20 */ blr -lbl_8036918C: -/* 8036918C 38 60 00 01 */ li r3, 1 -/* 80369190 4E 80 00 20 */ blr -lbl_80369194: -/* 80369194 38 60 FF FF */ li r3, -1 -/* 80369198 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/e_fmod/__ieee754_fmod.s b/asm/MSL_C/Math/Double_precision/e_fmod/__ieee754_fmod.s deleted file mode 100644 index 10abb84a7e..0000000000 --- a/asm/MSL_C/Math/Double_precision/e_fmod/__ieee754_fmod.s +++ /dev/null @@ -1,250 +0,0 @@ -lbl_80369B9C: -/* 80369B9C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80369BA0 D8 41 00 10 */ stfd f2, 0x10(r1) -/* 80369BA4 D8 21 00 08 */ stfd f1, 8(r1) -/* 80369BA8 81 41 00 10 */ lwz r10, 0x10(r1) -/* 80369BAC 80 C1 00 08 */ lwz r6, 8(r1) -/* 80369BB0 80 A1 00 14 */ lwz r5, 0x14(r1) -/* 80369BB4 55 48 00 7E */ clrlwi r8, r10, 1 -/* 80369BB8 54 C0 00 00 */ rlwinm r0, r6, 0, 0, 0 -/* 80369BBC 80 81 00 0C */ lwz r4, 0xc(r1) -/* 80369BC0 7D 03 2B 79 */ or. r3, r8, r5 -/* 80369BC4 7C C7 02 78 */ xor r7, r6, r0 -/* 80369BC8 41 82 00 28 */ beq lbl_80369BF0 -/* 80369BCC 3C C0 7F F0 */ lis r6, 0x7ff0 -/* 80369BD0 7C 07 30 00 */ cmpw r7, r6 -/* 80369BD4 40 80 00 1C */ bge lbl_80369BF0 -/* 80369BD8 7C 65 00 D0 */ neg r3, r5 -/* 80369BDC 7C A3 1B 78 */ or r3, r5, r3 -/* 80369BE0 54 63 0F FE */ srwi r3, r3, 0x1f -/* 80369BE4 7D 03 1B 78 */ or r3, r8, r3 -/* 80369BE8 7C 03 30 40 */ cmplw r3, r6 -/* 80369BEC 40 81 00 18 */ ble lbl_80369C04 -lbl_80369BF0: -/* 80369BF0 C8 21 00 08 */ lfd f1, 8(r1) -/* 80369BF4 C8 01 00 10 */ lfd f0, 0x10(r1) -/* 80369BF8 FC 01 00 32 */ fmul f0, f1, f0 -/* 80369BFC FC 20 00 24 */ fdiv f1, f0, f0 -/* 80369C00 48 00 02 D0 */ b lbl_80369ED0 -lbl_80369C04: -/* 80369C04 7C 07 40 00 */ cmpw r7, r8 -/* 80369C08 41 81 00 30 */ bgt lbl_80369C38 -/* 80369C0C 41 80 00 0C */ blt lbl_80369C18 -/* 80369C10 7C 04 28 40 */ cmplw r4, r5 -/* 80369C14 40 80 00 0C */ bge lbl_80369C20 -lbl_80369C18: -/* 80369C18 C8 21 00 08 */ lfd f1, 8(r1) -/* 80369C1C 48 00 02 B4 */ b lbl_80369ED0 -lbl_80369C20: -/* 80369C20 40 82 00 18 */ bne lbl_80369C38 -/* 80369C24 3C 60 80 3A */ lis r3, Zero@ha /* 0x803A2370@ha */ -/* 80369C28 54 00 27 38 */ rlwinm r0, r0, 4, 0x1c, 0x1c -/* 80369C2C 38 63 23 70 */ addi r3, r3, Zero@l /* 0x803A2370@l */ -/* 80369C30 7C 23 04 AE */ lfdx f1, r3, r0 -/* 80369C34 48 00 02 9C */ b lbl_80369ED0 -lbl_80369C38: -/* 80369C38 3C 60 00 10 */ lis r3, 0x10 -/* 80369C3C 7C 07 18 00 */ cmpw r7, r3 -/* 80369C40 40 80 00 4C */ bge lbl_80369C8C -/* 80369C44 2C 07 00 00 */ cmpwi r7, 0 -/* 80369C48 40 82 00 24 */ bne lbl_80369C6C -/* 80369C4C 7C 83 23 78 */ mr r3, r4 -/* 80369C50 39 60 FB ED */ li r11, -1043 -/* 80369C54 48 00 00 0C */ b lbl_80369C60 -lbl_80369C58: -/* 80369C58 54 63 08 3C */ slwi r3, r3, 1 -/* 80369C5C 39 6B FF FF */ addi r11, r11, -1 -lbl_80369C60: -/* 80369C60 2C 03 00 00 */ cmpwi r3, 0 -/* 80369C64 41 81 FF F4 */ bgt lbl_80369C58 -/* 80369C68 48 00 00 2C */ b lbl_80369C94 -lbl_80369C6C: -/* 80369C6C 54 E3 58 28 */ slwi r3, r7, 0xb -/* 80369C70 39 60 FC 02 */ li r11, -1022 -/* 80369C74 48 00 00 0C */ b lbl_80369C80 -lbl_80369C78: -/* 80369C78 54 63 08 3C */ slwi r3, r3, 1 -/* 80369C7C 39 6B FF FF */ addi r11, r11, -1 -lbl_80369C80: -/* 80369C80 2C 03 00 00 */ cmpwi r3, 0 -/* 80369C84 41 81 FF F4 */ bgt lbl_80369C78 -/* 80369C88 48 00 00 0C */ b lbl_80369C94 -lbl_80369C8C: -/* 80369C8C 7C E3 A6 70 */ srawi r3, r7, 0x14 -/* 80369C90 39 63 FC 01 */ addi r11, r3, -1023 -lbl_80369C94: -/* 80369C94 3C 60 00 10 */ lis r3, 0x10 -/* 80369C98 7C 08 18 00 */ cmpw r8, r3 -/* 80369C9C 40 80 00 4C */ bge lbl_80369CE8 -/* 80369CA0 2C 08 00 00 */ cmpwi r8, 0 -/* 80369CA4 40 82 00 24 */ bne lbl_80369CC8 -/* 80369CA8 7C A6 2B 78 */ mr r6, r5 -/* 80369CAC 38 60 FB ED */ li r3, -1043 -/* 80369CB0 48 00 00 0C */ b lbl_80369CBC -lbl_80369CB4: -/* 80369CB4 54 C6 08 3C */ slwi r6, r6, 1 -/* 80369CB8 38 63 FF FF */ addi r3, r3, -1 -lbl_80369CBC: -/* 80369CBC 2C 06 00 00 */ cmpwi r6, 0 -/* 80369CC0 41 81 FF F4 */ bgt lbl_80369CB4 -/* 80369CC4 48 00 00 2C */ b lbl_80369CF0 -lbl_80369CC8: -/* 80369CC8 55 06 58 28 */ slwi r6, r8, 0xb -/* 80369CCC 38 60 FC 02 */ li r3, -1022 -/* 80369CD0 48 00 00 0C */ b lbl_80369CDC -lbl_80369CD4: -/* 80369CD4 54 C6 08 3C */ slwi r6, r6, 1 -/* 80369CD8 38 63 FF FF */ addi r3, r3, -1 -lbl_80369CDC: -/* 80369CDC 2C 06 00 00 */ cmpwi r6, 0 -/* 80369CE0 41 81 FF F4 */ bgt lbl_80369CD4 -/* 80369CE4 48 00 00 0C */ b lbl_80369CF0 -lbl_80369CE8: -/* 80369CE8 7D 03 A6 70 */ srawi r3, r8, 0x14 -/* 80369CEC 38 63 FC 01 */ addi r3, r3, -1023 -lbl_80369CF0: -/* 80369CF0 2C 0B FC 02 */ cmpwi r11, -1022 -/* 80369CF4 41 80 00 10 */ blt lbl_80369D04 -/* 80369CF8 54 E6 03 3E */ clrlwi r6, r7, 0xc -/* 80369CFC 64 C9 00 10 */ oris r9, r6, 0x10 -/* 80369D00 48 00 00 34 */ b lbl_80369D34 -lbl_80369D04: -/* 80369D04 21 2B FC 02 */ subfic r9, r11, -1022 -/* 80369D08 2C 09 00 1F */ cmpwi r9, 0x1f -/* 80369D0C 41 81 00 1C */ bgt lbl_80369D28 -/* 80369D10 20 C9 00 20 */ subfic r6, r9, 0x20 -/* 80369D14 7C E7 48 30 */ slw r7, r7, r9 -/* 80369D18 7C 86 34 30 */ srw r6, r4, r6 -/* 80369D1C 7C 84 48 30 */ slw r4, r4, r9 -/* 80369D20 7C E9 33 78 */ or r9, r7, r6 -/* 80369D24 48 00 00 10 */ b lbl_80369D34 -lbl_80369D28: -/* 80369D28 38 C9 FF E0 */ addi r6, r9, -32 -/* 80369D2C 7C 89 30 30 */ slw r9, r4, r6 -/* 80369D30 38 80 00 00 */ li r4, 0 -lbl_80369D34: -/* 80369D34 2C 03 FC 02 */ cmpwi r3, -1022 -/* 80369D38 41 80 00 10 */ blt lbl_80369D48 -/* 80369D3C 55 46 03 3E */ clrlwi r6, r10, 0xc -/* 80369D40 64 C7 00 10 */ oris r7, r6, 0x10 -/* 80369D44 48 00 00 34 */ b lbl_80369D78 -lbl_80369D48: -/* 80369D48 21 43 FC 02 */ subfic r10, r3, -1022 -/* 80369D4C 2C 0A 00 1F */ cmpwi r10, 0x1f -/* 80369D50 41 81 00 1C */ bgt lbl_80369D6C -/* 80369D54 20 CA 00 20 */ subfic r6, r10, 0x20 -/* 80369D58 7D 07 50 30 */ slw r7, r8, r10 -/* 80369D5C 7C A6 34 30 */ srw r6, r5, r6 -/* 80369D60 7C A5 50 30 */ slw r5, r5, r10 -/* 80369D64 7C E7 33 78 */ or r7, r7, r6 -/* 80369D68 48 00 00 10 */ b lbl_80369D78 -lbl_80369D6C: -/* 80369D6C 38 CA FF E0 */ addi r6, r10, -32 -/* 80369D70 7C A7 30 30 */ slw r7, r5, r6 -/* 80369D74 38 A0 00 00 */ li r5, 0 -lbl_80369D78: -/* 80369D78 7C C3 58 51 */ subf. r6, r3, r11 -/* 80369D7C 7C C9 03 A6 */ mtctr r6 -/* 80369D80 41 82 00 64 */ beq lbl_80369DE4 -lbl_80369D84: -/* 80369D84 7C 04 28 40 */ cmplw r4, r5 -/* 80369D88 7D 07 48 50 */ subf r8, r7, r9 -/* 80369D8C 7D 45 20 50 */ subf r10, r5, r4 -/* 80369D90 40 80 00 08 */ bge lbl_80369D98 -/* 80369D94 39 08 FF FF */ addi r8, r8, -1 -lbl_80369D98: -/* 80369D98 2C 08 00 00 */ cmpwi r8, 0 -/* 80369D9C 40 80 00 18 */ bge lbl_80369DB4 -/* 80369DA0 54 86 0F FE */ srwi r6, r4, 0x1f -/* 80369DA4 7C 84 22 14 */ add r4, r4, r4 -/* 80369DA8 7C C9 32 14 */ add r6, r9, r6 -/* 80369DAC 7D 29 32 14 */ add r9, r9, r6 -/* 80369DB0 48 00 00 30 */ b lbl_80369DE0 -lbl_80369DB4: -/* 80369DB4 7D 04 53 79 */ or. r4, r8, r10 -/* 80369DB8 40 82 00 18 */ bne lbl_80369DD0 -/* 80369DBC 3C 60 80 3A */ lis r3, Zero@ha /* 0x803A2370@ha */ -/* 80369DC0 54 00 27 38 */ rlwinm r0, r0, 4, 0x1c, 0x1c -/* 80369DC4 38 63 23 70 */ addi r3, r3, Zero@l /* 0x803A2370@l */ -/* 80369DC8 7C 23 04 AE */ lfdx f1, r3, r0 -/* 80369DCC 48 00 01 04 */ b lbl_80369ED0 -lbl_80369DD0: -/* 80369DD0 55 46 0F FE */ srwi r6, r10, 0x1f -/* 80369DD4 7C 8A 52 14 */ add r4, r10, r10 -/* 80369DD8 7D 28 32 14 */ add r9, r8, r6 -/* 80369DDC 7D 28 4A 14 */ add r9, r8, r9 -lbl_80369DE0: -/* 80369DE0 42 00 FF A4 */ bdnz lbl_80369D84 -lbl_80369DE4: -/* 80369DE4 7C 04 28 40 */ cmplw r4, r5 -/* 80369DE8 7C C7 48 50 */ subf r6, r7, r9 -/* 80369DEC 7C A5 20 50 */ subf r5, r5, r4 -/* 80369DF0 40 80 00 08 */ bge lbl_80369DF8 -/* 80369DF4 38 C6 FF FF */ addi r6, r6, -1 -lbl_80369DF8: -/* 80369DF8 2C 06 00 00 */ cmpwi r6, 0 -/* 80369DFC 41 80 00 0C */ blt lbl_80369E08 -/* 80369E00 7C C9 33 78 */ mr r9, r6 -/* 80369E04 7C A4 2B 78 */ mr r4, r5 -lbl_80369E08: -/* 80369E08 7D 25 23 79 */ or. r5, r9, r4 -/* 80369E0C 40 82 00 18 */ bne lbl_80369E24 -/* 80369E10 3C 60 80 3A */ lis r3, Zero@ha /* 0x803A2370@ha */ -/* 80369E14 54 00 27 38 */ rlwinm r0, r0, 4, 0x1c, 0x1c -/* 80369E18 38 63 23 70 */ addi r3, r3, Zero@l /* 0x803A2370@l */ -/* 80369E1C 7C 23 04 AE */ lfdx f1, r3, r0 -/* 80369E20 48 00 00 B0 */ b lbl_80369ED0 -lbl_80369E24: -/* 80369E24 3C A0 00 10 */ lis r5, 0x10 -/* 80369E28 48 00 00 18 */ b lbl_80369E40 -lbl_80369E2C: -/* 80369E2C 54 86 0F FE */ srwi r6, r4, 0x1f -/* 80369E30 7C 84 22 14 */ add r4, r4, r4 -/* 80369E34 7C C9 32 14 */ add r6, r9, r6 -/* 80369E38 38 63 FF FF */ addi r3, r3, -1 -/* 80369E3C 7D 29 32 14 */ add r9, r9, r6 -lbl_80369E40: -/* 80369E40 7C 09 28 00 */ cmpw r9, r5 -/* 80369E44 41 80 FF E8 */ blt lbl_80369E2C -/* 80369E48 2C 03 FC 02 */ cmpwi r3, -1022 -/* 80369E4C 41 80 00 24 */ blt lbl_80369E70 -/* 80369E50 38 63 03 FF */ addi r3, r3, 0x3ff -/* 80369E54 3C A9 FF F0 */ addis r5, r9, 0xfff0 -/* 80369E58 54 63 A0 16 */ slwi r3, r3, 0x14 -/* 80369E5C 90 81 00 0C */ stw r4, 0xc(r1) -/* 80369E60 7C A3 1B 78 */ or r3, r5, r3 -/* 80369E64 7C 60 03 78 */ or r0, r3, r0 -/* 80369E68 90 01 00 08 */ stw r0, 8(r1) -/* 80369E6C 48 00 00 60 */ b lbl_80369ECC -lbl_80369E70: -/* 80369E70 20 C3 FC 02 */ subfic r6, r3, -1022 -/* 80369E74 2C 06 00 14 */ cmpwi r6, 0x14 -/* 80369E78 41 81 00 1C */ bgt lbl_80369E94 -/* 80369E7C 20 66 00 20 */ subfic r3, r6, 0x20 -/* 80369E80 7C 84 34 30 */ srw r4, r4, r6 -/* 80369E84 7D 23 18 30 */ slw r3, r9, r3 -/* 80369E88 7D 29 36 30 */ sraw r9, r9, r6 -/* 80369E8C 7C 83 1B 78 */ or r3, r4, r3 -/* 80369E90 48 00 00 30 */ b lbl_80369EC0 -lbl_80369E94: -/* 80369E94 2C 06 00 1F */ cmpwi r6, 0x1f -/* 80369E98 41 81 00 1C */ bgt lbl_80369EB4 -/* 80369E9C 20 A6 00 20 */ subfic r5, r6, 0x20 -/* 80369EA0 7C 83 34 30 */ srw r3, r4, r6 -/* 80369EA4 7D 24 28 30 */ slw r4, r9, r5 -/* 80369EA8 7C 09 03 78 */ mr r9, r0 -/* 80369EAC 7C 83 1B 78 */ or r3, r4, r3 -/* 80369EB0 48 00 00 10 */ b lbl_80369EC0 -lbl_80369EB4: -/* 80369EB4 38 66 FF E0 */ addi r3, r6, -32 -/* 80369EB8 7D 23 1E 30 */ sraw r3, r9, r3 -/* 80369EBC 7C 09 03 78 */ mr r9, r0 -lbl_80369EC0: -/* 80369EC0 7D 20 03 78 */ or r0, r9, r0 -/* 80369EC4 90 61 00 0C */ stw r3, 0xc(r1) -/* 80369EC8 90 01 00 08 */ stw r0, 8(r1) -lbl_80369ECC: -/* 80369ECC C8 21 00 08 */ lfd f1, 8(r1) -lbl_80369ED0: -/* 80369ED0 38 21 00 20 */ addi r1, r1, 0x20 -/* 80369ED4 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_ceil/ceil.s b/asm/MSL_C/Math/Double_precision/s_ceil/ceil.s deleted file mode 100644 index e76c0855f0..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_ceil/ceil.s +++ /dev/null @@ -1,94 +0,0 @@ -lbl_8036BEBC: -/* 8036BEBC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036BEC0 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036BEC4 80 A1 00 08 */ lwz r5, 8(r1) -/* 8036BEC8 80 C1 00 0C */ lwz r6, 0xc(r1) -/* 8036BECC 54 A3 65 7E */ rlwinm r3, r5, 0xc, 0x15, 0x1f -/* 8036BED0 38 E3 FC 01 */ addi r7, r3, -1023 -/* 8036BED4 2C 07 00 14 */ cmpwi r7, 0x14 -/* 8036BED8 40 80 00 94 */ bge lbl_8036BF6C -/* 8036BEDC 2C 07 00 00 */ cmpwi r7, 0 -/* 8036BEE0 40 80 00 40 */ bge lbl_8036BF20 -/* 8036BEE4 C8 42 D0 E0 */ lfd f2, lit_124(r2) -/* 8036BEE8 C8 02 D0 E8 */ lfd f0, lit_125(r2) -/* 8036BEEC FC 22 08 2A */ fadd f1, f2, f1 -/* 8036BEF0 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036BEF4 40 81 00 F8 */ ble lbl_8036BFEC -/* 8036BEF8 2C 05 00 00 */ cmpwi r5, 0 -/* 8036BEFC 40 80 00 10 */ bge lbl_8036BF0C -/* 8036BF00 3C A0 80 00 */ lis r5, 0x8000 -/* 8036BF04 38 C0 00 00 */ li r6, 0 -/* 8036BF08 48 00 00 E4 */ b lbl_8036BFEC -lbl_8036BF0C: -/* 8036BF0C 7C A0 33 79 */ or. r0, r5, r6 -/* 8036BF10 41 82 00 DC */ beq lbl_8036BFEC -/* 8036BF14 3C A0 3F F0 */ lis r5, 0x3ff0 -/* 8036BF18 38 C0 00 00 */ li r6, 0 -/* 8036BF1C 48 00 00 D0 */ b lbl_8036BFEC -lbl_8036BF20: -/* 8036BF20 3C 60 00 10 */ lis r3, 0x0010 /* 0x000FFFFF@ha */ -/* 8036BF24 38 03 FF FF */ addi r0, r3, 0xFFFF /* 0x000FFFFF@l */ -/* 8036BF28 7C 04 3E 30 */ sraw r4, r0, r7 -/* 8036BF2C 7C A0 20 38 */ and r0, r5, r4 -/* 8036BF30 7C C0 03 79 */ or. r0, r6, r0 -/* 8036BF34 40 82 00 08 */ bne lbl_8036BF3C -/* 8036BF38 48 00 00 C0 */ b lbl_8036BFF8 -lbl_8036BF3C: -/* 8036BF3C C8 42 D0 E0 */ lfd f2, lit_124(r2) -/* 8036BF40 C8 02 D0 E8 */ lfd f0, lit_125(r2) -/* 8036BF44 FC 22 08 2A */ fadd f1, f2, f1 -/* 8036BF48 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036BF4C 40 81 00 A0 */ ble lbl_8036BFEC -/* 8036BF50 2C 05 00 00 */ cmpwi r5, 0 -/* 8036BF54 40 81 00 0C */ ble lbl_8036BF60 -/* 8036BF58 7C 60 3E 30 */ sraw r0, r3, r7 -/* 8036BF5C 7C A5 02 14 */ add r5, r5, r0 -lbl_8036BF60: -/* 8036BF60 7C A5 20 78 */ andc r5, r5, r4 -/* 8036BF64 38 C0 00 00 */ li r6, 0 -/* 8036BF68 48 00 00 84 */ b lbl_8036BFEC -lbl_8036BF6C: -/* 8036BF6C 2C 07 00 33 */ cmpwi r7, 0x33 -/* 8036BF70 40 81 00 14 */ ble lbl_8036BF84 -/* 8036BF74 2C 07 04 00 */ cmpwi r7, 0x400 -/* 8036BF78 40 82 00 80 */ bne lbl_8036BFF8 -/* 8036BF7C FC 21 08 2A */ fadd f1, f1, f1 -/* 8036BF80 48 00 00 78 */ b lbl_8036BFF8 -lbl_8036BF84: -/* 8036BF84 38 07 FF EC */ addi r0, r7, -20 -/* 8036BF88 38 60 FF FF */ li r3, -1 -/* 8036BF8C 7C 64 04 30 */ srw r4, r3, r0 -/* 8036BF90 7C C0 20 39 */ and. r0, r6, r4 -/* 8036BF94 40 82 00 08 */ bne lbl_8036BF9C -/* 8036BF98 48 00 00 60 */ b lbl_8036BFF8 -lbl_8036BF9C: -/* 8036BF9C C8 42 D0 E0 */ lfd f2, lit_124(r2) -/* 8036BFA0 C8 02 D0 E8 */ lfd f0, lit_125(r2) -/* 8036BFA4 FC 22 08 2A */ fadd f1, f2, f1 -/* 8036BFA8 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036BFAC 40 81 00 40 */ ble lbl_8036BFEC -/* 8036BFB0 2C 05 00 00 */ cmpwi r5, 0 -/* 8036BFB4 40 81 00 34 */ ble lbl_8036BFE8 -/* 8036BFB8 2C 07 00 14 */ cmpwi r7, 0x14 -/* 8036BFBC 40 82 00 0C */ bne lbl_8036BFC8 -/* 8036BFC0 38 A5 00 01 */ addi r5, r5, 1 -/* 8036BFC4 48 00 00 24 */ b lbl_8036BFE8 -lbl_8036BFC8: -/* 8036BFC8 20 07 00 34 */ subfic r0, r7, 0x34 -/* 8036BFCC 38 60 00 01 */ li r3, 1 -/* 8036BFD0 7C 60 00 30 */ slw r0, r3, r0 -/* 8036BFD4 7C 06 02 14 */ add r0, r6, r0 -/* 8036BFD8 7C 00 30 40 */ cmplw r0, r6 -/* 8036BFDC 40 80 00 08 */ bge lbl_8036BFE4 -/* 8036BFE0 38 A5 00 01 */ addi r5, r5, 1 -lbl_8036BFE4: -/* 8036BFE4 7C 06 03 78 */ mr r6, r0 -lbl_8036BFE8: -/* 8036BFE8 7C C6 20 78 */ andc r6, r6, r4 -lbl_8036BFEC: -/* 8036BFEC 90 A1 00 08 */ stw r5, 8(r1) -/* 8036BFF0 90 C1 00 0C */ stw r6, 0xc(r1) -/* 8036BFF4 C8 21 00 08 */ lfd f1, 8(r1) -lbl_8036BFF8: -/* 8036BFF8 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036BFFC 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_copysign/copysign.s b/asm/MSL_C/Math/Double_precision/s_copysign/copysign.s deleted file mode 100644 index 858fc41513..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_copysign/copysign.s +++ /dev/null @@ -1,11 +0,0 @@ -lbl_8036C000: -/* 8036C000 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8036C004 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C008 D8 41 00 10 */ stfd f2, 0x10(r1) -/* 8036C00C 80 61 00 08 */ lwz r3, 8(r1) -/* 8036C010 80 01 00 10 */ lwz r0, 0x10(r1) -/* 8036C014 50 60 00 7E */ rlwimi r0, r3, 0, 1, 0x1f -/* 8036C018 90 01 00 08 */ stw r0, 8(r1) -/* 8036C01C C8 21 00 08 */ lfd f1, 8(r1) -/* 8036C020 38 21 00 20 */ addi r1, r1, 0x20 -/* 8036C024 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_cos/cos.s b/asm/MSL_C/Math/Double_precision/s_cos/cos.s deleted file mode 100644 index 85f3e4e44a..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_cos/cos.s +++ /dev/null @@ -1,62 +0,0 @@ -lbl_8036C028: -/* 8036C028 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8036C02C 7C 08 02 A6 */ mflr r0 -/* 8036C030 3C 60 3F E9 */ lis r3, 0x3FE9 /* 0x3FE921FB@ha */ -/* 8036C034 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C038 90 01 00 24 */ stw r0, 0x24(r1) -/* 8036C03C 38 03 21 FB */ addi r0, r3, 0x21FB /* 0x3FE921FB@l */ -/* 8036C040 80 61 00 08 */ lwz r3, 8(r1) -/* 8036C044 54 63 00 7E */ clrlwi r3, r3, 1 -/* 8036C048 7C 03 00 00 */ cmpw r3, r0 -/* 8036C04C 41 81 00 10 */ bgt lbl_8036C05C -/* 8036C050 C8 42 D0 F0 */ lfd f2, lit_67(r2) -/* 8036C054 4B FF EA 55 */ bl __kernel_cos -/* 8036C058 48 00 00 94 */ b lbl_8036C0EC -lbl_8036C05C: -/* 8036C05C 3C 00 7F F0 */ lis r0, 0x7ff0 -/* 8036C060 7C 03 00 00 */ cmpw r3, r0 -/* 8036C064 41 80 00 0C */ blt lbl_8036C070 -/* 8036C068 FC 21 08 28 */ fsub f1, f1, f1 -/* 8036C06C 48 00 00 80 */ b lbl_8036C0EC -lbl_8036C070: -/* 8036C070 38 61 00 10 */ addi r3, r1, 0x10 -/* 8036C074 4B FF E6 95 */ bl __ieee754_rem_pio2 -/* 8036C078 54 60 07 BE */ clrlwi r0, r3, 0x1e -/* 8036C07C 2C 00 00 01 */ cmpwi r0, 1 -/* 8036C080 41 82 00 30 */ beq lbl_8036C0B0 -/* 8036C084 40 80 00 10 */ bge lbl_8036C094 -/* 8036C088 2C 00 00 00 */ cmpwi r0, 0 -/* 8036C08C 40 80 00 14 */ bge lbl_8036C0A0 -/* 8036C090 48 00 00 4C */ b lbl_8036C0DC -lbl_8036C094: -/* 8036C094 2C 00 00 03 */ cmpwi r0, 3 -/* 8036C098 40 80 00 44 */ bge lbl_8036C0DC -/* 8036C09C 48 00 00 2C */ b lbl_8036C0C8 -lbl_8036C0A0: -/* 8036C0A0 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C0A4 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C0A8 4B FF EA 01 */ bl __kernel_cos -/* 8036C0AC 48 00 00 40 */ b lbl_8036C0EC -lbl_8036C0B0: -/* 8036C0B0 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C0B4 38 60 00 01 */ li r3, 1 -/* 8036C0B8 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C0BC 4B FF F9 35 */ bl __kernel_sin -/* 8036C0C0 FC 20 08 50 */ fneg f1, f1 -/* 8036C0C4 48 00 00 28 */ b lbl_8036C0EC -lbl_8036C0C8: -/* 8036C0C8 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C0CC C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C0D0 4B FF E9 D9 */ bl __kernel_cos -/* 8036C0D4 FC 20 08 50 */ fneg f1, f1 -/* 8036C0D8 48 00 00 14 */ b lbl_8036C0EC -lbl_8036C0DC: -/* 8036C0DC C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C0E0 38 60 00 01 */ li r3, 1 -/* 8036C0E4 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C0E8 4B FF F9 09 */ bl __kernel_sin -lbl_8036C0EC: -/* 8036C0EC 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8036C0F0 7C 08 03 A6 */ mtlr r0 -/* 8036C0F4 38 21 00 20 */ addi r1, r1, 0x20 -/* 8036C0F8 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_floor/floor.s b/asm/MSL_C/Math/Double_precision/s_floor/floor.s deleted file mode 100644 index 94da8c1902..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_floor/floor.s +++ /dev/null @@ -1,95 +0,0 @@ -lbl_8036C0FC: -/* 8036C0FC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C100 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C104 80 A1 00 08 */ lwz r5, 8(r1) -/* 8036C108 80 C1 00 0C */ lwz r6, 0xc(r1) -/* 8036C10C 54 A3 65 7E */ rlwinm r3, r5, 0xc, 0x15, 0x1f -/* 8036C110 38 E3 FC 01 */ addi r7, r3, -1023 -/* 8036C114 2C 07 00 14 */ cmpwi r7, 0x14 -/* 8036C118 40 80 00 98 */ bge lbl_8036C1B0 -/* 8036C11C 2C 07 00 00 */ cmpwi r7, 0 -/* 8036C120 40 80 00 44 */ bge lbl_8036C164 -/* 8036C124 C8 42 D0 F8 */ lfd f2, lit_124(r2) -/* 8036C128 C8 02 D1 00 */ lfd f0, lit_125(r2) -/* 8036C12C FC 22 08 2A */ fadd f1, f2, f1 -/* 8036C130 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036C134 40 81 00 FC */ ble lbl_8036C230 -/* 8036C138 2C 05 00 00 */ cmpwi r5, 0 -/* 8036C13C 41 80 00 10 */ blt lbl_8036C14C -/* 8036C140 38 C0 00 00 */ li r6, 0 -/* 8036C144 38 A0 00 00 */ li r5, 0 -/* 8036C148 48 00 00 E8 */ b lbl_8036C230 -lbl_8036C14C: -/* 8036C14C 54 A0 00 7E */ clrlwi r0, r5, 1 -/* 8036C150 7C 00 33 79 */ or. r0, r0, r6 -/* 8036C154 41 82 00 DC */ beq lbl_8036C230 -/* 8036C158 3C A0 BF F0 */ lis r5, 0xbff0 -/* 8036C15C 38 C0 00 00 */ li r6, 0 -/* 8036C160 48 00 00 D0 */ b lbl_8036C230 -lbl_8036C164: -/* 8036C164 3C 60 00 10 */ lis r3, 0x0010 /* 0x000FFFFF@ha */ -/* 8036C168 38 03 FF FF */ addi r0, r3, 0xFFFF /* 0x000FFFFF@l */ -/* 8036C16C 7C 04 3E 30 */ sraw r4, r0, r7 -/* 8036C170 7C A0 20 38 */ and r0, r5, r4 -/* 8036C174 7C C0 03 79 */ or. r0, r6, r0 -/* 8036C178 40 82 00 08 */ bne lbl_8036C180 -/* 8036C17C 48 00 00 C0 */ b lbl_8036C23C -lbl_8036C180: -/* 8036C180 C8 42 D0 F8 */ lfd f2, lit_124(r2) -/* 8036C184 C8 02 D1 00 */ lfd f0, lit_125(r2) -/* 8036C188 FC 22 08 2A */ fadd f1, f2, f1 -/* 8036C18C FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036C190 40 81 00 A0 */ ble lbl_8036C230 -/* 8036C194 2C 05 00 00 */ cmpwi r5, 0 -/* 8036C198 40 80 00 0C */ bge lbl_8036C1A4 -/* 8036C19C 7C 60 3E 30 */ sraw r0, r3, r7 -/* 8036C1A0 7C A5 02 14 */ add r5, r5, r0 -lbl_8036C1A4: -/* 8036C1A4 7C A5 20 78 */ andc r5, r5, r4 -/* 8036C1A8 38 C0 00 00 */ li r6, 0 -/* 8036C1AC 48 00 00 84 */ b lbl_8036C230 -lbl_8036C1B0: -/* 8036C1B0 2C 07 00 33 */ cmpwi r7, 0x33 -/* 8036C1B4 40 81 00 14 */ ble lbl_8036C1C8 -/* 8036C1B8 2C 07 04 00 */ cmpwi r7, 0x400 -/* 8036C1BC 40 82 00 80 */ bne lbl_8036C23C -/* 8036C1C0 FC 21 08 2A */ fadd f1, f1, f1 -/* 8036C1C4 48 00 00 78 */ b lbl_8036C23C -lbl_8036C1C8: -/* 8036C1C8 38 07 FF EC */ addi r0, r7, -20 -/* 8036C1CC 38 60 FF FF */ li r3, -1 -/* 8036C1D0 7C 64 04 30 */ srw r4, r3, r0 -/* 8036C1D4 7C C0 20 39 */ and. r0, r6, r4 -/* 8036C1D8 40 82 00 08 */ bne lbl_8036C1E0 -/* 8036C1DC 48 00 00 60 */ b lbl_8036C23C -lbl_8036C1E0: -/* 8036C1E0 C8 42 D0 F8 */ lfd f2, lit_124(r2) -/* 8036C1E4 C8 02 D1 00 */ lfd f0, lit_125(r2) -/* 8036C1E8 FC 22 08 2A */ fadd f1, f2, f1 -/* 8036C1EC FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8036C1F0 40 81 00 40 */ ble lbl_8036C230 -/* 8036C1F4 2C 05 00 00 */ cmpwi r5, 0 -/* 8036C1F8 40 80 00 34 */ bge lbl_8036C22C -/* 8036C1FC 2C 07 00 14 */ cmpwi r7, 0x14 -/* 8036C200 40 82 00 0C */ bne lbl_8036C20C -/* 8036C204 38 A5 00 01 */ addi r5, r5, 1 -/* 8036C208 48 00 00 24 */ b lbl_8036C22C -lbl_8036C20C: -/* 8036C20C 20 07 00 34 */ subfic r0, r7, 0x34 -/* 8036C210 38 60 00 01 */ li r3, 1 -/* 8036C214 7C 60 00 30 */ slw r0, r3, r0 -/* 8036C218 7C 06 02 14 */ add r0, r6, r0 -/* 8036C21C 7C 00 30 40 */ cmplw r0, r6 -/* 8036C220 40 80 00 08 */ bge lbl_8036C228 -/* 8036C224 38 A5 00 01 */ addi r5, r5, 1 -lbl_8036C228: -/* 8036C228 7C 06 03 78 */ mr r6, r0 -lbl_8036C22C: -/* 8036C22C 7C C6 20 78 */ andc r6, r6, r4 -lbl_8036C230: -/* 8036C230 90 A1 00 08 */ stw r5, 8(r1) -/* 8036C234 90 C1 00 0C */ stw r6, 0xc(r1) -/* 8036C238 C8 21 00 08 */ lfd f1, 8(r1) -lbl_8036C23C: -/* 8036C23C 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C240 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_frexp/frexp.s b/asm/MSL_C/Math/Double_precision/s_frexp/frexp.s deleted file mode 100644 index c8668fbd35..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_frexp/frexp.s +++ /dev/null @@ -1,40 +0,0 @@ -lbl_8036C244: -/* 8036C244 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C248 38 80 00 00 */ li r4, 0 -/* 8036C24C 3C 00 7F F0 */ lis r0, 0x7ff0 -/* 8036C250 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C254 80 A1 00 08 */ lwz r5, 8(r1) -/* 8036C258 90 83 00 00 */ stw r4, 0(r3) -/* 8036C25C 54 A4 00 7E */ clrlwi r4, r5, 1 -/* 8036C260 80 C1 00 0C */ lwz r6, 0xc(r1) -/* 8036C264 7C 04 00 00 */ cmpw r4, r0 -/* 8036C268 40 80 00 0C */ bge lbl_8036C274 -/* 8036C26C 7C 80 33 79 */ or. r0, r4, r6 -/* 8036C270 40 82 00 0C */ bne lbl_8036C27C -lbl_8036C274: -/* 8036C274 C8 21 00 08 */ lfd f1, 8(r1) -/* 8036C278 48 00 00 50 */ b lbl_8036C2C8 -lbl_8036C27C: -/* 8036C27C 3C 00 00 10 */ lis r0, 0x10 -/* 8036C280 7C 04 00 00 */ cmpw r4, r0 -/* 8036C284 40 80 00 20 */ bge lbl_8036C2A4 -/* 8036C288 C8 02 D1 08 */ lfd f0, lit_57(r2) -/* 8036C28C 38 00 FF CA */ li r0, -54 -/* 8036C290 90 03 00 00 */ stw r0, 0(r3) -/* 8036C294 FC 01 00 32 */ fmul f0, f1, f0 -/* 8036C298 D8 01 00 08 */ stfd f0, 8(r1) -/* 8036C29C 80 A1 00 08 */ lwz r5, 8(r1) -/* 8036C2A0 54 A4 00 7E */ clrlwi r4, r5, 1 -lbl_8036C2A4: -/* 8036C2A4 54 A0 03 00 */ rlwinm r0, r5, 0, 0xc, 0 -/* 8036C2A8 80 A3 00 00 */ lwz r5, 0(r3) -/* 8036C2AC 7C 84 A6 70 */ srawi r4, r4, 0x14 -/* 8036C2B0 64 00 3F E0 */ oris r0, r0, 0x3fe0 -/* 8036C2B4 90 01 00 08 */ stw r0, 8(r1) -/* 8036C2B8 7C 84 2A 14 */ add r4, r4, r5 -/* 8036C2BC 38 04 FC 02 */ addi r0, r4, -1022 -/* 8036C2C0 90 03 00 00 */ stw r0, 0(r3) -/* 8036C2C4 C8 21 00 08 */ lfd f1, 8(r1) -lbl_8036C2C8: -/* 8036C2C8 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C2CC 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_modf/modf.s b/asm/MSL_C/Math/Double_precision/s_modf/modf.s deleted file mode 100644 index ea82d94851..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_modf/modf.s +++ /dev/null @@ -1,70 +0,0 @@ -lbl_8036C494: -/* 8036C494 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C498 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C49C 80 A1 00 08 */ lwz r5, 8(r1) -/* 8036C4A0 80 C1 00 0C */ lwz r6, 0xc(r1) -/* 8036C4A4 54 A4 65 7E */ rlwinm r4, r5, 0xc, 0x15, 0x1f -/* 8036C4A8 38 E4 FC 01 */ addi r7, r4, -1023 -/* 8036C4AC 2C 07 00 14 */ cmpwi r7, 0x14 -/* 8036C4B0 40 80 00 70 */ bge lbl_8036C520 -/* 8036C4B4 2C 07 00 00 */ cmpwi r7, 0 -/* 8036C4B8 40 80 00 18 */ bge lbl_8036C4D0 -/* 8036C4BC 54 A4 00 00 */ rlwinm r4, r5, 0, 0, 0 -/* 8036C4C0 38 00 00 00 */ li r0, 0 -/* 8036C4C4 90 83 00 00 */ stw r4, 0(r3) -/* 8036C4C8 90 03 00 04 */ stw r0, 4(r3) -/* 8036C4CC 48 00 00 BC */ b lbl_8036C588 -lbl_8036C4D0: -/* 8036C4D0 3C 80 00 10 */ lis r4, 0x0010 /* 0x000FFFFF@ha */ -/* 8036C4D4 38 04 FF FF */ addi r0, r4, 0xFFFF /* 0x000FFFFF@l */ -/* 8036C4D8 7C 04 3E 30 */ sraw r4, r0, r7 -/* 8036C4DC 7C A0 20 38 */ and r0, r5, r4 -/* 8036C4E0 7C C0 03 79 */ or. r0, r6, r0 -/* 8036C4E4 40 82 00 20 */ bne lbl_8036C504 -/* 8036C4E8 54 A4 00 00 */ rlwinm r4, r5, 0, 0, 0 -/* 8036C4EC 38 00 00 00 */ li r0, 0 -/* 8036C4F0 90 81 00 08 */ stw r4, 8(r1) -/* 8036C4F4 90 01 00 0C */ stw r0, 0xc(r1) -/* 8036C4F8 D8 23 00 00 */ stfd f1, 0(r3) -/* 8036C4FC C8 21 00 08 */ lfd f1, 8(r1) -/* 8036C500 48 00 00 88 */ b lbl_8036C588 -lbl_8036C504: -/* 8036C504 7C A4 20 78 */ andc r4, r5, r4 -/* 8036C508 38 00 00 00 */ li r0, 0 -/* 8036C50C 90 83 00 00 */ stw r4, 0(r3) -/* 8036C510 90 03 00 04 */ stw r0, 4(r3) -/* 8036C514 C8 03 00 00 */ lfd f0, 0(r3) -/* 8036C518 FC 21 00 28 */ fsub f1, f1, f0 -/* 8036C51C 48 00 00 6C */ b lbl_8036C588 -lbl_8036C520: -/* 8036C520 2C 07 00 33 */ cmpwi r7, 0x33 -/* 8036C524 40 81 00 20 */ ble lbl_8036C544 -/* 8036C528 54 A4 00 00 */ rlwinm r4, r5, 0, 0, 0 -/* 8036C52C 38 00 00 00 */ li r0, 0 -/* 8036C530 90 81 00 08 */ stw r4, 8(r1) -/* 8036C534 90 01 00 0C */ stw r0, 0xc(r1) -/* 8036C538 D8 23 00 00 */ stfd f1, 0(r3) -/* 8036C53C C8 21 00 08 */ lfd f1, 8(r1) -/* 8036C540 48 00 00 48 */ b lbl_8036C588 -lbl_8036C544: -/* 8036C544 38 07 FF EC */ addi r0, r7, -20 -/* 8036C548 38 80 FF FF */ li r4, -1 -/* 8036C54C 7C 84 04 30 */ srw r4, r4, r0 -/* 8036C550 7C C0 20 39 */ and. r0, r6, r4 -/* 8036C554 40 82 00 20 */ bne lbl_8036C574 -/* 8036C558 54 A4 00 00 */ rlwinm r4, r5, 0, 0, 0 -/* 8036C55C 38 00 00 00 */ li r0, 0 -/* 8036C560 90 81 00 08 */ stw r4, 8(r1) -/* 8036C564 90 01 00 0C */ stw r0, 0xc(r1) -/* 8036C568 D8 23 00 00 */ stfd f1, 0(r3) -/* 8036C56C C8 21 00 08 */ lfd f1, 8(r1) -/* 8036C570 48 00 00 18 */ b lbl_8036C588 -lbl_8036C574: -/* 8036C574 90 A3 00 00 */ stw r5, 0(r3) -/* 8036C578 7C C0 20 78 */ andc r0, r6, r4 -/* 8036C57C 90 03 00 04 */ stw r0, 4(r3) -/* 8036C580 C8 03 00 00 */ lfd f0, 0(r3) -/* 8036C584 FC 21 00 28 */ fsub f1, f1, f0 -lbl_8036C588: -/* 8036C588 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C58C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_sin/sin.s b/asm/MSL_C/Math/Double_precision/s_sin/sin.s deleted file mode 100644 index 96fcfe2a46..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_sin/sin.s +++ /dev/null @@ -1,63 +0,0 @@ -lbl_8036C590: -/* 8036C590 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8036C594 7C 08 02 A6 */ mflr r0 -/* 8036C598 3C 60 3F E9 */ lis r3, 0x3FE9 /* 0x3FE921FB@ha */ -/* 8036C59C D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C5A0 90 01 00 24 */ stw r0, 0x24(r1) -/* 8036C5A4 38 03 21 FB */ addi r0, r3, 0x21FB /* 0x3FE921FB@l */ -/* 8036C5A8 80 61 00 08 */ lwz r3, 8(r1) -/* 8036C5AC 54 63 00 7E */ clrlwi r3, r3, 1 -/* 8036C5B0 7C 03 00 00 */ cmpw r3, r0 -/* 8036C5B4 41 81 00 14 */ bgt lbl_8036C5C8 -/* 8036C5B8 C8 42 D1 38 */ lfd f2, lit_67(r2) -/* 8036C5BC 38 60 00 00 */ li r3, 0 -/* 8036C5C0 4B FF F4 31 */ bl __kernel_sin -/* 8036C5C4 48 00 00 94 */ b lbl_8036C658 -lbl_8036C5C8: -/* 8036C5C8 3C 00 7F F0 */ lis r0, 0x7ff0 -/* 8036C5CC 7C 03 00 00 */ cmpw r3, r0 -/* 8036C5D0 41 80 00 0C */ blt lbl_8036C5DC -/* 8036C5D4 FC 21 08 28 */ fsub f1, f1, f1 -/* 8036C5D8 48 00 00 80 */ b lbl_8036C658 -lbl_8036C5DC: -/* 8036C5DC 38 61 00 10 */ addi r3, r1, 0x10 -/* 8036C5E0 4B FF E1 29 */ bl __ieee754_rem_pio2 -/* 8036C5E4 54 60 07 BE */ clrlwi r0, r3, 0x1e -/* 8036C5E8 2C 00 00 01 */ cmpwi r0, 1 -/* 8036C5EC 41 82 00 34 */ beq lbl_8036C620 -/* 8036C5F0 40 80 00 10 */ bge lbl_8036C600 -/* 8036C5F4 2C 00 00 00 */ cmpwi r0, 0 -/* 8036C5F8 40 80 00 14 */ bge lbl_8036C60C -/* 8036C5FC 48 00 00 4C */ b lbl_8036C648 -lbl_8036C600: -/* 8036C600 2C 00 00 03 */ cmpwi r0, 3 -/* 8036C604 40 80 00 44 */ bge lbl_8036C648 -/* 8036C608 48 00 00 28 */ b lbl_8036C630 -lbl_8036C60C: -/* 8036C60C C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C610 38 60 00 01 */ li r3, 1 -/* 8036C614 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C618 4B FF F3 D9 */ bl __kernel_sin -/* 8036C61C 48 00 00 3C */ b lbl_8036C658 -lbl_8036C620: -/* 8036C620 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C624 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C628 4B FF E4 81 */ bl __kernel_cos -/* 8036C62C 48 00 00 2C */ b lbl_8036C658 -lbl_8036C630: -/* 8036C630 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C634 38 60 00 01 */ li r3, 1 -/* 8036C638 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C63C 4B FF F3 B5 */ bl __kernel_sin -/* 8036C640 FC 20 08 50 */ fneg f1, f1 -/* 8036C644 48 00 00 14 */ b lbl_8036C658 -lbl_8036C648: -/* 8036C648 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C64C C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C650 4B FF E4 59 */ bl __kernel_cos -/* 8036C654 FC 20 08 50 */ fneg f1, f1 -lbl_8036C658: -/* 8036C658 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8036C65C 7C 08 03 A6 */ mtlr r0 -/* 8036C660 38 21 00 20 */ addi r1, r1, 0x20 -/* 8036C664 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/s_tan/tan.s b/asm/MSL_C/Math/Double_precision/s_tan/tan.s deleted file mode 100644 index a4298e631e..0000000000 --- a/asm/MSL_C/Math/Double_precision/s_tan/tan.s +++ /dev/null @@ -1,34 +0,0 @@ -lbl_8036C668: -/* 8036C668 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8036C66C 7C 08 02 A6 */ mflr r0 -/* 8036C670 3C 60 3F E9 */ lis r3, 0x3FE9 /* 0x3FE921FB@ha */ -/* 8036C674 D8 21 00 08 */ stfd f1, 8(r1) -/* 8036C678 90 01 00 24 */ stw r0, 0x24(r1) -/* 8036C67C 38 03 21 FB */ addi r0, r3, 0x21FB /* 0x3FE921FB@l */ -/* 8036C680 80 61 00 08 */ lwz r3, 8(r1) -/* 8036C684 54 63 00 7E */ clrlwi r3, r3, 1 -/* 8036C688 7C 03 00 00 */ cmpw r3, r0 -/* 8036C68C 41 81 00 14 */ bgt lbl_8036C6A0 -/* 8036C690 C8 42 D1 40 */ lfd f2, lit_58(r2) -/* 8036C694 38 60 00 01 */ li r3, 1 -/* 8036C698 4B FF F3 F9 */ bl __kernel_tan -/* 8036C69C 48 00 00 34 */ b lbl_8036C6D0 -lbl_8036C6A0: -/* 8036C6A0 3C 00 7F F0 */ lis r0, 0x7ff0 -/* 8036C6A4 7C 03 00 00 */ cmpw r3, r0 -/* 8036C6A8 41 80 00 0C */ blt lbl_8036C6B4 -/* 8036C6AC FC 21 08 28 */ fsub f1, f1, f1 -/* 8036C6B0 48 00 00 20 */ b lbl_8036C6D0 -lbl_8036C6B4: -/* 8036C6B4 38 61 00 10 */ addi r3, r1, 0x10 -/* 8036C6B8 4B FF E0 51 */ bl __ieee754_rem_pio2 -/* 8036C6BC 54 60 0F BC */ rlwinm r0, r3, 1, 0x1e, 0x1e -/* 8036C6C0 C8 21 00 10 */ lfd f1, 0x10(r1) -/* 8036C6C4 C8 41 00 18 */ lfd f2, 0x18(r1) -/* 8036C6C8 20 60 00 01 */ subfic r3, r0, 1 -/* 8036C6CC 4B FF F3 C5 */ bl __kernel_tan -lbl_8036C6D0: -/* 8036C6D0 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8036C6D4 7C 08 03 A6 */ mtlr r0 -/* 8036C6D8 38 21 00 20 */ addi r1, r1, 0x20 -/* 8036C6DC 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_acos/acos.s b/asm/MSL_C/Math/Double_precision/w_acos/acos.s deleted file mode 100644 index 9796648b5d..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_acos/acos.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C6E0: -/* 8036C6E0 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C6E4 7C 08 02 A6 */ mflr r0 -/* 8036C6E8 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C6EC 4B FF CB 89 */ bl __ieee754_acos -/* 8036C6F0 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C6F4 7C 08 03 A6 */ mtlr r0 -/* 8036C6F8 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C6FC 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_asin/asin.s b/asm/MSL_C/Math/Double_precision/w_asin/asin.s deleted file mode 100644 index 5349596c90..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_asin/asin.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C700: -/* 8036C700 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C704 7C 08 02 A6 */ mflr r0 -/* 8036C708 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C70C 4B FF CD A5 */ bl __ieee754_asin -/* 8036C710 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C714 7C 08 03 A6 */ mtlr r0 -/* 8036C718 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C71C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_atan2/atan2.s b/asm/MSL_C/Math/Double_precision/w_atan2/atan2.s deleted file mode 100644 index 5537210f03..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_atan2/atan2.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C720: -/* 8036C720 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C724 7C 08 02 A6 */ mflr r0 -/* 8036C728 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C72C 4B FF CF BD */ bl __ieee754_atan2 -/* 8036C730 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C734 7C 08 03 A6 */ mtlr r0 -/* 8036C738 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C73C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_exp/exp.s b/asm/MSL_C/Math/Double_precision/w_exp/exp.s deleted file mode 100644 index 51ca1f0fbd..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_exp/exp.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C740: -/* 8036C740 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C744 7C 08 02 A6 */ mflr r0 -/* 8036C748 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C74C 4B FF D2 2D */ bl __ieee754_exp -/* 8036C750 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C754 7C 08 03 A6 */ mtlr r0 -/* 8036C758 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C75C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_fmod/fmod.s b/asm/MSL_C/Math/Double_precision/w_fmod/fmod.s deleted file mode 100644 index a11ea2b10e..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_fmod/fmod.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C760: -/* 8036C760 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C764 7C 08 02 A6 */ mflr r0 -/* 8036C768 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C76C 4B FF D4 31 */ bl __ieee754_fmod -/* 8036C770 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C774 7C 08 03 A6 */ mtlr r0 -/* 8036C778 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C77C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_pow/pow.s b/asm/MSL_C/Math/Double_precision/w_pow/pow.s deleted file mode 100644 index 2fb44cbe5c..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_pow/pow.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036C780: -/* 8036C780 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C784 7C 08 02 A6 */ mflr r0 -/* 8036C788 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C78C 4B FF D7 4D */ bl __ieee754_pow -/* 8036C790 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C794 7C 08 03 A6 */ mtlr r0 -/* 8036C798 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C79C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s b/asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s deleted file mode 100644 index 82eb581977..0000000000 --- a/asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s +++ /dev/null @@ -1,9 +0,0 @@ -lbl_8036CA54: -/* 8036CA54 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036CA58 7C 08 02 A6 */ mflr r0 -/* 8036CA5C 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036CA60 4B FF FD 41 */ bl __ieee754_sqrt -/* 8036CA64 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036CA68 7C 08 03 A6 */ mtlr r0 -/* 8036CA6C 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036CA70 4E 80 00 20 */ blr diff --git a/asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s b/asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s deleted file mode 100644 index 1bf1b91e3d..0000000000 --- a/asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_8036CA30: -/* 8036CA30 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036CA34 7C 08 02 A6 */ mflr r0 -/* 8036CA38 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036CA3C 4B FF FC A5 */ bl acos -/* 8036CA40 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036CA44 FC 20 08 18 */ frsp f1, f1 -/* 8036CA48 7C 08 03 A6 */ mtlr r0 -/* 8036CA4C 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036CA50 4E 80 00 20 */ blr diff --git a/asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s b/asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s deleted file mode 100644 index 1e109db09d..0000000000 --- a/asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_8036CA0C: -/* 8036CA0C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036CA10 7C 08 02 A6 */ mflr r0 -/* 8036CA14 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036CA18 4B FF F6 11 */ bl cos -/* 8036CA1C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036CA20 FC 20 08 18 */ frsp f1, f1 -/* 8036CA24 7C 08 03 A6 */ mtlr r0 -/* 8036CA28 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036CA2C 4E 80 00 20 */ blr diff --git a/asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s b/asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s deleted file mode 100644 index d0c5164edb..0000000000 --- a/asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_8036C9E8: -/* 8036C9E8 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C9EC 7C 08 02 A6 */ mflr r0 -/* 8036C9F0 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C9F4 4B FF FB 9D */ bl sin -/* 8036C9F8 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C9FC FC 20 08 18 */ frsp f1, f1 -/* 8036CA00 7C 08 03 A6 */ mtlr r0 -/* 8036CA04 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036CA08 4E 80 00 20 */ blr diff --git a/asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s b/asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s deleted file mode 100644 index e28f77e85b..0000000000 --- a/asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_8036C9C4: -/* 8036C9C4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8036C9C8 7C 08 02 A6 */ mflr r0 -/* 8036C9CC 90 01 00 14 */ stw r0, 0x14(r1) -/* 8036C9D0 4B FF FC 99 */ bl tan -/* 8036C9D4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8036C9D8 FC 20 08 18 */ frsp f1, f1 -/* 8036C9DC 7C 08 03 A6 */ mtlr r0 -/* 8036C9E0 38 21 00 10 */ addi r1, r1, 0x10 -/* 8036C9E4 4E 80 00 20 */ blr diff --git a/asm/MSL_C/PPC_EABI/Src/uart_console_io_gcn/__write_console.s b/asm/MSL_C/PPC_EABI/Src/uart_console_io_gcn/__write_console.s deleted file mode 100644 index 55b4ded89f..0000000000 --- a/asm/MSL_C/PPC_EABI/Src/uart_console_io_gcn/__write_console.s +++ /dev/null @@ -1,57 +0,0 @@ -lbl_803691A4: -/* 803691A4 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 803691A8 7C 08 02 A6 */ mflr r0 -/* 803691AC 90 01 00 24 */ stw r0, 0x24(r1) -/* 803691B0 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 803691B4 7C DF 33 78 */ mr r31, r6 -/* 803691B8 93 C1 00 18 */ stw r30, 0x18(r1) -/* 803691BC 7C BE 2B 78 */ mr r30, r5 -/* 803691C0 93 A1 00 14 */ stw r29, 0x14(r1) -/* 803691C4 7C 9D 23 78 */ mr r29, r4 -/* 803691C8 93 81 00 10 */ stw r28, 0x10(r1) -/* 803691CC 7C 7C 1B 78 */ mr r28, r3 -/* 803691D0 4B FD 0D 2D */ bl OSGetConsoleType -/* 803691D4 54 60 00 85 */ rlwinm. r0, r3, 0, 2, 2 -/* 803691D8 40 82 00 64 */ bne lbl_8036923C -/* 803691DC 80 0D 94 30 */ lwz r0, initialized(r13) -/* 803691E0 38 60 00 00 */ li r3, 0 -/* 803691E4 2C 00 00 00 */ cmpwi r0, 0 -/* 803691E8 40 82 00 20 */ bne lbl_80369208 -/* 803691EC 3C 60 00 01 */ lis r3, 0x0001 /* 0x0000E100@ha */ -/* 803691F0 38 63 E1 00 */ addi r3, r3, 0xE100 /* 0x0000E100@l */ -/* 803691F4 4B FD B7 3D */ bl InitializeUART -/* 803691F8 2C 03 00 00 */ cmpwi r3, 0 -/* 803691FC 40 82 00 0C */ bne lbl_80369208 -/* 80369200 38 00 00 01 */ li r0, 1 -/* 80369204 90 0D 94 30 */ stw r0, initialized(r13) -lbl_80369208: -/* 80369208 2C 03 00 00 */ cmpwi r3, 0 -/* 8036920C 41 82 00 0C */ beq lbl_80369218 -/* 80369210 38 60 00 01 */ li r3, 1 -/* 80369214 48 00 00 40 */ b lbl_80369254 -lbl_80369218: -/* 80369218 80 9E 00 00 */ lwz r4, 0(r30) -/* 8036921C 7F A3 EB 78 */ mr r3, r29 -/* 80369220 4B FD B7 81 */ bl WriteUARTN -/* 80369224 2C 03 00 00 */ cmpwi r3, 0 -/* 80369228 41 82 00 14 */ beq lbl_8036923C -/* 8036922C 38 00 00 00 */ li r0, 0 -/* 80369230 38 60 00 01 */ li r3, 1 -/* 80369234 90 1E 00 00 */ stw r0, 0(r30) -/* 80369238 48 00 00 1C */ b lbl_80369254 -lbl_8036923C: -/* 8036923C 7F 83 E3 78 */ mr r3, r28 -/* 80369240 7F A4 EB 78 */ mr r4, r29 -/* 80369244 7F C5 F3 78 */ mr r5, r30 -/* 80369248 7F E6 FB 78 */ mr r6, r31 -/* 8036924C 48 00 8F 51 */ bl __TRK_write_console -/* 80369250 38 60 00 00 */ li r3, 0 -lbl_80369254: -/* 80369254 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80369258 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 8036925C 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80369260 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 80369264 83 81 00 10 */ lwz r28, 0x10(r1) -/* 80369268 7C 08 03 A6 */ mtlr r0 -/* 8036926C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80369270 4E 80 00 20 */ blr diff --git a/asm/init/TRK_memcpy.s b/asm/init/TRK_memcpy.s deleted file mode 100644 index 6ae882a4e7..0000000000 --- a/asm/init/TRK_memcpy.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_800035C0: -/* 800035C0 38 84 FF FF */ addi r4, r4, -1 -/* 800035C4 38 C3 FF FF */ addi r6, r3, -1 -/* 800035C8 38 A5 00 01 */ addi r5, r5, 1 -/* 800035CC 48 00 00 0C */ b lbl_800035D8 -lbl_800035D0: -/* 800035D0 8C 04 00 01 */ lbzu r0, 1(r4) -/* 800035D4 9C 06 00 01 */ stbu r0, 1(r6) -lbl_800035D8: -/* 800035D8 34 A5 FF FF */ addic. r5, r5, -1 -/* 800035DC 40 82 FF F4 */ bne lbl_800035D0 -/* 800035E0 4E 80 00 20 */ blr diff --git a/asm/init/TRK_memset.s b/asm/init/TRK_memset.s deleted file mode 100644 index c4c01f9819..0000000000 --- a/asm/init/TRK_memset.s +++ /dev/null @@ -1,13 +0,0 @@ -lbl_80003590: -/* 80003590 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80003594 7C 08 02 A6 */ mflr r0 -/* 80003598 90 01 00 14 */ stw r0, 0x14(r1) -/* 8000359C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 800035A0 7C 7F 1B 78 */ mr r31, r3 -/* 800035A4 48 36 BF DD */ bl TRK_fill_mem -/* 800035A8 80 01 00 14 */ lwz r0, 0x14(r1) -/* 800035AC 7F E3 FB 78 */ mr r3, r31 -/* 800035B0 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 800035B4 7C 08 03 A6 */ mtlr r0 -/* 800035B8 38 21 00 10 */ addi r1, r1, 0x10 -/* 800035BC 4E 80 00 20 */ blr diff --git a/asm/init/__TRK_reset.s b/asm/init/__TRK_reset.s deleted file mode 100644 index 14460e3afe..0000000000 --- a/asm/init/__TRK_reset.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_80005518: -/* 80005518 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8000551C 7C 08 02 A6 */ mflr r0 -/* 80005520 38 60 00 00 */ li r3, 0 -/* 80005524 38 80 00 00 */ li r4, 0 -/* 80005528 90 01 00 14 */ stw r0, 0x14(r1) -/* 8000552C 38 A0 00 00 */ li r5, 0 -/* 80005530 48 33 A3 7D */ bl OSResetSystem -/* 80005534 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80005538 7C 08 03 A6 */ mtlr r0 -/* 8000553C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80005540 4E 80 00 20 */ blr diff --git a/asm/init/__check_pad3.s b/asm/init/__check_pad3.s deleted file mode 100644 index 5ed11e5c2f..0000000000 --- a/asm/init/__check_pad3.s +++ /dev/null @@ -1,18 +0,0 @@ -lbl_80003100: -/* 80003100 7C 08 02 A6 */ mflr r0 -/* 80003104 3C 60 80 00 */ lis r3, 0x8000 /* 0x800030E4@ha */ -/* 80003108 90 01 00 04 */ stw r0, 4(r1) -/* 8000310C 94 21 FF F8 */ stwu r1, -8(r1) -/* 80003110 A0 03 30 E4 */ lhz r0, 0x30E4(r3) /* 0x800030E4@l */ -/* 80003114 70 00 0E EF */ andi. r0, r0, 0xeef -/* 80003118 2C 00 0E EF */ cmpwi r0, 0xeef -/* 8000311C 40 82 00 14 */ bne lbl_80003130 -/* 80003120 38 60 00 00 */ li r3, 0 -/* 80003124 38 80 00 00 */ li r4, 0 -/* 80003128 38 A0 00 00 */ li r5, 0 -/* 8000312C 48 33 C7 81 */ bl OSResetSystem -lbl_80003130: -/* 80003130 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80003134 38 21 00 08 */ addi r1, r1, 8 -/* 80003138 7C 08 03 A6 */ mtlr r0 -/* 8000313C 4E 80 00 20 */ blr diff --git a/asm/init/__fill_mem.s b/asm/init/__fill_mem.s deleted file mode 100644 index 787bbbfc89..0000000000 --- a/asm/init/__fill_mem.s +++ /dev/null @@ -1,56 +0,0 @@ -lbl_80003488: -/* 80003488 28 05 00 20 */ cmplwi r5, 0x20 -/* 8000348C 54 84 06 3E */ clrlwi r4, r4, 0x18 -/* 80003490 38 C3 FF FF */ addi r6, r3, -1 -/* 80003494 7C 87 23 78 */ mr r7, r4 -/* 80003498 41 80 00 90 */ blt lbl_80003528 -/* 8000349C 7C C0 30 F8 */ nor r0, r6, r6 -/* 800034A0 54 03 07 BF */ clrlwi. r3, r0, 0x1e -/* 800034A4 41 82 00 14 */ beq lbl_800034B8 -/* 800034A8 7C A3 28 50 */ subf r5, r3, r5 -lbl_800034AC: -/* 800034AC 34 63 FF FF */ addic. r3, r3, -1 -/* 800034B0 9C E6 00 01 */ stbu r7, 1(r6) -/* 800034B4 40 82 FF F8 */ bne lbl_800034AC -lbl_800034B8: -/* 800034B8 28 07 00 00 */ cmplwi r7, 0 -/* 800034BC 41 82 00 1C */ beq lbl_800034D8 -/* 800034C0 54 E3 C0 0E */ slwi r3, r7, 0x18 -/* 800034C4 54 E0 80 1E */ slwi r0, r7, 0x10 -/* 800034C8 54 E4 40 2E */ slwi r4, r7, 8 -/* 800034CC 7C 60 03 78 */ or r0, r3, r0 -/* 800034D0 7C 80 03 78 */ or r0, r4, r0 -/* 800034D4 7C E7 03 78 */ or r7, r7, r0 -lbl_800034D8: -/* 800034D8 54 A3 D9 7F */ rlwinm. r3, r5, 0x1b, 5, 0x1f -/* 800034DC 38 86 FF FD */ addi r4, r6, -3 -/* 800034E0 41 82 00 2C */ beq lbl_8000350C -lbl_800034E4: -/* 800034E4 90 E4 00 04 */ stw r7, 4(r4) -/* 800034E8 34 63 FF FF */ addic. r3, r3, -1 -/* 800034EC 90 E4 00 08 */ stw r7, 8(r4) -/* 800034F0 90 E4 00 0C */ stw r7, 0xc(r4) -/* 800034F4 90 E4 00 10 */ stw r7, 0x10(r4) -/* 800034F8 90 E4 00 14 */ stw r7, 0x14(r4) -/* 800034FC 90 E4 00 18 */ stw r7, 0x18(r4) -/* 80003500 90 E4 00 1C */ stw r7, 0x1c(r4) -/* 80003504 94 E4 00 20 */ stwu r7, 0x20(r4) -/* 80003508 40 82 FF DC */ bne lbl_800034E4 -lbl_8000350C: -/* 8000350C 54 A3 F7 7F */ rlwinm. r3, r5, 0x1e, 0x1d, 0x1f -/* 80003510 41 82 00 10 */ beq lbl_80003520 -lbl_80003514: -/* 80003514 34 63 FF FF */ addic. r3, r3, -1 -/* 80003518 94 E4 00 04 */ stwu r7, 4(r4) -/* 8000351C 40 82 FF F8 */ bne lbl_80003514 -lbl_80003520: -/* 80003520 38 C4 00 03 */ addi r6, r4, 3 -/* 80003524 54 A5 07 BE */ clrlwi r5, r5, 0x1e -lbl_80003528: -/* 80003528 28 05 00 00 */ cmplwi r5, 0 -/* 8000352C 4D 82 00 20 */ beqlr -lbl_80003530: -/* 80003530 34 A5 FF FF */ addic. r5, r5, -1 -/* 80003534 9C E6 00 01 */ stbu r7, 1(r6) -/* 80003538 40 82 FF F8 */ bne lbl_80003530 -/* 8000353C 4E 80 00 20 */ blr diff --git a/asm/init/__set_debug_bba.s b/asm/init/__set_debug_bba.s deleted file mode 100644 index dea699a767..0000000000 --- a/asm/init/__set_debug_bba.s +++ /dev/null @@ -1,4 +0,0 @@ -lbl_80003140: -/* 80003140 38 00 00 01 */ li r0, 1 -/* 80003144 98 0D 91 50 */ stb r0, data_804516D0(r13) -/* 80003148 4E 80 00 20 */ blr diff --git a/asm/init/memcpy.s b/asm/init/memcpy.s deleted file mode 100644 index 12dc4d6987..0000000000 --- a/asm/init/memcpy.s +++ /dev/null @@ -1,26 +0,0 @@ -lbl_80003540: -/* 80003540 7C 04 18 40 */ cmplw r4, r3 -/* 80003544 41 80 00 28 */ blt lbl_8000356C -/* 80003548 38 84 FF FF */ addi r4, r4, -1 -/* 8000354C 38 C3 FF FF */ addi r6, r3, -1 -/* 80003550 38 A5 00 01 */ addi r5, r5, 1 -/* 80003554 48 00 00 0C */ b lbl_80003560 -lbl_80003558: -/* 80003558 8C 04 00 01 */ lbzu r0, 1(r4) -/* 8000355C 9C 06 00 01 */ stbu r0, 1(r6) -lbl_80003560: -/* 80003560 34 A5 FF FF */ addic. r5, r5, -1 -/* 80003564 40 82 FF F4 */ bne lbl_80003558 -/* 80003568 4E 80 00 20 */ blr -lbl_8000356C: -/* 8000356C 7C 84 2A 14 */ add r4, r4, r5 -/* 80003570 7C C3 2A 14 */ add r6, r3, r5 -/* 80003574 38 A5 00 01 */ addi r5, r5, 1 -/* 80003578 48 00 00 0C */ b lbl_80003584 -lbl_8000357C: -/* 8000357C 8C 04 FF FF */ lbzu r0, -1(r4) -/* 80003580 9C 06 FF FF */ stbu r0, -1(r6) -lbl_80003584: -/* 80003584 34 A5 FF FF */ addic. r5, r5, -1 -/* 80003588 40 82 FF F4 */ bne lbl_8000357C -/* 8000358C 4E 80 00 20 */ blr diff --git a/asm/init/memset.s b/asm/init/memset.s deleted file mode 100644 index 1bee4e01a8..0000000000 --- a/asm/init/memset.s +++ /dev/null @@ -1,13 +0,0 @@ -lbl_80003458: -/* 80003458 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8000345C 7C 08 02 A6 */ mflr r0 -/* 80003460 90 01 00 14 */ stw r0, 0x14(r1) -/* 80003464 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80003468 7C 7F 1B 78 */ mr r31, r3 -/* 8000346C 48 00 00 1D */ bl __fill_mem -/* 80003470 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80003474 7F E3 FB 78 */ mr r3, r31 -/* 80003478 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 8000347C 7C 08 03 A6 */ mtlr r0 -/* 80003480 38 21 00 10 */ addi r1, r1, 0x10 -/* 80003484 4E 80 00 20 */ blr diff --git a/include/DynamicLink.h b/include/DynamicLink.h index a8905be76d..42c86a1e7c 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -14,7 +14,7 @@ struct DynamicModuleControlBase { /* 0x0C */ /*vtable*/ /* 802621CC */ virtual ~DynamicModuleControlBase(); - /* 800188DC */ virtual const char* getModuleName() const {return NULL;}; + /* 800188DC */ virtual const char* getModuleName() const { return NULL; }; /* 80263210 */ virtual int getModuleSize() const; /* 80263200 */ virtual const char* getModuleTypeString() const; /* 80262470 */ virtual void dump(); @@ -43,7 +43,7 @@ struct DynamicModuleControl : DynamicModuleControlBase { /* 80263218 */ virtual const char* getModuleName() const; /* 80263000 */ virtual int getModuleSize() const; /* 80263070 */ virtual const char* getModuleTypeString() const; - //virtual void dump(); + // virtual void dump(); /* 80262C0C */ virtual void dump2(); /* 802627E8 */ virtual bool do_load(); /* 80262AFC */ virtual BOOL do_load_async(); diff --git a/include/JSystem/J2DGraph/J2DMatBlock.h b/include/JSystem/J2DGraph/J2DMatBlock.h index 5b80a90f18..f2e20854d8 100644 --- a/include/JSystem/J2DGraph/J2DMatBlock.h +++ b/include/JSystem/J2DGraph/J2DMatBlock.h @@ -422,21 +422,18 @@ struct J2DBlendInfo { mType = other.mType; mSrcFactor = other.mSrcFactor; mDstFactor = other.mDstFactor; - //mOp = other.mOp; + // mOp = other.mOp; } /* 0x0 */ u8 mType; /* 0x1 */ u8 mSrcFactor; /* 0x2 */ u8 mDstFactor; - }; extern J2DBlendInfo j2dDefaultBlendInfo; struct J2DBlend { - J2DBlend() { - mBlendInfo = j2dDefaultBlendInfo; - } + J2DBlend() { mBlendInfo = j2dDefaultBlendInfo; } /* 0x0 */ J2DBlendInfo mBlendInfo; /* 0x3 */ u8 mOp; @@ -444,9 +441,7 @@ struct J2DBlend { class J2DPEBlock { public: - J2DPEBlock() { - initialize(); - } + J2DPEBlock() { initialize(); } /* 802F17FC */ void initialize(); /* 802F1840 */ void setGX(); @@ -475,10 +470,8 @@ public: class J2DIndBlockFull : public J2DIndBlock { public: - J2DIndBlockFull() { - initialize(); - } - + J2DIndBlockFull() { initialize(); } + /* 802F1664 */ virtual void initialize(); /* 802F1730 */ virtual void setGX(); /* 802F1B94 */ virtual void getType(); @@ -515,9 +508,7 @@ private: /* 0x24 */ J2DTexMtx* mTexMtx[8]; public: - J2DTexGenBlock() { - initialize(); - } + J2DTexGenBlock() { initialize(); } /* 802EB510 */ void initialize(); /* 802EB570 */ void setGX(); @@ -547,9 +538,7 @@ private: /* 0x12 */ u8 mCullMode; public: - J2DColorBlock() { - initialize(); - } + J2DColorBlock() { initialize(); } /* 802EB394 */ void initialize(); /* 802EB424 */ void setGX(); diff --git a/include/JSystem/J2DGraph/J2DMaterial.h b/include/JSystem/J2DGraph/J2DMaterial.h index fbf30353d0..ebea34bec8 100644 --- a/include/JSystem/J2DGraph/J2DMaterial.h +++ b/include/JSystem/J2DGraph/J2DMaterial.h @@ -42,7 +42,6 @@ public: J2DTevBlock* getTevBlock() { return mTevBlock; } J2DIndBlock* getIndBlock() { return mIndBlock; } - private: /* 0x04 */ int field_0x4; /* 0x08 */ int field_0x8; diff --git a/include/JSystem/J2DGraph/J2DScreen.h b/include/JSystem/J2DGraph/J2DScreen.h index 3ba1f4499c..a878d07f57 100644 --- a/include/JSystem/J2DGraph/J2DScreen.h +++ b/include/JSystem/J2DGraph/J2DScreen.h @@ -50,9 +50,9 @@ public: /* 802F9A74 */ virtual void setAnimationVF(J2DAnmVisibilityFull*); /* 802F9A78 */ virtual void setAnimationVC(J2DAnmVtxColor*); /* 802F99E8 */ virtual J2DPane* createPane(J2DScrnBlockHeader const&, JSURandomInputStream*, - J2DPane*, u32); + J2DPane*, u32); /* 802F8B98 */ virtual J2DPane* createPane(J2DScrnBlockHeader const&, JSURandomInputStream*, - J2DPane*, u32, JKRArchive*); + J2DPane*, u32, JKRArchive*); /* 802F8498 */ J2DScreen(); /* 802F85A8 */ void clean(); diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index edd694ea7e..47a8c1bc25 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -219,7 +219,7 @@ inline JKRCompression JKRConvertAttrToCompressionType(u32 attr) { } inline void* JKRGetResource(u32 node, const char* path, JKRArchive* archive) { - return JKRArchive::getGlbResource(node,path,archive); + return JKRArchive::getGlbResource(node, path, archive); } inline void* JKRGetTypeResource(u32 tag, const char* name, JKRArchive* arc) { diff --git a/include/JSystem/JKernel/JKRFileLoader.h b/include/JSystem/JKernel/JKRFileLoader.h index 42752bc241..b0e3250c03 100644 --- a/include/JSystem/JKernel/JKRFileLoader.h +++ b/include/JSystem/JKernel/JKRFileLoader.h @@ -55,7 +55,7 @@ public: }; inline bool JKRDetachResource(void* resource, JKRFileLoader* fileLoader) { - return JKRFileLoader::detachResource(resource,fileLoader); + return JKRFileLoader::detachResource(resource, fileLoader); } inline void* JKRGetNameResource(const char* name, JKRFileLoader* loader) { diff --git a/include/JSystem/JSupport/JSUMemoryStream.h b/include/JSystem/JSupport/JSUMemoryStream.h index ca69f91472..aa8c84480f 100644 --- a/include/JSystem/JSupport/JSUMemoryStream.h +++ b/include/JSystem/JSupport/JSUMemoryStream.h @@ -6,9 +6,7 @@ class JSUMemoryInputStream : JSURandomInputStream { public: - JSUMemoryInputStream(const void* res, u32 size) { - setBuffer(res, size); - } + JSUMemoryInputStream(const void* res, u32 size) { setBuffer(res, size); } /* 802552B8 */ ~JSUMemoryInputStream() {} /* 802DC520 */ void setBuffer(void const*, s32); diff --git a/include/MSL_C/MSL_Common/Src/ansi_files.h b/include/MSL_C/MSL_Common/Src/ansi_files.h index 684a827853..b16eccd5ef 100644 --- a/include/MSL_C/MSL_Common/Src/ansi_files.h +++ b/include/MSL_C/MSL_Common/Src/ansi_files.h @@ -1,39 +1,66 @@ #ifndef MSL_COMMON_SRC_ANSI_FILES_H #define MSL_COMMON_SRC_ANSI_FILES_H -#include "dolphin/types.h" +enum __file_kinds { + /* 0x0 */ CLOSED_FILE, + /* 0x1 */ DISK_FILE, + /* 0x2 */ CONSOLE_FILE, + /* 0x3 */ UNAVAILABLE_FILE, +}; -struct FILE { - /* 0x00 */ u32 handle; - /* 0x04 */ u32 file_mode; - /* 0x08 */ u32 file_state; - /* 0x0C */ u8 flag; +enum __file_orientation { + /* 0x0 */ UNORIENTED, + /* 0x1 */ CHAR_ORIENTED, + /* 0x2 */ WIDE_ORIENTED, +}; + +typedef struct _file_modes { + unsigned int open_mode : 2; + unsigned int io_mode : 3; + unsigned int buffer_mode : 2; + unsigned int file_kind : 3; + unsigned int file_orientation : 2; + unsigned int binary_io : 1; +} file_modes; + +typedef struct _file_states { + unsigned int io_state : 3; + unsigned int free_buffer : 1; + unsigned char eof; + unsigned char error; +} file_states; + +typedef struct _FILE { + /* 0x00 */ unsigned int handle; + /* 0x04 */ file_modes file_mode; + /* 0x08 */ file_states file_state; + /* 0x0C */ unsigned char flag; /* 0x0D */ char char_buffer; /* 0x0E */ char char_buffer_2; /* 0x0F */ char ungetc_buffer[2]; - /* 0x12 */ u16 ungetc_wide_buffer[2]; - /* 0x18 */ u32 position; - /* 0x1C */ u8* buffer; - /* 0x20 */ u32 buffer_size; - /* 0x24 */ u8* buffer_ptr; - /* 0x28 */ u32 buffer_length; - /* 0x2C */ u32 buffer_alignment; - /* 0x30 */ u32 buffer_length2; - /* 0x34 */ u32 buffer_position; + /* 0x12 */ unsigned short ungetc_wide_buffer[2]; + /* 0x18 */ unsigned int position; + /* 0x1C */ unsigned char* buffer; + /* 0x20 */ unsigned int buffer_size; + /* 0x24 */ unsigned char* buffer_ptr; + /* 0x28 */ unsigned int buffer_length; + /* 0x2C */ unsigned int buffer_alignment; + /* 0x30 */ unsigned int buffer_length2; + /* 0x34 */ unsigned int buffer_position; /* 0x38 */ void* position_fn; /* 0x3C */ void* read_fn; /* 0x40 */ void* write_fn; /* 0x44 */ void* close_fn; /* 0x48 */ void* unknown; - /* 0x4C */ struct FILE* next_file; -}; + /* 0x4C */ struct _FILE* next_file; +} FILE; -struct files { +typedef struct _files { FILE stdin; FILE stdout; FILE stderr; FILE empty; -}; +} files; extern files __files; diff --git a/include/MSL_C/MSL_Common/Src/char_io.h b/include/MSL_C/MSL_Common/Src/char_io.h index 7363bc22cd..4a6e04cce9 100644 --- a/include/MSL_C/MSL_Common/Src/char_io.h +++ b/include/MSL_C/MSL_Common/Src/char_io.h @@ -4,6 +4,14 @@ #include "MSL_C/MSL_Common/Src/ansi_files.h" #include "dolphin/types.h" -extern "C" int fputs(const char*, FILE*); +#ifdef __cplusplus +extern "C" { +#endif + +int fputs(const char*, FILE*); + +#ifdef __cplusplus +} +#endif #endif /* MSL_COMMON_SRC_CHAR_IO_H */ diff --git a/include/MSL_C/MSL_Common/Src/ctype.h b/include/MSL_C/MSL_Common/Src/ctype.h index f59c75d820..100460e708 100644 --- a/include/MSL_C/MSL_Common/Src/ctype.h +++ b/include/MSL_C/MSL_Common/Src/ctype.h @@ -3,8 +3,14 @@ #include "dolphin/types.h" +#ifdef __cplusplus extern "C" { +#endif + int tolower(int); -}; + +#ifdef __cplusplus +} +#endif #endif /* MSL_COMMON_SRC_CTYPE_H */ diff --git a/include/MSL_C/MSL_Common/Src/float.h b/include/MSL_C/MSL_Common/Src/float.h index 9a39ae5743..a41c15e2f3 100644 --- a/include/MSL_C/MSL_Common/Src/float.h +++ b/include/MSL_C/MSL_Common/Src/float.h @@ -14,6 +14,7 @@ #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) : __fpclassifyd(x)) #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x)) +#define isfinite(x) ((fpclassify(x) > 2)) #define __signbitf(x) ((*(u8*)&(x)) & 0x80) diff --git a/include/MSL_C/MSL_Common/Src/mem.h b/include/MSL_C/MSL_Common/Src/mem.h index e47536e0b7..73edb308ee 100644 --- a/include/MSL_C/MSL_Common/Src/mem.h +++ b/include/MSL_C/MSL_Common/Src/mem.h @@ -3,6 +3,14 @@ #include "dolphin/types.h" -extern "C" int memcmp(const void*, const void*, size_t); +#ifdef __cplusplus +extern "C" { +#endif + +int memcmp(const void*, const void*, size_t); + +#ifdef __cplusplus +} +#endif #endif /* MSL_COMMON_SRC_MEM_H */ diff --git a/include/MSL_C/MSL_Common/Src/printf.h b/include/MSL_C/MSL_Common/Src/printf.h index 206517c803..e8cfdf2814 100644 --- a/include/MSL_C/MSL_Common/Src/printf.h +++ b/include/MSL_C/MSL_Common/Src/printf.h @@ -4,10 +4,18 @@ #include "Runtime.PPCEABI.H/__va_arg.h" #include "dolphin/types.h" -extern "C" size_t sprintf(const char*, const char*, ...); -extern "C" size_t snprintf(const char*, size_t, const char*, ...); -extern "C" size_t vsnprintf(char*, size_t, const char*, va_list); -extern "C" size_t vprintf(const char*, va_list); -extern "C" size_t printf(const char*, ...); +#ifdef __cplusplus +extern "C" { +#endif + +size_t sprintf(const char*, const char*, ...); +size_t snprintf(const char*, size_t, const char*, ...); +size_t vsnprintf(char*, size_t, const char*, va_list); +size_t vprintf(const char*, va_list); +size_t printf(const char*, ...); + +#ifdef __cplusplus +} +#endif #endif /* MSL_COMMON_SRC_PRINTF_H */ diff --git a/include/MSL_C/MSL_Common/Src/string.h b/include/MSL_C/MSL_Common/Src/string.h index 38c7f3e7ea..c70f319597 100644 --- a/include/MSL_C/MSL_Common/Src/string.h +++ b/include/MSL_C/MSL_Common/Src/string.h @@ -3,8 +3,11 @@ #include "dolphin/types.h" +#ifdef __cplusplus extern "C" { -void* memcpy(void*, const void*, s32); +#endif + +void* memcpy(void*, const void*, size_t); void* memset(void*, int, u32); char* strrchr(const char*, int); char* strchr(const char*, int); @@ -16,6 +19,9 @@ char* strcpy(char*, const char*); u32 strlen(const char*); int stricmp(const char*, const char*); -}; + +#ifdef __cplusplus +} +#endif #endif /* MSL_COMMON_SRC_STRING_H */ diff --git a/include/MSL_C/math.h b/include/MSL_C/math.h index 0de55c166d..478829c1f5 100644 --- a/include/MSL_C/math.h +++ b/include/MSL_C/math.h @@ -4,57 +4,60 @@ #include "MSL_C/MSL_Common/Src/float.h" #include "dolphin/types.h" +#ifdef __cplusplus extern "C" { -s32 abs(s32); -f64 acos(f64); -f32 acosf(f32); -f64 asin(f64); -f64 atan(f64); -f64 atan2(f64); -f64 ceil(f64); -f64 copysign(f64, f64); -f64 cos(f64); -f32 cosf(f32); -f64 exp(f64); +#endif -extern f32 __fabsf(f32); -inline f64 fabs(f64 f) { +int abs(int); +double acos(double); +float acosf(float); +double asin(double); +double atan(double); +double atan2(double, double); +double ceil(double); +double copysign(double, double); +double cos(double); +float cosf(float); +double exp(double); + +extern float __fabsf(float); +inline double fabs(double f) { return __fabsf(f); } -inline f64 fabsf2(f32 f) { +inline double fabsf2(float f) { return __fabsf(f); } -inline f32 fabsf(f32 f) { +inline float fabsf(float f) { return fabsf2(f); } -f64 floor(f64); -f64 fmod(f64, f64); -inline f32 fmodf(f32 f1, f32 f2) { +double floor(double); +double fmod(double, double); +inline float fmodf(float f1, float f2) { return fmod(f1, f2); } -f64 frexp(f64, s32*); -f64 ldexp(f64, s32); -f64 modf(f64, f64*); -f64 pow(f64, f64); -f64 sin(f64); -f32 sinf(f32); -f64 sqrt(f64); -f64 tan(f64); -f32 tanf(f32); +double frexp(double, int*); +double ldexp(double, int); +double modf(double, double*); +double pow(double, double); +double sin(double); +float sinf(float); +double sqrt(double); +double tan(double); +float tanf(float); -extern f32 __float_nan[4]; -extern f32 __float_epsilon[4]; -extern f32 __float_max[4]; +extern float __float_nan[4]; +extern float __float_epsilon[4]; +extern float __float_max[4]; -inline f64 sqrt_step(f64 tmpd, f32 mag) { +inline double sqrt_step(double tmpd, float mag) { return tmpd * 0.5 * (3.0 - mag * (tmpd * tmpd)); } -inline f32 sqrtf(f32 mag) { +inline float sqrtf(float mag) { if (mag > 0.0f) { - f64 tmpd = __frsqrte(mag); + double tmpd = __frsqrte(mag); tmpd = sqrt_step(tmpd, mag); tmpd = sqrt_step(tmpd, mag); tmpd = sqrt_step(tmpd, mag); @@ -67,6 +70,9 @@ inline f32 sqrtf(f32 mag) { return mag; } } -} + +#ifdef __cplusplus +}; +#endif #endif diff --git a/include/Runtime.PPCEABI.H/__va_arg.h b/include/Runtime.PPCEABI.H/__va_arg.h index 2091ed6fb8..f4ff105d98 100644 --- a/include/Runtime.PPCEABI.H/__va_arg.h +++ b/include/Runtime.PPCEABI.H/__va_arg.h @@ -3,15 +3,21 @@ #include "dolphin/types.h" -// not sure what the members are. -// OK when the struct is 12 bytes. typedef struct __va_list_struct { - u8 data[12]; -}; + char gpr; + char fpr; + char reserved[2]; + char* input_arg_area; + char* reg_save_area; +} _va_list_struct; -typedef __va_list_struct __va_list[1]; +typedef _va_list_struct __va_list[1]; +#ifdef __cplusplus extern "C" void __va_arg(void*, int); +#else +void __va_arg(void*, int); +#endif #if IN_VSCODE_EDITOR #define __builtin_va_info(...) diff --git a/include/dol2asm.h b/include/dol2asm.h index 928a022448..039cf0054c 100644 --- a/include/dol2asm.h +++ b/include/dol2asm.h @@ -3,6 +3,8 @@ // this helps remove useless error from the linter when using vscode. #ifndef IN_VSCODE_EDITOR + +#ifdef __cplusplus #define SECTION_INIT extern "C" __declspec(section ".init") #define SECTION_RODATA __declspec(section ".rodata") #define SECTION_DATA __declspec(section ".data") @@ -23,6 +25,29 @@ #define COMPILER_STRIP_GATE(NAME, VALUE) SECTION_DEAD void* const cg_##NAME = (void*)(VALUE) #define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT))) #define REGISTER_CTORS(ADDR, FUNCTION) SECTION_CTORS void* const _ctors_##ADDR = (void*)(FUNCTION); +#else +#define SECTION_INIT __declspec(section ".init") +#define SECTION_RODATA __declspec(section ".rodata") +#define SECTION_DATA __declspec(section ".data") +#define SECTION_SDATA __declspec(section ".sdata") +#define SECTION_SDATA2 __declspec(section ".sdata2") +#define SECTION_BSS __declspec(section ".data") +#define SECTION_SBSS __declspec(section ".sdata") +#define SECTION_SBSS2 __declspec(section ".sdata2") +#define SECTION_CTORS __declspec(section ".ctors") +#define SECTION_DTORS __declspec(section ".dtors") +#define SECTION_EXTAB __declspec(section "extab_") +#define SECTION_EXTABINDEX __declspec(section "extabindex_") +#define SECTION_DEAD __declspec(section ".dead") +#define SECTION_CTORS10 __declspec(section ".ctors$10") +#define SECTION_CTORS15 __declspec(section ".ctors$15") +#define SECTION_DTORS10 __declspec(section ".dtors$10") +#define SECTION_DTORS15 __declspec(section ".dtors$15") +#define COMPILER_STRIP_GATE(NAME, VALUE) SECTION_DEAD void* const cg_##NAME = (void*)(VALUE) +#define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT))) +#define REGISTER_CTORS(ADDR, FUNCTION) SECTION_CTORS void* const _ctors_##ADDR = (void*)(FUNCTION); +#endif + #else #define SECTION_INIT #define SECTION_RODATA diff --git a/include/MSL_C/MSL_Common/Src/errno.h b/include/errno.h similarity index 78% rename from include/MSL_C/MSL_Common/Src/errno.h rename to include/errno.h index 4e3eb9a430..c7569bf20d 100644 --- a/include/MSL_C/MSL_Common/Src/errno.h +++ b/include/errno.h @@ -1,6 +1,6 @@ #ifndef MSL_COMMON_SRC_ERRNO_H #define MSL_COMMON_SRC_ERRNO_H -#include "dolphin/types.h" +extern int errno; #endif /* MSL_COMMON_SRC_ERRNO_H */ diff --git a/include/fdlibm.h b/include/fdlibm.h new file mode 100644 index 0000000000..9ad06deb19 --- /dev/null +++ b/include/fdlibm.h @@ -0,0 +1,228 @@ +#ifndef FDLIBM_H +#define FDLIBM_H + +/* @(#)fdlibm.h 1.5 04/04/22 */ +/* + * ==================================================== + * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly + but these catch some common cases. */ + +#if defined(i386) || defined(i486) || defined(intel) || defined(x86) || defined(i86pc) || \ + defined(__alpha) || defined(__osf__) +#define __LITTLE_ENDIAN +#endif + +#ifdef __LITTLE_ENDIAN +#define __HI(x) *(1 + (int*)&x) +#define __LO(x) *(int*)&x +#define __HIp(x) *(1 + (int*)x) +#define __LOp(x) *(int*)x +#else +#define __HI(x) *(int*)&x +#define __LO(x) *(1 + (int*)&x) +#define __HIp(x) *(int*)x +#define __LOp(x) *(1 + (int*)x) +#endif + +// TODO: should __STDC__ actually be defined? +//#ifdef __STDC__ +#define __P(p) p +//#else +//#define __P(p) () +//#endif + +/* + * ANSI/POSIX + */ + +extern int signgam; + +#define MAXFLOAT ((float)3.40282346638528860e+38) + +enum fdversion { fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix }; + +#define _LIB_VERSION_TYPE enum fdversion +#define _LIB_VERSION _fdlib_version + +/* if global variable _LIB_VERSION is not desirable, one may + * change the following to be a constant by: + * #define _LIB_VERSION_TYPE const enum version + * In that case, after one initializes the value _LIB_VERSION (see + * s_lib_version.c) during compile time, it cannot be modified + * in the middle of a program + */ +extern _LIB_VERSION_TYPE _LIB_VERSION; + +#define _IEEE_ fdlibm_ieee +#define _SVID_ fdlibm_svid +#define _XOPEN_ fdlibm_xopen +#define _POSIX_ fdlibm_posix + +struct exception { + int type; + char* name; + double arg1; + double arg2; + double retval; +}; + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in + * (one may replace the following line by "#include ") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +/* + * ANSI/POSIX + */ +extern double acos __P((double)); +extern double asin __P((double)); +extern double atan __P((double)); +extern double atan2 __P((double, double)); +extern double cos __P((double)); +extern double sin __P((double)); +extern double tan __P((double)); + +extern double cosh __P((double)); +extern double sinh __P((double)); +extern double tanh __P((double)); + +extern double exp __P((double)); +extern double frexp __P((double, int*)); +extern double ldexp __P((double, int)); +extern double log __P((double)); +extern double log10 __P((double)); +extern double modf __P((double, double*)); + +extern double pow __P((double, double)); +extern double sqrt __P((double)); + +extern double ceil __P((double)); +extern double fabs __P((double)); +extern double floor __P((double)); +extern double fmod __P((double, double)); + +extern double erf __P((double)); +extern double erfc __P((double)); +extern double gamma __P((double)); +extern double hypot __P((double, double)); +extern int isnan __P((double)); +extern int finite __P((double)); +extern double j0 __P((double)); +extern double j1 __P((double)); +extern double jn __P((int, double)); +extern double lgamma __P((double)); +extern double y0 __P((double)); +extern double y1 __P((double)); +extern double yn __P((int, double)); + +extern double acosh __P((double)); +extern double asinh __P((double)); +extern double atanh __P((double)); +extern double cbrt __P((double)); +extern double logb __P((double)); +extern double nextafter __P((double, double)); +extern double remainder __P((double, double)); +#ifdef _SCALB_INT +extern double scalb __P((double, int)); +#else +extern double scalb __P((double, double)); +#endif + +extern int matherr __P((struct exception*)); + +/* + * IEEE Test Vector + */ +extern double significand __P((double)); + +/* + * Functions callable from C, intended to support IEEE arithmetic. + */ +extern double copysign __P((double, double)); +extern int ilogb __P((double)); +extern double rint __P((double)); +extern double scalbn __P((double, int)); + +/* + * BSD math library entry points + */ +extern double expm1 __P((double)); +extern double log1p __P((double)); + +/* + * Reentrant version of gamma & lgamma; passes signgam back by reference + * as the second argument; user must allocate space for signgam. + */ +#ifdef _REENTRANT +extern double gamma_r __P((double, int*)); +extern double lgamma_r __P((double, int*)); +#endif /* _REENTRANT */ + +/* ieee style elementary functions */ +extern double __ieee754_sqrt __P((double)); +extern double __ieee754_acos __P((double)); +extern double __ieee754_acosh __P((double)); +extern double __ieee754_log __P((double)); +extern double __ieee754_atanh __P((double)); +extern double __ieee754_asin __P((double)); +extern double __ieee754_atan2 __P((double, double)); +extern double __ieee754_exp __P((double)); +extern double __ieee754_cosh __P((double)); +extern double __ieee754_fmod __P((double, double)); +extern double __ieee754_pow __P((double, double)); +extern double __ieee754_lgamma_r __P((double, int*)); +extern double __ieee754_gamma_r __P((double, int*)); +extern double __ieee754_lgamma __P((double)); +extern double __ieee754_gamma __P((double)); +extern double __ieee754_log10 __P((double)); +extern double __ieee754_sinh __P((double)); +extern double __ieee754_hypot __P((double, double)); +extern double __ieee754_j0 __P((double)); +extern double __ieee754_j1 __P((double)); +extern double __ieee754_y0 __P((double)); +extern double __ieee754_y1 __P((double)); +extern double __ieee754_jn __P((int, double)); +extern double __ieee754_yn __P((int, double)); +extern double __ieee754_remainder __P((double, double)); +extern int __ieee754_rem_pio2 __P((double, double*)); +#ifdef _SCALB_INT +extern double __ieee754_scalb __P((double, int)); +#else +extern double __ieee754_scalb __P((double, double)); +#endif + +/* fdlibm kernel function */ +extern double __kernel_standard __P((double, double, int)); +extern double __kernel_sin __P((double, double, int)); +extern double __kernel_cos __P((double, double)); +extern double __kernel_tan __P((double, double, int)); +extern int __kernel_rem_pio2 __P((double*, double*, int, int, int, const int*)); + +#ifdef __cplusplus +}; +#endif + +#endif /* FDLIBM_H */ \ No newline at end of file diff --git a/libs/JSystem/J2DGraph/J2DScreen.cpp b/libs/JSystem/J2DGraph/J2DScreen.cpp index d34ece206f..722443fe81 100644 --- a/libs/JSystem/J2DGraph/J2DScreen.cpp +++ b/libs/JSystem/J2DGraph/J2DScreen.cpp @@ -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); } diff --git a/libs/MSL_C/MSL_Common/Src/FILE_POS.cpp b/libs/MSL_C/MSL_Common/Src/FILE_POS.c similarity index 80% rename from libs/MSL_C/MSL_Common/Src/FILE_POS.cpp rename to libs/MSL_C/MSL_Common/Src/FILE_POS.c index 76dd37390f..dad60257d7 100644 --- a/libs/MSL_C/MSL_Common/Src/FILE_POS.cpp +++ b/libs/MSL_C/MSL_Common/Src/FILE_POS.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/abort_exit.cpp b/libs/MSL_C/MSL_Common/Src/abort_exit.c similarity index 84% rename from libs/MSL_C/MSL_Common/Src/abort_exit.cpp rename to libs/MSL_C/MSL_Common/Src/abort_exit.c index c7014cb234..4dc61f92d3 100644 --- a/libs/MSL_C/MSL_Common/Src/abort_exit.cpp +++ b/libs/MSL_C/MSL_Common/Src/abort_exit.c @@ -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]; diff --git a/libs/MSL_C/MSL_Common/Src/alloc.cpp b/libs/MSL_C/MSL_Common/Src/alloc.c similarity index 86% rename from libs/MSL_C/MSL_Common/Src/alloc.cpp rename to libs/MSL_C/MSL_Common/Src/alloc.c index de11b1b541..41c4f7ca57 100644 --- a/libs/MSL_C/MSL_Common/Src/alloc.cpp +++ b/libs/MSL_C/MSL_Common/Src/alloc.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/ansi_files.c b/libs/MSL_C/MSL_Common/Src/ansi_files.c new file mode 100644 index 0000000000..39b0e2c306 --- /dev/null +++ b/libs/MSL_C/MSL_Common/Src/ansi_files.c @@ -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); +} diff --git a/libs/MSL_C/MSL_Common/Src/ansi_files.cpp b/libs/MSL_C/MSL_Common/Src/ansi_files.cpp deleted file mode 100644 index 7aa06d6f38..0000000000 --- a/libs/MSL_C/MSL_Common/Src/ansi_files.cpp +++ /dev/null @@ -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 diff --git a/libs/MSL_C/MSL_Common/Src/arith.cpp b/libs/MSL_C/MSL_Common/Src/arith.c similarity index 94% rename from libs/MSL_C/MSL_Common/Src/arith.cpp rename to libs/MSL_C/MSL_Common/Src/arith.c index 41273b24e8..f3833afe37 100644 --- a/libs/MSL_C/MSL_Common/Src/arith.cpp +++ b/libs/MSL_C/MSL_Common/Src/arith.c @@ -11,8 +11,8 @@ // Forward References: // -extern "C" void div(); -extern "C" void abs(); +void div(); +void abs(); // // External References: diff --git a/libs/MSL_C/MSL_Common/Src/buffer_io.cpp b/libs/MSL_C/MSL_Common/Src/buffer_io.c similarity index 92% rename from libs/MSL_C/MSL_Common/Src/buffer_io.cpp rename to libs/MSL_C/MSL_Common/Src/buffer_io.c index a74b79c538..fde0e98e1f 100644 --- a/libs/MSL_C/MSL_Common/Src/buffer_io.cpp +++ b/libs/MSL_C/MSL_Common/Src/buffer_io.c @@ -11,8 +11,8 @@ // Forward References: // -extern "C" void __flush_buffer(); -extern "C" void __prep_buffer(); +void __flush_buffer(); +void __prep_buffer(); // // External References: diff --git a/libs/MSL_C/MSL_Common/Src/char_io.cpp b/libs/MSL_C/MSL_Common/Src/char_io.c similarity index 74% rename from libs/MSL_C/MSL_Common/Src/char_io.cpp rename to libs/MSL_C/MSL_Common/Src/char_io.c index 31308c70c2..5fd56198bb 100644 --- a/libs/MSL_C/MSL_Common/Src/char_io.cpp +++ b/libs/MSL_C/MSL_Common/Src/char_io.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/ctype.cpp b/libs/MSL_C/MSL_Common/Src/ctype.c similarity index 93% rename from libs/MSL_C/MSL_Common/Src/ctype.cpp rename to libs/MSL_C/MSL_Common/Src/ctype.c index 1fcc9b0527..beb4563240 100644 --- a/libs/MSL_C/MSL_Common/Src/ctype.cpp +++ b/libs/MSL_C/MSL_Common/Src/ctype.c @@ -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, diff --git a/libs/MSL_C/MSL_Common/Src/direct_io.cpp b/libs/MSL_C/MSL_Common/Src/direct_io.c similarity index 71% rename from libs/MSL_C/MSL_Common/Src/direct_io.cpp rename to libs/MSL_C/MSL_Common/Src/direct_io.c index ab240bccef..47b4141973 100644 --- a/libs/MSL_C/MSL_Common/Src/direct_io.cpp +++ b/libs/MSL_C/MSL_Common/Src/direct_io.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/errno.c b/libs/MSL_C/MSL_Common/Src/errno.c new file mode 100644 index 0000000000..dca8350e9d --- /dev/null +++ b/libs/MSL_C/MSL_Common/Src/errno.c @@ -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; diff --git a/libs/MSL_C/MSL_Common/Src/errno.cpp b/libs/MSL_C/MSL_Common/Src/errno.cpp deleted file mode 100644 index f96ecd6337..0000000000 --- a/libs/MSL_C/MSL_Common/Src/errno.cpp +++ /dev/null @@ -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 */]; diff --git a/libs/MSL_C/MSL_Common/Src/extras.cpp b/libs/MSL_C/MSL_Common/Src/extras.c similarity index 85% rename from libs/MSL_C/MSL_Common/Src/extras.cpp rename to libs/MSL_C/MSL_Common/Src/extras.c index 3d21071532..4fc1b12b31 100644 --- a/libs/MSL_C/MSL_Common/Src/extras.cpp +++ b/libs/MSL_C/MSL_Common/Src/extras.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/file_io.cpp b/libs/MSL_C/MSL_Common/Src/file_io.c similarity index 80% rename from libs/MSL_C/MSL_Common/Src/file_io.cpp rename to libs/MSL_C/MSL_Common/Src/file_io.c index 1f78637fa6..332ee0b5a2 100644 --- a/libs/MSL_C/MSL_Common/Src/file_io.cpp +++ b/libs/MSL_C/MSL_Common/Src/file_io.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/float.cpp b/libs/MSL_C/MSL_Common/Src/float.c similarity index 85% rename from libs/MSL_C/MSL_Common/Src/float.cpp rename to libs/MSL_C/MSL_Common/Src/float.c index ec43cf90b4..ac0853bb14 100644 --- a/libs/MSL_C/MSL_Common/Src/float.cpp +++ b/libs/MSL_C/MSL_Common/Src/float.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/mbstring.cpp b/libs/MSL_C/MSL_Common/Src/mbstring.c similarity index 93% rename from libs/MSL_C/MSL_Common/Src/mbstring.cpp rename to libs/MSL_C/MSL_Common/Src/mbstring.c index 9599770fa8..cd9b3e72f6 100644 --- a/libs/MSL_C/MSL_Common/Src/mbstring.cpp +++ b/libs/MSL_C/MSL_Common/Src/mbstring.c @@ -11,13 +11,13 @@ // Forward References: // -extern "C" void wcstombs(); +void wcstombs(); // // External References: // -extern "C" void strncpy(); +void strncpy(); // // Declarations: diff --git a/libs/MSL_C/MSL_Common/Src/mem.c b/libs/MSL_C/MSL_Common/Src/mem.c new file mode 100644 index 0000000000..bdf297797a --- /dev/null +++ b/libs/MSL_C/MSL_Common/Src/mem.c @@ -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; +} diff --git a/libs/MSL_C/MSL_Common/Src/mem.cpp b/libs/MSL_C/MSL_Common/Src/mem.cpp deleted file mode 100644 index 0037ddf0f8..0000000000 --- a/libs/MSL_C/MSL_Common/Src/mem.cpp +++ /dev/null @@ -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 diff --git a/libs/MSL_C/MSL_Common/Src/mem_funcs.cpp b/libs/MSL_C/MSL_Common/Src/mem_funcs.c similarity index 89% rename from libs/MSL_C/MSL_Common/Src/mem_funcs.cpp rename to libs/MSL_C/MSL_Common/Src/mem_funcs.c index 8da43ba803..0c3966539f 100644 --- a/libs/MSL_C/MSL_Common/Src/mem_funcs.cpp +++ b/libs/MSL_C/MSL_Common/Src/mem_funcs.c @@ -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: diff --git a/libs/MSL_C/MSL_Common/Src/misc_io.cpp b/libs/MSL_C/MSL_Common/Src/misc_io.c similarity index 54% rename from libs/MSL_C/MSL_Common/Src/misc_io.cpp rename to libs/MSL_C/MSL_Common/Src/misc_io.c index 851de5b75d..9dd9827d9b 100644 --- a/libs/MSL_C/MSL_Common/Src/misc_io.cpp +++ b/libs/MSL_C/MSL_Common/Src/misc_io.c @@ -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 diff --git a/libs/MSL_C/MSL_Common/Src/printf.cpp b/libs/MSL_C/MSL_Common/Src/printf.c similarity index 93% rename from libs/MSL_C/MSL_Common/Src/printf.cpp rename to libs/MSL_C/MSL_Common/Src/printf.c index 81abda1770..fa801a005a 100644 --- a/libs/MSL_C/MSL_Common/Src/printf.cpp +++ b/libs/MSL_C/MSL_Common/Src/printf.c @@ -12,37 +12,37 @@ // Forward References: // -extern "C" void fprintf(); -extern "C" void __StringWrite(); -extern "C" void __FileWrite(); -extern "C" void __pformatter(); -extern "C" static void float2str(); -extern "C" static void round_decimal(); -extern "C" static void double2hex(); -extern "C" static void longlong2str(); -extern "C" static void long2str(); -extern "C" static void parse_format(); -extern "C" extern char const* const MSL_Common_Src_printf__stringBase0; +void fprintf(); +void __StringWrite(); +void __FileWrite(); +void __pformatter(); +static void float2str(); +static void round_decimal(); +static void double2hex(); +static void longlong2str(); +static void long2str(); +static void parse_format(); +extern char const* const MSL_Common_Src_printf__stringBase0; // // External References: // SECTION_INIT void memcpy(); -extern "C" void __div2u(); -extern "C" void __mod2u(); -extern "C" void __num2dec(); -extern "C" void __end_critical_region(); -extern "C" void __begin_critical_region(); -extern "C" void fwrite(); -extern "C" void wcstombs(); -extern "C" void memchr(); -extern "C" void strchr(); -extern "C" void strcpy(); -extern "C" void strlen(); -extern "C" void fwide(); -extern "C" extern void* __files[80]; -extern "C" extern u8 __ctype_map[256]; +void __div2u(); +void __mod2u(); +void __num2dec(); +void __end_critical_region(); +void __begin_critical_region(); +void fwrite(); +void wcstombs(); +void memchr(); +void strchr(); +void strcpy(); +void strlen(); +void fwide(); +extern void* __files[80]; +extern u8 __ctype_map[256]; // // Declarations: diff --git a/libs/MSL_C/MSL_Common/Src/scanf.cpp b/libs/MSL_C/MSL_Common/Src/scanf.c similarity index 94% rename from libs/MSL_C/MSL_Common/Src/scanf.cpp rename to libs/MSL_C/MSL_Common/Src/scanf.c index 346ecbd077..f3f3fe048f 100644 --- a/libs/MSL_C/MSL_Common/Src/scanf.cpp +++ b/libs/MSL_C/MSL_Common/Src/scanf.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void __StringRead(); +void __StringRead(); // // External References: diff --git a/libs/MSL_C/MSL_Common/Src/signal.cpp b/libs/MSL_C/MSL_Common/Src/signal.c similarity index 84% rename from libs/MSL_C/MSL_Common/Src/signal.cpp rename to libs/MSL_C/MSL_Common/Src/signal.c index 73ac1de6fa..676d4a5373 100644 --- a/libs/MSL_C/MSL_Common/Src/signal.cpp +++ b/libs/MSL_C/MSL_Common/Src/signal.c @@ -11,15 +11,15 @@ // Forward References: // -extern "C" void raise(); +void raise(); // // External References: // -extern "C" void exit(); -extern "C" void __end_critical_region(); -extern "C" void __begin_critical_region(); +void exit(); +void __end_critical_region(); +void __begin_critical_region(); // // Declarations: diff --git a/libs/MSL_C/MSL_Common/Src/string.c b/libs/MSL_C/MSL_Common/Src/string.c new file mode 100644 index 0000000000..df42867b38 --- /dev/null +++ b/libs/MSL_C/MSL_Common/Src/string.c @@ -0,0 +1,257 @@ +// +// Generated By: dol2asm +// Translation Unit: MSL_Common/Src/string +// + +#include "MSL_C/MSL_Common/Src/string.h" +#include "dol2asm.h" +#include "dolphin/types.h" + +#define K1 0x80808080 +#define K2 0xFEFEFEFF + +// +// Declarations: +// + +/* 803688DC-80368924 36321C 0048+00 0/0 1/1 0/0 .text strrchr */ +char* strrchr(const char* str, int chr) { + const u8* p = (u8*)str - 1; + const u8* q = NULL; + u32 c = (chr & 0xFF); + + u32 ch; + while (ch = *++p) { + if (ch == c) { + q = p; + } + } + + if (q != NULL) { + return (char*)q; + } + + return c ? NULL : (char*)p; +} + +/* 80368924-80368954 363264 0030+00 0/0 3/3 0/0 .text strchr */ +char* strchr(const char* str, int chr) { + const u8* p = (u8*)str - 1; + u32 c = (chr & 0xFF); + + u32 ch; + while (ch = *++p) { + if (ch == c) { + return (char*)p; + } + } + + return c ? NULL : (char*)p; +} + +/* 80368954-80368994 363294 0040+00 0/0 6/6 0/0 .text strncmp */ +int strncmp(const char* strA, const char* strB, u32 n) { + const u8* p1 = (u8*)strA - 1; + const u8* p2 = (u8*)strB - 1; + u32 c1, c2; + + n++; + while (--n) { + if ((c1 = *++p1) != (c2 = *++p2)) { + return c1 - c2; + } else if (c1 == 0) { + break; + } + } + + return 0; +} + +/* 80368994-80368ABC 3632D4 0128+00 0/0 155/155 279/279 .text strcmp */ +int strcmp(const char* strA, const char* strB) { + register u8* left = (u8*)strA; + register u8* right = (u8*)strB; + u32 align, l1, r1, x; + + l1 = *left; + r1 = *right; + if (l1 - r1) { + return l1 - r1; + } + + if ((align = ((int)left & 3)) != ((int)right & 3)) { + goto bytecopy; + } + + if (align) { + if (l1 == 0) { + return 0; + } + for (align = 3 - align; align; align--) { + l1 = *(++left); + r1 = *(++right); + if (l1 - r1) { + return l1 - r1; + } + if (l1 == 0) { + return 0; + } + } + left++; + right++; + } + + l1 = *(int*)left; + r1 = *(int*)right; + x = l1 + K2; + if (x & K1) { + goto adjust; + } + + while (l1 == r1) { + l1 = *(++((int*)(left))); + r1 = *(++((int*)(right))); + x = l1 + K2; + if (x & K1) { + goto adjust; + } + } + + if (l1 > r1) { + return 1; + } + return -1; + +adjust: + l1 = *left; + r1 = *right; + if (l1 - r1) { + return l1 - r1; + } + +bytecopy: + if (l1 == 0) { + return 0; + } + + do { + l1 = *(++left); + r1 = *(++right); + if (l1 - r1) { + return l1 - r1; + } + if (l1 == 0) { + return 0; + } + } while (1); +} + +/* 80368ABC-80368AE8 3633FC 002C+00 0/0 20/20 8/8 .text strcat */ +char* strcat(char* dst, const char* src) { + const u8* p = (u8*)src - 1; + u8* q = (u8*)dst - 1; + + while (*++q) { + } + + q--; + + while (*++q = *++p) { + } + + return dst; +} + +/* 80368AE8-80368B2C 363428 0044+00 0/0 9/9 1/1 .text strncpy */ +char* strncpy(char* dst, const char* src, size_t n) { + const u8* p = (const u8*)src - 1; + u8* q = (u8*)dst - 1; + + n++; + while (--n) { + if (!(*++q = *++p)) { + while (--n) { + *++q = 0; + } + break; + } + } + + return dst; +} + +/* 80368B2C-80368BE4 36346C 00B8+00 0/0 131/131 13/13 .text strcpy */ +char* strcpy(char* dst, const char* src) { + register u8 *destb, *fromb; + register u32 w, t, align; + + fromb = (u8*)src; + destb = (u8*)dst; + + if ((align = ((int)fromb & 3)) != ((int)destb & 3)) { + goto bytecopy; + } + + if (align) { + if ((*destb = *fromb) == 0) { + return dst; + } + + for (align = 3 - align; align; align--) { + if ((*(++destb) = *(++fromb)) == 0) { + return dst; + } + } + ++destb; + ++fromb; + } + + w = *((int*)(fromb)); + + t = w + K2; + + t &= K1; + if (t) { + goto bytecopy; + } + --((int*)(destb)); + + do { + *(++((int*)(destb))) = w; + w = *(++((int*)(fromb))); + + t = w + K2; + t &= K1; + if (t) { + goto adjust; + } + } while (1); + +adjust: + ++((int*)(destb)); + +bytecopy: + if ((*destb = *fromb) == 0) { + return dst; + } + + do { + if ((*(++destb) = *(++fromb)) == 0) { + return dst; + } + } while (1); + + return dst; +} + +/* 80368BE4-80368C00 363524 001C+00 0/0 28/28 8/8 .text strlen */ +u32 strlen(const char* str) { + size_t len = -1; + u8* p = (u8*)str - 1; + + do { + len++; + } while (*++p); + + return len; +} diff --git a/libs/MSL_C/MSL_Common/Src/string.cpp b/libs/MSL_C/MSL_Common/Src/string.cpp deleted file mode 100644 index ce6e6cfbea..0000000000 --- a/libs/MSL_C/MSL_Common/Src/string.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: MSL_Common/Src/string -// - -#include "MSL_C/MSL_Common/Src/string.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// External References: -// - -extern "C" void _epilog(); - -// -// Declarations: -// - -/* 803688DC-80368924 36321C 0048+00 0/0 1/1 0/0 .text strrchr */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm char* strrchr(const char*, int) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strrchr.s" -} -#pragma pop - -/* 80368924-80368954 363264 0030+00 0/0 3/3 0/0 .text strchr */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm char* strchr(const char*, int) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strchr.s" -} -#pragma pop - -/* 80368954-80368994 363294 0040+00 0/0 6/6 0/0 .text strncmp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int strncmp(const char*, const char*, u32) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strncmp.s" -} -#pragma pop - -/* 80368994-80368ABC 3632D4 0128+00 0/0 155/155 279/279 .text strcmp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int strcmp(const char*, const char*) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strcmp.s" -} -#pragma pop - -/* 80368ABC-80368AE8 3633FC 002C+00 0/0 20/20 8/8 .text strcat */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm char* strcat(char*, const char*) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strcat.s" -} -#pragma pop - -/* 80368AE8-80368B2C 363428 0044+00 0/0 9/9 1/1 .text strncpy */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm char* strncpy(char*, const char*, u32) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strncpy.s" -} -#pragma pop - -/* 80368B2C-80368BE4 36346C 00B8+00 0/0 131/131 13/13 .text strcpy */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm char* strcpy(char*, const char*) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strcpy.s" -} -#pragma pop - -/* 80368BE4-80368C00 363524 001C+00 0/0 28/28 8/8 .text strlen */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm u32 strlen(const char*) { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/string/strlen.s" -} -#pragma pop diff --git a/libs/MSL_C/MSL_Common/Src/strtoul.cpp b/libs/MSL_C/MSL_Common/Src/strtoul.c similarity index 89% rename from libs/MSL_C/MSL_Common/Src/strtoul.cpp rename to libs/MSL_C/MSL_Common/Src/strtoul.c index 7ac0c47c61..3cc0b88b90 100644 --- a/libs/MSL_C/MSL_Common/Src/strtoul.cpp +++ b/libs/MSL_C/MSL_Common/Src/strtoul.c @@ -11,18 +11,18 @@ // Forward References: // -extern "C" void strtol(); -extern "C" void strtoul(); -extern "C" void __strtoul(); +void strtol(); +void strtoul(); +void __strtoul(); // // External References: // -extern "C" void __StringRead(); -extern "C" extern u8 __ctype_map[256]; -extern "C" extern u8 __upper_map[256]; -extern "C" extern u8 errno[4 + 4 /* padding */]; +void __StringRead(); +extern u8 __ctype_map[256]; +extern u8 __upper_map[256]; +extern u8 errno[4 + 4 /* padding */]; // // Declarations: diff --git a/libs/MSL_C/MSL_Common/Src/wchar_io.c b/libs/MSL_C/MSL_Common/Src/wchar_io.c new file mode 100644 index 0000000000..f6ac7a3f99 --- /dev/null +++ b/libs/MSL_C/MSL_Common/Src/wchar_io.c @@ -0,0 +1,44 @@ +// +// Generated By: dol2asm +// Translation Unit: MSL_Common/Src/wchar_io +// + +#include "MSL_C/MSL_Common/Src/wchar_io.h" +#include "MSL_C/MSL_Common/Src/ansi_files.h" +#include "dol2asm.h" +#include "dolphin/types.h" + +// +// Forward References: +// + +int fwide(FILE* file, int mode); + +// +// External References: +// + +// +// Declarations: +// + +/* 80369114-8036919C 363A54 0088+00 0/0 5/5 0/0 .text fwide */ +int fwide(FILE* file, int mode) { + if (file == NULL || file->file_mode.file_kind == CLOSED_FILE) { + return 0; + } + + switch (file->file_mode.file_orientation) { + case UNORIENTED: + if (mode > 0) { + file->file_mode.file_orientation = WIDE_ORIENTED; + } else if (mode < 0) { + file->file_mode.file_orientation = CHAR_ORIENTED; + } + return mode; + case WIDE_ORIENTED: + return 1; + case CHAR_ORIENTED: + return -1; + } +} diff --git a/libs/MSL_C/MSL_Common/Src/wchar_io.cpp b/libs/MSL_C/MSL_Common/Src/wchar_io.cpp deleted file mode 100644 index 8e71f35b42..0000000000 --- a/libs/MSL_C/MSL_Common/Src/wchar_io.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: MSL_Common/Src/wchar_io -// - -#include "MSL_C/MSL_Common/Src/wchar_io.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void fwide(); - -// -// External References: -// - -// -// Declarations: -// - -/* 80369114-8036919C 363A54 0088+00 0/0 5/5 0/0 .text fwide */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void fwide() { - nofralloc -#include "asm/MSL_C/MSL_Common/Src/wchar_io/fwide.s" -} -#pragma pop diff --git a/libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.cpp b/libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c similarity index 94% rename from libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.cpp rename to libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c index 7dde1664fb..4cdf13f636 100644 --- a/libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.cpp +++ b/libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c @@ -11,22 +11,22 @@ // Forward References: // -extern "C" void __num2dec(); -extern "C" void __num2dec_internal(); -extern "C" void __two_exp(); -extern "C" void __timesdec(); -extern "C" extern char const* const MSL_Common_Embedded_Src_ansi_fp__stringBase0; +void __num2dec(); +void __num2dec_internal(); +void __two_exp(); +void __timesdec(); +extern char const* const MSL_Common_Embedded_Src_ansi_fp__stringBase0; // // External References: // -extern "C" void __div2u(); -extern "C" void __mod2u(); -extern "C" void __cvt_dbl_usll(); -extern "C" void frexp(); -extern "C" void ldexp(); -extern "C" void modf(); +void __div2u(); +void __mod2u(); +void __cvt_dbl_usll(); +void frexp(); +void ldexp(); +void modf(); // // Declarations: diff --git a/libs/MSL_C/Makefile b/libs/MSL_C/Makefile index eda4f12ce3..e5ab9f3fbd 100644 --- a/libs/MSL_C/Makefile +++ b/libs/MSL_C/Makefile @@ -3,62 +3,62 @@ # LIBMSL_C_PPCEABI_BARE_H_A_CPP_FILES := \ - libs/MSL_C/MSL_Common/Src/abort_exit.cpp \ - libs/MSL_C/MSL_Common/Src/alloc.cpp \ - libs/MSL_C/MSL_Common/Src/errno.cpp \ - libs/MSL_C/MSL_Common/Src/ansi_files.cpp \ - libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.cpp \ - libs/MSL_C/MSL_Common/Src/arith.cpp \ - libs/MSL_C/MSL_Common/Src/buffer_io.cpp \ - libs/MSL_C/MSL_Common/Src/char_io.cpp \ - libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.cpp \ - libs/MSL_C/MSL_Common/Src/ctype.cpp \ - libs/MSL_C/MSL_Common/Src/direct_io.cpp \ - libs/MSL_C/MSL_Common/Src/file_io.cpp \ - libs/MSL_C/MSL_Common/Src/FILE_POS.cpp \ - libs/MSL_C/MSL_Common/Src/mbstring.cpp \ - libs/MSL_C/MSL_Common/Src/mem.cpp \ - libs/MSL_C/MSL_Common/Src/mem_funcs.cpp \ - libs/MSL_C/MSL_Common/Src/misc_io.cpp \ - libs/MSL_C/MSL_Common/Src/printf.cpp \ - libs/MSL_C/MSL_Common/Src/scanf.cpp \ - libs/MSL_C/MSL_Common/Src/float.cpp \ - libs/MSL_C/MSL_Common/Src/signal.cpp \ - libs/MSL_C/MSL_Common/Src/string.cpp \ - libs/MSL_C/MSL_Common/Src/strtoul.cpp \ - libs/MSL_C/MSL_Common/Src/wchar_io.cpp \ - libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.cpp \ - libs/MSL_C/Math/Double_precision/e_acos.cpp \ - libs/MSL_C/Math/Double_precision/e_asin.cpp \ - libs/MSL_C/Math/Double_precision/e_atan2.cpp \ - libs/MSL_C/Math/Double_precision/e_exp.cpp \ - libs/MSL_C/Math/Double_precision/e_fmod.cpp \ - libs/MSL_C/Math/Double_precision/e_pow.cpp \ - libs/MSL_C/Math/Double_precision/e_rem_pio2.cpp \ - libs/MSL_C/Math/Double_precision/k_cos.cpp \ - libs/MSL_C/Math/Double_precision/k_rem_pio2.cpp \ - libs/MSL_C/Math/Double_precision/k_sin.cpp \ - libs/MSL_C/Math/Double_precision/k_tan.cpp \ - libs/MSL_C/Math/Double_precision/s_atan.cpp \ - libs/MSL_C/Math/Double_precision/s_ceil.cpp \ - libs/MSL_C/Math/Double_precision/s_copysign.cpp \ - libs/MSL_C/Math/Double_precision/s_cos.cpp \ - libs/MSL_C/Math/Double_precision/s_floor.cpp \ - libs/MSL_C/Math/Double_precision/s_frexp.cpp \ - libs/MSL_C/Math/Double_precision/s_ldexp.cpp \ - libs/MSL_C/Math/Double_precision/s_modf.cpp \ - libs/MSL_C/Math/Double_precision/s_sin.cpp \ - libs/MSL_C/Math/Double_precision/s_tan.cpp \ - libs/MSL_C/Math/Double_precision/w_acos.cpp \ - libs/MSL_C/Math/Double_precision/w_asin.cpp \ - libs/MSL_C/Math/Double_precision/w_atan2.cpp \ - libs/MSL_C/Math/Double_precision/w_exp.cpp \ - libs/MSL_C/Math/Double_precision/w_fmod.cpp \ - libs/MSL_C/Math/Double_precision/w_pow.cpp \ - libs/MSL_C/Math/Double_precision/e_sqrt.cpp \ - libs/MSL_C/PPC_EABI/Src/math_ppc.cpp \ - libs/MSL_C/Math/Double_precision/w_sqrt.cpp \ - libs/MSL_C/MSL_Common/Src/extras.cpp \ + libs/MSL_C/MSL_Common/Src/abort_exit.c \ + libs/MSL_C/MSL_Common/Src/alloc.c \ + libs/MSL_C/MSL_Common/Src/errno.c \ + libs/MSL_C/MSL_Common/Src/ansi_files.c \ + libs/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c \ + libs/MSL_C/MSL_Common/Src/arith.c \ + libs/MSL_C/MSL_Common/Src/buffer_io.c \ + libs/MSL_C/MSL_Common/Src/char_io.c \ + libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.c \ + libs/MSL_C/MSL_Common/Src/ctype.c \ + libs/MSL_C/MSL_Common/Src/direct_io.c \ + libs/MSL_C/MSL_Common/Src/file_io.c \ + libs/MSL_C/MSL_Common/Src/FILE_POS.c \ + libs/MSL_C/MSL_Common/Src/mbstring.c \ + libs/MSL_C/MSL_Common/Src/mem.c \ + libs/MSL_C/MSL_Common/Src/mem_funcs.c \ + libs/MSL_C/MSL_Common/Src/misc_io.c \ + libs/MSL_C/MSL_Common/Src/printf.c \ + libs/MSL_C/MSL_Common/Src/scanf.c \ + libs/MSL_C/MSL_Common/Src/float.c \ + libs/MSL_C/MSL_Common/Src/signal.c \ + libs/MSL_C/MSL_Common/Src/string.c \ + libs/MSL_C/MSL_Common/Src/strtoul.c \ + libs/MSL_C/MSL_Common/Src/wchar_io.c \ + libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c \ + libs/MSL_C/Math/Double_precision/e_acos.c \ + libs/MSL_C/Math/Double_precision/e_asin.c \ + libs/MSL_C/Math/Double_precision/e_atan2.c \ + libs/MSL_C/Math/Double_precision/e_exp.c \ + libs/MSL_C/Math/Double_precision/e_fmod.c \ + libs/MSL_C/Math/Double_precision/e_pow.c \ + libs/MSL_C/Math/Double_precision/e_rem_pio2.c \ + libs/MSL_C/Math/Double_precision/k_cos.c \ + libs/MSL_C/Math/Double_precision/k_rem_pio2.c \ + libs/MSL_C/Math/Double_precision/k_sin.c \ + libs/MSL_C/Math/Double_precision/k_tan.c \ + libs/MSL_C/Math/Double_precision/s_atan.c \ + libs/MSL_C/Math/Double_precision/s_ceil.c \ + libs/MSL_C/Math/Double_precision/s_copysign.c \ + libs/MSL_C/Math/Double_precision/s_cos.c \ + libs/MSL_C/Math/Double_precision/s_floor.c \ + libs/MSL_C/Math/Double_precision/s_frexp.c \ + libs/MSL_C/Math/Double_precision/s_ldexp.c \ + libs/MSL_C/Math/Double_precision/s_modf.c \ + libs/MSL_C/Math/Double_precision/s_sin.c \ + libs/MSL_C/Math/Double_precision/s_tan.c \ + libs/MSL_C/Math/Double_precision/w_acos.c \ + libs/MSL_C/Math/Double_precision/w_asin.c \ + libs/MSL_C/Math/Double_precision/w_atan2.c \ + libs/MSL_C/Math/Double_precision/w_exp.c \ + libs/MSL_C/Math/Double_precision/w_fmod.c \ + libs/MSL_C/Math/Double_precision/w_pow.c \ + libs/MSL_C/Math/Double_precision/e_sqrt.c \ + libs/MSL_C/PPC_EABI/Src/math_ppc.c \ + libs/MSL_C/Math/Double_precision/w_sqrt.c \ + libs/MSL_C/MSL_Common/Src/extras.c \ LIBMSL_C_PPCEABI_BARE_H_A_O_FILES := \ $(BUILD_DIR)/libs/MSL_C/MSL_Common/Src/abort_exit.o \ @@ -119,6 +119,8 @@ LIBMSL_C_PPCEABI_BARE_H_A_O_FILES := \ $(BUILD_DIR)/libs/MSL_C/MSL_Common/Src/extras.o \ LIBMSL_C_PPCEABI_BARE_H_A_CFLAGS := \ + -O4,p \ + -lang=c \ LIBMSL_C_PPCEABI_BARE_H_A_LDFLAGS := \ -nodefaults \ @@ -131,9 +133,9 @@ $(BUILD_DIR)/libMSL_C.a: $(LIBMSL_C_PPCEABI_BARE_H_A_O_FILES) @echo $(LIBMSL_C_PPCEABI_BARE_H_A_O_FILES) > build/LIBMSL_C_PPCEABI_BARE_H_A_ofiles @$(LD) -xm l $(LIBMSL_C_PPCEABI_BARE_H_A_LDFLAGS) -o $(BUILD_DIR)/libMSL_C.a @build/LIBMSL_C_PPCEABI_BARE_H_A_ofiles -$(BUILD_DIR)/libs/MSL_C/%.o: libs/MSL_C/%.cpp +$(BUILD_DIR)/libs/MSL_C/%.o: libs/MSL_C/%.c @mkdir -p $(@D) @echo building... $< - @$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp - @$(CC) $(CFLAGS) $(LIBMSL_C_PPCEABI_BARE_H_A_CFLAGS) -c -o $@ $(basename $@).cpp + @$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).c + @$(CC) $(CFLAGS) $(LIBMSL_C_PPCEABI_BARE_H_A_CFLAGS) -c -o $@ $(basename $@).c diff --git a/libs/MSL_C/Math/Double_precision/e_acos.cpp b/libs/MSL_C/Math/Double_precision/e_acos.c similarity index 96% rename from libs/MSL_C/Math/Double_precision/e_acos.cpp rename to libs/MSL_C/Math/Double_precision/e_acos.c index 49f917ccb1..f23b7f0463 100644 --- a/libs/MSL_C/Math/Double_precision/e_acos.cpp +++ b/libs/MSL_C/Math/Double_precision/e_acos.c @@ -11,14 +11,14 @@ // Forward References: // -extern "C" void __ieee754_acos(); +void __ieee754_acos(); // // External References: // -extern "C" void sqrt(); -extern "C" extern u32 __float_nan; +void sqrt(); +extern u32 __float_nan; // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/e_asin.cpp b/libs/MSL_C/Math/Double_precision/e_asin.c similarity index 96% rename from libs/MSL_C/Math/Double_precision/e_asin.cpp rename to libs/MSL_C/Math/Double_precision/e_asin.c index 7f601e4c6b..fa5656cf07 100644 --- a/libs/MSL_C/Math/Double_precision/e_asin.cpp +++ b/libs/MSL_C/Math/Double_precision/e_asin.c @@ -11,14 +11,14 @@ // Forward References: // -extern "C" void __ieee754_asin(); +void __ieee754_asin(); // // External References: // -extern "C" void sqrt(); -extern "C" extern u32 __float_nan; +void sqrt(); +extern u32 __float_nan; // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/e_atan2.cpp b/libs/MSL_C/Math/Double_precision/e_atan2.c similarity index 97% rename from libs/MSL_C/Math/Double_precision/e_atan2.cpp rename to libs/MSL_C/Math/Double_precision/e_atan2.c index bba40e9696..db6f4e8742 100644 --- a/libs/MSL_C/Math/Double_precision/e_atan2.cpp +++ b/libs/MSL_C/Math/Double_precision/e_atan2.c @@ -11,13 +11,13 @@ // Forward References: // -extern "C" void __ieee754_atan2(); +void __ieee754_atan2(); // // External References: // -extern "C" void atan(); +void atan(); // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/e_exp.cpp b/libs/MSL_C/Math/Double_precision/e_exp.c similarity index 99% rename from libs/MSL_C/Math/Double_precision/e_exp.cpp rename to libs/MSL_C/Math/Double_precision/e_exp.c index c78a9f7d53..97c162b682 100644 --- a/libs/MSL_C/Math/Double_precision/e_exp.cpp +++ b/libs/MSL_C/Math/Double_precision/e_exp.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void __ieee754_exp(); +void __ieee754_exp(); // // External References: diff --git a/libs/MSL_C/Math/Double_precision/e_fmod.c b/libs/MSL_C/Math/Double_precision/e_fmod.c new file mode 100644 index 0000000000..200db3bc97 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/e_fmod.c @@ -0,0 +1,167 @@ + +/* @(#)e_fmod.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __ieee754_fmod(x,y) + * Return x mod y in exact arithmetic + * Method: shift and subtract + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +static const double one = 1.0, Zero[] = { + 0.0, + -0.0, +}; +#else +static double one = 1.0, Zero[] = { + 0.0, + -0.0, +}; +#endif + +#ifdef __STDC__ +double __ieee754_fmod(double x, double y) +#else +double __ieee754_fmod(x, y) double x, y; +#endif +{ + int n, hx, hy, hz, ix, iy, sx, i; + unsigned lx, ly, lz; + + hx = __HI(x); /* high word of x */ + lx = __LO(x); /* low word of x */ + hy = __HI(y); /* high word of y */ + ly = __LO(y); /* low word of y */ + sx = hx & 0x80000000; /* sign of x */ + hx ^= sx; /* |x| */ + hy &= 0x7fffffff; /* |y| */ + + /* purge off exception values */ + if ((hy | ly) == 0 || (hx >= 0x7ff00000) || /* y=0,or x not finite */ + ((hy | ((ly | -ly) >> 31)) > 0x7ff00000)) /* or y is NaN */ + return (x * y) / (x * y); + if (hx <= hy) { + if ((hx < hy) || (lx < ly)) + return x; /* |x|<|y| return x */ + if (lx == ly) + return Zero[(unsigned)sx >> 31]; /* |x|=|y| return x*0*/ + } + + /* determine ix = ilogb(x) */ + if (hx < 0x00100000) { /* subnormal x */ + if (hx == 0) { + for (ix = -1043, i = lx; i > 0; i <<= 1) + ix -= 1; + } else { + for (ix = -1022, i = (hx << 11); i > 0; i <<= 1) + ix -= 1; + } + } else + ix = (hx >> 20) - 1023; + + /* determine iy = ilogb(y) */ + if (hy < 0x00100000) { /* subnormal y */ + if (hy == 0) { + for (iy = -1043, i = ly; i > 0; i <<= 1) + iy -= 1; + } else { + for (iy = -1022, i = (hy << 11); i > 0; i <<= 1) + iy -= 1; + } + } else + iy = (hy >> 20) - 1023; + + /* set up {hx,lx}, {hy,ly} and align y to x */ + if (ix >= -1022) + hx = 0x00100000 | (0x000fffff & hx); + else { /* subnormal x, shift x to normal */ + n = -1022 - ix; + if (n <= 31) { + hx = (hx << n) | (lx >> (32 - n)); + lx <<= n; + } else { + hx = lx << (n - 32); + lx = 0; + } + } + if (iy >= -1022) + hy = 0x00100000 | (0x000fffff & hy); + else { /* subnormal y, shift y to normal */ + n = -1022 - iy; + if (n <= 31) { + hy = (hy << n) | (ly >> (32 - n)); + ly <<= n; + } else { + hy = ly << (n - 32); + ly = 0; + } + } + + /* fix point fmod */ + n = ix - iy; + while (n--) { + hz = hx - hy; + lz = lx - ly; + if (lx < ly) + hz -= 1; + if (hz < 0) { + hx = hx + hx + (lx >> 31); + lx = lx + lx; + } else { + if ((hz | lz) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + hx = hz + hz + (lz >> 31); + lx = lz + lz; + } + } + hz = hx - hy; + lz = lx - ly; + if (lx < ly) + hz -= 1; + if (hz >= 0) { + hx = hz; + lx = lz; + } + + /* convert back to floating value and restore the sign */ + if ((hx | lx) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + while (hx < 0x00100000) { /* normalize x */ + hx = hx + hx + (lx >> 31); + lx = lx + lx; + iy -= 1; + } + if (iy >= -1022) { /* normalize output */ + hx = ((hx - 0x00100000) | ((iy + 1023) << 20)); + __HI(x) = hx | sx; + __LO(x) = lx; + } else { /* subnormal output */ + n = -1022 - iy; + if (n <= 20) { + lx = (lx >> n) | ((unsigned)hx << (32 - n)); + hx >>= n; + } else if (n <= 31) { + lx = (hx << (32 - n)) | (lx >> n); + hx = sx; + } else { + lx = hx >> (n - 32); + hx = sx; + } + __HI(x) = hx | sx; + __LO(x) = lx; + x *= one; /* create necessary signal */ + } + return x; /* exact output */ +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/e_fmod.cpp b/libs/MSL_C/Math/Double_precision/e_fmod.cpp deleted file mode 100644 index fc46e25869..0000000000 --- a/libs/MSL_C/Math/Double_precision/e_fmod.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/e_fmod -// - -#include "MSL_C/Math/Double_precision/e_fmod.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void __ieee754_fmod(); - -// -// External References: -// - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 803A2370-803A2380 02E9D0 0010+00 1/1 0/0 0/0 .rodata Zero */ -SECTION_RODATA static u8 const Zero[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x803A2370, &Zero); - -/* 80369B9C-80369ED8 3644DC 033C+00 0/0 1/1 0/0 .text __ieee754_fmod */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __ieee754_fmod() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/e_fmod/__ieee754_fmod.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/e_pow.cpp b/libs/MSL_C/Math/Double_precision/e_pow.c similarity index 97% rename from libs/MSL_C/Math/Double_precision/e_pow.cpp rename to libs/MSL_C/Math/Double_precision/e_pow.c index 310be3d34a..77445aff0b 100644 --- a/libs/MSL_C/Math/Double_precision/e_pow.cpp +++ b/libs/MSL_C/Math/Double_precision/e_pow.c @@ -11,16 +11,16 @@ // Forward References: // -extern "C" void __ieee754_pow(); +void __ieee754_pow(); // // External References: // -extern "C" void ldexp(); -extern "C" void sqrt(); -extern "C" extern u32 __float_nan; -extern "C" extern u8 errno[4 + 4 /* padding */]; +void ldexp(); +void sqrt(); +extern u32 __float_nan; +extern u8 errno[4 + 4 /* padding */]; // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/e_rem_pio2.cpp b/libs/MSL_C/Math/Double_precision/e_rem_pio2.c similarity index 98% rename from libs/MSL_C/Math/Double_precision/e_rem_pio2.cpp rename to libs/MSL_C/Math/Double_precision/e_rem_pio2.c index d6677ddff1..d2d70f9f87 100644 --- a/libs/MSL_C/Math/Double_precision/e_rem_pio2.cpp +++ b/libs/MSL_C/Math/Double_precision/e_rem_pio2.c @@ -11,13 +11,13 @@ // Forward References: // -extern "C" void __ieee754_rem_pio2(); +void __ieee754_rem_pio2(); // // External References: // -extern "C" void __kernel_rem_pio2(); +void __kernel_rem_pio2(); // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/e_sqrt.cpp b/libs/MSL_C/Math/Double_precision/e_sqrt.c similarity index 86% rename from libs/MSL_C/Math/Double_precision/e_sqrt.cpp rename to libs/MSL_C/Math/Double_precision/e_sqrt.c index a54a115c59..744a175515 100644 --- a/libs/MSL_C/Math/Double_precision/e_sqrt.cpp +++ b/libs/MSL_C/Math/Double_precision/e_sqrt.c @@ -11,14 +11,14 @@ // Forward References: // -extern "C" void __ieee754_sqrt(); +void __ieee754_sqrt(); // // External References: // -extern "C" extern u32 __float_nan; -extern "C" extern u8 errno[4 + 4 /* padding */]; +extern u32 __float_nan; +extern u8 errno[4 + 4 /* padding */]; // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/k_cos.cpp b/libs/MSL_C/Math/Double_precision/k_cos.c similarity index 98% rename from libs/MSL_C/Math/Double_precision/k_cos.cpp rename to libs/MSL_C/Math/Double_precision/k_cos.c index 8b52238de4..1707287c24 100644 --- a/libs/MSL_C/Math/Double_precision/k_cos.cpp +++ b/libs/MSL_C/Math/Double_precision/k_cos.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void __kernel_cos(); +void __kernel_cos(); // // External References: diff --git a/libs/MSL_C/Math/Double_precision/k_rem_pio2.cpp b/libs/MSL_C/Math/Double_precision/k_rem_pio2.c similarity index 94% rename from libs/MSL_C/Math/Double_precision/k_rem_pio2.cpp rename to libs/MSL_C/Math/Double_precision/k_rem_pio2.c index 7f632503bd..e09d2b995b 100644 --- a/libs/MSL_C/Math/Double_precision/k_rem_pio2.cpp +++ b/libs/MSL_C/Math/Double_precision/k_rem_pio2.c @@ -11,16 +11,16 @@ // Forward References: // -extern "C" void __kernel_rem_pio2(); +void __kernel_rem_pio2(); // // External References: // -extern "C" void _savefpr_25(); -extern "C" void _restfpr_25(); -extern "C" void floor(); -extern "C" void ldexp(); +void _savefpr_25(); +void _restfpr_25(); +void floor(); +void ldexp(); // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/k_sin.cpp b/libs/MSL_C/Math/Double_precision/k_sin.c similarity index 97% rename from libs/MSL_C/Math/Double_precision/k_sin.cpp rename to libs/MSL_C/Math/Double_precision/k_sin.c index dd1f7021fa..7e4bd136d9 100644 --- a/libs/MSL_C/Math/Double_precision/k_sin.cpp +++ b/libs/MSL_C/Math/Double_precision/k_sin.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void __kernel_sin(); +void __kernel_sin(); // // External References: diff --git a/libs/MSL_C/Math/Double_precision/k_tan.cpp b/libs/MSL_C/Math/Double_precision/k_tan.c similarity index 98% rename from libs/MSL_C/Math/Double_precision/k_tan.cpp rename to libs/MSL_C/Math/Double_precision/k_tan.c index d9b04e8f8a..04f0eed1b7 100644 --- a/libs/MSL_C/Math/Double_precision/k_tan.cpp +++ b/libs/MSL_C/Math/Double_precision/k_tan.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void __kernel_tan(); +void __kernel_tan(); // // External References: diff --git a/libs/MSL_C/Math/Double_precision/s_atan.cpp b/libs/MSL_C/Math/Double_precision/s_atan.c similarity index 99% rename from libs/MSL_C/Math/Double_precision/s_atan.cpp rename to libs/MSL_C/Math/Double_precision/s_atan.c index 41dbd4859d..f77db189e7 100644 --- a/libs/MSL_C/Math/Double_precision/s_atan.cpp +++ b/libs/MSL_C/Math/Double_precision/s_atan.c @@ -11,7 +11,7 @@ // Forward References: // -extern "C" void atan(); +void atan(); // // External References: diff --git a/libs/MSL_C/Math/Double_precision/s_ceil.c b/libs/MSL_C/Math/Double_precision/s_ceil.c new file mode 100644 index 0000000000..91d3d34734 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_ceil.c @@ -0,0 +1,90 @@ + +/* @(#)s_ceil.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * ceil(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to ceil(x). + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +static const double huge = 1.0e300; +#else +static double huge = 1.0e300; +#endif + +#ifdef __STDC__ +double ceil(double x) +#else +double ceil(x) double x; +#endif +{ + int i0, i1, j0; + unsigned i, j; + i0 = __HI(x); + i1 = __LO(x); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + if (j0 < 20) { + if (j0 < 0) { /* raise inexact if x != 0 */ + if (huge + x > 0.0) { /* return 0*sign(x) if |x|<1 */ + if (i0 < 0) { + i0 = 0x80000000; + i1 = 0; + } else if ((i0 | i1) != 0) { + i0 = 0x3ff00000; + i1 = 0; + } + } + } else { + i = (0x000fffff) >> j0; + if (((i0 & i) | i1) == 0) + return x; /* x is integral */ + if (huge + x > 0.0) { /* raise inexact flag */ + if (i0 > 0) + i0 += (0x00100000) >> j0; + i0 &= (~i); + i1 = 0; + } + } + } else if (j0 > 51) { + if (j0 == 0x400) + return x + x; /* inf or NaN */ + else + return x; /* x is integral */ + } else { + i = ((unsigned)(0xffffffff)) >> (j0 - 20); + if ((i1 & i) == 0) + return x; /* x is integral */ + if (huge + x > 0.0) { /* raise inexact flag */ + if (i0 > 0) { + if (j0 == 20) + i0 += 1; + else { + j = i1 + (1 << (52 - j0)); + if (j < i1) + i0 += 1; /* got a carry */ + i1 = j; + } + } + i1 &= (~i); + } + } + __HI(x) = i0; + __LO(x) = i1; + return x; +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_ceil.cpp b/libs/MSL_C/Math/Double_precision/s_ceil.cpp deleted file mode 100644 index c93a5506c7..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_ceil.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_ceil -// - -#include "MSL_C/Math/Double_precision/s_ceil.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void ceil(); - -// -// External References: -// - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456AE0-80456AE8 0050E0 0008+00 1/1 0/0 0/0 .sdata2 @124 */ -SECTION_SDATA2 static f64 lit_124 = 1e+300; - -/* 80456AE8-80456AF0 0050E8 0008+00 1/1 0/0 0/0 .sdata2 @125 */ -SECTION_SDATA2 static u8 lit_125[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8036BEBC-8036C000 3667FC 0144+00 0/0 2/2 0/0 .text ceil */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void ceil() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_ceil/ceil.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_copysign.c b/libs/MSL_C/Math/Double_precision/s_copysign.c new file mode 100644 index 0000000000..14fd4ae8ce --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_copysign.c @@ -0,0 +1,30 @@ + +/* @(#)s_copysign.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * copysign(double x, double y) + * copysign(x,y) returns a value with the magnitude of x and + * with the sign bit of y. + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +double copysign(double x, double y) +#else +double copysign(x, y) double x, y; +#endif +{ + __HI(x) = (__HI(x) & 0x7fffffff) | (__HI(y) & 0x80000000); + return x; +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_copysign.cpp b/libs/MSL_C/Math/Double_precision/s_copysign.cpp deleted file mode 100644 index 5e27a452d1..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_copysign.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_copysign -// - -#include "MSL_C/Math/Double_precision/s_copysign.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void copysign(); - -// -// External References: -// - -// -// Declarations: -// - -/* 8036C000-8036C028 366940 0028+00 0/0 1/1 0/0 .text copysign */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void copysign() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_copysign/copysign.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_cos.c b/libs/MSL_C/Math/Double_precision/s_cos.c new file mode 100644 index 0000000000..f1d4d56d18 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_cos.c @@ -0,0 +1,81 @@ +/* @(#)s_cos.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* cos(x) + * Return cosine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cosine function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +double cos(double x) +#else +double cos(x) double x; +#endif +{ + double y[2], z = 0.0; + int n, ix; + + /* High word of x. */ + ix = __HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) + return __kernel_cos(x, z); + + /* cos(Inf or NaN) is NaN */ + else if (ix >= 0x7ff00000) + return x - x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x, y); + switch (n & 3) { + case 0: + return __kernel_cos(y[0], y[1]); + case 1: + return -__kernel_sin(y[0], y[1], 1); + case 2: + return -__kernel_cos(y[0], y[1]); + default: + return __kernel_sin(y[0], y[1], 1); + } + } +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_cos.cpp b/libs/MSL_C/Math/Double_precision/s_cos.cpp deleted file mode 100644 index f929cfa6dc..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_cos.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_cos -// - -#include "MSL_C/Math/Double_precision/s_cos.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void cos(); - -// -// External References: -// - -extern "C" void __ieee754_rem_pio2(); -extern "C" void __kernel_cos(); -extern "C" void __kernel_sin(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456AF0-80456AF8 0050F0 0008+00 1/1 0/0 0/0 .sdata2 @67 */ -SECTION_SDATA2 static u8 lit_67[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8036C028-8036C0FC 366968 00D4+00 0/0 12/12 0/0 .text cos */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void cos() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_cos/cos.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_floor.c b/libs/MSL_C/Math/Double_precision/s_floor.c new file mode 100644 index 0000000000..3eea609ce3 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_floor.c @@ -0,0 +1,89 @@ + +/* @(#)s_floor.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * floor(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to floor(x). + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +static const double huge = 1.0e300; +#else +static double huge = 1.0e300; +#endif + +#ifdef __STDC__ +double floor(double x) +#else +double floor(x) double x; +#endif +{ + int i0, i1, j0; + unsigned i, j; + i0 = __HI(x); + i1 = __LO(x); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + if (j0 < 20) { + if (j0 < 0) { /* raise inexact if x != 0 */ + if (huge + x > 0.0) { /* return 0*sign(x) if |x|<1 */ + if (i0 >= 0) { + i0 = i1 = 0; + } else if (((i0 & 0x7fffffff) | i1) != 0) { + i0 = 0xbff00000; + i1 = 0; + } + } + } else { + i = (0x000fffff) >> j0; + if (((i0 & i) | i1) == 0) + return x; /* x is integral */ + if (huge + x > 0.0) { /* raise inexact flag */ + if (i0 < 0) + i0 += (0x00100000) >> j0; + i0 &= (~i); + i1 = 0; + } + } + } else if (j0 > 51) { + if (j0 == 0x400) + return x + x; /* inf or NaN */ + else + return x; /* x is integral */ + } else { + i = ((unsigned)(0xffffffff)) >> (j0 - 20); + if ((i1 & i) == 0) + return x; /* x is integral */ + if (huge + x > 0.0) { /* raise inexact flag */ + if (i0 < 0) { + if (j0 == 20) + i0 += 1; + else { + j = i1 + (1 << (52 - j0)); + if (j < i1) + i0 += 1; /* got a carry */ + i1 = j; + } + } + i1 &= (~i); + } + } + __HI(x) = i0; + __LO(x) = i1; + return x; +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_floor.cpp b/libs/MSL_C/Math/Double_precision/s_floor.cpp deleted file mode 100644 index b18fe98819..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_floor.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_floor -// - -#include "MSL_C/Math/Double_precision/s_floor.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void floor(); - -// -// External References: -// - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456AF8-80456B00 0050F8 0008+00 1/1 0/0 0/0 .sdata2 @124 */ -SECTION_SDATA2 static f64 lit_124 = 1e+300; - -/* 80456B00-80456B08 005100 0008+00 1/1 0/0 0/0 .sdata2 @125 */ -SECTION_SDATA2 static u8 lit_125[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8036C0FC-8036C244 366A3C 0148+00 0/0 5/5 0/0 .text floor */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void floor() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_floor/floor.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_frexp.c b/libs/MSL_C/Math/Double_precision/s_frexp.c new file mode 100644 index 0000000000..48bcbf21ed --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_frexp.c @@ -0,0 +1,57 @@ + +/* @(#)s_frexp.c 1.4 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * for non-zero x + * x = frexp(arg,&exp); + * return a double fp quantity x such that 0.5 <= |x| <1.0 + * and the corresponding binary exponent "exp". That is + * arg = x*2^exp. + * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg + * with *exp=0. + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +static const double +#else +static double +#endif + two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */ + +#ifdef __STDC__ +double frexp(double x, int* eptr) +#else +double frexp(x, eptr) double x; +int* eptr; +#endif +{ + int hx, ix, lx; + hx = __HI(x); + ix = 0x7fffffff & hx; + lx = __LO(x); + *eptr = 0; + if (ix >= 0x7ff00000 || ((ix | lx) == 0)) + return x; /* 0,inf,nan */ + if (ix < 0x00100000) { /* subnormal */ + x *= two54; + hx = __HI(x); + ix = hx & 0x7fffffff; + *eptr = -54; + } + *eptr += (ix >> 20) - 1022; + hx = (hx & 0x800fffff) | 0x3fe00000; + __HI(x) = hx; + return x; +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_frexp.cpp b/libs/MSL_C/Math/Double_precision/s_frexp.cpp deleted file mode 100644 index f9ddfc6865..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_frexp.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_frexp -// - -#include "MSL_C/Math/Double_precision/s_frexp.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void frexp(); - -// -// External References: -// - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456B08-80456B10 005108 0008+00 1/1 0/0 0/0 .sdata2 @57 */ -SECTION_SDATA2 static f64 lit_57 = 1.8014398509481984e+16; - -/* 8036C244-8036C2D0 366B84 008C+00 0/0 1/1 0/0 .text frexp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void frexp() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_frexp/frexp.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_ldexp.cpp b/libs/MSL_C/Math/Double_precision/s_ldexp.c similarity index 96% rename from libs/MSL_C/Math/Double_precision/s_ldexp.cpp rename to libs/MSL_C/Math/Double_precision/s_ldexp.c index 6f99499ba6..11de93eec0 100644 --- a/libs/MSL_C/Math/Double_precision/s_ldexp.cpp +++ b/libs/MSL_C/Math/Double_precision/s_ldexp.c @@ -11,13 +11,13 @@ // Forward References: // -extern "C" void ldexp(); +void ldexp(); // // External References: // -extern "C" void copysign(); +void copysign(); // // Declarations: diff --git a/libs/MSL_C/Math/Double_precision/s_modf.c b/libs/MSL_C/Math/Double_precision/s_modf.c new file mode 100644 index 0000000000..63357bb06a --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_modf.c @@ -0,0 +1,79 @@ + +/* @(#)s_modf.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * modf(double x, double *iptr) + * return fraction part of x, and return x's integral part in *iptr. + * Method: + * Bit twiddling. + * + * Exception: + * No exception. + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +static const double one = 1.0; +#else +static double one = 1.0; +#endif + +#ifdef __STDC__ +double modf(double x, double* iptr) +#else +double modf(x, iptr) double x, *iptr; +#endif +{ + int i0, i1, j0; + unsigned i; + i0 = __HI(x); /* high x */ + i1 = __LO(x); /* low x */ + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; /* exponent of x */ + if (j0 < 20) { /* integer part in high x */ + if (j0 < 0) { /* |x|<1 */ + __HIp(iptr) = i0 & 0x80000000; + __LOp(iptr) = 0; /* *iptr = +-0 */ + return x; + } else { + i = (0x000fffff) >> j0; + if (((i0 & i) | i1) == 0) { /* x is integral */ + *iptr = x; + __HI(x) &= 0x80000000; + __LO(x) = 0; /* return +-0 */ + return x; + } else { + __HIp(iptr) = i0 & (~i); + __LOp(iptr) = 0; + return x - *iptr; + } + } + } else if (j0 > 51) { /* no fraction part */ + *iptr = x * one; + __HI(x) &= 0x80000000; + __LO(x) = 0; /* return +-0 */ + return x; + } else { /* fraction part in low x */ + i = ((unsigned)(0xffffffff)) >> (j0 - 20); + if ((i1 & i) == 0) { /* x is integral */ + *iptr = x; + __HI(x) &= 0x80000000; + __LO(x) = 0; /* return +-0 */ + return x; + } else { + __HIp(iptr) = i0; + __LOp(iptr) = i1 & (~i); + return x - *iptr; + } + } +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_modf.cpp b/libs/MSL_C/Math/Double_precision/s_modf.cpp deleted file mode 100644 index 00348526db..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_modf.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_modf -// - -#include "MSL_C/Math/Double_precision/s_modf.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void modf(); - -// -// External References: -// - -// -// Declarations: -// - -/* 8036C494-8036C590 366DD4 00FC+00 0/0 1/1 0/0 .text modf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void modf() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_modf/modf.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_sin.c b/libs/MSL_C/Math/Double_precision/s_sin.c new file mode 100644 index 0000000000..b2ba68868b --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_sin.c @@ -0,0 +1,82 @@ + +/* @(#)s_sin.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* sin(x) + * Return sine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cose function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +double sin(double x) +#else +double sin(x) double x; +#endif +{ + double y[2], z = 0.0; + int n, ix; + + /* High word of x. */ + ix = __HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) + return __kernel_sin(x, z, 0); + + /* sin(Inf or NaN) is NaN */ + else if (ix >= 0x7ff00000) + return x - x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x, y); + switch (n & 3) { + case 0: + return __kernel_sin(y[0], y[1], 1); + case 1: + return __kernel_cos(y[0], y[1]); + case 2: + return -__kernel_sin(y[0], y[1], 1); + default: + return -__kernel_cos(y[0], y[1]); + } + } +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_sin.cpp b/libs/MSL_C/Math/Double_precision/s_sin.cpp deleted file mode 100644 index 516f21184a..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_sin.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_sin -// - -#include "MSL_C/Math/Double_precision/s_sin.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void sin(); - -// -// External References: -// - -extern "C" void __ieee754_rem_pio2(); -extern "C" void __kernel_cos(); -extern "C" void __kernel_sin(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456B38-80456B40 005138 0008+00 1/1 0/0 0/0 .sdata2 @67 */ -SECTION_SDATA2 static u8 lit_67[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8036C590-8036C668 366ED0 00D8+00 0/0 11/11 2/2 .text sin */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void sin() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_sin/sin.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/s_tan.c b/libs/MSL_C/Math/Double_precision/s_tan.c new file mode 100644 index 0000000000..77d77a18af --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/s_tan.c @@ -0,0 +1,73 @@ + +/* @(#)s_tan.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* tan(x) + * Return tangent function of x. + * + * kernel function: + * __kernel_tan ... tangent function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "fdlibm.h" + +#ifdef __STDC__ +double tan(double x) +#else +double tan(x) double x; +#endif +{ + double y[2], z = 0.0; + int n, ix; + + /* High word of x. */ + ix = __HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) + return __kernel_tan(x, z, 1); + + /* tan(Inf or NaN) is NaN */ + else if (ix >= 0x7ff00000) + return x - x; /* NaN */ + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x, y); + return __kernel_tan(y[0], y[1], 1 - ((n & 1) << 1)); /* 1 -- n even + -1 -- n odd */ + } +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/s_tan.cpp b/libs/MSL_C/Math/Double_precision/s_tan.cpp deleted file mode 100644 index 9542b030cb..0000000000 --- a/libs/MSL_C/Math/Double_precision/s_tan.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/s_tan -// - -#include "MSL_C/Math/Double_precision/s_tan.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void tan(); - -// -// External References: -// - -extern "C" void __ieee754_rem_pio2(); -extern "C" void __kernel_tan(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80456B40-80456B48 005140 0008+00 1/1 0/0 0/0 .sdata2 @58 */ -SECTION_SDATA2 static u8 lit_58[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8036C668-8036C6E0 366FA8 0078+00 0/0 7/7 4/4 .text tan */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void tan() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/s_tan/tan.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_acos.c b/libs/MSL_C/Math/Double_precision/w_acos.c new file mode 100644 index 0000000000..a6c331a101 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_acos.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C6E0-8036C700 367020 0020+00 0/0 2/2 3/3 .text acos */ +double acos(double x) { + return __ieee754_acos(x); +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/w_acos.cpp b/libs/MSL_C/Math/Double_precision/w_acos.cpp deleted file mode 100644 index 7108ae082c..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_acos.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_acos -// - -#include "MSL_C/Math/Double_precision/w_acos.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void acos(); - -// -// External References: -// - -extern "C" void __ieee754_acos(); - -// -// Declarations: -// - -/* 8036C6E0-8036C700 367020 0020+00 0/0 2/2 3/3 .text acos */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void acos() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_acos/acos.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_asin.c b/libs/MSL_C/Math/Double_precision/w_asin.c new file mode 100644 index 0000000000..aa43f56c05 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_asin.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C700-8036C720 367040 0020+00 0/0 2/2 0/0 .text asin */ +double asin(double x) { + return __ieee754_asin(x); +} diff --git a/libs/MSL_C/Math/Double_precision/w_asin.cpp b/libs/MSL_C/Math/Double_precision/w_asin.cpp deleted file mode 100644 index ae7db8510e..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_asin.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_asin -// - -#include "MSL_C/Math/Double_precision/w_asin.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void asin(); - -// -// External References: -// - -extern "C" void __ieee754_asin(); - -// -// Declarations: -// - -/* 8036C700-8036C720 367040 0020+00 0/0 2/2 0/0 .text asin */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void asin() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_asin/asin.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_atan2.c b/libs/MSL_C/Math/Double_precision/w_atan2.c new file mode 100644 index 0000000000..8a2dd2ec73 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_atan2.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C720-8036C740 367060 0020+00 0/0 6/6 0/0 .text atan2 */ +double atan2(double x, double y) { + return __ieee754_atan2(x, y); +} \ No newline at end of file diff --git a/libs/MSL_C/Math/Double_precision/w_atan2.cpp b/libs/MSL_C/Math/Double_precision/w_atan2.cpp deleted file mode 100644 index 4e97e2cfab..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_atan2.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_atan2 -// - -#include "MSL_C/Math/Double_precision/w_atan2.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void atan2(); - -// -// External References: -// - -extern "C" void __ieee754_atan2(); - -// -// Declarations: -// - -/* 8036C720-8036C740 367060 0020+00 0/0 6/6 0/0 .text atan2 */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void atan2() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_atan2/atan2.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_exp.c b/libs/MSL_C/Math/Double_precision/w_exp.c new file mode 100644 index 0000000000..ea32cb9e1e --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_exp.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C740-8036C760 367080 0020+00 0/0 1/1 0/0 .text exp */ +double exp(double x) { + return __ieee754_exp(x); +} diff --git a/libs/MSL_C/Math/Double_precision/w_exp.cpp b/libs/MSL_C/Math/Double_precision/w_exp.cpp deleted file mode 100644 index 13e6c78b57..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_exp.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_exp -// - -#include "MSL_C/Math/Double_precision/w_exp.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void exp(); - -// -// External References: -// - -extern "C" void __ieee754_exp(); - -// -// Declarations: -// - -/* 8036C740-8036C760 367080 0020+00 0/0 1/1 0/0 .text exp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void exp() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_exp/exp.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_fmod.c b/libs/MSL_C/Math/Double_precision/w_fmod.c new file mode 100644 index 0000000000..2d24fd1534 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_fmod.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C760-8036C780 3670A0 0020+00 0/0 8/8 0/0 .text fmod */ +double fmod(double x, double y) { + return __ieee754_fmod(x, y); +} diff --git a/libs/MSL_C/Math/Double_precision/w_fmod.cpp b/libs/MSL_C/Math/Double_precision/w_fmod.cpp deleted file mode 100644 index adf0b076ea..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_fmod.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_fmod -// - -#include "MSL_C/Math/Double_precision/w_fmod.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void fmod(); - -// -// External References: -// - -extern "C" void __ieee754_fmod(); - -// -// Declarations: -// - -/* 8036C760-8036C780 3670A0 0020+00 0/0 8/8 0/0 .text fmod */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void fmod() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_fmod/fmod.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_pow.c b/libs/MSL_C/Math/Double_precision/w_pow.c new file mode 100644 index 0000000000..8dac75e354 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_pow.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036C780-8036C7A0 3670C0 0020+00 0/0 3/3 24/24 .text pow */ +double pow(double x, double y) { + return __ieee754_pow(x, y); +} diff --git a/libs/MSL_C/Math/Double_precision/w_pow.cpp b/libs/MSL_C/Math/Double_precision/w_pow.cpp deleted file mode 100644 index 7d05a7cdec..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_pow.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_pow -// - -#include "MSL_C/Math/Double_precision/w_pow.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void pow(); - -// -// External References: -// - -extern "C" void __ieee754_pow(); - -// -// Declarations: -// - -/* 8036C780-8036C7A0 3670C0 0020+00 0/0 3/3 24/24 .text pow */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void pow() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_pow/pow.s" -} -#pragma pop diff --git a/libs/MSL_C/Math/Double_precision/w_sqrt.c b/libs/MSL_C/Math/Double_precision/w_sqrt.c new file mode 100644 index 0000000000..b455656983 --- /dev/null +++ b/libs/MSL_C/Math/Double_precision/w_sqrt.c @@ -0,0 +1,6 @@ +#include "fdlibm.h" + +/* 8036CA54-8036CA74 367394 0020+00 0/0 8/8 1/1 .text sqrt */ +double sqrt(double x) { + return __ieee754_sqrt(x); +} diff --git a/libs/MSL_C/Math/Double_precision/w_sqrt.cpp b/libs/MSL_C/Math/Double_precision/w_sqrt.cpp deleted file mode 100644 index 64d3d13687..0000000000 --- a/libs/MSL_C/Math/Double_precision/w_sqrt.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: Math/Double_precision/w_sqrt -// - -#include "MSL_C/Math/Double_precision/w_sqrt.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void sqrt(); - -// -// External References: -// - -extern "C" void __ieee754_sqrt(); - -// -// Declarations: -// - -/* 8036CA54-8036CA74 367394 0020+00 0/0 8/8 1/1 .text sqrt */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void sqrt() { - nofralloc -#include "asm/MSL_C/Math/Double_precision/w_sqrt/sqrt.s" -} -#pragma pop diff --git a/libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.cpp b/libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.c similarity index 85% rename from libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.cpp rename to libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.c index 4a39451328..4d4a55a2d7 100644 --- a/libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.cpp +++ b/libs/MSL_C/PPC_EABI/Src/critical_regions.gamecube.c @@ -11,9 +11,9 @@ // Forward References: // -extern "C" void __end_critical_region(); -extern "C" void __begin_critical_region(); -extern "C" void __kill_critical_regions(); +void __end_critical_region(); +void __begin_critical_region(); +void __kill_critical_regions(); // // External References: diff --git a/libs/MSL_C/PPC_EABI/Src/math_ppc.c b/libs/MSL_C/PPC_EABI/Src/math_ppc.c new file mode 100644 index 0000000000..b969b12967 --- /dev/null +++ b/libs/MSL_C/PPC_EABI/Src/math_ppc.c @@ -0,0 +1,42 @@ +// +// Generated By: dol2asm +// Translation Unit: PPC_EABI/Src/math_ppc +// + +#include "MSL_C/PPC_EABI/Src/math_ppc.h" +#include "dol2asm.h" +#include "dolphin/types.h" +#include "fdlibm.h" + +// +// Forward References: +// + +float tanf(float); +float sinf(float); +float cosf(float); +float acosf(float); + +// +// Declarations: +// + +/* 8036C9C4-8036C9E8 367304 0024+00 0/0 2/2 0/0 .text tanf */ +float tanf(float x) { + return tan(x); +} + +/* 8036C9E8-8036CA0C 367328 0024+00 0/0 4/4 0/0 .text sinf */ +float sinf(float x) { + return sin(x); +} + +/* 8036CA0C-8036CA30 36734C 0024+00 0/0 4/4 0/0 .text cosf */ +float cosf(float x) { + return cos(x); +} + +/* 8036CA30-8036CA54 367370 0024+00 0/0 1/1 0/0 .text acosf */ +float acosf(float x) { + return acos(x); +} diff --git a/libs/MSL_C/PPC_EABI/Src/math_ppc.cpp b/libs/MSL_C/PPC_EABI/Src/math_ppc.cpp deleted file mode 100644 index 0341e41502..0000000000 --- a/libs/MSL_C/PPC_EABI/Src/math_ppc.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: PPC_EABI/Src/math_ppc -// - -#include "MSL_C/PPC_EABI/Src/math_ppc.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" void tanf(); -extern "C" void sinf(); -extern "C" void cosf(); -extern "C" void acosf(); - -// -// External References: -// - -extern "C" void cos(); -extern "C" void sin(); -extern "C" void tan(); -extern "C" void acos(); - -// -// Declarations: -// - -/* 8036C9C4-8036C9E8 367304 0024+00 0/0 2/2 0/0 .text tanf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void tanf() { - nofralloc -#include "asm/MSL_C/PPC_EABI/Src/math_ppc/tanf.s" -} -#pragma pop - -/* 8036C9E8-8036CA0C 367328 0024+00 0/0 4/4 0/0 .text sinf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void sinf() { - nofralloc -#include "asm/MSL_C/PPC_EABI/Src/math_ppc/sinf.s" -} -#pragma pop - -/* 8036CA0C-8036CA30 36734C 0024+00 0/0 4/4 0/0 .text cosf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void cosf() { - nofralloc -#include "asm/MSL_C/PPC_EABI/Src/math_ppc/cosf.s" -} -#pragma pop - -/* 8036CA30-8036CA54 367370 0024+00 0/0 1/1 0/0 .text acosf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void acosf() { - nofralloc -#include "asm/MSL_C/PPC_EABI/Src/math_ppc/acosf.s" -} -#pragma pop diff --git a/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c b/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c new file mode 100644 index 0000000000..89458682ff --- /dev/null +++ b/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.c @@ -0,0 +1,61 @@ +// +// Generated By: dol2asm +// Translation Unit: PPC_EABI/Src/uart_console_io_gcn +// + +#include "MSL_C/PPC_EABI/Src/uart_console_io_gcn.h" +#include "dol2asm.h" +#include "dolphin/types.h" + +// +// Forward References: +// + +int __close_console(); +int __write_console(s32 arg0, s32 arg1, s32* arg2, s32 arg3); + +// +// External References: +// + +s32 OSGetConsoleType(void); +s32 InitializeUART(u32); +s32 WriteUARTN(s32, s32); +s32 __TRK_write_console(s32, s32, s32*, s32); + +// +// Declarations: +// + +/* 8036919C-803691A4 363ADC 0008+00 0/0 1/0 0/0 .text __close_console */ +int __close_console() { + return 0; +} + +/* 803691A4-80369274 363AE4 00D0+00 0/0 1/0 0/0 .text __write_console */ +int __write_console(s32 param_0, s32 param_1, s32* param_2, s32 param_3) { + static int initialized; + + if ((OSGetConsoleType() & 0x20000000) == 0) { + int uart_init = 0; + if (initialized == FALSE) { + uart_init = InitializeUART(0xE100); + + if (uart_init == 0) { + initialized = 1; + } + } + + if (uart_init != 0) { + return 1; + } + + if (WriteUARTN(param_1, *param_2) != 0) { + *param_2 = 0; + return 1; + } + } + + __TRK_write_console(param_0, param_1, param_2, param_3); + return 0; +} diff --git a/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.cpp b/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.cpp deleted file mode 100644 index 0309c70886..0000000000 --- a/libs/MSL_C/PPC_EABI/Src/uart_console_io_gcn.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Generated By: dol2asm -// Translation Unit: PPC_EABI/Src/uart_console_io_gcn -// - -#include "MSL_C/PPC_EABI/Src/uart_console_io_gcn.h" -#include "dol2asm.h" -#include "dolphin/types.h" - -// -// Forward References: -// - -extern "C" bool __close_console(); -extern "C" void __write_console(); - -// -// External References: -// - -extern "C" void OSGetConsoleType(); -extern "C" void InitializeUART(); -extern "C" void WriteUARTN(); -extern "C" void __TRK_write_console(); - -// -// Declarations: -// - -/* 8036919C-803691A4 363ADC 0008+00 0/0 1/0 0/0 .text __close_console */ -bool __close_console() { - return false; -} - -/* ############################################################################################## */ -/* 804519B0-804519B8 000EB0 0004+04 1/1 0/0 0/0 .sbss initialized$60 */ -static u8 initialized[4 + 4 /* padding */]; - -/* 803691A4-80369274 363AE4 00D0+00 0/0 1/0 0/0 .text __write_console */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __write_console() { - nofralloc -#include "asm/MSL_C/PPC_EABI/Src/uart_console_io_gcn/__write_console.s" -} -#pragma pop diff --git a/obj_files.mk b/obj_files.mk index e4366a2b99..f6f8c7e2f7 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -3,6 +3,7 @@ # O_FILES := \ + $(BUILD_DIR)/src/__start.o \ $(BUILD_DIR)/src/init.o \ $(BUILD_DIR)/src/unknown_translation_unit.o \ $(BUILD_DIR)/src/m_Do/m_Do_main.o \ diff --git a/src/DynamicLink.cpp b/src/DynamicLink.cpp index ff49957ce1..2f1dda8bd9 100644 --- a/src/DynamicLink.cpp +++ b/src/DynamicLink.cpp @@ -456,7 +456,7 @@ error: */ bool DynamicModuleControl::do_unlink() { OSTime time1 = OSGetTime(); - ((void(*)())mModule->epilog)(); + ((void (*)())mModule->epilog)(); OSTime time2 = OSGetTime(); BOOL unklink = OSUnlink(mModule); OSTime time3 = OSGetTime(); diff --git a/src/__start.c b/src/__start.c new file mode 100644 index 0000000000..2c7a0dc4b4 --- /dev/null +++ b/src/__start.c @@ -0,0 +1,61 @@ +#include "dol2asm.h" +#include "dolphin/types.h" +#include "init.h" + +// +// Forward References: +// + +SECTION_INIT void __check_pad3(); +SECTION_INIT void __set_debug_bba(); +SECTION_INIT u8 __get_debug_bba(); +SECTION_INIT void __start(); + +// +// External References: +// + +void main(); +void OSInit(); +void OSResetSystem(s32, s32, s32); +void __init_user(); +void DBInit(); +void exit(); +void InitMetroTRK(); +void InitMetroTRK_BBA(); +extern u8 data_804516D0; +void __init_data(); +void __init_hardware(); +void __init_registers(); + +// +// Declarations: +// + +/* ############################################################################################## */ +/* 80003100-80003140 000000 0040+00 1/1 0/0 0/0 .init __check_pad3 */ +SECTION_INIT void __check_pad3(void) { + if ((*(u16*)0x800030E4 & 0xEEF) == 0xEEF) { + OSResetSystem(0, 0, 0); + } +} + +/* 80003140-8000314C 000040 000C+00 1/1 0/0 0/0 .init __set_debug_bba */ +void __set_debug_bba(void) { + data_804516D0 = 1; +} + +/* 8000314C-80003154 -00001 0008+00 0/0 0/0 0/0 .init __get_debug_bba */ +SECTION_INIT u8 __get_debug_bba(void) { + return data_804516D0; +} + +/* 80003154-800032B0 000054 015C+00 0/0 1/0 0/0 .init __start */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +SECTION_INIT asm void __start() { + nofralloc +#include "asm/init/__start.s" +} +#pragma pop diff --git a/src/f_pc/f_pc_manager.cpp b/src/f_pc/f_pc_manager.cpp index 7ba8946c34..54c6ce9c4c 100644 --- a/src/f_pc/f_pc_manager.cpp +++ b/src/f_pc/f_pc_manager.cpp @@ -26,9 +26,9 @@ #include "f_pc/f_pc_priority.h" #include "f_pc/f_pc_profile.h" +#include "SSystem/SComponent/c_API_graphic.h" #include "d/com/d_com_inf_game.h" #include "m_Do/m_Do_audio.h" -#include "SSystem/SComponent/c_API_graphic.h" // // Types: diff --git a/src/init.cpp b/src/init.c similarity index 94% rename from src/init.cpp rename to src/init.c index 121b6fa7f0..aa86ff38d1 100644 --- a/src/init.cpp +++ b/src/init.c @@ -7,20 +7,6 @@ #include "dol2asm.h" #include "dolphin/types.h" -// -// Types: -// - -struct daBg_c { - /* 804582B8 */ void createHeap(); -}; - -struct daBgObj_c { - struct spec_data_c { - /* 80459904 */ void Set(void*); - }; -}; - // // Forward References: // @@ -33,75 +19,39 @@ SECTION_INIT void __init_registers(); SECTION_INIT void __init_data(); SECTION_INIT void __init_hardware(); SECTION_INIT void __flush_cache(); -SECTION_INIT void __fill_mem(); -SECTION_INIT void TRK_memset(); -SECTION_INIT void TRK_memcpy(); -extern "C" extern u8 const __TRK_unknown_data[7988]; +SECTION_INIT void __fill_mem(void*, int, u32); +SECTION_INIT void* TRK_memset(void*, int, size_t); +SECTION_INIT void* TRK_memcpy(void* dst, const void* src, size_t n); +extern u8 const __TRK_unknown_data[7988]; SECTION_INIT void __TRK_reset(); -extern "C" extern u8 const _rom_copy_info[132]; -extern "C" extern u8 const _bss_init_info[32]; +extern u8 const _rom_copy_info[132]; +extern u8 const _bss_init_info[32]; // // External References: // -extern "C" void main(); -extern "C" void __OSFPRInit(); -extern "C" void OSInit(); -extern "C" void __OSPSInit(); -extern "C" void __OSCacheInit(); -extern "C" void OSResetSystem(); -extern "C" void __init_user(); -extern "C" void DBInit(); -extern "C" void exit(); -extern "C" void TRK_fill_mem(); -extern "C" void InitMetroTRK(); -extern "C" void InitMetroTRK_BBA(); -extern "C" extern u8 data_804516D0[8]; -extern "C" void _epilog(); -extern "C" void createHeap__6daBg_cFv(); -extern "C" void Set__Q29daBgObj_c11spec_data_cFPv(); +void main(); +void __OSFPRInit(); +void OSInit(); +void __OSPSInit(); +void __OSCacheInit(); +void OSResetSystem(s32, s32, s32); +void __init_user(); +void DBInit(); +void exit(); +void TRK_fill_mem(void* dst, int val, size_t n); +void InitMetroTRK(); +void InitMetroTRK_BBA(); +extern u8 data_804516D0; +void _epilog(); +void createHeap__6daBg_cFv(); +void Set__Q29daBgObj_c11spec_data_cFPv(); // // Declarations: // -/* ############################################################################################## */ -/* 80003100-80003140 000000 0040+00 1/1 0/0 0/0 .init __check_pad3 */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void __check_pad3() { - nofralloc -#include "asm/init/__check_pad3.s" -} -#pragma pop - -/* 80003140-8000314C 000040 000C+00 1/1 0/0 0/0 .init __set_debug_bba */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void __set_debug_bba() { - nofralloc -#include "asm/init/__set_debug_bba.s" -} -#pragma pop - -/* 8000314C-80003154 -00001 0008+00 0/0 0/0 0/0 .init __get_debug_bba */ -SECTION_INIT u8 __get_debug_bba() { - return *(u8*)(&data_804516D0); -} - -/* 80003154-800032B0 000054 015C+00 0/0 1/0 0/0 .init __start */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void __start() { - nofralloc -#include "asm/init/__start.s" -} -#pragma pop - extern void* _stack_end; extern void* _SDA2_BASE_; extern void* _SDA_BASE_; @@ -147,54 +97,109 @@ SECTION_INIT asm void __flush_cache() { #pragma pop /* 80003458-80003488 000358 0030+00 1/1 55/55 137/137 .init memset */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void* memset(void*, int, u32) { - nofralloc -#include "asm/init/memset.s" +SECTION_INIT void* memset(void* dst, int val, size_t n) { + __fill_mem(dst, val, n); + + return dst; } -#pragma pop /* 80003488-80003540 000388 00B8+00 1/1 0/0 0/0 .init __fill_mem */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void __fill_mem() { - nofralloc -#include "asm/init/__fill_mem.s" +SECTION_INIT void __fill_mem(void* dst, int val, size_t n) { + unsigned long v = (unsigned char)val; + unsigned long i; + + ((unsigned char*)dst) = ((unsigned char*)dst) - 1; + + if (n >= 32) { + i = (~(unsigned long)dst) & 3; + + if (i) { + n -= i; + + do { + *++(((unsigned char*)dst)) = v; + } while (--i); + } + + if (v) + v |= v << 24 | v << 16 | v << 8; + + ((unsigned long*)dst) = ((unsigned long*)(((unsigned char*)dst) + 1)) - 1; + + i = n >> 5; + + if (i) { + do { + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + *++((unsigned long*)dst) = v; + } while (--i); + } + + i = (n & 31) >> 2; + + if (i) { + do { + *++((unsigned long*)dst) = v; + } while (--i); + } + + ((unsigned char*)dst) = ((unsigned char*)(((unsigned long*)dst) + 1)) - 1; + + n &= 3; + } + + if (n) + do { + *++((unsigned char*)dst) = v; + } while (--n); + + return; } -#pragma pop /* 80003540-80003590 000440 0050+00 1/1 63/63 6/6 .init memcpy */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void* memcpy(void*, const void*, s32) { - nofralloc -#include "asm/init/memcpy.s" +SECTION_INIT void* memcpy(void* dst, const void* src, size_t n) { + const unsigned char* s; + unsigned char* d; + + if ((unsigned long)src >= (unsigned long)dst) { + s = (const unsigned char*)src - 1; + d = (unsigned char*)dst - 1; + n++; + while (--n != 0) + *++d = *++s; + } else { + s = (const unsigned char*)src + n; + d = (unsigned char*)dst + n; + n++; + while (--n != 0) + *--d = *--s; + } + return dst; } -#pragma pop /* 80003590-800035C0 000490 0030+00 0/0 1/1 0/0 .init TRK_memset */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void TRK_memset() { - nofralloc -#include "asm/init/TRK_memset.s" +SECTION_INIT void* TRK_memset(void* dst, int val, size_t n) { + TRK_fill_mem(dst, val, n); + + return dst; } -#pragma pop /* 800035C0-800035E4 0004C0 0024+00 0/0 12/12 0/0 .init TRK_memcpy */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void TRK_memcpy() { - nofralloc -#include "asm/init/TRK_memcpy.s" +SECTION_INIT void* TRK_memcpy(void* dst, const void* src, size_t n) { + const unsigned char* s = (const unsigned char*)src - 1; + unsigned char* d = (unsigned char*)dst - 1; + + n++; + while (--n != 0) + *++d = *++s; + return dst; } -#pragma pop /* 800035E4-80005518 0004E4 1F34+00 0/0 1/1 0/0 .init __TRK_unknown_data */ SECTION_INIT extern u8 const __TRK_unknown_data[7988] = { @@ -701,14 +706,9 @@ SECTION_INIT extern u8 const __TRK_unknown_data[7988] = { }; /* 80005518-80005544 002418 002C+00 0/0 1/1 0/0 .init __TRK_reset */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -SECTION_INIT asm void __TRK_reset() { - nofralloc -#include "asm/init/__TRK_reset.s" +SECTION_INIT void __TRK_reset() { + OSResetSystem(0, 0, 0); } -#pragma pop /* 80005544-800055C8 002444 0084+00 1/1 0/0 0/0 .init _rom_copy_info */ /* generated by the linker */ diff --git a/tools/tp.py b/tools/tp.py index 00c536402d..bbe581f3a7 100644 --- a/tools/tp.py +++ b/tools/tp.py @@ -921,8 +921,8 @@ def find_all_header_files(): return files -def find_all_cpp_files(): - """Recursivly find all files in the 'cpp/' folder""" +def find_all_files(): + """Recursively find all c/cpp files in '/src/', '/libs/', and '/rel/' """ files = set() @@ -938,7 +938,7 @@ def find_all_cpp_files(): if path.is_dir(): recursive(path) else: - if path.suffix == ".cpp": + if path.suffix == ".cpp" or path.suffix == ".c": files.add(path) src_root = Path("./src/") @@ -952,7 +952,7 @@ def find_all_cpp_files(): recursive(libs_root) recursive(rel_root) - LOG.debug(f"find_all_cpp_files: found {len(files)} .cpp files") + LOG.debug(f"find_all_files: found {len(files)} .c/.cpp files") return files @@ -978,7 +978,7 @@ def find_includes(lines, non_matching, ext=".s"): def find_used_asm_files(non_matching, use_progress_bar=True): - cpp_files = find_all_cpp_files() + cpp_files = find_all_files() includes = set() if use_progress_bar: