diff --git a/build/tools/sctools/copy_dst/Makefile b/build/tools/sctools/copy_dst/Makefile index ec2e829..e04410c 100644 --- a/build/tools/sctools/copy_dst/Makefile +++ b/build/tools/sctools/copy_dst/Makefile @@ -40,7 +40,7 @@ ES_ROOT = $(ES_LATEST) LINCLUDES = $(TWLSDK_ROOT)/build/libraries/lcfg/ARM9.TWL/include ../common/src \ $(ES_ROOT)/twl/include $(ES_ROOT)/common/lib/ec/include -LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib +LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib/$(TWL_BUILDTYPE) # LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) diff --git a/build/tools/sctools/copy_dst/banner/icon/gameIcon.bmp b/build/tools/sctools/copy_dst/banner/icon/gameIcon.bmp index 6aa182d..1d76d8a 100644 Binary files a/build/tools/sctools/copy_dst/banner/icon/gameIcon.bmp and b/build/tools/sctools/copy_dst/banner/icon/gameIcon.bmp differ diff --git a/build/tools/sctools/copy_dst/src/hatamotolib.cpp b/build/tools/sctools/copy_dst/src/hatamotolib.cpp index 4008572..063a573 100644 --- a/build/tools/sctools/copy_dst/src/hatamotolib.cpp +++ b/build/tools/sctools/copy_dst/src/hatamotolib.cpp @@ -27,6 +27,9 @@ #ifdef SDK_RELEASE #define ECDL_LOG(msg) OS_TPrintf("ECDL-LOG: %s\n", msg); #endif +#ifdef SDK_FINALROM +#define ECDL_LOG(msg) OS_TPrintf("ECDL-LOG: %s\n", msg); +#endif diff --git a/build/tools/sctools/copy_dst/src/main.c b/build/tools/sctools/copy_dst/src/main.c index dcfe62f..8286c56 100644 --- a/build/tools/sctools/copy_dst/src/main.c +++ b/build/tools/sctools/copy_dst/src/main.c @@ -47,10 +47,13 @@ //================================================================================ +#define MIYA_MCU 1 + static BOOL completed_flag = FALSE; static FSEventHook sSDHook; static BOOL sd_card_flag = FALSE; -static BOOL reboot_flag = FALSE; +//static BOOL reboot_flag = FALSE; +static volatile BOOL reboot_flag; static u8 WorkForNA[NA_VERSION_DATA_WORK_SIZE]; @@ -569,6 +572,7 @@ static void MyThreadProc(void *arg) (void)OS_SendMessage(&MyMesgQueue_response, (OSMessage)0, OS_MESSAGE_NOBLOCK); (void)OS_ReceiveMessage(&MyMesgQueue_request, &message, OS_MESSAGE_BLOCK); flag = TRUE; + twl_card_validation_flag = TRUE; /* MydataLoadはすでにやっているのでいらない。 */ for( function_counter = 0 ; function_counter < function_table_max ; function_counter++ ) { if( FALSE == (function_table[function_counter])() ) { @@ -705,6 +709,27 @@ static BOOL myTWLCardCallback( void ) return FALSE; // means that not terminate. } +#ifdef MIYA_MCU + +static volatile u8 miya_mcu_free_register = 0x44; + +static void miya_mcu_free_reg_pxi_callback(PXIFifoTag tag, u32 data, BOOL err) +{ +#pragma unused(tag) +#pragma unused(err) + miya_mcu_free_register = (u8)(0xff & data); +} + +static void miya_mcu_free_reg_send_pxi_data(u32 data) +{ + while (PXI_SendWordByFifo(PXI_FIFO_TAG_USER_0, data, FALSE) != PXI_FIFO_SUCCESS) + { + // do nothing + } +} +#endif + + void TwlMain(void) { void* newArenaLo; @@ -726,6 +751,7 @@ void TwlMain(void) BOOL MydataLoadDecrypt_dir_flag = TRUE; BOOL MydataLoadDecrypt_success_flag = TRUE; + OS_Init(); OS_InitThread(); @@ -771,6 +797,20 @@ void TwlMain(void) SEA_Init(); reboot_flag = OS_IsRebooted(); + /* OS_IsRebootedなんかおかしい・・ */ + + +#ifdef MIYA_MCU + PXI_SetFifoRecvCallback(PXI_FIFO_TAG_USER_0, miya_mcu_free_reg_pxi_callback); + miya_mcu_free_reg_send_pxi_data( 0 ); + + if( miya_mcu_free_register == 0x55 ) { + reboot_flag = TRUE; + } + else { + reboot_flag = FALSE; + } +#endif /* デバッグのために今だけ強制的にオン(UPDATE mode) */ /* miya */ // reboot_flag = TRUE; @@ -785,8 +825,8 @@ void TwlMain(void) else { sd_card_flag = TRUE; } - FS_RegisterEventHook("sdmc", &sSDHook, SDEvents, NULL); + FS_RegisterEventHook("sdmc", &sSDHook, SDEvents, NULL); if( FALSE == Read_SystemMenuVersion(&s_major, &s_minor, &s_timestamp) ) { m_set_palette(tc[0], M_TEXT_COLOR_RED ); @@ -800,6 +840,7 @@ void TwlMain(void) ES_InitLib(); + if( FALSE == MiyaReadHWNormalInfo( &hwn_info ) ) { m_set_palette(tc[0], 0x1); /* red */ mprintf("HW Normal Info. read error.\n"); @@ -839,17 +880,28 @@ void TwlMain(void) OS_TPrintf("DeviceID: %s\n", mydata.bmsDeviceId); } + // mprintf("mcu reg 0x%02X\n", miya_mcu_free_register ); +#ifdef MIYA_MCU + if( miya_mcu_free_register == 0x55 ) { + reboot_flag = TRUE; + } + else { + reboot_flag = FALSE; + } +#endif - +#if 1 (void)m_get_key_trigger(); keyData = m_get_key_code(); if ( keyData & PAD_BUTTON_X ) { reboot_flag = TRUE; } +#endif if( FALSE == reboot_flag ) { + mprintf("Network update mode\n"); /* 最初はネットワークアップデート。 */ // NSSL_Init(&s_sslConfig); @@ -875,14 +927,9 @@ void TwlMain(void) init_my_thread_nuc(); - -#if 0 /* 自動スタートはいらない */ - if( sd_card_flag == TRUE ) { - start_my_thread(); - } -#endif if( sd_card_flag == TRUE ) { text_blink_current_line(tc[0]); + /* 自動スタートはいらない */ mprintf("press A button to start UPDATE\n\n"); } else { @@ -892,7 +939,8 @@ void TwlMain(void) } else { - // 不要:NAM の初期化 + mprintf("user data restore mode\n"); + // NAM の初期化 NAM_Init(&AllocForNAM, &FreeForNAM); /* 書き戻し過程 */ diff --git a/build/tools/sctools/copy_org/Makefile b/build/tools/sctools/copy_org/Makefile index 5499097..fa1c6d1 100644 --- a/build/tools/sctools/copy_org/Makefile +++ b/build/tools/sctools/copy_org/Makefile @@ -39,7 +39,7 @@ ES_ROOT = $(ES_LATEST) LINCLUDES = $(TWLSDK_ROOT)/build/libraries/lcfg/ARM9.TWL/include ../common/src \ $(ES_ROOT)/twl/include $(ES_ROOT)/common/lib/ec/include -LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib +LLIBRARY_DIRS += $(ES_ROOT)/twl/lib/$(TWL_BUILDTYPE) ../wifilib/$(TWL_BUILDTYPE) LLIBRARIES += libecx$(TWL_LIBSUFFIX).a \ diff --git a/build/tools/sctools/copy_org/banner/icon/gameIcon.bmp b/build/tools/sctools/copy_org/banner/icon/gameIcon.bmp index 335953c..792db57 100644 Binary files a/build/tools/sctools/copy_org/banner/icon/gameIcon.bmp and b/build/tools/sctools/copy_org/banner/icon/gameIcon.bmp differ diff --git a/build/tools/sctools/my_armadillo.TWL/src/main.c b/build/tools/sctools/my_armadillo.TWL/src/main.c index 19f33a1..ae6b23b 100644 --- a/build/tools/sctools/my_armadillo.TWL/src/main.c +++ b/build/tools/sctools/my_armadillo.TWL/src/main.c @@ -80,6 +80,27 @@ static s32 CheckCorrectNCD(NVRAMConfig* ncdsp); #endif static void VBlankIntr(void); + +#define MIYA_MCU_FREE_REG_NO 1 +#define MIYA_MCU_FREE_REG_CODE 0x55 +static u8 miya_mcu_free_register = 0x66; + + +static void miya_mcu_free_reg_send_pxi_data(u32 data) +{ + while (PXI_SendWordByFifo(PXI_FIFO_TAG_USER_0, data, FALSE) != PXI_FIFO_SUCCESS) { + // do nothing + } +} + + +static void miya_mcu_free_reg_pxi_callback(PXIFifoTag tag, u32 data, BOOL err) +{ +#pragma unused(tag) +#pragma unused(err) + miya_mcu_free_reg_send_pxi_data( (u32)miya_mcu_free_register ); +} + /*---------------------------------------------------------------------------* Name: TwlSpMain Description: 起動ベクタ。 @@ -130,6 +151,14 @@ TwlSpMain(void) WVR_Begin(heapHandle); // NITRO 無線 SPI_Init(THREAD_PRIO_SPI); + + miya_mcu_free_register = MCU_GetFreeRegister( (u8)MIYA_MCU_FREE_REG_NO ); + + (void)MCU_SetFreeRegister( (u8)MIYA_MCU_FREE_REG_NO , (u8)MIYA_MCU_FREE_REG_CODE ); + + PXI_SetFifoRecvCallback(PXI_FIFO_TAG_USER_0, miya_mcu_free_reg_pxi_callback); + + while (TRUE) { OS_Halt(); diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.a new file mode 100644 index 0000000..3e19a02 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.thumb.a new file mode 100644 index 0000000..1f1f29d Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnhttp.nssl.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.a new file mode 100644 index 0000000..73c5238 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.thumb.a new file mode 100644 index 0000000..1bc9079 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnssl.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.a new file mode 100644 index 0000000..3b0958c Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.thumb.a new file mode 100644 index 0000000..13f4adf Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Debug/libnuc.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/libnhttp.nssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnhttp.nssl.TWL.LTD.a similarity index 100% rename from build/tools/sctools/wifilib/libnhttp.nssl.TWL.LTD.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnhttp.nssl.TWL.LTD.a diff --git a/build/tools/sctools/wifilib/libnhttp.nssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnhttp.nssl.TWL.LTD.thumb.a similarity index 100% rename from build/tools/sctools/wifilib/libnhttp.nssl.TWL.LTD.thumb.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnhttp.nssl.TWL.LTD.thumb.a diff --git a/build/tools/sctools/wifilib/libnssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.a similarity index 84% rename from build/tools/sctools/wifilib/libnssl.TWL.LTD.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.a index d87d250..07acfdc 100644 Binary files a/build/tools/sctools/wifilib/libnssl.TWL.LTD.a and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/libnssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.thumb.a similarity index 84% rename from build/tools/sctools/wifilib/libnssl.TWL.LTD.thumb.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.thumb.a index c5660d3..3710c5b 100644 Binary files a/build/tools/sctools/wifilib/libnssl.TWL.LTD.thumb.a and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnssl.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/libnuc.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.a similarity index 71% rename from build/tools/sctools/wifilib/libnuc.TWL.LTD.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.a index 02ffc2c..4ae07fb 100644 Binary files a/build/tools/sctools/wifilib/libnuc.TWL.LTD.a and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/libnuc.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.thumb.a similarity index 69% rename from build/tools/sctools/wifilib/libnuc.TWL.LTD.thumb.a rename to build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.thumb.a index a751ee5..a5cbf68 100644 Binary files a/build/tools/sctools/wifilib/libnuc.TWL.LTD.thumb.a and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Release/libnuc.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.a new file mode 100644 index 0000000..b0e0ffd Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.thumb.a new file mode 100644 index 0000000..74aa276 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnhttp.nssl.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.a new file mode 100644 index 0000000..583a092 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.thumb.a new file mode 100644 index 0000000..16fa575 Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnssl.TWL.LTD.thumb.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.a new file mode 100644 index 0000000..323bcab Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.a differ diff --git a/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.thumb.a b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.thumb.a new file mode 100644 index 0000000..d47f20d Binary files /dev/null and b/build/tools/sctools/wifilib/ARM9-TS.LTD/Rom/libnuc.TWL.LTD.thumb.a differ