From 6d24607229001300d0c79b0a6f1ae9019b054240 Mon Sep 17 00:00:00 2001 From: N1277 Date: Wed, 3 Feb 2010 11:17:40 +0000 Subject: [PATCH] =?UTF-8?q?=E5=90=B8=E5=87=BA=E3=81=97=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=83=8A=E3=83=AA=E3=81=B8ROM=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2917 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../tests/CardCopyMultiBoot/include/common.h | 1 + build/tests/CardCopyMultiBoot/readme.txt | 2 +- build/tests/CardCopyMultiBoot/src/common.c | 22 +++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/build/tests/CardCopyMultiBoot/include/common.h b/build/tests/CardCopyMultiBoot/include/common.h index 1dcd8db1..3096e94e 100644 --- a/build/tests/CardCopyMultiBoot/include/common.h +++ b/build/tests/CardCopyMultiBoot/include/common.h @@ -23,6 +23,7 @@ extern "C" { #include +#define CARD_SECURE_AREA_OFFSET 0x4000 // 16KB #define CARD_GAME_AREA_OFFSET 0x8000 // 32KB diff --git a/build/tests/CardCopyMultiBoot/readme.txt b/build/tests/CardCopyMultiBoot/readme.txt index 25c2d1af..de20660a 100644 --- a/build/tests/CardCopyMultiBoot/readme.txt +++ b/build/tests/CardCopyMultiBoot/readme.txt @@ -1,6 +1,6 @@ 【card_copy操作手順】 -1. TWL 開発機へ NMenu または NandInitializer で card_copy.tad をインポート(インポート済みなら不要) +1. TWL 開発機へ NMenu または NandInitializer で card_copy_*.tad をインポート(インポート済みなら不要) 2. TWL メニューから「カードコピーマルチブート」 NAND アプリを起動 3. NTR へ吸い出したい DS カードを差す 4. NTR の DS ダウンロードメニューを起動 diff --git a/build/tests/CardCopyMultiBoot/src/common.c b/build/tests/CardCopyMultiBoot/src/common.c index 11cf425e..02d590e1 100644 --- a/build/tests/CardCopyMultiBoot/src/common.c +++ b/build/tests/CardCopyMultiBoot/src/common.c @@ -207,14 +207,32 @@ void MpSendCallback(BOOL result) { #pragma unused( result ) CARDRomHeader* rh = (void*)CARD_GetRomHeader(); + u32 rh_size = sizeof(CARDRomHeaderNTR); u32 limit = rh->rom_size + CARD_ROM_PAGE_SIZE; - u32 offset = CARD_GAME_AREA_OFFSET + WH_CHILD_SIZE * send_counter[0]; + u32 offset = WH_CHILD_SIZE * send_counter[0]; BgSetMessage(PLTT_YELLOW, " Sending: ROM addr=0x%x", offset); if ( offset < limit ) { - CARD_ReadRom( MI_DMA_NOT_USE, (void*)offset, gSendBuf, WH_CHILD_SIZE ); + if ( offset < rh_size ) + { + u32 rem = rh_size%WH_CHILD_SIZE; + MI_CpuCopy8( &((u8*)rh)[offset], gSendBuf, WH_CHILD_SIZE ); + if ( offset >= MATH_ROUNDDOWN(rh_size, WH_CHILD_SIZE) ) + { + MI_CpuFill8( &gSendBuf[rem], 0, WH_CHILD_SIZE - rem ); + } + } + else + if ( offset < CARD_GAME_AREA_OFFSET ) + { + MI_CpuFill8(gSendBuf, 0, WH_CHILD_SIZE); + } + else + { + CARD_ReadRom( MI_DMA_NOT_USE, (void*)offset, gSendBuf, WH_CHILD_SIZE ); + } gSendBuf[WH_CHILD_SIZE] = FALSE; if ( (offset + WH_CHILD_SIZE) >= limit ) {