From f283773c7a1ab6669008afe73b4a2eb777bf7c2e Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Sat, 16 Mar 2024 01:58:27 -0600 Subject: [PATCH] Switch from tonccpy to ASM memcpy --- hb/dldi/Makefile | 5 +- hb/dldi/include/aeabi.h | 116 +++ .../bootloader => hb/dldi}/include/asminc.h | 11 +- hb/dldi/include/macros.inc | 39 + hb/dldi/source/abi_memcpy.s | 126 +++ hb/dldi/source/iointerface.c | 20 +- hb/dldi/source/memcpy.c | 83 -- hb/sdengine/Makefile | 5 +- hb/sdengine/include/aeabi.h | 116 +++ .../sdengine}/include/asminc.h | 11 +- hb/sdengine/include/macros.inc | 39 + hb/sdengine/source/abi_memcpy.s | 126 +++ hb/sdengine/source/sdmmcEngine.c | 10 +- hb/sdengine_alt/Makefile | 5 +- retail/arm9/mbedtls/bignum.c | 33 +- retail/arm9/source/conf_sd.cpp | 87 +- retail/arm9/source/lzss.c | 1 - retail/arm9/source/nand/crypto.c | 33 +- retail/arm9/source/nand/nandio.c | 8 +- retail/arm9/source/nds_loader_arm9.c | 8 +- retail/arm9/source/nitrofs.c | 4 +- retail/arm9/source/text.cpp | 6 +- retail/arm9/source/twltool/dsi.c | 39 +- retail/bootloader/Makefile | 2 +- retail/bootloader/source/arm7/booter.arm7.s | 2 +- retail/bootloader/source/arm7/decompress.c | 12 +- retail/bootloader/source/arm7/dldi_patcher.c | 12 +- .../bootloader/source/arm7/dsi2ds_patches.c | 858 ++++++++--------- retail/bootloader/source/arm7/hook_arm7.c | 6 +- retail/bootloader/source/arm7/ips.c | 6 +- retail/bootloader/source/arm7/main.arm7.c | 126 +-- retail/bootloader/source/arm7/patch_arm7.c | 19 +- retail/bootloader/source/arm7/patch_arm9.c | 72 +- retail/bootloader/source/arm7/patch_common.c | 26 +- .../arm7/save_patches/save_patch_universal.c | 12 +- .../source/arm7/save_patches/save_patch_v5.c | 12 +- .../bootloader/source/arm9/clear_cache.arm9.s | 2 +- retail/bootloader2/Makefile | 2 +- retail/bootloaderi/Makefile | 2 +- retail/bootloaderi/source/arm7/booter.arm7.s | 2 +- retail/bootloaderi/source/arm7/decompress.c | 12 +- retail/bootloaderi/source/arm7/dldi_patcher.c | 8 +- retail/bootloaderi/source/arm7/hook_arm7.c | 6 +- retail/bootloaderi/source/arm7/ips.c | 6 +- retail/bootloaderi/source/arm7/main.arm7.c | 199 ++-- retail/bootloaderi/source/arm7/patch_arm7.c | 41 +- retail/bootloaderi/source/arm7/patch_arm9.c | 72 +- retail/bootloaderi/source/arm7/patch_common.c | 884 +++++++++--------- .../arm7/save_patches/save_patch_universal.c | 12 +- .../source/arm7/save_patches/save_patch_v5.c | 12 +- .../source/arm9/clear_cache.arm9.s | 2 +- retail/bootloaderi2/Makefile | 2 +- retail/cardengine/arm7/Makefile | 2 +- retail/cardengine/arm7/source/cardengine.c | 18 +- retail/cardengine/arm7/source/inGameMenu.c | 6 +- retail/cardengine/arm7_music/Makefile | 2 +- retail/cardengine/arm9/source/cardengine.c | 90 +- retail/cardengine/arm9/source/dldi_patcher.c | 8 +- retail/cardenginei/arm7/source/cardengine.c | 79 +- retail/cardenginei/arm7/source/inGameMenu.c | 6 +- .../arm7/source/patcher/decompress.c | 1 - .../arm7/source/patcher/patch_arm7.c | 16 +- .../arm7/source/patcher/patch_arm9.c | 18 +- .../source/patcher/save_patch_universal.c | 12 +- .../arm7/source/patcher/save_patch_v5.c | 12 +- .../arm7_dsiware/source/cardengine.c | 36 +- .../arm7_dsiware/source/inGameMenu.c | 6 +- .../arm7_twlsdk/source_ext/dldi_patcher.c | 8 +- .../cardenginei/arm9/source/cardDma.thumb.c | 1 - retail/cardenginei/arm9/source/cardengine.c | 56 +- retail/cardenginei/arm9/source/misc.c | 14 +- retail/cardenginei/arm9/source/my_fat.thumb.c | 12 +- .../arm9_dsiware/source/cardengine.c | 14 +- .../cardenginei/arm9_igm/source/exception.c | 4 +- .../cardenginei/arm9_igm/source/inGameMenu.c | 42 +- retail/common/include/aeabi.h | 116 +++ retail/common/include/asminc.h | 28 + retail/common/include/macros.inc | 39 + retail/common/include/tonccpy.h | 43 - retail/common/source/my_fat.c | 22 +- retail/common/source_general/abi_memcpy.s | 126 +++ retail/common/source_general/abi_memset.s | 123 +++ retail/common/source_general/tonccpy.c | 139 --- 83 files changed, 2612 insertions(+), 1847 deletions(-) create mode 100644 hb/dldi/include/aeabi.h rename {retail/bootloader => hb/dldi}/include/asminc.h (63%) create mode 100644 hb/dldi/include/macros.inc create mode 100644 hb/dldi/source/abi_memcpy.s delete mode 100644 hb/dldi/source/memcpy.c create mode 100644 hb/sdengine/include/aeabi.h rename {retail/bootloaderi => hb/sdengine}/include/asminc.h (63%) create mode 100644 hb/sdengine/include/macros.inc create mode 100644 hb/sdengine/source/abi_memcpy.s create mode 100644 retail/common/include/aeabi.h create mode 100644 retail/common/include/asminc.h create mode 100644 retail/common/include/macros.inc delete mode 100644 retail/common/include/tonccpy.h create mode 100644 retail/common/source_general/abi_memcpy.s create mode 100644 retail/common/source_general/abi_memset.s delete mode 100644 retail/common/source_general/tonccpy.c diff --git a/hb/dldi/Makefile b/hb/dldi/Makefile index 9d243eb55..70981c21c 100644 --- a/hb/dldi/Makefile +++ b/hb/dldi/Makefile @@ -26,11 +26,12 @@ INCLUDES := include ../common/include #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb -mthumb-interwork -march=armv4t +ARCH := -mthumb -march=armv4t COMMON := -g -Wall -O2\ -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ -ffast-math \ + -flto \ $(ARCH) # ADD -DDEBUG here for logging/debug @@ -39,7 +40,7 @@ COMMON += $(INCLUDE) -DARM9 -fPIC CFLAGS := $(COMMON) -std=gnu99 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) $(INCLUDE) +ASFLAGS := -g $(ARCH) -flto $(INCLUDE) LDFLAGS = -nostartfiles -nostdlib -T ../dldi.ld -g $(ARCH) -Wl,-Map,$(TARGET).map LIBS := -lnds9 diff --git a/hb/dldi/include/aeabi.h b/hb/dldi/include/aeabi.h new file mode 100644 index 000000000..7de05c0b9 --- /dev/null +++ b/hb/dldi/include/aeabi.h @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors + +#ifndef AEABI_H__ +#define AEABI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * Alias of __aeabi_memcpy4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy8(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy4(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memmove4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove8(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove4(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memset4 + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset8(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset4(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Alias of __aeabi_memclr4 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr8(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr4(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr(void* dest, size_t n) __attribute__((nonnull(1))); + +#ifdef __cplusplus +} +#endif + +#endif // AEABI_H__ diff --git a/retail/bootloader/include/asminc.h b/hb/dldi/include/asminc.h similarity index 63% rename from retail/bootloader/include/asminc.h rename to hb/dldi/include/asminc.h index 4cbfd161e..efa52df39 100644 --- a/retail/bootloader/include/asminc.h +++ b/hb/dldi/include/asminc.h @@ -2,8 +2,8 @@ #define _ASMINC_H_ #if !__ASSEMBLER__ - #error This header file is only for use in assembly files! -#endif // !__ASSEMBLER__ +# error "This header file is only for use in assembly files!" +#endif .macro BEGIN_ASM_FUNC name section=text @@ -14,6 +14,13 @@ \name: .endm +.macro BEGIN_ASM_FUNC_NO_SECTION name + .global \name + .type \name, %function + .align 2 +\name: +.endm + #define ICACHE_SIZE 0x2000 #define DCACHE_SIZE 0x1000 #define CACHE_LINE_SIZE 32 diff --git a/hb/dldi/include/macros.inc b/hb/dldi/include/macros.inc new file mode 100644 index 000000000..a4a459a48 --- /dev/null +++ b/hb/dldi/include/macros.inc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ARM assembly support macros + +@ Shift and test upper two bits, clobbering \reg +@ Use mi for first bit, cs for second bit +.macro joaobapt_test_lsl reg shift = #0 + movs \reg, \reg, lsl \shift +.endm + +@ Test lowest two bits, clobbering \reg +@ Use mi for low bit, cs for high bit +.macro joaobapt_test reg + joaobapt_test_lsl \reg, #31 +.endm + +@ Test lowest two bits of \src, result stored in \dst +@ Use mi for low bit, cs for high bit +.macro joaobapt_test_into dst, src + movs \dst, \src, lsl #31 +.endm + +@ Branches depending on lowest two bits, clobbering \reg +@ b_mi = low bit case, b_cs = high bit case +.macro joaobapt_switch reg, b_mi, b_cs + joaobapt_test \reg + bmi \b_mi + bcs \b_cs +.endm + +@ Branches depending on alignment of \a and \b, clobbering \scratch +@ b_byte = off-by-byte case, b_half = off-by-half case +.macro align_switch a, b, scratch, b_byte, b_half + eor \scratch, \a, \b + joaobapt_switch \scratch, \b_byte, \b_half +.endm diff --git a/hb/dldi/source/abi_memcpy.s b/hb/dldi/source/abi_memcpy.s new file mode 100644 index 000000000..53854eb6f --- /dev/null +++ b/hb/dldi/source/abi_memcpy.s @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ABI: +// __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8 +// Standard: +// memcpy +// Support: +// __ndsabi_memcpy2, __ndsabi_memcpy1 + +#include "asminc.h" + +#include "macros.inc" + + .syntax unified + + .arm + + + +BEGIN_ASM_FUNC __aeabi_memcpy + + @ >6-bytes is roughly the threshold when byte-by-byte copy is slower + cmp r2, #6 + ble __ndsabi_memcpy1 + + align_switch r0, r1, r3, __ndsabi_memcpy1, .Lcopy_halves + + @ Check if r0 (or r1) needs word aligning + rsbs r3, r0, #4 + joaobapt_test r3 + + @ Copy byte head to align + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + submi r2, r2, #1 + @ r0, r1 are now half aligned + + @ Copy half head to align + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + subcs r2, r2, #2 + @ r0, r1 are now word aligned + + +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy8 +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy4 + + cmp r2, #32 + blt .Lcopy_words + + @ Word aligned, 32-byte copy + push {r4-r10} +.Lloop_32: + subs r2, r2, #32 + ldmiage r1!, {r3-r10} + stmiage r0!, {r3-r10} + bgt .Lloop_32 + pop {r4-r10} + bxeq lr + + @ < 32 bytes remaining to be copied + add r2, r2, #32 + +.Lcopy_words: + cmp r2, #4 + blt .Lcopy_halves +.Lloop_4: + subs r2, r2, #4 + ldrge r3, [r1], #4 + strge r3, [r0], #4 + bgt .Lloop_4 + bxeq lr + + @ Copy byte & half tail + @ This test still works when r2 is negative + joaobapt_test r2 + @ Copy half + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + @ Copy byte + ldrbmi r3, [r1] + strbmi r3, [r0] + bx lr + +.Lcopy_halves: + @ Copy byte head to align + tst r0, #1 + ldrbne r3, [r1], #1 + strbne r3, [r0], #1 + subne r2, r2, #1 + @ r0, r1 are now half aligned + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy2 + + subs r2, r2, #2 + ldrhge r3, [r1], #2 + strhge r3, [r0], #2 + bgt __ndsabi_memcpy2 + bxeq lr + + @ Copy byte tail + adds r2, r2, #2 + ldrbne r3, [r1] + strbne r3, [r0] + bx lr + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy1 + + subs r2, r2, #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + bgt __ndsabi_memcpy1 + bx lr + + +BEGIN_ASM_FUNC memcpy + + push {r0, lr} + bl __aeabi_memcpy + pop {r0, lr} + bx lr diff --git a/hb/dldi/source/iointerface.c b/hb/dldi/source/iointerface.c index bb77140f9..1d1129eb0 100644 --- a/hb/dldi/source/iointerface.c +++ b/hb/dldi/source/iointerface.c @@ -42,8 +42,8 @@ #include #include #include "my_sdmmc.h" -#include "tonccpy.h" #include "locations.h" +#include "aeabi.h" extern char ioType[4]; extern u32 dataStartOffset; @@ -106,7 +106,7 @@ static inline void sendValue32(u32 value32) { static inline void sendMsg(int size, u8* msg) { //nocashMessage("sendMsg"); *(vu32*)(word_command_offset+4) = (vu32)size; - tonccpy((u8*)word_command_offset+8, msg, size); + __aeabi_memcpy((u8*)word_command_offset+8, msg, size); *(vu32*)word_command_offset = (vu32)0x027FEE05; IPC_SendSync(0xEE24); } @@ -187,7 +187,7 @@ bool sd_ReadSectors(sec_t sector, sec_t numSectors,void* buffer) { result = getValue32(); - tonccpy(buffer+numreads*512, (u32*)mybuffer, readsectors*512); + __aeabi_memcpy(buffer+numreads*512, (u32*)mybuffer, readsectors*512); } /*sec_t alignedSector = (sector/cacheBlockSectors)*cacheBlockSectors; @@ -221,7 +221,7 @@ bool sd_ReadSectors(sec_t sector, sec_t numSectors,void* buffer) { len2 = alignedSector - sector + cacheBlockSectors; } - tonccpy(buffer, (u8*)cacheBuffer+((sector-alignedSector)*BYTES_PER_READ), len2*BYTES_PER_READ); + __aeabi_memcpy(buffer, (u8*)cacheBuffer+((sector-alignedSector)*BYTES_PER_READ), len2*BYTES_PER_READ); numSectors -= len2; if (numSectors > 0) { sector += len2; @@ -251,7 +251,7 @@ bool sd_WriteSectors(sec_t sector, sec_t numSectors,void* buffer) { vu32* mybuffer = (vu32*)((u32)tmp_buf_addr + (dsiMode ? 0x0A000000 : 0x00400000)); - tonccpy((u32*)mybuffer, buffer+numreads*512, readsectors*512); + __aeabi_memcpy((u32*)mybuffer, buffer+numreads*512, readsectors*512); msg.type = SDMMC_SD_WRITE_SECTORS; msg.sdParams.startsector = startsector; @@ -296,7 +296,7 @@ bool sd_WriteSectors(sec_t sector, sec_t numSectors,void* buffer) { len2 = alignedSector - sector + cacheBlockSectors; } - tonccpy((u8*)cacheBuffer+((sector-alignedSector)*BYTES_PER_READ), buffer, len2*BYTES_PER_READ); + __aeabi_memcpy((u8*)cacheBuffer+((sector-alignedSector)*BYTES_PER_READ), buffer, len2*BYTES_PER_READ); msg.type = SDMMC_SD_WRITE_SECTORS; msg.sdParams.startsector = alignedSector; @@ -329,7 +329,7 @@ bool ramDisk = false; bool ramd_ReadSectors(u32 sector, u32 numSectors, void* buffer) { //--------------------------------------------------------------------------------- if (dsiMode) { - tonccpy(buffer, (void*)RAM_DISK_LOCATION_DSIMODE+(sector << 9), numSectors << 9); + __aeabi_memcpy(buffer, (void*)RAM_DISK_LOCATION_DSIMODE+(sector << 9), numSectors << 9); } else { if (buffer >= (void*)0x02C00000 && buffer < (void*)0x03000000) { buffer -= 0xC00000; // Move out of RAM disk location @@ -340,7 +340,7 @@ bool ramd_ReadSectors(u32 sector, u32 numSectors, void* buffer) { } if (!isArm7) extendedMemory(true); // Enable extended memory mode to access RAM drive - tonccpy(buffer, (void*)RAM_DISK_LOCATION+(sector << 9), numSectors << 9); + __aeabi_memcpy(buffer, (void*)RAM_DISK_LOCATION+(sector << 9), numSectors << 9); if (!isArm7) extendedMemory(false); // Disable extended memory mode } return true; @@ -350,7 +350,7 @@ bool ramd_ReadSectors(u32 sector, u32 numSectors, void* buffer) { bool ramd_WriteSectors(u32 sector, u32 numSectors, void* buffer) { //--------------------------------------------------------------------------------- if (dsiMode) { - tonccpy((void*)RAM_DISK_LOCATION_DSIMODE+(sector << 9), buffer, numSectors << 9); + __aeabi_memcpy((void*)RAM_DISK_LOCATION_DSIMODE+(sector << 9), buffer, numSectors << 9); } else { if (buffer >= (void*)0x02C00000 && buffer < (void*)0x03000000) { buffer -= 0xC00000; // Move out of RAM disk location @@ -361,7 +361,7 @@ bool ramd_WriteSectors(u32 sector, u32 numSectors, void* buffer) { } if (!isArm7) extendedMemory(true); // Enable extended memory mode to access RAM drive - tonccpy((void*)RAM_DISK_LOCATION+(sector << 9), buffer, numSectors << 9); + __aeabi_memcpy((void*)RAM_DISK_LOCATION+(sector << 9), buffer, numSectors << 9); if (!isArm7) extendedMemory(false); // Disable extended memory mode } return true; diff --git a/hb/dldi/source/memcpy.c b/hb/dldi/source/memcpy.c deleted file mode 100644 index 143e9eb21..000000000 --- a/hb/dldi/source/memcpy.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -FUNCTION - <>---copy memory regions -ANSI_SYNOPSIS - #include - void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - void *memcpy(<[out]>, <[in]>, <[n]> - void *<[out]>; - void *<[in]>; - size_t <[n]>; -DESCRIPTION - This function copies <[n]> bytes from the memory region - pointed to by <[in]> to the memory region pointed to by - <[out]>. - If the regions overlap, the behavior is undefined. -RETURNS - <> returns a pointer to the first byte of the <[out]> - region. -PORTABILITY -<> is ANSI C. -<> requires no supporting OS subroutines. -QUICKREF - memcpy ansi pure - */ - -/* Nonzero if either X or Y is not aligned on a "long" boundary. */ -#define UNALIGNED(X, Y) \ - (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) -/* How many bytes are copied each iteration of the 4X unrolled loop. */ -#define BIGBLOCKSIZE (sizeof (long) << 2) -/* How many bytes are copied each iteration of the word copy loop. */ -#define LITTLEBLOCKSIZE (sizeof (long)) -/* Threshhold for punting to the byte copier. */ -#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) - -void* memcpy(const void * src0, void * dst0, int len0) -{ -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) - char *dst = (char *) dst0; - char *src = (char *) src0; - void *save = dst0; - while (len0--) - { - *dst++ = *src++; - } - return save; -#else - char *dst = dst0; - const char *src = src0; - long *aligned_dst; - const long *aligned_src; - /* If the size is small, or either SRC or DST is unaligned, - then punt into the byte copy loop. This should be rare. */ - if (!TOO_SMALL(len0) && !UNALIGNED (src, dst)) - { - aligned_dst = (long*)dst; - aligned_src = (long*)src; - /* Copy 4X long words at a time if possible. */ - while (len0 >= BIGBLOCKSIZE) - { - *aligned_dst++ = *aligned_src++; - *aligned_dst++ = *aligned_src++; - *aligned_dst++ = *aligned_src++; - *aligned_dst++ = *aligned_src++; - len0 -= BIGBLOCKSIZE; - } - /* Copy one long word at a time if possible. */ - while (len0 >= LITTLEBLOCKSIZE) - { - *aligned_dst++ = *aligned_src++; - len0 -= LITTLEBLOCKSIZE; - } - /* Pick up any residual with a byte copier. */ - dst = (char*)aligned_dst; - src = (char*)aligned_src; - } - while (len0--) - *dst++ = *src++; - return dst0; -#endif /* not PREFER_SIZE_OVER_SPEED */ -} diff --git a/hb/sdengine/Makefile b/hb/sdengine/Makefile index 01dba641c..72065454c 100644 --- a/hb/sdengine/Makefile +++ b/hb/sdengine/Makefile @@ -31,6 +31,7 @@ ARCH := -mthumb-interwork -march=armv4t COMMON := -g -Wall -O2\ -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ -ffast-math \ + -flto \ $(ARCH) # ADD -DDEBUG here for logging/debug @@ -39,8 +40,8 @@ COMMON += $(INCLUDE) -DARM7 -D_NO_FAT CFLAGS := $(COMMON) -std=gnu99 CXXFLAGS := $(COMMON) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) $(INCLUDE) -LDFLAGS = -nostartfiles -T ../sdengine.ld -g $(ARCH) -Wl,-Map,$(TARGET).map +ASFLAGS := -g $(ARCH) -flto $(INCLUDE) +LDFLAGS = -nostartfiles -nostdlib -T ../sdengine.ld -g $(ARCH) -Wl,-Map,$(TARGET).map LIBS := diff --git a/hb/sdengine/include/aeabi.h b/hb/sdengine/include/aeabi.h new file mode 100644 index 000000000..7de05c0b9 --- /dev/null +++ b/hb/sdengine/include/aeabi.h @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors + +#ifndef AEABI_H__ +#define AEABI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * Alias of __aeabi_memcpy4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy8(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy4(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memmove4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove8(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove4(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memset4 + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset8(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset4(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Alias of __aeabi_memclr4 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr8(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr4(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr(void* dest, size_t n) __attribute__((nonnull(1))); + +#ifdef __cplusplus +} +#endif + +#endif // AEABI_H__ diff --git a/retail/bootloaderi/include/asminc.h b/hb/sdengine/include/asminc.h similarity index 63% rename from retail/bootloaderi/include/asminc.h rename to hb/sdengine/include/asminc.h index 4cbfd161e..efa52df39 100644 --- a/retail/bootloaderi/include/asminc.h +++ b/hb/sdengine/include/asminc.h @@ -2,8 +2,8 @@ #define _ASMINC_H_ #if !__ASSEMBLER__ - #error This header file is only for use in assembly files! -#endif // !__ASSEMBLER__ +# error "This header file is only for use in assembly files!" +#endif .macro BEGIN_ASM_FUNC name section=text @@ -14,6 +14,13 @@ \name: .endm +.macro BEGIN_ASM_FUNC_NO_SECTION name + .global \name + .type \name, %function + .align 2 +\name: +.endm + #define ICACHE_SIZE 0x2000 #define DCACHE_SIZE 0x1000 #define CACHE_LINE_SIZE 32 diff --git a/hb/sdengine/include/macros.inc b/hb/sdengine/include/macros.inc new file mode 100644 index 000000000..a4a459a48 --- /dev/null +++ b/hb/sdengine/include/macros.inc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ARM assembly support macros + +@ Shift and test upper two bits, clobbering \reg +@ Use mi for first bit, cs for second bit +.macro joaobapt_test_lsl reg shift = #0 + movs \reg, \reg, lsl \shift +.endm + +@ Test lowest two bits, clobbering \reg +@ Use mi for low bit, cs for high bit +.macro joaobapt_test reg + joaobapt_test_lsl \reg, #31 +.endm + +@ Test lowest two bits of \src, result stored in \dst +@ Use mi for low bit, cs for high bit +.macro joaobapt_test_into dst, src + movs \dst, \src, lsl #31 +.endm + +@ Branches depending on lowest two bits, clobbering \reg +@ b_mi = low bit case, b_cs = high bit case +.macro joaobapt_switch reg, b_mi, b_cs + joaobapt_test \reg + bmi \b_mi + bcs \b_cs +.endm + +@ Branches depending on alignment of \a and \b, clobbering \scratch +@ b_byte = off-by-byte case, b_half = off-by-half case +.macro align_switch a, b, scratch, b_byte, b_half + eor \scratch, \a, \b + joaobapt_switch \scratch, \b_byte, \b_half +.endm diff --git a/hb/sdengine/source/abi_memcpy.s b/hb/sdengine/source/abi_memcpy.s new file mode 100644 index 000000000..53854eb6f --- /dev/null +++ b/hb/sdengine/source/abi_memcpy.s @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ABI: +// __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8 +// Standard: +// memcpy +// Support: +// __ndsabi_memcpy2, __ndsabi_memcpy1 + +#include "asminc.h" + +#include "macros.inc" + + .syntax unified + + .arm + + + +BEGIN_ASM_FUNC __aeabi_memcpy + + @ >6-bytes is roughly the threshold when byte-by-byte copy is slower + cmp r2, #6 + ble __ndsabi_memcpy1 + + align_switch r0, r1, r3, __ndsabi_memcpy1, .Lcopy_halves + + @ Check if r0 (or r1) needs word aligning + rsbs r3, r0, #4 + joaobapt_test r3 + + @ Copy byte head to align + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + submi r2, r2, #1 + @ r0, r1 are now half aligned + + @ Copy half head to align + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + subcs r2, r2, #2 + @ r0, r1 are now word aligned + + +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy8 +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy4 + + cmp r2, #32 + blt .Lcopy_words + + @ Word aligned, 32-byte copy + push {r4-r10} +.Lloop_32: + subs r2, r2, #32 + ldmiage r1!, {r3-r10} + stmiage r0!, {r3-r10} + bgt .Lloop_32 + pop {r4-r10} + bxeq lr + + @ < 32 bytes remaining to be copied + add r2, r2, #32 + +.Lcopy_words: + cmp r2, #4 + blt .Lcopy_halves +.Lloop_4: + subs r2, r2, #4 + ldrge r3, [r1], #4 + strge r3, [r0], #4 + bgt .Lloop_4 + bxeq lr + + @ Copy byte & half tail + @ This test still works when r2 is negative + joaobapt_test r2 + @ Copy half + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + @ Copy byte + ldrbmi r3, [r1] + strbmi r3, [r0] + bx lr + +.Lcopy_halves: + @ Copy byte head to align + tst r0, #1 + ldrbne r3, [r1], #1 + strbne r3, [r0], #1 + subne r2, r2, #1 + @ r0, r1 are now half aligned + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy2 + + subs r2, r2, #2 + ldrhge r3, [r1], #2 + strhge r3, [r0], #2 + bgt __ndsabi_memcpy2 + bxeq lr + + @ Copy byte tail + adds r2, r2, #2 + ldrbne r3, [r1] + strbne r3, [r0] + bx lr + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy1 + + subs r2, r2, #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + bgt __ndsabi_memcpy1 + bx lr + + +BEGIN_ASM_FUNC memcpy + + push {r0, lr} + bl __aeabi_memcpy + pop {r0, lr} + bx lr diff --git a/hb/sdengine/source/sdmmcEngine.c b/hb/sdengine/source/sdmmcEngine.c index e10d0ce72..d4d2b3e03 100644 --- a/hb/sdengine/source/sdmmcEngine.c +++ b/hb/sdengine/source/sdmmcEngine.c @@ -22,7 +22,7 @@ #include #include #include -#include "tonccpy.h" +#include "aeabi.h" #include "my_sdmmc.h" #include "sdmmcEngine.h" //#include "i2c.h" @@ -48,7 +48,7 @@ static int cardEgnineCommandMutex = 0; /*static int softResetTimer = 0; static void unlaunchSetHiyaBoot(void) { - tonccpy((u8*)0x02000800, unlaunchAutoLoadID, 12); + __aeabi_memcpy((u8*)0x02000800, unlaunchAutoLoadID, 12); *(u16*)(0x0200080C) = 0x3F0; // Unlaunch Length for CRC16 (fixed, must be 3F0h) *(u16*)(0x0200080E) = 0; // Unlaunch CRC16 (empty) *(u32*)(0x02000810) |= BIT(0); // Load the title at 2000838h @@ -73,7 +73,7 @@ static void sendValue32(vu32 value32) { } static inline void getDatamsg(int size, u8* msg) { - tonccpy(msg, (u8*)commandAddr+8, size); + __aeabi_memcpy(msg, (u8*)commandAddr+8, size); } //--------------------------------------------------------------------------------- @@ -197,7 +197,7 @@ void myIrqHandler(void) { //if (consoleModel < 2) { unlaunchSetHiyaBoot(); //} - tonccpy((u32*)0x02000300, sr_data_srloader, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x020); i2cWriteRegister(0x4A, 0x70, 0x01); i2cWriteRegister(0x4A, 0x11, 0x01); // Reboot into TWiLight Menu++ } @@ -210,7 +210,7 @@ void myIrqHandler(void) { //if (consoleModel < 2) { unlaunchSetHiyaBoot(); //} - tonccpy((u32*)0x02000300, sr_data_srllastran, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_srllastran, 0x020); i2cWriteRegister(0x4A, 0x70, 0x01); i2cWriteRegister(0x4A, 0x11, 0x01); // Reboot game }*/ diff --git a/hb/sdengine_alt/Makefile b/hb/sdengine_alt/Makefile index 5bb1bddd5..a5ff905c0 100644 --- a/hb/sdengine_alt/Makefile +++ b/hb/sdengine_alt/Makefile @@ -31,6 +31,7 @@ ARCH := -mthumb-interwork -march=armv4t COMMON := -g -Wall -O2\ -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ -ffast-math \ + -flto \ $(ARCH) # ADD -DDEBUG here for logging/debug @@ -39,8 +40,8 @@ COMMON += $(INCLUDE) -DARM7 -D_NO_FAT CFLAGS := $(COMMON) -std=gnu99 CXXFLAGS := $(COMMON) -fno-rtti -fno-exceptions -ASFLAGS := -g $(ARCH) $(INCLUDE) -LDFLAGS = -nostartfiles -T ../sdengine.ld -g $(ARCH) -Wl,-Map,$(TARGET).map +ASFLAGS := -g $(ARCH) -flto $(INCLUDE) +LDFLAGS = -nostartfiles -nostdlib -T ../sdengine.ld -g $(ARCH) -Wl,-Map,$(TARGET).map LIBS := diff --git a/retail/arm9/mbedtls/bignum.c b/retail/arm9/mbedtls/bignum.c index 76a5e49c7..0b5987fa4 100644 --- a/retail/arm9/mbedtls/bignum.c +++ b/retail/arm9/mbedtls/bignum.c @@ -47,6 +47,7 @@ #include "bn_mul.h" #include +#include "aeabi.h" #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" @@ -125,7 +126,7 @@ int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs ) if( X->p != NULL ) { - memcpy( p, X->p, X->n * ciL ); + __aeabi_memcpy( p, X->p, X->n * ciL ); mbedtls_mpi_zeroize( X->p, X->n ); mbedtls_free( X->p ); } @@ -163,7 +164,7 @@ int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs ) if( X->p != NULL ) { - memcpy( p, X->p, i * ciL ); + __aeabi_memcpy( p, X->p, i * ciL ); mbedtls_mpi_zeroize( X->p, X->n ); mbedtls_free( X->p ); } @@ -200,8 +201,8 @@ int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y ) MBEDTLS_MPI_CHK( mbedtls_mpi_grow( X, i ) ); - memset( X->p, 0, X->n * ciL ); - memcpy( X->p, Y->p, i * ciL ); + __aeabi_memset( X->p, 0, X->n * ciL ); + __aeabi_memcpy( X->p, Y->p, i * ciL ); cleanup: @@ -215,9 +216,9 @@ void mbedtls_mpi_swap( mbedtls_mpi *X, mbedtls_mpi *Y ) { mbedtls_mpi T; - memcpy( &T, X, sizeof( mbedtls_mpi ) ); - memcpy( X, Y, sizeof( mbedtls_mpi ) ); - memcpy( Y, &T, sizeof( mbedtls_mpi ) ); + __aeabi_memcpy( &T, X, sizeof( mbedtls_mpi ) ); + __aeabi_memcpy( X, Y, sizeof( mbedtls_mpi ) ); + __aeabi_memcpy( Y, &T, sizeof( mbedtls_mpi ) ); } /* @@ -292,7 +293,7 @@ int mbedtls_mpi_lset( mbedtls_mpi *X, mbedtls_mpi_sint z ) int ret; MBEDTLS_MPI_CHK( mbedtls_mpi_grow( X, 1 ) ); - memset( X->p, 0, X->n * ciL ); + __aeabi_memset( X->p, 0, X->n * ciL ); X->p[0] = ( z < 0 ) ? -z : z; X->s = ( z < 0 ) ? -1 : 1; @@ -610,7 +611,7 @@ int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin ) */ char s[ MBEDTLS_MPI_RW_BUFFER_SIZE ]; - memset( s, 0, sizeof( s ) ); + __aeabi_memset( s, 0, sizeof( s ) ); if( fgets( s, sizeof( s ) - 1, fin ) == NULL ) return( MBEDTLS_ERR_MPI_FILE_IO_ERROR ); @@ -642,7 +643,7 @@ int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X, int radix, FILE */ char s[ MBEDTLS_MPI_RW_BUFFER_SIZE ]; - memset( s, 0, sizeof( s ) ); + __aeabi_memset( s, 0, sizeof( s ) ); MBEDTLS_MPI_CHK( mbedtls_mpi_write_string( X, radix, s, sizeof( s ) - 2, &n ) ); @@ -703,7 +704,7 @@ int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf, size_t b if( buflen < n ) return( MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL ); - memset( buf, 0, buflen ); + __aeabi_memset( buf, 0, buflen ); for( i = buflen - 1, j = 0; n > 0; i--, j++, n-- ) buf[i] = (unsigned char)( X->p[j / ciL] >> ((j % ciL) << 3) ); @@ -1558,7 +1559,7 @@ static int mpi_montmul( mbedtls_mpi *A, const mbedtls_mpi *B, const mbedtls_mpi if( T->n < N->n + 1 || T->p == NULL ) return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); - memset( T->p, 0, T->n * ciL ); + __aeabi_memset( T->p, 0, T->n * ciL ); d = T->p; n = N->n; @@ -1578,7 +1579,7 @@ static int mpi_montmul( mbedtls_mpi *A, const mbedtls_mpi *B, const mbedtls_mpi *d++ = u0; d[n + 1] = 0; } - memcpy( A->p, d, ( n + 1 ) * ciL ); + __aeabi_memcpy( A->p, d, ( n + 1 ) * ciL ); if( mbedtls_mpi_cmp_abs( A, N ) >= 0 ) mpi_sub_hlp( n, N->p, A->p ); @@ -1628,7 +1629,7 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi mpi_montg_init( &mm, N ); mbedtls_mpi_init( &RR ); mbedtls_mpi_init( &T ); mbedtls_mpi_init( &Apos ); - memset( W, 0, sizeof( W ) ); + __aeabi_memset( W, 0, sizeof( W ) ); i = mbedtls_mpi_bitlen( E ); @@ -1664,10 +1665,10 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &RR, &RR, N ) ); if( _RR != NULL ) - memcpy( _RR, &RR, sizeof( mbedtls_mpi ) ); + __aeabi_memcpy( _RR, &RR, sizeof( mbedtls_mpi ) ); } else - memcpy( &RR, _RR, sizeof( mbedtls_mpi ) ); + __aeabi_memcpy( &RR, _RR, sizeof( mbedtls_mpi ) ); /* * W[1] = A * R^2 * R^-1 mod N = A * R mod N diff --git a/retail/arm9/source/conf_sd.cpp b/retail/arm9/source/conf_sd.cpp index c30a41344..4bbfa7926 100644 --- a/retail/arm9/source/conf_sd.cpp +++ b/retail/arm9/source/conf_sd.cpp @@ -19,7 +19,7 @@ #include "myDSiMode.h" #include "lzss.h" #include "text.h" -#include "tonccpy.h" +#include "aeabi.h" #include "hex.h" #include "cardengine_header_arm7.h" #include "cheat_engine.h" @@ -54,9 +54,9 @@ void decrypt_modcrypt_area(dsi_context* ctx, u8 *buffer, unsigned int size) while(len>0) { - toncset(block, 0, 0x10); + __aeabi_memset(block, 0x10, 0); dsi_crypt_ctr_block(ctx, buffer, block); - tonccpy(buffer, block, 0x10); + __aeabi_memcpy(buffer, block, 0x10); buffer+=0x10; len--; } @@ -95,14 +95,14 @@ void addTwlDevice(const char letter, u8 flags, u8 accessRights, const char* name static char currentLetter = 'A'; static u8* deviceList = (u8*)0x02EFF000; if (deviceList == (u8*)0x02EFF000) { - toncset(deviceList, 0, 0x400); + __aeabi_memclr(deviceList, 0x400); } - toncset(deviceList, (letter == 0) ? currentLetter : letter, 1); - toncset(deviceList+1, flags, 1); - toncset(deviceList+2, accessRights, 1); - tonccpy(deviceList+4, name, strlen(name)); - tonccpy(deviceList+0x14, path, strlen(path)); + __aeabi_memset(deviceList, 1, (letter == 0) ? currentLetter : letter); + __aeabi_memset(deviceList+1, 1, flags); + __aeabi_memset(deviceList+2, 1, accessRights); + __aeabi_memcpy(deviceList+4, name, strlen(name)); + __aeabi_memcpy(deviceList+0x14, path, strlen(path)); deviceList += 0x54; if (letter == 0) { @@ -327,8 +327,8 @@ static void load_conf(configuration* conf, const char* fn) { void getIgmStrings(configuration* conf, bool b4ds) { // Set In-Game Menu strings - tonccpy(igmText->version, VER_NUMBER, sizeof(VER_NUMBER)); - tonccpy(igmText->ndsBootstrap, "nds-bootstrap", 28); + __aeabi_memcpy(igmText->version, VER_NUMBER, sizeof(VER_NUMBER)); + __aeabi_memcpy(igmText->ndsBootstrap, "nds-bootstrap", 28); igmText->rtl = false; // Load In-Game Menu font @@ -748,13 +748,13 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { u8* twlCfg = (u8*)0x02000400; readFirmware(0x1FD, twlCfg+0x1E0, 1); // WlFirm Type (1=DWM-W015, 2=W024, 3=W028) if (twlCfg[0x1E0] == 2 || twlCfg[0x1E0] == 3) { - toncset32(twlCfg+0x1E4, 0x520000, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x520000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x020000, 1); // WlFirm RAM size + __aeabi_memset4(twlCfg+0x1E4, 4, 0x520000); // WlFirm RAM vars + __aeabi_memset4(twlCfg+0x1E8, 4, 0x520000); // WlFirm RAM base + __aeabi_memset4(twlCfg+0x1EC, 4, 0x020000); // WlFirm RAM size } else { - toncset32(twlCfg+0x1E4, 0x500400, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x500000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x02E000, 1); // WlFirm RAM size + __aeabi_memset4(twlCfg+0x1E4, 4, 0x500400); // WlFirm RAM vars + __aeabi_memset4(twlCfg+0x1E8, 4, 0x500000); // WlFirm RAM base + __aeabi_memset4(twlCfg+0x1EC, 4, 0x02E000); // WlFirm RAM size } *(u16*)(twlCfg+0x1E2) = swiCRC16(0xFFFF, twlCfg+0x1E4, 0xC); // WlFirm CRC16 @@ -892,7 +892,7 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { uint8_t *target = (uint8_t *)TARGETBUFFERHEADER ; fseek(ndsFile, 0, SEEK_SET); fread(target, 1, 0x1000, ndsFile); - toncset32((u8*)target+0x1D8, ndsArm7idst, 1); + __aeabi_memset4((u8*)target+0x1D8, 4, ndsArm7idst); /*if (conf->dsiMode > 0 && unitCode > 0 && !conf->isDSiWare) { load_game_conf(conf, conf->sdFound ? "sd:/_nds/nds-bootstrap.ini" : "fat:/_nds/nds-bootstrap.ini", (char*)romTid); @@ -947,18 +947,18 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { if ((target[0x1C] & 4) || (target[0x1BF] & 0x80)) { // Debug Key - tonccpy(key, target, 16) ; + __aeabi_memcpy(key, target, 16) ; } else { //Retail key char modcrypt_shared_key[8] = {'N','i','n','t','e','n','d','o'}; - tonccpy(keyp, modcrypt_shared_key, 8) ; + __aeabi_memcpy(keyp, modcrypt_shared_key, 8) ; for (int i=0;i<4;i++) { keyp[8+i] = target[0x0c+i] ; keyp[15-i] = target[0x0c+i] ; } - tonccpy(key, target+0x350, 16) ; + __aeabi_memcpy(key, target+0x350, 16) ; u128_xor(key, keyp); u128_add(key, DSi_KEY_MAGIC); @@ -991,18 +991,18 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { if ((target[0x1C] & 4) || (target[0x1BF] & 0x80)) { // Debug Key - tonccpy(key, target, 16) ; + __aeabi_memcpy(key, target, 16) ; } else { //Retail key char modcrypt_shared_key[8] = {'N','i','n','t','e','n','d','o'}; - tonccpy(keyp, modcrypt_shared_key, 8) ; + __aeabi_memcpy(keyp, modcrypt_shared_key, 8) ; for (int i=0;i<4;i++) { keyp[8+i] = target[0x0c+i] ; keyp[15-i] = target[0x0c+i] ; } - tonccpy(key, target+0x350, 16) ; + __aeabi_memcpy(key, target+0x350, 16) ; u128_xor(key, keyp); u128_add(key, DSi_KEY_MAGIC); @@ -1150,8 +1150,8 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { if (!conf->gameOnFlashcard && strlen(conf->appPath) < 62) { char sdmcText[4] = {'s','d','m','c'}; - tonccpy((char*)0x02EFF3C2, conf->appPath, strlen(conf->appPath)); - tonccpy((char*)0x02EFF3C0, sdmcText, 4); + __aeabi_memcpy((char*)0x02EFF3C2, conf->appPath, strlen(conf->appPath)); + __aeabi_memcpy((char*)0x02EFF3C0, sdmcText, 4); } } @@ -1203,9 +1203,9 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { fread(lz77ImageBuffer, 1, sizeof(lz77ImageBuffer), cebin); LZ77_Decompress(lz77ImageBuffer, (u8*)CARDENGINEI_ARM7_BUFFERED_LOCATION); if (REG_SCFG_EXT7 != 0) { - tonccpy((u8*)LOADER_RETURN_SDK5_LOCATION, twlmenuResetGamePath, 256); + __aeabi_memcpy((u8*)LOADER_RETURN_SDK5_LOCATION, twlmenuResetGamePath, 256); } - tonccpy((u8*)LOADER_RETURN_SDK5_LOCATION+0x100, &srBackendId, 8); + __aeabi_memcpy((u8*)LOADER_RETURN_SDK5_LOCATION+0x100, &srBackendId, 8); } fclose(cebin); @@ -1233,9 +1233,9 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { fread(lz77ImageBuffer, 1, sizeof(lz77ImageBuffer), cebin); LZ77_Decompress(lz77ImageBuffer, (u8*)CARDENGINEI_ARM7_BUFFERED_LOCATION); if (REG_SCFG_EXT7 != 0) { - tonccpy((u8*)LOADER_RETURN_LOCATION, twlmenuResetGamePath, 256); + __aeabi_memcpy((u8*)LOADER_RETURN_LOCATION, twlmenuResetGamePath, 256); } - tonccpy((u8*)LOADER_RETURN_LOCATION+0x100, &srBackendId, 8); + __aeabi_memcpy((u8*)LOADER_RETURN_LOCATION+0x100, &srBackendId, 8); } fclose(cebin); @@ -1373,9 +1373,9 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { fread(lz77ImageBuffer, 1, sizeof(lz77ImageBuffer), cebin); LZ77_Decompress(lz77ImageBuffer, (u8*)CARDENGINEI_ARM7_BUFFERED_LOCATION); if (REG_SCFG_EXT7 != 0) { - tonccpy((u8*)LOADER_RETURN_DSIWARE_LOCATION, twlmenuResetGamePath, 256); + __aeabi_memcpy((u8*)LOADER_RETURN_DSIWARE_LOCATION, twlmenuResetGamePath, 256); } - tonccpy((u8*)LOADER_RETURN_DSIWARE_LOCATION+0x100, &srBackendId, 8); + __aeabi_memcpy((u8*)LOADER_RETURN_DSIWARE_LOCATION+0x100, &srBackendId, 8); } fclose(cebin); @@ -1477,7 +1477,7 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { cebin = fopen(pageFilePath.c_str(), "r+"); fwrite((u8*)igmText, 1, 0xA000, cebin); fclose(cebin); - toncset((u8*)igmText, 0, 0xA000); + __aeabi_memclr((u8*)igmText, 0xA000); } // Load DS blowfish @@ -1586,11 +1586,11 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { delete[] bmpImageBuffer;*/ fread((u16*)IMAGES_LOCATION, 1, 0x18000, bootstrapImages); } else { - toncset16((u16*)IMAGES_LOCATION, 0, 256*192); + __aeabi_memclr((u16*)IMAGES_LOCATION, (256*192)*sizeof(u16)); } fclose(bootstrapImages); } else { - toncset16((u16*)IMAGES_LOCATION, 0, 256*192); + __aeabi_memclr((u16*)IMAGES_LOCATION, (256*192)*sizeof(u16)); } } else { @@ -1611,18 +1611,18 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { if ((target[0x1C] & 4) || (target[0x1BF] & 0x80)) { // Debug Key - tonccpy(key, target, 16) ; + __aeabi_memcpy(key, target, 16) ; } else { //Retail key char modcrypt_shared_key[8] = {'N','i','n','t','e','n','d','o'}; - tonccpy(keyp, modcrypt_shared_key, 8) ; + __aeabi_memcpy(keyp, modcrypt_shared_key, 8) ; for (int i=0;i<4;i++) { keyp[8+i] = target[0x0c+i] ; keyp[15-i] = target[0x0c+i] ; } - tonccpy(key, target+0x350, 16) ; + __aeabi_memcpy(key, target+0x350, 16) ; u128_xor(key, keyp); u128_add(key, DSi_KEY_MAGIC); @@ -1669,10 +1669,11 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { fclose(cebin); // Load ce7 binary - if (strncmp(romTid, "KWY", 3) == 0 // Mighty Milky Way + if (strncmp(romTid, "KMG", 3) == 0 // Mighty Flip Champs! + || strncmp(romTid, "KWY", 3) == 0 // Mighty Milky Way || strncmp(romTid, "KS3", 3) == 0 // Shantae: Risky's Revenge ) { - cebin = fopen("nitro:/cardengine_arm7_music.bin", "rb"); + cebin = fopen("nitro:/cardengine_arm7_music.bin", "rb"); // Music and/or rumble } else { cebin = fopen("nitro:/cardengine_arm7.bin", "rb"); } @@ -1768,7 +1769,7 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { cebin = fopen(pageFilePath.c_str(), "r+"); fwrite((u8*)igmText, 1, 0xA000, cebin); fclose(cebin); - toncset((u8*)igmText, 0, 0xA000); + __aeabi_memclr((u8*)igmText, 0xA000); } if (accessControl & BIT(4)) { @@ -1956,11 +1957,11 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { delete[] bmpImageBuffer;*/ fread((u16*)IMAGES_LOCATION, 1, 0x18000, bootstrapImages); } else { - toncset16((u16*)IMAGES_LOCATION, 0, 256*192); + __aeabi_memclr((u16*)IMAGES_LOCATION, (256*192)*sizeof(u16)); } fclose(bootstrapImages); } else { - toncset16((u16*)IMAGES_LOCATION, 0, 256*192); + __aeabi_memclr((u16*)IMAGES_LOCATION, (256*192)*sizeof(u16)); } sprintf(patchOffsetCacheFilePath, "fat:/_nds/nds-bootstrap/musicPacks/%s-%04X.pck", romTid, headerCRC); diff --git a/retail/arm9/source/lzss.c b/retail/arm9/source/lzss.c index 0843fba9e..4ca6b348e 100644 --- a/retail/arm9/source/lzss.c +++ b/retail/arm9/source/lzss.c @@ -1,7 +1,6 @@ #include #include #include "lzss.h" -#include "tonccpy.h" #define __itcm __attribute__((section(".itcm"))) diff --git a/retail/arm9/source/nand/crypto.c b/retail/arm9/source/nand/crypto.c index 52b339a7f..f0b58d141 100644 --- a/retail/arm9/source/nand/crypto.c +++ b/retail/arm9/source/nand/crypto.c @@ -1,5 +1,6 @@ #include #include "../mbedtls/mbedtls_aes.h" +#include "aeabi.h" #include "crypto.h" //#include "ticket0.h" #include "utils.h" @@ -215,8 +216,8 @@ void dsi_boot2_crypt(uint8_t* out, const uint8_t* in, unsigned count) { // and also nonce, it becomes garbage after decryption uint8_t ccm_mac[AES_CCM_MAC_LEN]; uint8_t nonce[AES_CCM_NONCE_LEN]; - memcpy(ccm_mac, footer->ccm_mac, AES_CCM_MAC_LEN); - memcpy(nonce, footer->nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(ccm_mac, footer->ccm_mac, AES_CCM_MAC_LEN); + __aeabi_memcpy(nonce, footer->nonce, AES_CCM_NONCE_LEN); uint32_t ctr32[4], pad32[4], mac32[4]; // I'm too paranoid to use more stack variables @@ -228,11 +229,11 @@ void dsi_boot2_crypt(uint8_t* out, const uint8_t* in, unsigned count) { if (mode == DECRYPT) { // decrypt footer zero(ctr32); - memcpy(ctr + 1, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(ctr + 1, nonce, AES_CCM_NONCE_LEN); // footer might not be 32 bit aligned after all, so we copy it out to decrypt - memcpy(pad, footer->encrypted, AES_BLOCK_SIZE); + __aeabi_memcpy(pad, footer->encrypted, AES_BLOCK_SIZE); aes_ctr(es_rk, ctr32, pad32, pad32); - memcpy(footer->encrypted, pad, AES_BLOCK_SIZE); + __aeabi_memcpy(footer->encrypted, pad, AES_BLOCK_SIZE); } // check decrypted footer if (footer->fixed_3a != 0x3a) { @@ -253,21 +254,21 @@ void dsi_boot2_crypt(uint8_t* out, const uint8_t* in, unsigned count) { zero(pad32); if (mode == DECRYPT) { ctr32[0] = (block_size >> 4) + 1; - memcpy(ctr + 3, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(ctr + 3, nonce, AES_CCM_NONCE_LEN); ctr[0xf] = 2; aes_ctr(es_rk, ctr32, pad32, pad32); } - memcpy(buf + block_size, pad + remainder, 16 - remainder); + __aeabi_memcpy(buf + block_size, pad + remainder, 16 - remainder); block_size += 16 - remainder; } // AES-CCM MAC mac32[0] = block_size; - memcpy(mac + 3, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(mac + 3, nonce, AES_CCM_NONCE_LEN); mac[0xf] = 0x3a; aes_encrypt_128_be(es_rk, mac, mac); // AES-CCM CTR ctr32[0] = 0; - memcpy(ctr + 3, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(ctr + 3, nonce, AES_CCM_NONCE_LEN); ctr[0xf] = 2; // AES-CCM start zero(pad32); @@ -295,25 +296,25 @@ void dsi_boot2_crypt(uint8_t* out, const uint8_t* in, unsigned count) { if (memcmp(mac, ccm_mac, 16) == 0) { if (remainder != 0) { // restore mac - memcpy(footer->ccm_mac, ccm_mac, AES_CCM_MAC_LEN); + __aeabi_memcpy(footer->ccm_mac, ccm_mac, AES_CCM_MAC_LEN); } // restore nonce - memcpy(footer->nonce, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(footer->nonce, nonce, AES_CCM_NONCE_LEN); return 0; } else { //printf("MAC verification failed\n"); return 1; } } else { - memcpy(footer->ccm_mac, mac, AES_CCM_MAC_LEN); + __aeabi_memcpy(footer->ccm_mac, mac, AES_CCM_MAC_LEN); // AES-CTR crypt later half of footer zero(ctr32); - memcpy(ctr + 1, nonce, AES_CCM_NONCE_LEN); - memcpy(pad, footer->encrypted, AES_BLOCK_SIZE); + __aeabi_memcpy(ctr + 1, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(pad, footer->encrypted, AES_BLOCK_SIZE); aes_ctr(es_rk, ctr32, pad32, pad32); - memcpy(footer->encrypted, pad, AES_BLOCK_SIZE); + __aeabi_memcpy(footer->encrypted, pad, AES_BLOCK_SIZE); // restore nonce - memcpy(footer->nonce, nonce, AES_CCM_NONCE_LEN); + __aeabi_memcpy(footer->nonce, nonce, AES_CCM_NONCE_LEN); return 0; } #undef ctr diff --git a/retail/arm9/source/nand/nandio.c b/retail/arm9/source/nand/nandio.c index 7237deed8..8a129e9a9 100644 --- a/retail/arm9/source/nand/nandio.c +++ b/retail/arm9/source/nand/nandio.c @@ -5,7 +5,7 @@ #include #include "crypto.h" #include "sector0.h" -#include "tonccpy.h" +#include "aeabi.h" #include "f_xy.h" //#define SECTOR_SIZE 512 @@ -31,7 +31,7 @@ void getConsoleID(u8 *consoleID){ u8 key_x[16];////key3_x - contains a DSi console id (which just happens to be the LFCS on 3ds) u8 key_y[16] = {0x76, 0xDC, 0xB9, 0x0A, 0xD3, 0xC4, 0x4D, 0xBD, 0x1D, 0xDD, 0x2D, 0x20, 0x05, 0x00, 0xA0, 0xE1}; //key3_y NAND constant - tonccpy(key, fifo, 16); //receive the goods from arm7 + __aeabi_memcpy(key, fifo, 16); //receive the goods from arm7 F_XY_reverse(key, key_xy); //work backwards from the normalkey to get key_x that has the consoleID @@ -39,8 +39,8 @@ void getConsoleID(u8 *consoleID){ key_x[i] = key_xy[i] ^ key_y[i]; //'' } - tonccpy(&consoleID[0], &key_x[0], 4); - tonccpy(&consoleID[4], &key_x[0xC], 4); + __aeabi_memcpy(&consoleID[0], &key_x[0], 4); + __aeabi_memcpy(&consoleID[4], &key_x[0xC], 4); } bool nandio_startup() { diff --git a/retail/arm9/source/nds_loader_arm9.c b/retail/arm9/source/nds_loader_arm9.c index f33760318..ad1ddc276 100644 --- a/retail/arm9/source/nds_loader_arm9.c +++ b/retail/arm9/source/nds_loader_arm9.c @@ -33,7 +33,7 @@ #include "myDSiMode.h" #include "lzss.h" -#include "tonccpy.h" +#include "aeabi.h" #include "hex.h" #include "configuration.h" #include "nds_loader_arm9.h" @@ -180,7 +180,7 @@ static bool dldiPatchLoader (data_t *binData, u32 binSize, bool clearBSS) // Remember how much space is actually reserved pDH[DO_allocatedSpace] = pAH[DO_allocatedSpace]; // Copy the DLDI patch into the application - tonccpy (pAH, pDH, dldiFileSize); + __aeabi_memcpy (pAH, pDH, dldiFileSize); // Fix the section pointers in the header writeAddr (pAH, DO_text_start, readAddr (pAH, DO_text_start) + relocationOffset); @@ -228,7 +228,7 @@ static bool dldiPatchLoader (data_t *binData, u32 binSize, bool clearBSS) if (clearBSS && (pDH[DO_fixSections] & FIX_BSS)) { // Initialise the BSS to 0, only if the disc is being re-inited - toncset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); + __aeabi_memset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); } return true; @@ -310,7 +310,7 @@ int runNds(u32 cluster, u32 saveCluster, u32 donorTwlCluster, u32 gbaCluster, u3 // Set the parameters for the loader // Load the loader into the correct address - tonccpy(lc0, loader, 0x40000); //vramcpy(LCDC_BANK_D, loader, loaderSize); + __aeabi_memcpy(lc0, loader, 0x40000); //vramcpy(LCDC_BANK_D, loader, loaderSize); if(conf->gameOnFlashcard || conf->saveOnFlashcard) { // Patch the loader with a DLDI for the card diff --git a/retail/arm9/source/nitrofs.c b/retail/arm9/source/nitrofs.c index 3148e2f15..1e8c620e2 100644 --- a/retail/arm9/source/nitrofs.c +++ b/retail/arm9/source/nitrofs.c @@ -61,7 +61,7 @@ #include #include "myDSiMode.h" #include "nitrofs.h" -#include "tonccpy.h" +#include "aeabi.h" //This seems to be a typo! memory.h has REG_EXEMEMCNT #ifndef REG_EXMEMCNT @@ -141,7 +141,7 @@ static inline ssize_t nitroSubRead(off_t *npos, void *ptr, size_t len) } else if (!bootNitro) { //reading from gbarom - tonccpy(ptr, *npos + (void *)GBAROM, len); //len isnt checked here because other checks exist in the callers (hopefully) + __aeabi_memcpy(ptr, *npos + (void *)GBAROM, len); //len isnt checked here because other checks exist in the callers (hopefully) } if (len > 0) *npos += len; diff --git a/retail/arm9/source/text.cpp b/retail/arm9/source/text.cpp index eef05528c..06c31e8ed 100644 --- a/retail/arm9/source/text.cpp +++ b/retail/arm9/source/text.cpp @@ -1,6 +1,7 @@ #include "text.h" -#include "tonccpy.h" +#include "aeabi.h" +#include #include #include @@ -209,7 +210,6 @@ char16_t arabicForm(char16_t current, char16_t prev, char16_t next) { return current; } -#include #include void processRTL(unsigned char *begin, unsigned char *end) { @@ -332,7 +332,7 @@ void processRTL(unsigned char *begin, unsigned char *end) { } } - tonccpy(begin, buffer, sizeof(buffer)); + __aeabi_memcpy(begin, buffer, sizeof(buffer)); } void setIgmString(const char *src, unsigned char *dst) { diff --git a/retail/arm9/source/twltool/dsi.c b/retail/arm9/source/twltool/dsi.c index e12224b8b..6a4b209e6 100644 --- a/retail/arm9/source/twltool/dsi.c +++ b/retail/arm9/source/twltool/dsi.c @@ -3,6 +3,7 @@ #include #include #include +#include "aeabi.h" #include "u128_math.h" void dsi_set_key( dsi_context* ctx, @@ -225,15 +226,15 @@ void dsi_decrypt_ccm( dsi_context* ctx, size -= 16; } - memcpy(ctr, ctx->ctr, 16); - memset(block, 0, 16); + __aeabi_memcpy(ctr, ctx->ctr, 16); + __aeabi_memset(block, 0, 16); dsi_crypt_ctr_block(ctx, block, block); - memcpy(ctx->ctr, ctr, 16); - memcpy(block, input, size); + __aeabi_memcpy(ctx->ctr, ctr, 16); + __aeabi_memcpy(block, input, size); dsi_decrypt_ccm_block(ctx, block, block, mac); - memcpy(output, block, size); + __aeabi_memcpy(output, block, size); } @@ -257,23 +258,23 @@ void dsi_encrypt_ccm( dsi_context* ctx, size -= 16; } - memset(block, 0, 16); - memcpy(block, input, size); + __aeabi_memset(block, 0, 16); + __aeabi_memcpy(block, input, size); dsi_encrypt_ccm_block(ctx, block, block, mac); - memcpy(output, block, size); + __aeabi_memcpy(output, block, size); } void dsi_es_init( dsi_es_context* ctx, unsigned char key[16] ) { - memcpy(ctx->key, key, 16); + __aeabi_memcpy(ctx->key, key, 16); ctx->randomnonce = 1; } void dsi_es_set_nonce( dsi_es_context* ctx, unsigned char nonce[12] ) { - memcpy(ctx->nonce, nonce, 12); + __aeabi_memcpy(ctx->nonce, nonce, 12); ctx->randomnonce = 0; } @@ -297,9 +298,9 @@ int dsi_es_decrypt( dsi_es_context* ctx, unsigned int chksize; - memcpy(chkmac, metablock, 16); + __aeabi_memcpy(chkmac, metablock, 16); - memcpy(ctr, metablock + 16, 16); + __aeabi_memcpy(ctr, metablock + 16, 16); ctr[0] = 0; ctr[13] = 0; ctr[14] = 0; @@ -320,7 +321,7 @@ int dsi_es_decrypt( dsi_es_context* ctx, return -2; } - memcpy(nonce, metablock + 17, 12); + __aeabi_memcpy(nonce, metablock + 17, 12); dsi_init_ccm(&cryptoctx, ctx->key, 16, size, 0, nonce); dsi_decrypt_ccm(&cryptoctx, buffer, buffer, size, genmac); @@ -355,25 +356,25 @@ void dsi_es_encrypt( dsi_es_context* ctx, } else { - memcpy(nonce, ctx->nonce, 12); + __aeabi_memcpy(nonce, ctx->nonce, 12); } dsi_init_ccm(&cryptoctx, ctx->key, 16, size, 0, nonce); dsi_encrypt_ccm(&cryptoctx, buffer, buffer, size, mac); - memset(scratchpad, 0, 16); + __aeabi_memset(scratchpad, 0, 16); scratchpad[0] = 0x3A; scratchpad[13] = size >> 16; scratchpad[14] = size >> 8; scratchpad[15] = size >> 0; - memset(ctr, 0, 16); - memcpy(ctr+1, nonce, 12); + __aeabi_memset(ctr, 0, 16); + __aeabi_memcpy(ctr+1, nonce, 12); dsi_init_ctr(&cryptoctx, ctx->key, ctr); dsi_crypt_ctr_block(&cryptoctx, scratchpad, metablock+16); - memcpy(metablock+17, nonce, 12); + __aeabi_memcpy(metablock+17, nonce, 12); - memcpy(metablock, mac, 16); + __aeabi_memcpy(metablock, mac, 16); } diff --git a/retail/bootloader/Makefile b/retail/bootloader/Makefile index 69d5c502e..e805d0178 100644 --- a/retail/bootloader/Makefile +++ b/retail/bootloader/Makefile @@ -39,7 +39,7 @@ CFLAGS := -g -Wall -O2\ CFLAGS += $(INCLUDE) -DARM7 -D_NO_SDMMC -DB4DS -std=gnu99 -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -nostartfiles -T $(TOPDIR)/load.ld -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(TARGET).map LIBS := -lnds7 diff --git a/retail/bootloader/source/arm7/booter.arm7.s b/retail/bootloader/source/arm7/booter.arm7.s index c898c63f9..fb97f8267 100644 --- a/retail/bootloader/source/arm7/booter.arm7.s +++ b/retail/bootloader/source/arm7/booter.arm7.s @@ -17,7 +17,7 @@ @ Clears ICache and Dcache, and resets the protection units @ Originally written by Darkain, modified by Chishm -#include "../../include/asminc.h" +#include "asminc.h" .arm diff --git a/retail/bootloader/source/arm7/decompress.c b/retail/bootloader/source/arm7/decompress.c index bc32bd403..57d24939d 100644 --- a/retail/bootloader/source/arm7/decompress.c +++ b/retail/bootloader/source/arm7/decompress.c @@ -20,7 +20,7 @@ #include "decompress.h" #include "debug_file.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #define BLZ_SHIFT 1 // bits to shift #define BLZ_MASK 0x80 // bits to check: @@ -231,8 +231,8 @@ u32 decompressIBinary(unsigned char *pak_buffer, unsigned int pak_len) { BLZ_Invert((char *)raw_buffer + dec_len, raw_len - dec_len); - tonccpy(pak_buffer, raw_buffer, raw_len); - toncset(raw_buffer, 0, raw_len); + __aeabi_memcpy(pak_buffer, raw_buffer, raw_len); + __aeabi_memclr(raw_buffer, raw_len); return raw_len; } @@ -343,7 +343,7 @@ void init2(u32 *magic, u32 a[3]) void init1(u32 cardheader_gamecode) { - tonccpy(card_hash, encr_data, 4*(1024 + 18)); + __aeabi_memcpy(card_hash, encr_data, 4*(1024 + 18)); arg2[0] = *(u32 *)&cardheader_gamecode; arg2[1] = (*(u32 *)&cardheader_gamecode) >> 1; arg2[2] = (*(u32 *)&cardheader_gamecode) << 1; @@ -364,7 +364,7 @@ bool decrypt_arm9(const tNDSHeader* ndsHeader) u32 *p = (u32*)ndsHeader->arm9destination; if (p[0] == 0 || (p[0] == 0xE7FFDEFF && p[1] == 0xE7FFDEFF)) { - toncset(encr_data, 0, 0x1048); + __aeabi_memclr(encr_data, 0x1048); return false; } @@ -391,6 +391,6 @@ bool decrypt_arm9(const tNDSHeader* ndsHeader) size -= 8; } - toncset(encr_data, 0, 0x1048); + __aeabi_memclr(encr_data, 0x1048); return true; } diff --git a/retail/bootloader/source/arm7/dldi_patcher.c b/retail/bootloader/source/arm7/dldi_patcher.c index 1479142d3..119ce5ff2 100644 --- a/retail/bootloader/source/arm7/dldi_patcher.c +++ b/retail/bootloader/source/arm7/dldi_patcher.c @@ -23,7 +23,7 @@ #include #include #include "dldi_patcher.h" -#include "tonccpy.h" +#include "aeabi.h" #define FIX_ALL 0x01 #define FIX_GLUE 0x02 @@ -132,7 +132,7 @@ bool dldiPatchBinary (data_t *binDataSrc, u32 binSize, data_t *binData) { } } - tonccpy (binData, (u32*)dldiDataSrc, 0x80); + __aeabi_memcpy (binData, (u32*)dldiDataSrc, 0x80); data_t *pDH = (data_t*)(((u32*)(&__myio_dldi)) - 24); data_t *pAH = &(binData[patchOffset]); @@ -163,7 +163,7 @@ bool dldiPatchBinary (data_t *binDataSrc, u32 binSize, data_t *binData) { // Remember how much space is actually reserved pDH[DO_allocatedSpace] = pAH[DO_allocatedSpace]; // Copy the DLDI patch into the application - tonccpy (pAH, pDH, dldiFileSize); + __aeabi_memcpy (pAH, pDH, dldiFileSize); // Fix the section pointers in the header writeAddr (pAH, DO_text_start, readAddr (pAH, DO_text_start) + relocationOffset); @@ -183,7 +183,7 @@ bool dldiPatchBinary (data_t *binDataSrc, u32 binSize, data_t *binData) { writeAddr (pAH, DO_shutdown, readAddr (pAH, DO_shutdown) + relocationOffset); // Put the correct DLDI magic string back into the DLDI header - tonccpy (pAH, dldiMagicString, sizeof (dldiMagicString)); + __aeabi_memcpy (pAH, dldiMagicString, sizeof (dldiMagicString)); if (pDH[DO_fixSections] & FIX_ALL) { // Search through and fix pointers within the data section of the file @@ -214,10 +214,10 @@ bool dldiPatchBinary (data_t *binDataSrc, u32 binSize, data_t *binData) { /*if (pDH[DO_fixSections] & FIX_BSS) { // Initialise the BSS to 0 - toncset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); + __aeabi_memclr (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart], readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); }*/ - tonccpy ((u32*)dldiDataSrc, binData, 0x80); + __aeabi_memcpy ((u32*)dldiDataSrc, binData, 0x80); return true; } #endif \ No newline at end of file diff --git a/retail/bootloader/source/arm7/dsi2ds_patches.c b/retail/bootloader/source/arm7/dsi2ds_patches.c index af84cbbca..a83491011 100644 --- a/retail/bootloader/source/arm7/dsi2ds_patches.c +++ b/retail/bootloader/source/arm7/dsi2ds_patches.c @@ -7,7 +7,7 @@ #include "patch.h" #include "common.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #include "loading_screen.h" #include "debug_file.h" @@ -254,7 +254,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020193E0 = 0xE12FFF1E; // bx lr (Disable NFTR loading from TWLNAND) *(u32*)0x02019D20 = 0xE12FFF1E; // bx lr *(u32*)0x02030A88 = 0xE1A00000; // nop - //tonccpy((u32*)0x02031660, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x02031660, dsiSaveGetResultCode, 0xC); *(u32*)0x02034224 = 0xE1A00000; // nop patchInitDSiWare(0x02039C40, heapEnd); // *(u32*)0x02039FCC = 0x02115860; @@ -436,8 +436,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (s2FlashcardId == 0x5A45) { gate18HeapAddrPtr[0] -= 0x01000000; } - tonccpy((u32*)0x0200E844, mepHeapSetPatch, 0x70); - tonccpy((u32*)0x02017E18, gate18HeapAlloc, 0xBC); + __aeabi_memcpy((u32*)0x0200E844, mepHeapSetPatch, 0x70); + __aeabi_memcpy((u32*)0x02017E18, gate18HeapAlloc, 0xBC); *(u32*)0x0200E840 = (u32)getOffsetFromBL((u32*)0x02020740); setBL(0x02020740, 0x0200E844); @@ -623,10 +623,10 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020764A4, (u32)dsiSaveWrite); setBL(0x020764AC, (u32)dsiSaveClose); - toncset((char*)0x020A05F4, 0, 9); // Redirect otherPrv to dataPrv - tonccpy((char*)0x020A05F4, dataPrv, strlen(dataPrv)); - toncset((char*)0x020A0608, 0, 9); - tonccpy((char*)0x020A0608, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x020A05F4, 9); // Redirect otherPrv to dataPrv + __aeabi_memcpy((char*)0x020A05F4, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x020A0608, 9); + __aeabi_memcpy((char*)0x020A0608, dataPrv, strlen(dataPrv)); } // 21 Blackjack (USA) @@ -1404,7 +1404,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200E4F8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0200E578 = 0xE3A00001; // mov r0, #1 *(u32*)0x020FD244 = 0xE1A00000; // nop - tonccpy((u32*)0x020FDDC8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FDDC8, dsiSaveGetResultCode, 0xC); *(u32*)0x021008F8 = 0xE1A00000; // nop patchInitDSiWare(0x021059B0, heapEnd); patchUserSettingsReadDSiWare(0x021070C0); @@ -1446,7 +1446,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200E4A8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0200E528 = 0xE3A00001; // mov r0, #1 *(u32*)0x020FC8B4 = 0xE1A00000; // nop - tonccpy((u32*)0x020FD438, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FD438, dsiSaveGetResultCode, 0xC); *(u32*)0x020FFF68 = 0xE1A00000; // nop patchInitDSiWare(0x02105020, heapEnd); patchUserSettingsReadDSiWare(0x02106730); @@ -1465,7 +1465,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // 5 in 1 Mahjong (Europe) else if (strcmp(romTid, "KRJE") == 0 || strcmp(romTid, "KRJP") == 0) { *(u32*)0x02012514 = 0xE1A00000; // nop - tonccpy((u32*)0x02013098, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013098, dsiSaveGetResultCode, 0xC); *(u32*)0x02015FD8 = 0xE1A00000; // nop patchInitDSiWare(0x0201CBE4, heapEnd); patchUserSettingsReadDSiWare(0x0201E2C4); @@ -1638,7 +1638,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // 7 Card Games (USA) else if (strcmp(romTid, "K7CE") == 0) { *(u32*)0x02012574 = 0xE1A00000; // nop - tonccpy((u32*)0x020130EC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020130EC, dsiSaveGetResultCode, 0xC); *(u32*)0x02015FA4 = 0xE1A00000; // nop patchInitDSiWare(0x0201CB3C, heapEnd); patchUserSettingsReadDSiWare(0x0201E1F8); @@ -2261,7 +2261,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "K5HE") == 0 || strcmp(romTid, "K5HP") == 0) { useSharedFont = (twlFontFound && debugOrMep); *(u32*)0x0200F778 = 0xE1A00000; // nop - //tonccpy((u32*)0x020102FC, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x020102FC, dsiSaveGetResultCode, 0xC); *(u32*)0x02012A58 = 0xE1A00000; // nop patchInitDSiWare(0x02018098, heapEnd); patchUserSettingsReadDSiWare(0x02019538); @@ -2316,7 +2316,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200A27C = 0xE12FFF1E; // bx lr */ *(u32*)0x0200D774 = 0xE1A00000; // nop *(u32*)0x0204F750 = 0xE1A00000; // nop - // tonccpy((u32*)0x020502D4, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x020502D4, dsiSaveGetResultCode, 0xC); *(u32*)0x020536E4 = 0xE1A00000; // nop patchInitDSiWare(0x0205B8C8, heapEnd); if (!extendedMemory) { @@ -2436,7 +2436,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02017864 = 0xE1A00000; // nop (Skip Manual screen) } *(u32*)0x0203F1EC = 0xE1A00000; // nop - tonccpy((u32*)0x0203FD80, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203FD80, dsiSaveGetResultCode, 0xC); *(u32*)0x020428B8 = 0xE1A00000; // nop patchInitDSiWare(0x02048244, heapEnd); patchUserSettingsReadDSiWare(0x0204982C); @@ -2450,7 +2450,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020177AC = 0xE1A00000; // nop (Skip Manual screen) } *(u32*)0x0203F140 = 0xE1A00000; // nop - tonccpy((u32*)0x0203FCD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203FCD4, dsiSaveGetResultCode, 0xC); *(u32*)0x0204280C = 0xE1A00000; // nop patchInitDSiWare(0x02048198, heapEnd); patchUserSettingsReadDSiWare(0x02049780); @@ -2484,7 +2484,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200A224 = 0xE12FFF1E; // bx lr */ *(u32*)0x0200D71C = 0xE1A00000; // nop *(u32*)0x0204E880 = 0xE1A00000; // nop - // tonccpy((u32*)0x0204F404, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x0204F404, dsiSaveGetResultCode, 0xC); *(u32*)0x02052814 = 0xE1A00000; // nop patchInitDSiWare(0x0205A9F8, heapEnd); if (!extendedMemory) { @@ -2687,7 +2687,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020269D8, (u32)dsiSaveWrite); setBL(0x020269E0, (u32)dsiSaveClose); *(u32*)0x0202D6EC = 0xE1A00000; // nop - tonccpy((u32*)0x0202E838, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E838, dsiSaveGetResultCode, 0xC); *(u32*)0x020312B4 = 0xE1A00000; // nop patchInitDSiWare(0x02036E94, heapEnd); patchUserSettingsReadDSiWare(0x02038330); @@ -2719,7 +2719,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025A9C, (u32)dsiSaveWrite); setBL(0x02025AA4, (u32)dsiSaveClose); *(u32*)0x0202C7B0 = 0xE1A00000; // nop - tonccpy((u32*)0x0202D8FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D8FC, dsiSaveGetResultCode, 0xC); *(u32*)0x02030378 = 0xE1A00000; // nop patchInitDSiWare(0x02035F68, heapEnd); patchUserSettingsReadDSiWare(0x02037404); @@ -2729,7 +2729,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KPCJ") == 0) { useSharedFont = (twlFontFound && debugOrMep); *(u32*)0x0200E894 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F9E0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F9E0, dsiSaveGetResultCode, 0xC); *(u32*)0x0201245C = 0xE1A00000; // nop patchInitDSiWare(0x02018024, heapEnd); patchUserSettingsReadDSiWare(0x020194B0); @@ -3779,7 +3779,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02020B18, (u32)dsiSaveRead); setBL(0x02020B20, (u32)dsiSaveClose); *(u32*)0x020426BC = 0xE1A00000; // nop - tonccpy((u32*)0x02043360, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043360, dsiSaveGetResultCode, 0xC); *(u32*)0x02045CC4 = 0xE1A00000; // nop patchInitDSiWare(0x0204CE40, heapEnd); patchUserSettingsReadDSiWare(0x0204E3E0); @@ -3878,7 +3878,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } */ *(u32*)0x02037120 = 0xE1A00000; // nop - tonccpy((u32*)0x02038D64, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02038D64, dsiSaveGetResultCode, 0xC); *(u32*)0x0203B68C = 0xE1A00000; // nop patchInitDSiWare(0x02042834, heapEnd); *(u32*)0x02042BC0 = *(u32*)0x02004FD0; @@ -4011,7 +4011,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02009A0C = 0xE12FFF1E; // bx lr *(u32*)0x0200A29C = 0xE1A00000; // nop *(u32*)0x020427A0 = 0xE1A00000; // nop - tonccpy((u32*)0x02043318, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043318, dsiSaveGetResultCode, 0xC); *(u32*)0x020466A0 = 0xE1A00000; // nop patchInitDSiWare(0x0204E638, heapEnd); if (!extendedMemory) { @@ -4064,7 +4064,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200AF60 = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x0200AF64 = 0xE12FFF1E; // bx lr *(u32*)0x02031CFC = 0xE1A00000; // nop - tonccpy((u32*)0x02032874, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02032874, dsiSaveGetResultCode, 0xC); *(u32*)0x02035A64 = 0xE1A00000; // nop patchInitDSiWare(0x0203D044, heapEnd); patchUserSettingsReadDSiWare(0x0203E510); @@ -4433,35 +4433,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEE") == 0) { const u32 dsiSaveCreateT = 0x02095E90; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02095EA0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02095EB0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02095EC0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02095ED0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x02095794; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02096254; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02096444; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x020368DE); // dsiSaveCreateDirAuto setBLThumb(0x020368E6, dsiSaveCreateT); // dsiSaveCreateAuto @@ -4501,35 +4501,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEV") == 0) { const u32 dsiSaveCreateT = 0x02094A78; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02094A88; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02094A98; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02094AA8; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02094AB8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x020943F0; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02094E3C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02094FF4; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x0200910C); doubleNopT(0x020091F2); @@ -4570,35 +4570,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEJ") == 0) { const u32 dsiSaveCreateT = 0x02094750; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02094760; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02094770; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02094780; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02094790; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x020940C8; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02094B14; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02094CCC; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x020090F8); doubleNopT(0x020091DE); @@ -4640,7 +4640,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "K9GE") == 0) { *(u32*)0x02005120 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x0200D83C = 0xE1A00000; // nop - tonccpy((u32*)0x0200E3C0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E3C0, dsiSaveGetResultCode, 0xC); *(u32*)0x02010DDC = 0xE1A00000; // nop patchInitDSiWare(0x0201865C, heapEndMaxForRetail); *(u32*)0x020189E8 = *(u32*)0x02004FE8; @@ -4765,7 +4765,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020078D4 = 0xE12FFF1E; // bx lr *(u32*)0x0200815C = 0xE1A00000; // nop *(u32*)0x02040214 = 0xE1A00000; // nop - tonccpy((u32*)0x02040EA8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040EA8, dsiSaveGetResultCode, 0xC); *(u32*)0x02044274 = 0xE1A00000; // nop *(u32*)0x0204C4D8 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204C4F0, heapEnd); @@ -4827,35 +4827,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { /*else if (strcmp(romTid, "KZ4E") == 0 && extendedMemory) { const u32 dsiSaveCreateT = 0x02019C98; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x02019CA8; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x02019CB8; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02019CC8; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x02019CD8; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x02019CE8; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02019CF8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02019D08; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u32*)0x02015040 = 0xE1A00000; // nop *(u32*)0x020186D0 = 0xE1A00000; // nop @@ -4926,7 +4926,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0206C078 = 0xE3A00001; // mov r0, #1 (dsiSaveFreeSpaceAvailable) *(u32*)0x0206C09C = 0xE12FFF1E; // bx lr *(u32*)0x0207569C = 0xE1A00000; // nop - tonccpy((u32*)0x020771C0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020771C0, dsiSaveGetResultCode, 0xC); *(u32*)0x02079EB0 = 0xE1A00000; // nop patchInitDSiWare(0x02080EC0, heapEnd); *(u32*)0x0208124C = 0x020E0380; @@ -4942,7 +4942,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050E0 = 0xE1A00000; // nop *(u32*)0x02005158 = 0xE1A00000; // nop (Work around save-related crash) *(u32*)0x02014304 = 0xE1A00000; // nop - //tonccpy((u32*)0x02014E88, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x02014E88, dsiSaveGetResultCode, 0xC); *(u32*)0x02017C38 = 0xE1A00000; // nop patchInitDSiWare(0x0201D718, heapEnd); *(u32*)0x0201DAA4 -= 0x30000; @@ -5082,7 +5082,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Itsudemo Bomberman (Japan) else if (strncmp(romTid, "KBB", 3) == 0) { *(u32*)0x02008988 = 0xE1A00000; // nop - tonccpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); *(u32*)0x0200C280 = 0xE1A00000; // nop patchInitDSiWare(0x02014638, heapEnd); *(u32*)0x020149A8 = *(u32*)0x02004FC0; @@ -5252,7 +5252,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u32 offsetChange = (romTid[3] == 'E') ? 0 : 4; *(u32*)(0x0200FF00-offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x02010A84-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02010A84-offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x02013254-offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x020189F4-offsetChange, heapEnd); *(u32*)(0x02018D80-offsetChange) = *(u32*)0x02004FE8; @@ -5385,7 +5385,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007698, (u32)dsiSaveWrite); setBL(0x020076A0, (u32)dsiSaveClose); */ *(u32*)0x0202CE74 = 0xE1A00000; // nop - // tonccpy((u32*)0x0202D9F8, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x0202D9F8, dsiSaveGetResultCode, 0xC); *(u32*)0x02030830 = 0xE1A00000; // nop patchInitDSiWare(0x02035BE8, heapEnd); *(u32*)0x02035F74 = *(u32*)0x02004FE8; @@ -5414,7 +5414,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007600, (u32)dsiSaveWrite); setBL(0x02007608, (u32)dsiSaveClose); */ *(u32*)0x0202CDDC = 0xE1A00000; // nop - // tonccpy((u32*)0x0202D960, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x0202D960, dsiSaveGetResultCode, 0xC); *(u32*)0x02030798 = 0xE1A00000; // nop patchInitDSiWare(0x02035B50, heapEnd); *(u32*)0x02035EDC = *(u32*)0x02004FE8; @@ -5442,7 +5442,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200772C, (u32)dsiSaveWrite); setBL(0x02007734, (u32)dsiSaveClose); */ *(u32*)0x0202F178 = 0xE1A00000; // nop - // tonccpy((u32*)0x0202FCFC, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x0202FCFC, dsiSaveGetResultCode, 0xC); *(u32*)0x02032B34 = 0xE1A00000; // nop patchInitDSiWare(0x02037EEC, heapEnd); *(u32*)0x02038278 = *(u32*)0x02004FE8; @@ -5661,7 +5661,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { useSharedFont = twlFontFound; *(u32*)0x0201B334 = 0xE1A00000; // nop - tonccpy((u32*)0x0201BEB8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201BEB8, dsiSaveGetResultCode, 0xC); *(u32*)0x0201E7B0 = 0xE1A00000; // nop patchInitDSiWare(0x02024CE0, heapEnd); patchUserSettingsReadDSiWare(0x0202637C); @@ -5815,7 +5815,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202D258, (u32)dsiSaveWrite); setBL(0x0202D264, (u32)dsiSaveClose); *(u32*)0x02057938 = 0xE1A00000; // nop - tonccpy((u32*)0x020584CC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020584CC, dsiSaveGetResultCode, 0xC); *(u32*)0x0205B0FC = 0xE1A00000; // nop patchInitDSiWare(0x02062C24, heapEnd); *(u32*)0x02062FB0 = *(u32*)0x02004FE8; @@ -5857,7 +5857,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202D330, (u32)dsiSaveWrite); setBL(0x0202D33C, (u32)dsiSaveClose); *(u32*)0x02057A10 = 0xE1A00000; // nop - tonccpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); *(u32*)0x0205B1D4 = 0xE1A00000; // nop patchInitDSiWare(0x02062CFC, heapEnd); *(u32*)0x02063088 = *(u32*)0x02004FE8; @@ -5891,7 +5891,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0204CD80, (u32)dsiSaveWrite); setBL(0x0204CD8C, (u32)dsiSaveClose); *(u32*)0x020774AC = 0xE1A00000; // nop - tonccpy((u32*)0x02078040, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02078040, dsiSaveGetResultCode, 0xC); *(u32*)0x0207AC70 = 0xE1A00000; // nop patchInitDSiWare(0x020827C4, heapEnd); *(u32*)0x02082B50 = *(u32*)0x02004FE8; @@ -5925,7 +5925,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0204CDDC, (u32)dsiSaveWrite); setBL(0x0204CDE8, (u32)dsiSaveClose); *(u32*)0x02077508 = 0xE1A00000; // nop - tonccpy((u32*)0x0207809C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0207809C, dsiSaveGetResultCode, 0xC); *(u32*)0x0207ACCC = 0xE1A00000; // nop patchInitDSiWare(0x02082820, heapEnd); *(u32*)0x02082BAC = *(u32*)0x02004FE8; @@ -5960,7 +5960,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025B84, (u32)dsiSaveWrite); setBL(0x02025B90, (u32)dsiSaveClose); *(u32*)0x02050348 = 0xE1A00000; // nop - tonccpy((u32*)0x02050EDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02050EDC, dsiSaveGetResultCode, 0xC); *(u32*)0x02053B0C = 0xE1A00000; // nop patchInitDSiWare(0x0205B760, heapEnd); *(u32*)0x0205BAEC = *(u32*)0x02004FE8; @@ -5995,7 +5995,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025C10, (u32)dsiSaveWrite); setBL(0x02025C1C, (u32)dsiSaveClose); *(u32*)0x020503D4 = 0xE1A00000; // nop - tonccpy((u32*)0x02050F68, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02050F68, dsiSaveGetResultCode, 0xC); *(u32*)0x02053B98 = 0xE1A00000; // nop patchInitDSiWare(0x0205B7EC, heapEnd); *(u32*)0x0205BB78 = *(u32*)0x02004FE8; @@ -6037,7 +6037,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u8 offsetChange = (romTid[3] == 'E') ? 0 : 0xA4; *(u32*)0x020175F4 = 0xE1A00000; // nop - tonccpy((u32*)0x02018178, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018178, dsiSaveGetResultCode, 0xC); *(u32*)0x0201ADD4 = 0xE1A00000; // nop patchInitDSiWare(0x02021C14, heapEnd); // *(u32*)0x02021FA0 = *(u32*)0x02004FE8; @@ -6104,7 +6104,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)(0x0204D2D8-offsetChange) = 0xE12FFF1E; // bx lr *(u32*)(0x0205144C-offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x02051FD0-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02051FD0-offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x020549AC-offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0205BA1C-offsetChange, heapEnd); patchUserSettingsReadDSiWare(0x0205CEF8-offsetChange); @@ -6126,7 +6126,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0201DBB8 -= 0x30000; patchUserSettingsReadDSiWare(0x0201ECBC); *(u32*)0x02024740 = 0xE1A00000; // nop - tonccpy((u32*)0x020252B8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020252B8, dsiSaveGetResultCode, 0xC); *(u32*)0x02027A00 = 0xE1A00000; // nop if (!extendedMemory) { *(u32*)0x0203D44C = 0x2C00C8; // Shrink sound heap from 0x3000C8 @@ -6163,7 +6163,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Crashes on some file function after company logo /*else if (strncmp(romTid, "KCN", 3) == 0) { *(u32*)0x02016340 = 0xE1A00000; // nop - tonccpy((u32*)0x02016EC4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016EC4, dsiSaveGetResultCode, 0xC); *(u32*)0x02019694 = 0xE1A00000; // nop *(u32*)0x0201D330 = 0xE1A00000; // nop *(u32*)0x0201F0CC = 0xE1A00000; // nop @@ -6321,7 +6321,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // } *(u32*)0x02017744 = 0xE1A00000; // nop - tonccpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); *(u32*)0x0201AB7C = 0xE1A00000; // nop patchInitDSiWare(0x02020544, heapEnd); *(u32*)0x020208D0 = *(u32*)0x02004FE8; @@ -6389,7 +6389,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // } *(u32*)0x02017670 = 0xE1A00000; // nop - tonccpy((u32*)0x02018248, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018248, dsiSaveGetResultCode, 0xC); *(u32*)0x0201AAA8 = 0xE1A00000; // nop patchInitDSiWare(0x02020470, heapEnd); *(u32*)0x020207FC = *(u32*)0x02004FE8; @@ -6441,13 +6441,13 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // } *(u32*)0x02013170 = 0xE1A00000; // nop - tonccpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); /* if (!extendedMemory) { if (s2FlashcardId == 0x5A45) { cch2HeapAddrPtr[0] -= 0x01000000; } - tonccpy((u32*)0x0201473C, mepHeapSetPatch, 0x70); - tonccpy((u32*)0x0201D810, cch2HeapAlloc, 0xBC); + __aeabi_memcpy((u32*)0x0201473C, mepHeapSetPatch, 0x70); + __aeabi_memcpy((u32*)0x0201D810, cch2HeapAlloc, 0xBC); } */ *(u32*)0x020164C4 = 0xE1A00000; // nop patchInitDSiWare(0x0201BE28, heapEnd); @@ -6645,7 +6645,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { useSharedFont = twlFontFound; *(u32*)0x020050EC = 0xE1A00000; // nop *(u32*)0x020176F4 = 0xE1A00000; // nop - tonccpy((u32*)0x02018278, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018278, dsiSaveGetResultCode, 0xC); *(u32*)0x0201AED4 = 0xE1A00000; // nop patchInitDSiWare(0x02021B28, heapEnd); // *(u32*)0x02021EB4 = *(u32*)0x02004FE8; @@ -6714,7 +6714,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200A12C = 0xE1A00000; // nop (Skip Manual screen) //} *(u32*)0x0207342C = 0xE1A00000; // nop - tonccpy((u32*)0x02073FA4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02073FA4, dsiSaveGetResultCode, 0xC); *(u32*)0x0207654C = 0xE1A00000; // nop patchInitDSiWare(0x0207C180, heapEnd); patchUserSettingsReadDSiWare(0x0207D758); @@ -7249,7 +7249,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { extern u32* mepHeapSetPatch; extern u32* elementalistsHeapAlloc; - tonccpy((u32*)0x02002004, mepHeapSetPatch, 0x1C); + __aeabi_memcpy((u32*)0x02002004, mepHeapSetPatch, 0x1C); *(u32*)0x0200C038 = 0xE1A00000; // nop *(u32*)0x0200C160 = 0xE1A00000; // nop @@ -7262,7 +7262,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0201877C = 0xE12FFF1E; // bx lr *(u32*)0x02018784 = 0xE3A00000; // mov r0, #0 *(u32*)0x02018788 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02018C50, elementalistsHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x02018C50, elementalistsHeapAlloc, 0xC0); if (romTid[3] == 'E') { *(u32*)0x0202627C = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) setBL(0x02027524, 0x02018C50); @@ -7299,7 +7299,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037594, (u32)dsiSaveClose); setBL(0x020376A8, (u32)dsiSaveRead); setBL(0x020376E4, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D0A8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D0A8, dsiSaveGetResultCode, 0xC); *(u32*)0x0205FE18 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) // *(u32*)0x020720F4 = 0xE3A00001; // mov r0, #1 (Enable TWL soft-reset function) } @@ -7316,7 +7316,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037540, (u32)dsiSaveClose); setBL(0x02037654, (u32)dsiSaveRead); setBL(0x02037690, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D0FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D0FC, dsiSaveGetResultCode, 0xC); *(u32*)0x0205FD10 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7332,7 +7332,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02038750, (u32)dsiSaveClose); setBL(0x02038864, (u32)dsiSaveRead); setBL(0x020388A0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E154, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E154, dsiSaveGetResultCode, 0xC); *(u32*)0x02060EC4 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7348,7 +7348,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020371AC, (u32)dsiSaveClose); setBL(0x020372BC, (u32)dsiSaveRead); setBL(0x020372F0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205C1FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205C1FC, dsiSaveGetResultCode, 0xC); *(u32*)0x0205EDBC = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7364,7 +7364,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037044, (u32)dsiSaveClose); setBL(0x02037154, (u32)dsiSaveRead); setBL(0x02037188, (u32)dsiSaveClose); - tonccpy((u32*)0x0205EB40, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205EB40, dsiSaveGetResultCode, 0xC); *(u32*)0x02061700 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7380,7 +7380,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02038AD4, (u32)dsiSaveClose); setBL(0x02038BE8, (u32)dsiSaveRead); setBL(0x02038C24, (u32)dsiSaveClose); - tonccpy((u32*)0x02060D9C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060D9C, dsiSaveGetResultCode, 0xC); *(u32*)0x020639B0 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7396,7 +7396,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02038A94, (u32)dsiSaveClose); setBL(0x02038BA8, (u32)dsiSaveRead); setBL(0x02038BE4, (u32)dsiSaveClose); - tonccpy((u32*)0x02060CE4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060CE4, dsiSaveGetResultCode, 0xC); *(u32*)0x020638F8 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7412,7 +7412,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037970, (u32)dsiSaveClose); setBL(0x02037A84, (u32)dsiSaveRead); setBL(0x02037AC0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D388, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D388, dsiSaveGetResultCode, 0xC); *(u32*)0x020600F8 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7428,7 +7428,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0203723C, (u32)dsiSaveClose); setBL(0x0203734C, (u32)dsiSaveRead); setBL(0x02037380, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E388, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E388, dsiSaveGetResultCode, 0xC); *(u32*)0x02060F48 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7444,7 +7444,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037A14, (u32)dsiSaveClose); setBL(0x02037B24, (u32)dsiSaveRead); setBL(0x02037B58, (u32)dsiSaveClose); - tonccpy((u32*)0x0205CB04, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205CB04, dsiSaveGetResultCode, 0xC); *(u32*)0x0205F6C4 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7460,7 +7460,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020388D4, (u32)dsiSaveClose); setBL(0x020389E8, (u32)dsiSaveRead); setBL(0x02038A24, (u32)dsiSaveClose); - tonccpy((u32*)0x02060C24, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060C24, dsiSaveGetResultCode, 0xC); *(u32*)0x02063838 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7476,7 +7476,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02038888, (u32)dsiSaveClose); setBL(0x0203899C, (u32)dsiSaveRead); setBL(0x020389D8, (u32)dsiSaveClose); - tonccpy((u32*)0x02060B60, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060B60, dsiSaveGetResultCode, 0xC); *(u32*)0x02063774 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7492,7 +7492,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02037B48, (u32)dsiSaveClose); setBL(0x02037C5C, (u32)dsiSaveRead); setBL(0x02037C98, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D744, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D744, dsiSaveGetResultCode, 0xC); *(u32*)0x020604B4 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7508,7 +7508,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020370CC, (u32)dsiSaveClose); setBL(0x020371DC, (u32)dsiSaveRead); setBL(0x02037210, (u32)dsiSaveClose); - tonccpy((u32*)0x0205C078, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205C078, dsiSaveGetResultCode, 0xC); *(u32*)0x0205EC38 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7524,7 +7524,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0203707C, (u32)dsiSaveClose); setBL(0x0203718C, (u32)dsiSaveRead); setBL(0x020371C0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E270, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E270, dsiSaveGetResultCode, 0xC); *(u32*)0x02060E30 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -7555,7 +7555,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u8 offsetChangeS = (romTid[3] == 'E') ? 0 : 0x1C; *(u32*)(0x0200C394-offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x0200CF18-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0200CF18-offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x0200F8C8-offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0201481C-offsetChange, heapEnd); *(u32*)(0x02014BA8-offsetChange) = *(u32*)0x02004FE8; @@ -7617,7 +7617,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (strcmp(romTid, "KH5J") == 0) { *(u32*)0x02008188 = 0xE1A00000; // nop *(u32*)0x0204017C = 0xE1A00000; // nop - tonccpy((u32*)0x02040E10, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040E10, dsiSaveGetResultCode, 0xC); *(u32*)0x020441DC = 0xE1A00000; // nop *(u32*)0x0204C440 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204C458, heapEnd); @@ -7631,7 +7631,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } else { *(u32*)0x0200D9F0 = 0xE1A00000; // nop *(u32*)0x0204599C = 0xE1A00000; // nop - tonccpy((u32*)0x02046630, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02046630, dsiSaveGetResultCode, 0xC); *(u32*)0x020499FC = 0xE1A00000; // nop *(u32*)0x02051C60 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x02051C78, heapEnd); @@ -7649,7 +7649,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Coropata (Japan) else if (strcmp(romTid, "K56J") == 0) { *(u32*)0x020110B8 = 0xE1A00000; // nop - tonccpy((u32*)0x02011C3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011C3C, dsiSaveGetResultCode, 0xC); *(u32*)0x02014610 = 0xE1A00000; // nop patchInitDSiWare(0x0201AFC4, heapEnd); *(u32*)0x0201B350 = *(u32*)0x02004FE8; @@ -7784,31 +7784,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KDCE") == 0) { const u32 dsiSaveCreateT = 0x02024B0C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02024B1C; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02024B2C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02024B3C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02024B4C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02024B5C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02024B6C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200DF38 = 0x2001; // movs r0, #1 *(u16*)0x0200DF3A = 0x4770; // bx lr @@ -7822,7 +7822,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200E2D4, dsiSaveWriteT); setBLThumb(0x0200E2E6, dsiSaveCloseT); *(u16*)0x0200E30C = 0x4778; // bx pc - tonccpy((u32*)0x0200E310, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200E310, dsiSaveGetLength, 0xC); setBLThumb(0x0200E33C, dsiSaveOpenT); setBLThumb(0x0200E362, dsiSaveCloseT); setBLThumb(0x0200E374, dsiSaveReadT); @@ -8056,7 +8056,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // useSharedFont = twlFontFound; *(u32*)0x0201B8CC = 0xE1A00000; // nop - tonccpy((u32*)0x0201C450, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C450, dsiSaveGetResultCode, 0xC); *(u32*)0x0201ED48 = 0xE1A00000; // nop patchInitDSiWare(0x02025278, heapEnd); *(u32*)0x02025604 = *(u32*)0x02004FE8; @@ -8226,7 +8226,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x02042A8C = 0xE1A00000; // nop - tonccpy((u32*)0x02043610, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043610, dsiSaveGetResultCode, 0xC); *(u32*)0x02046A20 = 0xE1A00000; // nop patchInitDSiWare(0x0204E97C, heapEnd); if (!extendedMemory) { @@ -8239,7 +8239,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else if (romTid[3] == 'P') { *(u32*)0x02042AA4 = 0xE1A00000; // nop - tonccpy((u32*)0x0204361C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204361C, dsiSaveGetResultCode, 0xC); *(u32*)0x020469A4 = 0xE1A00000; // nop patchInitDSiWare(0x0204E8C0, heapEnd); if (!extendedMemory) { @@ -8252,7 +8252,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x02042A40 = 0xE1A00000; // nop - tonccpy((u32*)0x020435C4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020435C4, dsiSaveGetResultCode, 0xC); *(u32*)0x020469D4 = 0xE1A00000; // nop patchInitDSiWare(0x0204E930, heapEnd); if (!extendedMemory) { @@ -8291,7 +8291,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020078DC = 0xE12FFF1E; // bx lr *(u32*)0x02008164 = 0xE1A00000; // nop *(u32*)0x02040244 = 0xE1A00000; // nop - tonccpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); *(u32*)0x02044144 = 0xE1A00000; // nop patchInitDSiWare(0x0204C060, heapEnd); if (!extendedMemory) { @@ -8427,7 +8427,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x0204303C = 0xE1A00000; // nop - tonccpy((u32*)0x02043BC0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043BC0, dsiSaveGetResultCode, 0xC); *(u32*)0x02046FD0 = 0xE1A00000; // nop patchInitDSiWare(0x0204EFA8, heapEnd); if (!extendedMemory) { @@ -8440,7 +8440,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x02043054 = 0xE1A00000; // nop - tonccpy((u32*)0x02043BCC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043BCC, dsiSaveGetResultCode, 0xC); *(u32*)0x02046F54 = 0xE1A00000; // nop patchInitDSiWare(0x0204EEEC, heapEnd); if (!extendedMemory) { @@ -8479,7 +8479,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02007A94 = 0xE12FFF1E; // bx lr *(u32*)0x0200831C = 0xE1A00000; // nop *(u32*)0x020406C8 = 0xE1A00000; // nop - tonccpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); *(u32*)0x020445C8 = 0xE1A00000; // nop patchInitDSiWare(0x0204C560, heapEnd); if (!extendedMemory) { @@ -8498,7 +8498,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // useSharedFont = (twlFontFound && debugOrMep); *(u32*)0x02018A3C = 0xE1A00000; // nop *(u32*)0x02018A4C = 0xE1A00000; // nop - tonccpy((u32*)0x02043DDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043DDC, dsiSaveGetResultCode, 0xC); *(u32*)0x02046DD8 = 0xE1A00000; // nop *(u32*)0x0204EE80 = 0xE1A00000; // nop patchInitDSiWare(0x0204EE8C, heapEnd); @@ -8666,7 +8666,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200B4A8, (u32)dsiSaveWrite); setBL(0x0200B4C0, (u32)dsiSaveClose); *(u32*)0x0205CE4C = 0xE1A00000; // nop - tonccpy((u32*)0x0205D9D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D9D0, dsiSaveGetResultCode, 0xC); *(u32*)0x02061130 = 0xE1A00000; // nop patchInitDSiWare(0x02068918, heapEnd); *(u32*)0x02068CA4 -= 0x39000; @@ -8698,13 +8698,13 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200D344 = 0xE1A00000; // nop if (romTid[3] != 'J') { *(u32*)0x02049F68 = 0xE1A00000; // nop - tonccpy((u32*)0x0204AAEC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204AAEC, dsiSaveGetResultCode, 0xC); *(u32*)0x0204DC94 = 0xE1A00000; // nop patchInitDSiWare(0x02055548, heapEnd); patchUserSettingsReadDSiWare(0x02056A24); } else { *(u32*)0x02049D70 = 0xE1A00000; // nop - tonccpy((u32*)0x0204A8E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204A8E8, dsiSaveGetResultCode, 0xC); *(u32*)0x0204DA90 = 0xE1A00000; // nop patchInitDSiWare(0x02055328, heapEnd); patchUserSettingsReadDSiWare(0x020567F4); @@ -9047,7 +9047,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KD9E") == 0 || strcmp(romTid, "KD9V") == 0) { // useSharedFont = twlFontFound; *(u32*)0x020103C4 = 0xE3A00000; // mov r0, #0 - tonccpy((u32*)0x02011160, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011160, dsiSaveGetResultCode, 0xC); *(u32*)0x02013A08 = 0xE3A00000; // mov r0, #0 *(u32*)0x02019DF4 = 0xE3A00000; // mov r0, #0 *(u32*)0x0201B724 = 0xE3A00001; // mov r0, #1 @@ -9122,7 +9122,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // useSharedFont = twlFontFound; *(u32*)0x020052B0 = 0xE3A00000; // mov r0, #0 *(u32*)0x02010B08 = 0xE3A00000; // mov r0, #0 - tonccpy((u32*)0x020118A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020118A4, dsiSaveGetResultCode, 0xC); *(u32*)0x02013E58 = 0xE3A00000; // mov r0, #0 *(u32*)0x0201A244 = 0xE3A00000; // mov r0, #0 *(u32*)0x0201BB74 = 0xE3A00001; // mov r0, #1 @@ -9565,7 +9565,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x02041C2C = 0xE1A00000; // nop - tonccpy((u32*)0x020427B0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020427B0, dsiSaveGetResultCode, 0xC); *(u32*)0x02045BC0 = 0xE1A00000; // nop patchInitDSiWare(0x0204DBA8, heapEnd); if (!extendedMemory) { @@ -9578,7 +9578,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x02041BE0 = 0xE1A00000; // nop - tonccpy((u32*)0x02042764, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042764, dsiSaveGetResultCode, 0xC); *(u32*)0x02045B74 = 0xE1A00000; // nop patchInitDSiWare(0x0204DB5C, heapEnd); if (!extendedMemory) { @@ -9617,7 +9617,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008260 = 0xE12FFF1E; // bx lr *(u32*)0x02008AE8 = 0xE1A00000; // nop *(u32*)0x02041448 = 0xE1A00000; // nop - tonccpy((u32*)0x020420DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020420DC, dsiSaveGetResultCode, 0xC); *(u32*)0x020454A8 = 0xE1A00000; // nop *(u32*)0x0204D79C = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204D7B4, heapEnd); @@ -9656,7 +9656,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02009818 = 0xE12FFF1E; // bx lr *(u32*)0x0200A0A8 = 0xE1A00000; // nop *(u32*)0x02042944 = 0xE1A00000; // nop - tonccpy((u32*)0x020434BC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020434BC, dsiSaveGetResultCode, 0xC); *(u32*)0x02046844 = 0xE1A00000; // nop patchInitDSiWare(0x0204E7EC, heapEndMaxForRetail); if (!extendedMemory) { @@ -9702,7 +9702,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)(0x020583D4+offsetChange2) = 0xE12FFF1E; // bx lr (Disable NFTR loading from TWLNAND) *(u32*)(0x020A8BD8+offsetChangeInit) = 0xE1A00000; // nop - tonccpy((u32*)(0x020AA6B4+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x020AA6B4+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x020AD198+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x020BA3A4+offsetChangeInit, heapEnd); *(u32*)(0x020BA730+offsetChangeInit) = *(u32*)(0x020D7270+offsetChangeInit); @@ -9735,7 +9735,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020084F8, (u32)dsiSaveClose); */ *(u32*)0x0200BCF0 = 0xE1A00000; // nop *(u32*)0x0204D480 = 0xE1A00000; // nop - // tonccpy((u32*)0x0204E004, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x0204E004, dsiSaveGetResultCode, 0xC); *(u32*)0x02051414 = 0xE1A00000; // nop patchInitDSiWare(0x020595F8, heapEnd); if (!extendedMemory) { @@ -9775,7 +9775,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200827C = 0xE12FFF1E; // bx lr *(u32*)0x02008B04 = 0xE1A00000; // nop *(u32*)0x02040F5C = 0xE1A00000; // nop - tonccpy((u32*)0x02041AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041AD4, dsiSaveGetResultCode, 0xC); *(u32*)0x02044E5C = 0xE1A00000; // nop patchInitDSiWare(0x0204CD78, heapEnd); if (!extendedMemory) { @@ -9847,7 +9847,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200AE58, (u32)dsiSaveGetInfo); *(u32*)0x02036398 = 0xE1A00000; // nop *(u32*)0x0204BFE8 = 0xE1A00000; // nop - tonccpy((u32*)0x0204CB6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204CB6C, dsiSaveGetResultCode, 0xC); *(u32*)0x0204F548 = 0xE1A00000; // nop patchInitDSiWare(0x0205619C, heapEnd); patchUserSettingsReadDSiWare(0x02057678); @@ -9883,7 +9883,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02036394 = 0xE1A00000; // nop *(u32*)0x02047D50 = 0xE12FFF1E; // bx lr *(u32*)0x0204BEEC = 0xE1A00000; // nop - tonccpy((u32*)0x0204CA70, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204CA70, dsiSaveGetResultCode, 0xC); *(u32*)0x0204F44C = 0xE1A00000; // nop patchInitDSiWare(0x020560A0, heapEnd); patchUserSettingsReadDSiWare(0x0205757C); @@ -9916,7 +9916,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200FF44 = 0xE12FFF1E; // bx lr (Skip Manual screen, Part 1) *(u32*)0x0203092C = 0xE12FFF1E; // bx lr *(u32*)0x02034AD4 = 0xE1A00000; // nop - tonccpy((u32*)0x0203564C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203564C, dsiSaveGetResultCode, 0xC); *(u32*)0x02037FA0 = 0xE1A00000; // nop patchInitDSiWare(0x0203EBBC, heapEnd); patchUserSettingsReadDSiWare(0x02040088); @@ -9950,7 +9950,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020360E8 = 0xE1A00000; // nop *(u32*)0x02047A88 = 0xE12FFF1E; // bx lr *(u32*)0x0204BC24 = 0xE1A00000; // nop - tonccpy((u32*)0x0204C79C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204C79C, dsiSaveGetResultCode, 0xC); *(u32*)0x0204F0F0 = 0xE1A00000; // nop patchInitDSiWare(0x02055D0C, heapEnd); patchUserSettingsReadDSiWare(0x020571D8); @@ -10530,10 +10530,10 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200526C = 0xE1A00000; // nop /*if (!extendedMemory) { *(u32*)0x02046374 = (u32)getOffsetFromBL((u32*)0x02005508); - tonccpy((u32*)0x02046378, elePlHeapAlloc, 0xBC); + __aeabi_memcpy((u32*)0x02046378, elePlHeapAlloc, 0xBC); *(u32*)0x02003000 = (u32)getOffsetFromBL((u32*)0x020331FC); - tonccpy((u32*)0x02003004, mepHeapSetPatch, 0x1C); + __aeabi_memcpy((u32*)0x02003004, mepHeapSetPatch, 0x1C); setBL(0x02005508, 0x02046378); setBL(0x020331FC, 0x02003004); @@ -10773,7 +10773,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02011258, (u32)dsiSaveWrite); setBL(0x02011264, (u32)dsiSaveClose); *(u32*)0x0205CE84 = 0xE1A00000; // nop - tonccpy((u32*)0x0205DA08, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205DA08, dsiSaveGetResultCode, 0xC); *(u32*)0x020609EC = 0xE1A00000; // nop patchInitDSiWare(0x020679D4, heapEndExceed); patchUserSettingsReadDSiWare(0x02068EB0); @@ -10827,7 +10827,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008338 = 0xE12FFF1E; // bx lr *(u32*)0x02008BC8 = 0xE1A00000; // nop *(u32*)0x02040938 = 0xE1A00000; // nop - tonccpy((u32*)0x020414B0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020414B0, dsiSaveGetResultCode, 0xC); *(u32*)0x02044838 = 0xE1A00000; // nop patchInitDSiWare(0x0204C754, heapEnd); /* if (!extendedMemory) { @@ -10909,7 +10909,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KFKE") == 0) { *(u32*)0x020050D0 = 0xE1A00000; // nop *(u32*)0x0200E938 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F4CC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F4CC, dsiSaveGetResultCode, 0xC); *(u32*)0x02011EE4 = 0xE1A00000; // nop patchInitDSiWare(0x020178F4, heapEnd); patchUserSettingsReadDSiWare(0x02019090); @@ -10951,35 +10951,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { const u32 dsiSaveCreateT = 0x020370F4-offsetChange2; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); // Original function overwritten, no BL setting needed + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); // Original function overwritten, no BL setting needed const u32 dsiSaveSetLengthT = 0x02037104-offsetChange2; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02037114-offsetChange2; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveOpenRT = 0x02037124-offsetChange2; *(u16*)dsiSaveOpenRT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenRT + 4), dsiSaveOpenR, 0x10); + __aeabi_memcpy((u32*)(dsiSaveOpenRT + 4), dsiSaveOpenR, 0x10); const u32 dsiSaveCloseT = 0x02037138-offsetChange2; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02037148-offsetChange2; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02037300-offsetChange2; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0203725C-offsetChange2; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); // Original function overwritten, no BL setting needed + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); // Original function overwritten, no BL setting needed /* *(u16*)(0x020271CC-offsetChange) = 0x2001; // movs r0, #1 *(u16*)(0x020271CE-offsetChange) = 0x4770; // bx lr @@ -11086,7 +11086,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Fizz (USA) else if (strcmp(romTid, "KZZE") == 0) { *(u32*)0x020106E8 = 0xE1A00000; // nop - tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); *(u32*)0x0201391C = 0xE1A00000; // nop patchInitDSiWare(0x02018BD8, heapEnd8MBHack); *(u32*)0x02018F64 = 0x0213B440; @@ -11146,39 +11146,39 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KKRE") == 0 || strcmp(romTid, "KKRP") == 0) { const u32 dsiSaveCreateT = 0x0209B380; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x0209B390; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0209B3A0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x0209B3B0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x0209B3C0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveSetLengthT = 0x0209B408; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadAsyncT = 0x0209B5F4; *(u16*)dsiSaveReadAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); /* const u32 dsiSaveWriteT = 0x0209B63C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); */ + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); */ const u32 dsiSaveWriteAsyncT = 0x0209B66C; *(u16*)dsiSaveWriteAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); doubleNopT(0x02015390); doubleNopT(0x020157A0); @@ -11559,7 +11559,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Frogger Returns (USA) else if (strcmp(romTid, "KFGE") == 0) { *(u32*)0x020117D4 = 0xE1A00000; // nop - tonccpy((u32*)0x0201234C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201234C, dsiSaveGetResultCode, 0xC); *(u32*)0x020152F0 = 0xE1A00000; // nop patchInitDSiWare(0x0201BFB4, heapEnd); *(u32*)0x0201C340 = *(u32*)0x02004FD0; @@ -11878,7 +11878,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02041054, (u32)dsiSaveWrite); setBL(0x02041070, (u32)dsiSaveClose); setBL(0x0204108C, (u32)dsiSaveClose); - tonccpy((u32*)0x0205AEB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205AEB4, dsiSaveGetResultCode, 0xC); *(u32*)0x0205D3B8 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -11900,7 +11900,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02040B4C, (u32)dsiSaveWrite); setBL(0x02040B68, (u32)dsiSaveClose); setBL(0x02040B84, (u32)dsiSaveClose); - tonccpy((u32*)0x02058E14, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02058E14, dsiSaveGetResultCode, 0xC); *(u32*)0x0205B318 = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) } @@ -11946,7 +11946,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! (USA) else if (strcmp(romTid, "KGXE") == 0) { *(u32*)0x02010CA0 = 0xE1A00000; // nop - tonccpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); *(u32*)0x020143C0 = 0xE1A00000; // nop patchInitDSiWare(0x0201BB38, heapEnd); patchUserSettingsReadDSiWare(0x0201D014); @@ -11971,7 +11971,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! (Japan) else if (strcmp(romTid, "KGXJ") == 0) { *(u32*)0x02010CA0 = 0xE1A00000; // nop - tonccpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); *(u32*)0x02014A6C = 0xE1A00000; // nop patchInitDSiWare(0x0201C4F8, heapEnd); patchUserSettingsReadDSiWare(0x0201D9D4); @@ -11997,7 +11997,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! 2 (Japan) else if (strcmp(romTid, "KKFE") == 0 || strcmp(romTid, "KKFJ") == 0) { *(u32*)0x020187A8 = 0xE1A00000; // nop - tonccpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); *(u32*)0x0201C634 = 0xE1A00000; // nop patchInitDSiWare(0x02028FDC, heapEnd); patchUserSettingsReadDSiWare(0x0202A68C); @@ -12057,7 +12057,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005088 = 0xE1A00000; // nop *(u32*)0x02005090 = 0xE1A00000; // nop *(u32*)(0x02014CE0-offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x02015874-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02015874-offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x020183AC-offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0201D9C0-offsetChange, heapEnd); setBL(0x0202AD60-offsetChangeS, (u32)dsiSaveCreate); @@ -12099,7 +12099,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (!extendedMemory) { extern u32* goGoKokopoloHeapAlloc; - tonccpy((u32*)0x0201DB58, (u32*)goGoKokopoloHeapAlloc, 0xC); + __aeabi_memcpy((u32*)0x0201DB58, (u32*)goGoKokopoloHeapAlloc, 0xC); } *(u32*)0x02012738 = 0xE1A00000; // nop @@ -12203,7 +12203,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "K3GJ") == 0) { if (!extendedMemory) { extern u32* goGoKokopoloHeapAlloc; - tonccpy((u32*)0x0201DB88, (u32*)goGoKokopoloHeapAlloc, 0xC); + __aeabi_memcpy((u32*)0x0201DB88, (u32*)goGoKokopoloHeapAlloc, 0xC); } *(u32*)0x02012768 = 0xE1A00000; // nop @@ -12407,7 +12407,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KHOJ") == 0) { useSharedFont = twlFontFound; *(u32*)0x0200B534 = 0xE1A00000; // nop - tonccpy((u32*)0x0200C1D4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200C1D4, dsiSaveGetResultCode, 0xC); *(u32*)0x0200F0D4 = 0xE1A00000; // nop patchInitDSiWare(0x0201CA9C, heapEnd); patchUserSettingsReadDSiWare(0x0201E0E8); @@ -12449,31 +12449,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KDHE") == 0) { const u32 dsiSaveCreateT = 0x020238C8; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x020238D8; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x020238E8; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x020238F8; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02023908; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02023918; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02023928; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200D060 = 0x2001; // movs r0, #1 *(u16*)0x0200D062 = 0x4770; // bx lr @@ -12486,7 +12486,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200D3FC, dsiSaveWriteT); setBLThumb(0x0200D40E, dsiSaveCloseT); *(u16*)0x0200D434 = 0x4778; // bx pc - tonccpy((u32*)0x0200D438, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200D438, dsiSaveGetLength, 0xC); setBLThumb(0x0200D464, dsiSaveOpenT); setBLThumb(0x0200D48A, dsiSaveCloseT); setBLThumb(0x0200D49C, dsiSaveReadT); @@ -12682,7 +12682,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // High Stakes Texas Hold'em (Europe, Australia) else if (strcmp(romTid, "KTXE") == 0 || strcmp(romTid, "KTXV") == 0) { *(u32*)0x0200E1A0 = 0xE1A00000; // nop - tonccpy((u32*)0x0200EE34, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200EE34, dsiSaveGetResultCode, 0xC); *(u32*)0x02011F20 = 0xE1A00000; // nop patchInitDSiWare(0x0201AF98, heapEnd); // *(u32*)0x0201B308 = *(u32*)0x02004FC0; @@ -12812,7 +12812,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x020413EC = 0xE1A00000; // nop - tonccpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); *(u32*)0x02045380 = 0xE1A00000; // nop patchInitDSiWare(0x0204D368, heapEnd); if (!extendedMemory) { @@ -12826,7 +12826,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x02041404 = 0xE1A00000; // nop - tonccpy((u32*)0x02041F7C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041F7C, dsiSaveGetResultCode, 0xC); *(u32*)0x02045304 = 0xE1A00000; // nop patchInitDSiWare(0x0204D2AC, heapEnd); if (!extendedMemory) { @@ -12866,7 +12866,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02007A20 = 0xE12FFF1E; // bx lr *(u32*)0x020082A8 = 0xE1A00000; // nop *(u32*)0x02040C18 = 0xE1A00000; // nop - tonccpy((u32*)0x020418AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020418AC, dsiSaveGetResultCode, 0xC); *(u32*)0x02044C78 = 0xE1A00000; // nop *(u32*)0x0204CF68 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204CF80, heapEnd); @@ -12903,7 +12903,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0201253C = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x02012540 = 0xE12FFF1E; // bx lr *(u32*)0x0202BAD0 = 0xE1A00000; // nop - tonccpy((u32*)0x0202C764, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202C764, dsiSaveGetResultCode, 0xC); *(u32*)0x0202F998 = 0xE1A00000; // nop *(u32*)0x020373A8 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x020373C0, heapEnd); @@ -13034,7 +13034,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u16 offsetChangeS = (romTid[3] == 'X') ? 0 : 0x344; *(u32*)0x020124D4 = 0xE1A00000; // nop - tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); *(u32*)0x02015BAC = 0xE1A00000; // nop patchInitDSiWare(0x02025468, heapEnd); patchUserSettingsReadDSiWare(0x02026990); @@ -13067,7 +13067,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Ivy the Kiwi? mini (Japan) else if (strcmp(romTid, "KIKJ") == 0) { *(u32*)0x020124D4 = 0xE1A00000; // nop - tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); *(u32*)0x02015B74 = 0xE1A00000; // nop patchInitDSiWare(0x0202546C, heapEnd); patchUserSettingsReadDSiWare(0x02026994); @@ -13222,7 +13222,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201EC38-offsetChange, (u32)dsiSaveRead); setBL(0x0201EC40-offsetChange, (u32)dsiSaveClose); *(u32*)(0x02031EC4-offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x02032A48-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02032A48-offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x02035578-offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0203B404-offsetChange, heapEnd); patchUserSettingsReadDSiWare(0x0203CA58-offsetChange); @@ -13250,7 +13250,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201E974, (u32)dsiSaveWrite); *(u32*)0x0203E324 = 0xE12FFF1E; // bx lr (Skip Manual screen) *(u32*)0x02044FD8 = 0xE1A00000; // nop - tonccpy((u32*)0x02046AB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02046AB4, dsiSaveGetResultCode, 0xC); *(u32*)0x020499F4 = 0xE1A00000; // nop patchInitDSiWare(0x0205050C, heapEnd); patchUserSettingsReadDSiWare(0x02051BA0); @@ -13262,35 +13262,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { /* else if (strcmp(romTid, "K43E") == 0 || strcmp(romTid, "K43P") == 0) { const u32 dsiSaveCreateT = 0x020B18B0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020B18C0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020B18D0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x020B18E0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x020B18F0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveSetLengthT = 0x020B1938; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadAsyncT = 0x020B1B24; *(u16*)dsiSaveReadAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteAsyncT = 0x020B1B9C; *(u16*)dsiSaveWriteAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); *(u16*)0x0206C40C = 0x4770; // bx lr (Skip NAND error checking) setBLThumb(0x0206C460, dsiSaveCloseT); @@ -13503,29 +13503,29 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Just SING! 80's (USA) // Just SING! 80's (Europe) else if (strcmp(romTid, "KJFE") == 0 || strcmp(romTid, "KJFP") == 0) { - tonccpy((u32*)0x02070968, dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)0x02070968, dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02070974; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02070984; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x02070994; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x020709A4; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); - tonccpy((u32*)0x02070A58, dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)0x02070A58, dsiSaveSetLength, 0xC); - tonccpy((u32*)0x02070DC4, dsiSaveRead, 0xC); // dsiSaveReadAsync + __aeabi_memcpy((u32*)0x02070DC4, dsiSaveRead, 0xC); // dsiSaveReadAsync - tonccpy((u32*)0x02070E90, dsiSaveWrite, 0xC); // dsiSaveWriteAsync + __aeabi_memcpy((u32*)0x02070E90, dsiSaveWrite, 0xC); // dsiSaveWriteAsync doubleNopT(0x0200B7EA); doubleNopT(0x0200B9B8); @@ -13633,7 +13633,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Crashes after ESRB screen /* else if (strcmp(romTid, "KPAE") == 0 && extendedMemory) { *(u32*)0x020194A8 = 0xE1A00000; // nop - tonccpy((u32*)0x0201A020, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201A020, dsiSaveGetResultCode, 0xC); *(u32*)0x0201CFE4 = 0xE1A00000; // nop patchInitDSiWare(0x02023EB0, heapEnd); *(u32*)0x0202423C = (*(u32*)0x02004FD0)+0x50000; @@ -13657,7 +13657,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Crashes after title screen fades in /* else if (strcmp(romTid, "K69J") == 0) { *(u32*)0x02011138 = 0xE1A00000; // nop - tonccpy((u32*)0x02011DCC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011DCC, dsiSaveGetResultCode, 0xC); *(u32*)0x020147D8 = 0xE1A00000; // nop patchInitDSiWare(0x0201CA60, heapEnd); *(u32*)0x0201CDD0 = *(u32*)0x02004FC0; @@ -13842,7 +13842,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200E804 = 0xE1A00000; // nop *(u32*)0x0200E814 = 0xE1A00000; // nop *(u32*)0x02057A2C = 0xE1A00000; // nop - tonccpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); *(u32*)0x0205B650 = 0xE1A00000; // nop patchInitDSiWare(0x02061C68, heapEnd); patchUserSettingsReadDSiWare(0x020633E8); @@ -13903,7 +13903,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006230, (u32)dsiSaveWrite); setBL(0x0200624C, (u32)dsiSaveClose); *(u32*)0x0202AC54 = 0xE1A00000; // nop - tonccpy((u32*)0x0202B8E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202B8E8, dsiSaveGetResultCode, 0xC); *(u32*)0x0202E834 = 0xE1A00000; // nop patchInitDSiWare(0x020353AC, heapEnd); } @@ -13913,7 +13913,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005034 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x0200C124 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0200C128 = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0200CEA8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200CEA8, dsiSaveGetResultCode, 0xC); *(u32*)0x0200F7CC = 0xE1A00000; // nop patchInitDSiWare(0x02019DE0, heapEnd); *(u32*)0x0201A15C = *(u32*)0x02004FBC; @@ -14169,7 +14169,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { //u32* getLengthFunc = (u32*)0; *(u32*)0x020051CC = 0xE1A00000; // nop - tonccpy((u32*)0x0200F860, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F860, dsiSaveGetResultCode, 0xC); *(u32*)0x02012AAC = 0xE1A00000; // nop patchInitDSiWare(0x0201853C, heapEnd); *(u32*)0x020188C8 = *(u32*)0x02004FF4; @@ -14184,7 +14184,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { fourSwHeapAddrPtr[i] -= 0x01000000; } } - tonccpy((u32*)newCodeAddr, fourSwHeapAlloc, 0x1FC); + __aeabi_memcpy((u32*)newCodeAddr, fourSwHeapAlloc, 0x1FC); } *(u32*)0x02021F40 = 0xE1A00000; // nop (Fix glitched stage graphics) *(u32*)0x02056644 = 0xE3A00003; // mov r0, #3 @@ -14352,7 +14352,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005D64 = 0x4000; // Shrink unknown heap from 0x177000 } *(u32*)0x0201B6C8 = 0xE1A00000; // nop - tonccpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); *(u32*)0x0201F188 = 0xE1A00000; // nop patchInitDSiWare(0x020269E0, heapEnd); *(u32*)0x02026D6C -= 0x30000; @@ -14393,7 +14393,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005CA8 = 0x4000; // Shrink unknown heap from 0x177000 } *(u32*)0x0201B61C = 0xE1A00000; // nop - tonccpy((u32*)0x0201C1A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C1A0, dsiSaveGetResultCode, 0xC); *(u32*)0x0201F0DC = 0xE1A00000; // nop patchInitDSiWare(0x02026934, heapEnd); *(u32*)0x02026CC0 -= 0x30000; @@ -14509,7 +14509,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)(0x02051324+offsetChange5) = 0xE12FFF1E; // bx lr (Soft-lock instead of displaying Manual screen) *(u32*)(0x020663C8-offsetChange6) = 0xE1A00000; // nop - tonccpy((u32*)(0x02066F94-offsetChange6), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02066F94-offsetChange6), dsiSaveGetResultCode, 0xC); *(u32*)(0x0206A004-offsetChange6) = 0xE1A00000; // nop patchInitDSiWare(0x0206F2E8-offsetChange6, heapEndMaxForRetail); *(u32*)(0x0206F674-offsetChange6) -= 0x30000; @@ -14541,7 +14541,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x02050CC4 = 0xE12FFF1E; // bx lr (Soft-lock instead of displaying Manual screen) *(u32*)0x02065A9C = 0xE1A00000; // nop - tonccpy((u32*)0x02066F94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02066F94, dsiSaveGetResultCode, 0xC); *(u32*)0x02069814 = 0xE1A00000; // nop *(u32*)0x0206EDD4 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0206EDEC, heapEndMaxForRetail); @@ -14630,7 +14630,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } *(u32*)0x02014D4C = 0xE1A00000; // nop - tonccpy((u32*)0x020159F0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020159F0, dsiSaveGetResultCode, 0xC); *(u32*)0x02018354 = 0xE1A00000; // nop patchInitDSiWare(0x02020724, heapEnd); patchUserSettingsReadDSiWare(0x02021C1C); @@ -14914,8 +14914,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0202DA1C = 0xE12FFF1E; // bx lr *(u32*)0x0202E65C = 0xE12FFF1E; // bx lr *(u32*)0x020343E8 = 0xE1A00000; // nop - tonccpy((u32*)0x020350D0, dsiSaveGetResultCode, 0xC); - tonccpy((u32*)0x02035C7C, dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)0x020350D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02035C7C, dsiSaveGetInfo, 0xC); *(u32*)0x02037D30 = 0xE1A00000; // nop patchInitDSiWare(0x0203D968, heapEnd); *(u32*)0x0203DE70 = 0xE12FFF1E; // bx lr (Skip NFTR font rendering) @@ -15046,7 +15046,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202A710, (u32)dsiSaveWrite); setBL(0x0202A71C, (u32)dsiSaveClose); *(u32*)0x020558D4 = 0xE1A00000; // nop - tonccpy((u32*)0x02056468, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02056468, dsiSaveGetResultCode, 0xC); *(u32*)0x02059040 = 0xE1A00000; // nop patchInitDSiWare(0x02060784, heapEnd); *(u32*)0x02060B10 = *(u32*)0x02004FD0; @@ -15092,7 +15092,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202A848, (u32)dsiSaveWrite); setBL(0x0202A854, (u32)dsiSaveClose); *(u32*)0x02055A0C = 0xE1A00000; // nop - tonccpy((u32*)0x020565A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020565A0, dsiSaveGetResultCode, 0xC); *(u32*)0x02059200 = 0xE1A00000; // nop patchInitDSiWare(0x02060968, heapEnd); *(u32*)0x02060CF4 = *(u32*)0x02004FE8; @@ -15167,7 +15167,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0202E6F8 = 0xE1A00000; // nop *(u32*)0x0202E788 = 0xE1A00000; // nop /*if (!extendedMemory) { - tonccpy((u32*)0x0206AAC8, mvdk3HeapAlloc, 0x1D8); + __aeabi_memcpy((u32*)0x0206AAC8, mvdk3HeapAlloc, 0x1D8); setBL(0x02033288, 0x0206AAC8); }*/ *(u32*)0x020612B8 = 0xE28DD00C; // ADD SP, SP, #0xC @@ -15278,7 +15278,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0200B69C+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0200B6A8+offsetChange) = 0xE1A00000; // nop *(u32*)(0x020394A0+offsetChangeInit0) = 0xE1A00000; // nop - tonccpy((u32*)(0x0203A10C+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0203A10C+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x0203C8EC+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x02042150+offsetChangeInit, heapEnd); } @@ -15307,7 +15307,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200B89C = 0xE1A00000; // nop *(u32*)0x0204995C = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x02049960 = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0204A6DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204A6DC, dsiSaveGetResultCode, 0xC); *(u32*)0x0204CFEC = 0xE1A00000; // nop patchInitDSiWare(0x0205906C, heapEnd); } @@ -15377,7 +15377,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0200B880+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0200B88C+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0202EF6C+offsetChangeInit0) = 0xE1A00000; // nop - tonccpy((u32*)(0x0202FBD8+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202FBD8+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x020323B8+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x02037B70+offsetChangeInit, heapEnd); } @@ -15406,7 +15406,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200BA74 = 0xE1A00000; // nop *(u32*)0x0204BB78 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0204BB7C = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0204C8F8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204C8F8, dsiSaveGetResultCode, 0xC); *(u32*)0x0204F208 = 0xE1A00000; // nop patchInitDSiWare(0x0205B1DC, heapEnd); } @@ -15437,7 +15437,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0200B614+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0200B978+offsetChange) = 0xE3A00000; // mov r0, #0 (Skip Camera, Part 2) *(u32*)(0x0202D3EC+offsetChangeInit) = 0xE1A00000; // nop - tonccpy((u32*)(0x0202E080+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202E080+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x02030B2C+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x02036304+offsetChangeInit, heapEnd); } @@ -15464,7 +15464,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200B8BC = 0xE3A00000; // mov r0, #0 (Skip Camera, Part 2) *(u32*)0x0202D28C = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0202D290 = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0202E000, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E000, dsiSaveGetResultCode, 0xC); *(u32*)0x020309A8 = 0xE1A00000; // nop patchInitDSiWare(0x02037988, heapEnd); } @@ -15493,7 +15493,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0200B584+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0200B590+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0202CCC4+offsetChangeInit) = 0xE1A00000; // nop - tonccpy((u32*)(0x0202D958+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202D958+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x0203019C+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x02035890+offsetChangeInit, heapEnd); } @@ -15518,7 +15518,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200B4DC = 0xE1A00000; // nop *(u32*)0x0202CB4C = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0202CB50 = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0202D8C0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D8C0, dsiSaveGetResultCode, 0xC); *(u32*)0x020300A4 = 0xE1A00000; // nop patchInitDSiWare(0x02036D24, heapEnd); } @@ -15568,7 +15568,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0200B664+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0200B670+offsetChange) = 0xE1A00000; // nop *(u32*)(0x0202CB80+offsetChangeInit0) = 0xE1A00000; // nop - tonccpy((u32*)(0x0202D7EC+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202D7EC+offsetChangeInit), dsiSaveGetResultCode, 0xC); *(u32*)(0x0202FFCC+offsetChangeInit) = 0xE1A00000; // nop patchInitDSiWare(0x020355DC+offsetChangeInit, heapEnd); } @@ -15597,7 +15597,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200B8A8 = 0xE1A00000; // nop *(u32*)0x020496C8 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x020496CC = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0204A448, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204A448, dsiSaveGetResultCode, 0xC); *(u32*)0x0204CD58 = 0xE1A00000; // nop patchInitDSiWare(0x02058B84, heapEnd); } @@ -15714,7 +15714,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // } *(u32*)0x0200EDA4 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F91C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F91C, dsiSaveGetResultCode, 0xC); *(u32*)0x02012334 = 0xE1A00000; // nop patchInitDSiWare(0x02017AD4, heapEnd); *(u32*)0x02017E60 = *(u32*)0x0207EB14; @@ -15838,7 +15838,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // *(u32*)0x0204DF68 = 0xE3A00001; // mov r0, #1 // *(u32*)0x0204DF6C = 0xE12FFF1E; // bx lr // *(u32*)0x020552DC = 0xE3A00000; // mov r0, #0 - // tonccpy((u32*)0x02057F8C, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x02057F8C, dsiSaveGetResultCode, 0xC); *(u32*)0x0205A50C = 0xE3A00001; // mov r0, #1 (Enable NitroFS reads) *(u32*)0x02063AA8 = 0xE3A00000; // mov r0, #0 *(u32*)0x02063AAC = 0xE12FFF1E; // bx lr @@ -15854,7 +15854,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02041F54 = 0xE12FFF1E; // bx lr *(u32*)0x0204DD50 = 0x020FCA20; - tonccpy((u32*)0x0204DD54, metalTorrentSndLoad, 0x1C); + __aeabi_memcpy((u32*)0x0204DD54, metalTorrentSndLoad, 0x1C); *(u32*)0x020F98BC = 0xE3A00901; // mov r0, #0x4000 setBL(0x020FC094, 0x0204DD54); @@ -15884,7 +15884,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02041F6C = 0xE12FFF1E; // bx lr *(u32*)0x0204DD68 = 0x020FC838; - tonccpy((u32*)0x0204DD6C, metalTorrentSndLoad, 0x1C); + __aeabi_memcpy((u32*)0x0204DD6C, metalTorrentSndLoad, 0x1C); *(u32*)0x020F96D4 = 0xE3A00901; // mov r0, #0x4000 setBL(0x020FBEAC, 0x0204DD6C); @@ -15914,7 +15914,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02085D64 = 0xE12FFF1E; // bx lr *(u32*)0x02091944 = 0x0205A3B8; - tonccpy((u32*)0x02091948, metalTorrentSndLoad, 0x1C); + __aeabi_memcpy((u32*)0x02091948, metalTorrentSndLoad, 0x1C); *(u32*)0x0206AFA0 = 0xE3A00901; // mov r0, #0x4000 setBL(0x02059A2C, 0x02091948); @@ -16127,8 +16127,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005A3C = 0xE1A00000; // nop if (!extendedMemory) { *(u32*)0x020072CC = 0xE3A00901; // mov r0, #0x4000 (Shrink sound heap from 1MB to 16KB: Disables music) - tonccpy((u32*)0x02008528, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x02008570, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x02008528, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x02008570, ce9->patches->musicStopEffect, 0xC); } if (romTid[3] == 'J') { ce9->patches->rumble_arm9[0][3] = *(u32*)0x0201D008; @@ -16305,7 +16305,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0207F5E8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0207F654 = 0xE3A00001; // mov r0, #1 *(u32*)0x02094318 = 0xE1A00000; // nop - tonccpy((u32*)0x02094EAC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02094EAC, dsiSaveGetResultCode, 0xC); *(u32*)0x02097954 = 0xE1A00000; // nop patchInitDSiWare(0x0209C858, heapEnd); patchUserSettingsReadDSiWare(0x0209DEA8); @@ -16345,7 +16345,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0207F504 = 0xE3A00001; // mov r0, #1 *(u32*)0x0207F584 = 0xE3A00001; // mov r0, #1 *(u32*)0x0209424C = 0xE1A00000; // nop - tonccpy((u32*)0x02094DE0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02094DE0, dsiSaveGetResultCode, 0xC); *(u32*)0x02097888 = 0xE1A00000; // nop patchInitDSiWare(0x0209C78C, heapEnd); patchUserSettingsReadDSiWare(0x0209DDDC); @@ -16359,7 +16359,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "K9SJ") == 0) { useSharedFont = twlFontFound; *(u32*)0x0200E824 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F3A8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F3A8, dsiSaveGetResultCode, 0xC); *(u32*)0x02011D58 = 0xE1A00000; // nop patchInitDSiWare(0x02016F60, heapEnd); if (!extendedMemory) { @@ -16410,7 +16410,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02009548 = 0xE3A0480B; // mov r4, #0xB0000 (Shrink heap from 0x4B0000) *(u32*)0x0200958C = 0x1E1000; // Shrink heap from 0x5E1000 *(u32*)0x02025AB4 = 0xE1A00000; // nop - tonccpy((u32*)0x02026748, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02026748, dsiSaveGetResultCode, 0xC); *(u32*)0x02029804 = 0xE1A00000; // nop patchInitDSiWare(0x02032570, heapEnd); patchUserSettingsReadDSiWare(0x02033AC4); @@ -17199,7 +17199,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Exotic Farm (Europe, Australia) else if (strcmp(romTid, "KMRE") == 0 || strcmp(romTid, "KMVE") == 0 || strcmp(romTid, "KMVV") == 0) { *(u32*)0x02011B64 = 0xE1A00000; // nop - tonccpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); *(u32*)0x02014FBC = 0xE1A00000; // nop patchInitDSiWare(0x0201B740, heapEnd); patchUserSettingsReadDSiWare(0x0201CD38); @@ -17278,7 +17278,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Farm (Europe, Australia) else if (strcmp(romTid, "KMRV") == 0) { *(u32*)0x02011A90 = 0xE1A00000; // nop - tonccpy((u32*)0x02012608, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012608, dsiSaveGetResultCode, 0xC); *(u32*)0x02014EE8 = 0xE1A00000; // nop patchInitDSiWare(0x0201B66C, heapEnd); patchUserSettingsReadDSiWare(0x0201CC64); @@ -17314,7 +17314,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Australian Farm (Europe) else if (strcmp(romTid, "KL3E") == 0 || strcmp(romTid, "KL3P") == 0 || strcmp(romTid, "KL4E") == 0 || strcmp(romTid, "KL4P") == 0) { *(u32*)0x02011B88 = 0xE1A00000; // nop - tonccpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); *(u32*)0x02015074 = 0xE1A00000; // nop patchInitDSiWare(0x0201B830, heapEnd); patchUserSettingsReadDSiWare(0x0201CE38); @@ -17421,7 +17421,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020186DC = 0xE12FFF1E; // bx lr *(u32*)0x0201872C = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x0202EBA4, myLtlRestHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x0202EBA4, myLtlRestHeapAlloc, 0xC0); setBLThumb(0x0205406C, 0x0202EBA4); } */ *(u32*)(0x02041BD0+offsetChange2) = 0xE12FFF1E; // bx lr @@ -17550,38 +17550,38 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strncmp(romTid, "KNP", 3) == 0) { /*const u32 dsiSaveCreateT = 0x0201D090; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x0201D0A0; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x0201D0B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0201D0C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x0201D0D0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x0201D0E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0201D0F0; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC);*/ + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC);*/ doubleNopT(0x0200511E); doubleNopT(0x02005124); doubleNopT(0x02005272); *(u32*)0x0201BA24 = 0xE1A00000; // nop - //tonccpy((u32*)0x0201C5A8, dsiSaveGetResultCode, 0xC); - //tonccpy((u32*)0x0201D178, dsiSaveSetLength, 0xC); + //__aeabi_memcpy((u32*)0x0201C5A8, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x0201D178, dsiSaveSetLength, 0xC); *(u32*)0x0201F744 = 0xE1A00000; // nop patchInitDSiWare(0x0202EC54, heapEndMaxForRetail); if (!extendedMemory) { @@ -17685,7 +17685,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x0200A3D8 = 0xE1A00000; // nop *(u32*)0x02042148 = 0xE1A00000; // nop - tonccpy((u32*)0x02042CC0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042CC0, dsiSaveGetResultCode, 0xC); *(u32*)0x02046048 = 0xE1A00000; // nop patchInitDSiWare(0x0204DF64, heapEnd); if (!extendedMemory) { @@ -17701,7 +17701,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02009E70 = 0xE12FFF1E; // bx lr *(u32*)0x0200A6A4 = 0xE1A00000; // nop *(u32*)0x020423B8 = 0xE1A00000; // nop - tonccpy((u32*)0x02042F3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042F3C, dsiSaveGetResultCode, 0xC); *(u32*)0x0204634C = 0xE1A00000; // nop patchInitDSiWare(0x0204E2A8, heapEnd); if (!extendedMemory) { @@ -17742,7 +17742,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008184 = 0xE1A00000; // nop if (strcmp(romTid, "KAQJ") == 0) { *(u32*)0x020401F4 = 0xE1A00000; // nop - tonccpy((u32*)0x02040E88, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040E88, dsiSaveGetResultCode, 0xC); *(u32*)0x02044254 = 0xE1A00000; // nop *(u32*)0x0204C4B8 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204C4D0, heapEnd); @@ -17756,7 +17756,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x0204003C = 0xE1A00000; // nop - tonccpy((u32*)0x02040CD0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040CD0, dsiSaveGetResultCode, 0xC); *(u32*)0x0204409C = 0xE1A00000; // nop *(u32*)0x0204C300 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204C318, heapEnd); @@ -17795,7 +17795,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008E00 = 0xE12FFF1E; // bx lr *(u32*)0x02009690 = 0xE1A00000; // nop *(u32*)0x020413F8 = 0xE1A00000; // nop - tonccpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); *(u32*)0x020452F8 = 0xE1A00000; // nop patchInitDSiWare(0x0204D214, heapEnd); if (!extendedMemory) { @@ -17835,7 +17835,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { nintCdwnCalHeapAddrPtr[i] -= 0x800000; } } - tonccpy((u32*)0x020917D8, nintCdwnCalHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x020917D8, nintCdwnCalHeapAlloc, 0xC0); setBL(0x0205AB70, 0x020917D8); /* if (twlFontFound) { patchTwlFontLoad(0x0205AC48, 0x02092324); @@ -17845,7 +17845,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0205C1B4 = 0xE1A00000; // nop // } *(u32*)0x020863A8 = 0xE1A00000; // nop - tonccpy((u32*)0x02086F2C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02086F2C, dsiSaveGetResultCode, 0xC); *(u32*)0x02089BB0 = 0xE1A00000; // nop patchInitDSiWare(0x0208FCB8, heapEnd); *(u32*)0x02090044 = *(u32*)0x02004FD0; @@ -17878,12 +17878,12 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { nintCdwnCalHeapAddrPtr[i] -= 0x800000; } } - tonccpy((u32*)0x02091A20, nintCdwnCalHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x02091A20, nintCdwnCalHeapAlloc, 0xC0); setBL(0x0205ADA8, 0x02091A20); } *(u32*)0x0205C3EC = 0xE1A00000; // nop *(u32*)0x020865E0 = 0xE1A00000; // nop - tonccpy((u32*)0x02087164, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02087164, dsiSaveGetResultCode, 0xC); *(u32*)0x02089DE8 = 0xE1A00000; // nop patchInitDSiWare(0x0208FEF0, heapEnd); *(u32*)0x0209027C = *(u32*)0x02004FD0; @@ -17917,14 +17917,14 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { nintCdwnCalHeapAddrPtr[i] -= 0x800000; } } - tonccpy((u32*)0x0208A268, nintCdwnCalHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x0208A268, nintCdwnCalHeapAlloc, 0xC0); setBL(0x02058404, 0x0208A268); } if (!twlFontFound) { *(u32*)0x020597A4 = 0xE1A00000; // nop } *(u32*)0x0207EE70 = 0xE1A00000; // nop - tonccpy((u32*)0x0207F9E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0207F9E8, dsiSaveGetResultCode, 0xC); *(u32*)0x0208266C = 0xE1A00000; // nop patchInitDSiWare(0x02088758, heapEnd); // *(u32*)0x02088AE4 = *(u32*)0x02004FD0; @@ -18043,7 +18043,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x0201D1B0 = 0xE12FFF1E; // bx lr *(u32*)0x0201D1D8 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x0201C038, nintendojiHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x0201C038, nintendojiHeapAlloc, 0xC0); setBL(0x02022FDC, 0x0201C038); *(u32*)0x0203F98C = 0xE1A00000; // nop *(u32*)0x020FAB1C = 0xE1A00000; // nop @@ -18119,7 +18119,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050A4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x0200C000 = 0xE1A00000; // nop - tonccpy((u32*)0x0200CC94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200CC94, dsiSaveGetResultCode, 0xC); *(u32*)0x0200F5F8 = 0xE1A00000; // nop *(u32*)0x02015AAC = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x02015AC4, heapEnd); @@ -18458,7 +18458,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005284 = 0xE1A00000; // nop *(u32*)0x020052EC = 0xE1A00000; // nop *(u32*)0x0200F380 = 0xE1A00000; // nop - tonccpy((u32*)0x0200FF04, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200FF04, dsiSaveGetResultCode, 0xC); *(u32*)0x020129D4 = 0xE1A00000; // nop patchInitDSiWare(0x02017548, heapEnd); if (useSharedFont) { @@ -18493,7 +18493,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KOLJ") == 0) { useSharedFont = twlFontFound; *(u32*)0x0200B300 = 0xE1A00000; // nop - tonccpy((u32*)0x0200BF94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF94, dsiSaveGetResultCode, 0xC); *(u32*)0x0200E7AC = 0xE1A00000; // nop patchInitDSiWare(0x02013F6C, heapEnd); if (useSharedFont && !extendedMemory) { @@ -18727,7 +18727,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Paul's Monster Adventure (USA) else if (strcmp(romTid, "KP9E") == 0) { *(u32*)0x02013828 = 0xE1A00000; // nop - tonccpy((u32*)0x020143AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020143AC, dsiSaveGetResultCode, 0xC); *(u32*)0x02016F48 = 0xE1A00000; // nop patchInitDSiWare(0x0201E654, heapEnd); patchUserSettingsReadDSiWare(0x0201FB30); @@ -18752,7 +18752,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Aru to Harapeko Monsuta (Japan) else if (strcmp(romTid, "KP9J") == 0) { *(u32*)0x02013794 = 0xE1A00000; // nop - tonccpy((u32*)0x02014318, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02014318, dsiSaveGetResultCode, 0xC); *(u32*)0x02016E2C = 0xE1A00000; // nop patchInitDSiWare(0x0201E514, heapEnd); patchUserSettingsReadDSiWare(0x0201F9F0); @@ -18775,7 +18775,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Paul's Shooting Adventure (USA) else if (strcmp(romTid, "KPJE") == 0) { *(u32*)0x0200FF94 = 0xE1A00000; // nop - tonccpy((u32*)0x02010B18, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010B18, dsiSaveGetResultCode, 0xC); *(u32*)0x0201362C = 0xE1A00000; // nop patchInitDSiWare(0x02019C28, heapEnd); patchUserSettingsReadDSiWare(0x0201B104); @@ -18801,7 +18801,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Adventure Kid: Poru no Bouken (Japan) else if (strcmp(romTid, "KPJJ") == 0) { *(u32*)0x0200FF74 = 0xE1A00000; // nop - tonccpy((u32*)0x02010AF8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010AF8, dsiSaveGetResultCode, 0xC); *(u32*)0x0201360C = 0xE1A00000; // nop patchInitDSiWare(0x02019C08, heapEnd); patchUserSettingsReadDSiWare(0x0201B0E4); @@ -18827,7 +18827,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Adventure Kid 2: Poru no Dai Bouken (Japan) else if (strcmp(romTid, "KUSE") == 0 || strcmp(romTid, "KUSJ") == 0) { *(u32*)0x02016008 = 0xE1A00000; // nop - tonccpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); *(u32*)0x02019E58 = 0xE1A00000; // nop patchInitDSiWare(0x020217E8, heapEnd); patchUserSettingsReadDSiWare(0x02022E98); @@ -19010,31 +19010,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { /*else if (strcmp(romTid, "KP5E") == 0) { const u32 dsiSaveCreateT = 0x020A721C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x020A722C; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x020A723C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020A724C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020A725C; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020A726C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020A727C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x020191A8); doubleNopT(0x0201A4E4); @@ -19055,7 +19055,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02089404 = 0xE3A00000; // mov r0, #0 } *(u32*)0x020A5B04 = 0xE1A00000; // nop - tonccpy((u32*)0x020A67EC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020A67EC, dsiSaveGetResultCode, 0xC); *(u32*)0x020A9B78 = 0xE1A00000; // nop *(u32*)0x020B046C = 0xE1A00000; // nop *(u32*)0x020B244C = 0xE1A00000; // nop @@ -19093,30 +19093,30 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Save code does not work due to a weird crash caused by it // Crashes after finishing a stage on retail consoles else if (strcmp(romTid, "KPSJ") == 0) { - /* tonccpy((u32*)0x0200A75C, dsiSaveCreate, 0xC); + /* __aeabi_memcpy((u32*)0x0200A75C, dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x0200A76C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0200A77C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x0200A78C; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x0200A79C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); - tonccpy((u32*)0x0200A79C, dsiSaveWrite, 0xC); - tonccpy((u32*)0x0200ACD8, dsiSaveWrite, 0xC); // dsiSaveWriteAsync */ + __aeabi_memcpy((u32*)0x0200A79C, dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)0x0200ACD8, dsiSaveWrite, 0xC); // dsiSaveWriteAsync */ *(u32*)0x02007FA8 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x02007FAC = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - // tonccpy((u32*)0x02009C88, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x02009C88, dsiSaveGetResultCode, 0xC); *(u32*)0x0200CC88 = 0xE1A00000; // nop patchInitDSiWare(0x0202D950, heapEndMaxForRetail); *(u32*)0x0202DCCC -= 0x64000; @@ -19133,9 +19133,9 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { extern u16* ps0MiniPatch; extern u16* ps0MiniFuncHook; - // tonccpy((u16*)newCodeAddr, ps0MiniPatch, 0x1D4); - tonccpy((u16*)newCodeAddr, ps0MiniPatch, 0x78); - tonccpy((u16*)newCodeAddr2, ps0MiniFuncHook, 0x80); + // __aeabi_memcpy((u16*)newCodeAddr, ps0MiniPatch, 0x1D4); + __aeabi_memcpy((u16*)newCodeAddr, ps0MiniPatch, 0x78); + __aeabi_memcpy((u16*)newCodeAddr2, ps0MiniFuncHook, 0x80); setBLThumb(0x0208C4F2, newCodeAddr); *(u16*)0x0208C53E = 0x2D02; // cmp r5, #2 @@ -19178,7 +19178,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200B2B0, (u32)dsiSaveWrite); setBL(0x0200B2BC, (u32)dsiSaveClose); *(u32*)0x020642CC = 0xE1A00000; // nop - tonccpy((u32*)0x02064E50, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02064E50, dsiSaveGetResultCode, 0xC); *(u32*)0x02067E34 = 0xE1A00000; // nop patchInitDSiWare(0x0206ECC8, heapEndExceed); patchUserSettingsReadDSiWare(0x020701A4); @@ -19202,7 +19202,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200A174, (u32)dsiSaveWrite); setBL(0x0200A180, (u32)dsiSaveClose); *(u32*)0x02061C34 = 0xE1A00000; // nop - tonccpy((u32*)0x020627B8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020627B8, dsiSaveGetResultCode, 0xC); *(u32*)0x02065714 = 0xE1A00000; // nop patchInitDSiWare(0x0206C584, heapEndExceed); patchUserSettingsReadDSiWare(0x0206DA60); @@ -19322,8 +19322,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Change help button (No blank file found to hide it) //const char* lp0 = "1p.dt0"; - //tonccpy((char*)0x0211281E, lp0, strlen(lp0)+1); - //tonccpy((char*)0x02112844, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211281E, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x02112844, lp0, strlen(lp0)+1); } // PictureBook Games: The Royal Bluff (Europe, Australia) @@ -19380,8 +19380,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Change help button (No blank file found to hide it) //const char* lp0 = "t_1p.dt0"; - //tonccpy((char*)0x0211ABC6, lp0, strlen(lp0)+1); - //tonccpy((char*)0x0211ABF0, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211ABC6, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211ABF0, lp0, strlen(lp0)+1); } // Picture Perfect: Pocket Stylist (USA) @@ -19762,7 +19762,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020F7204 = 0xE1A00000; // nop *(u32*)0x020F7280 = 0xE1A00000; // nop *(u32*)0x020F7294 = 0xE1A00000; // nop - tonccpy((u32*)0x020F8B24, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020F8B24, dsiSaveGetResultCode, 0xC); *(u32*)0x020FBF88 = 0xE1A00000; // nop patchInitDSiWare(0x02108684, heapEnd); *(u32*)0x02108A10 = 0x0226BE80; @@ -19792,7 +19792,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020F8E74 = 0xE1A00000; // nop *(u32*)0x020F8EF0 = 0xE1A00000; // nop *(u32*)0x020F8F04 = 0xE1A00000; // nop - tonccpy((u32*)0x020FA794, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FA794, dsiSaveGetResultCode, 0xC); *(u32*)0x020FDBF8 = 0xE1A00000; // nop patchInitDSiWare(0x0210A6DC, heapEnd); *(u32*)0x0210AA68 = 0x0226F8E0; @@ -19804,7 +19804,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // PlayLearn Spanish (USA) else if (strcmp(romTid, "KFXE") == 0 || strcmp(romTid, "KFQE") == 0) { *(u32*)0x02005190 = 0xE1A00000; // nop - tonccpy((u32*)0x02014C94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02014C94, dsiSaveGetResultCode, 0xC); *(u32*)0x020176AC = 0xE1A00000; // nop patchInitDSiWare(0x0201E128, heapEnd); *(u32*)0x0201E4B4 = *(u32*)0x02004FD0; @@ -20009,13 +20009,13 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200E004 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) if (romTid[3] != 'J') { *(u32*)0x0204E1B8 = 0xE1A00000; // nop - tonccpy((u32*)0x0204ED3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204ED3C, dsiSaveGetResultCode, 0xC); *(u32*)0x02051F6C = 0xE1A00000; // nop patchInitDSiWare(0x020599E0, heapEnd); patchUserSettingsReadDSiWare(0x0205AEBC); } else { *(u32*)0x0204E02C = 0xE1A00000; // nop - tonccpy((u32*)0x0204EBB0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204EBB0, dsiSaveGetResultCode, 0xC); *(u32*)0x02051DE0 = 0xE1A00000; // nop patchInitDSiWare(0x02059854, heapEnd); patchUserSettingsReadDSiWare(0x0205AD30); @@ -20224,7 +20224,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201A1A8+offsetChange, (u32)dsiSaveWrite); setBL(0x0201A1B0+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02037128+offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x02037CA0+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02037CA0+offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x0203A508+offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0203EF8C+offsetChange, heapEnd); patchUserSettingsReadDSiWare(0x02040458+offsetChange); @@ -20258,7 +20258,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200D990, (u32)dsiSaveWrite); setBL(0x0200D9A8, (u32)dsiSaveWrite); *(u32*)0x02064A94 = 0xE1A00000; // nop - tonccpy((u32*)0x02065618, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02065618, dsiSaveGetResultCode, 0xC); *(u32*)0x02068D78 = 0xE1A00000; // nop patchInitDSiWare(0x02070CE4, heapEnd); patchUserSettingsReadDSiWare(0x02072394); @@ -20270,31 +20270,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KDPE") == 0) { const u32 dsiSaveCreateT = 0x020270FC; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x0202710C; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x0202711C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x0202712C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0202713C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x0202714C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0202715C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x020106BC = 0x2001; // movs r0, #1 *(u16*)0x020106BE = 0x4770; // bx lr @@ -20307,7 +20307,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x02010A58, dsiSaveWriteT); setBLThumb(0x02010A6A, dsiSaveCloseT); *(u16*)0x02010A90 = 0x4778; // bx pc - tonccpy((u32*)0x02010A94, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x02010A94, dsiSaveGetLength, 0xC); setBLThumb(0x02010AC0, dsiSaveOpenT); setBLThumb(0x02010AE6, dsiSaveCloseT); setBLThumb(0x02010AF8, dsiSaveReadT); @@ -20353,7 +20353,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x02010140 = 0xE1A00000; // nop - tonccpy((u32*)0x02010CC4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010CC4, dsiSaveGetResultCode, 0xC); *(u32*)0x02013494 = 0xE1A00000; // nop patchInitDSiWare(0x02019570, heapEnd); *(u32*)0x020198FC = *(u32*)0x02004FE8; @@ -20405,31 +20405,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KNUP") == 0) { const u32 dsiSaveCreateT = 0x02058F8C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveSetLengthT = 0x02058F9C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02058FAC; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02058FBC; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02058FCC; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02058FDC; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02058FEC; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x020086EE, dsiSaveOpenT); setBLThumb(0x0200870A, dsiSaveSeekT); @@ -20573,7 +20573,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02057D40, (u32)dsiSaveClose); */ *(u32*)0x02064DD0 = 0xE3A00001; // mov r0, #1 (Hide volume icon in menu) *(u32*)0x020ACF54 = 0xE1A00000; // nop - //tonccpy((u32*)0x020ADBF4, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x020ADBF4, dsiSaveGetResultCode, 0xC); *(u32*)0x020B1334 = 0xE1A00000; // nop patchInitDSiWare(0x020BFF78, heapEnd); patchUserSettingsReadDSiWare(0x020C1668); @@ -20698,7 +20698,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050F8 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) *(u32*)0x02014F50 = 0xE1A00000; // nop - tonccpy((u32*)0x02015AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015AD4, dsiSaveGetResultCode, 0xC); *(u32*)0x02018134 = 0xE1A00000; // nop patchInitDSiWare(0x0201D25C, heapEnd); *(u32*)0x0201D5E8 = *(u32*)0x02004FE8; @@ -20725,7 +20725,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050F8 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) *(u32*)0x020148A8 = 0xE1A00000; // nop - tonccpy((u32*)0x0201542C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201542C, dsiSaveGetResultCode, 0xC); *(u32*)0x02017A8C = 0xE1A00000; // nop patchInitDSiWare(0x0201CD94, heapEnd); *(u32*)0x0201D120 = *(u32*)0x02004FE8; @@ -20749,7 +20749,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050F8 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) *(u32*)0x02014F4C = 0xE1A00000; // nop - tonccpy((u32*)0x02015AD0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015AD0, dsiSaveGetResultCode, 0xC); *(u32*)0x02018130 = 0xE1A00000; // nop patchInitDSiWare(0x0201D258, heapEndMaxForRetail); *(u32*)0x0201D5E4 = *(u32*)0x02004FE8; @@ -21081,27 +21081,27 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KRCE") == 0) { const u32 dsiSaveCreateT = 0x020119A0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020119B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020119C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020119D0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020119E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020119F0; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u32*)0x020103D8 = 0xE1A00000; // nop *(u32*)0x02013974 = 0xE1A00000; // nop @@ -21148,27 +21148,27 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KRCV") == 0) { const u32 dsiSaveCreateT = 0x020119A4; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020119B4; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020119C4; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020119D4; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020119E4; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020119F4; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u32*)0x020103DC = 0xE1A00000; // nop *(u32*)0x02013978 = 0xE1A00000; // nop @@ -21263,7 +21263,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { rmtRacersHeapAddrPtr[i] -= 0x800000; } } - tonccpy((u32*)0x020256C0, rmtRacersHeapAlloc, 0xC0); + __aeabi_memcpy((u32*)0x020256C0, rmtRacersHeapAlloc, 0xC0); setBLThumb(0x02082484, 0x020256C0); } if (romTid[3] == 'E') { @@ -21657,31 +21657,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KD6E") == 0) { const u32 dsiSaveCreateT = 0x02025C20; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02025C30; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02025C40; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02025C50; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02025C60; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02025C70; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02025C80; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x02010164 = 0x2001; // movs r0, #1 *(u16*)0x02010166 = 0x4770; // bx lr @@ -21694,7 +21694,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x02010508, dsiSaveWriteT); setBLThumb(0x0201051A, dsiSaveCloseT); *(u16*)0x02010540 = 0x4778; // bx pc - tonccpy((u32*)0x02010544, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x02010544, dsiSaveGetLength, 0xC); setBLThumb(0x02010570, dsiSaveOpenT); setBLThumb(0x02010596, dsiSaveCloseT); setBLThumb(0x020105A8, dsiSaveReadT); @@ -21721,7 +21721,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u8 offsetChange = (romTid[3] == 'E') ? 0 : 4; *(u32*)(0x02013560+offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x020140E4+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x020140E4+offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x0201732C+offsetChange) = 0xE1A00000; // nop patchInitDSiWare(0x0201D08C+offsetChange, heapEnd); patchUserSettingsReadDSiWare(0x0201E7B0+offsetChange); @@ -21787,7 +21787,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200EEDC, (u32)dsiSaveWrite); setBL(0x0200EEE8, (u32)dsiSaveClose); *(u32*)0x0203C4CC = 0xE1A00000; // nop - tonccpy((u32*)0x0203D050, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203D050, dsiSaveGetResultCode, 0xC); *(u32*)0x02040034 = 0xE1A00000; // nop patchInitDSiWare(0x02045D64, heapEnd); *(u32*)0x020460F0 = *(u32*)0x02004FE8; @@ -21901,7 +21901,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x0203319C-offsetChange2) = 0xE12FFF1E; // bx lr // } *(u32*)(0x0204E9A8-offsetChange2) = 0xE1A00000; // nop - tonccpy((u32*)(0x0204F520-offsetChange2), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0204F520-offsetChange2), dsiSaveGetResultCode, 0xC); *(u32*)(0x02051D88-offsetChange2) = 0xE1A00000; // nop patchInitDSiWare(0x02056868-offsetChange2, heapEnd); patchUserSettingsReadDSiWare(0x02057D24-offsetChange2); @@ -22101,8 +22101,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020B80A4 = 0xE12FFF1E; // bx lr } *(u32*)0x02020404 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x02020424, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x0202045C, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x02020424, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x0202045C, ce9->patches->musicStopEffect, 0xC); setBL(0x02026E44, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x0208B9A0, (u32)dsiSaveCreate); setBL(0x0208B9C4, (u32)dsiSaveGetResultCode); @@ -22149,8 +22149,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020B6C94 = 0xE12FFF1E; // bx lr } *(u32*)0x0201FCEC = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x0201FD0C, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x0201FD44, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x0201FD0C, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x0201FD44, ce9->patches->musicStopEffect, 0xC); setBL(0x0202657C, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x0208A8E0, (u32)dsiSaveCreate); setBL(0x0208A904, (u32)dsiSaveGetResultCode); @@ -22201,8 +22201,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x020C76E0-offsetChange) = 0xE12FFF1E; // bx lr } *(u32*)(0x02022EF0-offsetChange) = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)(0x02022F10-offsetChange), ce9->patches->musicPlay, 0xC); - tonccpy((u32*)(0x02022F48-offsetChange), ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)(0x02022F10-offsetChange), ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)(0x02022F48-offsetChange), ce9->patches->musicStopEffect, 0xC); setBL(0x0202A548-offsetChange, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x02098B60-offsetChange, (u32)dsiSaveCreate); setBL(0x02098B84-offsetChange, (u32)dsiSaveGetResultCode); @@ -22249,8 +22249,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020C73F0 = 0xE12FFF1E; // bx lr } *(u32*)0x020229D0 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x020229F0, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x02022A28, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x020229F0, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x02022A28, ce9->patches->musicStopEffect, 0xC); setBL(0x02029F94, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x020984C4, (u32)dsiSaveCreate); setBL(0x020984E8, (u32)dsiSaveGetResultCode); @@ -22290,8 +22290,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020BDE0C = 0xE12FFF1E; // bx lr } *(u32*)0x020211F8 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x02021218, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x02021250, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x02021218, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x02021250, ce9->patches->musicStopEffect, 0xC); setBL(0x0202853C, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x020902AC, (u32)dsiSaveCreate); setBL(0x020902D0, (u32)dsiSaveGetResultCode); @@ -22331,8 +22331,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020C5DD4 = 0xE12FFF1E; // bx lr } *(u32*)0x02022594 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x020225B4, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x020225EC, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x020225B4, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x020225EC, ce9->patches->musicStopEffect, 0xC); setBL(0x020299A4, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x02097484, (u32)dsiSaveCreate); setBL(0x020974A8, (u32)dsiSaveGetResultCode); @@ -22384,8 +22384,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020BCE44 = 0xE12FFF1E; // bx lr } *(u32*)0x0201FC20 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x0201FC40, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x0201FC78, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x0201FC40, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x0201FC78, ce9->patches->musicStopEffect, 0xC); setBL(0x02026F68, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x0209201C, (u32)dsiSaveCreate); setBL(0x02092040, (u32)dsiSaveGetResultCode); @@ -22452,8 +22452,8 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020BD234 = 0xE12FFF1E; // bx lr } *(u32*)0x0201FE98 = 0xE12FFF1E; // bx lr (Disable loading sdat file) - tonccpy((u32*)0x0201FEB8, ce9->patches->musicPlay, 0xC); - tonccpy((u32*)0x0201FEF0, ce9->patches->musicStopEffect, 0xC); + __aeabi_memcpy((u32*)0x0201FEB8, ce9->patches->musicPlay, 0xC); + __aeabi_memcpy((u32*)0x0201FEF0, ce9->patches->musicStopEffect, 0xC); setBL(0x020271E0, (int)ce9->patches->rumble_arm9[0]); // Rumble when hair is whipped setBL(0x020922A0, (u32)dsiSaveCreate); setBL(0x020922C4, (u32)dsiSaveGetResultCode); @@ -22610,7 +22610,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0205E43C = 0xE1A00000; // nop *(u32*)0x0205E570 = 0xE1A00000; // nop *(u32*)0x0205E584 = 0xE1A00000; // nop - tonccpy((u32*)0x0205F0D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205F0D0, dsiSaveGetResultCode, 0xC); *(u32*)0x0206204C = 0xE1A00000; // nop *(u32*)0x020678CC = 0xE1A00000; // nop *(u32*)0x0206973C = 0xE1A00000; // nop @@ -22934,7 +22934,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x02005064 = 0xE1A00000; // nop *(u32*)0x0200EB54 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F72C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F72C, dsiSaveGetResultCode, 0xC); *(u32*)0x02011F90 = 0xE1A00000; // nop patchInitDSiWare(0x02017790, heapEnd); patchUserSettingsReadDSiWare(0x02018C80); @@ -22970,7 +22970,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x02005064 = 0xE1A00000; // nop *(u32*)0x0200EAB4 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F680, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F680, dsiSaveGetResultCode, 0xC); *(u32*)0x02011EE4 = 0xE1A00000; // nop patchInitDSiWare(0x020176C8, heapEnd); patchUserSettingsReadDSiWare(0x02018BA8); @@ -23227,7 +23227,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Sora Kake Girl: Shojo Shooting (Japan) else if (strcmp(romTid, "KU4J") == 0) { *(u32*)0x0200B544 = 0xE1A00000; // nop - tonccpy((u32*)0x0200C0BC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200C0BC, dsiSaveGetResultCode, 0xC); *(u32*)0x0200EEBC = 0xE1A00000; // nop patchInitDSiWare(0x02016C6C, heapEnd); *(u32*)0x02016FF8 = *(u32*)0x02004FD0; @@ -23325,7 +23325,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { siezHeapAddrPtr[i] -= 0x01000000; } } - tonccpy((u32*)0x020192F4, siezHeapAlloc, 0x50); + __aeabi_memcpy((u32*)0x020192F4, siezHeapAlloc, 0x50); } *(u32*)0x0201B794 = 0xE1A00000; // nop patchInitDSiWare(0x0202254C, heapEnd); @@ -23406,7 +23406,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020139B4 = 0xE1A00000; // nop patchVolumeGetDSiWare(0x02024D5C); *(u32*)0x02067804 = 0xE1A00000; // nop - tonccpy((u32*)0x02068398, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02068398, dsiSaveGetResultCode, 0xC); *(u32*)0x0206AC78 = 0xE1A00000; // nop patchInitDSiWare(0x02071F38, heapEnd); patchUserSettingsReadDSiWare(0x02073598); @@ -23427,7 +23427,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020139C0 = 0xE1A00000; // nop patchVolumeGetDSiWare(0x02024D68); *(u32*)0x02067810 = 0xE1A00000; // nop - tonccpy((u32*)0x020683A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020683A4, dsiSaveGetResultCode, 0xC); *(u32*)0x0206AC84 = 0xE1A00000; // nop patchInitDSiWare(0x02071F44, heapEnd); patchUserSettingsReadDSiWare(0x020735A4); @@ -23460,7 +23460,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { patchVolumeGetDSiWare(0x02025004); *(u32*)0x02068508 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0206850C = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0206928C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0206928C, dsiSaveGetResultCode, 0xC); *(u32*)0x0206BB48 = 0xE1A00000; // nop patchInitDSiWare(0x020747FC, heapEnd); patchUserSettingsReadDSiWare(0x02075E60); @@ -23478,7 +23478,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050F4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } *(u32*)0x0200D970 = 0xE1A00000; // nop - tonccpy((u32*)0x0200E4E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E4E8, dsiSaveGetResultCode, 0xC); *(u32*)0x02010E7C = 0xE1A00000; // nop patchInitDSiWare(0x02018410, heapEnd); patchUserSettingsReadDSiWare(0x020198A0); @@ -23510,7 +23510,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005110 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } *(u32*)0x0200DEB8 = 0xE1A00000; // nop - tonccpy((u32*)0x0200EA3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200EA3C, dsiSaveGetResultCode, 0xC); *(u32*)0x02011458 = 0xE1A00000; // nop patchInitDSiWare(0x02018A7C, heapEnd); patchUserSettingsReadDSiWare(0x02019F1C); @@ -23707,7 +23707,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020071F8, (u32)dsiSaveWrite); *(u32*)0x0204BA50 = 0xE1A00000; // nop *(u32*)0x020DB868 = 0xE1A00000; // nop - tonccpy((u32*)0x020DC3E0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020DC3E0, dsiSaveGetResultCode, 0xC); *(u32*)0x020DF270 = 0xE1A00000; // nop patchInitDSiWare(0x020E558C, heapEnd); *(u32*)0x020E5918 = *(u32*)0x02004FD0; @@ -23921,7 +23921,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Sudoku & Kakuro: Welt Edition (Germany) else if (strcmp(romTid, "KWUD") == 0) { *(u32*)0x02012064 = 0xE1A00000; // nop - tonccpy((u32*)0x02012BDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012BDC, dsiSaveGetResultCode, 0xC); *(u32*)0x020155F4 = 0xE1A00000; // nop patchInitDSiWare(0x0201B058, heapEnd); patchUserSettingsReadDSiWare(0x0201C694); @@ -24049,7 +24049,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x02042E88 = 0xE1A00000; // nop - tonccpy((u32*)0x02043A00, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043A00, dsiSaveGetResultCode, 0xC); *(u32*)0x02046D88 = 0xE1A00000; // nop patchInitDSiWare(0x0204ECA4, heapEnd); /* if (!extendedMemory) { @@ -24058,7 +24058,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { patchUserSettingsReadDSiWare(0x02050450); } else { *(u32*)0x02042E94 = 0xE1A00000; // nop - tonccpy((u32*)0x02043A18, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043A18, dsiSaveGetResultCode, 0xC); *(u32*)0x02046E28 = 0xE1A00000; // nop patchInitDSiWare(0x0204ED84, heapEnd); /* if (!extendedMemory) { @@ -24094,7 +24094,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02007958 = 0xE12FFF1E; // bx lr *(u32*)0x020081E0 = 0xE1A00000; // nop *(u32*)0x0204097C = 0xE1A00000; // nop - tonccpy((u32*)0x02041610, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041610, dsiSaveGetResultCode, 0xC); *(u32*)0x020449DC = 0xE1A00000; // nop *(u32*)0x0204CC40 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204CC58, heapEnd); @@ -24130,7 +24130,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008ED4 = 0xE12FFF1E; // bx lr *(u32*)0x02009764 = 0xE1A00000; // nop *(u32*)0x0204243C = 0xE1A00000; // nop - tonccpy((u32*)0x02042FB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042FB4, dsiSaveGetResultCode, 0xC); *(u32*)0x0204633C = 0xE1A00000; // nop patchInitDSiWare(0x0204E258, heapEnd); patchUserSettingsReadDSiWare(0x0204FA04); @@ -24238,7 +24238,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // *(u32*)0x020050C8 = 0xE1A00000; // nop (Disable audio) // } *(u32*)0x02016F5C = 0xE1A00000; // nop - tonccpy((u32*)0x02017AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02017AD4, dsiSaveGetResultCode, 0xC); *(u32*)0x0201AC44 = 0xE1A00000; // nop patchInitDSiWare(0x02020844, heapEnd); *(u32*)0x02020BD0 = *(u32*)0x02004FD0; @@ -24265,35 +24265,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KOWE") == 0 || strcmp(romTid, "KOWP") == 0) { const u32 dsiSaveGetResultCodeT = 0x0201AB18; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveCreateT = 0x0201B1A0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x0201B1B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0201B1C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x0201B1D0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSetLengthT = 0x0201B2F4; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadT = 0x0201B1E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0201B49C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x02004A3A); doubleNopT(0x02004A48); @@ -24462,7 +24462,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020062C0, (u32)dsiSaveClose); *(u32*)0x0202D3A4 = 0xE28DD00C; // ADD SP, SP, #0xC *(u32*)0x0202D3A8 = 0xE8BD8078; // LDMFD SP!, {R3-R6,PC} - tonccpy((u32*)0x0202E118, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E118, dsiSaveGetResultCode, 0xC); *(u32*)0x02031180 = 0xE1A00000; // nop patchInitDSiWare(0x0203958C, heapEnd); } @@ -24493,7 +24493,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006310, (u32)dsiSaveClose); if (strncmp(romTid, "KJA", 3) == 0) { *(u32*)0x0202D49C = 0xE1A00000; // nop - tonccpy((u32*)0x0202E130, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E130, dsiSaveGetResultCode, 0xC); *(u32*)0x020311D8 = 0xE1A00000; // nop patchInitDSiWare(0x02038034, heapEnd); *(u32*)0x0203996C = 0xE1A00000; // nop @@ -24502,7 +24502,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02039978 = 0xE1A00000; // nop } else if (strncmp(romTid, "KJ7", 3) != 0) { *(u32*)0x0202D4B4 = 0xE1A00000; // nop - tonccpy((u32*)0x0202E148, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E148, dsiSaveGetResultCode, 0xC); *(u32*)0x020311F0 = 0xE1A00000; // nop patchInitDSiWare(0x0203804C, heapEnd); *(u32*)0x02039984 = 0xE1A00000; // nop @@ -24511,7 +24511,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02039990 = 0xE1A00000; // nop } else { *(u32*)0x0202D51C = 0xE1A00000; // nop - tonccpy((u32*)0x0202E1B0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E1B0, dsiSaveGetResultCode, 0xC); *(u32*)0x02031258 = 0xE1A00000; // nop patchInitDSiWare(0x020380B4, heapEnd); *(u32*)0x020399EC = 0xE1A00000; // nop @@ -24532,7 +24532,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // } *(u32*)0x0200EDF0 = 0xE1A00000; // nop - tonccpy((u32*)0x0200F968, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F968, dsiSaveGetResultCode, 0xC); *(u32*)0x02012380 = 0xE1A00000; // nop patchInitDSiWare(0x02017B20, heapEnd); *(u32*)0x02017EAC = *(u32*)0x0207EF20; @@ -24597,7 +24597,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Telegraph Sudoku & Kakuro (Europe) else if (strcmp(romTid, "KXLE") == 0 || strcmp(romTid, "KXLP") == 0) { *(u32*)0x02011FF4 = 0xE1A00000; // nop - tonccpy((u32*)0x02012B6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012B6C, dsiSaveGetResultCode, 0xC); *(u32*)0x02015584 = 0xE1A00000; // nop patchInitDSiWare(0x0201AFE8, heapEnd); patchUserSettingsReadDSiWare(0x0201C624); @@ -24630,7 +24630,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Oshiete Darling (Japan) else if (strcmp(romTid, "KOSJ") == 0) { *(u32*)0x0200B3F4 = 0xE1A00000; // nop - tonccpy((u32*)0x0200BF6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF6C, dsiSaveGetResultCode, 0xC); *(u32*)0x0200E894 = 0xE1A00000; // nop patchInitDSiWare(0x0201412C, heapEnd); patchUserSettingsReadDSiWare(0x02015704); @@ -24653,7 +24653,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // ENG banner text: Tell me Darling else if (strcmp(romTid, "KOSK") == 0) { *(u32*)0x0200B40C = 0xE1A00000; // nop - tonccpy((u32*)0x0200BF90, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF90, dsiSaveGetResultCode, 0xC); *(u32*)0x0200E940 = 0xE1A00000; // nop patchInitDSiWare(0x02014210, heapEnd); patchUserSettingsReadDSiWare(0x020157F8); @@ -24795,7 +24795,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x0200C9EC = 0xE1A00000; // nop - tonccpy((u32*)0x0200D680, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200D680, dsiSaveGetResultCode, 0xC); *(u32*)0x0201041C = 0xE1A00000; // nop patchInitDSiWare(0x02017BD4, heapEnd); *(u32*)0x02017F44 = *(u32*)0x020013C0; @@ -24837,7 +24837,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } *(u32*)0x02010650 = 0xE1A00000; // nop - tonccpy((u32*)0x020111C8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020111C8, dsiSaveGetResultCode, 0xC); *(u32*)0x02013F28 = 0xE1A00000; // nop patchInitDSiWare(0x0201B050, heapEnd); *(u32*)0x0201B3DC = *(u32*)0x02004FD0; @@ -24915,7 +24915,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020082F8 = 0xE12FFF1E; // bx lr *(u32*)0x02008B88 = 0xE1A00000; // nop *(u32*)0x020415A4 = 0xE1A00000; // nop - tonccpy((u32*)0x0204211C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204211C, dsiSaveGetResultCode, 0xC); *(u32*)0x020454A4 = 0xE1A00000; // nop patchInitDSiWare(0x0204D648, heapEnd); /* if (!extendedMemory) { @@ -25073,7 +25073,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200163C = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } *(u32*)(0x0200B734+offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x0200C3C8+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0200C3C8+offsetChange), dsiSaveGetResultCode, 0xC); *(u32*)(0x0200F1D4+offsetChange) = 0xE1A00000; // nop *(u32*)(0x020154AC+offsetChange) = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x020154C4+offsetChange, heapEnd); @@ -25101,7 +25101,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { doubleNopT(0x02040D24); doubleNopT(0x020B4B40); doubleNopT(0x020B9216); - toncset16((u16*)0x020B9298, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020B9298, 0x4A, nopT); // Do not use DSi WRAM *(u32*)0x020C7510 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x020C7528, heapEnd); *(u32*)0x020C7898 -= 0x30000; @@ -25133,7 +25133,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { doubleNopT(0x02040A14); doubleNopT(0x020B4830); doubleNopT(0x020B8F06); - toncset16((u16*)0x020B8F88, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020B8F88, 0x4A, nopT); // Do not use DSi WRAM *(u32*)0x020C7200 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x020C7218, heapEnd); *(u32*)0x020C7588 -= 0x30000; @@ -25439,7 +25439,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02021020 = 0xE1A00000; // nop setBL(0x02021028, (u32)dsiSaveClose); */ *(u32*)0x02038BE0 = 0xE1A00000; // nop - // tonccpy((u32*)0x02039874, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x02039874, dsiSaveGetResultCode, 0xC); *(u32*)0x0203CC30 = 0xE1A00000; // nop patchInitDSiWare(0x0204489C, heapEnd); patchUserSettingsReadDSiWare(0x02045D78); @@ -25511,7 +25511,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020078D8 = 0xE12FFF1E; // bx lr *(u32*)0x02008160 = 0xE1A00000; // nop *(u32*)0x02040024 = 0xE1A00000; // nop - tonccpy((u32*)0x02040CB8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040CB8, dsiSaveGetResultCode, 0xC); *(u32*)0x02044084 = 0xE1A00000; // nop *(u32*)0x0204C2E8 = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204C300, heapEnd); @@ -25559,7 +25559,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0200509C = 0xE1A00000; // nop *(u32*)0x020058EC = 0xE1A00000; // nop *(u32*)0x0201AA9C = 0xE1A00000; // nop - tonccpy((u32*)0x0201B634, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201B634, dsiSaveGetResultCode, 0xC); *(u32*)0x0201E184 = 0xE1A00000; // nop patchInitDSiWare(0x0202657C, heapEnd); patchUserSettingsReadDSiWare(0x02027A48); @@ -25590,7 +25590,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005084 = 0xE1A00000; // nop *(u32*)0x020057D0 = 0xE1A00000; // nop *(u32*)0x0201A168 = 0xE1A00000; // nop - tonccpy((u32*)0x0201AD00, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201AD00, dsiSaveGetResultCode, 0xC); *(u32*)0x0201D850 = 0xE1A00000; // nop patchInitDSiWare(0x02025C48, heapEnd); patchUserSettingsReadDSiWare(0x02027114); @@ -25765,7 +25765,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // DSi Camera is disabled due to DS mode limitations else if (strcmp(romTid, "KWQE") == 0 || strcmp(romTid, "KWQJ") == 0) { *(u32*)0x020145B0 = 0xE1A00000; // nop - tonccpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); *(u32*)0x0201837C = 0xE1A00000; // nop patchInitDSiWare(0x0201FD04, heapEnd); patchUserSettingsReadDSiWare(0x02021428); @@ -25826,31 +25826,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KDWE") == 0) { const u32 dsiSaveCreateT = 0x02023258; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02023268; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02023278; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02023288; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02023298; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x020232A8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020232B8; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200C918 = 0x2001; // movs r0, #1 *(u16*)0x0200C91A = 0x4770; // bx lr @@ -25863,7 +25863,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200CCB4, dsiSaveWriteT); setBLThumb(0x0200CCC6, dsiSaveCloseT); *(u16*)0x0200CCEC = 0x4778; // bx pc - tonccpy((u32*)0x0200CCF0, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200CCF0, dsiSaveGetLength, 0xC); setBLThumb(0x0200CD1C, dsiSaveOpenT); setBLThumb(0x0200CD42, dsiSaveCloseT); setBLThumb(0x0200CD54, dsiSaveReadT); @@ -25928,7 +25928,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02009E14 = 0xE12FFF1E; // bx lr *(u32*)0x0200A648 = 0xE1A00000; // nop *(u32*)0x02042348 = 0xE1A00000; // nop - tonccpy((u32*)0x02042EC0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042EC0, dsiSaveGetResultCode, 0xC); *(u32*)0x02046248 = 0xE1A00000; // nop patchInitDSiWare(0x0204E164, heapEnd); if (!extendedMemory) { @@ -26206,7 +26206,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KYWE") == 0) { useSharedFont = (twlFontFound && debugOrMep); *(u32*)0x0200DB1C = 0xE1A00000; // nop - tonccpy((u32*)0x0200E6A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E6A0, dsiSaveGetResultCode, 0xC); *(u32*)0x020110BC = 0xE1A00000; // nop patchInitDSiWare(0x02017830, heapEnd); setBL(0x02031D38, (u32)dsiSaveCreate); @@ -26244,7 +26244,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020055A0 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } *(u32*)0x0200DD60 = 0xE1A00000; // nop - tonccpy((u32*)0x0200E8E4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E8E4, dsiSaveGetResultCode, 0xC); *(u32*)0x02011300 = 0xE1A00000; // nop patchInitDSiWare(0x02017ACC, heapEnd); patchUserSettingsReadDSiWare(0x02018F6C); @@ -26270,7 +26270,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { useSharedFont = twlFontFound; *(u32*)0x0200508C = 0xE1A00000; // nop *(u32*)0x0201CD5C = 0xE1A00000; // nop - tonccpy((u32*)0x0201DA10, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201DA10, dsiSaveGetResultCode, 0xC); *(u32*)0x02020374 = 0xE1A00000; // nop patchInitDSiWare(0x02026E84, heapEnd); if (!extendedMemory) { @@ -26303,7 +26303,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { useSharedFont = twlFontFound; *(u32*)0x0200148C = 0xE1A00000; // nop *(u32*)0x02019130 = 0xE1A00000; // nop - tonccpy((u32*)0x02019DE4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02019DE4, dsiSaveGetResultCode, 0xC); *(u32*)0x0201C748 = 0xE1A00000; // nop patchInitDSiWare(0x02023258, heapEnd); if (!extendedMemory) { @@ -26362,7 +26362,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (romTid[3] == 'E') { *(u32*)0x02042B0C = 0xE1A00000; // nop - tonccpy((u32*)0x02043684, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043684, dsiSaveGetResultCode, 0xC); *(u32*)0x02046A0C = 0xE1A00000; // nop patchInitDSiWare(0x0204E928, heapEnd); if (!extendedMemory) { @@ -26375,7 +26375,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } else { *(u32*)0x02042AA8 = 0xE1A00000; // nop - tonccpy((u32*)0x02043620, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043620, dsiSaveGetResultCode, 0xC); *(u32*)0x020469A8 = 0xE1A00000; // nop patchInitDSiWare(0x0204E8C4, heapEnd); if (!extendedMemory) { @@ -26414,7 +26414,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02007974 = 0xE12FFF1E; // bx lr *(u32*)0x020081FC = 0xE1A00000; // nop *(u32*)0x02040818 = 0xE1A00000; // nop - tonccpy((u32*)0x020414AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020414AC, dsiSaveGetResultCode, 0xC); *(u32*)0x02044878 = 0xE1A00000; // nop *(u32*)0x0204CADC = 0xE3A00001; // mov r0, #1 patchInitDSiWare(0x0204CAF4, heapEnd); @@ -26453,7 +26453,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02008EAC = 0xE12FFF1E; // bx lr *(u32*)0x0200973C = 0xE1A00000; // nop *(u32*)0x02041D10 = 0xE1A00000; // nop - tonccpy((u32*)0x02042888, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042888, dsiSaveGetResultCode, 0xC); *(u32*)0x02045C10 = 0xE1A00000; // nop patchInitDSiWare(0x0204DBB8, heapEnd); if (!extendedMemory) { @@ -26575,7 +26575,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Zimo: Mahjong Puzzle (Japan) else if (strcmp(romTid, "KKHE") == 0 || strcmp(romTid, "KKHJ") == 0) { *(u32*)0x020123D4 = 0xE1A00000; // nop - tonccpy((u32*)0x02012F58, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012F58, dsiSaveGetResultCode, 0xC); *(u32*)0x020161A0 = 0xE1A00000; // nop patchInitDSiWare(0x0201BD98, heapEnd); patchUserSettingsReadDSiWare(0x0201D3EC); @@ -26760,7 +26760,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020142B8 = 0xE1A00000; // nop (dsiSaveCreateDirAuto) setBL(0x020142C4, (u32)dsiSaveCreate); *(u32*)0x02015334 = 0xE1A00000; // nop - tonccpy((u32*)0x02016E10, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016E10, dsiSaveGetResultCode, 0xC); *(u32*)0x02019CEC = 0xE1A00000; // nop patchInitDSiWare(0x0201FF04, heapEnd); *(u32*)0x02020290 -= 0x30000; diff --git a/retail/bootloader/source/arm7/hook_arm7.c b/retail/bootloader/source/arm7/hook_arm7.c index 89e0eae1e..9a56db36e 100644 --- a/retail/bootloader/source/arm7/hook_arm7.c +++ b/retail/bootloader/source/arm7/hook_arm7.c @@ -31,7 +31,7 @@ #include "patch.h" #include "find.h" #include "hook.h" -#include "tonccpy.h" +#include "aeabi.h" #define b_sleepMode BIT(17) @@ -243,7 +243,7 @@ int hookNdsRetailArm7( aFile apPatchFile; getFileFromCluster(&apPatchFile, apPatchFileCluster); const u32 cheatSizeTotal = cheatSize+(apPatchIsCheat ? apPatchSize : 0); if (cheatSizeTotal > 4 && cheatSizeTotal <= 0x1C00) { - tonccpy((u8*)cheatEngineAddr, (u8*)CHEAT_ENGINE_LOCATION_B4DS_BUFFERED, 0x400); + __aeabi_memcpy((u8*)cheatEngineAddr, (u8*)CHEAT_ENGINE_LOCATION_B4DS_BUFFERED, 0x400); char* cheatDataOffset = (char*)cheatEngineAddr+0x3E8; if (apPatchFile.firstCluster != CLUSTER_FREE && apPatchIsCheat) { @@ -257,7 +257,7 @@ int hookNdsRetailArm7( dbg_printf("Cheats found and applied\n"); } } - toncset((u8*)CHEAT_ENGINE_LOCATION_B4DS_BUFFERED, 0, 0x400); + __aeabi_memclr((u8*)CHEAT_ENGINE_LOCATION_B4DS_BUFFERED, 0x400); nocashMessage("ERR_NONE"); return ERR_NONE; diff --git a/retail/bootloader/source/arm7/ips.c b/retail/bootloader/source/arm7/ips.c index b3d870121..288b85ca1 100644 --- a/retail/bootloader/source/arm7/ips.c +++ b/retail/bootloader/source/arm7/ips.c @@ -8,7 +8,7 @@ #include "nds_header.h" #include "locations.h" #include "my_fat.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 apFixOverlaysCluster; @@ -64,7 +64,7 @@ bool applyIpsPatch(const tNDSHeader* ndsHeader, u8* ipsbyte, bool arm9Only, bool repeatbyte[ontime] = ipsbyte[ipson]; } if (!overlays || ROMinRAM) { - tonccpy(rombyte+offset, repeatbyte, totalrepeats); + __aeabi_memcpy(rombyte+offset, repeatbyte, totalrepeats); } else { fileWrite((char*)&repeatbyte, &apFixOverlaysFile, offset, totalrepeats); } @@ -73,7 +73,7 @@ bool applyIpsPatch(const tNDSHeader* ndsHeader, u8* ipsbyte, bool arm9Only, bool totalrepeats = ipsbyte[ipson] * 256 + ipsbyte[ipson + 1]; ipson += 2; if (!overlays || ROMinRAM) { - tonccpy(rombyte+offset, ipsbyte+ipson, totalrepeats); + __aeabi_memcpy(rombyte+offset, ipsbyte+ipson, totalrepeats); } else { fileWrite((char*)ipsbyte+ipson, &apFixOverlaysFile, offset, totalrepeats); } diff --git a/retail/bootloader/source/arm7/main.arm7.c b/retail/bootloader/source/arm7/main.arm7.c index 7d910d1ce..04d45b732 100644 --- a/retail/bootloader/source/arm7/main.arm7.c +++ b/retail/bootloader/source/arm7/main.arm7.c @@ -57,7 +57,7 @@ #define REG_GPIO_WIFI *(vu16*)0x4004C04 -#include "tonccpy.h" +#include "aeabi.h" #include "my_fat.h" #include "debug_file.h" #include "nds_header.h" @@ -86,7 +86,6 @@ typedef unsigned char data_t; //#define resetCpu() __asm volatile("\tswi 0x000000\n"); -extern void arm7clearRAM(void); extern void arm7code(u32* addr); //extern u32 _start; @@ -223,7 +222,7 @@ static void initMBK(void) { void memset_addrs_arm7(u32 start, u32 end) { - toncset((u32*)start, 0, ((int)end - (int)start)); + __aeabi_memclr((u32*)start, ((int)end - (int)start)); } /*------------------------------------------------------------------------- @@ -270,14 +269,14 @@ static void resetMemory_ARM7(void) { memset_addrs_arm7(0x03800000 - 0x8000, 0x03800000 + 0x10000); memset_addrs_arm7(0x02000620, IMAGES_LOCATION-0x1000); // clear part of EWRAM - except before nds-bootstrap images - toncset((u32*)0x02380000, 0, 0x38000); // clear part of EWRAM - except before 0x023DA000, which has the arm9 code - toncset((u32*)0x023C0000, 0, 0x20000); - toncset((u32*)0x023F0000, 0, 0xD000); - toncset((u32*)0x023FE000, 0, 0x400); - toncset((u32*)0x023FF000, 0, 0x1000); + __aeabi_memclr((u32*)0x02380000, 0x38000); // clear part of EWRAM - except before 0x023DA000, which has the arm9 code + __aeabi_memclr((u32*)0x023C0000, 0x20000); + __aeabi_memclr((u32*)0x023F0000, 0xD000); + __aeabi_memclr((u32*)0x023FE000, 0x400); + __aeabi_memclr((u32*)0x023FF000, 0x1000); if (extendedMemory) { - toncset((u32*)0x02400000, 0, 0x3FC000); - toncset((u32*)0x027FF000, 0, dsDebugRam ? 0x1000 : 0x801000); + __aeabi_memclr((u32*)0x02400000, 0x3FC000); + __aeabi_memclr((u32*)0x027FF000, dsDebugRam ? 0x1000 : 0x801000); } REG_IE = 0; @@ -447,7 +446,7 @@ static void NDSTouchscreenMode(void) { static module_params_t* buildModuleParams(u32 donorSdkVer) { module_params_t* moduleParams = (module_params_t*)malloc(sizeof(module_params_t)); - toncset(moduleParams, 0, sizeof(module_params_t)); + __aeabi_memclr(moduleParams, sizeof(module_params_t)); moduleParams->compressed_static_end = 0; // Avoid decompressing switch (donorSdkVer) { @@ -764,7 +763,7 @@ static void my_readUserSettings(tNDSHeader* ndsHeader) { PERSONAL_DATA* personalData = (PERSONAL_DATA*)((u32)__NDSHeader - (u32)ndsHeader + (u32)PersonalData); //(u8*)((u32)ndsHeader - 0x180) - tonccpy(PersonalData, currentSettings, sizeof(PERSONAL_DATA)); + __aeabi_memcpy(PersonalData, currentSettings, sizeof(PERSONAL_DATA)); if (language >= 0 && language <= 7) { // Change language @@ -855,7 +854,7 @@ static void loadOverlaysintoFile(const tNDSHeader* ndsHeader, const module_param break; } } - toncset((char*)buffer, 0, bufferSize); + __aeabi_memclr((char*)buffer, bufferSize); if (!isSdk5(moduleParams)) { u32 word = 0; @@ -879,7 +878,7 @@ static void fileReadWithBuffer(const u32 memDst, aFile* file, const u32 src, u32 u32 readLenBuf = (len > bufferSize) ? bufferSize : len; fileRead((char*)buffer, file, src+dst, readLenBuf); - tonccpy((char*)memDst+dst, (char*)buffer, readLenBuf); + __aeabi_memcpy((char*)memDst+dst, (char*)buffer, readLenBuf); len -= bufferSize; dst += bufferSize; @@ -888,7 +887,7 @@ static void fileReadWithBuffer(const u32 memDst, aFile* file, const u32 src, u32 break; } } - toncset((char*)buffer, 0, bufferSize); + __aeabi_memclr((char*)buffer, bufferSize); } static void loadIOverlaysintoRAM(const tDSiHeader* dsiHeader, aFile* file, const bool usesCloneboot) { @@ -943,35 +942,38 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* // Construct TWLCFG u8* twlCfg = (u8*)0x02000400; u8* personalData = (u8*)0x02FFFC80; - tonccpy(twlCfg+0x6, personalData+0x64, 1); // Selected Language (eg. 1=English) - tonccpy(twlCfg+0x7, personalData+0x66, 1); // RTC Year (last date change) (max 63h=2099) - tonccpy(twlCfg+0x8, personalData+0x68, 4); // RTC Offset (difference in seconds on change) - tonccpy(twlCfg+0x1A, personalData+0x52, 1); // Alarm Hour (0..17h) - tonccpy(twlCfg+0x1B, personalData+0x53, 1); // Alarm Minute (0..3Bh) - tonccpy(twlCfg+0x1E, personalData+0x56, 1); // Alarm Enable (0=Off, 1=On) - toncset(twlCfg+0x24, 0x03, 1); // Unknown (02h or 03h) - tonccpy(twlCfg+0x30, personalData+0x58, 0xC); // TSC calib - toncset32(twlCfg+0x3C, 0x0201209C, 1); - tonccpy(twlCfg+0x44, personalData+0x02, 1); // Favorite color (also Sysmenu Cursor Color) - tonccpy(twlCfg+0x46, personalData+0x03, 2); // Birthday (month, day) - tonccpy(twlCfg+0x48, personalData+0x06, 0x16); // Nickname (UCS-2), max 10 chars+EOL - tonccpy(twlCfg+0x5E, personalData+0x1C, 0x36); // Message (UCS-2), max 26 chars+EOL + const u32 unk = 0x0201209C; + __aeabi_memcpy(twlCfg+0x6, personalData+0x64, 1); // Selected Language (eg. 1=English) + __aeabi_memcpy(twlCfg+0x7, personalData+0x66, 1); // RTC Year (last date change) (max 63h=2099) + __aeabi_memcpy(twlCfg+0x8, personalData+0x68, 4); // RTC Offset (difference in seconds on change) + __aeabi_memcpy(twlCfg+0x1A, personalData+0x52, 1); // Alarm Hour (0..17h) + __aeabi_memcpy(twlCfg+0x1B, personalData+0x53, 1); // Alarm Minute (0..3Bh) + __aeabi_memcpy(twlCfg+0x1E, personalData+0x56, 1); // Alarm Enable (0=Off, 1=On) + __aeabi_memset(twlCfg+0x24, 1, 0x03); // Unknown (02h or 03h) + __aeabi_memcpy(twlCfg+0x30, personalData+0x58, 0xC); // TSC calib + __aeabi_memcpy(twlCfg+0x3C, &unk, 4); + __aeabi_memcpy(twlCfg+0x44, personalData+0x02, 1); // Favorite color (also Sysmenu Cursor Color) + __aeabi_memcpy(twlCfg+0x46, personalData+0x03, 2); // Birthday (month, day) + __aeabi_memcpy(twlCfg+0x48, personalData+0x06, 0x16); // Nickname (UCS-2), max 10 chars+EOL + __aeabi_memcpy(twlCfg+0x5E, personalData+0x1C, 0x36); // Message (UCS-2), max 26 chars+EOL readFirmware(0x1FD, twlCfg+0x1E0, 1); // WlFirm Type (1=DWM-W015, 2=W024, 3=W028) + u32 wlFirmVars = 0x500400; + u32 wlFirmBase = 0x500000; + u32 wlFirmSize = 0x02E000; if (twlCfg[0x1E0] == 2 || twlCfg[0x1E0] == 3) { - toncset32(twlCfg+0x1E4, 0x520000, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x520000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x020000, 1); // WlFirm RAM size - } else { - toncset32(twlCfg+0x1E4, 0x500400, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x500000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x02E000, 1); // WlFirm RAM size + wlFirmVars = 0x520000; + wlFirmBase = 0x520000; + wlFirmSize = 0x020000; } + __aeabi_memcpy(twlCfg+0x1E4, &wlFirmVars, 4); // WlFirm RAM vars + __aeabi_memcpy(twlCfg+0x1E8, &wlFirmBase, 4); // WlFirm RAM base + __aeabi_memcpy(twlCfg+0x1EC, &wlFirmSize, 4); // WlFirm RAM size *(u16*)(twlCfg+0x1E2) = swiCRC16(0xFFFF, twlCfg+0x1E4, 0xC); // WlFirm CRC16 u32 configFlags = 0x0100000F; configFlags |= BIT(3); - toncset32(twlCfg, configFlags, 1); // Config Flags + __aeabi_memcpy(twlCfg, &configFlags, 4); // Config Flags fileRead(twlCfg+0x10, &romFile, 0x20E, 1); // EULA Version (0=None/CountryChanged, 1=v1) fileRead(twlCfg+0x9C, &romFile, 0x2F0, 1); // Parental Controls Years of Age Rating (00h..14h) }*/ @@ -997,7 +999,7 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* } else if (ndsHeader->gameCode[3] == 'K') { newRegion = 5; } - toncset((u8*)0x02FFFD70, newRegion, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, newRegion); } else if (region == -1) { // Determine region by language PERSONAL_DATA* personalData = (PERSONAL_DATA*)((u32)__NDSHeader - (u32)ndsHeader + (u32)PersonalData); //(u8*)((u32)ndsHeader - 0x180) @@ -1013,9 +1015,9 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* } else if (personalData->language >= 2 && personalData->language <= 5) { newRegion = 2; // Europe } - toncset((u8*)0x02FFFD70, newRegion, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, newRegion); } else { - toncset((u8*)0x02FFFD70, region, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, region); } // Set bitmask for supported languages u8 curRegion = *(u8*)0x02FFFD70; @@ -1046,7 +1048,7 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* // Make the Pokemon game code ADAJ. const char gameCodePokemon[] = { 'A', 'D', 'A', 'J' }; tNDSHeader* ndsHeaderPokemon = (tNDSHeader*)NDS_HEADER_POKEMON; - tonccpy(ndsHeaderPokemon->gameCode, gameCodePokemon, 4); + __aeabi_memcpy(ndsHeaderPokemon->gameCode, gameCodePokemon, 4); } // Set memory values expected by loaded NDS @@ -1256,26 +1258,26 @@ int arm7_main(void) { const bool dsBrowser = (strcmp(romTid, "UBRP") == 0); if (dsBrowser && extendedMemory && !dsDebugRam) { - toncset((char*)0x0C400000, 0xFF, 0xC0); - toncset((u8*)0x0C4000B2, 0, 3); - toncset((u8*)0x0C4000B5, 0x24, 3); + __aeabi_memset((char*)0x0C400000, 0xC0, 0xFF); + __aeabi_memclr((u8*)0x0C4000B2, 3); + __aeabi_memset((u8*)0x0C4000B5, 3, 0x24); *(u16*)0x0C4000BE = 0x7FFF; - toncset((char*)0x0C4000C0, 0, 0xE); + __aeabi_memclr((char*)0x0C4000C0, 0xE); *(u16*)0x0C4000CE = 0x7FFF; - toncset((char*)0x0C4000D0, 0, 0x130); + __aeabi_memclr((char*)0x0C4000D0, 0x130); } *(vu16*)0x08240000 = 1; expansionPakFound = ((*(vu16*)0x08240000 == 1) && (s2FlashcardId != 0 || !dsBrowser)); if (dsBrowser && s2FlashcardId != 0 && s2FlashcardId != 0x5A45) { - toncset((char*)0x08000000, 0xFF, 0xC0); - toncset((u8*)0x080000B2, 0, 3); - toncset((u8*)0x080000B5, 0x24, 3); + __aeabi_memset((char*)0x08000000, 0xC0, 0xFF); + __aeabi_memclr((u8*)0x080000B2, 3); + __aeabi_memset((u8*)0x080000B5, 3, 0x24); *(u16*)0x080000BE = 0x7FFF; - toncset((char*)0x080000C0, 0, 0xE); + __aeabi_memclr((char*)0x080000C0, 0xE); *(u16*)0x080000CE = 0x7FFF; - toncset((char*)0x080000D0, 0, 0x130); + __aeabi_memclr((char*)0x080000D0, 0x130); } // dbg_printf("Trying to patch the card...\n"); @@ -1283,11 +1285,11 @@ int arm7_main(void) { ce9Location = *(u32*)CARDENGINE_ARM9_LOCATION_BUFFERED; ce9Alt = (ce9Location == CARDENGINE_ARM9_LOCATION_DLDI_ALT || ce9Location == CARDENGINE_ARM9_LOCATION_DLDI_ALT2); // const bool ce9NotInHeap = (ce9Alt || ce9Location == CARDENGINE_ARM9_LOCATION_DLDI_START); - tonccpy((u32*)ce9Location, (u32*)CARDENGINE_ARM9_LOCATION_BUFFERED, ce9Alt ? 0x2800 : 0x3800); - toncset((u32*)0x023E0000, 0, 0x10000); + __aeabi_memcpy((u32*)ce9Location, (u32*)CARDENGINE_ARM9_LOCATION_BUFFERED, ce9Alt ? 0x2800 : 0x3800); + __aeabi_memclr((u32*)0x023E0000, 0x10000); - tonccpy((u8*)CARDENGINE_ARM7_LOCATION, (u8*)CARDENGINE_ARM7_LOCATION_BUFFERED, 0x1000); - toncset((u8*)CARDENGINE_ARM7_LOCATION_BUFFERED, 0, 0x1000); + __aeabi_memcpy((u8*)CARDENGINE_ARM7_LOCATION, (u8*)CARDENGINE_ARM7_LOCATION_BUFFERED, 0x1000); + __aeabi_memclr((u8*)CARDENGINE_ARM7_LOCATION_BUFFERED, 0x1000); if (!dldiPatchBinary((data_t*)ce9Location, 0x3800, (data_t*)(extendedMemory ? 0x027FC000 : ((accessControl & BIT(4)) && !ce9Alt) ? 0x023FC000 : 0x023FD000))) { dbg_printf("ce9 DLDI patch failed\n"); @@ -1421,7 +1423,7 @@ int arm7_main(void) { fatTableAddr -= romFile.fatTableCacheSize; } } */ - tonccpy((u32*)fatTableAddr, (u32*)0x037F8000, romFile.fatTableCacheSize); + __aeabi_memcpy((u32*)fatTableAddr, (u32*)0x037F8000, romFile.fatTableCacheSize); romFile.fatTableCache = (u32*)fatTableAddr; lastClusterCacheUsed = (u32*)0x037F8000; @@ -1437,7 +1439,7 @@ int arm7_main(void) { } else { fatTableAddr -= savFile.fatTableCacheSize; } - tonccpy((u32*)fatTableAddr, (u32*)0x037F8000, savFile.fatTableCacheSize); + __aeabi_memcpy((u32*)fatTableAddr, (u32*)0x037F8000, savFile.fatTableCacheSize); savFile.fatTableCache = (u32*)fatTableAddr; } if (musicCluster != 0) { @@ -1452,7 +1454,7 @@ int arm7_main(void) { } else { fatTableAddr -= musicsFile.fatTableCacheSize; } - tonccpy((u32*)fatTableAddr, (u32*)0x037F8000, musicsFile.fatTableCacheSize); + __aeabi_memcpy((u32*)fatTableAddr, (u32*)0x037F8000, musicsFile.fatTableCacheSize); musicsFile.fatTableCache = (u32*)fatTableAddr; } // } @@ -1503,7 +1505,7 @@ int arm7_main(void) { patchBinary((cardengineArm9*)ce9Location, ndsHeader, moduleParams); patchCardNdsArm9Cont((cardengineArm9*)ce9Location, ndsHeader, moduleParams); - toncset((u32*)0x0380C000, 0, 0x2780); + __aeabi_memclr((u32*)0x0380C000, 0x2780); errorCode = hookNdsRetailArm7( (cardengineArm7*)CARDENGINE_ARM7_LOCATION, @@ -1611,7 +1613,7 @@ int arm7_main(void) { } } - toncset16((u32*)IMAGES_LOCATION, 0, (256*192)*3); // Clear nds-bootstrap images and IPS patch + __aeabi_memclr((u32*)IMAGES_LOCATION, ((256*192)*3)*sizeof(u16)); // Clear nds-bootstrap images and IPS patch if (ce9Alt) { unpatchedFunctions* unpatchedFuncs = (unpatchedFunctions*)UNPATCHED_FUNCTION_LOCATION; @@ -1623,8 +1625,8 @@ int arm7_main(void) { //codeBranch += 0x30; const u32 codeBranch = 0x023FF200; - tonccpy((u32*)0x02370000, ce9, 0x2800); - tonccpy((u32*)codeBranch, copyBackCe9, copyBackCe9Len); + __aeabi_memcpy((u32*)0x02370000, ce9, 0x2800); + __aeabi_memcpy((u32*)codeBranch, copyBackCe9, copyBackCe9Len); for (int i = 0; i < copyBackCe9Len/4; i++) { u32* addr = (u32*)codeBranch; if (addr[i] == 0x77777777) { @@ -1633,7 +1635,7 @@ int arm7_main(void) { } } - toncset(ce9, 0, 0x2800); + __aeabi_memclr(ce9, 0x2800); u32 blFrom = (u32)ndsHeader->arm9executeAddress; for (int i = 0; i < 0x200/4; i++) { diff --git a/retail/bootloader/source/arm7/patch_arm7.c b/retail/bootloader/source/arm7/patch_arm7.c index 5b681f162..6296274f1 100644 --- a/retail/bootloader/source/arm7/patch_arm7.c +++ b/retail/bootloader/source/arm7/patch_arm7.c @@ -7,7 +7,7 @@ #include "common.h" #include "value_bits.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #include "cardengine_header_arm7.h" #include "debug_file.h" @@ -232,26 +232,27 @@ static void fixForDSiBios(const cardengineArm7* ce7, const tNDSHeader* ndsHeader // swi 0x12 call if (swi12Offset) { // Patch to call swi 0x02 instead of 0x12 - tonccpy(swi12Offset, swi12Patch, 0x4); + __aeabi_memcpy(swi12Offset, swi12Patch, 0x4); } // swi get pitch table if (swiGetPitchTableOffset) { // Patch if (isSdk5(moduleParams)) { - toncset16(swiGetPitchTableOffset, 0x46C0, 6); + u16 swiGetPitchTablePatch5[6] = {0x46C0}; + __aeabi_memcpy(swiGetPitchTableOffset, swiGetPitchTablePatch5, 6*sizeof(u16)); } else if (patchOffsetCache.a7IsThumb) { - tonccpy((u16*)newSwiGetPitchTableAddr, swiGetPitchTablePatch, 0x10); + __aeabi_memcpy((u16*)newSwiGetPitchTableAddr, swiGetPitchTablePatch, 0x10); u32 srcAddr = (u32)swiGetPitchTableOffset - vAddrOfRelocSrc + 0x37F8000; u32 dstAddr = (u32)newSwiGetPitchTableAddr - vAddrOfRelocSrc + 0x37F8000; const u16* swiGetPitchTableBranch = generateA7InstrThumb(srcAddr, dstAddr); - tonccpy(swiGetPitchTableOffset, swiGetPitchTableBranch, 0x4); + __aeabi_memcpy(swiGetPitchTableOffset, swiGetPitchTableBranch, 0x4); dbg_printf("swiGetPitchTable new location : "); dbg_hexa(newSwiGetPitchTableAddr); dbg_printf("\n\n"); } else { - tonccpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTable, 0xC); + __aeabi_memcpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTable, 0xC); } } } @@ -354,10 +355,10 @@ static bool patchCardIrqEnable(cardengineArm7* ce7, const tNDSHeader* ndsHeader, const bool usesThumb = (*(u16*)cardIrqEnableOffset == 0xB510 || *(u16*)cardIrqEnableOffset == 0xB530); if (usesThumb) { u16* cardIrqEnablePatch = (u16*)ce7->patches->thumb_card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); } else { u32* cardIrqEnablePatch = ce7->patches->card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); } dbg_printf("cardIrqEnable location : "); @@ -371,7 +372,7 @@ static bool patchCardIrqEnable(cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32* cardCheckPullOutOffset = findCardCheckPullOutOffset(ndsHeader, moduleParams); if (cardCheckPullOutOffset) { u32* cardCheckPullOutPatch = ce7->patches->card_pull_out_arm9; - tonccpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); + __aeabi_memcpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); } }*/ diff --git a/retail/bootloader/source/arm7/patch_arm9.c b/retail/bootloader/source/arm7/patch_arm9.c index 395265079..40751def8 100644 --- a/retail/bootloader/source/arm7/patch_arm9.c +++ b/retail/bootloader/source/arm7/patch_arm9.c @@ -7,7 +7,7 @@ #include "cardengine_header_arm9.h" #include "unpatched_funcs.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" #include "value_bits.h" #define FEATURE_SLOT_GBA 0x00000010 @@ -135,7 +135,7 @@ static bool patchCardRead(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons // Patch u32* cardReadPatch = (usesThumb ? ce9->thumbPatches->card_read_arm9 : ce9->patches->card_read_arm9); - tonccpy(cardReadStartOffset, cardReadPatch, usesThumb ? (isSdk5(moduleParams) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 + __aeabi_memcpy(cardReadStartOffset, cardReadPatch, usesThumb ? (isSdk5(moduleParams) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 dbg_printf("cardRead location : "); dbg_hexa((u32)cardReadStartOffset); dbg_printf("\n"); @@ -190,7 +190,7 @@ static void patchCardPullOut(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c // Patch u32* cardPullOutPatch = (usesThumb ? ce9->thumbPatches->card_pull : ce9->patches->card_pull); - tonccpy(cardPullOutOffset, cardPullOutPatch, 0x4); + __aeabi_memcpy(cardPullOutOffset, cardPullOutPatch, 0x4); dbg_printf("cardPullOut location : "); dbg_hexa((u32)cardPullOutOffset); dbg_printf("\n\n"); @@ -214,7 +214,7 @@ static void patchCacheFlush(cardengineArm9* ce9, bool usesThumb, u32* cardPullOu } // Patch u32* cardPullOutPatch = (usesThumb ? ce9->thumbPatches->card_pull : ce9->patches->card_pull); - tonccpy(forceToPowerOffOffset, cardPullOutPatch, 0x4); + __aeabi_memcpy(forceToPowerOffOffset, cardPullOutPatch, 0x4); }*/ static bool patchCardId(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const module_params_t* moduleParams, bool usesThumb, u32* cardReadEndOffset) { @@ -246,7 +246,7 @@ static bool patchCardId(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const u32* cardIdPatch = (usesThumb ? ce9->thumbPatches->card_id_arm9 : ce9->patches->card_id_arm9); cardIdPatch[usesThumb ? 1 : 2] = baseChipID; - tonccpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); + __aeabi_memcpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); dbg_printf("cardId location : "); dbg_hexa((u32)cardIdStartOffset); dbg_printf("\n\n"); @@ -281,7 +281,7 @@ static void patchCardReadDma(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c } // Patch u32* cardReadDmaPatch = (usesThumb ? ce9->thumbPatches->card_dma_arm9 : ce9->patches->card_dma_arm9); - tonccpy(cardReadDmaStartOffset, cardReadDmaPatch, usesThumb ? 4 : 8); + __aeabi_memcpy(cardReadDmaStartOffset, cardReadDmaPatch, usesThumb ? 4 : 8); dbg_printf("cardReadDma location : "); dbg_hexa((u32)cardReadDmaStartOffset); dbg_printf("\n\n"); @@ -302,7 +302,7 @@ static void patchReset(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const m // Patch u32* resetPatch = ce9->patches->reset_arm9; - tonccpy(reset, resetPatch, 0x40); + __aeabi_memcpy(reset, resetPatch, 0x40); dbg_printf("reset location : "); dbg_hexa((u32)reset); dbg_printf("\n\n"); @@ -391,7 +391,7 @@ static bool patchCardIrqEnable(cardengineArm9* ce9, const tNDSHeader* ndsHeader, return false; } u32* cardIrqEnablePatch = (usesThumb ? ce9->thumbPatches->card_irq_enable : ce9->patches->card_irq_enable); - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); dbg_printf("cardIrqEnable location : "); dbg_hexa((u32)cardIrqEnableOffset); dbg_printf("\n\n"); @@ -1197,7 +1197,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, //extern u32 accessControl; extern u32 arm9ibinarySize; if (/* !(accessControl & BIT(4)) || *(u32*)0x023B8000 != 0 */ !useSharedFont) { - toncset((u32*)0x023B8000, 0, arm9ibinarySize > 0x8000 ? 0x8000 : arm9ibinarySize); + __aeabi_memclr((u32*)0x023B8000, arm9ibinarySize > 0x8000 ? 0x8000 : arm9ibinarySize); return; } @@ -1231,7 +1231,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } } if (!fileIoOpen) { - toncset((u32*)0x023B8000, 0, arm9ibinarySize); + __aeabi_memclr((u32*)0x023B8000, arm9ibinarySize); return; } @@ -1248,7 +1248,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } } if (!fileIoClose) { - toncset((u32*)0x023B8000, 0, arm9ibinarySize); + __aeabi_memclr((u32*)0x023B8000, arm9ibinarySize); return; } @@ -1264,7 +1264,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } } if (!fileIoSeek) { - toncset((u32*)0x023B8000, 0, arm9ibinarySize); + __aeabi_memclr((u32*)0x023B8000, arm9ibinarySize); return; } @@ -1280,7 +1280,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } } if (!fileIoRead) { - toncset((u32*)0x023B8000, 0, arm9ibinarySize); + __aeabi_memclr((u32*)0x023B8000, arm9ibinarySize); return; } @@ -1314,8 +1314,8 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } dbg_printf("\n\n"); - tonccpy(moduleParams->static_bss_end, (u32*)0x023B8004, iUncompressedSizei-4); - toncset((u32*)0x023B8000, 0, iUncompressedSizei); + __aeabi_memcpy(moduleParams->static_bss_end, (u32*)0x023B8004, iUncompressedSizei-4); + __aeabi_memclr((u32*)0x023B8000, iUncompressedSizei); //bool armFound = false; //bool dsiBiosFuncsIn9i = false; @@ -1437,23 +1437,23 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } if (openBlFound) { *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); } if (closeBlFound) { *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); } if (seekBlFound) { *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); } if (readBlFound) { *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); } }*/ } else { // THUMB - toncset((u32*)0x023B8000, 0, 0x8000); + __aeabi_memclr((u32*)0x023B8000, 0x8000); u16* fileIoClose = (u16*)patchOffsetCache.fileIoCloseOffset; if (!patchOffsetCache.fileIoCloseOffset) { @@ -1502,8 +1502,8 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, return; // getOffsetFromBLThumb currently doesn't get backward offsets correctly - tonccpy(moduleParams->static_bss_end, (u32*)0x023B8004, 0x7FFC); - toncset((u32*)0x023B8000, 0, 0x8000); + __aeabi_memcpy(moduleParams->static_bss_end, (u32*)0x023B8004, 0x7FFC); + __aeabi_memclr((u32*)0x023B8000, 0x8000); const u32 dsiSaveOpenT = 0x02000200; const u32 dsiSaveCloseT = 0x02000210; @@ -1556,19 +1556,19 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } if (openBlFound) { *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); } if (closeBlFound) { *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); } if (seekBlFound) { *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); } if (readBlFound) { *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); } } } @@ -1581,7 +1581,7 @@ void patchTwlFontLoad(u32 heapAllocAddr, u32 newCodeAddr) { extern u32* twlFontHeapAlloc; extern u32 twlFontHeapAllocSize; - tonccpy((u32*)newCodeAddr, twlFontHeapAlloc, twlFontHeapAllocSize); + __aeabi_memcpy((u32*)newCodeAddr, twlFontHeapAlloc, twlFontHeapAllocSize); *(u32*)newCodeAddr = clusterCache-0x200000; setBL(heapAllocAddr, newCodeAddr+4); @@ -1591,12 +1591,12 @@ void patchTwlFontLoad(u32 heapAllocAddr, u32 newCodeAddr) { extern u32* twlFontHeapAllocNoMep; - tonccpy((u32*)newCodeAddr, twlFontHeapAllocNoMep, 0xC); + __aeabi_memcpy((u32*)newCodeAddr, twlFontHeapAllocNoMep, 0xC); setBL(heapAllocAddr, newCodeAddr); } void codeCopy(u32* dst, u32* src, u32 len) { - tonccpy(dst, src, len); + __aeabi_memcpy(dst, src, len); u32 srci = (u32)src; u32 dsti = (u32)dst; @@ -1875,11 +1875,11 @@ static void nandSavePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons //u32 gNandWrite(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandWritePatch = ce9->patches->nand_write_arm9; - tonccpy((u8*)sdPatchEntry+0x958, nandWritePatch, 0x40); + __aeabi_memcpy((u8*)sdPatchEntry+0x958, nandWritePatch, 0x40); //u32 gNandRead(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandReadPatch = ce9->patches->nand_read_arm9; - tonccpy((u8*)sdPatchEntry+0xD24, nandReadPatch, 0x40); + __aeabi_memcpy((u8*)sdPatchEntry+0xD24, nandReadPatch, 0x40); } else { // Jam with the Band (Europe) if (strcmp(romTid, "UXBP") == 0) { @@ -1897,11 +1897,11 @@ static void nandSavePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons //u32 gNandWrite(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandWritePatch = ce9->patches->nand_write_arm9; - tonccpy((u32*)0x0206176C, nandWritePatch, 0x40); + __aeabi_memcpy((u32*)0x0206176C, nandWritePatch, 0x40); //u32 gNandRead(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandReadPatch = ce9->patches->nand_read_arm9; - tonccpy((u32*)0x02061AC4, nandReadPatch, 0x40); + __aeabi_memcpy((u32*)0x02061AC4, nandReadPatch, 0x40); } } } @@ -1950,7 +1950,7 @@ static void patchCardReadPdash(cardengineArm9* ce9, const tNDSHeader* ndsHeader) if(sdPatchEntry) { // Patch u32* pDashReadPatch = ce9->patches->pdash_read; - tonccpy((u32*)sdPatchEntry, pDashReadPatch, 0x40); + __aeabi_memcpy((u32*)sdPatchEntry, pDashReadPatch, 0x40); } } @@ -1979,7 +1979,7 @@ static void operaRamPatch(void) { *(u32*)0x020402D8 = 0xD3FFFFF; *(u32*)0x020402DC = 0xD7FFFFF; *(u32*)0x020402E0 = 0xDFFFFFF; // ??? - toncset((char*)0xD000000, 0xFF, 0x800000); // Fill fake MEP with FFs + __aeabi_memset((char*)0xD000000, 0xFF, 0x800000); // Fill fake MEP with FFs } else { *(u32*)0x020402CC = 0xCFFFFFE; *(u32*)0x020402D0 = 0xC800000; @@ -1987,7 +1987,7 @@ static void operaRamPatch(void) { *(u32*)0x020402D8 = 0xCBFFFFF; *(u32*)0x020402DC = 0xCFFFFFF; *(u32*)0x020402E0 = 0xD7FFFFF; // ??? - toncset((char*)0xC800000, 0xFF, 0x800000); // Fill fake MEP with FFs + __aeabi_memset((char*)0xC800000, 0xFF, 0x800000); // Fill fake MEP with FFs } } diff --git a/retail/bootloader/source/arm7/patch_common.c b/retail/bootloader/source/arm7/patch_common.c index a4ffeae3f..d1b328b04 100644 --- a/retail/bootloader/source/arm7/patch_common.c +++ b/retail/bootloader/source/arm7/patch_common.c @@ -25,7 +25,7 @@ #include "patch.h" #include "common.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #include "loading_screen.h" #include "debug_file.h" @@ -450,38 +450,38 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params else if (strcmp(romTid, "CTXE") == 0) { extern u32 baseChipID; u32 cardIdFunc[2] = {0, 0}; - tonccpy(cardIdFunc, ce9->thumbPatches->card_id_arm9, 0x4); + __aeabi_memcpy(cardIdFunc, ce9->thumbPatches->card_id_arm9, 0x4); cardIdFunc[1] = baseChipID; const u16* branchCode1 = generateA7InstrThumb(0x020BA666, 0x020BA670); - tonccpy((void*)0x020BA666, branchCode1, 0x4); + __aeabi_memcpy((void*)0x020BA666, branchCode1, 0x4); - tonccpy((void*)0x020BA670, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BA670, cardIdFunc, 0x8); const u16* branchCode2 = generateA7InstrThumb(0x020BA66A, 0x020BA6C0); - tonccpy((void*)0x020BA66A, branchCode2, 0x4); + __aeabi_memcpy((void*)0x020BA66A, branchCode2, 0x4); - /* tonccpy((void*)0x020BA728, ce9->thumbPatches->card_set_dma_arm9, 0xC); + /* __aeabi_memcpy((void*)0x020BA728, ce9->thumbPatches->card_set_dma_arm9, 0xC); const u16* branchCode3 = generateA7InstrThumb(0x020BA70C, 0x020BA728); - tonccpy((void*)0x020BA70C, branchCode3, 0x4); + __aeabi_memcpy((void*)0x020BA70C, branchCode3, 0x4); *(u16*)0x020BA710 = 0xBDF8; */ const u16* branchCode4 = generateA7InstrThumb(0x020BAAA2, 0x020BAAAC); - tonccpy((void*)0x020BAAA2, branchCode4, 0x4); + __aeabi_memcpy((void*)0x020BAAA2, branchCode4, 0x4); - tonccpy((void*)0x020BAAAC, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BAAAC, cardIdFunc, 0x8); const u16* branchCode5 = generateA7InstrThumb(0x020BAAA6, 0x020BAAFC); - tonccpy((void*)0x020BAAA6, branchCode5, 0x4); + __aeabi_memcpy((void*)0x020BAAA6, branchCode5, 0x4); const u16* branchCode6 = generateA7InstrThumb(0x020BAC5C, 0x020BAC64); - tonccpy((void*)0x020BAC5C, branchCode6, 0x4); + __aeabi_memcpy((void*)0x020BAC5C, branchCode6, 0x4); - tonccpy((void*)0x020BAC64, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BAC64, cardIdFunc, 0x8); const u16* branchCode7 = generateA7InstrThumb(0x020BAC60, 0x020BACB6); - tonccpy((void*)0x020BAC60, branchCode7, 0x4); + __aeabi_memcpy((void*)0x020BAC60, branchCode7, 0x4); } // Shantae DSi (03/06/09 build) diff --git a/retail/bootloader/source/arm7/save_patches/save_patch_universal.c b/retail/bootloader/source/arm7/save_patches/save_patch_universal.c index 9f42652fc..91c7ed936 100644 --- a/retail/bootloader/source/arm7/save_patches/save_patch_universal.c +++ b/retail/bootloader/source/arm7/save_patches/save_patch_universal.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 newArm7binarySize; extern u32 vAddrOfRelocSrc; @@ -235,7 +235,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n"); - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)((u32)EepromWriteJump + 0x6); dbg_printf("Eeprom page write branch:\t"); @@ -245,7 +245,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n"); - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); newSwiGetPitchTableAddr = (u32)eepromPageWrite+0x14; u16* eepromPageProgBranch = (u16*)((u32)EepromProgJump + 0x6); @@ -256,7 +256,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n"); - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)((u32)EepromVerifyJump + 0x6); dbg_printf("Eeprom verify branch:\t"); @@ -266,7 +266,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n"); - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)((u32)EepromEraseJump + 0x4); dbg_printf("Eeprom page erase branch:\t"); @@ -276,7 +276,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n"); - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { u32* eepromRead = (u32*)((u32)EepromReadJump + 0xA); dbg_printf("Eeprom read:\t"); diff --git a/retail/bootloader/source/arm7/save_patches/save_patch_v5.c b/retail/bootloader/source/arm7/save_patches/save_patch_v5.c index 069601b69..9b6c9625f 100644 --- a/retail/bootloader/source/arm7/save_patches/save_patch_v5.c +++ b/retail/bootloader/source/arm7/save_patches/save_patch_v5.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 newArm7binarySize; extern u32 vAddrOfRelocSrc; @@ -81,7 +81,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32 save dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n"); - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)(JumpTableFunc + 0x16); dbg_printf("Eeprom page write branch:\t"); @@ -91,7 +91,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32 save dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n"); - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); u16* eepromPageProgBranch = (u16*)(JumpTableFunc + 0x24); dbg_printf("Eeprom page prog branch:\t"); @@ -101,7 +101,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32 save dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n"); - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)(JumpTableFunc + 0x32); dbg_printf("Eeprom verify branch:\t"); @@ -111,7 +111,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32 save dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n"); - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)(JumpTableFunc + 0x3E); dbg_printf("Eeprom page erase branch:\t"); @@ -121,7 +121,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, u32 save dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n"); - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { if (*(u32*)(JumpTableFunc - 0x24) == 0xEBFFFFB3) { u32* cardId = (u32*) (JumpTableFunc - 0x24); diff --git a/retail/bootloader/source/arm9/clear_cache.arm9.s b/retail/bootloader/source/arm9/clear_cache.arm9.s index a10dc573b..34ea60a47 100644 --- a/retail/bootloader/source/arm9/clear_cache.arm9.s +++ b/retail/bootloader/source/arm9/clear_cache.arm9.s @@ -17,7 +17,7 @@ @ Clears ICache and Dcache, and resets the protection units @ Originally written by Darkain, modified by Chishm -#include "../../include/asminc.h" +#include "asminc.h" .arm diff --git a/retail/bootloader2/Makefile b/retail/bootloader2/Makefile index 2d3bdccf0..a9741b2e4 100644 --- a/retail/bootloader2/Makefile +++ b/retail/bootloader2/Makefile @@ -39,7 +39,7 @@ CFLAGS := -g -Wall -O2\ CFLAGS += $(INCLUDE) -DARM7 -D_NO_SDMMC -DB4DS -DLOADERTWO -std=gnu99 -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -nostartfiles -T $(TOPDIR)/load.ld -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(TARGET).map LIBS := -lnds7 diff --git a/retail/bootloaderi/Makefile b/retail/bootloaderi/Makefile index a24cc4798..024abe71c 100644 --- a/retail/bootloaderi/Makefile +++ b/retail/bootloaderi/Makefile @@ -39,7 +39,7 @@ CFLAGS := -g -Wall -O2\ CFLAGS += $(INCLUDE) -DARM7 -std=gnu99 -DTWOCARD -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -nostartfiles -T $(TOPDIR)/load.ld -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(TARGET).map LIBS := -lnds7 diff --git a/retail/bootloaderi/source/arm7/booter.arm7.s b/retail/bootloaderi/source/arm7/booter.arm7.s index c898c63f9..fb97f8267 100644 --- a/retail/bootloaderi/source/arm7/booter.arm7.s +++ b/retail/bootloaderi/source/arm7/booter.arm7.s @@ -17,7 +17,7 @@ @ Clears ICache and Dcache, and resets the protection units @ Originally written by Darkain, modified by Chishm -#include "../../include/asminc.h" +#include "asminc.h" .arm diff --git a/retail/bootloaderi/source/arm7/decompress.c b/retail/bootloaderi/source/arm7/decompress.c index 2f4396bbe..d441eac3a 100644 --- a/retail/bootloaderi/source/arm7/decompress.c +++ b/retail/bootloaderi/source/arm7/decompress.c @@ -20,7 +20,7 @@ #include "decompress.h" #include "debug_file.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #define BLZ_SHIFT 1 // bits to shift #define BLZ_MASK 0x80 // bits to check: @@ -234,8 +234,8 @@ static u32 decompressIBinary(unsigned char *pak_buffer, unsigned int pak_len) { BLZ_Invert((char *)raw_buffer + dec_len, raw_len - dec_len); - tonccpy(pak_buffer, raw_buffer, raw_len); - toncset(raw_buffer, 0, raw_len); + __aeabi_memcpy(pak_buffer, raw_buffer, raw_len); + __aeabi_memclr(raw_buffer, raw_len); return raw_len; } @@ -370,7 +370,7 @@ void init2(u32 *magic, u32 a[3]) void init1(u32 cardheader_gamecode) { - tonccpy(card_hash, encr_data, 4*(1024 + 18)); + __aeabi_memcpy(card_hash, encr_data, 4*(1024 + 18)); arg2[0] = *(u32 *)&cardheader_gamecode; arg2[1] = (*(u32 *)&cardheader_gamecode) >> 1; arg2[2] = (*(u32 *)&cardheader_gamecode) << 1; @@ -391,7 +391,7 @@ bool decrypt_arm9ntr(const tDSiHeader* dsiHeader) u32 *p = (u32*)dsiHeader->ndshdr.arm9destination; if (p[0] == 0 || (p[0] == 0xE7FFDEFF && p[1] == 0xE7FFDEFF)) { - toncset(encr_data, 0, 0x1048); + __aeabi_memclr(encr_data, 0x1048); return false; } @@ -418,7 +418,7 @@ bool decrypt_arm9ntr(const tDSiHeader* dsiHeader) size -= 8; } - toncset(encr_data, 0, 0x1048); + __aeabi_memclr(encr_data, 0x1048); return true; } diff --git a/retail/bootloaderi/source/arm7/dldi_patcher.c b/retail/bootloaderi/source/arm7/dldi_patcher.c index 76a04f11f..107acc42f 100644 --- a/retail/bootloaderi/source/arm7/dldi_patcher.c +++ b/retail/bootloaderi/source/arm7/dldi_patcher.c @@ -23,7 +23,7 @@ #include #include #include "dldi_patcher.h" -#include "tonccpy.h" +#include "aeabi.h" #define FIX_ALL 0x01 #define FIX_GLUE 0x02 @@ -147,7 +147,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { // Remember how much space is actually reserved pDH[DO_allocatedSpace] = pAH[DO_allocatedSpace]; // Copy the DLDI patch into the application - tonccpy (pAH, pDH, dldiFileSize); + __aeabi_memcpy (pAH, pDH, dldiFileSize); // Fix the section pointers in the header writeAddr (pAH, DO_text_start, readAddr (pAH, DO_text_start) + relocationOffset); @@ -167,7 +167,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { writeAddr (pAH, DO_shutdown, readAddr (pAH, DO_shutdown) + relocationOffset); // Put the correct DLDI magic string back into the DLDI header - tonccpy (pAH, dldiMagicString, sizeof (dldiMagicString)); + __aeabi_memcpy (pAH, dldiMagicString, sizeof (dldiMagicString)); if (pDH[DO_fixSections] & FIX_ALL) { // Search through and fix pointers within the data section of the file @@ -198,7 +198,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { /*if (pDH[DO_fixSections] & FIX_BSS) { // Initialise the BSS to 0 - toncset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); + __aeabi_memclr (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart], readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); }*/ return true; diff --git a/retail/bootloaderi/source/arm7/hook_arm7.c b/retail/bootloaderi/source/arm7/hook_arm7.c index 4f3a3fca5..2fc28c24a 100644 --- a/retail/bootloaderi/source/arm7/hook_arm7.c +++ b/retail/bootloaderi/source/arm7/hook_arm7.c @@ -32,7 +32,7 @@ #include "patch.h" #include "find.h" #include "hook.h" -#include "tonccpy.h" +#include "aeabi.h" #define b_gameOnFlashcard BIT(0) #define b_saveOnFlashcard BIT(1) @@ -187,7 +187,7 @@ int hookNdsRetailArm7( /*bool handlerPatched = false; if (!gameOnFlashcard && !ROMinRAM && handlerLocation && ce7->patches->fifoHandler) { - tonccpy(handlerLocation, ce7->patches->j_irqHandler, 0xC); + __aeabi_memcpy(handlerLocation, ce7->patches->j_irqHandler, 0xC); handlerPatched = true; }*/ @@ -507,7 +507,7 @@ int hookNdsRetailArm7( aFile apPatchFile; getFileFromCluster(&apPatchFile, apPatchFileCluster, gameOnFlashcard); - tonccpy((u8*)cheatEngineOffset, cheatEngineBuffer, 0x400); + __aeabi_memcpy((u8*)cheatEngineOffset, cheatEngineBuffer, 0x400); if (ndsHeader->unitCode < 3 && apPatchFile.firstCluster != CLUSTER_FREE && apPatchIsCheat) { fileRead(cheatDataOffset, &apPatchFile, 0, apPatchSize); diff --git a/retail/bootloaderi/source/arm7/ips.c b/retail/bootloaderi/source/arm7/ips.c index d8ac214c7..9a0d2e573 100644 --- a/retail/bootloaderi/source/arm7/ips.c +++ b/retail/bootloaderi/source/arm7/ips.c @@ -7,7 +7,7 @@ #include #include "nds_header.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #define cacheBlockSize 0x4000 @@ -92,7 +92,7 @@ bool applyIpsPatch(const tNDSHeader* ndsHeader, u8* ipsbyte, const bool arm9Only for (int ontime = 0; ontime < totalrepeats; ontime++) { repeatbyte[ontime] = ipsbyte[ipson]; } - // tonccpy(rombyte+offset, repeatbyte, totalrepeats); + // __aeabi_memcpy(rombyte+offset, repeatbyte, totalrepeats); u8* rombyteOffset = (u8*)rombyte+offset; for (int i = 0; i < totalrepeats; i++) { *rombyteOffset = repeatbyte[i]; @@ -123,7 +123,7 @@ bool applyIpsPatch(const tNDSHeader* ndsHeader, u8* ipsbyte, const bool arm9Only } else { totalrepeats = ipsbyte[ipson] * 256 + ipsbyte[ipson + 1]; ipson += 2; - // tonccpy(rombyte+offset, ipsbyte+ipson, totalrepeats); + // __aeabi_memcpy(rombyte+offset, ipsbyte+ipson, totalrepeats); u8* rombyteOffset = (u8*)rombyte+offset; for (int i = 0; i < totalrepeats; i++) { *rombyteOffset = ipsbyte[ipson+i]; diff --git a/retail/bootloaderi/source/arm7/main.arm7.c b/retail/bootloaderi/source/arm7/main.arm7.c index 115ccc860..398788390 100644 --- a/retail/bootloaderi/source/arm7/main.arm7.c +++ b/retail/bootloaderi/source/arm7/main.arm7.c @@ -57,7 +57,7 @@ #define REG_GPIO_WIFI *(vu16*)0x4004C04 -#include "tonccpy.h" +#include "aeabi.h" #include "dmaTwl.h" #include "my_fat.h" #include "debug_file.h" @@ -231,7 +231,7 @@ static void initMBK_dsiMode(void) { void memset_addrs_arm7(u32 start, u32 end) { - // toncset((u32*)start, 0, ((int)end - (int)start)); + // __aeabi_memclr((u32*)start, ((int)end - (int)start)); dma_twlFill32(0, 0, (u32*)start, ((int)end - (int)start)); } @@ -293,7 +293,7 @@ static void resetMemory_ARM7(void) { memset_addrs_arm7(0x02F80000, 0x02FFD7BC); // Leave eMMC CID intact memset_addrs_arm7(0x02FFD7CC, 0x02FFE000); dma_twlFill32(0, 0, (u32*)0x02FFF000, 0xD60); // clear part of EWRAM - toncset32((u32*)0x02FFFDFC, 0, 1); // clear TWLCFG address + __aeabi_memclr((u32*)0x02FFFDFC, 4); // clear TWLCFG address dma_twlFill32(0, 0, (u32*)0x02FFFE00, 0x200); // clear part of EWRAM: header REG_IE = 0; REG_IF = ~0; @@ -319,7 +319,7 @@ static void resetMemory_ARM7(void) { } else { sharedFontRegion = -1; } - tonccpy((u8*)0x02FFD400, (u8*)0x02000400, 0x128); // Duplicate TWLCFG, in case it gets overwritten + __aeabi_memcpy((u8*)0x02FFD400, (u8*)0x02000400, 0x128); // Duplicate TWLCFG, in case it gets overwritten } else { sharedFontRegion = -1; } @@ -572,7 +572,7 @@ static void DSiTouchscreenMode(void) { static module_params_t* buildModuleParams(u32 donorSdkVer) { module_params_t* moduleParams = (module_params_t*)malloc(sizeof(module_params_t)); - toncset(moduleParams, 0, sizeof(module_params_t)); + __aeabi_memclr(moduleParams, sizeof(module_params_t)); moduleParams->compressed_static_end = 0; // Avoid decompressing switch (donorSdkVer) { @@ -835,11 +835,11 @@ static tNDSHeader* loadHeader(tDSiHeader* dsiHeaderTemp, const module_params_t* //*(u32*)(dsiHeader+0x1B8) |= BIT(18); // SD access - //toncset((char*)dsiHeader+0x220, 0, 0x10); // Clear modcrypt bytes + //__aeabi_memclr((char*)dsiHeader+0x220, 0x10); // Clear modcrypt bytes /*if (!isDSiWare) { // Clear out Digest offsets/lengths - toncset((char*)dsiHeader+0x1E0, 0, 0x28); + __aeabi_memclr((char*)dsiHeader+0x1E0, 0x28); }*/ } @@ -891,7 +891,7 @@ static void my_readUserSettings(tNDSHeader* ndsHeader) { PERSONAL_DATA* personalData = (PERSONAL_DATA*)((u32)__NDSHeader - (u32)ndsHeader + (u32)PersonalData); //(u8*)((u32)ndsHeader - 0x180) - tonccpy(PersonalData, currentSettings, sizeof(PERSONAL_DATA)); + __aeabi_memcpy(PersonalData, currentSettings, sizeof(PERSONAL_DATA)); if (useTwlCfg && language == 0xFF) { language = twlCfgLang; @@ -989,16 +989,16 @@ static void loadOverlaysintoRAM(const tNDSHeader* ndsHeader, const module_params /* if (strncmp(romTid, "BO5", 3) == 0) { if (romTid[3] == 'E') { - tonccpy((u8*)(overlaysLocation+0xDBDBF), (u8*)0x02FFF17C, 4); - tonccpy((u8*)(overlaysLocation+0x270085), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0xDBDBF), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0x270085), (u8*)0x02FFF17C, 4); } else if (romTid[3] == 'P') { - tonccpy((u8*)(overlaysLocation+0x7C1B0), (u8*)0x02FFF17C, 4); - tonccpy((u8*)(overlaysLocation+0xD09D4), (u8*)0x02FFF17C, 4); - tonccpy((u8*)(overlaysLocation+0xDBDC0), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0x7C1B0), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0xD09D4), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0xDBDC0), (u8*)0x02FFF17C, 4); } else { - tonccpy((u8*)(overlaysLocation+0xD09CC), (u8*)0x02FFF17C, 4); - tonccpy((u8*)(overlaysLocation+0xDBDBD), (u8*)0x02FFF17C, 4); - tonccpy((u8*)(overlaysLocation+0x270087), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0xD09CC), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0xDBDBD), (u8*)0x02FFF17C, 4); + __aeabi_memcpy((u8*)(overlaysLocation+0x270087), (u8*)0x02FFF17C, 4); } } else */ if (!isSdk5(moduleParams) && *(u32*)(overlaysLocation+0x3128AC) == 0x4B434148) { *(u32*)(overlaysLocation+0x3128AC) = 0xA00; // Primary fix for Mario's Holiday (before Rev 11) @@ -1126,22 +1126,22 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* dbg_hexa((u32)deviceListAddr); dbg_printf("\n"); - tonccpy(deviceListAddr, (u32*)0x02EFF000, 0x400); - toncset((u32*)0x02EFF000, 0, 0x400); + __aeabi_memcpy(deviceListAddr, (u32*)0x02EFF000, 0x400); + __aeabi_memclr((u32*)0x02EFF000, 0x400); /*const char *ndsPath = "sdmc:/DSIWARE.NDS"; const char *pubPath = "sdmc:/DSIWARE.PUB"; - tonccpy((u8*)deviceListAddr+0x1B8, pubPath, 18); - tonccpy((u8*)deviceListAddr+0x3C0, ndsPath, 18);*/ + __aeabi_memcpy((u8*)deviceListAddr+0x1B8, pubPath, 18); + __aeabi_memcpy((u8*)deviceListAddr+0x3C0, ndsPath, 18);*/ } - tonccpy((u32*)0x02FFC000, (u32*)DSI_HEADER_SDK5, 0x1000); // Make a duplicate of DSi header + __aeabi_memcpy((u32*)0x02FFC000, (u32*)DSI_HEADER_SDK5, 0x1000); // Make a duplicate of DSi header if (*(u32*)(DSI_HEADER_SDK5+0x1A0) != 0x00403000 && *(u8*)(DSI_HEADER_SDK5+0x234) < 4) { *(u8*)(DSI_HEADER_SDK5+0x234) = 6; // Workaround to not overwrite 0x02F80000-0x02F88000 } if (gameOnFlashcard || !isDSiWare) { - tonccpy((u32*)0x02FFFA80, (u32*)NDS_HEADER_SDK5, 0x160); // Make a duplicate of DS header + __aeabi_memcpy((u32*)0x02FFFA80, (u32*)NDS_HEADER_SDK5, 0x160); // Make a duplicate of DS header } /* *(u32*)(0x02FFA680) = 0x02FD4D80; @@ -1161,29 +1161,32 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* twlCfg = (u8*)0x02FFD400; } u8* personalData = (u8*)0x02FFFC80; - tonccpy(twlCfg+0x6, personalData+0x64, 1); // Selected Language (eg. 1=English) - tonccpy(twlCfg+0x7, personalData+0x66, 1); // RTC Year (last date change) (max 63h=2099) - tonccpy(twlCfg+0x8, personalData+0x68, 4); // RTC Offset (difference in seconds on change) - tonccpy(twlCfg+0x1A, personalData+0x52, 1); // Alarm Hour (0..17h) - tonccpy(twlCfg+0x1B, personalData+0x53, 1); // Alarm Minute (0..3Bh) - tonccpy(twlCfg+0x1E, personalData+0x56, 1); // Alarm Enable (0=Off, 1=On) - toncset(twlCfg+0x24, 0x03, 1); // Unknown (02h or 03h) - tonccpy(twlCfg+0x30, personalData+0x58, 0xC); // TSC calib - toncset32(twlCfg+0x3C, 0x0201209C, 1); - tonccpy(twlCfg+0x44, personalData+0x02, 1); // Favorite color (also Sysmenu Cursor Color) - tonccpy(twlCfg+0x46, personalData+0x03, 2); // Birthday (month, day) - tonccpy(twlCfg+0x48, personalData+0x06, 0x16); // Nickname (UCS-2), max 10 chars+EOL - tonccpy(twlCfg+0x5E, personalData+0x1C, 0x36); // Message (UCS-2), max 26 chars+EOL + const u32 unk = 0x0201209C; + __aeabi_memcpy(twlCfg+0x6, personalData+0x64, 1); // Selected Language (eg. 1=English) + __aeabi_memcpy(twlCfg+0x7, personalData+0x66, 1); // RTC Year (last date change) (max 63h=2099) + __aeabi_memcpy(twlCfg+0x8, personalData+0x68, 4); // RTC Offset (difference in seconds on change) + __aeabi_memcpy(twlCfg+0x1A, personalData+0x52, 1); // Alarm Hour (0..17h) + __aeabi_memcpy(twlCfg+0x1B, personalData+0x53, 1); // Alarm Minute (0..3Bh) + __aeabi_memcpy(twlCfg+0x1E, personalData+0x56, 1); // Alarm Enable (0=Off, 1=On) + __aeabi_memset(twlCfg+0x24, 1, 0x03); // Unknown (02h or 03h) + __aeabi_memcpy(twlCfg+0x30, personalData+0x58, 0xC); // TSC calib + __aeabi_memcpy(twlCfg+0x3C, &unk, 4); + __aeabi_memcpy(twlCfg+0x44, personalData+0x02, 1); // Favorite color (also Sysmenu Cursor Color) + __aeabi_memcpy(twlCfg+0x46, personalData+0x03, 2); // Birthday (month, day) + __aeabi_memcpy(twlCfg+0x48, personalData+0x06, 0x16); // Nickname (UCS-2), max 10 chars+EOL + __aeabi_memcpy(twlCfg+0x5E, personalData+0x1C, 0x36); // Message (UCS-2), max 26 chars+EOL readFirmware(0x1FD, twlCfg+0x1E0, 1); // WlFirm Type (1=DWM-W015, 2=W024, 3=W028) + u32 wlFirmVars = 0x500400; + u32 wlFirmBase = 0x500000; + u32 wlFirmSize = 0x02E000; if (twlCfg[0x1E0] == 2 || twlCfg[0x1E0] == 3) { - toncset32(twlCfg+0x1E4, 0x520000, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x520000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x020000, 1); // WlFirm RAM size - } else { - toncset32(twlCfg+0x1E4, 0x500400, 1); // WlFirm RAM vars - toncset32(twlCfg+0x1E8, 0x500000, 1); // WlFirm RAM base - toncset32(twlCfg+0x1EC, 0x02E000, 1); // WlFirm RAM size + wlFirmVars = 0x520000; + wlFirmBase = 0x520000; + wlFirmSize = 0x020000; } + __aeabi_memcpy(twlCfg+0x1E4, &wlFirmVars, 4); // WlFirm RAM vars + __aeabi_memcpy(twlCfg+0x1E8, &wlFirmBase, 4); // WlFirm RAM base + __aeabi_memcpy(twlCfg+0x1EC, &wlFirmSize, 4); // WlFirm RAM size *(u16*)(twlCfg+0x1E2) = swiCRC16(0xFFFF, twlCfg+0x1E4, 0xC); // WlFirm CRC16 dbg_printf("TWLCFG reconstructed\n"); @@ -1203,12 +1206,12 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* } } - toncset32(twlCfg, configFlags, 1); // Config Flags - tonccpy(twlCfg+0x10, (u8*)0x02FFE20E, 1); // EULA Version (0=None/CountryChanged, 1=v1) - tonccpy(twlCfg+0x9C, (u8*)0x02FFE2F0, 1); // Parental Controls Years of Age Rating (00h..14h) + __aeabi_memcpy(twlCfg, &configFlags, 4); // Config Flags + __aeabi_memset(twlCfg+0x10, 1, *(u8*)0x02FFE20E); // EULA Version (0=None/CountryChanged, 1=v1) + __aeabi_memset(twlCfg+0x9C, 1, *(u8*)0x02FFE2F0); // Parental Controls Years of Age Rating (00h..14h) if (*(u32*)0x02FFFDFC != 0x02FFD400) { - toncset((u32*)0x02FFD400, 0, 0x128); + __aeabi_memclr((u32*)0x02FFD400, 0x128); } // Set region flag @@ -1228,7 +1231,7 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* } else if (ndsHeader->gameCode[3] == 'K') { newRegion = 5; } - toncset((u8*)0x02FFFD70, newRegion, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, newRegion); } else if (region == -1 && twlCfgCountry != 0) { u8 newRegion = 0; if (twlCfgCountry != 0) { @@ -1261,9 +1264,9 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* newRegion = 2; // Europe } } - toncset((u8*)0x02FFFD70, newRegion, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, newRegion); } else { - toncset((u8*)0x02FFFD70, region, 1); + __aeabi_memset((u8*)0x02FFFD70, 1, region); } // Set bitmask for supported languages u8 curRegion = *(u8*)0x02FFFD70; @@ -1287,7 +1290,7 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* i2cWriteRegister(I2C_PM, I2CREGPM_MMCPWR, 1); // Have IRQ check for power button press i2cWriteRegister(I2C_PM, I2CREGPM_RESETFLAG, 1); // SDK 5 --> Bootflag = Warmboot/SkipHealthSafety } else if (isSdk5(moduleParams)) { - toncset((u32*)0x02FFFD60, 0, 0xA0); + __aeabi_memclr((u32*)0x02FFFD60, 0xA0); } if (!gameOnFlashcard && isDSiWare) { @@ -1322,7 +1325,7 @@ static void setMemoryAddress(const tNDSHeader* ndsHeader, const module_params_t* // Make the Pokemon game code ADAJ. const char gameCodePokemon[] = { 'A', 'D', 'A', 'J' }; tNDSHeader* ndsHeaderPokemon = (tNDSHeader*)NDS_HEADER_POKEMON; - tonccpy(ndsHeaderPokemon->gameCode, gameCodePokemon, 4); + __aeabi_memcpy(ndsHeaderPokemon->gameCode, gameCodePokemon, 4); } // Set memory values expected by loaded NDS @@ -1551,25 +1554,25 @@ int arm7_main(void) { } if (gameOnFlashcard || !isDSiWare) { /* if (consoleModel > 0) { - tonccpy((char*)0x0DF80000, (char*)0x02700000, 0x80000); // Move FAT table cache to debug RAM + __aeabi_memcpy((char*)0x0DF80000, (char*)0x02700000, 0x80000); // Move FAT table cache to debug RAM romFile->fatTableCache = (u32*)((u32)romFile->fatTableCache+0xB880000); savFile->fatTableCache = (u32*)((u32)savFile->fatTableCache+0xB880000); lastClusterCacheUsed = (u32*)((u32)lastClusterCacheUsed+0xB880000); clusterCache += 0xB880000; - toncset((char*)0x02700000, 0, 0x80000); + __aeabi_memclr((char*)0x02700000, 0x80000); } else { */ u32 add = (*(u32*)0x02FFE1A0 == 0x00403000) ? 0x8DE000 : 0x8FA000; // 0x02FDE000 : 0x02FFA000 - tonccpy((char*)0x02700000+add, (char*)0x02700000, 0x2000); // Move FAT table cache elsewhere + __aeabi_memcpy((char*)0x02700000+add, (char*)0x02700000, 0x2000); // Move FAT table cache elsewhere romFile->fatTableCache = (u32*)((u32)romFile->fatTableCache+add); savFile->fatTableCache = (u32*)((u32)savFile->fatTableCache+add); lastClusterCacheUsed = (u32*)((u32)lastClusterCacheUsed+add); clusterCache += add; - toncset((char*)0x02700000, 0, 0x10000); + __aeabi_memclr((char*)0x02700000, 0x10000); // } } - tonccpy((char*)ROM_FILE_LOCATION_TWLSDK, romFile, sizeof(aFile)); - tonccpy((char*)SAV_FILE_LOCATION_TWLSDK, savFile, sizeof(aFile)); + __aeabi_memcpy((char*)ROM_FILE_LOCATION_TWLSDK, romFile, sizeof(aFile)); + __aeabi_memcpy((char*)SAV_FILE_LOCATION_TWLSDK, savFile, sizeof(aFile)); romFile = (aFile*)ROM_FILE_LOCATION_TWLSDK; savFile = (aFile*)SAV_FILE_LOCATION_TWLSDK; @@ -1581,9 +1584,9 @@ int arm7_main(void) { REG_SCFG_EXT = 0x93FFFB06; REG_SCFG_CLK = 0x187; } else { - toncset((u32*)0x02400000, 0, 0x2000); + __aeabi_memclr((u32*)0x02400000, 0x2000); dma_twlFill32(0, 0, (u32*)0x02500000, 0x100000); // clear part of EWRAM - except before in-game menu data - toncset((u32*)0x02E80000, 0, 0x800); + __aeabi_memclr((u32*)0x02E80000, 0x800); memset_addrs_arm7(0x02F00000, 0x02F80000); memset_addrs_arm7(0x02FFE000, 0x02FFF000); // clear DSi header @@ -1594,12 +1597,12 @@ int arm7_main(void) { if (memcmp(romTid, "HND", 3) == 0) { add = 0x108000; // 0x02808000 } - tonccpy((char*)0x02700000+add, (char*)0x02700000, 0x10000); // Move FAT table cache elsewhere + __aeabi_memcpy((char*)0x02700000+add, (char*)0x02700000, 0x10000); // Move FAT table cache elsewhere romFile->fatTableCache = (u32*)((u32)romFile->fatTableCache+add); savFile->fatTableCache = (u32*)((u32)savFile->fatTableCache+add); lastClusterCacheUsed = (u32*)((u32)lastClusterCacheUsed+add); clusterCache += add; - toncset((char*)0x02700000, 0, 0x10000); + __aeabi_memclr((char*)0x02700000, 0x10000); } //if (gameOnFlashcard || !isDSiWare || !dsiWramAccess) { @@ -1631,8 +1634,8 @@ int arm7_main(void) { baseChipID = getChipId(pkmnHeader ? (tNDSHeader*)NDS_HEADER_POKEMON : ndsHeader, moduleParams); cheatSizeTotal = wideCheatSize+cheatSize+(apPatchIsCheat ? apPatchSize : 0); - tonccpy(cheatEngineBuffer, (char*)CHEAT_ENGINE_BUFFERED_LOCATION, 0x400); - toncset((char*)CHEAT_ENGINE_BUFFERED_LOCATION, 0, 0x400); + __aeabi_memcpy(cheatEngineBuffer, (char*)CHEAT_ENGINE_BUFFERED_LOCATION, 0x400); + __aeabi_memclr((char*)CHEAT_ENGINE_BUFFERED_LOCATION, 0x400); if (!gameOnFlashcard && isDSiWare) { extern void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, const module_params_t* moduleParams, const ltd_module_params_t* ltdModuleParams); @@ -1667,7 +1670,7 @@ int arm7_main(void) { // Replace incompatible ARM7 binary newArm7binarySize = *(u32*)DONOR_ROM_ARM7_SIZE_LOCATION; newArm7ibinarySize = *(u32*)DONOR_ROM_ARM7I_SIZE_LOCATION; - tonccpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); + __aeabi_memcpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); } extern void patchGbaSlotInit_cont(const tNDSHeader* ndsHeader, bool usesThumb, bool searchAgainForThumb); @@ -1690,8 +1693,8 @@ int arm7_main(void) { extern void patchScfgExt(const tNDSHeader* ndsHeader); patchScfgExt(ndsHeader); - toncset((u32*)0x02680000, 0, 0x100000); - toncset((u32*)UNPATCHED_FUNCTION_LOCATION, 0, 0x40); + __aeabi_memclr((u32*)0x02680000, 0x100000); + __aeabi_memsclr((u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); patchOffsetCacheFileNewCrc = swiCRC16(0xFFFF, &patchOffsetCache, sizeof(patchOffsetCacheContents)); if (patchOffsetCacheFileNewCrc != patchOffsetCacheFilePrevCrc) { @@ -1701,11 +1704,11 @@ int arm7_main(void) { ce9Location = *(u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION; ce7Location = *(u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION; - tonccpy((u32*)ce9Location, (u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, 0x1400); + __aeabi_memcpy((u32*)ce9Location, (u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, 0x1400); - tonccpy((u32*)ce7Location, (u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0x8400); + __aeabi_memcpy((u32*)ce7Location, (u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0x8400); cheatEngineOffset = ((ce7Location == CARDENGINEI_ARM7_DSIWARE_LOCATION3) ? CHEAT_ENGINE_DSIWARE_LOCATION3 : CHEAT_ENGINE_DSIWARE_LOCATION); - toncset((u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0, 0x8400); + __aeabi_memclr((u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0x8400); //ensureBinaryDecompressed(&dsiHeaderTemp.ndshdr, moduleParams, false); @@ -1744,7 +1747,7 @@ int arm7_main(void) { // Replace incompatible ARM7 binary newArm7binarySize = *(u32*)DONOR_ROM_ARM7_SIZE_LOCATION; newArm7ibinarySize = *(u32*)DONOR_ROM_ARM7I_SIZE_LOCATION; - tonccpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); + __aeabi_memcpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); } /* if (!dsiWramAccess) { @@ -1836,8 +1839,8 @@ int arm7_main(void) { consoleModel ); - tonccpy((u32*)UNPATCHED_FUNCTION_LOCATION_SDK5, (u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); - toncset((u32*)UNPATCHED_FUNCTION_LOCATION, 0, 0x40); + __aeabi_memcpy((u32*)UNPATCHED_FUNCTION_LOCATION_SDK5, (u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); + __aeabi_memclr((u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); patchOffsetCacheFileNewCrc = swiCRC16(0xFFFF, &patchOffsetCache, sizeof(patchOffsetCacheContents)); if (patchOffsetCacheFileNewCrc != patchOffsetCacheFilePrevCrc) { @@ -1848,10 +1851,10 @@ int arm7_main(void) { extern u32 iUncompressedSizei; const u32 currentArm9ibinarySize = (iUncompressedSizei > 0 ? iUncompressedSizei : *(u32*)0x02FFE1CC); if (consoleModel > 0) { - tonccpy((char*)ndsHeader->arm9destination+0xB000000, ndsHeader->arm9destination, iUncompressedSize); - tonccpy((char*)ndsHeader->arm7destination+0xB000000, ndsHeader->arm7destination, newArm7binarySize); - tonccpy((char*)(*(u32*)0x02FFE1C8)+0xB000000, (u32*)*(u32*)0x02FFE1C8, currentArm9ibinarySize); - tonccpy((char*)(*(u32*)0x02FFE1D8)+0xB000000, (u32*)*(u32*)0x02FFE1D8, newArm7ibinarySize); + __aeabi_memcpy((char*)ndsHeader->arm9destination+0xB000000, ndsHeader->arm9destination, iUncompressedSize); + __aeabi_memcpy((char*)ndsHeader->arm7destination+0xB000000, ndsHeader->arm7destination, newArm7binarySize); + __aeabi_memcpy((char*)(*(u32*)0x02FFE1C8)+0xB000000, (u32*)*(u32*)0x02FFE1C8, currentArm9ibinarySize); + __aeabi_memcpy((char*)(*(u32*)0x02FFE1D8)+0xB000000, (u32*)*(u32*)0x02FFE1D8, newArm7ibinarySize); *(u32*)0x0DFEE02C = iUncompressedSize; *(u32*)0x0DFEE03C = newArm7binarySize; *(u32*)0x0DFEE1CC = currentArm9ibinarySize; @@ -1873,13 +1876,13 @@ int arm7_main(void) { // } } else { if (strncmp(romTid, "UBR", 3) == 0) { - toncset((char*)0x0C3E0000, 0xFF, 0xC0); - toncset((u8*)0x0C3E00B2, 0, 3); - toncset((u8*)0x0C3E00B5, 0x24, 3); + __aeabi_memset((char*)0x0C3E0000, 0xC0, 0xFF); + __aeabi_memclr((u8*)0x0C3E00B2, 3); + __aeabi_memset((u8*)0x0C3E00B5, 3, 0x24); *(u16*)0x0C3E00BE = 0x7FFF; - toncset((char*)0x0C3E00C0, 0, 0xE); + __aeabi_memclr((char*)0x0C3E00C0, 0xE); *(u16*)0x0C3E00CE = 0x7FFF; - toncset((char*)0x0C3E00D0, 0, 0x130); + __aeabi_memclr((char*)0x0C3E00D0, 0x130); } /*else // GBA file if (!dsiModeConfirmed && !isSdk5(moduleParams)) { aFile* gbaFile = (aFile*)(dsiEnhancedMbk ? GBA_FILE_LOCATION_ALT : GBA_FILE_LOCATION); @@ -1889,8 +1892,8 @@ int arm7_main(void) { gbaRomFound = (gbaFile->firstCluster != CLUSTER_FREE); //patchSlot2Addr(ndsHeader); - tonccpy((char*)GBA_FILE_LOCATION_MAINMEM, gbaFile, sizeof(aFile)); - tonccpy((char*)GBA_SAV_FILE_LOCATION_MAINMEM, gbaSavFile, sizeof(aFile)); + __aeabi_memcpy((char*)GBA_FILE_LOCATION_MAINMEM, gbaFile, sizeof(aFile)); + __aeabi_memcpy((char*)GBA_SAV_FILE_LOCATION_MAINMEM, gbaSavFile, sizeof(aFile)); if (gbaRomFound) { fileRead((char*)0x027FFC30, *gbaFile, 0xBE, 2, -1); @@ -1967,12 +1970,12 @@ int arm7_main(void) { if (ROMsupportsDsiMode(&dsiHeaderTemp.ndshdr)) { if (!dsiModeConfirmed) { - tonccpy((char*)ROM_FILE_LOCATION_MAINMEM5, romFile, sizeof(aFile)); - tonccpy((char*)SAV_FILE_LOCATION_MAINMEM5, savFile, sizeof(aFile)); + __aeabi_memcpy((char*)ROM_FILE_LOCATION_MAINMEM5, romFile, sizeof(aFile)); + __aeabi_memcpy((char*)SAV_FILE_LOCATION_MAINMEM5, savFile, sizeof(aFile)); } } else { - tonccpy((char*)ROM_FILE_LOCATION_MAINMEM, romFile, sizeof(aFile)); - tonccpy((char*)SAV_FILE_LOCATION_MAINMEM, savFile, sizeof(aFile)); + __aeabi_memcpy((char*)ROM_FILE_LOCATION_MAINMEM, romFile, sizeof(aFile)); + __aeabi_memcpy((char*)SAV_FILE_LOCATION_MAINMEM, savFile, sizeof(aFile)); } const bool useApPatch = (srlAddr == 0 && apPatchFileCluster != 0 && !apPatchIsCheat && apPatchSize > 0 && apPatchSize <= 0x40000); @@ -1991,7 +1994,7 @@ int arm7_main(void) { overlayPatch = true; // Allow overlay patching for SM64DS ROM hacks (ex. Mario's Holiday) } - tonccpy((u32*)ce7Location, (u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, ce7Size); + __aeabi_memcpy((u32*)ce7Location, (u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, ce7Size); if (gameOnFlashcard || saveOnFlashcard) { if (!dldiPatchBinary((data_t*)ce7Location, ce7Size-0x400)) { dbg_printf("ce7 DLDI patch failed\n"); @@ -2007,7 +2010,7 @@ int arm7_main(void) { if (ROMsupportsDsiMode(ndsHeader) && dsiModeConfirmed) { ce9Location = *(u32*)CARDENGINEI_ARM9_SDK5_BUFFERED_LOCATION; ce9size = 0x7800; - tonccpy((u32*)ce9Location, (u32*)CARDENGINEI_ARM9_SDK5_BUFFERED_LOCATION, ce9size); + __aeabi_memcpy((u32*)ce9Location, (u32*)CARDENGINEI_ARM9_SDK5_BUFFERED_LOCATION, ce9size); if (gameOnFlashcard) { if (!dldiPatchBinary((data_t*)ce9Location, ce9size)) { dbg_printf("ce9 DLDI patch failed\n"); @@ -2017,7 +2020,7 @@ int arm7_main(void) { } else if (gameOnFlashcard) { ce9Location = CARDENGINEI_ARM9_LOCATION_DSI_WRAM; ce9size = 0x7000; - tonccpy((u32*)CARDENGINEI_ARM9_LOCATION_DSI_WRAM, (u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, ce9size); + __aeabi_memcpy((u32*)CARDENGINEI_ARM9_LOCATION_DSI_WRAM, (u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, ce9size); if (!dldiPatchBinary((data_t*)ce9Location, ce9size)) { dbg_printf("ce9 DLDI patch failed\n"); errorOutput(); @@ -2029,12 +2032,12 @@ int arm7_main(void) { ce9Location = CARDENGINEI_ARM9_LOCATION_DLP; } ce9size = 0x5000; - tonccpy((u32*)ce9Location, (u32*)((!dsiWramAccess && !laterSdk) ? CARDENGINEI_ARM9_BUFFERED_LOCATION2 : CARDENGINEI_ARM9_BUFFERED_LOCATION), ce9size); + __aeabi_memcpy((u32*)ce9Location, (u32*)((!dsiWramAccess && !laterSdk) ? CARDENGINEI_ARM9_BUFFERED_LOCATION2 : CARDENGINEI_ARM9_BUFFERED_LOCATION), ce9size); } patchHiHeapPointer(moduleParams, ndsHeader); - toncset((u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, 0, 0x10000); - toncset((u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0, 0x11C00); + __aeabi_memclr((u32*)CARDENGINEI_ARM9_BUFFERED_LOCATION, 0x10000); + __aeabi_memclr((u32*)CARDENGINEI_ARM7_BUFFERED_LOCATION, 0x11C00); errorCode = patchCardNds( (cardengineArm7*)ce7Location, @@ -2118,8 +2121,8 @@ int arm7_main(void) { } if (isSdk5(moduleParams)) { - tonccpy((u32*)UNPATCHED_FUNCTION_LOCATION_SDK5, (u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); - toncset((u32*)UNPATCHED_FUNCTION_LOCATION, 0, 0x40); + __aeabi_memcpy((u32*)UNPATCHED_FUNCTION_LOCATION_SDK5, (u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); + __aeabi_memclr((u32*)UNPATCHED_FUNCTION_LOCATION, 0x40); } if (ROMinRAM) { @@ -2191,8 +2194,8 @@ int arm7_main(void) { } } /* else { *(u32*)ARM9_DEC_SIZE_LOCATION = iUncompressedSize; - tonccpy((char*)ndsHeader->arm9destination+0x400000, ndsHeader->arm9destination, iUncompressedSize); - tonccpy((char*)DONOR_ROM_ARM7_LOCATION, ndsHeader->arm7destination, ndsHeader->arm7binarySize); + __aeabi_memcpy((char*)ndsHeader->arm9destination+0x400000, ndsHeader->arm9destination, iUncompressedSize); + __aeabi_memcpy((char*)DONOR_ROM_ARM7_LOCATION, ndsHeader->arm7destination, ndsHeader->arm7binarySize); } */ if (!gameOnFlashcard && !ROMinRAM && (romRead_LED==1 || dmaRomRead_LED==1)) { @@ -2215,7 +2218,7 @@ int arm7_main(void) { } } - toncset16((u32*)IMAGES_LOCATION, 0, (256*192)*3); // Clear nds-bootstrap images + __aeabi_memclr((u32*)IMAGES_LOCATION, ((256*192)*3)*sizeof(u16)); // Clear nds-bootstrap images clearScreen(); i2cReadRegister(0x4A, 0x10); // Clear accidential POWER button press diff --git a/retail/bootloaderi/source/arm7/patch_arm7.c b/retail/bootloaderi/source/arm7/patch_arm7.c index 3960706e0..d04d414df 100644 --- a/retail/bootloaderi/source/arm7/patch_arm7.c +++ b/retail/bootloaderi/source/arm7/patch_arm7.c @@ -7,7 +7,7 @@ #include "common.h" #include "value_bits.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #include "cardengine_header_arm7.h" #include "debug_file.h" @@ -155,18 +155,18 @@ static void patchSwiHalt(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, if (swiHaltOffset && swiHaltHook && doPatch) { // Patch if (patchOffsetCache.a7IsThumb) { - tonccpy((u16*)newSwiHaltAddr, ce7->patches->newSwiHaltThumb, 0x10); + __aeabi_memcpy((u16*)newSwiHaltAddr, ce7->patches->newSwiHaltThumb, 0x10); u32 srcAddr = (u32)swiHaltOffset - vAddrOfRelocSrc + 0x37F8000; u32 dstAddr = (u32)newSwiHaltAddr - vAddrOfRelocSrc + 0x37F8000; const u16* swiHaltPatch = generateA7InstrThumb(srcAddr, dstAddr); - tonccpy(swiHaltOffset, swiHaltPatch, 0x4); + __aeabi_memcpy(swiHaltOffset, swiHaltPatch, 0x4); dbg_printf("swiHalt new location : "); dbg_hexa(newSwiHaltAddr); dbg_printf("\n\n"); } else { u32* swiHaltPatch = ce7->patches->j_newSwiHalt; - tonccpy(swiHaltOffset, swiHaltPatch, 0xC); + __aeabi_memcpy(swiHaltOffset, swiHaltPatch, 0xC); } swiHaltPatched = true; dbg_printf("swiHalt hooked\n"); @@ -237,23 +237,24 @@ static void fixForDifferentBios(const cardengineArm7* ce7, const tNDSHeader* nds if (swi12Offset && !(REG_SCFG_ROM & BIT(9))) { // Patch to call swi 0x02 instead of 0x12 u32* swi12Patch = ce7->patches->swi02; - tonccpy(swi12Offset, swi12Patch, 0x4); + __aeabi_memcpy(swi12Offset, swi12Patch, 0x4); } // swi get pitch table if (swiGetPitchTableOffset && (!(REG_SCFG_ROM & BIT(9)) || ((REG_SCFG_ROM & BIT(9)) && ndsHeader->unitCode > 0 && dsiModeConfirmed))) { // Patch if (useGetPitchTableBranch) { - tonccpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTableThumb, 0x40); + __aeabi_memcpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTableThumb, 0x40); } else if (isSdk5(moduleParams)) { - toncset16(swiGetPitchTableOffset, 0x46C0, 6); + u16 swiGetPitchTablePatch[6] = {0x46C0}; + __aeabi_memcpy(swiGetPitchTableOffset, swiGetPitchTablePatch, 6*sizeof(u16)); if ((REG_SCFG_ROM & BIT(9)) && dsiModeConfirmed) { u16* swiGetPitchTableOffsetThumb = (u16*)patchOffsetCache.swiGetPitchTableOffset; - toncset16(swiGetPitchTableOffsetThumb+2, 0x46C0, 6); + __aeabi_memcpy(swiGetPitchTableOffsetThumb+2, swiGetPitchTablePatch, 6*sizeof(u16)); } } else if (!patchOffsetCache.a7IsThumb) { u32* swiGetPitchTablePatch = ce7->patches->j_twlGetPitchTable; - tonccpy(swiGetPitchTableOffset, swiGetPitchTablePatch, 0xC); + __aeabi_memcpy(swiGetPitchTableOffset, swiGetPitchTablePatch, 0xC); } } @@ -298,25 +299,25 @@ static void fixForDifferentBios(const cardengineArm7* ce7, const tNDSHeader* nds *swi24Offset = 0xE77E; u32 dst = ((u32)swi24Offset) - 0x100; - tonccpy((u32*)dst, ce7->patches->swi24, 0x8); + __aeabi_memcpy((u32*)dst, ce7->patches->swi24, 0x8); } if (swi25Offset) { *swi25Offset = 0xE780; u32 dst = ((u32)swi25Offset) - 0xFC; - tonccpy((u32*)dst, ce7->patches->swi25, 0x8); + __aeabi_memcpy((u32*)dst, ce7->patches->swi25, 0x8); } if (swi26Offset) { *swi26Offset = 0xE77F; u32 dst = ((u32)swi26Offset) - 0xFE; - tonccpy((u32*)dst, ce7->patches->swi26, 0x8); + __aeabi_memcpy((u32*)dst, ce7->patches->swi26, 0x8); } if (swi27Offset) { *swi27Offset = 0xE780; u32 dst = ((u32)swi27Offset) - 0xFC; - tonccpy((u32*)dst, ce7->patches->swi27, 0x8); + __aeabi_memcpy((u32*)dst, ce7->patches->swi27, 0x8); } //u32 mainMemA7iStart = (*(u32*)0x02FFE1A0 != 0x00403000) ? 0x02F88000 : 0x02F80000; @@ -518,10 +519,10 @@ bool a7PatchCardIrqEnable(cardengineArm7* ce7, const tNDSHeader* ndsHeader, cons const bool usesThumb = (*(u16*)cardIrqEnableOffset == 0xB510 || *(u16*)cardIrqEnableOffset == 0xB530); if (usesThumb) { u16* cardIrqEnablePatch = (u16*)ce7->patches->thumb_card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); } else { u32* cardIrqEnablePatch = ce7->patches->card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); } dbg_printf("cardIrqEnable location : "); @@ -542,7 +543,7 @@ static void patchCardCheckPullOut(cardengineArm7* ce7, const tNDSHeader* ndsHead } if (cardCheckPullOutOffset) { u32* cardCheckPullOutPatch = ce7->patches->card_pull_out_arm9; - tonccpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); + __aeabi_memcpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); } } @@ -592,8 +593,8 @@ u32 patchCardNdsArm7( // Replace incompatible ARM7 binary newArm7binarySize = *(u32*)DONOR_ROM_ARM7_SIZE_LOCATION; newArm7ibinarySize = *(u32*)DONOR_ROM_ARM7I_SIZE_LOCATION; - tonccpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); - toncset((u8*)DONOR_ROM_ARM7_LOCATION, 0, 0x30010); + __aeabi_memcpy(ndsHeader->arm7destination, (u8*)DONOR_ROM_ARM7_LOCATION, newArm7binarySize); + __aeabi_memclr((u8*)DONOR_ROM_ARM7_LOCATION, 0x30010); } if (newArm7binarySize != patchOffsetCache.a7BinSize) { @@ -612,9 +613,9 @@ u32 patchCardNdsArm7( if (newArm7binarySize == 0x24B64 && *(u32*)0x023825E4 == 0xE92D4030 && *(u32*)0x023825E8 == 0xE24DD004) { - tonccpy((char*)0x023825E4, (char*)ARM7_FIX_BUFFERED_LOCATION, 0x140); + __aeabi_memcpy((char*)0x023825E4, (char*)ARM7_FIX_BUFFERED_LOCATION, 0x140); } - toncset((char*)ARM7_FIX_BUFFERED_LOCATION, 0, 0x140); + __aeabi_memclr((char*)ARM7_FIX_BUFFERED_LOCATION, 0x140); if (!a7PatchCardIrqEnable(ce7, ndsHeader, moduleParams)) { dbg_printf("ERR_LOAD_OTHR"); diff --git a/retail/bootloaderi/source/arm7/patch_arm9.c b/retail/bootloaderi/source/arm7/patch_arm9.c index f162cf945..eb19f9b42 100644 --- a/retail/bootloaderi/source/arm7/patch_arm9.c +++ b/retail/bootloaderi/source/arm7/patch_arm9.c @@ -10,7 +10,7 @@ #include "unpatched_funcs.h" #include "debug_file.h" #include "dmaTwl.h" -#include "tonccpy.h" +#include "aeabi.h" #include "igm_text.h" #include "locations.h" @@ -48,7 +48,7 @@ static void fixForDifferentBios(const cardengineArm9* ce9, const tNDSHeader* nds if (swi12Offset && (u8)a9ScfgRom == 1 && (!(REG_SCFG_ROM & BIT(1)) || dsiModeConfirmed)) { // Patch to call swi 0x02 instead of 0x12 u32* swi12Patch = ce9->patches->swi02; - tonccpy(swi12Offset, swi12Patch, 0x4); + __aeabi_memcpy(swi12Offset, swi12Patch, 0x4); } dbg_printf("swi12 location : "); @@ -285,7 +285,7 @@ static bool patchCardRead(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons // Patch u32* cardReadPatch = (usesThumb ? ce9->thumbPatches->card_read_arm9 : ce9->patches->card_read_arm9); - tonccpy(cardReadStartOffset, cardReadPatch, usesThumb ? (isSdk5(moduleParams) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 + __aeabi_memcpy(cardReadStartOffset, cardReadPatch, usesThumb ? (isSdk5(moduleParams) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 dbg_printf("cardRead location : "); dbg_hexa((u32)cardReadStartOffset); dbg_printf("\n"); @@ -305,7 +305,7 @@ static bool patchCardRead(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons if (cardReadStartOffset) { cardReadPatch = ce9->patches->card_read_arm9; - tonccpy(cardReadStartOffset, cardReadPatch, 0x2C); + __aeabi_memcpy(cardReadStartOffset, cardReadPatch, 0x2C); } dbg_printf("cardReadHash location : "); @@ -361,7 +361,7 @@ static void patchCardPullOut(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c // Patch u32* cardPullOutPatch = (usesThumb ? ce9->thumbPatches->card_pull_out_arm9 : ce9->patches->card_pull_out_arm9); - tonccpy(cardPullOutOffset, cardPullOutPatch, usesThumb ? 0x2 : 0x30); + __aeabi_memcpy(cardPullOutOffset, cardPullOutPatch, usesThumb ? 0x2 : 0x30); dbg_printf("cardPullOut location : "); dbg_hexa((u32)cardPullOutOffset); dbg_printf("\n\n"); @@ -397,7 +397,7 @@ static void patchCacheFlush(cardengineArm9* ce9, bool usesThumb, u32* cardPullOu } // Patch u32* cardPullOutPatch = (usesThumb ? ce9->thumbPatches->card_pull : ce9->patches->card_pull); - tonccpy(forceToPowerOffOffset, cardPullOutPatch, 0x4); + __aeabi_memcpy(forceToPowerOffOffset, cardPullOutPatch, 0x4); }*/ static bool patchCardId(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const module_params_t* moduleParams, bool usesThumb, u32* cardReadEndOffset) { @@ -429,7 +429,7 @@ static bool patchCardId(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const u32* cardIdPatch = (usesThumb ? ce9->thumbPatches->card_id_arm9 : ce9->patches->card_id_arm9); cardIdPatch[usesThumb ? 1 : 2] = baseChipID; - tonccpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); + __aeabi_memcpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); dbg_printf("cardId location : "); dbg_hexa((u32)cardIdStartOffset); dbg_printf("\n\n"); @@ -542,7 +542,7 @@ static void patchCardReadDma(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c } // Patch u32* cardReadDmaPatch = (usesThumb ? ce9->thumbPatches->card_dma_arm9 : ce9->patches->card_dma_arm9); - tonccpy(cardReadDmaStartOffset, cardReadDmaPatch, 0x40); + __aeabi_memcpy(cardReadDmaStartOffset, cardReadDmaPatch, 0x40); dbg_printf("cardReadDma location : "); dbg_hexa((u32)cardReadDmaStartOffset); dbg_printf("\n\n"); @@ -699,7 +699,7 @@ static bool patchCardSetDma(cardengineArm9* ce9, const tNDSHeader* ndsHeader, co dbg_hexa((u32)setDmaoffset); dbg_printf("\n\n"); u32* cardSetDmaPatch = (usesThumb ? ce9->thumbPatches->card_set_dma_arm9 : ce9->patches->card_set_dma_arm9); - tonccpy(setDmaoffset, cardSetDmaPatch, 0x30); + __aeabi_memcpy(setDmaoffset, cardSetDmaPatch, 0x30); setDmaPatched = true; return true; @@ -723,7 +723,7 @@ static void patchReset(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const m // Patch u32* resetPatch = ce9->patches->reset_arm9; - tonccpy(reset, resetPatch, 0x40); + __aeabi_memcpy(reset, resetPatch, 0x40); dbg_printf("reset location : "); dbg_hexa((u32)reset); dbg_printf("\n\n"); @@ -855,7 +855,7 @@ bool a9PatchCardIrqEnable(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons return false; } u32* cardIrqEnablePatch = (usesThumb ? ce9->thumbPatches->card_irq_enable : ce9->patches->card_irq_enable); - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); dbg_printf("cardIrqEnable location : "); dbg_hexa((u32)cardIrqEnableOffset); dbg_printf("\n\n"); @@ -1241,7 +1241,7 @@ static void patchCartRead(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons // Patch u32* cartReadPatch = (usesThumb ? ce9->thumbPatches->cart_read : ce9->patches->cart_read); - tonccpy(offset, cartReadPatch, 0x40); + __aeabi_memcpy(offset, cartReadPatch, 0x40); dbg_printf("cartRead location : "); dbg_hexa((u32)offset); dbg_printf("\n\n"); @@ -1703,7 +1703,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, dbg_hexa((u32)ltdModuleParams->arm9i_offset); dbg_printf("\n\n");*/ - tonccpy(moduleParams->static_bss_end, ltdModuleParams->arm9i_offset, iUncompressedSizei); + __aeabi_memcpy(moduleParams->static_bss_end, ltdModuleParams->arm9i_offset, iUncompressedSizei); //bool armFound = false; u32* arm9idst = moduleParams->static_bss_end; @@ -1801,19 +1801,19 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } if (openBlFound) { *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); } if (closeBlFound) { *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); } if (seekBlFound) { *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); } if (readBlFound) { *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); } }*/ } else { // THUMB @@ -1864,7 +1864,7 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, return; // getOffsetFromBLThumb currently doesn't get backward offsets correctly - tonccpy(moduleParams->static_bss_end, ltdModuleParams->arm9i_offset, iUncompressedSizei); + __aeabi_memcpy(moduleParams->static_bss_end, ltdModuleParams->arm9i_offset, iUncompressedSizei); const u32 dsiSaveOpenT = 0x02000200; const u32 dsiSaveCloseT = 0x02000210; @@ -1917,24 +1917,24 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } if (openBlFound) { *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); } if (closeBlFound) { *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); } if (seekBlFound) { *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); } if (readBlFound) { *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); } } - tonccpy(ltdModuleParams->arm9i_offset, moduleParams->static_bss_end, iUncompressedSizei); - toncset(moduleParams->static_bss_end, 0, iUncompressedSizei); + __aeabi_memcpy(ltdModuleParams->arm9i_offset, moduleParams->static_bss_end, iUncompressedSizei); + __aeabi_memclr(moduleParams->static_bss_end, iUncompressedSizei); } else { extern int sharedFontRegion; if ((sharedFontRegion == 2 && ndsHeader->gameCode[3] == 'K') @@ -1974,17 +1974,17 @@ void patchSharedFontPath(const cardengineArm9* ce9, const tNDSHeader* ndsHeader, } if (ndsHeader->gameCode[3] == 'K') { - tonccpy((u32*)newFontPathOffset, korFontPath, strlen(korFontPath)); + __aeabi_memcpy((u32*)newFontPathOffset, korFontPath, strlen(korFontPath)); } else if (ndsHeader->gameCode[3] == 'C') { - tonccpy((u32*)newFontPathOffset, chnFontPath, strlen(chnFontPath)); + __aeabi_memcpy((u32*)newFontPathOffset, chnFontPath, strlen(chnFontPath)); } else { - tonccpy((u32*)newFontPathOffset, twlFontPath, strlen(twlFontPath)); + __aeabi_memcpy((u32*)newFontPathOffset, twlFontPath, strlen(twlFontPath)); } } } void codeCopy(u32* dst, u32* src, u32 len) { - tonccpy(dst, src, len); + __aeabi_memcpy(dst, src, len); u32 srci = (u32)src; u32 dsti = (u32)dst; @@ -2425,11 +2425,11 @@ static void nandSavePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons //u32 gNandWrite(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandWritePatch = ce9->patches->nand_write_arm9; - tonccpy((u8*)sdPatchEntry+0x958, nandWritePatch, 0x40); + __aeabi_memcpy((u8*)sdPatchEntry+0x958, nandWritePatch, 0x40); //u32 gNandRead(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandReadPatch = ce9->patches->nand_read_arm9; - tonccpy((u8*)sdPatchEntry+0xD24, nandReadPatch, 0x40); + __aeabi_memcpy((u8*)sdPatchEntry+0xD24, nandReadPatch, 0x40); } else { // Jam with the Band (Europe) if (strcmp(romTid, "UXBP") == 0) { @@ -2447,11 +2447,11 @@ static void nandSavePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons //u32 gNandWrite(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandWritePatch = ce9->patches->nand_write_arm9; - tonccpy((u32*)0x0206176C, nandWritePatch, 0x40); + __aeabi_memcpy((u32*)0x0206176C, nandWritePatch, 0x40); //u32 gNandRead(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandReadPatch = ce9->patches->nand_read_arm9; - tonccpy((u32*)0x02061AC4, nandReadPatch, 0x40); + __aeabi_memcpy((u32*)0x02061AC4, nandReadPatch, 0x40); } else // Face Training (Europe) if (strcmp(romTid, "USKV") == 0) { @@ -2469,11 +2469,11 @@ static void nandSavePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons //u32 gNandWrite(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandWritePatch = ce9->patches->nand_write_arm9; - tonccpy((u32*)0x020E2BF0, nandWritePatch, 0x40); + __aeabi_memcpy((u32*)0x020E2BF0, nandWritePatch, 0x40); //u32 gNandRead(void* memory,void* flash,u32 size,u32 dma_channel) u32* nandReadPatch = ce9->patches->nand_read_arm9; - tonccpy((u32*)0x020E2F3C, nandReadPatch, 0x40); + __aeabi_memcpy((u32*)0x020E2F3C, nandReadPatch, 0x40); } } } @@ -2522,7 +2522,7 @@ static void patchCardReadPdash(cardengineArm9* ce9, const tNDSHeader* ndsHeader) if(sdPatchEntry) { // Patch u32* pDashReadPatch = ce9->patches->pdash_read; - tonccpy((u32*)sdPatchEntry, pDashReadPatch, 0x40); + __aeabi_memcpy((u32*)sdPatchEntry, pDashReadPatch, 0x40); } } @@ -2632,7 +2632,7 @@ u32 patchCardNdsArm9(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const mod patchCardReadPdash(ce9, ndsHeader); - // made obsolete by tonccpy + // made obsolete by __aeabi_memcpy //patchCardReadCached(ce9, ndsHeader, moduleParams, usesThumb); patchCardPullOut(ce9, ndsHeader, moduleParams, usesThumb, sdk5ReadType, &cardPullOutOffset); diff --git a/retail/bootloaderi/source/arm7/patch_common.c b/retail/bootloaderi/source/arm7/patch_common.c index 1a805dce7..f9e7ac0bc 100644 --- a/retail/bootloaderi/source/arm7/patch_common.c +++ b/retail/bootloaderi/source/arm7/patch_common.c @@ -24,7 +24,7 @@ #include "cardengine_header_arm9.h" #include "patch.h" #include "common.h" -#include "tonccpy.h" +#include "aeabi.h" #include "loading_screen.h" #include "debug_file.h" #include "value_bits.h" @@ -105,7 +105,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02015EE8, (u32)dsiSaveWrite); setBL(0x02015F04, (u32)dsiSaveClose); setBL(0x02015F18, (u32)dsiSaveClose);*/ - // tonccpy((u32*)0x02031660, dsiSaveGetResultCode, 0xC); + // __aeabi_memcpy((u32*)0x02031660, dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x020193E0 = 0xE12FFF1E; // bx lr (Disable NFTR loading from TWLNAND) @@ -346,10 +346,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020764A4, (u32)dsiSaveWrite); setBL(0x020764AC, (u32)dsiSaveClose); } - toncset((char*)0x020A05F4, 0, 9); // Redirect otherPrv to dataPrv - tonccpy((char*)0x020A05F4, dataPrv, strlen(dataPrv)); - toncset((char*)0x020A0608, 0, 9); - tonccpy((char*)0x020A0608, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x020A05F4, 9); // Redirect otherPrv to dataPrv + __aeabi_memcpy((char*)0x020A05F4, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x020A0608, 9); + __aeabi_memcpy((char*)0x020A0608, dataPrv, strlen(dataPrv)); } // 21 Blackjack (USA) @@ -894,7 +894,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200E494, 0x0200E4D4); *(u32*)0x0200E4F8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0200E578 = 0xE3A00001; // mov r0, #1 - tonccpy((u32*)0x020FDDC8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FDDC8, dsiSaveGetResultCode, 0xC); } // 40-in-1: Explosive Megamix (Europe) @@ -922,14 +922,14 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200E444, 0x0200E484); *(u32*)0x0200E4A8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0200E528 = 0xE3A00001; // mov r0, #1 - tonccpy((u32*)0x020FD438, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FD438, dsiSaveGetResultCode, 0xC); } // 5 in 1 Mahjong (USA) // 5 in 1 Mahjong (Europe) else if (strcmp(romTid, "KRJE") == 0 || strcmp(romTid, "KRJP") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02013098, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013098, dsiSaveGetResultCode, 0xC); setBL(0x02030C18, (u32)dsiSaveOpen); setBL(0x02030C28, (u32)dsiSaveClose); setBL(0x0203104C, (u32)dsiSaveCreate); // dsiSaveCreateAuto @@ -1024,7 +1024,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // 7 Card Games (USA) else if (strcmp(romTid, "K7CE") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x020130EC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020130EC, dsiSaveGetResultCode, 0xC); setBL(0x02034820, (u32)dsiSaveOpen); setBL(0x02034830, (u32)dsiSaveClose); setBL(0x02034C24, (u32)dsiSaveCreate); // dsiSaveCreateAuto @@ -1276,10 +1276,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPub to dataPub - toncset((char*)0x02095CD4, 0, 9); - tonccpy((char*)0x02095CD4, dataPub, strlen(dataPub)); - toncset((char*)0x02095CE8, 0, 9); - tonccpy((char*)0x02095CE8, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x02095CD4, 9); + __aeabi_memcpy((char*)0x02095CD4, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x02095CE8, 9); + __aeabi_memcpy((char*)0x02095CE8, dataPub, strlen(dataPub)); } else { *(u32*)0x02055B74 = 0xE3A00000; // mov r0, #0 *(u32*)0x02055B78 = 0xE12FFF1E; // bx lr @@ -1294,10 +1294,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPub to dataPub - toncset((char*)0x020943B0, 0, 9); - tonccpy((char*)0x020943B0, dataPub, strlen(dataPub)); - toncset((char*)0x020943C4, 0, 9); - tonccpy((char*)0x020943C4, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x020943B0, 9); + __aeabi_memcpy((char*)0x020943B0, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x020943C4, 9); + __aeabi_memcpy((char*)0x020943C4, dataPub, strlen(dataPub)); } } @@ -1307,10 +1307,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPub to dataPub - toncset((char*)0x0209E9C8, 0, 9); - tonccpy((char*)0x0209E9C8, dataPub, strlen(dataPub)); - toncset((char*)0x0209E9DC, 0, 9); - tonccpy((char*)0x0209E9DC, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209E9C8, 9); + __aeabi_memcpy((char*)0x0209E9C8, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209E9DC, 9); + __aeabi_memcpy((char*)0x0209E9DC, dataPub, strlen(dataPub)); } } @@ -1320,10 +1320,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPrv to dataPrv - toncset((char*)0x0209CCDC, 0, 9); - tonccpy((char*)0x0209CCDC, dataPrv, strlen(dataPrv)); - toncset((char*)0x0209CCF0, 0, 9); - tonccpy((char*)0x0209CCF0, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x0209CCDC, 9); + __aeabi_memcpy((char*)0x0209CCDC, dataPrv, strlen(dataPrv)); + __aeabi_memclr((char*)0x0209CCF0, 9); + __aeabi_memcpy((char*)0x0209CCF0, dataPrv, strlen(dataPrv)); } } @@ -1333,10 +1333,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPub to dataPub - toncset((char*)0x0209D220, 0, 9); - tonccpy((char*)0x0209D220, dataPub, strlen(dataPub)); - toncset((char*)0x0209D234, 0, 9); - tonccpy((char*)0x0209D234, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209D220, 9); + __aeabi_memcpy((char*)0x0209D220, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209D234, 9); + __aeabi_memcpy((char*)0x0209D234, dataPub, strlen(dataPub)); } } @@ -1346,10 +1346,10 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020053E4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (!saveOnFlashcard) { // Redirect otherPub to dataPub - toncset((char*)0x0209C1C0, 0, 9); - tonccpy((char*)0x0209C1C0, dataPub, strlen(dataPub)); - toncset((char*)0x0209C1D4, 0, 9); - tonccpy((char*)0x0209C1D4, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209C1C0, 9); + __aeabi_memcpy((char*)0x0209C1C0, dataPub, strlen(dataPub)); + __aeabi_memclr((char*)0x0209C1D4, 9); + __aeabi_memcpy((char*)0x0209C1D4, dataPub, strlen(dataPub)); } } @@ -1458,7 +1458,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Ah! Heaven (USA) // Ah! Heaven (Europe) else if (strcmp(romTid, "K5HE") == 0 || strcmp(romTid, "K5HP") == 0) { - //tonccpy((u32*)0x020102FC, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x020102FC, dsiSaveGetResultCode, 0xC); /* setBL(0x0201E3C0, (u32)dsiSaveCreate); setBL(0x0201E3E8, (u32)dsiSaveOpen); setBL(0x0201E428, (u32)dsiSaveCreate); @@ -1505,7 +1505,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009F7C, (u32)dsiSaveClose); *(u32*)0x0200A278 = 0xE3A00000; // mov r0, #0 *(u32*)0x0200A27C = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020502D4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020502D4, dsiSaveGetResultCode, 0xC); } */ // AiRace: Tunnel (USA) @@ -1563,9 +1563,9 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200DC6C, (u32)dsiSaveClose); *(u32*)0x0200DDB4 = 0xE1A00000; // nop if (romTid[3] == 'E') { - tonccpy((u32*)0x0203FD80, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203FD80, dsiSaveGetResultCode, 0xC); } else { - tonccpy((u32*)0x0203FCD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203FCD4, dsiSaveGetResultCode, 0xC); } } if (!twlFontFound) { @@ -1602,7 +1602,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009F24, (u32)dsiSaveClose); *(u32*)0x0200A220 = 0xE3A00000; // mov r0, #0 *(u32*)0x0200A224 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x0204F404, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204F404, dsiSaveGetResultCode, 0xC); } */ // All-Star Air Hockey (USA) @@ -1710,7 +1710,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02026988, (u32)dsiSaveSetLength); setBL(0x020269D8, (u32)dsiSaveWrite); setBL(0x020269E0, (u32)dsiSaveClose); - tonccpy((u32*)0x0202E838, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E838, dsiSaveGetResultCode, 0xC); } // Animal Puzzle Adventure (Europe, Australia) @@ -1733,12 +1733,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025A4C, (u32)dsiSaveSetLength); setBL(0x02025A9C, (u32)dsiSaveWrite); setBL(0x02025AA4, (u32)dsiSaveClose); - tonccpy((u32*)0x0202D8FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D8FC, dsiSaveGetResultCode, 0xC); } // O Tegaru Pazuru Shirizu: Chiria no Doubutsu Goya (Japan) else if (strcmp(romTid, "KPCJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200F9E0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F9E0, dsiSaveGetResultCode, 0xC); setBL(0x02032EA4, (u32)dsiSaveOpen); setBL(0x02032EB8, (u32)dsiSaveGetLength); setBL(0x02032EC8, (u32)dsiSaveRead); @@ -2435,7 +2435,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02020B08, (u32)dsiSaveGetLength); setBL(0x02020B18, (u32)dsiSaveRead); setBL(0x02020B20, (u32)dsiSaveClose); - tonccpy((u32*)0x02043360, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043360, dsiSaveGetResultCode, 0xC); } // Around the World in 80 Days (USA) @@ -2516,7 +2516,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02019200, (u32)dsiSaveRead); setBL(0x02019214, (u32)dsiSaveRead); setBL(0x0201921C, (u32)dsiSaveClose); - tonccpy((u32*)0x02038D64, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02038D64, dsiSaveGetResultCode, 0xC); } // Artillery: Knights vs. Orcs (Europe) @@ -2599,7 +2599,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200970C, (u32)dsiSaveClose); *(u32*)0x02009A08 = 0xE3A00000; // mov r0, #0 *(u32*)0x02009A0C = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02043318, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043318, dsiSaveGetResultCode, 0xC); } // Astro (USA) @@ -2645,7 +2645,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200AF1C, (u32)dsiSaveGetInfo); *(u32*)0x0200AF60 = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x0200AF64 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02032874, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02032874, dsiSaveGetResultCode, 0xC); } } @@ -2819,35 +2819,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEE") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02095E90; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02095EA0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02095EB0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02095EC0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02095ED0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x02095794; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02096254; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02096444; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x020368DE); // dsiSaveCreateDirAuto setBLThumb(0x020368E6, dsiSaveCreateT); // dsiSaveCreateAuto @@ -2872,35 +2872,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEV") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02094A78; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02094A88; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02094A98; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02094AA8; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02094AB8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x020943F0; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02094E3C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02094FF4; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x0203601E); // dsiSaveCreateDirAuto setBLThumb(0x02036026, dsiSaveCreateT); // dsiSaveCreateAuto @@ -2925,35 +2925,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KBEJ") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02094750; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02094760; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02094770; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02094780; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02094790; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveGetResultCodeT = 0x020940C8; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveSetLengthT = 0x02094B14; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveWriteT = 0x02094CCC; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); doubleNopT(0x02036112); // dsiSaveCreateDirAuto setBLThumb(0x0203611A, dsiSaveCreateT); // dsiSaveCreateAuto @@ -2980,7 +2980,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005120 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200E3C0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E3C0, dsiSaveGetResultCode, 0xC); setBL(0x0203AF74, (u32)dsiSaveCreate); setBL(0x0203AF90, (u32)dsiSaveOpen); setBL(0x0203AFA4, (u32)dsiSaveSetLength); @@ -3040,7 +3040,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020075D4, (u32)dsiSaveClose); *(u32*)0x020078D0 = 0xE3A00000; // mov r0, #0 *(u32*)0x020078D4 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02040EA8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040EA8, dsiSaveGetResultCode, 0xC); } // Blockado: Puzzle Island (USA) @@ -3056,35 +3056,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02019C98; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x02019CA8; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x02019CB8; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02019CC8; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x02019CD8; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x02019CE8; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02019CF8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02019D08; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0204B0C0 = 0x2001; // movs r0, #1 (dsiSaveGetArcSrc) *(u16*)0x0204B0C2 = nopT; @@ -3114,7 +3114,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // A weird bug is preventing save support else if ((strcmp(romTid, "KLNE") == 0 || strcmp(romTid, "KLNP") == 0) && saveOnFlashcard) { *(u32*)0x02005158 = 0xE1A00000; // nop (Work around save-related crash) - /* tonccpy((u32*)0x02014E88, dsiSaveGetResultCode, 0xC); + /* __aeabi_memcpy((u32*)0x02014E88, dsiSaveGetResultCode, 0xC); *(u32*)0x0205EDAC = 0xE3A00000; // mov r0, #0 setBL(0x0205F3E8, (u32)dsiSaveDelete); setBL(0x0205F460, (u32)dsiSaveOpen); @@ -3211,7 +3211,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Bomberman Blitz (USA) else if (strcmp(romTid, "KBBE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); // *(u32*)0x020437AC = 0xE3A00001; // mov r0, #1 // *(u32*)0x020437B0 = 0xE12FFF1E; // bx lr setBL(0x02043950, (u32)dsiSaveOpen); @@ -3226,7 +3226,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Bomberman Blitz (Europe, Australia) else if (strcmp(romTid, "KBBV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); // *(u32*)0x02043878 = 0xE3A00001; // mov r0, #1 // *(u32*)0x0204387C = 0xE12FFF1E; // bx lr setBL(0x02043A1C, (u32)dsiSaveOpen); @@ -3241,7 +3241,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Itsudemo Bomberman (Japan) else if (strcmp(romTid, "KBBJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02009670, dsiSaveGetResultCode, 0xC); // *(u32*)0x020434D8 = 0xE3A00001; // mov r0, #1 // *(u32*)0x020434DC = 0xE12FFF1E; // bx lr setBL(0x0204367C, (u32)dsiSaveOpen); @@ -3256,7 +3256,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Bookstore Dream (USA) else if (strcmp(romTid, "KQVE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02010A84, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010A84, dsiSaveGetResultCode, 0xC); setBL(0x02052C48, (u32)dsiSaveGetInfo); setBL(0x02052C5C, (u32)dsiSaveOpen); setBL(0x02052C70, (u32)dsiSaveCreate); @@ -3282,7 +3282,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Bookstore Dream (Europe, Australia) else if (strcmp(romTid, "KQVV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02010A80, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010A80, dsiSaveGetResultCode, 0xC); setBL(0x02052F54, (u32)dsiSaveGetInfo); setBL(0x02052F68, (u32)dsiSaveOpen); setBL(0x02052F7C, (u32)dsiSaveCreate); @@ -3308,7 +3308,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Bookstore Dream (Japan) else if (strcmp(romTid, "KQVJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02010A80, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010A80, dsiSaveGetResultCode, 0xC); setBL(0x02053344, (u32)dsiSaveGetInfo); setBL(0x02053358, (u32)dsiSaveOpen); setBL(0x0205336C, (u32)dsiSaveCreate); @@ -3370,7 +3370,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007688, (u32)dsiSaveWrite); setBL(0x02007698, (u32)dsiSaveWrite); setBL(0x020076A0, (u32)dsiSaveClose); - tonccpy((u32*)0x0202D9F8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D9F8, dsiSaveGetResultCode, 0xC); } */ } @@ -3392,7 +3392,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020075F0, (u32)dsiSaveWrite); setBL(0x02007600, (u32)dsiSaveWrite); setBL(0x02007608, (u32)dsiSaveClose); - tonccpy((u32*)0x0202D960, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D960, dsiSaveGetResultCode, 0xC); } */ } @@ -3414,7 +3414,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200771C, (u32)dsiSaveWrite); setBL(0x0200772C, (u32)dsiSaveWrite); setBL(0x02007734, (u32)dsiSaveClose); - tonccpy((u32*)0x0202FCFC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202FCFC, dsiSaveGetResultCode, 0xC); } */ } @@ -3521,7 +3521,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strncmp(romTid, "KKQ", 3) == 0 && saveOnFlashcard) { u32* saveFuncOffsets[22] = {NULL}; - tonccpy((u32*)0x0201BEB8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201BEB8, dsiSaveGetResultCode, 0xC); if (romTid[3] == 'E') { *(u32*)0x0205A598 = 0xE3A00000; // mov r0, #0 *(u32*)0x0205A804 = 0xE3A00000; // mov r0, #0 @@ -3618,7 +3618,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202D244, (u32)dsiSaveSeek); setBL(0x0202D258, (u32)dsiSaveWrite); setBL(0x0202D264, (u32)dsiSaveClose); - tonccpy((u32*)0x020584CC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020584CC, dsiSaveGetResultCode, 0xC); } // Cake Ninja (Europe) @@ -3640,7 +3640,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202D31C, (u32)dsiSaveSeek); setBL(0x0202D330, (u32)dsiSaveWrite); setBL(0x0202D33C, (u32)dsiSaveClose); - tonccpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); } // Cake Ninja 2 (USA) @@ -3662,7 +3662,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0204CD6C, (u32)dsiSaveSeek); setBL(0x0204CD80, (u32)dsiSaveWrite); setBL(0x0204CD8C, (u32)dsiSaveClose); - tonccpy((u32*)0x02078040, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02078040, dsiSaveGetResultCode, 0xC); } // Cake Ninja 2 (Europe) @@ -3684,7 +3684,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0204CDC8, (u32)dsiSaveSeek); setBL(0x0204CDDC, (u32)dsiSaveWrite); setBL(0x0204CDE8, (u32)dsiSaveClose); - tonccpy((u32*)0x0207809C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0207809C, dsiSaveGetResultCode, 0xC); } // Cake Ninja: XMAS (USA) @@ -3706,7 +3706,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025B70, (u32)dsiSaveSeek); setBL(0x02025B84, (u32)dsiSaveWrite); setBL(0x02025B90, (u32)dsiSaveClose); - tonccpy((u32*)0x02050EDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02050EDC, dsiSaveGetResultCode, 0xC); } // Cake Ninja: XMAS (Europe) @@ -3727,7 +3727,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02025BD4, (u32)dsiSaveOpen); setBL(0x02025BFC, (u32)dsiSaveSeek); setBL(0x02025C10, (u32)dsiSaveWrite); - tonccpy((u32*)0x02050F68, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02050F68, dsiSaveGetResultCode, 0xC); } // Candle Route (USA) @@ -3735,7 +3735,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "K9YE") == 0 || strcmp(romTid, "K9YP") == 0) { if (saveOnFlashcard) { u8 offsetChange = (romTid[3] == 'E') ? 0 : 0xA4; - tonccpy((u32*)0x02018178, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018178, dsiSaveGetResultCode, 0xC); setBL(0x02089814+offsetChange, (u32)dsiSaveGetInfo); setBL(0x02089840+offsetChange, (u32)dsiSaveCreate); setBL(0x02089868+offsetChange, (u32)dsiSaveOpen); @@ -3798,13 +3798,13 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200ABB8, (u32)dsiSaveWrite); setBL(0x0200ABDC, (u32)dsiSaveClose); setBL(0x0200AC6C, (u32)dsiSaveGetInfo); - tonccpy((u32*)(0x02051FD0-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02051FD0-offsetChange), dsiSaveGetResultCode, 0xC); } } // Castle Conqueror (USA) else if (strcmp(romTid, "KCNE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x020252B8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020252B8, dsiSaveGetResultCode, 0xC); // *(u32*)0x0204AFD8 = 0xE12FFF1E; // bx lr // *(u32*)0x0204B084 = 0xE12FFF1E; // bx lr // *(u32*)0x0204B44C = 0xE12FFF1E; // bx lr @@ -3833,7 +3833,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror (Europe) else if (strcmp(romTid, "KCNP") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02016EC4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016EC4, dsiSaveGetResultCode, 0xC); // *(u32*)0x0203A5A4 = 0xE12FFF1E; // bx lr // *(u32*)0x0203A7D4 = 0xE12FFF1E; // bx lr // *(u32*)0x0203AB6C = 0xE12FFF1E; // bx lr @@ -3921,7 +3921,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes (USA) else if (strcmp(romTid, "KC5E") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); setBL(0x02065C8C, (u32)dsiSaveGetInfo); setBL(0x02065CA0, (u32)dsiSaveOpen); setBL(0x02065CB4, (u32)dsiSaveCreate); @@ -3949,7 +3949,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes (Europe, Australia) else if (strcmp(romTid, "KC5V") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02018248, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018248, dsiSaveGetResultCode, 0xC); setBL(0x020660FC, (u32)dsiSaveGetInfo); setBL(0x02066110, (u32)dsiSaveOpen); setBL(0x02066128, (u32)dsiSaveCreate); @@ -3977,7 +3977,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes (Japan) else if (strcmp(romTid, "KC5J") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201831C, dsiSaveGetResultCode, 0xC); setBL(0x02026F94, (u32)dsiSaveGetInfo); setBL(0x02026FA8, (u32)dsiSaveOpen); setBL(0x02026FC0, (u32)dsiSaveCreate); @@ -4005,7 +4005,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes 2 (USA) else if (strcmp(romTid, "KXCE") == 0) { - tonccpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); setBL(0x02035478, (u32)dsiSaveGetInfo); setBL(0x0203548C, (u32)dsiSaveOpen); setBL(0x020354A4, (u32)dsiSaveCreate); @@ -4034,7 +4034,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes 2 (Europe, Australia) else if (strcmp(romTid, "KXCV") == 0) { - tonccpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); setBL(0x0206A44C, (u32)dsiSaveGetInfo); setBL(0x0206A460, (u32)dsiSaveOpen); setBL(0x0206A478, (u32)dsiSaveCreate); @@ -4063,7 +4063,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Castle Conqueror: Heroes 2 (Japan) else if (strcmp(romTid, "KXCJ") == 0) { - tonccpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013CF4, dsiSaveGetResultCode, 0xC); setBL(0x02026EAC, (u32)dsiSaveGetInfo); setBL(0x02026EC0, (u32)dsiSaveOpen); setBL(0x02026ED8, (u32)dsiSaveCreate); @@ -4138,7 +4138,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Cat Frenzy (Europe) else if (strcmp(romTid, "KVXE") == 0 || strcmp(romTid, "KVXP") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02018278, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018278, dsiSaveGetResultCode, 0xC); setBL(0x020293A0, (u32)dsiSaveGetInfo); setBL(0x020293D4, (u32)dsiSaveCreate); setBL(0x020293FC, (u32)dsiSaveOpen); @@ -4163,7 +4163,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Mew Mew Chamber (Japan) else if (strcmp(romTid, "KVXJ") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02018254, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02018254, dsiSaveGetResultCode, 0xC); setBL(0x0202929C, (u32)dsiSaveGetInfo); setBL(0x020292D0, (u32)dsiSaveCreate); setBL(0x020292F8, (u32)dsiSaveOpen); @@ -4207,7 +4207,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02005C28, (u32)dsiSaveSeek); setBL(0x02005C38, (u32)dsiSaveWrite); setBL(0x02005C40, (u32)dsiSaveClose); - tonccpy((u32*)0x02073FA4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02073FA4, dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x0200A12C = 0xE1A00000; // nop (Skip Manual screen) @@ -4598,7 +4598,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007600, (u32)dsiSaveClose); *(u32*)0x020078FC = 0xE3A00000; // mov r0, #0 *(u32*)0x02007900 = 0xE12FFF1E; // bx lr - tonccpy((u32*)(strcmp(romTid, "KH5J") == 0 ? 0x02040E10 : 0x02046630), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(strcmp(romTid, "KH5J") == 0 ? 0x02040E10 : 0x02046630), dsiSaveGetResultCode, 0xC); } // Coropata (Japan) @@ -4607,7 +4607,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020699A8 = 0xE1A00000; // nop (Soft-lock instead of displaying Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x02011C3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011C3C, dsiSaveGetResultCode, 0xC); setBL(0x0206E1E4, (u32)dsiSaveOpen); setBL(0x0206E1F4, (u32)dsiSaveGetLength); setBL(0x0206E204, (u32)dsiSaveClose); @@ -4678,31 +4678,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02024B0C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02024B1C; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02024B2C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02024B3C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02024B4C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02024B5C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02024B6C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200DF38 = 0x2001; // movs r0, #1 *(u16*)0x0200DF3A = 0x4770; // bx lr @@ -4715,7 +4715,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200E2D4, dsiSaveWriteT); setBLThumb(0x0200E2E6, dsiSaveCloseT); *(u16*)0x0200E30C = 0x4778; // bx pc - tonccpy((u32*)0x0200E310, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200E310, dsiSaveGetLength, 0xC); setBLThumb(0x0200E33C, dsiSaveOpenT); setBLThumb(0x0200E362, dsiSaveCloseT); setBLThumb(0x0200E374, dsiSaveReadT); @@ -4878,7 +4878,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strncmp(romTid, "K32", 3) == 0 && saveOnFlashcard) { u32* saveFuncOffsets[22] = {NULL}; - tonccpy((u32*)0x0201C450, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C450, dsiSaveGetResultCode, 0xC); if (romTid[3] == 'E') { *(u32*)0x02062328 = 0xE3A00000; // mov r0, #0 *(u32*)0x02062600 = 0xE3A00000; // mov r0, #0 @@ -4989,11 +4989,11 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x02009BF4+offsetChange) = 0xE12FFF1E; // bx lr if (romTid[3] == 'E') { - tonccpy((u32*)0x02043610, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043610, dsiSaveGetResultCode, 0xC); } else if (romTid[3] == 'P') { - tonccpy((u32*)0x0204361C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204361C, dsiSaveGetResultCode, 0xC); } else { - tonccpy((u32*)0x020435C4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020435C4, dsiSaveGetResultCode, 0xC); } } @@ -5020,7 +5020,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020075DC, (u32)dsiSaveClose); *(u32*)0x020078D8 = 0xE3A00000; // mov r0, #0 *(u32*)0x020078DC = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); } // Dairojo! Samurai Defenders (USA) @@ -5110,7 +5110,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009A98+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02009D94+offsetChange) = 0xE3A00000; // mov r0, #0 *(u32*)(0x02009D98+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x02043BC0 : 0x02043BCC), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x02043BC0 : 0x02043BCC), dsiSaveGetResultCode, 0xC); } // G.G Series: Dark Spirits (Japan) @@ -5136,13 +5136,13 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007794, (u32)dsiSaveClose); *(u32*)0x02007A90 = 0xE3A00000; // mov r0, #0 *(u32*)0x02007A94 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040DBC, dsiSaveGetResultCode, 0xC); } // Dark Void Zero (USA) // Dark Void Zero (Europe, Australia) else if ((strcmp(romTid, "KDVE") == 0 || strcmp(romTid, "KDVV") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x02043DDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02043DDC, dsiSaveGetResultCode, 0xC); setBL(0x0208AE90, (u32)dsiSaveOpen); setBL(0x0208AEA4, (u32)dsiSaveCreate); setBL(0x0208AEC4, (u32)dsiSaveOpen); @@ -5255,7 +5255,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200B488, (u32)dsiSaveOpen); setBL(0x0200B4A8, (u32)dsiSaveWrite); setBL(0x0200B4C0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D9D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D9D0, dsiSaveGetResultCode, 0xC); } // GO Series: Defense Wars (USA) @@ -5289,7 +5289,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200C8CC, (u32)dsiSaveGetInfo); *(u32*)0x0200C910 = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x0200C914 = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] != 'J') ? 0x0204AAEC : 0x0204A8E8), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] != 'J') ? 0x0204AAEC : 0x0204A8E8), dsiSaveGetResultCode, 0xC); } } @@ -5434,7 +5434,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // A Little Bit of... Dr. Mario (Europe, Australia) else if (strcmp(romTid, "KD9E") == 0 || strcmp(romTid, "KD9V") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02011160, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011160, dsiSaveGetResultCode, 0xC); *(u32*)0x0203D228 = 0xE3A00000; // mov r0, #0 (Skip saving to "back.dat") // *(u32*)0x0203D488 = 0xE3A00000; // mov r0, #0 // *(u32*)0x0203D48C = 0xE12FFF1E; // bx lr @@ -5487,7 +5487,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Chotto Dr. Mario (Japan) else if (strcmp(romTid, "KD9J") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x020118A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020118A4, dsiSaveGetResultCode, 0xC); *(u32*)0x0205824C = 0xE3A00000; // mov r0, #0 (Skip saving to "back.dat") // *(u32*)0x020584B4 = 0xE3A00000; // mov r0, #0 // *(u32*)0x020584B8 = 0xE12FFF1E; // bx lr @@ -5653,7 +5653,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02008870+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02008B6C+offsetChange) = 0xE3A00000; // mov r0, #0 *(u32*)(0x02008B70+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x020427B0 : 0x02042764), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x020427B0 : 0x02042764), dsiSaveGetResultCode, 0xC); } // G.G Series: Drift Circuit (Japan) @@ -5679,7 +5679,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007F60, (u32)dsiSaveClose); *(u32*)0x0200825C = 0xE3A00000; // mov r0, #0 *(u32*)0x02008260 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020420DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020420DC, dsiSaveGetResultCode, 0xC); } // G.G Series: Drift Circuit 2 (Japan) @@ -5705,7 +5705,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009518, (u32)dsiSaveClose); *(u32*)0x02009814 = 0xE3A00000; // mov r0, #0 *(u32*)0x02009818 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020434BC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020434BC, dsiSaveGetResultCode, 0xC); } // Drift Street International (USA) @@ -5734,7 +5734,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020369DC+offsetChange, (u32)dsiSaveCreate); setBL(0x02036A14+offsetChange, (u32)dsiSaveSetLength); *(u32*)(0x02036D04+offsetChange) = 0xE1A00000; // nop - tonccpy((u32*)(0x020AA6B4+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x020AA6B4+offsetChangeInit), dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { u8 offsetChange2 = (romTid[3] == 'E') ? 0 : 0x68; @@ -5764,7 +5764,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020084A8, (u32)dsiSaveRead); setBL(0x020084B4, (u32)dsiSaveRead); // dsiSaveReadAsync setBL(0x020084F8, (u32)dsiSaveClose); - tonccpy((u32*)0x0204E004, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204E004, dsiSaveGetResultCode, 0xC); } */ // G.G Series: Drilling Attack!! (Japan) @@ -5790,12 +5790,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007F7C, (u32)dsiSaveClose); *(u32*)0x02008278 = 0xE3A00000; // mov r0, #0 *(u32*)0x0200827C = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02041AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041AD4, dsiSaveGetResultCode, 0xC); } // DS WiFi Settings else if (strcmp(romTid, "B88A") == 0) { - tonccpy((void*)0x023C0000, ce9->thumbPatches->reset_arm9, 0x18); + __aeabi_memcpy((void*)0x023C0000, ce9->thumbPatches->reset_arm9, 0x18); const u16* branchCode = generateA7InstrThumb(0x020051F4, 0x023C0000); @@ -5828,7 +5828,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200ADA0, (u32)dsiSaveWrite); setBL(0x0200ADC4, (u32)dsiSaveClose); setBL(0x0200AE58, (u32)dsiSaveGetInfo); - tonccpy((u32*)0x0204CB6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204CB6C, dsiSaveGetResultCode, 0xC); } } @@ -5856,7 +5856,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200ACB0, (u32)dsiSaveWrite); setBL(0x0200ACD4, (u32)dsiSaveClose); setBL(0x0200AD68, (u32)dsiSaveGetInfo); - tonccpy((u32*)0x0204CA70, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204CA70, dsiSaveGetResultCode, 0xC); } } @@ -5884,7 +5884,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009E74, (u32)dsiSaveWrite); setBL(0x02009E98, (u32)dsiSaveClose); setBL(0x02009F28, (u32)dsiSaveGetInfo); - tonccpy((u32*)0x0203564C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203564C, dsiSaveGetResultCode, 0xC); } } @@ -5912,7 +5912,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200A9D8, (u32)dsiSaveWrite); setBL(0x0200A9FC, (u32)dsiSaveClose); setBL(0x0200AA90, (u32)dsiSaveGetInfo); - tonccpy((u32*)0x0204C79C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204C79C, dsiSaveGetResultCode, 0xC); } } @@ -6043,7 +6043,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02011230, (u32)dsiSaveClose); setBL(0x02011258, (u32)dsiSaveWrite); setBL(0x02011264, (u32)dsiSaveClose); - tonccpy((u32*)0x0205DA08, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205DA08, dsiSaveGetResultCode, 0xC); } } @@ -6064,7 +6064,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020116AC, (u32)dsiSaveClose); setBL(0x020116D4, (u32)dsiSaveWrite); setBL(0x020116E0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205DE84, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205DE84, dsiSaveGetResultCode, 0xC); } } @@ -6085,7 +6085,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02011AF4, (u32)dsiSaveClose); setBL(0x02011B1C, (u32)dsiSaveWrite); setBL(0x02011B28, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E16C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E16C, dsiSaveGetResultCode, 0xC); } } @@ -6106,7 +6106,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02013F4C, (u32)dsiSaveClose); setBL(0x02013F74, (u32)dsiSaveWrite); setBL(0x02013F80, (u32)dsiSaveClose); - tonccpy((u32*)0x0206009C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0206009C, dsiSaveGetResultCode, 0xC); } } @@ -6127,7 +6127,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201450C, (u32)dsiSaveClose); setBL(0x02014534, (u32)dsiSaveWrite); setBL(0x02014540, (u32)dsiSaveClose); - tonccpy((u32*)0x0206065C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0206065C, dsiSaveGetResultCode, 0xC); } } @@ -6148,7 +6148,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02013638, (u32)dsiSaveClose); setBL(0x02013660, (u32)dsiSaveWrite); setBL(0x0201366C, (u32)dsiSaveClose); - tonccpy((u32*)0x0205F924, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205F924, dsiSaveGetResultCode, 0xC); } } @@ -6169,7 +6169,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02014080, (u32)dsiSaveClose); setBL(0x020140A8, (u32)dsiSaveWrite); setBL(0x020140B4, (u32)dsiSaveClose); - tonccpy((u32*)0x0205FD00, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205FD00, dsiSaveGetResultCode, 0xC); } } @@ -6190,7 +6190,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020144E4, (u32)dsiSaveClose); setBL(0x0201450C, (u32)dsiSaveWrite); setBL(0x02014518, (u32)dsiSaveClose); - tonccpy((u32*)0x02060164, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060164, dsiSaveGetResultCode, 0xC); } } @@ -6211,7 +6211,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020135F0, (u32)dsiSaveClose); setBL(0x02013618, (u32)dsiSaveWrite); setBL(0x02013624, (u32)dsiSaveClose); - tonccpy((u32*)0x0205F4A8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205F4A8, dsiSaveGetResultCode, 0xC); } } @@ -6238,7 +6238,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02008038, (u32)dsiSaveClose); *(u32*)0x02008334 = 0xE3A00000; // mov r0, #0 *(u32*)0x02008338 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020414B0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020414B0, dsiSaveGetResultCode, 0xC); } // Face Pilot: Fly With Your Nintendo DSi Camera! (USA) @@ -6261,7 +6261,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Farm Frenzy (USA) else if (strcmp(romTid, "KFKE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200F4CC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F4CC, dsiSaveGetResultCode, 0xC); setBL(0x02035B30, (u32)dsiSaveCreate); setBL(0x02035B4C, (u32)dsiSaveOpen); setBL(0x02035B9C, (u32)dsiSaveWrite); @@ -6298,35 +6298,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { const u32 dsiSaveCreateT = 0x020370F4-offsetChange2; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); // Original function overwritten, no BL setting needed + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); // Original function overwritten, no BL setting needed const u32 dsiSaveSetLengthT = 0x02037104-offsetChange2; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02037114-offsetChange2; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveOpenRT = 0x02037124-offsetChange2; *(u16*)dsiSaveOpenRT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenRT + 4), dsiSaveOpenR, 0x10); + __aeabi_memcpy((u32*)(dsiSaveOpenRT + 4), dsiSaveOpenR, 0x10); const u32 dsiSaveCloseT = 0x02037138-offsetChange2; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02037148-offsetChange2; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02037300-offsetChange2; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0203725C-offsetChange2; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); // Original function overwritten, no BL setting needed + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); // Original function overwritten, no BL setting needed /* *(u16*)(0x020271CC-offsetChange) = 0x2001; // movs r0, #1 *(u16*)(0x020271CE-offsetChange) = 0x4770; // bx lr @@ -6403,7 +6403,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Fizz (USA) else if (strcmp(romTid, "KZZE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); setBL(0x02029FE0, (u32)dsiSaveOpen); setBL(0x0202A030, (u32)dsiSaveGetLength); setBL(0x0202A044, (u32)dsiSaveRead); @@ -6426,39 +6426,39 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if ((strcmp(romTid, "KKRE") == 0 || strcmp(romTid, "KKRP") == 0) && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x0209B380; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x0209B390; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0209B3A0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x0209B3B0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x0209B3C0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveSetLengthT = 0x0209B408; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadAsyncT = 0x0209B5F4; *(u16*)dsiSaveReadAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); /* const u32 dsiSaveWriteT = 0x0209B63C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); */ + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); */ const u32 dsiSaveWriteAsyncT = 0x0209B66C; *(u16*)dsiSaveWriteAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); *(u16*)0x0204A2E8 = 0x4770; // bx lr (Skip NAND error checking) setBLThumb(0x0204A2FC, dsiSaveCloseT); @@ -6629,7 +6629,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Frogger Returns (USA) else if (strcmp(romTid, "KFGE") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x0201234C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201234C, dsiSaveGetResultCode, 0xC); setBL(0x02038250, (u32)dsiSaveGetInfo); setBL(0x02038294, (u32)dsiSaveOpen); setBL(0x020382B0, (u32)dsiSaveRead); @@ -6825,7 +6825,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! (USA) else if (strcmp(romTid, "KGXE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); setBL(0x0203BD8C, (u32)dsiSaveOpen); setBL(0x0203BDA4, (u32)dsiSaveCreate); setBL(0x0203BDBC, (u32)dsiSaveOpen); @@ -6846,7 +6846,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! (Japan) else if (strcmp(romTid, "KGXJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011824, dsiSaveGetResultCode, 0xC); setBL(0x0203CAE8, (u32)dsiSaveOpen); setBL(0x0203CB00, (u32)dsiSaveCreate); // dsiSaveCreateAuto setBL(0x0203CB18, (u32)dsiSaveOpen); @@ -6867,7 +6867,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! 2 (USA) else if (strcmp(romTid, "KKFE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); setBL(0x02040240, (u32)dsiSaveOpen); setBL(0x02040258, (u32)dsiSaveCreate); // dsiSaveCreateAuto setBL(0x02040270, (u32)dsiSaveOpen); @@ -6888,7 +6888,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Go Fetch! 2 (Japan) else if (strcmp(romTid, "KKFJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02019338, dsiSaveGetResultCode, 0xC); setBL(0x0205DD14, (u32)dsiSaveOpen); setBL(0x0205DD2C, (u32)dsiSaveCreate); // dsiSaveCreateAuto setBL(0x0205DD44, (u32)dsiSaveOpen); @@ -6915,7 +6915,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { u8 offsetChangeS2 = (romTid[3] == 'E') ? 0 : 0x1C; u8 offsetChangeS3 = (romTid[3] == 'E') ? 0 : 0x24; - tonccpy((u32*)0x02015874, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015874, dsiSaveGetResultCode, 0xC); setBL(0x0202AD60-offsetChangeS, (u32)dsiSaveCreate); setBL(0x0202AD74-offsetChangeS, (u32)dsiSaveOpen); setBL(0x0202AD9C-offsetChangeS, (u32)dsiSaveCreate); @@ -7107,7 +7107,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Handy Hockey (Japan) else if (strcmp(romTid, "KHOJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200C1D4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200C1D4, dsiSaveGetResultCode, 0xC); *(u32*)0x02031440 = 0xE1A00000; // nop (dsiSaveCreateDir) *(u32*)0x020314AC = 0xE3A00001; // mov r0, #1 (dsiSaveCreateDirAuto) setBL(0x0203150C, (u32)dsiSaveCreate); // dsiSaveCreateAuto @@ -7127,31 +7127,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020238C8; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x020238D8; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x020238E8; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x020238F8; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02023908; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02023918; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02023928; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200D060 = 0x2001; // movs r0, #1 *(u16*)0x0200D062 = 0x4770; // bx lr @@ -7164,7 +7164,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200D3FC, dsiSaveWriteT); setBLThumb(0x0200D40E, dsiSaveCloseT); *(u16*)0x0200D434 = 0x4778; // bx pc - tonccpy((u32*)0x0200D438, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200D438, dsiSaveGetLength, 0xC); setBLThumb(0x0200D464, dsiSaveOpenT); setBLThumb(0x0200D48A, dsiSaveCloseT); setBLThumb(0x0200D49C, dsiSaveReadT); @@ -7226,7 +7226,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // High Stakes Texas Hold'em (USA) // High Stakes Texas Hold'em (Europe, Australia) else if ((strcmp(romTid, "KTXE") == 0 || strcmp(romTid, "KTXV") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x0200EE34, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200EE34, dsiSaveGetResultCode, 0xC); setBL(0x0203A774, (u32)dsiSaveGetInfo); setBL(0x0203A7E0, (u32)dsiSaveCreate); setBL(0x0203A820, (u32)dsiSaveOpen); @@ -7327,7 +7327,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)(0x02008320+offsetChange) = 0xE12FFF1E; // bx lr *(u32*)(0x02008560+offsetChange) = 0xE12FFF1E; // bx lr *(u32*)(0x02008578+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x02041F70 : 0x02041F7C), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x02041F70 : 0x02041F7C), dsiSaveGetResultCode, 0xC); } // G.G Series: Tetsubou (Japan) @@ -7353,7 +7353,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007720, (u32)dsiSaveClose); *(u32*)0x02007A1C = 0xE3A00000; // mov r0, #0 *(u32*)0x02007A20 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020418AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020418AC, dsiSaveGetResultCode, 0xC); } // Ichi Moudaji!: Neko King (Japan) @@ -7385,7 +7385,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200124F8, (u32)dsiSaveGetInfo); *(u32*)0x0201253C = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x02012540 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x0202C764, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202C764, dsiSaveGetResultCode, 0xC); } */ } @@ -7459,7 +7459,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // GO Series: Ivy the Kiwi? mini (Europe, Australia) else if ((strcmp(romTid, "KIKX") == 0 || strcmp(romTid, "KIKV") == 0) && saveOnFlashcard) { u16 offsetChangeS = (romTid[3] == 'X') ? 0 : 0x344; - tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); setBL(0x020B0AB8+offsetChangeS, (u32)dsiSaveCreate); *(u32*)(0x020B0D94+offsetChangeS) = 0xE1A00000; // nop setBL(0x020B1078+offsetChangeS, (u32)dsiSaveCreate); @@ -7484,7 +7484,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Ivy the Kiwi? mini (Japan) else if (strcmp(romTid, "KIKJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC); setBL(0x020B9174, (u32)dsiSaveCreate); *(u32*)0x020B9450 = 0xE1A00000; // nop setBL(0x020B9734, (u32)dsiSaveCreate); @@ -7573,13 +7573,13 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201EC08-offsetChange, (u32)dsiSaveOpen); setBL(0x0201EC38-offsetChange, (u32)dsiSaveRead); setBL(0x0201EC40-offsetChange, (u32)dsiSaveClose); - tonccpy((u32*)(0x02032A48-offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02032A48-offsetChange), dsiSaveGetResultCode, 0xC); } // Jewel Legends: Tree of Life (USA) else if (strcmp(romTid, "KUKE") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02046AB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02046AB4, dsiSaveGetResultCode, 0xC); setBL(0x0201E25C, (u32)dsiSaveOpen); setBL(0x0201E26C, (u32)dsiSaveClose); setBL(0x0201E6D8, (u32)dsiSaveCreate); // dsiSaveCreateAuto @@ -7604,35 +7604,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { /* else if ((strcmp(romTid, "K43E") == 0 || strcmp(romTid, "K43P") == 0) && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020B18B0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020B18C0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020B18D0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x020B18E0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x020B18F0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveSetLengthT = 0x020B1938; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadAsyncT = 0x020B1B24; *(u16*)dsiSaveReadAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadAsyncT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteAsyncT = 0x020B1B9C; *(u16*)dsiSaveWriteAsyncT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteAsyncT + 4), dsiSaveWrite, 0xC); *(u16*)0x0206C40C = 0x4770; // bx lr (Skip NAND error checking) setBLThumb(0x0206C460, dsiSaveCloseT); @@ -7761,29 +7761,29 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Just SING! 80's (USA) // Just SING! 80's (Europe) else if ((strcmp(romTid, "KJFE") == 0 || strcmp(romTid, "KJFP") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x02070968, dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)0x02070968, dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x02070974; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02070984; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x02070994; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSeekT = 0x020709A4; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); - tonccpy((u32*)0x02070A58, dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)0x02070A58, dsiSaveSetLength, 0xC); - tonccpy((u32*)0x02070DC4, dsiSaveRead, 0xC); // dsiSaveReadAsync + __aeabi_memcpy((u32*)0x02070DC4, dsiSaveRead, 0xC); // dsiSaveReadAsync - tonccpy((u32*)0x02070E90, dsiSaveWrite, 0xC); // dsiSaveWriteAsync + __aeabi_memcpy((u32*)0x02070E90, dsiSaveWrite, 0xC); // dsiSaveWriteAsync *(u32*)0x02037CAC = 0x4770; // bx lr (Skip NAND error checking) setBLThumb(0x02037D00, dsiSaveCloseT); @@ -7823,7 +7823,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // A Kappa's Trail (USA) else if (strcmp(romTid, "KPAE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201A020, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201A020, dsiSaveGetResultCode, 0xC); setBL(0x02032000, (u32)dsiSaveOpenR); setBL(0x02032038, (u32)dsiSaveRead); setBL(0x0203205C, (u32)dsiSaveClose); @@ -7838,7 +7838,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Kappa Michi (Japan) else if (strcmp(romTid, "KPAJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201A554, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201A554, dsiSaveGetResultCode, 0xC); setBL(0x02032CAC, (u32)dsiSaveOpenR); setBL(0x02032CE4, (u32)dsiSaveRead); setBL(0x02032D08, (u32)dsiSaveClose); @@ -7853,7 +7853,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Katamukusho (Japan) else if (strcmp(romTid, "K69J") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02011DCC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02011DCC, dsiSaveGetResultCode, 0xC); setBL(0x0206AED8, (u32)dsiSaveOpen); setBL(0x0206AEF0, (u32)dsiSaveGetLength); setBL(0x0206AF18, (u32)dsiSaveRead); @@ -7993,7 +7993,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200C380, getLengthCodeCopy); setBL(0x0200C3A4, readCodeCopy); setBL(0x0200C3B4, closeCodeCopy); - tonccpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020585A4, dsiSaveGetResultCode, 0xC); } // Kokoro no Herusumeta: Kokoron (Japan) @@ -8033,7 +8033,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006220, (u32)dsiSaveSeek); setBL(0x02006230, (u32)dsiSaveWrite); setBL(0x0200624C, (u32)dsiSaveClose); - tonccpy((u32*)0x0202B8E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202B8E8, dsiSaveGetResultCode, 0xC); } // Korogashi Pazuru: Katamari Damacy (Japan) @@ -8042,7 +8042,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005034 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200CEA8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200CEA8, dsiSaveGetResultCode, 0xC); setBL(0x02070238, (u32)dsiSaveCreate); setBL(0x0207026C, (u32)dsiSaveOpen); setBL(0x02070284, (u32)dsiSaveSetLength); @@ -8179,7 +8179,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // The Legend of Zelda: Four Swords: Anniversary Edition (Europe, Australia) // Zelda no Densetsu: 4-tsu no Tsurugi: 25th Kinen Edition (Japan) else if (strncmp(romTid, "KQ9", 3) == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200F860, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F860, dsiSaveGetResultCode, 0xC); *(u32*)0x02056644 = 0xE3A00003; // mov r0, #3 *(u32*)0x02056744 = 0xE3A00003; // mov r0, #3 setBL(0x02056B9C, (u32)dsiSaveCreate); @@ -8197,7 +8197,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Legendary Wars: T-Rex Rumble (USA) else if (strcmp(romTid, "KLDE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); setBL(0x0205DB2C, (u32)dsiSaveOpen); setBL(0x0205DBA8, (u32)dsiSaveCreate); setBL(0x0205DBE4, (u32)dsiSaveGetLength); @@ -8214,7 +8214,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Legendary Wars: T-Rex Rumble (Europe, Australia) else if (strcmp(romTid, "KLDV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C24C, dsiSaveGetResultCode, 0xC); setBL(0x0205DB90, (u32)dsiSaveOpen); setBL(0x0205DC0C, (u32)dsiSaveCreate); setBL(0x0205DC48, (u32)dsiSaveGetLength); @@ -8231,7 +8231,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // ARC Style: Jurassic War (Japan) else if (strcmp(romTid, "KLDJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201C1A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201C1A0, dsiSaveGetResultCode, 0xC); setBL(0x0205DCCC, (u32)dsiSaveOpen); setBL(0x0205DD48, (u32)dsiSaveCreate); setBL(0x0205DD84, (u32)dsiSaveGetLength); @@ -8378,7 +8378,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } if (saveOnFlashcard) { - tonccpy((u32*)0x020159F0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020159F0, dsiSaveGetResultCode, 0xC); setBL(0x0205DE18, (u32)dsiSaveOpen); setBL(0x0205DE70, (u32)dsiSaveRead); setBL(0x0205DF24, (u32)dsiSaveCreate); @@ -8564,8 +8564,8 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02019998, (u32)dsiSaveWrite); setBL(0x020199B4, (u32)dsiSaveClose); setBL(0x020199C8, (u32)dsiSaveClose); - tonccpy((u32*)0x020350D0, dsiSaveGetResultCode, 0xC); - tonccpy((u32*)0x02035C7C, dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)0x020350D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02035C7C, dsiSaveGetInfo, 0xC); }*/ } @@ -8646,7 +8646,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202A6FC, (u32)dsiSaveSeek); setBL(0x0202A710, (u32)dsiSaveWrite); setBL(0x0202A71C, (u32)dsiSaveClose); - tonccpy((u32*)0x02056468, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02056468, dsiSaveGetResultCode, 0xC); } } @@ -8672,7 +8672,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0202A834, (u32)dsiSaveSeek); setBL(0x0202A848, (u32)dsiSaveWrite); setBL(0x0202A854, (u32)dsiSaveClose); - tonccpy((u32*)0x020565A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020565A0, dsiSaveGetResultCode, 0xC); } } @@ -8756,7 +8756,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006EC0, (u32)dsiSaveSetLength); setBL(0x02006ED0, (u32)dsiSaveWrite); setBL(0x02006ED8, (u32)dsiSaveClose); - tonccpy((u32*)0x0203A10C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203A10C, dsiSaveGetResultCode, 0xC); } } @@ -8776,7 +8776,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020071C4, (u32)dsiSaveSetLength); setBL(0x020071D4, (u32)dsiSaveWrite); setBL(0x020071DC, (u32)dsiSaveClose); - tonccpy((u32*)0x0203A450, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203A450, dsiSaveGetResultCode, 0xC); } } @@ -8796,7 +8796,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006EE0, (u32)dsiSaveSetLength); setBL(0x02006EF4, (u32)dsiSaveWrite); setBL(0x02006EFC, (u32)dsiSaveClose); - tonccpy((u32*)0x0204A6DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204A6DC, dsiSaveGetResultCode, 0xC); } } @@ -8850,7 +8850,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020071E4, (u32)dsiSaveWrite); setBL(0x020071EC, (u32)dsiSaveClose); } - tonccpy((u32*)(0x0202FBD8+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202FBD8+offsetChangeInit), dsiSaveGetResultCode, 0xC); } } @@ -8870,7 +8870,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006F48, (u32)dsiSaveSetLength); setBL(0x02006F5C, (u32)dsiSaveWrite); setBL(0x02006F64, (u32)dsiSaveClose); - tonccpy((u32*)0x0204C8F8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204C8F8, dsiSaveGetResultCode, 0xC); } } @@ -8893,7 +8893,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006DA8+offsetChange, (u32)dsiSaveSetLength); setBL(0x02006DB8+offsetChange, (u32)dsiSaveWrite); setBL(0x02006DC0+offsetChange, (u32)dsiSaveClose); - tonccpy((u32*)(0x0202E080+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202E080+offsetChangeInit), dsiSaveGetResultCode, 0xC); } } @@ -8912,7 +8912,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006CF8, (u32)dsiSaveSetLength); setBL(0x02006D08, (u32)dsiSaveWrite); setBL(0x02006D10, (u32)dsiSaveClose); - tonccpy((u32*)0x0202E000, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E000, dsiSaveGetResultCode, 0xC); } } @@ -8935,7 +8935,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006D24+offsetChange, (u32)dsiSaveSetLength); setBL(0x02006D34+offsetChange, (u32)dsiSaveWrite); setBL(0x02006D3C+offsetChange, (u32)dsiSaveClose); - tonccpy((u32*)(0x0202D958+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202D958+offsetChangeInit), dsiSaveGetResultCode, 0xC); } } @@ -8954,7 +8954,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006C7C, (u32)dsiSaveSetLength); setBL(0x02006C8C, (u32)dsiSaveWrite); setBL(0x02006C94, (u32)dsiSaveClose); - tonccpy((u32*)0x0202D8C0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202D8C0, dsiSaveGetResultCode, 0xC); } } @@ -8977,7 +8977,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006D38+offsetChange, (u32)dsiSaveSetLength); setBL(0x02006D48+offsetChange, (u32)dsiSaveWrite); setBL(0x02006D50+offsetChange, (u32)dsiSaveClose); - tonccpy((u32*)(0x0202DD84+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202DD84+offsetChangeInit), dsiSaveGetResultCode, 0xC); } } @@ -8996,7 +8996,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006C90, (u32)dsiSaveSetLength); setBL(0x02006CA0, (u32)dsiSaveWrite); setBL(0x02006CA8, (u32)dsiSaveClose); - tonccpy((u32*)0x0202DD0C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202DD0C, dsiSaveGetResultCode, 0xC); } } @@ -9033,7 +9033,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } } u16 offsetChangeInit = (romTid[3] == 'T') ? 0 : 0x340; - tonccpy((u32*)(0x0202D7EC+offsetChangeInit), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0202D7EC+offsetChangeInit), dsiSaveGetResultCode, 0xC); } // Chotto Majikku Taizen: 3ttsu no Shaffuru Gemu (Japan) @@ -9052,7 +9052,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006EEC, (u32)dsiSaveSetLength); setBL(0x02006F00, (u32)dsiSaveWrite); setBL(0x02006F08, (u32)dsiSaveClose); - tonccpy((u32*)0x0204A448, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204A448, dsiSaveGetResultCode, 0xC); } } @@ -9084,7 +9084,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0202B0A4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200F91C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F91C, dsiSaveGetResultCode, 0xC); setBL(0x0202C75C, (u32)dsiSaveOpen); setBL(0x0202C774, (u32)dsiSaveSeek); setBL(0x0202C784, (u32)dsiSaveWrite); @@ -9388,7 +9388,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0207F584, 0x0207F5C4); *(u32*)0x0207F5E8 = 0xE3A00001; // mov r0, #1 *(u32*)0x0207F654 = 0xE3A00001; // mov r0, #1 - tonccpy((u32*)0x02094EAC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02094EAC, dsiSaveGetResultCode, 0xC); } // Monster Buster Club (Europe) @@ -9416,13 +9416,13 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0207F4A0, 0x0207F4E0); *(u32*)0x0207F504 = 0xE3A00001; // mov r0, #1 *(u32*)0x0207F584 = 0xE3A00001; // mov r0, #1 - tonccpy((u32*)0x02094DE0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02094DE0, dsiSaveGetResultCode, 0xC); } // Motto Me de Unou o Kitaeru: DS Sokudoku Jutsu Light (Japan) else if (strcmp(romTid, "K9SJ") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x0200F3A8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F3A8, dsiSaveGetResultCode, 0xC); setBL(0x02047350, (u32)dsiSaveOpen); setBL(0x0204739C, (u32)dsiSaveCreate); setBL(0x020473D0, (u32)dsiSaveGetLength); @@ -9452,7 +9452,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02005B34, (u32)dsiSaveSetLength); setBL(0x02005B54, (u32)dsiSaveWrite); setBL(0x02005B6C, (u32)dsiSaveClose); - tonccpy((u32*)0x02026748, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02026748, dsiSaveGetResultCode, 0xC); } // Mr. Driller: Drill Till You Drop (USA) @@ -9814,7 +9814,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Farm (USA) else if (strcmp(romTid, "KMRE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); setBL(0x0207A09C, (u32)dsiSaveCreate); setBL(0x0207A118, (u32)dsiSaveOpen); setBL(0x0207A164, (u32)dsiSaveSetLength); @@ -9832,7 +9832,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Farm (Europe, Australia) else if (strcmp(romTid, "KMRV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02012608, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012608, dsiSaveGetResultCode, 0xC); setBL(0x02079FA0, (u32)dsiSaveCreate); setBL(0x0207A01C, (u32)dsiSaveOpen); setBL(0x0207A068, (u32)dsiSaveSetLength); @@ -9851,7 +9851,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Asian Farm (USA) // My Australian Farm (USA) else if ((strcmp(romTid, "KL3E") == 0 || strcmp(romTid, "KL4E") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); setBL(0x02077428, (u32)dsiSaveCreate); setBL(0x020774A4, (u32)dsiSaveOpen); setBL(0x020774F0, (u32)dsiSaveSetLength); @@ -9870,7 +9870,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Asian Farm (Europe) // My Australian Farm (Europe) else if ((strcmp(romTid, "KL3P") == 0 || strcmp(romTid, "KL4P") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201270C, dsiSaveGetResultCode, 0xC); setBL(0x02077474, (u32)dsiSaveCreate); setBL(0x020774F0, (u32)dsiSaveOpen); setBL(0x0207753C, (u32)dsiSaveSetLength); @@ -9888,7 +9888,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Exotic Farm (USA) else if (strcmp(romTid, "KMVE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); setBL(0x0207A0A4, (u32)dsiSaveCreate); setBL(0x0207A120, (u32)dsiSaveOpen); setBL(0x0207A16C, (u32)dsiSaveSetLength); @@ -9906,7 +9906,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // My Exotic Farm (Europe, Australia) else if (strcmp(romTid, "KMVV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020126DC, dsiSaveGetResultCode, 0xC); setBL(0x0207A07C, (u32)dsiSaveCreate); setBL(0x0207A0F8, (u32)dsiSaveOpen); setBL(0x0207A144, (u32)dsiSaveSetLength); @@ -10055,34 +10055,34 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strncmp(romTid, "KNP", 3) == 0 && saveOnFlashcard) { /*const u32 dsiSaveCreateT = 0x0201D090; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x0201D0A0; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x0201D0B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0201D0C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x0201D0D0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x0201D0E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0201D0F0; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC);*/ + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC);*/ - //tonccpy((u32*)0x0201C5A8, dsiSaveGetResultCode, 0xC); - //tonccpy((u32*)0x0201D178, dsiSaveSetLength, 0xC); + //__aeabi_memcpy((u32*)0x0201C5A8, dsiSaveGetResultCode, 0xC); + //__aeabi_memcpy((u32*)0x0201D178, dsiSaveSetLength, 0xC); *(u16*)0x020EBFC4 = 0x4770; // bx lr /*setBLThumb(0x020EBFDC, dsiSaveOpenT); setBLThumb(0x020EBFEA, dsiSaveCloseT); @@ -10152,7 +10152,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009848+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02009B44+offsetChange) = 0xE3A00000; // mov r0, #0 *(u32*)(0x02009B48+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x02042CC0 : 0x02042F3C), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x02042CC0 : 0x02042F3C), dsiSaveGetResultCode, 0xC); } // G.G Series: Ninja Karakuri Den (Japan) @@ -10179,7 +10179,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020075FC, (u32)dsiSaveClose); *(u32*)0x020078F8 = 0xE3A00000; // mov r0, #0 *(u32*)0x020078FC = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02040E88, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040E88, dsiSaveGetResultCode, 0xC); } // G.G Series: Ninja Karakuri Den 2 (Japan) @@ -10205,7 +10205,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02008B00, (u32)dsiSaveClose); *(u32*)0x02008DFC = 0xE3A00000; // mov r0, #0 *(u32*)0x02008E00 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041F70, dsiSaveGetResultCode, 0xC); } // Nintendo Countdown Calendar (USA) @@ -10220,7 +10220,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02012F50, (u32)dsiSaveOpen); setBL(0x02012F64, (u32)dsiSaveSetLength); setBL(0x02012FAC, (u32)dsiSaveClose); - tonccpy((u32*)0x02086F2C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02086F2C, dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x0205C1B4 = 0xE1A00000; // nop @@ -10239,7 +10239,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02012FAC, (u32)dsiSaveOpen); setBL(0x02012FC0, (u32)dsiSaveSetLength); setBL(0x02013008, (u32)dsiSaveClose); - tonccpy((u32*)0x02087164, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02087164, dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x0205C3EC = 0xE1A00000; // nop @@ -10258,7 +10258,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201597C, (u32)dsiSaveOpen); setBL(0x02015990, (u32)dsiSaveSetLength); setBL(0x020159D8, (u32)dsiSaveClose); - tonccpy((u32*)0x0207F9E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0207F9E8, dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x020597A4 = 0xE1A00000; // nop @@ -10274,7 +10274,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (memcmp(addr+i, "pit.bin", 8) == 0) { const char* textReplace = "tip.bin"; - tonccpy(addr+i, textReplace, sizeof(textReplace)); + __aeabi_memcpy(addr+i, textReplace, sizeof(textReplace)); break; } } @@ -10341,7 +10341,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { } if (saveOnFlashcard) { u8 offsetChange = (strncmp(romTid, "KJI", 3) == 0) ? 0 : 4; - tonccpy((u32*)0x0200CC94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200CC94, dsiSaveGetResultCode, 0xC); setBL(0x02030DAC+offsetChange, (u32)dsiSaveOpen); setBL(0x02030DF0+offsetChange, (u32)dsiSaveGetLength); setBL(0x02030E00+offsetChange, (u32)dsiSaveRead); @@ -10500,7 +10500,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0202E35C = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200FF04, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200FF04, dsiSaveGetResultCode, 0xC); setBL(0x020352B0, (u32)dsiSaveOpen); setBL(0x020352D4, (u32)dsiSaveGetLength); setBL(0x020352E4, (u32)dsiSaveRead); @@ -10524,7 +10524,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Othello (Japan) else if (strcmp(romTid, "KOLJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200BF94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF94, dsiSaveGetResultCode, 0xC); setBL(0x02038B98, (u32)dsiSaveGetInfo); setBL(0x02038C0C, (u32)dsiSaveGetInfo); setBL(0x02038C70, (u32)dsiSaveCreate); @@ -10715,7 +10715,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Paul's Monster Adventure (USA) else if (strcmp(romTid, "KP9E") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x020143AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020143AC, dsiSaveGetResultCode, 0xC); setBL(0x02047940, (u32)dsiSaveOpen); setBL(0x02047958, (u32)dsiSaveCreate); setBL(0x02047970, (u32)dsiSaveOpen); @@ -10736,7 +10736,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Aru to Harapeko Monsuta (Japan) else if (strcmp(romTid, "KP9J") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02014318, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02014318, dsiSaveGetResultCode, 0xC); setBL(0x020475B8, (u32)dsiSaveOpen); setBL(0x020475D8, (u32)dsiSaveWrite); setBL(0x020475E8, (u32)dsiSaveClose); @@ -10755,7 +10755,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Paul's Shooting Adventure (USA) else if (strcmp(romTid, "KPJE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02010B18, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010B18, dsiSaveGetResultCode, 0xC); // *(u32*)0x0203A20C = 0xE12FFF1E; // bx lr setBL(0x02048524, (u32)dsiSaveOpen); setBL(0x0204853C, (u32)dsiSaveCreate); @@ -10777,7 +10777,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Adventure Kid: Poru no Bouken (Japan) else if (strcmp(romTid, "KPJJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02010AF8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010AF8, dsiSaveGetResultCode, 0xC); setBL(0x02037328, (u32)dsiSaveOpen); setBL(0x02037340, (u32)dsiSaveCreate); setBL(0x02037358, (u32)dsiSaveOpen); @@ -10798,7 +10798,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Paul's Shooting Adventure 2 (USA) else if (strcmp(romTid, "KUSE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); setBL(0x0202EE44, (u32)dsiSaveOpen); setBL(0x0202EE5C, (u32)dsiSaveCreate); // dsiSaveCreateAuto setBL(0x0202EE74, (u32)dsiSaveOpen); @@ -10820,7 +10820,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Adventure Kid 2: Poru no Dai Bouken (Japan) else if (strcmp(romTid, "KUSJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016B8C, dsiSaveGetResultCode, 0xC); setBL(0x02030C88, (u32)dsiSaveOpen); setBL(0x02030CA0, (u32)dsiSaveCreate); // dsiSaveCreateAuto setBL(0x02030CB8, (u32)dsiSaveOpen); @@ -10896,31 +10896,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KP5E") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020A721C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x020A722C; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x020A723C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020A724C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020A725C; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020A726C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020A727C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x0203810A, dsiSaveOpenT); setBLThumb(0x02038152, dsiSaveCloseT); @@ -10930,38 +10930,38 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x020381D4, dsiSaveReadT); setBLThumb(0x020381F6, dsiSaveSeekT); setBLThumb(0x0203820C, dsiSaveWriteT); - tonccpy((u32*)0x020A67EC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020A67EC, dsiSaveGetResultCode, 0xC); } // Petz Cat: Superstar (Europe, Australia) else if (strcmp(romTid, "KP5V") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020A7264; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveGetInfoT = 0x020A7274; *(u16*)dsiSaveGetInfoT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetInfoT + 4), dsiSaveGetInfo, 0xC); const u32 dsiSaveOpenT = 0x020A7284; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020A7294; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020A72A4; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020A72B4; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020A72C4; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x02038172, dsiSaveOpenT); setBLThumb(0x020381BA, dsiSaveCloseT); @@ -10971,7 +10971,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0203823C, dsiSaveReadT); setBLThumb(0x0203825E, dsiSaveSeekT); setBLThumb(0x02038274, dsiSaveWriteT); - tonccpy((u32*)0x020A6834, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020A6834, dsiSaveGetResultCode, 0xC); } // GO Series: Picdun (USA) @@ -10987,7 +10987,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200B288, (u32)dsiSaveClose); setBL(0x0200B2B0, (u32)dsiSaveWrite); setBL(0x0200B2BC, (u32)dsiSaveClose); - tonccpy((u32*)0x02064E50, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02064E50, dsiSaveGetResultCode, 0xC); } // Danjo RPG: Picudan (Japan) @@ -11003,7 +11003,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200A14C, (u32)dsiSaveClose); setBL(0x0200A174, (u32)dsiSaveWrite); setBL(0x0200A180, (u32)dsiSaveClose); - tonccpy((u32*)0x020627B8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020627B8, dsiSaveGetResultCode, 0xC); } // Art Style: PiCTOBiTS (USA) @@ -11062,8 +11062,8 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Change help button (No blank file found to hide it) //const char* lp0 = "1p.dt0"; - //tonccpy((char*)0x0211281E, lp0, strlen(lp0)+1); - //tonccpy((char*)0x02112844, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211281E, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x02112844, lp0, strlen(lp0)+1); } } @@ -11091,8 +11091,8 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Change help button (No blank file found to hide it) //const char* lp0 = "t_1p.dt0"; - //tonccpy((char*)0x0211ABC6, lp0, strlen(lp0)+1); - //tonccpy((char*)0x0211ABF0, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211ABC6, lp0, strlen(lp0)+1); + //__aeabi_memcpy((char*)0x0211ABF0, lp0, strlen(lp0)+1); } } @@ -11266,7 +11266,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020993C8 = 0xE1A00000; // nop (dsiSaveCreateDirAuto) setBL(0x020993D4, (u32)dsiSaveCreate); // *(u32*)0x020C2F94 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020F8B24, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020F8B24, dsiSaveGetResultCode, 0xC); } // Plants vs. Zombies (Europe, Australia) @@ -11282,13 +11282,13 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02099C34 = 0xE1A00000; // nop (dsiSaveCreateDirAuto) setBL(0x02099C40, (u32)dsiSaveCreate); // *(u32*)0x020C41F8 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020FA794, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020FA794, dsiSaveGetResultCode, 0xC); } // PlayLearn Chinese (USA) // PlayLearn Spanish (USA) else if ((strcmp(romTid, "KFXE") == 0 || strcmp(romTid, "KFQE") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x02014C94, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02014C94, dsiSaveGetResultCode, 0xC); setBL(0x0202CAA4, (u32)dsiSaveCreate); setBL(0x0202CAC0, (u32)dsiSaveOpen); setBL(0x0202CAF0, (u32)dsiSaveWrite); @@ -11376,7 +11376,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200D1D0, (u32)dsiSaveGetInfo); *(u32*)0x0200D214 = 0xE3A00001; // mov r0, #1 (dsiSaveGetArcSrc & dsiSaveFreeSpaceAvailable) *(u32*)0x0200D218 = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] != 'J') ? 0x0204ED3C : 0x0204EBB0), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] != 'J') ? 0x0204ED3C : 0x0204EBB0), dsiSaveGetResultCode, 0xC); } if (!twlFontFound) { *(u32*)0x0200E004 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) @@ -11524,7 +11524,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201A184+offsetChange, (u32)dsiSaveOpen); setBL(0x0201A1A8+offsetChange, (u32)dsiSaveWrite); setBL(0x0201A1B0+offsetChange, (u32)dsiSaveClose); - tonccpy((u32*)(0x02037CA0+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x02037CA0+offsetChange), dsiSaveGetResultCode, 0xC); } } @@ -11543,7 +11543,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200D970, (u32)dsiSaveOpen); setBL(0x0200D990, (u32)dsiSaveWrite); setBL(0x0200D9A8, (u32)dsiSaveWrite); - tonccpy((u32*)0x02065618, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02065618, dsiSaveGetResultCode, 0xC); } // Pro-Putt Domo (USA) @@ -11551,31 +11551,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020270FC; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x0202710C; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x0202711C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x0202712C; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0202713C; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x0202714C; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0202715C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x020106BC = 0x2001; // movs r0, #1 *(u16*)0x020106BE = 0x4770; // bx lr @@ -11587,7 +11587,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x02010A58, dsiSaveWriteT); setBLThumb(0x02010A6A, dsiSaveCloseT); *(u16*)0x02010A90 = 0x4778; // bx pc - tonccpy((u32*)0x02010A90, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x02010A90, dsiSaveGetLength, 0xC); setBLThumb(0x02010AC0, dsiSaveOpenT); setBLThumb(0x02010AE6, dsiSaveCloseT); setBLThumb(0x02010AF8, dsiSaveReadT); @@ -11608,7 +11608,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { offsetChange += 0x500; } - tonccpy((u32*)0x02010CC4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02010CC4, dsiSaveGetResultCode, 0xC); setBL(0x0206F764+offsetChange, (u32)dsiSaveGetInfo); setBL(0x0206F778+offsetChange, (u32)dsiSaveOpen); setBL(0x0206F78C+offsetChange, (u32)dsiSaveCreate); @@ -11636,31 +11636,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { else if (strcmp(romTid, "KNUP") == 0 && saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02058F8C; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveSetLengthT = 0x02058F9C; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02058FAC; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02058FBC; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x02058FCC; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x02058FDC; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02058FEC; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x020086EE, dsiSaveOpenT); setBLThumb(0x0200870A, dsiSaveSeekT); @@ -11792,7 +11792,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x02015AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015AD4, dsiSaveGetResultCode, 0xC); setBL(0x02026984, (u32)dsiSaveOpen); setBL(0x020269CC, (u32)dsiSaveGetLength); setBL(0x02026A14, (u32)dsiSaveRead); @@ -11812,7 +11812,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x0201542C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201542C, dsiSaveGetResultCode, 0xC); setBL(0x0202663C, (u32)dsiSaveOpen); setBL(0x02026684, (u32)dsiSaveGetLength); setBL(0x020266CC, (u32)dsiSaveRead); @@ -11832,7 +11832,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020051BC = 0xE1A00000; // nop (Skip Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x02015AD0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015AD0, dsiSaveGetResultCode, 0xC); setBL(0x0202693C, (u32)dsiSaveOpen); setBL(0x02026984, (u32)dsiSaveGetLength); setBL(0x020269CC, (u32)dsiSaveRead); @@ -12075,27 +12075,27 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020119A0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020119B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020119C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020119D0; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020119E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020119F0; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x02026358, dsiSaveOpenT); setBLThumb(0x02026370, dsiSaveSeekT); @@ -12142,27 +12142,27 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x020119A4; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x020119B4; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x020119C4; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveSeekT = 0x020119D4; *(u16*)dsiSaveSeekT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSeekT + 4), dsiSaveSeek, 0xC); const u32 dsiSaveReadT = 0x020119E4; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020119F4; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); setBLThumb(0x02026338, dsiSaveOpenT); setBLThumb(0x0202634E, dsiSaveSeekT); @@ -12565,31 +12565,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02025C20; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02025C30; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02025C40; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02025C40; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02025C50; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x02025C60; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x02025C70; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x02010164 = 0x2001; // movs r0, #1 *(u16*)0x02010166 = 0x4770; // bx lr @@ -12601,7 +12601,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x02010508, dsiSaveWriteT); setBLThumb(0x0201051A, dsiSaveCloseT); *(u16*)0x02010540 = 0x4778; // bx pc - tonccpy((u32*)0x02010544, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x02010544, dsiSaveGetLength, 0xC); setBLThumb(0x02010570, dsiSaveOpenT); setBLThumb(0x02010596, dsiSaveCloseT); setBLThumb(0x020105A8, dsiSaveReadT); @@ -12617,7 +12617,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Roller Angels: Pashatto Dai Sakusen (Japan) else if ((strcmp(romTid, "KRLE") == 0 || strcmp(romTid, "KRLJ") == 0) && saveOnFlashcard) { u8 offsetChange = (romTid[3] == 'E') ? 0 : 4; - tonccpy((u32*)(0x020140E4+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x020140E4+offsetChange), dsiSaveGetResultCode, 0xC); if (romTid[3] == 'E') { *(u32*)0x0202E77C = 0xE1A00000; // nop *(u32*)0x0202E794 = 0xE1A00000; // nop @@ -12672,7 +12672,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0200EEB4, (u32)dsiSaveClose); setBL(0x0200EEDC, (u32)dsiSaveWrite); setBL(0x0200EEE8, (u32)dsiSaveClose); - tonccpy((u32*)0x0203D050, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0203D050, dsiSaveGetResultCode, 0xC); } // Saikyou Ginsei Shougi (Japan) @@ -12725,7 +12725,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020318B0-offsetChange2, (u32)dsiSaveOpen); setBL(0x020318D4-offsetChange2, (u32)dsiSaveWrite); setBL(0x020318DC-offsetChange2, (u32)dsiSaveClose); - tonccpy((u32*)(0x0204F520-offsetChange2), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0204F520-offsetChange2), dsiSaveGetResultCode, 0xC); } } @@ -13111,7 +13111,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020134F8, (u32)dsiSaveClose); setBL(0x02013520, (u32)dsiSaveWrite); setBL(0x0201352C, (u32)dsiSaveClose); - tonccpy((u32*)0x0205F0D0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205F0D0, dsiSaveGetResultCode, 0xC); } } @@ -13132,7 +13132,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020135A0, (u32)dsiSaveClose); setBL(0x020135C8, (u32)dsiSaveWrite); setBL(0x020135D4, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E620, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E620, dsiSaveGetResultCode, 0xC); } } @@ -13153,7 +13153,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02013688, (u32)dsiSaveClose); setBL(0x020136B0, (u32)dsiSaveWrite); setBL(0x020136BC, (u32)dsiSaveClose); - tonccpy((u32*)0x0205F574, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205F574, dsiSaveGetResultCode, 0xC); } } @@ -13344,7 +13344,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 newCodeAddr = 0x02010128; - tonccpy((u32*)0x0200F72C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F72C, dsiSaveGetResultCode, 0xC); codeCopy((u32*)newCodeAddr, (u32*)0x0201E594, 0xF0); setBL(newCodeAddr+0x34, (u32)dsiSaveOpen); setBL(newCodeAddr+0x58, (u32)dsiSaveGetLength); @@ -13374,7 +13374,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 newCodeAddr = 0x0201007C; - tonccpy((u32*)0x0200F680, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F680, dsiSaveGetResultCode, 0xC); codeCopy((u32*)newCodeAddr, (u32*)0x0201DD4C, 0xF0); setBL(newCodeAddr+0x34, (u32)dsiSaveOpen); setBL(newCodeAddr+0x58, (u32)dsiSaveGetLength); @@ -13545,7 +13545,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Sora Kake Girl: Shojo Shooting (Japan) else if (strcmp(romTid, "KU4J") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x0200C0BC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200C0BC, dsiSaveGetResultCode, 0xC); *(u32*)0x020492BC = 0xE1A00000; // nop (dsiSaveCreateDir) *(u32*)0x020492C4 = 0xE3A00008; // mov r0, #8 (Result code of dsiSaveCreateDir) *(u32*)0x020493A4 = 0xE3A00001; // mov r0, #1 (dsiSaveCreateDirAuto) @@ -13615,7 +13615,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x0201393C, (u32)dsiSaveSetLength); setBL(0x02013960, (u32)dsiSaveWrite); setBL(0x02013968, (u32)dsiSaveClose); - tonccpy((u32*)0x02068398, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02068398, dsiSaveGetResultCode, 0xC); } } @@ -13635,7 +13635,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02013948, (u32)dsiSaveSetLength); setBL(0x0201396C, (u32)dsiSaveWrite); setBL(0x02013974, (u32)dsiSaveClose); - tonccpy((u32*)0x020683A4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020683A4, dsiSaveGetResultCode, 0xC); } } @@ -13655,7 +13655,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02013EAC, (u32)dsiSaveSetLength); setBL(0x02013ECC, (u32)dsiSaveWrite); setBL(0x02013ED4, (u32)dsiSaveClose); - tonccpy((u32*)0x0206928C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0206928C, dsiSaveGetResultCode, 0xC); } } @@ -13665,7 +13665,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020050F4 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200E4E8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E4E8, dsiSaveGetResultCode, 0xC); setBL(0x020394A4, (u32)dsiSaveCreate); setBL(0x020394C0, (u32)dsiSaveOpen); setBL(0x020394D4, (u32)dsiSaveSetLength); @@ -13689,7 +13689,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x02005110 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200EA3C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200EA3C, dsiSaveGetResultCode, 0xC); setBL(0x0203A564, (u32)dsiSaveCreate); setBL(0x0203A580, (u32)dsiSaveOpen); setBL(0x0203A594, (u32)dsiSaveSetLength); @@ -13778,12 +13778,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Starship Defense (USA) // Starship Patrol (Europe, Australia) else if ((strcmp(romTid, "KDYE") == 0 || strcmp(romTid, "KDYV") == 0) && !dsiWramAccess) { - toncset16((u16*)0x020A76C4, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020A76C4, 0x4A, nopT); // Do not use DSi WRAM } // Starship Defender (Japan) else if (strcmp(romTid, "KDYJ") == 0 && !dsiWramAccess) { - toncset16((u16*)0x020A767C, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020A767C, 0x4A, nopT); // Do not use DSi WRAM } // SteamWorld Tower Defense (USA) @@ -13812,7 +13812,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020071A4, (u32)dsiSaveClose); setBL(0x020071E8, (u32)dsiSaveSeek); setBL(0x020071F8, (u32)dsiSaveWrite); - tonccpy((u32*)0x020DC3E0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020DC3E0, dsiSaveGetResultCode, 0xC); } */ // Successfully Learning: English, Year 2 (Europe) @@ -13987,7 +13987,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Sudoku & Kakuro: Welt Edition (Germany) else if (strcmp(romTid, "KWUD") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02012BDC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012BDC, dsiSaveGetResultCode, 0xC); setBL(0x0202680C, (u32)dsiSaveCreate); setBL(0x02026828, (u32)dsiSaveOpen); setBL(0x0202688C, (u32)dsiSaveWrite); @@ -14047,7 +14047,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020098B4+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02009BB0+offsetChange) = 0xE3A00000; // mov r0, #0 *(u32*)(0x02009BB4+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x02043A00 : 0x02043A18), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x02043A00 : 0x02043A18), dsiSaveGetResultCode, 0xC); } // G.G Series: Super Hero Ogre (Japan) @@ -14073,7 +14073,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007658, (u32)dsiSaveClose); *(u32*)0x02007954 = 0xE3A00000; // mov r0, #0 *(u32*)0x02007958 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02041610, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02041610, dsiSaveGetResultCode, 0xC); } // G.G Series: Super Hero Ogre 2 (Japan) @@ -14099,7 +14099,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02008BD4, (u32)dsiSaveClose); *(u32*)0x02008ED0 = 0xE3A00000; // mov r0, #0 *(u32*)0x02008ED4 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02042FB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042FB4, dsiSaveGetResultCode, 0xC); } // Super Swap (USA) @@ -14177,7 +14177,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(newCode+0x6C, (u32)dsiSaveRead); setBL(newCode+0x9C, (u32)dsiSaveClose); - tonccpy((u32*)0x02017AD4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02017AD4, dsiSaveGetResultCode, 0xC); *(u32*)(0x02062B34+offsetChange) = 0xE3A00003; // mov r0, #3 setBL(0x02062B58+offsetChange, newCode); *(u32*)(0x02062BE4+offsetChange) = 0xE3A00003; // mov r0, #3 @@ -14198,35 +14198,35 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveGetResultCodeT = 0x0201AB18; *(u16*)dsiSaveGetResultCodeT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetResultCodeT + 4), dsiSaveGetResultCode, 0xC); const u32 dsiSaveCreateT = 0x0201B1A0; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveOpenT = 0x0201B1B0; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x0201B1C0; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveGetLengthT = 0x0201B1D0; *(u16*)dsiSaveGetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveGetLengthT + 4), dsiSaveGetLength, 0xC); const u32 dsiSaveSetLengthT = 0x0201B2F4; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveReadT = 0x0201B1E0; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x0201B49C; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x02006EB2 = 0x2000; // movs r0, #0 (dsiSaveGetArcSrc) *(u16*)0x02006EB4 = nopT; @@ -14365,7 +14365,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02006294, (u32)dsiSaveSeek); setBL(0x020062A4, (u32)dsiSaveWrite); setBL(0x020062C0, (u32)dsiSaveClose); - tonccpy((u32*)0x0202E118, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E118, dsiSaveGetResultCode, 0xC); } // Tantei Jinguuji Saburou: Akenaiyoru ni (Japan) @@ -14393,11 +14393,11 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020062F4, (u32)dsiSaveWrite); setBL(0x02006310, (u32)dsiSaveClose); if (strncmp(romTid, "KJA", 3) == 0) { - tonccpy((u32*)0x0202E130, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E130, dsiSaveGetResultCode, 0xC); } else if (strncmp(romTid, "KJ7", 3) != 0) { - tonccpy((u32*)0x0202E148, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E148, dsiSaveGetResultCode, 0xC); } else { - tonccpy((u32*)0x0202E1B0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0202E1B0, dsiSaveGetResultCode, 0xC); } } @@ -14409,7 +14409,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0202B008 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200F968, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200F968, dsiSaveGetResultCode, 0xC); setBL(0x0202C6C0, (u32)dsiSaveOpen); setBL(0x0202C6D8, (u32)dsiSaveSeek); setBL(0x0202C6E8, (u32)dsiSaveWrite); @@ -14468,7 +14468,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Telegraph Sudoku & Kakuro (Europe) else if (strcmp(romTid, "KXLE") == 0 || strcmp(romTid, "KXLP") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x02012B6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012B6C, dsiSaveGetResultCode, 0xC); setBL(0x0202679C, (u32)dsiSaveCreate); setBL(0x020267B8, (u32)dsiSaveOpen); setBL(0x0202681C, (u32)dsiSaveWrite); @@ -14496,7 +14496,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Oshiete Darling (Japan) else if (strcmp(romTid, "KOSJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200BF6C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF6C, dsiSaveGetResultCode, 0xC); setBL(0x0201BA8C, (u32)dsiSaveCreate); setBL(0x0201BACC, (u32)dsiSaveOpen); setBL(0x0201BAFC, (u32)dsiSaveSetLength); @@ -14511,7 +14511,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Gareuchyeojwodalling (Korea) // ENG banner text: Tell me Darling else if (strcmp(romTid, "KOSK") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0200BF90, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200BF90, dsiSaveGetResultCode, 0xC); setBL(0x0201BB60, (u32)dsiSaveCreate); setBL(0x0201BBA0, (u32)dsiSaveOpen); setBL(0x0201BBD0, (u32)dsiSaveSetLength); @@ -14578,7 +14578,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Thorium Wars (USA) else if (strcmp(romTid, "KTWE") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x0200D680, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200D680, dsiSaveGetResultCode, 0xC); setBL(0x0207C824, (u32)dsiSaveCreate); setBL(0x0207C840, (u32)dsiSaveOpen); setBL(0x0207C854, (u32)dsiSaveSetLength); @@ -14602,7 +14602,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Thorium Wars (Europe) else if (strcmp(romTid, "KTWP") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x020111C8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020111C8, dsiSaveGetResultCode, 0xC); setBL(0x02084A78, (u32)dsiSaveCreate); setBL(0x02084A94, (u32)dsiSaveOpen); setBL(0x02084AA8, (u32)dsiSaveSetLength); @@ -14646,7 +14646,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007FF8, (u32)dsiSaveClose); *(u32*)0x020082F4 = 0xE3A00000; // mov r0, #0 *(u32*)0x020082F8 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x0204211C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0204211C, dsiSaveGetResultCode, 0xC); } // Topoloco (USA) @@ -14684,7 +14684,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { u8 offsetChange = (romTid[2] == 'W') ? 0 : 0x48; u8 offsetChangeS = (romTid[2] == 'W') ? 0 : 0x60; - tonccpy((u32*)(0x0200C3C8+offsetChange), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)(0x0200C3C8+offsetChange), dsiSaveGetResultCode, 0xC); setBL(0x0201C5B4+offsetChangeS, (u32)dsiSaveOpen); setBL(0x0201C5E4+offsetChangeS, (u32)dsiSaveGetPosition); setBL(0x0201C5F8+offsetChangeS, (u32)dsiSaveWrite); @@ -14702,12 +14702,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Trajectile (USA) // Reflect Missile (Europe, Australia) else if ((strcmp(romTid, "KDZE") == 0 || strcmp(romTid, "KDZV") == 0) && !dsiWramAccess) { - toncset16((u16*)0x020B9298, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020B9298, 0x4A, nopT); // Do not use DSi WRAM } // Reflect Missile (Japan) else if (strcmp(romTid, "KDZJ") == 0 && !dsiWramAccess) { - toncset16((u16*)0x020B8F88, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020B8F88, 0x4A, nopT); // Do not use DSi WRAM } // Trollboarder (USA) @@ -14855,7 +14855,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02020FE8, (u32)dsiSaveSetLength); setBL(0x02020FF8, (u32)dsiSaveWrite); setBL(0x02021028, (u32)dsiSaveClose); - tonccpy((u32*)0x02039874, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02039874, dsiSaveGetResultCode, 0xC); } */ } @@ -14882,7 +14882,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020075D8, (u32)dsiSaveClose); *(u32*)0x020078D4 = 0xE3A00000; // mov r0, #0 *(u32*)0x020078D8 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02040CB8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02040CB8, dsiSaveGetResultCode, 0xC); } // WarioWare: Touched! DL (USA, Australia) @@ -14980,7 +14980,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0205C000 = 0xE3A00000; // mov r0, #0 (Skip Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x0201B634, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201B634, dsiSaveGetResultCode, 0xC); setBL(0x0209C1B0, (u32)dsiSaveCreate); setBL(0x0209C1C0, (u32)dsiSaveOpen); setBL(0x0209C1E8, (u32)dsiSaveSetLength); @@ -14998,7 +14998,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x0205B314 = 0xE3A00000; // mov r0, #0 (Skip Manual screen) } if (saveOnFlashcard) { - tonccpy((u32*)0x0201AD00, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201AD00, dsiSaveGetResultCode, 0xC); setBL(0x0209B120, (u32)dsiSaveCreate); setBL(0x0209B130, (u32)dsiSaveOpen); setBL(0x0209B158, (u32)dsiSaveSetLength); @@ -15029,7 +15029,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Whack-A-Friend (USA) else if (strcmp(romTid, "KWQE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); for (int i = 0; i < 8; i++) { u32* offset = (u32*)0x02040E3C; offset[i] = 0xE1A00000; @@ -15056,7 +15056,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Pashatto Bashitto: Whack a Friend (Japan) else if (strcmp(romTid, "KWQJ") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02015134, dsiSaveGetResultCode, 0xC); for (int i = 0; i < 8; i++) { u32* offset = (u32*)0x02026A50; offset[i] = 0xE1A00000; @@ -15086,31 +15086,31 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { if (saveOnFlashcard) { const u32 dsiSaveCreateT = 0x02023258; *(u16*)dsiSaveCreateT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCreateT + 4), dsiSaveCreate, 0xC); const u32 dsiSaveDeleteT = 0x02023268; *(u16*)dsiSaveDeleteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); + __aeabi_memcpy((u32*)(dsiSaveDeleteT + 4), dsiSaveDelete, 0xC); const u32 dsiSaveSetLengthT = 0x02023278; *(u16*)dsiSaveSetLengthT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); + __aeabi_memcpy((u32*)(dsiSaveSetLengthT + 4), dsiSaveSetLength, 0xC); const u32 dsiSaveOpenT = 0x02023288; *(u16*)dsiSaveOpenT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); + __aeabi_memcpy((u32*)(dsiSaveOpenT + 4), dsiSaveOpen, 0xC); const u32 dsiSaveCloseT = 0x02023298; *(u16*)dsiSaveCloseT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); + __aeabi_memcpy((u32*)(dsiSaveCloseT + 4), dsiSaveClose, 0xC); const u32 dsiSaveReadT = 0x020232A8; *(u16*)dsiSaveReadT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); + __aeabi_memcpy((u32*)(dsiSaveReadT + 4), dsiSaveRead, 0xC); const u32 dsiSaveWriteT = 0x020232B8; *(u16*)dsiSaveWriteT = 0x4778; // bx pc - tonccpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); + __aeabi_memcpy((u32*)(dsiSaveWriteT + 4), dsiSaveWrite, 0xC); *(u16*)0x0200C918 = 0x2001; // movs r0, #1 *(u16*)0x0200C91A = 0x4770; // bx lr @@ -15122,7 +15122,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBLThumb(0x0200CCB4, dsiSaveWriteT); setBLThumb(0x0200CCC6, dsiSaveCloseT); *(u16*)0x0200CCEC = 0x4778; // bx pc - tonccpy((u32*)0x0200CCF0, dsiSaveGetLength, 0xC); + __aeabi_memcpy((u32*)0x0200CCF0, dsiSaveGetLength, 0xC); setBLThumb(0x0200CD1C, dsiSaveOpenT); setBLThumb(0x0200CD42, dsiSaveCloseT); setBLThumb(0x0200CD54, dsiSaveReadT); @@ -15157,7 +15157,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x020098BC, (u32)dsiSaveClose); *(u32*)0x02009BB8 = 0xE3A00000; // mov r0, #0 *(u32*)0x02009BBC = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02042EC0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042EC0, dsiSaveGetResultCode, 0xC); } // Wonderful Sports: Bowling (Japan) @@ -15322,7 +15322,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Working Dawgs: A-maze-ing Pipes (USA) else if (strcmp(romTid, "KYWE") == 0) { if (saveOnFlashcard) { - tonccpy((u32*)0x0200E6A0, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E6A0, dsiSaveGetResultCode, 0xC); setBL(0x02031D38, (u32)dsiSaveCreate); setBL(0x02031D54, (u32)dsiSaveOpen); setBL(0x02031D68, (u32)dsiSaveSetLength); @@ -15349,7 +15349,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020055A0 = 0xE1A00000; // nop (Disable NFTR loading from TWLNAND) } if (saveOnFlashcard) { - tonccpy((u32*)0x0200E8E4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0200E8E4, dsiSaveGetResultCode, 0xC); setBL(0x02031FDC, (u32)dsiSaveCreate); setBL(0x02031FF8, (u32)dsiSaveOpen); setBL(0x0203200C, (u32)dsiSaveSetLength); @@ -15371,7 +15371,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // 3D Space Tank (Europe, Australia) // X-Returns (Japan) else if (strncmp(romTid, "KDX", 3) == 0 && !dsiWramAccess) { - toncset16((u16*)0x020B12A0, nopT, 0x4A/sizeof(u16)); // Do not use DSi WRAM + __aeabi_memset((u16*)0x020B12A0, 0x4A, nopT); // Do not use DSi WRAM // Speed up file loading by 0.5 seconds // *(u16*)0x020B13D0 = 0x2001; // movs r0, #1 @@ -15380,7 +15380,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Yummy Yummy Cooking Jam (USA) else if (strcmp(romTid, "KYUE") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x0201DA10, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0201DA10, dsiSaveGetResultCode, 0xC); setBL(0x02069A78, (u32)dsiSaveOpen); setBL(0x02069AB4, (u32)dsiSaveRead); setBL(0x02069ACC, (u32)dsiSaveRead); @@ -15395,7 +15395,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Yummy Yummy Cooking Jam (Europe, Australia) else if (strcmp(romTid, "KYUV") == 0 && saveOnFlashcard) { - tonccpy((u32*)0x02019DE4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02019DE4, dsiSaveGetResultCode, 0xC); setBL(0x02065E1C, (u32)dsiSaveOpen); setBL(0x02065E58, (u32)dsiSaveRead); setBL(0x02065E70, (u32)dsiSaveRead); @@ -15434,7 +15434,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02009900+offsetChange, (u32)dsiSaveClose); *(u32*)(0x02009BFC+offsetChange) = 0xE3A00000; // mov r0, #0 *(u32*)(0x02009C00+offsetChange) = 0xE12FFF1E; // bx lr - tonccpy((u32*)((romTid[3] == 'E') ? 0x02043684 : 0x02043620), dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)((romTid[3] == 'E') ? 0x02043684 : 0x02043620), dsiSaveGetResultCode, 0xC); } // G.G Series: Z-One (Japan) @@ -15460,7 +15460,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02007674, (u32)dsiSaveClose); *(u32*)0x02007970 = 0xE3A00000; // mov r0, #0 *(u32*)0x02007974 = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x020414AC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x020414AC, dsiSaveGetResultCode, 0xC); } // G.G Series: Z-One 2 (Japan) @@ -15486,7 +15486,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02008BAC, (u32)dsiSaveClose); *(u32*)0x02008EA8 = 0xE3A00000; // mov r0, #0 *(u32*)0x02008EAC = 0xE12FFF1E; // bx lr - tonccpy((u32*)0x02042888, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02042888, dsiSaveGetResultCode, 0xC); } // Za Curosu (Japan) @@ -15531,7 +15531,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { // Zimo: Mahjong Fanatic (USA) // Zimo: Mahjong Puzzle (Japan) else if ((strcmp(romTid, "KKHE") == 0 || strcmp(romTid, "KKHJ") == 0) && saveOnFlashcard) { - tonccpy((u32*)0x02012F58, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02012F58, dsiSaveGetResultCode, 0xC); if (romTid[3] == 'E') { setBL(0x02026BC8, (u32)dsiSaveOpen); setBL(0x02026BE0, (u32)dsiSaveCreate); // dsiSaveCreateAuto @@ -15676,7 +15676,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { setBL(0x02014280, (u32)dsiSaveClose); *(u32*)0x020142B8 = 0xE1A00000; // nop (dsiSaveCreateDirAuto) setBL(0x020142C4, (u32)dsiSaveCreate); - tonccpy((u32*)0x02016E10, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02016E10, dsiSaveGetResultCode, 0xC); // *(u32*)0x020815F8 = 0xE12FFF1E; // bx lr } #endif @@ -16053,38 +16053,38 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params else if (strcmp(romTid, "CTXE") == 0) { extern u32 baseChipID; u32 cardIdFunc[2] = {0, 0}; - tonccpy(cardIdFunc, ce9->thumbPatches->card_id_arm9, 0x4); + __aeabi_memcpy(cardIdFunc, ce9->thumbPatches->card_id_arm9, 0x4); cardIdFunc[1] = baseChipID; const u16* branchCode1 = generateA7InstrThumb(0x020BA666, 0x020BA670); - tonccpy((void*)0x020BA666, branchCode1, 0x4); + __aeabi_memcpy((void*)0x020BA666, branchCode1, 0x4); - tonccpy((void*)0x020BA670, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BA670, cardIdFunc, 0x8); const u16* branchCode2 = generateA7InstrThumb(0x020BA66A, 0x020BA6C0); - tonccpy((void*)0x020BA66A, branchCode2, 0x4); + __aeabi_memcpy((void*)0x020BA66A, branchCode2, 0x4); - tonccpy((void*)0x020BA728, ce9->thumbPatches->card_set_dma_arm9, 0xC); + __aeabi_memcpy((void*)0x020BA728, ce9->thumbPatches->card_set_dma_arm9, 0xC); const u16* branchCode3 = generateA7InstrThumb(0x020BA70C, 0x020BA728); - tonccpy((void*)0x020BA70C, branchCode3, 0x4); + __aeabi_memcpy((void*)0x020BA70C, branchCode3, 0x4); *(u16*)0x020BA710 = 0xBDF8; const u16* branchCode4 = generateA7InstrThumb(0x020BAAA2, 0x020BAAAC); - tonccpy((void*)0x020BAAA2, branchCode4, 0x4); + __aeabi_memcpy((void*)0x020BAAA2, branchCode4, 0x4); - tonccpy((void*)0x020BAAAC, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BAAAC, cardIdFunc, 0x8); const u16* branchCode5 = generateA7InstrThumb(0x020BAAA6, 0x020BAAFC); - tonccpy((void*)0x020BAAA6, branchCode5, 0x4); + __aeabi_memcpy((void*)0x020BAAA6, branchCode5, 0x4); const u16* branchCode6 = generateA7InstrThumb(0x020BAC5C, 0x020BAC64); - tonccpy((void*)0x020BAC5C, branchCode6, 0x4); + __aeabi_memcpy((void*)0x020BAC5C, branchCode6, 0x4); - tonccpy((void*)0x020BAC64, cardIdFunc, 0x8); + __aeabi_memcpy((void*)0x020BAC64, cardIdFunc, 0x8); const u16* branchCode7 = generateA7InstrThumb(0x020BAC60, 0x020BACB6); - tonccpy((void*)0x020BAC60, branchCode7, 0x4); + __aeabi_memcpy((void*)0x020BAC60, branchCode7, 0x4); } // DSiWare containing Cloneboot @@ -16283,7 +16283,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037594, (u32)dsiSaveClose); setBL(0x020376A8, (u32)dsiSaveRead); setBL(0x020376E4, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D0A8, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D0A8, dsiSaveGetResultCode, 0xC); } // A Little Bit of... All-Time Classics: Card Classics (Europe) @@ -16298,7 +16298,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037540, (u32)dsiSaveClose); setBL(0x02037654, (u32)dsiSaveRead); setBL(0x02037690, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D0FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D0FC, dsiSaveGetResultCode, 0xC); } // Chotto Asobi Taizen: Jikkuri Toranpu (Japan) @@ -16313,7 +16313,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02038750, (u32)dsiSaveClose); setBL(0x02038864, (u32)dsiSaveRead); setBL(0x020388A0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E154, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E154, dsiSaveGetResultCode, 0xC); } // Yixia Xia Ming Liu Daquan: Zhiyong Shuangquan (China) @@ -16328,7 +16328,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x020371AC, (u32)dsiSaveClose); setBL(0x020372BC, (u32)dsiSaveRead); setBL(0x020372F0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205C1FC, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205C1FC, dsiSaveGetResultCode, 0xC); } // Clubhouse Games Express: Card Classics (Korea) @@ -16343,7 +16343,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037044, (u32)dsiSaveClose); setBL(0x02037154, (u32)dsiSaveRead); setBL(0x02037188, (u32)dsiSaveClose); - tonccpy((u32*)0x0205EB40, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205EB40, dsiSaveGetResultCode, 0xC); } // Clubhouse Games Express: Family Favorites (USA, Australia) @@ -16358,7 +16358,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02038AD4, (u32)dsiSaveClose); setBL(0x02038BE8, (u32)dsiSaveRead); setBL(0x02038C24, (u32)dsiSaveClose); - tonccpy((u32*)0x02060D9C, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060D9C, dsiSaveGetResultCode, 0xC); } // A Little Bit of... All-Time Classics: Family Games (Europe) @@ -16373,7 +16373,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02038A94, (u32)dsiSaveClose); setBL(0x02038BA8, (u32)dsiSaveRead); setBL(0x02038BE4, (u32)dsiSaveClose); - tonccpy((u32*)0x02060CE4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060CE4, dsiSaveGetResultCode, 0xC); } // Chotto Asobi Taizen: Otegaru Toranpu (Japan) @@ -16388,7 +16388,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037970, (u32)dsiSaveClose); setBL(0x02037A84, (u32)dsiSaveRead); setBL(0x02037AC0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D388, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D388, dsiSaveGetResultCode, 0xC); } // Yixia Xia Ming Liu Daquan: Qingsong Xiuxian (China) @@ -16403,7 +16403,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x0203723C, (u32)dsiSaveClose); setBL(0x0203734C, (u32)dsiSaveRead); setBL(0x02037380, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E388, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E388, dsiSaveGetResultCode, 0xC); } // Clubhouse Games Express: Family Favorites (Korea) @@ -16418,7 +16418,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037A14, (u32)dsiSaveClose); setBL(0x02037B24, (u32)dsiSaveRead); setBL(0x02037B58, (u32)dsiSaveClose); - tonccpy((u32*)0x0205CB04, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205CB04, dsiSaveGetResultCode, 0xC); } // Clubhouse Games Express: Strategy Pack (USA, Australia) @@ -16433,7 +16433,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x020388D4, (u32)dsiSaveClose); setBL(0x020389E8, (u32)dsiSaveRead); setBL(0x02038A24, (u32)dsiSaveClose); - tonccpy((u32*)0x02060C24, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060C24, dsiSaveGetResultCode, 0xC); } // A Little Bit of... All-Time Classics: Strategy Games (Europe) @@ -16448,7 +16448,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02038888, (u32)dsiSaveClose); setBL(0x0203899C, (u32)dsiSaveRead); setBL(0x020389D8, (u32)dsiSaveClose); - tonccpy((u32*)0x02060B60, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02060B60, dsiSaveGetResultCode, 0xC); } // Chotto Asobi Taizen: Onajimi Teburu (Japan) @@ -16463,7 +16463,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02037B48, (u32)dsiSaveClose); setBL(0x02037C5C, (u32)dsiSaveRead); setBL(0x02037C98, (u32)dsiSaveClose); - tonccpy((u32*)0x0205D744, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205D744, dsiSaveGetResultCode, 0xC); } // Yixia Xia Ming Liu Daquan: Jingdian Zhongwen (China) @@ -16478,7 +16478,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x020370CC, (u32)dsiSaveClose); setBL(0x020371DC, (u32)dsiSaveRead); setBL(0x02037210, (u32)dsiSaveClose); - tonccpy((u32*)0x0205C078, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205C078, dsiSaveGetResultCode, 0xC); } // Clubhouse Games Express: Strategy Pack (Korea) @@ -16493,7 +16493,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x0203707C, (u32)dsiSaveClose); setBL(0x0203718C, (u32)dsiSaveRead); setBL(0x020371C0, (u32)dsiSaveClose); - tonccpy((u32*)0x0205E270, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205E270, dsiSaveGetResultCode, 0xC); } // Globulos Party (USA) @@ -16513,7 +16513,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02041054, (u32)dsiSaveWrite); setBL(0x02041070, (u32)dsiSaveClose); setBL(0x0204108C, (u32)dsiSaveClose); - tonccpy((u32*)0x0205AEB4, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x0205AEB4, dsiSaveGetResultCode, 0xC); } // Punito 20 no Asobiba (Japan) @@ -16532,7 +16532,7 @@ void patchBinary(cardengineArm9* ce9, const tNDSHeader* ndsHeader, module_params setBL(0x02040B4C, (u32)dsiSaveWrite); setBL(0x02040B68, (u32)dsiSaveClose); setBL(0x02040B84, (u32)dsiSaveClose); - tonccpy((u32*)0x02058E14, dsiSaveGetResultCode, 0xC); + __aeabi_memcpy((u32*)0x02058E14, dsiSaveGetResultCode, 0xC); } // Hearts Spades Euchre (USA) @@ -16671,8 +16671,8 @@ void bannerSavPatch(const tNDSHeader* ndsHeader) { // Brain Age Express: Sudoku (USA) else if (strcmp(romTid, "KN9E") == 0) { - //toncset((char*)0x020925A0, 0, 0xE); - //tonccpy((char*)0x020925A0, newBannerPath, 8); + //__aeabi_memclr((char*)0x020925A0, 0xE); + //__aeabi_memcpy((char*)0x020925A0, newBannerPath, 8); *(u32*)0x0201178C = 0xE3A00001; // mov r0, #1 } diff --git a/retail/bootloaderi/source/arm7/save_patches/save_patch_universal.c b/retail/bootloaderi/source/arm7/save_patches/save_patch_universal.c index f2f072039..a6a5c3e6f 100644 --- a/retail/bootloaderi/source/arm7/save_patches/save_patch_universal.c +++ b/retail/bootloaderi/source/arm7/save_patches/save_patch_universal.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 newArm7binarySize; extern u32 vAddrOfRelocSrc; @@ -235,7 +235,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n"); - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)((u32)EepromWriteJump + 0x6); dbg_printf("Eeprom page write branch:\t"); @@ -245,7 +245,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n"); - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); //newSwiHaltAddr = (u32)eepromPageWrite+0x14; u16* eepromPageProgBranch = (u16*)((u32)EepromProgJump + 0x6); @@ -256,7 +256,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n"); - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)((u32)EepromVerifyJump + 0x6); dbg_printf("Eeprom verify branch:\t"); @@ -266,7 +266,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n"); - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)((u32)EepromEraseJump + 0x4); dbg_printf("Eeprom page erase branch:\t"); @@ -276,7 +276,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n"); - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { u32* eepromRead = (u32*)((u32)EepromReadJump + 0xA); dbg_printf("Eeprom read:\t"); diff --git a/retail/bootloaderi/source/arm7/save_patches/save_patch_v5.c b/retail/bootloaderi/source/arm7/save_patches/save_patch_v5.c index 71c6f7f4a..ca92d4656 100644 --- a/retail/bootloaderi/source/arm7/save_patches/save_patch_v5.c +++ b/retail/bootloaderi/source/arm7/save_patches/save_patch_v5.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 newArm7binarySize; extern u32 vAddrOfRelocSrc; @@ -82,7 +82,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n"); - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)(JumpTableFunc + 0x16); dbg_printf("Eeprom page write branch:\t"); @@ -92,7 +92,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n"); - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); //newSwiHaltAddr = (u32)eepromPageWrite+0x14; u16* eepromPageProgBranch = (u16*)(JumpTableFunc + 0x24); @@ -103,7 +103,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n"); - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)(JumpTableFunc + 0x32); dbg_printf("Eeprom verify branch:\t"); @@ -113,7 +113,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n"); - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)(JumpTableFunc + 0x3E); dbg_printf("Eeprom page erase branch:\t"); @@ -123,7 +123,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n"); - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { if (*(u32*)(JumpTableFunc - 0x24) == 0xEBFFFFB3) { u32* cardId = (u32*) (JumpTableFunc - 0x24); diff --git a/retail/bootloaderi/source/arm9/clear_cache.arm9.s b/retail/bootloaderi/source/arm9/clear_cache.arm9.s index a10dc573b..34ea60a47 100644 --- a/retail/bootloaderi/source/arm9/clear_cache.arm9.s +++ b/retail/bootloaderi/source/arm9/clear_cache.arm9.s @@ -17,7 +17,7 @@ @ Clears ICache and Dcache, and resets the protection units @ Originally written by Darkain, modified by Chishm -#include "../../include/asminc.h" +#include "asminc.h" .arm diff --git a/retail/bootloaderi2/Makefile b/retail/bootloaderi2/Makefile index 47763a2a2..736aeae62 100644 --- a/retail/bootloaderi2/Makefile +++ b/retail/bootloaderi2/Makefile @@ -39,7 +39,7 @@ CFLAGS := -g -Wall -O2\ CFLAGS += $(INCLUDE) -DARM7 -std=gnu99 -DTWOCARD -DLOADERTWO -ASFLAGS := -g $(ARCH) +ASFLAGS := -g $(ARCH) $(INCLUDE) LDFLAGS = -nostartfiles -T $(TOPDIR)/load.ld -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(TARGET).map LIBS := -lnds7 diff --git a/retail/cardengine/arm7/Makefile b/retail/cardengine/arm7/Makefile index 41574dc95..3b72a0acc 100644 --- a/retail/cardengine/arm7/Makefile +++ b/retail/cardengine/arm7/Makefile @@ -24,7 +24,7 @@ DATA := data #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb -mthumb-interwork -march=armv4t +ARCH := -mthumb -march=armv4t CFLAGS := -g -Wall -Oz\ -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ diff --git a/retail/cardengine/arm7/source/cardengine.c b/retail/cardengine/arm7/source/cardengine.c index 6e27a6a15..37577f5ee 100644 --- a/retail/cardengine/arm7/source/cardengine.c +++ b/retail/cardengine/arm7/source/cardengine.c @@ -35,7 +35,7 @@ #include "unpatched_funcs.h" #include "cardengine.h" #include "nds_header.h" -#include "tonccpy.h" +#include "aeabi.h" #define RUMBLE_PAK (*(vuint16 *)0x08000000) #define WARIOWARE_PAK (*(vuint16 *)0x080000C4) @@ -83,8 +83,10 @@ static bool volumeAdjustActivated = false;*/ bool ipcEveryFrame = false; static bool swapScreens = false; +#ifdef MUSIC int RumbleTimer = 0; int RumbleForce = 1; +#endif //static int cardEgnineCommandMutex = 0; //static int saveMutex = 0; @@ -147,8 +149,8 @@ static void initialize(void) { } if (!bootloaderCleared) { - toncset((u32*)0x02377000, 0, 0x1000); - toncset((u8*)0x06000000, 0, 0x40000); // Clear bootloader + __aeabi_memclr((u32*)0x02377000, 0x1000); + __aeabi_memclr((u8*)0x06000000, 0x40000); // Clear bootloader if (mainScreen) { swapScreens = (mainScreen == 2); ipcEveryFrame = true; @@ -161,6 +163,7 @@ static void initialize(void) { extern void inGameMenu(void); +#ifdef MUSIC void Rumble(int Frames) { if ((RumblePakType == 0) || (RumbleForce == 0)) return; @@ -192,6 +195,7 @@ void DoRumble() { RumbleTimer = 0; } } +#endif void rebootConsole(void) { if (*(vu16*)0x4004700 != 0) { @@ -212,7 +216,7 @@ void reset(void) { REG_IME = 0; - toncset32((u32*)0x04000400, 0, 0x104/4); // Clear sound channel & control registers + __aeabi_memclr((u32*)0x04000400, 0x104); // Clear sound channel & control registers REG_SNDCAP0CNT = 0; REG_SNDCAP1CNT = 0; @@ -222,8 +226,8 @@ void reset(void) { REG_SNDCAP1DAD = 0; REG_SNDCAP1LEN = 0; - toncset16((u32*)0x040000B0, 0, 0x40/2); // Clear DMA channels - toncset16((u32*)0x04000100, 0, 0x10/2); // Clear timers + __aeabi_memclr((u32*)0x040000B0, 0x40); // Clear DMA channels + __aeabi_memclr((u32*)0x04000100, 0x10); // Clear timers // Clear out FIFO REG_IPC_SYNC = 0; @@ -370,7 +374,6 @@ void myIrqHandlerVBlank(void) { if (musicBufferNo == 2) musicBufferNo = 0; } } -#endif if (sharedAddr[3] == 0x424D5552) { // 'RUMB' RumbleForce = sharedAddr[1]; @@ -385,6 +388,7 @@ void myIrqHandlerVBlank(void) { } else { DoRumble(); } +#endif if (sharedAddr[3] == (vu32)0x52534554) { reset(); diff --git a/retail/cardengine/arm7/source/inGameMenu.c b/retail/cardengine/arm7/source/inGameMenu.c index 91bc896a8..0bf1ff9ff 100644 --- a/retail/cardengine/arm7/source/inGameMenu.c +++ b/retail/cardengine/arm7/source/inGameMenu.c @@ -9,7 +9,7 @@ #include "locations.h" #include "cardengine.h" #include "nds_header.h" -#include "tonccpy.h" +#include "aeabi.h" #define sleepMode BIT(17) @@ -129,7 +129,7 @@ void inGameMenu(void) { u32* src = (u32*)((u32)sharedAddr[1]); for (int i = 0; i < 0xC0/8; i++) { if ((u32)src >= 0x8000) { - tonccpy(dst, src, 8); + __aeabi_memcpy(dst, src, 8); } else { biosRead(dst, src, 8); } @@ -141,7 +141,7 @@ void inGameMenu(void) { break; case 0x574D4152: // RAMW if (sharedAddr[1]+sharedAddr[2] >= 0x8000) { - tonccpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); + __aeabi_memcpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); } break; case 0x4554494C: // LITE diff --git a/retail/cardengine/arm7_music/Makefile b/retail/cardengine/arm7_music/Makefile index e313e4716..3b2fa134a 100644 --- a/retail/cardengine/arm7_music/Makefile +++ b/retail/cardengine/arm7_music/Makefile @@ -24,7 +24,7 @@ DATA := ../arm7/data #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -mthumb -mthumb-interwork -march=armv4t +ARCH := -mthumb -march=armv4t CFLAGS := -g -Wall -Oz\ -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ diff --git a/retail/cardengine/arm9/source/cardengine.c b/retail/cardengine/arm9/source/cardengine.c index 7ee7efd18..24baf599f 100644 --- a/retail/cardengine/arm9/source/cardengine.c +++ b/retail/cardengine/arm9/source/cardengine.c @@ -58,7 +58,7 @@ #define cardReadFix BIT(8) #define softResetMb BIT(13) -#include "tonccpy.h" +#include "aeabi.h" #include "card.h" #include "my_fat.h" @@ -213,7 +213,7 @@ void reset(u32 param) { REG_IE = 0; REG_IF = ~0; - //toncset((u32*)0x01FF8000, 0, 0x8000); + //__aeabi_memclr((u32*)0x01FF8000, 0x8000); cacheFlush(); @@ -243,8 +243,8 @@ void reset(u32 param) { mpuSet = false; IPC_SYNC_hooked = false; - toncset((char*)((ce9->valueBits & isSdk5) ? 0x02FFFD80 : 0x027FFD80), 0, 0x80); - toncset((char*)((ce9->valueBits & isSdk5) ? 0x02FFFF80 : 0x027FFF80), 0, 0x80); + __aeabi_memclr((char*)((ce9->valueBits & isSdk5) ? 0x02FFFD80 : 0x027FFD80), 0x80); + __aeabi_memclr((char*)((ce9->valueBits & isSdk5) ? 0x02FFFF80 : 0x027FFF80), 0x80); if (param == 0xFFFFFFFF || *(u32*)(resetParams+0xC) > 0) { resetMpu(); @@ -254,16 +254,16 @@ void reset(u32 param) { REG_DISPCNT_SUB = 0; GFX_STATUS = 0; - toncset((u16*)0x04000000, 0, 0x56); - toncset((u16*)0x04001000, 0, 0x56); + __aeabi_memclr((u16*)0x04000000, 0x56); + __aeabi_memclr((u16*)0x04001000, 0x56); *(vu32*)&VRAM_A_CR = 0x80808080; //ABCD *(vu16*)&VRAM_E_CR = 0x8080; //EF VRAM_G_CR = 0x80; //G *(vu16*)&VRAM_H_CR = 0x8080; //HI - toncset16(BG_PALETTE, 0, 512); // Clear main and sub palettes - toncset(VRAM, 0, 0xC0000); // Clear VRAM + __aeabi_memclr(BG_PALETTE, 512*sizeof(u16)); // Clear main and sub palettes + __aeabi_memclr(VRAM, 0xC0000); // Clear VRAM *(vu32*)&VRAM_A_CR = 0; //ABCD *(vu16*)&VRAM_E_CR = 0; //EF @@ -277,14 +277,14 @@ void reset(u32 param) { if (param == 0xFFFFFFFF) { *(u32*)(0x02000000) |= BIT(2); }*/ - //toncset((u32*)0x02000004, 0, 0x3DA000 - 4); - toncset((u32*)0x02000000, 0, 0x3C0000); + //__aeabi_memclr((u32*)0x02000004, 0x3DA000 - 4); + __aeabi_memclr((u32*)0x02000000, 0x3C0000); #ifdef NODSIWARE - toncset((u32*)0x023C4000, 0, 0x1C000); - toncset((u32*)0x02FE4000, 0, 0x19C00-0x4000); + __aeabi_memclr((u32*)0x023C4000, 0x1C000); + __aeabi_memclr((u32*)0x02FE4000, 0x19C00-0x4000); #else - toncset((u32*)0x023C4000, 0, 0x16800); - toncset((u32*)0x02FE4000, 0, 0x1D000-0x4000); + __aeabi_memclr((u32*)0x023C4000, 0x16800); + __aeabi_memclr((u32*)0x02FE4000, 0x1D000-0x4000); #endif if (param == 0xFFFFFFFF) { *(u32*)(0x02000000) = BIT(0) | BIT(1) | BIT(2); @@ -303,7 +303,7 @@ void reset(u32 param) { sharedAddr[1] = 0x57495344; } - toncset((u32*)0x02FFD000, 0, 0x2000); + __aeabi_memclr((u32*)0x02FFD000, 0x2000); } else { u32 newArm7binarySize = 0; fileRead((char*)&newArm7binarySize, &pageFile, 0x3FFFF4, sizeof(u32)); @@ -316,7 +316,7 @@ void reset(u32 param) { #endif #ifdef NODSIWARE - tonccpy((u32*)0x02370000, ce9, 0x2800); + __aeabi_memcpy((u32*)0x02370000, ce9, 0x2800); #endif resetMpu(); @@ -391,7 +391,7 @@ void readManual(int line) { } } - toncset((u8*)0x027FF200, ' ', 32 * 24); + __aeabi_memset((u8*)0x027FF200, 32 * 24, ' '); ((vu8*)0x027FF200)[32 * 24] = '\0'; // Read in 24 lines @@ -410,7 +410,7 @@ void readManual(int line) { if(buffer[i] == '\n') tempManualOffset++; fullLine = i == 32; - tonccpy((char*)0x027FF200 + line * 32, buffer, i); + __aeabi_memcpy((char*)0x027FF200 + line * 32, buffer, i); break; } } @@ -741,13 +741,13 @@ void cardRead(u32* cacheStruct, u8* dst0, u32 src0, u32 len0) { if (ce9->valueBits & ROMinRAM) { if (src >= 0 && src < 0x160) { u32 newSrc = (u32)ndsHeader+src; - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); } else { u32 newSrc = ce9->romLocation+src; if (ndsHeader->unitCode == 3 && src >= arm9iromOffset) { newSrc -= arm9ibinarySize; } - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); } } else { cardReadNormal(dst, src, len); @@ -775,7 +775,7 @@ bool nandWrite(void* memory,void* flash,u32 len,u32 dma) { #ifndef NODSIWARE void ndmaCopy(int ndmaSlot, const void* src, void* dst, u32 len) { - tonccpy(dst, src, len); + __aeabi_memcpy(dst, src, len); } static bool sharedFontOpened = false; @@ -906,7 +906,7 @@ bool dsiSaveDelete(const char* path) { } bool dsiSaveGetInfo(const char* path, dsiSaveInfo* info) { - toncset(info, 0, sizeof(dsiSaveInfo)); + __aeabi_memclr(info, sizeof(dsiSaveInfo)); if (savFile.firstCluster == CLUSTER_FREE || savFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; return false; @@ -932,7 +932,7 @@ u32 dsiSaveSetLength(void* ctx, s32 len) { dsiSaveSeekPos = 0; if (savFile.firstCluster == CLUSTER_FREE || savFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return 1; } @@ -948,7 +948,7 @@ u32 dsiSaveSetLength(void* ctx, s32 len) { setDeviceOwner(); bool res = fileWrite((char*)&dsiSaveSize, &savFile, ce9->saveSize-4, 4); dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); cardReadInProgress = false; REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); @@ -961,23 +961,23 @@ bool dsiSaveOpen(void* ctx, const char* path, u32 mode) { if (strcmp(path, "nand:/") == 0) { if (sharedFontFile.firstCluster == CLUSTER_FREE || sharedFontFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); sharedFontOpened = true; return true; } if (savFile.firstCluster == CLUSTER_FREE || savFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveInit(); dsiSaveResultCode = dsiSaveExists ? 0 : 0xB; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); dsiSavePerms = mode; return dsiSaveExists; @@ -989,21 +989,21 @@ bool dsiSaveClose(void* ctx) { sharedFontOpened = false; if (sharedFontFile.firstCluster == CLUSTER_FREE || sharedFontFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; } if (savFile.firstCluster == CLUSTER_FREE || savFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } - //toncset(ctx, 0, 0x80); + //__aeabi_memset(ctx, 0, 0x80); dsiSaveResultCode = dsiSaveExists ? 0 : 0xB; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return dsiSaveExists; } @@ -1032,22 +1032,22 @@ bool dsiSaveSeek(void* ctx, s32 pos, u32 mode) { } dsiSaveSeekPos = pos; dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; } if (savFile.firstCluster == CLUSTER_FREE || savFile.firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } if (!dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveSeekPos = pos; dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; } @@ -1055,13 +1055,13 @@ s32 dsiSaveRead(void* ctx, void* dst, s32 len) { if (!sharedFontOpened) { if (dsiSavePerms == 2 || !dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return -1; // Return if only write perms are set } if (dsiSaveSize == 0) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return 0; } @@ -1071,7 +1071,7 @@ s32 dsiSaveRead(void* ctx, void* dst, s32 len) { if (len == 0) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return 0; } } @@ -1091,7 +1091,7 @@ s32 dsiSaveRead(void* ctx, void* dst, s32 len) { if (!res) { break; } - tonccpy((char*)dst+dstAdd, (char*)0x027FF200, readLen); + __aeabi_memcpy((char*)dst+dstAdd, (char*)0x027FF200, readLen); bufLen -= 0x600; dstAdd += 0x600; @@ -1104,7 +1104,7 @@ s32 dsiSaveRead(void* ctx, void* dst, s32 len) { res = fileRead(dst, sharedFontOpened ? &sharedFontFile : &savFile, dsiSaveSeekPos, len); } dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); cardReadInProgress = false; REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); @@ -1118,7 +1118,7 @@ s32 dsiSaveRead(void* ctx, void* dst, s32 len) { s32 dsiSaveWrite(void* ctx, void* src, s32 len) { if (dsiSavePerms == 1 || !dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return -1; // Return if only read perms are set } @@ -1142,7 +1142,7 @@ s32 dsiSaveWrite(void* ctx, void* src, s32 len) { while (1) { u32 readLen = (bufLen > 0x600) ? 0x600 : len; - tonccpy((char*)0x027FF200, (char*)src+srcAdd, readLen); + __aeabi_memcpy((char*)0x027FF200, (char*)src+srcAdd, readLen); res = fileWrite((char*)0x027FF200, &savFile, dsiSaveSeekPos+srcAdd, readLen); if (!res) { break; @@ -1159,7 +1159,7 @@ s32 dsiSaveWrite(void* ctx, void* src, s32 len) { res = fileWrite(src, &savFile, dsiSaveSeekPos, len); } dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); cardReadInProgress = false; REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); diff --git a/retail/cardengine/arm9/source/dldi_patcher.c b/retail/cardengine/arm9/source/dldi_patcher.c index 5ed3ba242..74a71f1d7 100644 --- a/retail/cardengine/arm9/source/dldi_patcher.c +++ b/retail/cardengine/arm9/source/dldi_patcher.c @@ -23,7 +23,7 @@ #include #include #include "dldi_patcher.h" -#include "tonccpy.h" +#include "aeabi.h" #define FIX_ALL 0x01 #define FIX_GLUE 0x02 @@ -151,7 +151,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { // Remember how much space is actually reserved pDH[DO_allocatedSpace] = pAH[DO_allocatedSpace]; // Copy the DLDI patch into the application - tonccpy (pAH, pDH, dldiFileSize); + __aeabi_memcpy (pAH, pDH, dldiFileSize); // Fix the section pointers in the header writeAddr (pAH, DO_text_start, readAddr (pAH, DO_text_start) + relocationOffset); @@ -171,7 +171,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { writeAddr (pAH, DO_shutdown, readAddr (pAH, DO_shutdown) + relocationOffset); // Put the correct DLDI magic string back into the DLDI header - tonccpy (pAH, dldiMagicString, sizeof (dldiMagicString)); + __aeabi_memcpy (pAH, dldiMagicString, sizeof (dldiMagicString)); if (pDH[DO_fixSections] & FIX_ALL) { // Search through and fix pointers within the data section of the file @@ -202,7 +202,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { if (pDH[DO_fixSections] & FIX_BSS) { // Initialise the BSS to 0 - toncset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); + __aeabi_memclr (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart], readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); } return true; diff --git a/retail/cardenginei/arm7/source/cardengine.c b/retail/cardenginei/arm7/source/cardengine.c index 377ce4a87..fce56699e 100644 --- a/retail/cardenginei/arm7/source/cardengine.c +++ b/retail/cardenginei/arm7/source/cardengine.c @@ -31,7 +31,7 @@ #include #include "ndma.h" -#include "tonccpy.h" +#include "aeabi.h" #include "my_sdmmc.h" #include "my_fat.h" #include "locations.h" @@ -210,14 +210,14 @@ u32 currentSrlAddr = 0; void i2cIRQHandler(void); static void unlaunchSetFilename(bool boot) { - tonccpy((u8*)0x02000800, unlaunchAutoLoadID, 12); + __aeabi_memcpy((u8*)0x02000800, unlaunchAutoLoadID, 12); *(u16*)(0x0200080C) = 0x3F0; // Unlaunch Length for CRC16 (fixed, must be 3F0h) *(u16*)(0x0200080E) = 0; // Unlaunch CRC16 (empty) *(u32*)(0x02000810) = (BIT(0) | BIT(1)); // Load the title at 2000838h // Use colors 2000814h *(u16*)(0x02000814) = 0x7FFF; // Unlaunch Upper screen BG color (0..7FFFh) *(u16*)(0x02000816) = 0x7FFF; // Unlaunch Lower screen BG color (0..7FFFh) - toncset((u8*)0x02000818, 0, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) + __aeabi_memclr((u8*)0x02000818, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) int i2 = 0; if (boot) { for (int i = 0; i < (int)sizeof(bootNdsPath); i++) { @@ -240,14 +240,14 @@ static void unlaunchSetFilename(bool boot) { static void unlaunchSetHiyaFilename(void) { if (!(valueBits & hiyaCfwFound)) return; - tonccpy((u8*)0x02000800, unlaunchAutoLoadID, 12); + __aeabi_memcpy((u8*)0x02000800, unlaunchAutoLoadID, 12); *(u16*)(0x0200080C) = 0x3F0; // Unlaunch Length for CRC16 (fixed, must be 3F0h) *(u16*)(0x0200080E) = 0; // Unlaunch CRC16 (empty) *(u32*)(0x02000810) = (BIT(0) | BIT(1)); // Load the title at 2000838h // Use colors 2000814h *(u16*)(0x02000814) = 0x7FFF; // Unlaunch Upper screen BG color (0..7FFFh) *(u16*)(0x02000816) = 0x7FFF; // Unlaunch Lower screen BG color (0..7FFFh) - toncset((u8*)0x02000818, 0, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) + __aeabi_memclr((u8*)0x02000818, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) int i2 = 0; for (int i = 0; i < (int)sizeof(hiyaDSiPath); i++) { *(u8*)(0x02000838+i2) = hiyaDSiPath[i]; // Unlaunch Device:/Path/Filename.ext (16bit Unicode,end by 0000h) @@ -381,7 +381,7 @@ static void initialize(void) { } if (!bootloaderCleared) { - toncset((u8*)0x06000000, 0, 0x40000); // Clear bootloader + __aeabi_memclr((u8*)0x06000000, 0x40000); // Clear bootloader if (mainScreen) { swapScreens = (mainScreen == 2); ipcEveryFrame = true; @@ -430,9 +430,9 @@ static void cardReadRAM(u8* dst, u32 src, u32 len/*, int romPartNo*/) { if (src > *(u32*)0x02FFE1C0) { newSrc -= *(u32*)0x02FFE1CC; } - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); #else - // tonccpy(dst, (u8*)romLocation/*[romPartNo]*/+src, len); + // __aeabi_memcpy(dst, (u8*)romLocation/*[romPartNo]*/+src, len); u32 len2 = 0; for (int i = 0; i < romMapLines; i++) { if (!(src >= romMap[i][0] && (i == romMapLines-1 || src < romMap[i+1][0]))) @@ -444,11 +444,11 @@ static void cardReadRAM(u8* dst, u32 src, u32 len/*, int romPartNo*/) { len--; len2++; } while (newSrc+len != romMap[i][2]); - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); src += len; dst += len; } else { - tonccpy(dst, (u8*)newSrc, len2==0 ? len : len2); + __aeabi_memcpy(dst, (u8*)newSrc, len2==0 ? len : len2); break; } } @@ -470,14 +470,14 @@ void reset(void) { fileWrite((char*)0x022C0000, &pageFile, 0x2C0000, ndsHeader->arm7binarySize); } fileWrite((char*)resetParam, &srParamsFile, 0, 0x10); - toncset((u32*)0x02000000, 0, 0x400); + __aeabi_memclr((u32*)0x02000000, 0x400); *(u32*)0x02000000 = BIT(3); *(u32*)0x02000004 = 0x54455352; // 'RSET' if (consoleModel < 2) { (*(u32*)(ce7+0x11900) == 0 && (valueBits & b_dsiSD)) ? unlaunchSetFilename(false) : unlaunchSetHiyaFilename(); } if (*(u32*)(ce7+0x11900) == 0 && (valueBits & b_dsiSD)) { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x20); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x20); } else { // Use different SR backend ID readSrBackendId(); @@ -549,7 +549,7 @@ void reset(void) { if (*(u32*)(resetParam+8) == 0x44414F4C) { ndmaCopyWordsAsynch(1, (u32*)0x022C0000, ndsHeader->arm7destination, ndsHeader->arm7binarySize); *((u16*)(/*isSdk5(moduleParams) ? 0x02fffc40 :*/ 0x027ffc40)) = 2; // Boot Indicator (Cloneboot/Multiboot) - // tonccpy((u32*)0x027FFC40, (u32*)0x02344820, 0x40); // Multiboot info? + // __aeabi_memcpy((u32*)0x027FFC40, (u32*)0x02344820, 0x40); // Multiboot info? } else if (valueBits & ROMinRAM) { cardReadRAM((u8*)ndsHeader, currentSrlAddr, 0x160); cardReadRAM((u8*)ndsHeader->arm9destination, currentSrlAddr+ndsHeader->arm9romOffset, ndsHeader->arm9binarySize); @@ -605,9 +605,9 @@ void reset(void) { while (ndmaBusy(0) || ndmaBusy(1)); } */ if (valueBits & isDlp) { - toncset((u32*)0x022C0000, 0, ndsHeader->arm7binarySize); + __aeabi_memclr((u32*)0x022C0000, ndsHeader->arm7binarySize); if (!(valueBits & isSdk5)) { - tonccpy((u8*)0x027FF000, (u8*)0x02FFF000, 0x1000); + __aeabi_memcpy((u8*)0x027FF000, (u8*)0x02FFF000, 0x1000); } } else { *(u32*)(resetParam+8) = 0; @@ -652,8 +652,8 @@ void reset(void) { } //if (doBak) restoreSdBakData(); #endif - toncset((char*)((valueBits & isSdk5) ? 0x02FFFD80 : 0x027FFD80), 0, 0x80); - toncset((char*)((valueBits & isSdk5) ? 0x02FFFF80 : 0x027FFF80), 0, 0x80); + __aeabi_memclr((char*)((valueBits & isSdk5) ? 0x02FFFD80 : 0x027FFD80), 0x80); + __aeabi_memclr((char*)((valueBits & isSdk5) ? 0x02FFFF80 : 0x027FFF80), 0x80); sharedAddr[0] = 0x44414F4C; // 'LOAD' @@ -745,7 +745,7 @@ static void cardReadLED(bool on, bool dmaLed) { extern void inGameMenu(void); void forceGameReboot(void) { - toncset((u32*)0x02000000, 0, 0x400); + __aeabi_memclr((u32*)0x02000000, 0x400); *(u32*)0x02000000 = BIT(3); *(u32*)0x02000004 = 0x54455352; // 'RSET' sharedAddr[4] = 0x57534352; @@ -774,7 +774,7 @@ void forceGameReboot(void) { if (*(u32*)(ce7+0x11900) == 0 && (valueBits & b_dsiSD)) #endif { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x20); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x20); } else { // Use different SR backend ID readSrBackendId(); @@ -801,20 +801,20 @@ extern bool dldiPatchBinary (unsigned char *binData, u32 binSize); #endif void returnToLoader(bool reboot) { - toncset((u32*)0x02000000, 0, 0x400); + __aeabi_memclr((u32*)0x02000000, 0x400); *(u32*)0x02000000 = BIT(0) | BIT(1) | BIT(2); *(u32*)0x02000004 = 0x54455352; // 'RSET' sharedAddr[4] = 0x57534352; #ifdef TWLSDK u32 twlCfgLoc = *(u32*)0x02FFFDFC; if (twlCfgLoc != 0x02000400) { - tonccpy((u8*)0x02000400, (u8*)twlCfgLoc, 0x128); + __aeabi_memcpy((u8*)0x02000400, (u8*)twlCfgLoc, 0x128); } if (reboot || !(valueBits & dsiBios) || ((valueBits & twlTouch) && !(*(u8*)0x02FFE1BF & BIT(0))) || ((valueBits & b_dsiSD) && (valueBits & wideCheatUsed))) { if (consoleModel >= 2) { if (*(u32*)(ce7+0x8500) == 0) { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x020); } else if (*(char*)(ce7+0x8503) == 'H' || *(char*)(ce7+0x8503) == 'K') { // Use different SR backend ID readSrBackendId(); @@ -924,7 +924,7 @@ void returnToLoader(bool reboot) { if (consoleModel >= 2) { if (*(u32*)(ce7+0x11900) == 0 && (valueBits & b_dsiSD)) { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x020); } else if (*(char*)(ce7+0x11903) == 'H' || *(char*)(ce7+0x11903) == 'K') { @@ -1063,7 +1063,7 @@ void readManual(int line) { } } - toncset((u8*)INGAME_MENU_EXT_LOCATION, ' ', 32 * 24); + __aeabi_memset((u8*)INGAME_MENU_EXT_LOCATION, 32 * 24, ' '); ((vu8*)INGAME_MENU_EXT_LOCATION)[32 * 24] = '\0'; // Read in 24 lines @@ -1082,7 +1082,7 @@ void readManual(int line) { if(buffer[i] == '\n') tempManualOffset++; fullLine = i == 32; - tonccpy((char*)INGAME_MENU_EXT_LOCATION + line * 32, buffer, i); + __aeabi_memcpy((char*)INGAME_MENU_EXT_LOCATION + line * 32, buffer, i); break; } } @@ -1602,7 +1602,7 @@ void myIrqHandlerVBlank(void) { #ifndef TWLSDK if (!(valueBits & gameOnFlashcard) && !(valueBits & ROMinRAM) && isSdEjected()) { - tonccpy((u32*)0x02000300, sr_data_error, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_error, 0x020); i2cWriteRegister(0x4A, 0x70, 0x01); i2cWriteRegister(0x4A, 0x11, 0x01); // Reboot into error screen if SD card is removed } @@ -1932,9 +1932,10 @@ bool eepromRead(u32 src, void *dst, u32 len) { #endif //driveInitialize(); /*if (saveInRam) { - tonccpy(dst, (char*)0x02440000 + src, len); + __aeabi_memcpy(dst, (char*)0x02440000 + src, len); } else {*/ sdmmc_set_ndma_slot(4); + #ifndef TWLSDK if ((u32)(src % saveSize)+len > saveSize) { u32 len2 = len; u32 len3 = 0; @@ -1944,9 +1945,9 @@ bool eepromRead(u32 src, void *dst, u32 len) { } fileRead(dst, savFile, (src % saveSize), len2); fileRead(dst+len2, savFile, ((src+len2) % saveSize), len3); - } else { - fileRead(dst, savFile, (src % saveSize), len); - } + } else + #endif + { fileRead(dst, savFile, (src % saveSize), len); } sdmmc_set_ndma_slot(0); //} #ifdef TWLSDK @@ -1983,9 +1984,10 @@ bool eepromPageWrite(u32 dst, const void *src, u32 len) { saveTimer = 1; //i2cWriteRegister(0x4A, 0x12, 0x01); // When we're saving, power button does nothing, in order to prevent corruption. /*if (saveInRam) { - tonccpy((char*)0x02440000 + dst, src, len); + __aeabi_memcpy((char*)0x02440000 + dst, src, len); }*/ sdmmc_set_ndma_slot(4); + #ifndef TWLSDK if ((dst % saveSize)+len > saveSize) { u32 len2 = len; u32 len3 = 0; @@ -1995,9 +1997,9 @@ bool eepromPageWrite(u32 dst, const void *src, u32 len) { } fileWrite(src, savFile, (dst % saveSize), len2); fileWrite(src+len2, savFile, ((dst+len2) % saveSize), len3); - } else { - fileWrite(src, savFile, (dst % saveSize), len); - } + } else + #endif + { fileWrite(src, savFile, (dst % saveSize), len); } sdmmc_set_ndma_slot(0); #ifdef TWLSDK //if (doBak) restoreSdBakData(); @@ -2033,9 +2035,10 @@ bool eepromPageProg(u32 dst, const void *src, u32 len) { saveTimer = 1; //i2cWriteRegister(0x4A, 0x12, 0x01); // When we're saving, power button does nothing, in order to prevent corruption. /*if (saveInRam) { - tonccpy((char*)0x02440000 + dst, src, len); + __aeabi_memcpy((char*)0x02440000 + dst, src, len); }*/ sdmmc_set_ndma_slot(4); + #ifndef TWLSDK if ((dst % saveSize)+len > saveSize) { u32 len2 = len; u32 len3 = 0; @@ -2045,9 +2048,9 @@ bool eepromPageProg(u32 dst, const void *src, u32 len) { } fileWrite(src, savFile, (dst % saveSize), len2); fileWrite(src+len2, savFile, ((dst+len2) % saveSize), len3); - } else { - fileWrite(src, savFile, (dst % saveSize), len); - } + } else + #endif + { fileWrite(src, savFile, (dst % saveSize), len); } sdmmc_set_ndma_slot(0); #ifdef TWLSDK //if (doBak) restoreSdBakData(); diff --git a/retail/cardenginei/arm7/source/inGameMenu.c b/retail/cardenginei/arm7/source/inGameMenu.c index 768b76004..5ce4ac16f 100644 --- a/retail/cardenginei/arm7/source/inGameMenu.c +++ b/retail/cardenginei/arm7/source/inGameMenu.c @@ -11,7 +11,7 @@ #include "locations.h" #include "cardengine.h" #include "nds_header.h" -#include "tonccpy.h" +#include "aeabi.h" #define sleepMode BIT(17) @@ -176,7 +176,7 @@ void inGameMenu(void) { u32* src = (u32*)((u32)sharedAddr[1]); for (int i = 0; i < 0xC0/8; i++) { if ((u32)src >= 0x8000) { - tonccpy(dst, src, 8); + __aeabi_memcpy(dst, src, 8); } else { biosRead(dst, src, 8); } @@ -188,7 +188,7 @@ void inGameMenu(void) { break; case 0x574D4152: // RAMW if (sharedAddr[1]+sharedAddr[2] >= 0x8000) { - tonccpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); + __aeabi_memcpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); } break; case 0x4554494C: // LITE diff --git a/retail/cardenginei/arm7/source/patcher/decompress.c b/retail/cardenginei/arm7/source/patcher/decompress.c index 231f216c1..d1b321e6d 100644 --- a/retail/cardenginei/arm7/source/patcher/decompress.c +++ b/retail/cardenginei/arm7/source/patcher/decompress.c @@ -21,7 +21,6 @@ //#include "debug_file.h" #include "locations.h" #include "ndma.h" -#include "tonccpy.h" u32 iUncompressedSize = 0; static u32 iFixedAddr = 0; diff --git a/retail/cardenginei/arm7/source/patcher/patch_arm7.c b/retail/cardenginei/arm7/source/patcher/patch_arm7.c index d14e3c512..8854aec13 100644 --- a/retail/cardenginei/arm7/source/patcher/patch_arm7.c +++ b/retail/cardenginei/arm7/source/patcher/patch_arm7.c @@ -7,7 +7,7 @@ #include "common.h" //#include "value_bits.h" #include "locations.h" -#include "tonccpy.h" +#include "aeabi.h" #include "cardengine_header_arm7.h" //#include "debug_file.h" @@ -76,19 +76,19 @@ static void fixForDifferentBios(const cardengineArm7* ce7, const tNDSHeader* nds if (swi12Offset) { // Patch to call swi 0x02 instead of 0x12 u32* swi12Patch = ce7->patches->swi02; - tonccpy(swi12Offset, swi12Patch, 0x4); + __aeabi_memcpy(swi12Offset, swi12Patch, 0x4); } // swi get pitch table if (swiGetPitchTableOffset) { // Patch if (useGetPitchTableBranch) { - tonccpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTableThumb, 0x40); + __aeabi_memcpy(swiGetPitchTableOffset, ce7->patches->j_twlGetPitchTableThumb, 0x40); } else if (isSdk5(moduleParams)) { - toncset16(swiGetPitchTableOffset, 0x46C0, 6); + __aeabi_memset(swiGetPitchTableOffset, 6*sizeof(u16), 0x46C046C0); } else if (!a7IsThumb) { u32* swiGetPitchTablePatch = ce7->patches->j_twlGetPitchTable; - tonccpy(swiGetPitchTableOffset, swiGetPitchTablePatch, 0xC); + __aeabi_memcpy(swiGetPitchTableOffset, swiGetPitchTablePatch, 0xC); } } @@ -155,10 +155,10 @@ bool a7PatchCardIrqEnable(cardengineArm7* ce7, const tNDSHeader* ndsHeader, cons bool usesThumb = (*(u16*)cardIrqEnableOffset == 0xB510); if (usesThumb) { u16* cardIrqEnablePatch = (u16*)ce7->patches->thumb_card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x20); } else { u32* cardIrqEnablePatch = ce7->patches->card_irq_enable_arm7; - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, 0x30); } /*dbg_printf("cardIrqEnable location : "); @@ -172,7 +172,7 @@ static void patchCardCheckPullOut(cardengineArm7* ce7, const tNDSHeader* ndsHead u32* cardCheckPullOutOffset = findCardCheckPullOutOffset(ndsHeader, moduleParams); if (cardCheckPullOutOffset) { u32* cardCheckPullOutPatch = ce7->patches->card_pull_out_arm9; - tonccpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); + __aeabi_memcpy(cardCheckPullOutOffset, cardCheckPullOutPatch, 0x4); } } diff --git a/retail/cardenginei/arm7/source/patcher/patch_arm9.c b/retail/cardenginei/arm7/source/patcher/patch_arm9.c index 8c6454738..2a7a55dca 100644 --- a/retail/cardenginei/arm7/source/patcher/patch_arm9.c +++ b/retail/cardenginei/arm7/source/patcher/patch_arm9.c @@ -9,7 +9,7 @@ #include "cardengine_header_arm9.h" #include "unpatched_funcs.h" //#include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" #define gameOnFlashcard BIT(0) #define ROMinRAM BIT(3) @@ -42,7 +42,7 @@ static void fixForDifferentBios(const cardengineArm9* ce9, const tNDSHeader* nds if (swi12Offset) { // Patch to call swi 0x02 instead of 0x12 u32* swi12Patch = ce9->patches->swi02; - tonccpy(swi12Offset, swi12Patch, 0x4); + __aeabi_memcpy(swi12Offset, swi12Patch, 0x4); } /*dbg_printf("swi12 location : "); @@ -143,7 +143,7 @@ static bool patchCardRead(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons // Patch u32* cardReadPatch = (usesThumb ? ce9->thumbPatches->card_read_arm9 : ce9->patches->card_read_arm9); - tonccpy(cardReadStartOffset, cardReadPatch, usesThumb ? ((moduleParams->sdk_version > 0x5000000) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 + __aeabi_memcpy(cardReadStartOffset, cardReadPatch, usesThumb ? ((moduleParams->sdk_version > 0x5000000) ? 0xB0 : 0xA0) : 0xE0); // 0xE0 = 0xF0 - 0x08 /* dbg_printf("cardRead location : "); dbg_hexa((u32)cardReadStartOffset); dbg_printf("\n"); @@ -192,7 +192,7 @@ static void patchCardPullOut(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c // Patch u32* cardPullOutPatch = (usesThumb ? ce9->thumbPatches->card_pull_out_arm9 : ce9->patches->card_pull_out_arm9); - tonccpy(cardPullOutOffset, cardPullOutPatch, usesThumb ? 0x2 : 0x30); + __aeabi_memcpy(cardPullOutOffset, cardPullOutPatch, usesThumb ? 0x2 : 0x30); /* dbg_printf("cardPullOut location : "); dbg_hexa((u32)cardPullOutOffset); dbg_printf("\n\n"); */ @@ -227,7 +227,7 @@ static void patchCardId(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const if (cardIdStartOffset) { // Patch u32* cardIdPatch = (usesThumb ? ce9->thumbPatches->card_id_arm9 : ce9->patches->card_id_arm9); - tonccpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); + __aeabi_memcpy(cardIdStartOffset, cardIdPatch, usesThumb ? 0x8 : 0xC); /* dbg_printf("cardId location : "); dbg_hexa((u32)cardIdStartOffset); dbg_printf("\n\n"); */ @@ -251,7 +251,7 @@ static void patchCardReadDma(cardengineArm9* ce9, const tNDSHeader* ndsHeader, c } // Patch u32* cardReadDmaPatch = (usesThumb ? ce9->thumbPatches->card_dma_arm9 : ce9->patches->card_dma_arm9); - tonccpy(cardReadDmaStartOffset, cardReadDmaPatch, 0x40); + __aeabi_memcpy(cardReadDmaStartOffset, cardReadDmaPatch, 0x40); /*dbg_printf("cardReadDma location : "); dbg_hexa((u32)cardReadDmaStartOffset); dbg_printf("\n\n");*/ @@ -381,7 +381,7 @@ static bool patchCardSetDma(cardengineArm9* ce9, const tNDSHeader* ndsHeader, co dbg_hexa((u32)setDmaoffset); dbg_printf("\n\n");*/ u32* cardSetDmaPatch = (usesThumb ? ce9->thumbPatches->card_set_dma_arm9 : ce9->patches->card_set_dma_arm9); - tonccpy(setDmaoffset, cardSetDmaPatch, 0x30); + __aeabi_memcpy(setDmaoffset, cardSetDmaPatch, 0x30); setDmaPatched = true; return true; @@ -401,7 +401,7 @@ static void patchReset(cardengineArm9* ce9, const tNDSHeader* ndsHeader, const m // Patch u32* resetPatch = ce9->patches->reset_arm9; - tonccpy(reset, resetPatch, 0x40); + __aeabi_memcpy(reset, resetPatch, 0x40); /*dbg_printf("reset location : "); dbg_hexa((u32)reset); dbg_printf("\n\n");*/ @@ -461,7 +461,7 @@ bool a9PatchCardIrqEnable(cardengineArm9* ce9, const tNDSHeader* ndsHeader, cons return false; } u32* cardIrqEnablePatch = (usesThumb ? ce9->thumbPatches->card_irq_enable : ce9->patches->card_irq_enable); - tonccpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); + __aeabi_memcpy(cardIrqEnableOffset, cardIrqEnablePatch, usesThumb ? 0x18 : 0x30); /*dbg_printf("cardIrqEnable location : "); dbg_hexa((u32)cardIrqEnableOffset); dbg_printf("\n\n");*/ diff --git a/retail/cardenginei/arm7/source/patcher/save_patch_universal.c b/retail/cardenginei/arm7/source/patcher/save_patch_universal.c index 02ef8c85b..3e9a5f423 100644 --- a/retail/cardenginei/arm7/source/patcher/save_patch_universal.c +++ b/retail/cardenginei/arm7/source/patcher/save_patch_universal.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" //#include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 vAddrOfRelocSrc; extern u32 relocDestAtSharedMem; @@ -223,7 +223,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m /*dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n");*/ - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)((u32)EepromWriteJump + 0x6); /*dbg_printf("Eeprom page write branch:\t"); @@ -233,7 +233,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m /*dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n");*/ - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); //newSwiHaltAddr = (u32)eepromPageWrite+0x14; u16* eepromPageProgBranch = (u16*)((u32)EepromProgJump + 0x6); @@ -244,7 +244,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m /*dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n");*/ - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)((u32)EepromVerifyJump + 0x6); /*dbg_printf("Eeprom verify branch:\t"); @@ -254,7 +254,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m /*dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n");*/ - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)((u32)EepromEraseJump + 0x4); /*dbg_printf("Eeprom page erase branch:\t"); @@ -264,7 +264,7 @@ u32 savePatchUniversal(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, m /*dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n");*/ - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { u32* eepromRead = (u32*)((u32)EepromReadJump + 0xA); /*dbg_printf("Eeprom read:\t"); diff --git a/retail/cardenginei/arm7/source/patcher/save_patch_v5.c b/retail/cardenginei/arm7/source/patcher/save_patch_v5.c index 76b001746..78694eb33 100644 --- a/retail/cardenginei/arm7/source/patcher/save_patch_v5.c +++ b/retail/cardenginei/arm7/source/patcher/save_patch_v5.c @@ -4,7 +4,7 @@ #include "find.h" #include "cardengine_header_arm7.h" #include "debug_file.h" -#include "tonccpy.h" +#include "aeabi.h" extern u32 vAddrOfRelocSrc; extern u32 relocDestAtSharedMem; @@ -71,7 +71,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 /* dbg_printf("Eeprom read:\t"); dbg_hexa((u32)eepromRead); dbg_printf("\n"); */ - tonccpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); + __aeabi_memcpy(eepromRead, (u16*)ce7->patches->arm7FunctionsThumb->eepromRead, 0x14); u16* eepromPageWriteBranch = (u16*)(JumpTableFunc + 0x16); /* dbg_printf("Eeprom page write branch:\t"); @@ -81,7 +81,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 /* dbg_printf("Eeprom page write:\t"); dbg_hexa((u32)eepromPageWrite); dbg_printf("\n"); */ - tonccpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); + __aeabi_memcpy(eepromPageWrite, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageWrite, 0x14); u16* eepromPageProgBranch = (u16*)(JumpTableFunc + 0x24); /* dbg_printf("Eeprom page prog branch:\t"); @@ -91,7 +91,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 /* dbg_printf("Eeprom page prog:\t"); dbg_hexa((u32)eepromPageProg); dbg_printf("\n"); */ - tonccpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); + __aeabi_memcpy(eepromPageProg, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageProg, 0x14); u16* eepromPageVerifyBranch = (u16*)(JumpTableFunc + 0x32); /* dbg_printf("Eeprom verify branch:\t"); @@ -101,7 +101,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 /* dbg_printf("Eeprom verify:\t"); dbg_hexa((u32)eepromPageVerify); dbg_printf("\n"); */ - tonccpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); + __aeabi_memcpy(eepromPageVerify, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageVerify, 0x14); u16* eepromPageEraseBranch = (u16*)(JumpTableFunc + 0x3E); /* dbg_printf("Eeprom page erase branch:\t"); @@ -111,7 +111,7 @@ u32 savePatchV5(const cardengineArm7* ce7, const tNDSHeader* ndsHeader, const u3 /* dbg_printf("Eeprom page erase:\t"); dbg_hexa((u32)eepromPageErase); dbg_printf("\n"); */ - tonccpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); + __aeabi_memcpy(eepromPageErase, (u16*)ce7->patches->arm7FunctionsThumb->eepromPageErase, 0x14); } else { if (*(u32*)(JumpTableFunc - 0x24) == 0xEBFFFFB3) { u32* cardId = (u32*) (JumpTableFunc - 0x24); diff --git a/retail/cardenginei/arm7_dsiware/source/cardengine.c b/retail/cardenginei/arm7_dsiware/source/cardengine.c index 2f47f08a2..2526bf2a1 100644 --- a/retail/cardenginei/arm7_dsiware/source/cardengine.c +++ b/retail/cardenginei/arm7_dsiware/source/cardengine.c @@ -31,7 +31,7 @@ #include #include "ndma.h" -#include "tonccpy.h" +#include "aeabi.h" #include "my_sdmmc.h" #include "my_fat.h" #include "locations.h" @@ -125,14 +125,14 @@ static tNDSHeader* ndsHeader = (tNDSHeader*)NDS_HEADER_SDK5; static PERSONAL_DATA* personalData = (PERSONAL_DATA*)((u8*)NDS_HEADER_SDK5-0x180); static void unlaunchSetFilename(bool boot) { - tonccpy((u8*)0x02000800, unlaunchAutoLoadID, 12); + __aeabi_memcpy((u8*)0x02000800, unlaunchAutoLoadID, 12); *(u16*)(0x0200080C) = 0x3F0; // Unlaunch Length for CRC16 (fixed, must be 3F0h) *(u16*)(0x0200080E) = 0; // Unlaunch CRC16 (empty) *(u32*)(0x02000810) = (BIT(0) | BIT(1)); // Load the title at 2000838h // Use colors 2000814h *(u16*)(0x02000814) = 0x7FFF; // Unlaunch Upper screen BG color (0..7FFFh) *(u16*)(0x02000816) = 0x7FFF; // Unlaunch Lower screen BG color (0..7FFFh) - toncset((u8*)0x02000818, 0, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) + __aeabi_memclr((u8*)0x02000818, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) int i2 = 0; if (boot) { for (int i = 0; i < (int)sizeof(bootNdsPath); i++) { @@ -151,14 +151,14 @@ static void unlaunchSetFilename(bool boot) { static void unlaunchSetHiyaFilename(void) { if (!(valueBits & hiyaCfwFound)) return; - tonccpy((u8*)0x02000800, unlaunchAutoLoadID, 12); + __aeabi_memcpy((u8*)0x02000800, unlaunchAutoLoadID, 12); *(u16*)(0x0200080C) = 0x3F0; // Unlaunch Length for CRC16 (fixed, must be 3F0h) *(u16*)(0x0200080E) = 0; // Unlaunch CRC16 (empty) *(u32*)(0x02000810) = (BIT(0) | BIT(1)); // Load the title at 2000838h // Use colors 2000814h *(u16*)(0x02000814) = 0x7FFF; // Unlaunch Upper screen BG color (0..7FFFh) *(u16*)(0x02000816) = 0x7FFF; // Unlaunch Lower screen BG color (0..7FFFh) - toncset((u8*)0x02000818, 0, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) + __aeabi_memclr((u8*)0x02000818, 0x20+0x208+0x1C0); // Unlaunch Reserved (zero) int i2 = 0; for (int i = 0; i < (int)sizeof(hiyaDSiPath); i++) { *(u8*)(0x02000838+i2) = hiyaDSiPath[i]; // Unlaunch Device:/Path/Filename.ext (16bit Unicode,end by 0000h) @@ -249,7 +249,7 @@ static void initialize(void) { } if (!bootloaderCleared) { - toncset((u8*)0x06000000, 0, 0x40000); // Clear bootloader + __aeabi_memclr((u8*)0x06000000, 0x40000); // Clear bootloader if (mainScreen) { swapScreens = (mainScreen == 2); ipcEveryFrame = true; @@ -354,7 +354,7 @@ void reset(void) { if (deviceListAddr[0x3C0] == 's' && deviceListAddr[0x3C1] == 'd') { for (int i = 0; i < 0x3C0; i += 0x54) { if (deviceListAddr[i+4] == 's' && deviceListAddr[i+5] == 'd') { - toncset(deviceListAddr+i+2, 0, 1); // Clear SD access rights + __aeabi_memclr(deviceListAddr+i+2, 1); // Clear SD access rights break; } } @@ -387,8 +387,8 @@ void reset(void) { restoreBakData(); } - toncset((char*)0x02FFFD80, 0, 0x80); - toncset((char*)0x02FFFF80, 0, 0x80); + __aeabi_memclr((char*)0x02FFFD80, 0x80); + __aeabi_memclr((char*)0x02FFFF80, 0x80); sharedAddr[0] = 0x44414F4C; // 'LOAD' @@ -406,7 +406,7 @@ void reset(void) { } void forceGameReboot(void) { - toncset((u32*)0x02000000, 0, 0x400); + __aeabi_memclr((u32*)0x02000000, 0x400); *(u32*)0x02000000 = BIT(3); *(u32*)0x02000004 = 0x54455352; // 'RSET' sharedAddr[4] = 0x57534352; @@ -419,7 +419,7 @@ void forceGameReboot(void) { driveInitialize(); fileWrite((char*)&clearBuffer, &srParamsFile, 0, 0x4); if (*(u32*)(ce7+0x8100) == 0) { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x20); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x20); } else { // Use different SR backend ID readSrBackendId(); @@ -442,7 +442,7 @@ void forceGameReboot(void) { } */ void returnToLoader(bool reboot) { - toncset((u32*)0x02000000, 0, 0x400); + __aeabi_memclr((u32*)0x02000000, 0x400); *(u32*)0x02000000 = BIT(0) | BIT(1) | BIT(2); *(u32*)0x02000004 = 0x54455352; // 'RSET' sharedAddr[4] = 0x57534352; @@ -450,13 +450,13 @@ void returnToLoader(bool reboot) { u32 twlCfgLoc = *(u32*)0x02FFFDFC; if (twlCfgLoc != 0x02000400) { - tonccpy((u8*)0x02000400, (u8*)twlCfgLoc, 0x128); + __aeabi_memcpy((u8*)0x02000400, (u8*)twlCfgLoc, 0x128); } if (reboot || ((valueBits & twlTouch) && !(*(u8*)0x02FFE1BF & BIT(0))) || (valueBits & wideCheatUsed)) { if (consoleModel >= 2) { if (*(u32*)(ce7+0x8100) == 0) { - tonccpy((u32*)0x02000300, sr_data_srloader, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_srloader, 0x020); } else if (*(char*)(ce7+0x8103) == 'H' || *(char*)(ce7+0x8103) == 'K') { // Use different SR backend ID readSrBackendId(); @@ -627,7 +627,7 @@ void readManual(int line) { } } - toncset((u8*)INGAME_MENU_EXT_LOCATION, ' ', 32 * 24); + __aeabi_memset((u8*)INGAME_MENU_EXT_LOCATION, 32 * 24, ' '); ((vu8*)INGAME_MENU_EXT_LOCATION)[32 * 24] = '\0'; // Read in 24 lines @@ -646,7 +646,7 @@ void readManual(int line) { if(buffer[i] == '\n') tempManualOffset++; fullLine = i == 32; - tonccpy((char*)INGAME_MENU_EXT_LOCATION + line * 32, buffer, i); + __aeabi_memcpy((char*)INGAME_MENU_EXT_LOCATION + line * 32, buffer, i); break; } } @@ -703,7 +703,7 @@ void myIrqHandlerVBlank(void) { if (deviceListAddr[0x3C0] == 's' && deviceListAddr[0x3C1] == 'd') { for (int i = 0; i < 0x3C0; i += 0x54) { if (deviceListAddr[i+4] == 's' && deviceListAddr[i+5] == 'd') { - toncset(deviceListAddr+i+2, 0x06, 1); // Set SD access rights + __aeabi_memset(deviceListAddr+i+2, 1, 0x06); // Set SD access rights break; } } @@ -744,7 +744,7 @@ void myIrqHandlerVBlank(void) { } /* if (isSdEjected()) { - tonccpy((u32*)0x02000300, sr_data_error, 0x020); + __aeabi_memcpy((u32*)0x02000300, sr_data_error, 0x020); i2cWriteRegister(0x4A, 0x70, 0x01); i2cWriteRegister(0x4A, 0x11, 0x01); // Reboot into error screen if SD card is removed } */ diff --git a/retail/cardenginei/arm7_dsiware/source/inGameMenu.c b/retail/cardenginei/arm7_dsiware/source/inGameMenu.c index 4c64501d4..6c05741d2 100644 --- a/retail/cardenginei/arm7_dsiware/source/inGameMenu.c +++ b/retail/cardenginei/arm7_dsiware/source/inGameMenu.c @@ -11,7 +11,7 @@ #include "locations.h" #include "cardengine.h" #include "nds_header.h" -#include "tonccpy.h" +#include "aeabi.h" #define sleepMode BIT(17) @@ -175,7 +175,7 @@ void inGameMenu(void) { u32* src = (u32*)((u32)sharedAddr[1]); for (int i = 0; i < 0xC0/8; i++) { if ((u32)src >= 0x8000) { - tonccpy(dst, src, 8); + __aeabi_memcpy(dst, src, 8); } else { biosRead(dst, src, 8); } @@ -187,7 +187,7 @@ void inGameMenu(void) { break; case 0x574D4152: // RAMW if (sharedAddr[1]+sharedAddr[2] >= 0x8000) { - tonccpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); + __aeabi_memcpy((u8*)((u32)sharedAddr[1])+sharedAddr[2], (u8*)((u32)sharedAddr[0])+sharedAddr[2], 1); } break; case 0x4554494C: // LITE diff --git a/retail/cardenginei/arm7_twlsdk/source_ext/dldi_patcher.c b/retail/cardenginei/arm7_twlsdk/source_ext/dldi_patcher.c index 61c78259a..87a414140 100644 --- a/retail/cardenginei/arm7_twlsdk/source_ext/dldi_patcher.c +++ b/retail/cardenginei/arm7_twlsdk/source_ext/dldi_patcher.c @@ -23,7 +23,7 @@ #include #include #include "dldi_patcher.h" -#include "tonccpy.h" +#include "aeabi.h" #define FIX_ALL 0x01 #define FIX_GLUE 0x02 @@ -147,7 +147,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { // Remember how much space is actually reserved pDH[DO_allocatedSpace] = pAH[DO_allocatedSpace]; // Copy the DLDI patch into the application - tonccpy (pAH, pDH, dldiFileSize); + __aeabi_memcpy (pAH, pDH, dldiFileSize); // Fix the section pointers in the header writeAddr (pAH, DO_text_start, readAddr (pAH, DO_text_start) + relocationOffset); @@ -167,7 +167,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { writeAddr (pAH, DO_shutdown, readAddr (pAH, DO_shutdown) + relocationOffset); // Put the correct DLDI magic string back into the DLDI header - tonccpy (pAH, dldiMagicString, sizeof (dldiMagicString)); + __aeabi_memcpy (pAH, dldiMagicString, sizeof (dldiMagicString)); if (pDH[DO_fixSections] & FIX_ALL) { // Search through and fix pointers within the data section of the file @@ -198,7 +198,7 @@ bool dldiPatchBinary (data_t *binData, u32 binSize) { if (pDH[DO_fixSections] & FIX_BSS) { // Initialise the BSS to 0 - toncset (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart] , 0, readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); + __aeabi_memclr (&pAH[readAddr(pDH, DO_bss_start) - ddmemStart], readAddr(pDH, DO_bss_end) - readAddr(pDH, DO_bss_start)); } return true; diff --git a/retail/cardenginei/arm9/source/cardDma.thumb.c b/retail/cardenginei/arm9/source/cardDma.thumb.c index 8445bec23..a49e1d098 100644 --- a/retail/cardenginei/arm9/source/cardDma.thumb.c +++ b/retail/cardenginei/arm9/source/cardDma.thumb.c @@ -30,7 +30,6 @@ #include // tNDSHeader #include "module_params.h" #include "ndma.h" -#include "tonccpy.h" #include "hex.h" #include "igm_text.h" #include "nds_header.h" diff --git a/retail/cardenginei/arm9/source/cardengine.c b/retail/cardenginei/arm9/source/cardengine.c index cbd9e8b17..a69b0889d 100644 --- a/retail/cardenginei/arm9/source/cardengine.c +++ b/retail/cardenginei/arm9/source/cardengine.c @@ -29,7 +29,7 @@ #include #include // tNDSHeader #include "ndma.h" -#include "tonccpy.h" +#include "aeabi.h" #include "hex.h" #include "igm_text.h" #include "nds_header.h" @@ -444,7 +444,7 @@ static inline void cardReadNormal(u8* dst, u32 src, u32 len) { } } } else {*/ - tonccpy(dst, (u8*)buffer+(src-sector), len2); + __aeabi_memcpy(dst, (u8*)buffer+(src-sector), len2); //} len -= len2; @@ -487,7 +487,7 @@ static inline void cardReadRAM(u8* dst, u32 src, u32 len/*, int romPartNo*/) { if (src >= 0 && src < 0x160) { u32 newSrc = (u32)ndsHeader+src; - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); return; } @@ -497,9 +497,9 @@ static inline void cardReadRAM(u8* dst, u32 src, u32 len/*, int romPartNo*/) { if (src > *(u32*)0x02FFE1C0) { newSrc -= *(u32*)0x02FFE1CC; } - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); #else - // tonccpy(dst, (u8*)ce9->romLocation/*[romPartNo]*/+src, len); + // __aeabi_memcpy(dst, (u8*)ce9->romLocation/*[romPartNo]*/+src, len); u32 len2 = 0; for (int i = 0; i < ce9->romMapLines; i++) { if (!(src >= ce9->romMap[i][0] && (i == ce9->romMapLines-1 || src < ce9->romMap[i+1][0]))) @@ -511,11 +511,11 @@ static inline void cardReadRAM(u8* dst, u32 src, u32 len/*, int romPartNo*/) { len--; len2++; } while (newSrc+len != ce9->romMap[i][2]); - tonccpy(dst, (u8*)newSrc, len); + __aeabi_memcpy(dst, (u8*)newSrc, len); src += len; dst += len; } else { - tonccpy(dst, (u8*)newSrc, len2==0 ? len : len2); + __aeabi_memcpy(dst, (u8*)newSrc, len2==0 ? len : len2); break; } } @@ -606,7 +606,7 @@ void cardRead(u32* cacheStruct, u8* dst0, u32 src0, u32 len0) { u32 len = len0; if (src == ndsHeader->romSize) { - tonccpy(dst, (u8*)0x02FFDC00, len); // Load pre-loaded RSA key + __aeabi_memcpy(dst, (u8*)0x02FFDC00, len); // Load pre-loaded RSA key return; } #else @@ -896,7 +896,7 @@ bool dsiSaveDelete(const char* path) { #ifdef DLDI bool dsiSaveGetInfo(const char* path, dsiSaveInfo* info) { - toncset(info, 0, sizeof(dsiSaveInfo)); + __aeabi_memclr(info, sizeof(dsiSaveInfo)); if (savFile->firstCluster == CLUSTER_FREE || savFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; return false; @@ -942,7 +942,7 @@ u32 dsiSaveSetLength(void* ctx, s32 len) { sysSetCardOwner(true); // Give Slot-1 access to arm9 bool res = fileWrite((char*)&dsiSaveSize, savFile, ce9->saveSize-4, 4); dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); @@ -958,23 +958,23 @@ bool dsiSaveOpen(void* ctx, const char* path, u32 mode) { if (strcmp(path, "nand:/") == 0) { if (sharedFontFile->firstCluster == CLUSTER_FREE || sharedFontFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); sharedFontOpened = true; return true; } if (savFile->firstCluster == CLUSTER_FREE || savFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveInit(); dsiSaveResultCode = dsiSaveExists ? 0 : 0xB; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); dsiSavePerms = mode; return dsiSaveExists; @@ -990,21 +990,21 @@ bool dsiSaveClose(void* ctx) { sharedFontOpened = false; if (sharedFontFile->firstCluster == CLUSTER_FREE || sharedFontFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; } if (savFile->firstCluster == CLUSTER_FREE || savFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } //toncset(ctx, 0, 0x80); dsiSaveResultCode = dsiSaveExists ? 0 : 0xB; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return dsiSaveExists; #else return false; @@ -1045,22 +1045,22 @@ bool dsiSaveSeek(void* ctx, s32 pos, u32 mode) { } dsiSaveSeekPos = pos; dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; } if (savFile->firstCluster == CLUSTER_FREE || savFile->firstCluster == CLUSTER_EOF) { dsiSaveResultCode = 0xE; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } if (!dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return false; } dsiSaveSeekPos = pos; dsiSaveResultCode = 0; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return true; #else return false; @@ -1072,13 +1072,13 @@ s32 dsiSaveRead(void* ctx, void* dst, u32 len) { if (!sharedFontOpened) { if (dsiSavePerms == 2 || !dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return -1; // Return if only write perms are set } if (dsiSaveSize == 0) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return 0; } @@ -1088,7 +1088,7 @@ s32 dsiSaveRead(void* ctx, void* dst, u32 len) { if (len == 0) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return 0; } } @@ -1098,7 +1098,7 @@ s32 dsiSaveRead(void* ctx, void* dst, u32 len) { sysSetCardOwner(true); // Give Slot-1 access to arm9 bool res = fileRead(dst, sharedFontOpened ? sharedFontFile : savFile, dsiSaveSeekPos, len); dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); if (res) { @@ -1113,7 +1113,7 @@ s32 dsiSaveWrite(void* ctx, void* src, s32 len) { #ifdef DLDI if (dsiSavePerms == 1 || !dsiSaveExists) { dsiSaveResultCode = 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); return -1; // Return if only read perms are set } @@ -1131,7 +1131,7 @@ s32 dsiSaveWrite(void* ctx, void* src, s32 len) { sysSetCardOwner(true); // Give Slot-1 access to arm9 bool res = fileWrite(src, savFile, dsiSaveSeekPos, len); dsiSaveResultCode = res ? 0 : 1; - toncset32(ctx+0x14, dsiSaveResultCode, 1); + __aeabi_memset4(ctx+0x14, 4, dsiSaveResultCode); REG_EXMEMCNT = exmemcnt; leaveCriticalSection(oldIME); if (res) { diff --git a/retail/cardenginei/arm9/source/misc.c b/retail/cardenginei/arm9/source/misc.c index 31e82ac50..05484743b 100644 --- a/retail/cardenginei/arm9/source/misc.c +++ b/retail/cardenginei/arm9/source/misc.c @@ -25,7 +25,7 @@ #include #include #include // tNDSHeader -#include "tonccpy.h" +#include "aeabi.h" #include "nds_header.h" #include "cardengine.h" #include "locations.h" @@ -247,7 +247,7 @@ void reset(u32 param, u32 tid2) { } #endif } else { - toncset((u8*)getDtcmBase()+0x3E00, 0, 0x200); + __aeabi_memclr((u8*)getDtcmBase()+0x3E00, 0x200); #ifdef TWLSDK if (ce9->intr_vblank_orig_return && (*(u32*)0x02FFE234 == 0x00030004 || *(u32*)0x02FFE234 == 0x00030005)) { *(u32*)0x02FFC230 = 0; @@ -284,8 +284,8 @@ void reset(u32 param, u32 tid2) { REG_DISPCNT_SUB = 0; GFX_STATUS = 0; - toncset((u16*)0x04000000, 0, 0x56); - toncset((u16*)0x04001000, 0, 0x56); + __aeabi_memclr((u16*)0x04000000, 0x56); + __aeabi_memclr((u16*)0x04001000, 0x56); VRAM_A_CR = 0x80; VRAM_B_CR = 0x80; @@ -297,9 +297,9 @@ void reset(u32 param, u32 tid2) { VRAM_H_CR = 0x80; VRAM_I_CR = 0x80; - toncset16(BG_PALETTE, 0, 256); // Clear palettes - toncset16(BG_PALETTE_SUB, 0, 256); - toncset(VRAM, 0, 0xC0000); // Clear VRAM + __aeabi_memclr(BG_PALETTE, 256*sizeof(u16)); // Clear palettes + __aeabi_memclr(BG_PALETTE_SUB, 256*sizeof(u16)); + __aeabi_memclr(VRAM, 0xC0000); // Clear VRAM VRAM_A_CR = 0; VRAM_B_CR = 0; diff --git a/retail/cardenginei/arm9/source/my_fat.thumb.c b/retail/cardenginei/arm9/source/my_fat.thumb.c index a9ac59a58..f021fe5b9 100644 --- a/retail/cardenginei/arm9/source/my_fat.thumb.c +++ b/retail/cardenginei/arm9/source/my_fat.thumb.c @@ -29,7 +29,7 @@ project at chishm@hotmail.com ------------------------------------------------------------------*/ -#include "tonccpy.h" +#include "aeabi.h" #include "my_fat.h" #include "card.h" #include "debug_file.h" @@ -833,7 +833,7 @@ bool resumeFileRead() CARD_ReadSector( context.curSect + FAT_ClustToSect(context.file->currentCluster), lastGlobalBuffer, 0, 0); // Read in last partial chunk - tonccpy(context.buffer+context.dataPos,lastGlobalBuffer+context.curByte,context.length-context.dataPos); + __aeabi_memcpy(context.buffer+context.dataPos,lastGlobalBuffer+context.curByte,context.length-context.dataPos); context.curByte+=context.length; context.dataPos+=context.length; @@ -898,7 +898,7 @@ u32 fileRead (char* buffer, aFile* file, u32 startOffset, u32 length) // Read first part from buffer, to align with sector boundary dataPos=0; - tonccpy(buffer,globalBuffer+curByte,beginBytes); + __aeabi_memcpy(buffer,globalBuffer+curByte,beginBytes); curByte+=beginBytes; dataPos+=beginBytes; @@ -1016,7 +1016,7 @@ u32 fileRead (char* buffer, aFile* file, u32 startOffset, u32 length) CARD_ReadSectors( curSect + FAT_ClustToSect(file->currentCluster), 1, lastGlobalBuffer); // Read in last partial chunk - tonccpy(buffer+dataPos,lastGlobalBuffer,length-dataPos); + __aeabi_memcpy(buffer+dataPos,lastGlobalBuffer,length-dataPos); curByte+=length; dataPos+=length; } @@ -1081,7 +1081,7 @@ u32 fileWrite (const char* buffer, aFile* file, u32 startOffset, u32 length) // Read first part from buffer, to align with sector boundary dataPos=0; - tonccpy(globalBuffer+curByte,buffer,beginBytes); + __aeabi_memcpy(globalBuffer+curByte,buffer,beginBytes); curByte+=beginBytes; dataPos+=beginBytes; @@ -1140,7 +1140,7 @@ u32 fileWrite (const char* buffer, aFile* file, u32 startOffset, u32 length) CARD_ReadSectors( curSect + FAT_ClustToSect(file->currentCluster), 1, lastGlobalBuffer); // Read in last partial chunk - tonccpy(lastGlobalBuffer,buffer+dataPos,length-dataPos); + __aeabi_memcpy(lastGlobalBuffer,buffer+dataPos,length-dataPos); curByte+=length; dataPos+=length; diff --git a/retail/cardenginei/arm9_dsiware/source/cardengine.c b/retail/cardenginei/arm9_dsiware/source/cardengine.c index a77350e1b..553d4eb2f 100644 --- a/retail/cardenginei/arm9_dsiware/source/cardengine.c +++ b/retail/cardenginei/arm9_dsiware/source/cardengine.c @@ -28,7 +28,7 @@ #include #include // tNDSHeader #include "ndma.h" -#include "tonccpy.h" +#include "aeabi.h" #include "hex.h" #include "igm_text.h" #include "nds_header.h" @@ -137,7 +137,7 @@ void reset(u32 tid1, u32 tid2) { *(u32*)0x02FFC234 = *(u32*)0x02FFE234; } } else { - toncset((u8*)getDtcmBase()+0x3E00, 0, 0x200); + __aeabi_memclr((u8*)getDtcmBase()+0x3E00, 0x200); if (ce9->intr_vblank_orig_return) { *(u32*)0x02FFC230 = 0; @@ -170,8 +170,8 @@ void reset(u32 tid1, u32 tid2) { REG_DISPCNT_SUB = 0; GFX_STATUS = 0; - toncset((u16*)0x04000000, 0, 0x56); - toncset((u16*)0x04001000, 0, 0x56); + __aeabi_memclr((u16*)0x04000000, 0x56); + __aeabi_memclr((u16*)0x04001000, 0x56); VRAM_A_CR = 0x80; VRAM_B_CR = 0x80; @@ -183,9 +183,9 @@ void reset(u32 tid1, u32 tid2) { VRAM_H_CR = 0x80; VRAM_I_CR = 0x80; - toncset16(BG_PALETTE, 0, 256); // Clear palettes - toncset16(BG_PALETTE_SUB, 0, 256); - toncset(VRAM, 0, 0xC0000); // Clear VRAM + __aeabi_memclr(BG_PALETTE, 256*sizeof(u16)); // Clear palettes + __aeabi_memclr(BG_PALETTE_SUB, 256*sizeof(u16)); + __aeabi_memclr(VRAM, 0xC0000); // Clear VRAM VRAM_A_CR = 0; VRAM_B_CR = 0; diff --git a/retail/cardenginei/arm9_igm/source/exception.c b/retail/cardenginei/arm9_igm/source/exception.c index 6d0648878..9ab00f085 100644 --- a/retail/cardenginei/arm9_igm/source/exception.c +++ b/retail/cardenginei/arm9_igm/source/exception.c @@ -3,7 +3,7 @@ #include #include "igm_text.h" -#include "tonccpy.h" +#include "aeabi.h" bool exceptionPrinted = false; @@ -217,7 +217,7 @@ void showException(s32 *expReg) { clearScreen(true); - toncset16(BG_PALETTE, 0, 256); + __aeabi_memclr(BG_PALETTE, 256*sizeof(u16)); for(int i = 0; i < sizeof(igmPal) / sizeof(igmPal[0]); i++) { BG_PALETTE[i * 0x10 + 1] = igmPal[i]; } diff --git a/retail/cardenginei/arm9_igm/source/inGameMenu.c b/retail/cardenginei/arm9_igm/source/inGameMenu.c index 93e1a94f5..9bd41313a 100644 --- a/retail/cardenginei/arm9_igm/source/inGameMenu.c +++ b/retail/cardenginei/arm9_igm/source/inGameMenu.c @@ -12,7 +12,7 @@ #include "locations.h" #include "cardengine_header_arm9.h" #include "nds_header.h" -#include "tonccpy.h" +#include "aeabi.h" void DC_InvalidateRange(const void *base, u32 size); void DC_FlushRange(const void *base, u32 size); @@ -203,7 +203,7 @@ static void waitKeys(u16 keys) { } void clearScreen(bool main) { - toncset16(main ? BG_MAP_RAM(15) : BG_MAP_RAM_SUB(15), 0, 0x300); + __aeabi_memclr(main ? BG_MAP_RAM(15) : BG_MAP_RAM_SUB(15), 0x300*sizeof(u16)); } #define VRAM_x(bank) ((u16*)(0x6800000 + (0x0020000 * (bank)))) @@ -242,10 +242,12 @@ static void screenshot(void) { clearScreen(false); - toncset16(BG_MAP_RAM_SUB(15) + 0x20 * 9 + 5, '-', 20); + for (int i = 0; i < 20; i++) { + printChar(5 + i, 9, '-', FONT_WHITE, false); + printChar(5 + i, 13, '-', FONT_WHITE, false); + } printCenter(15, 10, igmText.selectBank, FONT_WHITE, false); printChar(15, 12, 'A' + vramBank, FONT_LIGHT_BLUE, false); - toncset16(BG_MAP_RAM_SUB(15) + 0x20 * 13 + 5, '-', 20); FontPalette color = igmText.currentScreenshot == 50 ? FONT_RED : FONT_LIME; if(igmText.rtl) { @@ -289,12 +291,12 @@ static void screenshot(void) { #endif // Backup VRAM bank - tonccpy(vramBak, VRAM_x(vramBank), 0x18000); + __aeabi_memcpy(vramBak, VRAM_x(vramBank), 0x18000); REG_DISPCAPCNT = DCAP_BANK(vramBank) | DCAP_SIZE(DCAP_SIZE_256x192) | DCAP_MODE(captureMode) | DCAP_ENABLE; while(REG_DISPCAPCNT & DCAP_ENABLE); - tonccpy(bmpBuffer, bmpHeader, sizeof(bmpHeader)); + __aeabi_memcpy(bmpBuffer, bmpHeader, sizeof(bmpHeader)); // ABGR 1555 -> RGB 565 for (int i = 0; i < 256 * 192; i++) { @@ -305,12 +307,12 @@ static void screenshot(void) { // Write image data, upside down as that's how BMPs want it u16 *bmp = bmpBuffer + sizeof(bmpHeader) / sizeof(u16); for(int i = 191; i >= 0; i--) { - tonccpy(bmp, VRAM_x(vramBank) + (i * 256), 256 * sizeof(u16)); + __aeabi_memcpy(bmp, VRAM_x(vramBank) + (i * 256), 256 * sizeof(u16)); bmp += 256; } // Restore VRAM bank - tonccpy(VRAM_x(vramBank), vramBak, 0x18000); + __aeabi_memcpy(VRAM_x(vramBank), vramBak, 0x18000); VRAM_x_CR(vramBank) = vramCr; #ifdef B4DS @@ -582,11 +584,13 @@ static void jumpToAddress(void) { u8 cursorPosition = 0; while(1) { - toncset16(BG_MAP_RAM_SUB(15) + 0x20 * 9 + 5, '-', 20); + for (int i = 0; i < 20; i++) { + printChar(5 + i, 9, '-', FONT_WHITE, false); + printChar(5 + i, 13, '-', FONT_WHITE, false); + } printCenter(15, 10, igmText.jumpAddress, FONT_WHITE, false); printHex(11, 12, (u32)address, 4, FONT_LIGHT_BLUE, false); BG_MAP_RAM_SUB(15)[0x20 * 12 + 11 + 6 - cursorPosition] = (BG_MAP_RAM_SUB(15)[0x20 * 12 + 11 + 6 - cursorPosition] & ~(0xF << 12)) | 4 << 12; - toncset16(BG_MAP_RAM_SUB(15) + 0x20 * 13 + 5, '-', 20); waitKeys(KEY_UP | KEY_DOWN | KEY_LEFT | KEY_RIGHT | KEY_A | KEY_B); @@ -611,7 +615,7 @@ static void ramViewer(void) { (*changeMpu)(); u8 *arm7RamBuffer = ((u8*)sharedAddr) - 0x74C; - tonccpy(arm7RamBak, arm7RamBuffer, 0xC0); + __aeabi_memcpy(arm7RamBak, arm7RamBuffer, 0xC0); bool ramLoaded = false; u8 cursorPosition = 0, mode = 0; while(1) { @@ -748,7 +752,7 @@ static void ramViewer(void) { } } } - tonccpy(arm7RamBuffer, arm7RamBak, 0xC0); + __aeabi_memcpy(arm7RamBuffer, arm7RamBak, 0xC0); (*revertMpu)(); } @@ -807,16 +811,16 @@ void inGameMenu(s32 *mainScreen, u32 consoleModel, s32 *exceptionRegisters) { REG_BLDALPHA_SUB = 0; // Register is write only, can't back up REG_BLDY_SUB = 0; // Register is write only, can't back up - tonccpy(bgMapBak, BG_MAP_RAM_SUB(15), sizeof(bgMapBak)); // Backup BG_MAP_RAM + __aeabi_memcpy(bgMapBak, BG_MAP_RAM_SUB(15), sizeof(bgMapBak)); // Backup BG_MAP_RAM clearScreen(false); - tonccpy(palBak, BG_PALETTE_SUB, sizeof(palBak)); // Backup the palette - toncset16(BG_PALETTE_SUB, 0, 256); + __aeabi_memcpy(palBak, BG_PALETTE_SUB, sizeof(palBak)); // Backup the palette + __aeabi_memclr(BG_PALETTE_SUB, 256*sizeof(u16)); for(int i = 0; i < sizeof(igmPal) / sizeof(igmPal[0]); i++) { BG_PALETTE_SUB[i * 0x10 + 1] = igmPal[i]; } - tonccpy(bgBak, BG_GFX_SUB, sizeof(igmText.font) * 4); // Backup the original graphics + __aeabi_memcpy(bgBak, BG_GFX_SUB, sizeof(igmText.font) * 4); // Backup the original graphics for(int i = 0; i < sizeof(igmText.font); i++) { // Load font from 1bpp to 4bpp u8 val = igmText.font[i]; BG_GFX_SUB[i * 2] = (val & 1) | ((val & 2) << 3) | ((val & 4) << 6) | ((val & 8) << 9); @@ -950,9 +954,9 @@ void inGameMenu(s32 *mainScreen, u32 consoleModel, s32 *exceptionRegisters) { } */ } - tonccpy(BG_MAP_RAM_SUB(15), bgMapBak, sizeof(bgMapBak)); // Restore BG_MAP_RAM - tonccpy(BG_PALETTE_SUB, palBak, sizeof(palBak)); // Restore the palette - tonccpy(BG_GFX_SUB, bgBak, sizeof(igmText.font) * 4); // Restore the original graphics + __aeabi_memcpy(BG_MAP_RAM_SUB(15), bgMapBak, sizeof(bgMapBak)); // Restore BG_MAP_RAM + __aeabi_memcpy(BG_PALETTE_SUB, palBak, sizeof(palBak)); // Restore the palette + __aeabi_memcpy(BG_GFX_SUB, bgBak, sizeof(igmText.font) * 4); // Restore the original graphics *(vu16*)0x0400106C = masterBright; diff --git a/retail/common/include/aeabi.h b/retail/common/include/aeabi.h new file mode 100644 index 000000000..7de05c0b9 --- /dev/null +++ b/retail/common/include/aeabi.h @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors + +#ifndef AEABI_H__ +#define AEABI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * Alias of __aeabi_memcpy4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy8(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy4(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Copies n bytes from src to dest (forward) + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memcpy(void* __restrict__ dest, const void* __restrict__ src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memmove4 + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove8(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * Assumes dest and src are 4-byte aligned + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove4(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Safely copies n bytes of src to dest + * @param dest Destination address + * @param src Source address + * @param n Number of bytes to copy + */ +void __aeabi_memmove(void* dest, const void* src, size_t n) __attribute__((nonnull(1, 2))); + +/** + * Alias of __aeabi_memset4 + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset8(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset4(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Set n bytes of dest to (c & 0xff) + * @param dest Destination address + * @param n Number of bytes to set + * @param c Value to set + */ +void __aeabi_memset(void* dest, size_t n, int c) __attribute__((nonnull(1))); + +/** + * Alias of __aeabi_memclr4 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr8(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * Assumes dest is 4-byte aligned + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr4(void* dest, size_t n) __attribute__((nonnull(1))); + +/** + * Clears n bytes of dest to 0 + * @param dest Destination address + * @param n Number of bytes to clear + */ +void __aeabi_memclr(void* dest, size_t n) __attribute__((nonnull(1))); + +#ifdef __cplusplus +} +#endif + +#endif // AEABI_H__ diff --git a/retail/common/include/asminc.h b/retail/common/include/asminc.h new file mode 100644 index 000000000..efa52df39 --- /dev/null +++ b/retail/common/include/asminc.h @@ -0,0 +1,28 @@ +#ifndef _ASMINC_H_ +#define _ASMINC_H_ + +#if !__ASSEMBLER__ +# error "This header file is only for use in assembly files!" +#endif + + +.macro BEGIN_ASM_FUNC name section=text + .section .\section\().\name\(), "ax", %progbits + .global \name + .type \name, %function + .align 2 +\name: +.endm + +.macro BEGIN_ASM_FUNC_NO_SECTION name + .global \name + .type \name, %function + .align 2 +\name: +.endm + +#define ICACHE_SIZE 0x2000 +#define DCACHE_SIZE 0x1000 +#define CACHE_LINE_SIZE 32 + +#endif // _ASMINC_H_ diff --git a/retail/common/include/macros.inc b/retail/common/include/macros.inc new file mode 100644 index 000000000..a4a459a48 --- /dev/null +++ b/retail/common/include/macros.inc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ARM assembly support macros + +@ Shift and test upper two bits, clobbering \reg +@ Use mi for first bit, cs for second bit +.macro joaobapt_test_lsl reg shift = #0 + movs \reg, \reg, lsl \shift +.endm + +@ Test lowest two bits, clobbering \reg +@ Use mi for low bit, cs for high bit +.macro joaobapt_test reg + joaobapt_test_lsl \reg, #31 +.endm + +@ Test lowest two bits of \src, result stored in \dst +@ Use mi for low bit, cs for high bit +.macro joaobapt_test_into dst, src + movs \dst, \src, lsl #31 +.endm + +@ Branches depending on lowest two bits, clobbering \reg +@ b_mi = low bit case, b_cs = high bit case +.macro joaobapt_switch reg, b_mi, b_cs + joaobapt_test \reg + bmi \b_mi + bcs \b_cs +.endm + +@ Branches depending on alignment of \a and \b, clobbering \scratch +@ b_byte = off-by-byte case, b_half = off-by-half case +.macro align_switch a, b, scratch, b_byte, b_half + eor \scratch, \a, \b + joaobapt_switch \scratch, \b_byte, \b_half +.endm diff --git a/retail/common/include/tonccpy.h b/retail/common/include/tonccpy.h deleted file mode 100644 index dd4267dc6..000000000 --- a/retail/common/include/tonccpy.h +++ /dev/null @@ -1,43 +0,0 @@ -//# Stuff you may not have yet. - -#ifndef TONCCPY_H -#define TONCCPY_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -typedef unsigned int uint; -#define BIT_MASK(len) ( (1<<(len))-1 ) -static inline u32 quad8(u16 x) { x |= x<<8; return x | x<<16; } - - -//# Declarations and inlines. - -void tonccpy(void *dst, const void *src, uint size); - -void __toncset(void *dst, u32 fill, uint size); -static inline void toncset(void *dst, u8 src, uint size); -static inline void toncset16(void *dst, u16 src, uint size); -static inline void toncset32(void *dst, u32 src, uint size); - - -//! VRAM-safe memset, byte version. Size in bytes. -static inline void toncset(void *dst, u8 src, uint size) -{ __toncset(dst, quad8(src), size); } - -//! VRAM-safe memset, halfword version. Size in hwords. -static inline void toncset16(void *dst, u16 src, uint size) -{ __toncset(dst, src|src<<16, size*2); } - -//! VRAM-safe memset, word version. Size in words. -static inline void toncset32(void *dst, u32 src, uint size) -{ __toncset(dst, src, size*4); } - -#ifdef __cplusplus -} -#endif -#endif diff --git a/retail/common/source/my_fat.c b/retail/common/source/my_fat.c index c2af35086..ccc0f9600 100644 --- a/retail/common/source/my_fat.c +++ b/retail/common/source/my_fat.c @@ -29,7 +29,7 @@ project at chishm@hotmail.com ------------------------------------------------------------------*/ -#include "tonccpy.h" +#include "aeabi.h" #include "my_fat.h" #include "card.h" #include "debug_file.h" @@ -1218,9 +1218,9 @@ bool resumeFileRead() // Read in last partial chunk #ifdef TWOCARD - tonccpy(context.buffer+context.dataPos,lastGlobalBuffer[0]+context.curByte,context.length-context.dataPos); + __aeabi_memcpy(context.buffer+context.dataPos,lastGlobalBuffer[0]+context.curByte,context.length-context.dataPos); #else - tonccpy(context.buffer+context.dataPos,lastGlobalBuffer+context.curByte,context.length-context.dataPos); + __aeabi_memcpy(context.buffer+context.dataPos,lastGlobalBuffer+context.curByte,context.length-context.dataPos); #endif context.curByte+=context.length; @@ -1316,9 +1316,9 @@ u32 fileRead (char* buffer, aFile* file, u32 startOffset, u32 length) // Read first part from buffer, to align with sector boundary dataPos=0; #ifdef TWOCARD - tonccpy(buffer,globalBuffer[file->card2]+curByte,beginBytes); + __aeabi_memcpy(buffer,globalBuffer[file->card2]+curByte,beginBytes); #else - tonccpy(buffer,globalBuffer+curByte,beginBytes); + __aeabi_memcpy(buffer,globalBuffer+curByte,beginBytes); #endif curByte+=beginBytes; dataPos+=beginBytes; @@ -1516,9 +1516,9 @@ u32 fileRead (char* buffer, aFile* file, u32 startOffset, u32 length) // Read in last partial chunk #ifdef TWOCARD - tonccpy(buffer+dataPos,lastGlobalBuffer[file->card2],length-dataPos); + __aeabi_memcpy(buffer+dataPos,lastGlobalBuffer[file->card2],length-dataPos); #else - tonccpy(buffer+dataPos,lastGlobalBuffer,length-dataPos); + __aeabi_memcpy(buffer+dataPos,lastGlobalBuffer,length-dataPos); #endif curByte+=length; dataPos+=length; @@ -1582,9 +1582,9 @@ u32 fileWrite (const char* buffer, aFile* file, u32 startOffset, u32 length) // Read first part from buffer, to align with sector boundary dataPos=0; #ifdef TWOCARD - tonccpy(globalBuffer[file->card2]+curByte,buffer,beginBytes); + __aeabi_memcpy(globalBuffer[file->card2]+curByte,buffer,beginBytes); #else - tonccpy(globalBuffer+curByte,buffer,beginBytes); + __aeabi_memcpy(globalBuffer+curByte,buffer,beginBytes); #endif curByte+=beginBytes; dataPos+=beginBytes; @@ -1687,9 +1687,9 @@ u32 fileWrite (const char* buffer, aFile* file, u32 startOffset, u32 length) // Read in last partial chunk #ifdef TWOCARD - tonccpy(lastGlobalBuffer[file->card2]+curByte,buffer+dataPos,length-dataPos); + __aeabi_memcpy(lastGlobalBuffer[file->card2]+curByte,buffer+dataPos,length-dataPos); #else - tonccpy(lastGlobalBuffer+curByte,buffer+dataPos,length-dataPos); + __aeabi_memcpy(lastGlobalBuffer+curByte,buffer+dataPos,length-dataPos); #endif curByte+=length; dataPos+=length; diff --git a/retail/common/source_general/abi_memcpy.s b/retail/common/source_general/abi_memcpy.s new file mode 100644 index 000000000..ad76c21aa --- /dev/null +++ b/retail/common/source_general/abi_memcpy.s @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ABI: +// __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8 +// Standard: +// memcpy +// Support: +// __ndsabi_memcpy2, __ndsabi_memcpy1 + +#include "asminc.h" + +#include "macros.inc" + + .syntax unified + + .arm + + + +BEGIN_ASM_FUNC __aeabi_memcpy + + @ >6-bytes is roughly the threshold when byte-by-byte copy is slower + cmp r2, #6 + ble __ndsabi_memcpy1 + + align_switch r0, r1, r3, __ndsabi_memcpy1, .Lcopy_halves + + @ Check if r0 (or r1) needs word aligning + rsbs r3, r0, #4 + joaobapt_test r3 + + @ Copy byte head to align + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + submi r2, r2, #1 + @ r0, r1 are now half aligned + + @ Copy half head to align + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + subcs r2, r2, #2 + @ r0, r1 are now word aligned + + +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy8 +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memcpy4 + + cmp r2, #32 + blt .Lcopy_words + + @ Word aligned, 32-byte copy + push {r4-r10} +.Lloop_32: + subs r2, r2, #32 + ldmiage r1!, {r3-r10} + stmiage r0!, {r3-r10} + bgt .Lloop_32 + pop {r4-r10} + bxeq lr + + @ < 32 bytes remaining to be copied + add r2, r2, #32 + +.Lcopy_words: + cmp r2, #4 + blt .Lcopy_halves +.Lloop_4: + subs r2, r2, #4 + ldrge r3, [r1], #4 + strge r3, [r0], #4 + bgt .Lloop_4 + bxeq lr + + @ Copy byte & half tail + @ This test still works when r2 is negative + joaobapt_test r2 + @ Copy half + ldrhcs r3, [r1], #2 + strhcs r3, [r0], #2 + @ Copy byte + ldrbmi r3, [r1] + strbmi r3, [r0] + bx lr + +.Lcopy_halves: + @ Copy byte head to align + tst r0, #1 + ldrbne r3, [r1], #1 + strbne r3, [r0], #1 + subne r2, r2, #1 + @ r0, r1 are now half aligned + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy2 + + subs r2, r2, #2 + ldrhge r3, [r1], #2 + strhge r3, [r0], #2 + bgt __ndsabi_memcpy2 + bxeq lr + + @ Copy byte tail + adds r2, r2, #2 + ldrbne r3, [r1] + strbne r3, [r0] + bx lr + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_memcpy1 + + subs r2, r2, #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + bgt __ndsabi_memcpy1 + bx lr + + +@BEGIN_ASM_FUNC abi_memcpy + +@ push {r0, lr} +@ bl __aeabi_memcpy +@ pop {r0, lr} +@ bx lr diff --git a/retail/common/source_general/abi_memset.s b/retail/common/source_general/abi_memset.s new file mode 100644 index 000000000..76950130b --- /dev/null +++ b/retail/common/source_general/abi_memset.s @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: Zlib +// SPDX-FileNotice: Modified from the original version by the BlocksDS project. +// +// Copyright (C) 2021-2023 agbabi contributors +// +// ABI: +// __aeabi_memclr, __aeabi_memclr4, __aeabi_memclr8, +// __aeabi_memset, __aeabi_memset4, __aeabi_memset8 +// Standard: +// memset +// Support: +// __ndsabi_wordset4, __ndsabi_lwordset4, __ndsabi_memset1 + +#include "asminc.h" + +#include "macros.inc" + + .syntax unified + + .arm + + +BEGIN_ASM_FUNC __aeabi_memclr + + mov r2, #0 + b __aeabi_memset + + +BEGIN_ASM_FUNC __aeabi_memclr8 +BEGIN_ASM_FUNC __aeabi_memclr4 + + mov r2, #0 + b __ndsabi_wordset4 + + +BEGIN_ASM_FUNC __aeabi_memset + + @ < 8 bytes probably won't be aligned: go byte-by-byte + cmp r1, #8 + blt __ndsabi_memset1 + + @ Copy head to align to next word + rsb r3, r0, #4 + joaobapt_test r3 + strbmi r2, [r0], #1 + submi r1, r1, #1 + strbcs r2, [r0], #1 + strbcs r2, [r0], #1 + subcs r1, r1, #2 + + +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memset8 +BEGIN_ASM_FUNC_NO_SECTION __aeabi_memset4 + + lsl r2, r2, #24 + orr r2, r2, r2, lsr #8 + orr r2, r2, r2, lsr #16 + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_wordset4 + + mov r3, r2 + + +BEGIN_ASM_FUNC_NO_SECTION __ndsabi_lwordset4 + + @ 16 words is roughly the threshold when lwordset is slower + cmp r1, #64 + blt .Lset_2_words + + @ 8 word set + push {r4-r9} + mov r4, r2 + mov r5, r3 + mov r6, r2 + mov r7, r3 + mov r8, r2 + mov r9, r3 + +.Lset_8_words: + subs r1, r1, #32 + stmiage r0!, {r2-r9} + bgt .Lset_8_words + pop {r4-r9} + bxeq lr + + @ Fixup remaining + add r1, r1, #32 +.Lset_2_words: + subs r1, r1, #8 + stmiage r0!, {r2-r3} + bgt .Lset_2_words + bxeq lr + + @ Test for remaining word + adds r1, r1, #4 + strge r2, [r0], #4 + bxeq lr + + @ Set tail + joaobapt_test r1 + strhcs r2, [r0], #2 + strbmi r2, [r0], #1 + bx lr + + +BEGIN_ASM_FUNC __ndsabi_memset1 + + subs r1, r1, #1 + strbge r2, [r0], #1 + bgt __ndsabi_memset1 + bx lr + + +@BEGIN_ASM_FUNC abi_memset + +@ mov r3, r1 +@ mov r1, r2 +@ mov r2, r3 +@ push {r0, lr} +@ bl __aeabi_memset +@ pop {r0, lr} +@ bx lr diff --git a/retail/common/source_general/tonccpy.c b/retail/common/source_general/tonccpy.c deleted file mode 100644 index caff2a361..000000000 --- a/retail/common/source_general/tonccpy.c +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef NO_TONCCPY - -#include "tonccpy.h" -//# tonccpy.c - -//! VRAM-safe cpy. -/*! This version mimics memcpy in functionality, with - the benefit of working for VRAM as well. It is also - slightly faster than the original memcpy, but faster - implementations can be made. - \param dst Destination pointer. - \param src Source pointer. - \param size Fill-length in bytes. - \note The pointers and size need not be word-aligned. -*/ -void tonccpy(void *dst, const void *src, uint size) -{ - if(size==0 || dst==0 || src==0) - return; - - uint count; - u16 *dst16; // hword destination - u8 *src8; // byte source - - // Ideal case: copy by 4x words. Leaves tail for later. - if( ((u32)src|(u32)dst)%4==0 && size>=4) - { - u32 *src32= (u32*)src, *dst32= (u32*)dst; - - count= size/4; - uint tmp= count&3; - count /= 4; - - // Duff's Device, good friend! - switch(tmp) { - do { *dst32++ = *src32++; - case 3: *dst32++ = *src32++; - case 2: *dst32++ = *src32++; - case 1: *dst32++ = *src32++; - case 0: ; } while(count--); - } - - // Check for tail - size &= 3; - if(size == 0) - return; - - src8= (u8*)src32; - dst16= (u16*)dst32; - } - else // Unaligned. - { - uint dstOfs= (u32)dst&1; - src8= (u8*)src; - dst16= (u16*)(dst-dstOfs); - - // Head: 1 byte. - if(dstOfs != 0) - { - *dst16= (*dst16 & 0xFF) | *src8++<<8; - dst16++; - if(--size==0) - return; - } - } - - // Unaligned main: copy by 2x byte. - count= size/2; - while(count--) - { - *dst16++ = src8[0] | src8[1]<<8; - src8 += 2; - } - - // Tail: 1 byte. - if(size&1) - *dst16= (*dst16 &~ 0xFF) | *src8; -} -//# toncset.c - -//! VRAM-safe memset, internal routine. -/*! This version mimics memset in functionality, with - the benefit of working for VRAM as well. It is also - slightly faster than the original memset. - \param dst Destination pointer. - \param fill Word to fill with. - \param size Fill-length in bytes. - \note The \a dst pointer and \a size need not be - word-aligned. In the case of unaligned fills, \a fill - will be masked off to match the situation. -*/ -void __toncset(void *dst, u32 fill, uint size) -{ - if(size==0 || dst==0) - return; - - uint left= (u32)dst&3; - u32 *dst32= (u32*)(dst-left); - u32 count, mask; - - // Unaligned head. - if(left != 0) - { - // Adjust for very small stint. - if(left+size<4) - { - mask= BIT_MASK(size*8)<<(left*8); - *dst32= (*dst32 &~ mask) | (fill & mask); - return; - } - - mask= BIT_MASK(left*8); - *dst32= (*dst32 & mask) | (fill&~mask); - dst32++; - size -= 4-left; - } - - // Main stint. - count= size/4; - uint tmp= count&3; - count /= 4; - - switch(tmp) { - do { *dst32++ = fill; - case 3: *dst32++ = fill; - case 2: *dst32++ = fill; - case 1: *dst32++ = fill; - case 0: ; } while(count--); - } - - // Tail - size &= 3; - if(size) - { - mask= BIT_MASK(size*8); - *dst32= (*dst32 &~ mask) | (fill & mask); - } -} -#endif \ No newline at end of file