diff --git a/build/libraries_sysmenu/hotsw/ARM7/Makefile b/build/libraries_sysmenu/hotsw/ARM7/Makefile index 544cac43..9e7e28c7 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/Makefile +++ b/build/libraries_sysmenu/hotsw/ARM7/Makefile @@ -34,9 +34,7 @@ SRCS = blowfish.c \ ds_blowfish_table.c \ dsCardCommon.c \ romEmulation.c \ - customNDma.c \ -# dsCardType1.c \ -# dsCardType2.c \ + customNDma.c TARGET_LIB = libhotsw_sp$(TWL_LIBSUFFIX).a diff --git a/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h b/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h index 559cf008..f38a49d9 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h +++ b/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h @@ -21,10 +21,14 @@ extern "C" { #endif +#define USE_LOCAL_KEYTABLE + /*************************************************************************/ +#ifdef USE_LOCAL_KEYTABLE // 初期化テーブル extern const BLOWFISH_CTX GCDi_BlowfishInitTableDS; +#endif // Function Prototype ------------------------------------------------------------------------ // Blowfish 初期化 diff --git a/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c b/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c index 116b4d5c..2da68dbe 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c +++ b/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c @@ -18,7 +18,6 @@ // Function Prototype ------------------------------------------------------- static u32 F(const BLOWFISH_CTX *ctx, u32 x); -//static void GCDi_InitBlowfishKeyAndTableDS(BLOWFISH_CTX *ctx, u32 *keyBufp, s32 keyLen); //***************************************** // @@ -27,16 +26,22 @@ static u32 F(const BLOWFISH_CTX *ctx, u32 x); //***************************************** void GCDm_MakeBlowfishTableDS(CardBootData *cbd, s32 keyLen) { +#ifdef USE_LOCAL_KEYTABLE const BLOWFISH_CTX *blowfishInitTablep = &GCDi_BlowfishInitTableDS; +#endif u32 blowfishedKey[2]; u8 *RomHeaderCtrlRsvB = cbd->pBootSegBuf->rh.s.ctrl_reserved_B; u32 *RomHeaderGameCode = (u32 *)cbd->pBootSegBuf->rh.s.game_code; u32 *keyBuf = cbd->keyBuf; BLOWFISH_CTX *ctx = &cbd->keyTable; - - MI_CpuCopy32((void *)blowfishInitTablep, (void *)ctx, sizeof(BLOWFISH_CTX)); +#ifdef USE_LOCAL_KEYTABLE + MI_CpuCopyFast((void *)blowfishInitTablep, (void *)ctx, sizeof(BLOWFISH_CTX)); +#else + MI_CpuCopyFast((void *)HW_WRAM_0_LTD, (void *)ctx, sizeof(BLOWFISH_CTX)); +#endif + keyBuf[0] = *RomHeaderGameCode; keyBuf[1] = *RomHeaderGameCode >> 1; keyBuf[2] = *RomHeaderGameCode << 1; diff --git a/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c b/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c index 0c402ad0..323aeb15 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c +++ b/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c @@ -13,7 +13,7 @@ #include -const BLOWFISH_CTX GCDi_BlowfishInitTableDS = { +const BLOWFISH_CTX GCDi_BlowfishInitTableDS ATTRIBUTE_ALIGN(4) = { 0x5f20d599, 0xb9f54457, 0xd9a4196e, 0x945a6a9e, 0xebf1aed8, 0x3ae27541, 0x32d08293, 0xd531ee33, 0x9a6157cc, 0x1ba20637, 0xf5723979, 0xbef6ae55,