mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
NandFirmWriteをコミット
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2870 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
c88c6d9894
commit
3ceb1410a8
90
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/Makefile
Normal file
90
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/Makefile
Normal file
@ -0,0 +1,90 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - components - armadillo.TWL
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2008-08-15#$
|
||||
# $Rev: 2167 $
|
||||
# $Author: yosiokat $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
override TARGET_PLATFORM = TWL
|
||||
override TWL_PROC = ARM7
|
||||
override TWL_ARCHGEN = LIMITED
|
||||
##override TWL_PLATFORM = TS
|
||||
TWL_NO_STD_PCHDR = True
|
||||
override TARGET_CODEGEN = ARM
|
||||
|
||||
ifndef TWLSDK_NOCRYPTO
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = crt0.SCFG_NOLOCK.c \
|
||||
main.c \
|
||||
kami_pxi.c \
|
||||
formatter.c \
|
||||
mcu_firm.c
|
||||
|
||||
TARGET_NAME = armadillo
|
||||
|
||||
TARGET_NEF = $(TARGET_NAME).tef
|
||||
LCFILE_SPEC = $(TARGET_NAME).lsf
|
||||
LCFILE_TEMPLATE = $(ROOT)/build/components/$(TARGET_NAME).TWL/$(TARGET_NAME).lcf.template
|
||||
LDRES_TEMPLATE = $(ROOT)/build/components/$(TARGET_NAME).TWL/$(TARGET_NAME).response.template
|
||||
|
||||
CRT0_O = crt0.SCFG_NOLOCK.o
|
||||
|
||||
# スタック不足防止の為、インライン展開せずにコンパイルする
|
||||
CCFLAGS_OPT = -O4 -inline off
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
MACRO_FLAGS += -DSDK_ARM7COMP_LTD -DSDK_SEA -DSDK_NOINIT
|
||||
|
||||
MAKELCF_FLAGS += -DISDBG_LIBS_TWL='$(if $(ISDBG_LIBS_TWL),$(ISDBG_LIBS_TWL),libstubsistd_sp$(TWL_LIBSUFFIX).a)' \
|
||||
-DISDBG_LIBS_NITRO='libstubsisd_sp$(TWL_LIBSUFFIX).a'
|
||||
|
||||
LINCLUDES += $(ROOT)/build/libraries/spi/ARM7/include \
|
||||
$(ROOT)/build/libraries/os/common/include \
|
||||
$(TWL_IPL_RED_ROOT)/include \
|
||||
../common/include \
|
||||
$(ROOT)/build/libraries/init/common/include \
|
||||
../../common/ARM7/include \
|
||||
$(ROOT)/build/libraries/fatfs/ARM7.TWL/include \
|
||||
$(ROOT)/build/libraries/fatfs/ARM7.TWL/include/fatfs \
|
||||
$(ROOT)/build/libraries/fatfs/ARM7.TWL/include/twl/fatfs/ARM7
|
||||
|
||||
SRCDIR += ../../common/ARM7/src
|
||||
|
||||
LLIBRARY_DIRS += $(TWL_IPL_RED_ROOT)/lib/ARM7-TS/$(TWL_BUILD_DIR) \
|
||||
./obj/ARM7-TS.LTD/$(TWL_BUILD_DIR)
|
||||
|
||||
LLIBRARIES += libwl_sp$(TWL_LIBSUFFIX).a \
|
||||
libsdio_sp$(TWL_LIBSUFFIX).a \
|
||||
libathdrv_sp$(TWL_LIBSUFFIX).a \
|
||||
libwpa_sp$(TWL_LIBSUFFIX).a \
|
||||
libhotsw_sp$(TWL_LIBSUFFIX).a \
|
||||
libreloc_info_sp$(TWL_LIBSUFFIX).a
|
||||
|
||||
LLIBRARIES += libpm_sp.SYSMENU$(TWL_LIBSUFFIX).a
|
||||
GLIBRARIES := $(filter-out libpm_sp$(TWL_LIBSUFFIX).a,$(GLIBRARIES))
|
||||
|
||||
LDEPENDS_NEF = $(TWL_LIBS) $(LLIBRARIES)
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
endif #ifndef TWLSDK_NOCRYPTO
|
||||
|
||||
#===== End of Makefile =====
|
||||
89
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/armadillo.lsf
Normal file
89
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/armadillo.lsf
Normal file
@ -0,0 +1,89 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - components - armadillo.TWL
|
||||
# File: armadillo.lsf
|
||||
#
|
||||
# Copyright 2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded insructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2008-07-24#$
|
||||
# $Rev: 1990 $
|
||||
# $Author: kamikawa $
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Nitro LCF SPEC FILE
|
||||
#
|
||||
#--------
|
||||
Static $(TARGET_NAME)
|
||||
{
|
||||
Address 0x02380000
|
||||
StackSize 1024 1024
|
||||
|
||||
Library $(CRT0_O)
|
||||
}
|
||||
|
||||
#--------
|
||||
Ltdautoload SCRWRAM
|
||||
{
|
||||
Address 0x03740000
|
||||
|
||||
Library libsubpsyscall.a
|
||||
Library libsyscall_sp.twl.a
|
||||
Library $(CW_LIBS)
|
||||
Library $(ISDBG_LIBS_TWL)
|
||||
Library $(ISDBG_LIBS_NITRO)
|
||||
|
||||
Object * (.etable)
|
||||
Object $(OBJDIR)/main.o
|
||||
Object $(OBJDIR)/kami_pxi.o
|
||||
Object $(OBJDIR)/formatter.o
|
||||
Object $(OBJDIR)/mcu_firm.o
|
||||
|
||||
Library libsea_sp$(LIBSUFFIX).a
|
||||
Library libcrypto_sp$(LIBSUFFIX).a
|
||||
|
||||
Library libos_sp$(LIBSUFFIX).a
|
||||
Library libmi_sp$(LIBSUFFIX).a
|
||||
Library libstd_sp$(LIBSUFFIX).a
|
||||
Library libmath_sp$(LIBSUFFIX).a
|
||||
Library libpxi_sp$(LIBSUFFIX).a
|
||||
Library libexi_sp$(LIBSUFFIX).a
|
||||
Library libi2c_sp$(LIBSUFFIX).a
|
||||
Library libsdio_sp$(LIBSUFFIX).a
|
||||
Library libpad_sp$(LIBSUFFIX).a
|
||||
Library libscfg_sp$(LIBSUFFIX).a
|
||||
Library libmcu_sp$(LIBSUFFIX).a
|
||||
Library libcdc_sp$(LIBSUFFIX).a
|
||||
Library libsnd_sp$(LIBSUFFIX).a
|
||||
Library libsndex_sp$(LIBSUFFIX).a
|
||||
Library libspi_sp$(LIBSUFFIX).a
|
||||
Library libpm_sp.SYSMENU$(LIBSUFFIX).a
|
||||
Library libtp_sp$(LIBSUFFIX).a
|
||||
Library libtpex_sp$(LIBSUFFIX).a
|
||||
Library libmic_sp$(LIBSUFFIX).a
|
||||
Library libmicex_sp$(LIBSUFFIX).a
|
||||
Library libnvram_sp$(LIBSUFFIX).a
|
||||
Library librtc_sp$(LIBSUFFIX).a
|
||||
Library libfatfs_sp$(LIBSUFFIX).a
|
||||
Library libwm_sp$(LIBSUFFIX).a
|
||||
Library libnwm_sp$(LIBSUFFIX).a
|
||||
Library libwvr_sp$(LIBSUFFIX).a
|
||||
Library libwl_sp$(LIBSUFFIX).a
|
||||
Library libwpa_sp$(LIBSUFFIX).a
|
||||
Library libathdrv_sp$(LIBSUFFIX).a
|
||||
Library libfs_sp$(LIBSUFFIX).a
|
||||
Library libcard_sp$(LIBSUFFIX).a
|
||||
Library libcamera_sp$(LIBSUFFIX).a
|
||||
Library libhotsw_sp$(LIBSUFFIX).a
|
||||
Library libreloc_info_sp$(LIBSUFFIX).a
|
||||
|
||||
Object * (.wram)
|
||||
Object * (.ltdwram)
|
||||
Object * (.rsvwram)
|
||||
Object * (.main)
|
||||
Object * (.ltdmain)
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_pxi.h
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-03-31#$
|
||||
$Rev: 1005 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TWL_CAMERA_TEST_CAMERATEST_H_
|
||||
#define TWL_CAMERA_TEST_CAMERATEST_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
’è<EFBFBD>”’è‹`
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
void KamiPxiInit( void );
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* TWL_CAMERA_TEST_CAMERATEST_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
@ -0,0 +1,798 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - libraries - init - ARM7.TWL
|
||||
File: crt0.SCR.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-06-23#$
|
||||
$Rev: 1672 $
|
||||
$Author: yosiokat $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nitro/types.h>
|
||||
#include <nitro/hw/common/armArch.h>
|
||||
#include <twl/init/crt0.h>
|
||||
#include <twl/memorymap_sp.h>
|
||||
#include <twl/hw/common/mmap_wramEnv.h>
|
||||
#include <nitro/os/common/emulator.h>
|
||||
#ifndef SDK_FINALROM
|
||||
#include <nitro/os/common/printf.h>
|
||||
#endif
|
||||
#include "boot_sync.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void _start(void);
|
||||
void _start_AutoloadDoneCallback(void* argv[]);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
外部参照
|
||||
*---------------------------------------------------------------------------*/
|
||||
/* リンカスクリプトにより定義されるシンボル参照 */
|
||||
extern void SDK_AUTOLOAD_LIST(void);
|
||||
extern void SDK_AUTOLOAD_LIST_END(void);
|
||||
extern void SDK_AUTOLOAD_START(void);
|
||||
extern void SDK_STATIC_START(void);
|
||||
extern void SDK_STATIC_BSS_START(void);
|
||||
extern void SDK_STATIC_BSS_END(void);
|
||||
extern void SDK_LTDAUTOLOAD_LIST(void);
|
||||
extern void SDK_LTDAUTOLOAD_LIST_END(void);
|
||||
extern void SDK_LTDAUTOLOAD_START(void);
|
||||
extern void SDK_WRAM_ARENA_LO(void);
|
||||
|
||||
/* 外部関数参照 */
|
||||
extern void OS_IrqHandler(void);
|
||||
#ifndef SDK_NOINIT
|
||||
extern void _fp_init(void);
|
||||
extern void __call_static_initializers(void);
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define SDK_NITROCODE_LE 0x2106c0de
|
||||
#define SDK_NITROCODE_BE 0xdec00621
|
||||
#define SDK_TWLCODE_LE 0x6314c0de
|
||||
#define SDK_TWLCODE_BE 0xdec01463
|
||||
|
||||
/* .rodata セクションに配置するロードに必要な情報 */
|
||||
void* const _start_ModuleParams[] =
|
||||
{
|
||||
(void*)0,
|
||||
(void*)0,
|
||||
(void*)0,
|
||||
(void*)SDK_STATIC_BSS_START,
|
||||
(void*)SDK_STATIC_BSS_END,
|
||||
(void*)0,
|
||||
(void*)0,
|
||||
(void*)SDK_NITROCODE_BE,
|
||||
(void*)SDK_NITROCODE_LE,
|
||||
};
|
||||
|
||||
void* const _start_LtdModuleParams[] =
|
||||
{
|
||||
(void*)SDK_LTDAUTOLOAD_LIST,
|
||||
(void*)SDK_LTDAUTOLOAD_LIST_END,
|
||||
(void*)SDK_LTDAUTOLOAD_START,
|
||||
(void*)0,
|
||||
(void*)SDK_TWLCODE_BE,
|
||||
(void*)SDK_TWLCODE_LE,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ShakeHand
|
||||
Description: ARM9 の ShakeHand 関数と同期を取る。
|
||||
メインメモリでないメモリ空間で実行される必要がある。
|
||||
Arguments: r0 - ARM9 同期用変数へのポインタ。
|
||||
r1 - ARM7 同期用変数へのポインタ。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const u32 microcode_ShakeHand[10] =
|
||||
{
|
||||
0xe1d020b0, /* ldrh r2, [r0] ; 同期変数9を共有メモリから読む */
|
||||
0xe1d130b0, /* ldrh r3, [r1] ; 同期変数7を共有メモリから読む */
|
||||
0xe2833001, /* @1: add r3, r3, #1 ; 同期変数7 ++ */
|
||||
0xe1c130b0, /* strh r3, [r1] ; 同期変数7を共有メモリに書く */
|
||||
0xe1d0c0b0, /* ldrh r12, [r0] ; 同期変数9の現状を共有メモリから読む */
|
||||
0xe152000c, /* cmp r2, r12 ; 同期変数9の変化を判定する */
|
||||
0x0afffffa, /* beq @1 ; 変化していなければループ */
|
||||
0xe2833001, /* add r3, r3, #1 ; 同期変数7 ++ */
|
||||
0xe1c130b0, /* strh r3, [r1] ; 同期変数7を共有メモリに書く */
|
||||
0xe12fff1e /* bx lr ; ハンドシェイク完了 */
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: Stop
|
||||
Description: プログラムを停止する。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const u32 microcode_Stop[2] =
|
||||
{
|
||||
0xef000006, /* @1: swi #6 ; SVC_Halt */
|
||||
0xeafffffd /* b @1 ; ループ */
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: GotoMain
|
||||
Description: ARM9 に特定の状態になったことを伝えた上で、Main 関数へジャンプ
|
||||
する。同時に指定バッファの 0 クリアを行う。スタック内で動作させ
|
||||
ることを想定している為、スタックを一切使用しない。
|
||||
Arguments: r0 - 0 クリアするバッファの先頭アドレス。
|
||||
4 バイトアラインされたアドレスである必要がある。
|
||||
r1 - 上位 8 bit: ARM9 に伝えるフェーズ番号。
|
||||
下位 24 bit: 0 クリアするバッファのサイズ。
|
||||
4 の倍数である必要がある。
|
||||
r2 - 同期用フェーズ管理変数へのポインタ。
|
||||
r3 - Main 関数のポインタ。Main 関数が Thumb コードである場合
|
||||
には、bx 命令でジャンプするため最下位ビットが 1 になって
|
||||
いる必要がある。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const u32 microcode_GotoMain[10] =
|
||||
{
|
||||
0xe59fc01c, /* @1: ldr r12, [pc, #28] ; 下位 24 bit マスクを用意 */
|
||||
0xe111000c, /* tst r1, r12 ; クリアバッファ残サイズをチェック */
|
||||
0xe3a0c000, /* mov r12, #0 ; クリア用変数を用意 */
|
||||
0x1480c004, /* strne r12, [r0], #4 ; 4 バイトクリア */
|
||||
0x12411004, /* subne r1, r1, #4 ; クリアバッファ残サイズ -= 4 */
|
||||
0x1afffff9, /* bne @1 ; 残サイズが 0 になるまでループ */
|
||||
0xe1a01c21, /* mov r1, r1, LSR #24 ; フェーズ管理変数の更新値を用意 */
|
||||
0xe1c210b0, /* strh r1, [r2] ; フェーズ管理変数を更新 */
|
||||
0xe12fff13, /* bx r3 ; Main 関数へジャンプ */
|
||||
0x00fffffc /* <DATA> 0x00fffffc */
|
||||
};
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数プロトタイプ
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void INITi_CheckSysConfig(void);
|
||||
static void INITi_DetectMainMemorySize(void);
|
||||
static void INITi_Stop(void);
|
||||
static void INITi_DoAutoload(void);
|
||||
#ifndef SDK_NOINIT
|
||||
static void INITi_ShelterStaticInitializer(u32* ptr);
|
||||
static void INITi_CallStaticInitializers(void);
|
||||
#endif
|
||||
|
||||
static void* INITi_Copy32(void* dst, void* src, u32 size);
|
||||
static void* INITi_Fill32(void* dst, u32 value, u32 size);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <twl/code32.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: _start
|
||||
Description: 起動ベクタ。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
SDK_WEAK_SYMBOL asm void
|
||||
_start(void)
|
||||
{
|
||||
@000:
|
||||
/* 割込み禁止 */
|
||||
mov r12, #HW_REG_BASE
|
||||
str r12, [r12, #REG_IME_OFFSET]
|
||||
|
||||
/* SCFG 設定を確認 */
|
||||
bl INITi_CheckSysConfig
|
||||
|
||||
/* プリロードパラメータアドレスが格納されていない場合は、デフォルト値をセット */
|
||||
ldr r0, =HW_PRELOAD_PARAMETER_ADDR
|
||||
ldr r1, [r0]
|
||||
cmp r1, #0
|
||||
ldreq r1, =HW_PARAM_TWL_SETTINGS_DATA_DEFAULT
|
||||
streq r1, [r0]
|
||||
|
||||
/* ランチャーから渡された情報を退避 */
|
||||
ldr r3, =SDK_WRAM_ARENA_LO
|
||||
sub r2, r3, #0x40
|
||||
ldr r1, =HW_LAUNCHER_DELIVER_PARAM_BUF
|
||||
@001:
|
||||
cmp r2, r3
|
||||
ldrlt r0, [r1], #4
|
||||
strlt r0, [r2], #4
|
||||
blt @001
|
||||
|
||||
|
||||
/* ハンドシェイク用マイクロコードを専用 WRAM にコピー */
|
||||
ldr r1, =microcode_ShakeHand
|
||||
ldr r2, =HW_PRV_WRAM
|
||||
add r3, r2, #40 // sizeof(microcode_ShakeHand)
|
||||
@002: ldr r0, [r1], #4
|
||||
str r0, [r2], #4
|
||||
cmp r2, r3
|
||||
blt @002
|
||||
|
||||
/* 専用 WRAM 上のコードで ARM9 とハンドシェイク */
|
||||
ldr r0, =HW_BOOT_SHAKEHAND_9
|
||||
ldr r1, =HW_BOOT_SHAKEHAND_7
|
||||
ldr r2, =HW_PRV_WRAM
|
||||
mov lr, pc
|
||||
bx r2
|
||||
|
||||
@010:
|
||||
/* スタックポインタ設定 */
|
||||
mov r0, #HW_PSR_SVC_MODE // SuperVisor mode
|
||||
msr cpsr_c, r0
|
||||
ldr sp, =HW_PRV_WRAM_SVC_STACK_END
|
||||
mov r0, #HW_PSR_IRQ_MODE // IRQ mode
|
||||
msr cpsr_c, r0
|
||||
ldr sp, =HW_PRV_WRAM_IRQ_STACK_END
|
||||
ldr r1, =SDK_IRQ_STACKSIZE
|
||||
sub r1, sp, r1
|
||||
sub sp, sp, #4 // 4 bytes for IRQ stack check code
|
||||
mov r0, #HW_PSR_SYS_MODE // System mode
|
||||
msr cpsr_csfx, r0
|
||||
sub sp, r1, #4 // 4 bytes for SYS stack check code
|
||||
|
||||
/* スタック領域をクリア */
|
||||
ldr r0, =SDK_SYS_STACKSIZE
|
||||
sub r1, r1, r0
|
||||
ldr r2, =HW_PRV_WRAM_IRQ_STACK_END
|
||||
mov r0, #0
|
||||
@011: cmp r1, r2
|
||||
strlt r0, [r1], #4
|
||||
blt @011
|
||||
|
||||
/* Autoload を実施 */
|
||||
bl INITi_DoAutoload
|
||||
|
||||
/* STATIC セグメントの .bss セクションを 0 クリア */
|
||||
mov r1, #0 // r1 = clear value for STATIC bss section
|
||||
ldr r3, =_start_ModuleParams
|
||||
ldr r0, [r3, #12] // r0 = start address of STATIC bss section
|
||||
ldr r2, [r3, #16]
|
||||
subs r2, r2, r0 // r2 = size of STATIC bss section
|
||||
blgt INITi_Fill32
|
||||
|
||||
/* メインメモリサイズを調査 */
|
||||
bl INITi_DetectMainMemorySize
|
||||
|
||||
#ifndef SDK_FINALROM
|
||||
/* デバッグ出力ウィンドウを設定 */
|
||||
ldr r1, =HW_PRINT_OUTPUT_ARM9
|
||||
mov r0, #OS_PRINT_OUTPUT_DEFAULT_ARM9
|
||||
orr r0, r0, #(OS_PRINT_OUTPUT_DEFAULT_ARM7 << 8)
|
||||
strh r0, [r1]
|
||||
mov r0, #OS_PRINT_OUTPUT_DEFAULT_ARM9ERR
|
||||
orr r0, r0, #(OS_PRINT_OUTPUT_DEFAULT_ARM7ERR << 8)
|
||||
strh r0, [r1, #2]
|
||||
#endif
|
||||
|
||||
/* IRQ 割込みベクタ設定 */
|
||||
ldr r1, =HW_INTR_VECTOR_BUF
|
||||
ldr r0, =OS_IrqHandler
|
||||
str r0, [r1]
|
||||
|
||||
#ifndef SDK_NOINIT
|
||||
/* c++ 用初期化 */
|
||||
bl _fp_init
|
||||
bl TwlSpStartUp
|
||||
bl __call_static_initializers
|
||||
bl INITi_CallStaticInitializers
|
||||
#endif
|
||||
|
||||
@0f0:
|
||||
/* Main 関数へのジャンプ用マイクロコードをスタックの底にコピー */
|
||||
ldr r1, =microcode_GotoMain
|
||||
sub r2, sp, #40
|
||||
mov r3, sp
|
||||
@0f1: cmp r2, r3
|
||||
ldrlt r0, [r1], #4
|
||||
strlt r0, [r2], #4
|
||||
blt @0f1
|
||||
|
||||
/* マイクロコードを経由して Main 関数へジャンプ */
|
||||
ldr r0, =SDK_STATIC_START
|
||||
bic r0, r0, #0x00000003
|
||||
ldr r1, =SDK_STATIC_BSS_END
|
||||
sub r1, r1, r0
|
||||
add r1, r1, #3
|
||||
bic r1, r1, #0x00000003
|
||||
bic r1, r1, #0xff000000
|
||||
mov r2, #BOOT_SYNC_PHASE_4
|
||||
mov r2, r2, LSL #24
|
||||
orr r1, r1, r2
|
||||
ldr r2, =HW_BOOT_SYNC_PHASE
|
||||
ldr r3, =TwlSpMain
|
||||
ldr lr, =HW_RESET_VECTOR
|
||||
sub r12, sp, #40
|
||||
bx r12
|
||||
/* never return */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: _start_AutoloadDoneCallback
|
||||
Description: オートロード完了コールバック。
|
||||
Arguments: argv - オートロードパラメータを保持している配列。
|
||||
argv[0] = SDK_AUTOLOAD_LIST
|
||||
argv[1] = SDK_AUTOLOAD_LIST_END
|
||||
argv[2] = SDK_AUTOLOAD_START
|
||||
argv[3] = SDK_STATIC_BSS_START
|
||||
argv[4] = SDK_STATIC_BSS_END
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
SDK_WEAK_SYMBOL asm void
|
||||
_start_AutoloadDoneCallback(void* argv[])
|
||||
{
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_CheckSysConfig
|
||||
Description: SCFG 関連 I/O レジスタの内容を確認する。
|
||||
A7-SCFG ブロックがアクセス有効な場合には、ローダーが行う設定処
|
||||
理を代行した上でアクセスを無効化する。
|
||||
ARM7 専用 WRAM 内にローダーが展開している I/O レジスタ情報を確
|
||||
認した上でメインメモリ上の共有領域にコピーする。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void
|
||||
INITi_CheckSysConfig(void)
|
||||
{
|
||||
/* A7-SCFG のアクセス可否判定 */
|
||||
ldr r1, =REG_EXT_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r2, =HW_PRV_WRAM_SYSRV
|
||||
tst r0, #REG_SCFG_EXT_CFG_MASK
|
||||
beq @invalid
|
||||
|
||||
@valid:
|
||||
/* ARM7 Secure-ROM 切り離し */
|
||||
ldr r1, =REG_A7ROM_ADDR
|
||||
ldrb r0, [r1]
|
||||
orr r0, r0, #REG_SCFG_A7ROM_SEC_MASK
|
||||
strb r0, [r1]
|
||||
|
||||
/* ARM9 Secure-ROM 切り離し */
|
||||
ldr r1, =REG_A9ROM_ADDR
|
||||
ldrb r0, [r1]
|
||||
orr r0, r0, #REG_SCFG_A9ROM_SEC_MASK
|
||||
strb r0, [r1]
|
||||
|
||||
/* NITRO 無線を有効化 */
|
||||
ldr r1, =REG_WL_ADDR
|
||||
ldrh r0, [r1]
|
||||
orr r0, r0, #REG_SCFG_WL_OFFB_MASK
|
||||
strh r0, [r1]
|
||||
|
||||
/* ROM 設定、NITRO 無線設定、ボンディングオプション情報を WRAM に展開 */
|
||||
ldr r3, =REG_OP_ADDR // SCFG-OP
|
||||
ldrb r1, [r3]
|
||||
and r0, r1, #(REG_SCFG_OP_OP1_MASK | REG_SCFG_OP_OP0_MASK)
|
||||
ldr r3, =REG_A9ROM_ADDR // SCFG-ROM:0~7
|
||||
ldrb r1, [r3]
|
||||
and r3, r1, #(REG_SCFG_A9ROM_RSEL_MASK | REG_SCFG_A9ROM_SEC_MASK)
|
||||
orr r0, r0, r3, LSL #(HWi_WSYS08_ROM_ARM9RSEL_SHIFT - REG_SCFG_A9ROM_RSEL_SHIFT)
|
||||
ldr r3, =REG_A7ROM_ADDR // SCFG-ROM:8~15
|
||||
ldrb r1, [r3]
|
||||
and r3, r1, #(REG_SCFG_A7ROM_RSEL_MASK | REG_SCFG_A7ROM_FUSE_MASK)
|
||||
orr r0, r0, r3, LSL #(HWi_WSYS08_ROM_ARM7RSEL_SHIFT - REG_SCFG_A7ROM_RSEL_SHIFT)
|
||||
ldr r3, =REG_WL_ADDR // SCFG-WL
|
||||
ldrb r1, [r3]
|
||||
and r3, r1, #REG_SCFG_WL_OFFB_MASK
|
||||
orr r0, r0, r3, LSL #(HWi_WSYS08_WL_OFFB_SHIFT - REG_SCFG_WL_OFFB_SHIFT)
|
||||
strb r0, [r2, #HWi_WSYS08_WRAMOFFSET]
|
||||
|
||||
/* 各新規ブロックへクロックを供給 */
|
||||
ldr r1, =REG_CLK_ADDR
|
||||
ldrh r0, [r1]
|
||||
ldr r3, =REG_SCFG_CLK_SNDMCLK_MASK | REG_SCFG_CLK_WRAMHCLK_MASK | REG_SCFG_CLK_AESHCLK_MASK | REG_SCFG_CLK_SD2HCLK_MASK | REG_SCFG_CLK_SD1HCLK_MASK
|
||||
orr r0, r0, r3
|
||||
strh r0, [r1]
|
||||
|
||||
/* JTAG 情報を WRAM に展開 */
|
||||
ldr r3, =REG_JTAG_ADDR // SCFG-JTAG
|
||||
ldrh r1, [r3]
|
||||
and r0, r1, #(REG_SCFG_JTAG_CPUJE_MASK | REG_SCFG_JTAG_ARM7SEL_MASK)
|
||||
and r3, r1, #REG_SCFG_JTAG_DSPJE_MASK
|
||||
orr r0, r0, r3, LSR #(REG_SCFG_JTAG_DSPJE_SHIFT - HWi_WSYS09_JTAG_DSPJE_SHIFT)
|
||||
strb r0, [r2, #HWi_WSYS09_WRAMOFFSET]
|
||||
|
||||
/* 各拡張機能を有効化 */
|
||||
ldr r1, =REG_EXT_ADDR // SCFG_EXT
|
||||
ldr r0, [r1]
|
||||
ldr r3, =REG_SCFG_EXT_WRAM_MASK | REG_SCFG_EXT_GPIO_MASK | REG_SCFG_EXT_I2C_MASK | REG_SCFG_EXT_I2S_MASK | REG_SCFG_EXT_MIC_MASK | REG_SCFG_EXT_SD2_MASK | REG_SCFG_EXT_SD1_MASK | REG_SCFG_EXT_AES_MASK | REG_SCFG_EXT_DMAC_MASK
|
||||
orr r0, r0, r3
|
||||
orr r0, r0, #(REG_SCFG_EXT_DSEL_MASK | REG_SCFG_EXT_INTC_MASK)
|
||||
bic r0, r0, #REG_SCFG_EXT_MC_B_MASK
|
||||
str r0, [r1]
|
||||
|
||||
/* 各拡張機能の制御設定内容を WRAM に展開 */
|
||||
str r0, [r2, #HWi_WSYS04_WRAMOFFSET]
|
||||
|
||||
/* メモリーカード I/F のスロット選択 */
|
||||
ldr r1, =REG_MC1_ADDR // SCFG_MC1
|
||||
ldr r0, [r1]
|
||||
bic r0, r0, #REG_MI_MC1_SWP_MASK
|
||||
str r0, [r1]
|
||||
|
||||
/* WRAM-A/B/C が ARM7 に割り当たっていることを確認 */
|
||||
ldr r1, =REG_MBK1_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r3, =0x8d898581
|
||||
cmp r0, r3
|
||||
blne INITi_Stop
|
||||
ldr r1, =REG_MBK2_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r3, =0x8d898581
|
||||
cmp r0, r3
|
||||
blne INITi_Stop
|
||||
ldr r1, =REG_MBK3_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r3, =0x9d999591
|
||||
cmp r0, r3
|
||||
blne INITi_Stop
|
||||
ldr r1, =REG_MBK4_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r3, =0x8d898581
|
||||
cmp r0, r3
|
||||
blne INITi_Stop
|
||||
ldr r1, =REG_MBK5_ADDR
|
||||
ldr r0, [r1]
|
||||
ldr r3, =0x9d999591
|
||||
cmp r0, r3
|
||||
blne INITi_Stop
|
||||
|
||||
/* WRAM-A/B/C のメモリマップを設定 */
|
||||
ldr r1, =REG_MBK6_ADDR
|
||||
ldr r0, =0x080037c0
|
||||
str r0, [r1]
|
||||
ldr r1, =REG_MBK7_ADDR
|
||||
ldr r0, =0x07c03780
|
||||
str r0, [r1]
|
||||
ldr r1, =REG_MBK8_ADDR
|
||||
ldr r0, =0x07803740
|
||||
str r0, [r1]
|
||||
ldr r1, =REG_MBK9_ADDR
|
||||
ldr r0, =0x00ffff0f
|
||||
str r0, [r1]
|
||||
|
||||
/* A7-SCFG ブロックへのアクセスを無効化 */
|
||||
ldr r1, =REG_EXT_ADDR
|
||||
ldr r0, [r1]
|
||||
/* bic r0, r0, #REG_SCFG_EXT_CFG_MASK */
|
||||
str r0, [r1]
|
||||
|
||||
@invalid:
|
||||
/* ROM 設定、NITRO 無線設定内容を確認 */
|
||||
ldrb r0, [r2, #HWi_WSYS08_WRAMOFFSET]
|
||||
and r0, r0, #(HWi_WSYS08_ROM_ARM7RSEL_MASK | HWi_WSYS08_ROM_ARM9RSEL_MASK | HWi_WSYS08_ROM_ARM9SEC_MASK)
|
||||
cmp r0, #HWi_WSYS08_ROM_ARM9SEC_MASK
|
||||
blne INITi_Stop
|
||||
|
||||
/* SCFG レジスタ設定情報を共有領域にコピー */
|
||||
ldr r2, =HW_PRV_WRAM_SYSRV
|
||||
ldr r3, =HW_SYS_CONF_BUF
|
||||
ldr r0, [r2, #HWi_WSYS04_WRAMOFFSET]
|
||||
str r0, [r3, #HWi_WSYS04_OFFSET]
|
||||
ldrh r0, [r2, #HWi_WSYS08_WRAMOFFSET]
|
||||
strh r0, [r3, #HWi_WSYS08_OFFSET]
|
||||
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_DetectMainMemorySize
|
||||
Description: メインメモリサイズを調査する。
|
||||
調査結果は (u16*)HW_MMEMCHECER_SUB に格納される。
|
||||
格納される値は [OS_CONSOLE_SIZE_16MB|OS_CONSOLE_SIZE_32B]
|
||||
NOTE: プラットフォームが NITRO の場合は考慮していない。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define OSi_IMAGE_DIFFERENCE2 0xb000000
|
||||
#define OSi_DETECT_NITRO_MASK (REG_SND_SMX_CNT_E_MASK | REG_SND_SMX_CNT_FSEL_MASK)
|
||||
#define OSi_DETECT_NITRO_VAL (REG_SND_SMX_CNT_E_MASK)
|
||||
|
||||
#define OSi_CHECKNUM1 0x55
|
||||
#define OSi_CHECKNUM2 0xaa
|
||||
#define OSi_100usWAIT 3352 // 100us = 3351.4cycles(33.514MHz)
|
||||
|
||||
static asm void
|
||||
INITi_DetectMainMemorySize(void)
|
||||
{
|
||||
ldr r2, =HW_MMEMCHECKER_SUB
|
||||
add r3, r2, #OSi_IMAGE_DIFFERENCE2
|
||||
mov r0, #OS_CONSOLE_SIZE_16MB
|
||||
|
||||
/* OSi_CHECKNUM1 (0x55) 書き込みテスト */
|
||||
mov r1, #OSi_CHECKNUM1
|
||||
strb r1, [r3]
|
||||
|
||||
ldr r2, =OSi_100usWAIT
|
||||
@1 subs r2, r2, #4
|
||||
bcs @1
|
||||
|
||||
ldrb r1, [r3]
|
||||
cmp r1, #OSi_CHECKNUM1
|
||||
bne @check_smix
|
||||
|
||||
/* OSi_CHECKNUM2 (0xaa) を 書き込みテスト */
|
||||
mov r1, #OSi_CHECKNUM2
|
||||
strb r1, [r3]
|
||||
|
||||
ldr r2, =OSi_100usWAIT
|
||||
@2 subs r2, r2, #4
|
||||
bcs @2
|
||||
|
||||
ldrb r1, [r3]
|
||||
cmp r1, #OSi_CHECKNUM2
|
||||
moveq r0, #OS_CONSOLE_SIZE_32MB
|
||||
|
||||
@check_smix:
|
||||
/* SMIX レジスタを調査 */
|
||||
ldr r3, =REG_SMX_CNT_ADDR
|
||||
ldrh r1, [r3]
|
||||
and r1, r1, #OSi_DETECT_NITRO_MASK
|
||||
cmp r1, #OSi_DETECT_NITRO_VAL
|
||||
orreq r0, r0, #OS_CHIPTYPE_SMX_MASK
|
||||
|
||||
/* 調査結果を格納 */
|
||||
ldr r2, =HW_MMEMCHECKER_SUB
|
||||
strb r0, [r2]
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_Stop
|
||||
Description: プログラムを停止する。ARM7 専用 WRAM に Halt を繰り返すループ
|
||||
関数をコピーし、コピーした関数を実行する。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void
|
||||
INITi_Stop(void)
|
||||
{
|
||||
ldr r1, =microcode_Stop
|
||||
ldr r2, =HW_PRV_WRAM
|
||||
add r3, r2, #8 // sizeof(microcode_Stop)
|
||||
@copy_loop:
|
||||
ldr r0, [r1], #4
|
||||
str r0, [r2], #4
|
||||
cmp r2, r3
|
||||
blt @copy_loop
|
||||
|
||||
@stop_loop:
|
||||
ldr r0, =HW_PRV_WRAM
|
||||
mov lr, pc
|
||||
bx r0
|
||||
b @stop_loop
|
||||
/* never return */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_DoAutoload
|
||||
Description: リンク情報に沿って、各オートロードブロックの固定データ部の展開
|
||||
及び変数部の 0 クリアを行う。
|
||||
NITRO 互換オートロードセグメントは存在せず、TWL 専用セグメント
|
||||
のみが存在するという前提。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static asm void
|
||||
INITi_DoAutoload(void)
|
||||
{
|
||||
stmfd sp!, {lr}
|
||||
|
||||
/* オートロードを実施 */
|
||||
@000:
|
||||
ldr r0, =_start_LtdModuleParams
|
||||
ldr r12, [r0] // r12 = SDK_LTDAUTOLOAD_LIST
|
||||
ldr r3, [r0, #4] // r3 = SDK_LTDAUTOLOAD_LIST_END
|
||||
ldr r1, [r0, #8] // r1 = SDK_LTDAUTOLOAD_START
|
||||
@001:
|
||||
cmp r12, r3
|
||||
bge @010
|
||||
/* 固定セクション */
|
||||
ldr r0, [r12], #4 // r0 = start address of destination range of fixed section
|
||||
ldr r2, [r12], #4 // r2 = size of fixed section
|
||||
bl INITi_Copy32
|
||||
stmfd sp!, {r0, r1}
|
||||
/* static initializer テーブル */
|
||||
ldr r0, [r12], #4
|
||||
#ifndef SDK_NOINIT
|
||||
stmfd sp!, {r3, r12}
|
||||
bl INITi_ShelterStaticInitializer
|
||||
ldmfd sp!, {r3, r12}
|
||||
#endif
|
||||
/* bss セクション */
|
||||
ldmfd sp!, {r0} // r0 = start address of destination range of bss section
|
||||
mov r1, #0 // r1 = clear value for bss section
|
||||
ldr r2, [r12], #4 // r2 = sizeo of bss section
|
||||
bl INITi_Fill32
|
||||
ldmfd sp!, {r1}
|
||||
b @001
|
||||
|
||||
/* オートロードリスト・オートロード元バッファをクリア */
|
||||
@010:
|
||||
ldr r1, =_start_LtdModuleParams
|
||||
ldr r12, [r1] // r12 = SDK_LTDAUTOLOAD_LIST
|
||||
ldr r3, [r1, #4] // r3 = SDK_LTDAUTOLOAD_LIST_END
|
||||
ldr r0, [r1, #8] // r0 = SDK_LTDAUTOLOAD_START
|
||||
@011:
|
||||
cmp r12, r3
|
||||
bge @0f0
|
||||
mov r1, #0 // r1 = clear value
|
||||
str r1, [r12], #4
|
||||
ldr r2, [r12] // r2 = size of fixed section
|
||||
str r1, [r12], #4
|
||||
str r1, [r12], #4
|
||||
str r1, [r12], #4
|
||||
bl INITi_Fill32
|
||||
b @011
|
||||
|
||||
@0f0:
|
||||
/* オートロード完了コールバック呼び出し */
|
||||
ldr r0, =_start_ModuleParams
|
||||
ldr r1, =_start_LtdModuleParams
|
||||
ldmfd sp!, {lr}
|
||||
b _start_AutoloadDoneCallback
|
||||
}
|
||||
|
||||
#ifndef SDK_NOINIT
|
||||
|
||||
static asm void
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_ShelterStaticInitializer
|
||||
Description: 各オートロードセグメント内の static initializer へのポインタ
|
||||
テーブルを IRQ スタックの最上部に退避する。
|
||||
Arguments: ptr - セグメント内のポインタテーブルへのポインタ。
|
||||
テーブルは NULL で終端されている必要がある。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void
|
||||
INITi_ShelterStaticInitializer(u32* ptr)
|
||||
{
|
||||
/* 引数確認 */
|
||||
cmp r0, #0
|
||||
bxeq lr
|
||||
|
||||
/* 退避場所先頭アドレスを計算 */
|
||||
ldr r1, =HW_PRV_WRAM_IRQ_STACK_END
|
||||
ldr r2, =SDK_IRQ_STACKSIZE
|
||||
sub r1, r1, r2
|
||||
add r1, r1, #4
|
||||
@001:
|
||||
/* 退避場所先頭から空き場所を調査 */
|
||||
ldr r2, [r1]
|
||||
cmp r2, #0
|
||||
addne r1, r1, #4
|
||||
bne @001
|
||||
@002:
|
||||
/* 空き場所にテーブルをコピー */
|
||||
ldr r2, [r0], #4
|
||||
str r2, [r1], #4
|
||||
cmp r2, #0
|
||||
bne @002
|
||||
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_CallStaticInitializers
|
||||
Description: 各オートロードセグメント内の static initializer を呼び出す。
|
||||
オートロード処理によって IRQ スタックの最上部に退避されている
|
||||
関数ポインタテーブルを一つずつ呼び出す。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void
|
||||
INITi_CallStaticInitializers(void)
|
||||
{
|
||||
stmdb sp!, {lr}
|
||||
|
||||
/* テーブル退避場所先頭アドレスを計算 */
|
||||
ldr r1, =HW_PRV_WRAM_IRQ_STACK_END
|
||||
ldr r2, =SDK_IRQ_STACKSIZE
|
||||
sub r1, r1, r2
|
||||
add r1, r1, #4
|
||||
@001:
|
||||
/* テーブルに管理されているポインタを一つずつ呼び出し */
|
||||
ldr r0, [r1]
|
||||
cmp r0, #0
|
||||
beq @002
|
||||
stmfd sp!, {r1}
|
||||
mov lr, pc
|
||||
bx r0
|
||||
ldmfd sp!, {r1}
|
||||
/* 一旦呼び出したポインタはゼロクリア (IRQスタックを間借りしている為) */
|
||||
mov r0, #0
|
||||
str r0, [r1], #4
|
||||
b @001
|
||||
@002:
|
||||
ldmia sp!, {lr}
|
||||
bx lr
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_Copy32
|
||||
Description: 32 bit 単位でコピーを行う。スタックを 36 バイト消費するが、
|
||||
レジスタ r3 - r12 は破壊しない。
|
||||
Arguments: r0 - コピー先へのポインタ ( 4 バイトアライン )。
|
||||
r1 - コピー元へのポインタ ( 4 バイトアライン )。
|
||||
r2 - コピーする長さをバイト単位で指定 ( 4 の倍数 )。
|
||||
Returns: r0 - コピー後のコピー先へのポインタ ( r0 + r2 )。
|
||||
r1 - コピー後のコピー元へのポインタ ( r1 + r2 )。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void*
|
||||
INITi_Copy32(void* dst, void* src, u32 size)
|
||||
{
|
||||
stmfd sp!, {r3-r11}
|
||||
|
||||
bics r3, r2, #0x0000001f
|
||||
beq @next
|
||||
add r3, r0, r3
|
||||
@loop:
|
||||
ldmia r1!, {r4-r11}
|
||||
stmia r0!, {r4-r11}
|
||||
cmp r3, r0
|
||||
bgt @loop
|
||||
@next:
|
||||
tst r2, #0x00000010
|
||||
ldmneia r1!, {r4-r7}
|
||||
stmneia r0!, {r4-r7}
|
||||
tst r2, #0x00000008
|
||||
ldmneia r1!, {r4-r5}
|
||||
stmneia r0!, {r4-r5}
|
||||
tst r2, #0x00000004
|
||||
ldmneia r1!, {r4}
|
||||
stmneia r0!, {r4}
|
||||
|
||||
ldmfd sp!, {r3-r11}
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_Fill32
|
||||
Description: 32 bit 単位でバッファ内容を指定データで埋める。スタックを 36
|
||||
バイト消費するが、レジスタ r3 - r12 は破壊しない。
|
||||
Arguments: r0 - バッファへのポインタ ( 4 バイトアライン )。
|
||||
r1 - バッファを埋める内容を 32 bit 値で指定。
|
||||
r2 - バッファを埋める長さをバイト単位で指定 ( 4 の倍数 )。
|
||||
Returns: r0 - 処理後のバッファへのポインタ ( r0 + r2 )。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void*
|
||||
INITi_Fill32(void* dst, u32 value, u32 size)
|
||||
{
|
||||
stmfd sp!, {r3-r11}
|
||||
|
||||
mov r4, r1
|
||||
mov r5, r1
|
||||
mov r6, r1
|
||||
mov r7, r1
|
||||
mov r8, r1
|
||||
mov r9, r1
|
||||
mov r10, r1
|
||||
mov r11, r1
|
||||
bics r3, r2, #0x0000001f
|
||||
beq @next
|
||||
add r3, r0, r3
|
||||
@loop:
|
||||
stmia r0!, {r4-r11}
|
||||
cmp r3, r0
|
||||
bgt @loop
|
||||
@next:
|
||||
tst r2, #0x00000010
|
||||
stmneia r0!, {r4-r7}
|
||||
tst r2, #0x00000008
|
||||
stmneia r0!, {r4-r5}
|
||||
tst r2, #0x00000004
|
||||
stmneia r0!, {r4}
|
||||
|
||||
ldmfd sp!, {r3-r11}
|
||||
bx lr
|
||||
}
|
||||
|
||||
#include <twl/codereset.h>
|
||||
358
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/src/kami_pxi.c
Normal file
358
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/src/kami_pxi.c
Normal file
@ -0,0 +1,358 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_pxi.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-07-30#$
|
||||
$Rev: 2031 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include <twl/exi/ARM7/genPort2.h>
|
||||
#include "kami_pxi.h"
|
||||
#include "fifo.h"
|
||||
#include "twl/cdc.h"
|
||||
#include "formatter.h"
|
||||
#include "mcu_firm.h"
|
||||
#include <twl/ltdmain_begin.h>
|
||||
#include <twl/mcu.h>
|
||||
#include <twl/camera.h>
|
||||
#include <twl/camera/ARM7/i2c_sharp.h>
|
||||
#include <twl/camera/ARM7/i2c_micron.h>
|
||||
#include <twl/sdmc.h>
|
||||
|
||||
#define BOOLEAN int
|
||||
|
||||
extern BOOL FATFSi_nandRtfsIo( int driveno, dword block, void* buffer, word count, BOOLEAN reading);
|
||||
extern BOOL sdmcFormatNandLog( BOOL verify_flag);
|
||||
extern void sdmcGetCID( SDMC_PORT_NO port, u32* dest);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define KAMITEST_MESSAGE_ARRAY_MAX 4 // スレッド同期用メッセージキューのサイズ
|
||||
#define KAMITEST_THREAD_STACK_SIZE 2048 // スレッドのスタックサイズ
|
||||
|
||||
#define KAMITEST_THREAD_PRIORITY 6
|
||||
|
||||
// アライメント調整してコピーする
|
||||
#define KAMI_UNPACK_U16(d, s) \
|
||||
(*(d) = (u16)((((u8*)s)[0] << 0) | (((u8*)s)[1] << 8)))
|
||||
#define KAMI_UNPACK_U32(d, s) \
|
||||
(*(d) = (u32)((((u8*)s)[0] << 0) | (((u8*)s)[1] << 8) | (((u8*)s)[2] << 16) | (((u8*)s)[3] << 24)))
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct KamiWork
|
||||
{
|
||||
BOOL result;
|
||||
u32 total;
|
||||
u32 current;
|
||||
KamiCommand command;
|
||||
u8 data[KAMITEST_PXI_DATA_SIZE_MAX]; // 後続データ格納用
|
||||
|
||||
OSMessageQueue msgQ; // スレッド同期用メッセージキュー
|
||||
OSMessage msgArray[KAMITEST_MESSAGE_ARRAY_MAX];
|
||||
// メッセージを格納するバッファ
|
||||
OSThread thread; // KAMI用スレッド
|
||||
u64 stack[KAMITEST_THREAD_STACK_SIZE / sizeof(u64)];
|
||||
// KAMI用スレッドのスタック
|
||||
}
|
||||
KamiWork;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
静的変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL kamiInitialized;
|
||||
static KamiWork kamiWork;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void KamiPxiCallback(PXIFifoTag tag, u32 data, BOOL err);
|
||||
static void KamiReturnResult(KamiCommand command, KAMIPxiResult result);
|
||||
static void KamiReturnResultEx(KamiCommand command, KAMIPxiResult result, u8 size, u8* data);
|
||||
static void KamiThread(void *arg);
|
||||
|
||||
void KamiPxiInit(void)
|
||||
{
|
||||
if (kamiInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
kamiInitialized = TRUE;
|
||||
|
||||
PXI_Init();
|
||||
PXI_SetFifoRecvCallback(PXI_FIFO_TAG_KAMITEST, KamiPxiCallback);
|
||||
|
||||
OS_InitMessageQueue(&kamiWork.msgQ, kamiWork.msgArray, KAMITEST_MESSAGE_ARRAY_MAX);
|
||||
OS_CreateThread(&kamiWork.thread, KamiThread, 0,
|
||||
(void *)(kamiWork.stack + (KAMITEST_THREAD_STACK_SIZE / sizeof(u64))),
|
||||
KAMITEST_THREAD_STACK_SIZE, KAMITEST_THREAD_PRIORITY);
|
||||
OS_WakeupThreadDirect(&kamiWork.thread);
|
||||
}
|
||||
|
||||
static void KamiPxiCallback(PXIFifoTag tag, u32 data, BOOL err)
|
||||
{
|
||||
#pragma unused( tag )
|
||||
if (err)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (data & KAMITEST_PXI_START_BIT) // 先頭データ
|
||||
{
|
||||
kamiWork.total = (u8)((data & KAMITEST_PXI_DATA_NUMS_MASK) >> KAMITEST_PXI_DATA_NUMS_SHIFT);
|
||||
kamiWork.current = 0;
|
||||
kamiWork.command = (KamiCommand)((data & KAMITEST_PXI_COMMAND_MASK) >> KAMITEST_PXI_COMMAND_SHIFT);
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & KAMITEST_PXI_1ST_DATA_MASK) >> KAMITEST_PXI_1ST_DATA_SHIFT);
|
||||
}
|
||||
else // 後続データ
|
||||
{
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0xFF0000) >> 16);
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0x00FF00) >> 8);
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0x0000FF) >> 0);
|
||||
}
|
||||
if (kamiWork.current >= kamiWork.total)
|
||||
{
|
||||
switch (kamiWork.command)
|
||||
{
|
||||
case KAMI_EXE_FORMAT:
|
||||
case KAMI_NAND_IO:
|
||||
case KAMI_MCU_WRITE_FIRM:
|
||||
case KAMI_MCU_IO:
|
||||
case KAMI_ARM7_IO:
|
||||
case KAMI_CDC_GO_DSMODE:
|
||||
case KAMI_CLEAR_NAND_ERRORLOG:
|
||||
case KAMI_GET_CAMERA_MODULE_TYPE:
|
||||
case KAMI_GET_NAND_CID:
|
||||
if (!OS_SendMessage(&kamiWork.msgQ, NULL, OS_MESSAGE_NOBLOCK))
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_FATAL_ERROR);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_INVALID_COMMAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void KamiReturnResult(KamiCommand command, KAMIPxiResult result)
|
||||
{
|
||||
u32 pxiData = (u32)(KAMITEST_PXI_START_BIT | KAMITEST_PXI_RESULT_BIT |
|
||||
((command << KAMITEST_PXI_COMMAND_SHIFT) & KAMITEST_PXI_COMMAND_MASK) |
|
||||
((1 << KAMITEST_PXI_DATA_NUMS_SHIFT) & KAMITEST_PXI_DATA_NUMS_MASK) |
|
||||
((result << KAMITEST_PXI_1ST_DATA_SHIFT) & KAMITEST_PXI_1ST_DATA_MASK));
|
||||
while (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, pxiData, 0))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void KamiReturnResultEx(KamiCommand command, KAMIPxiResult result, u8 size, u8* data)
|
||||
{
|
||||
u32 pxiData = (u32)(KAMITEST_PXI_START_BIT | KAMITEST_PXI_RESULT_BIT |
|
||||
((command << KAMITEST_PXI_COMMAND_SHIFT) & KAMITEST_PXI_COMMAND_MASK) |
|
||||
(((size+1) << KAMITEST_PXI_DATA_NUMS_SHIFT) & KAMITEST_PXI_DATA_NUMS_MASK) |
|
||||
((result << KAMITEST_PXI_1ST_DATA_SHIFT) & KAMITEST_PXI_1ST_DATA_MASK));
|
||||
int i;
|
||||
while (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, pxiData, 0))
|
||||
{
|
||||
}
|
||||
for (i = 0; i < size; i+= 3)
|
||||
{
|
||||
pxiData = (u32)((data[i] << 16) | (data[i+1] << 8) | data[i+2]);
|
||||
while (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, pxiData, 0))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void KamiThread(void *arg)
|
||||
{
|
||||
#pragma unused( arg )
|
||||
OSMessage msg;
|
||||
BOOL result;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
(void)OS_ReceiveMessage(&kamiWork.msgQ, &msg, OS_MESSAGE_BLOCK);
|
||||
switch (kamiWork.command)
|
||||
{
|
||||
case KAMI_EXE_FORMAT:
|
||||
{
|
||||
result = ExeFormat((FormatMode)kamiWork.data[0]); // Quick or Full
|
||||
if (result)
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_NAND_IO:
|
||||
{
|
||||
BOOL is_read;
|
||||
u32 block;
|
||||
void* buffer;
|
||||
u32 count;
|
||||
|
||||
is_read = (BOOL)kamiWork.data[0];
|
||||
KAMI_UNPACK_U32(&block, &kamiWork.data[1]);
|
||||
KAMI_UNPACK_U32((u32 *)(&buffer), &kamiWork.data[5]);
|
||||
KAMI_UNPACK_U32(&count, &kamiWork.data[9]);
|
||||
|
||||
result = FATFSi_nandRtfsIo( 0, block, buffer, (u16)count, is_read );
|
||||
if (result)
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_MCU_WRITE_FIRM:
|
||||
{
|
||||
void* buffer;
|
||||
KAMI_UNPACK_U32((u32 *)(&buffer), &kamiWork.data[1]);
|
||||
|
||||
if ( MCU_WriteFirm( buffer ) )
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_MCU_IO:
|
||||
{
|
||||
BOOL is_read;
|
||||
u32 reg_no;
|
||||
u32 write;
|
||||
u32 read;
|
||||
|
||||
is_read = (BOOL)kamiWork.data[0];
|
||||
KAMI_UNPACK_U32(®_no, &kamiWork.data[1]);
|
||||
KAMI_UNPACK_U32(&write, &kamiWork.data[5]);
|
||||
|
||||
if (is_read)
|
||||
{
|
||||
read = MCU_ReadRegister( (u8)reg_no );
|
||||
KamiReturnResultEx(kamiWork.command, KAMI_PXI_RESULT_SUCCESS, sizeof(u8), (u8*)&read );
|
||||
}
|
||||
else
|
||||
{
|
||||
MCU_WriteRegister( (u8)reg_no, (u8)write );
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_ARM7_IO:
|
||||
{
|
||||
BOOL is_read;
|
||||
u32 addr;
|
||||
u32 write;
|
||||
u32 read;
|
||||
|
||||
is_read = (BOOL)kamiWork.data[0];
|
||||
KAMI_UNPACK_U32(&addr, &kamiWork.data[1]);
|
||||
KAMI_UNPACK_U32(&write, &kamiWork.data[5]);
|
||||
|
||||
if (is_read)
|
||||
{
|
||||
read = *(u32 *)addr;
|
||||
KamiReturnResultEx(kamiWork.command, KAMI_PXI_RESULT_SUCCESS, sizeof(u32), (u8*)&read );
|
||||
}
|
||||
else
|
||||
{
|
||||
*(u32 *)addr = write;
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_CDC_GO_DSMODE:
|
||||
{
|
||||
CDC_Init(); // IIRなどのパラメータ初期化のため
|
||||
CDC_GoDsMode();
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS);
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_CLEAR_NAND_ERRORLOG:
|
||||
{
|
||||
if (sdmcFormatNandLog(TRUE))
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_SUCCESS_FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_GET_CAMERA_MODULE_TYPE:
|
||||
{
|
||||
CameraModuleTypes types;
|
||||
if (CAMERAi_IsSharpModule(CAMERA_SELECT_IN))
|
||||
{
|
||||
types.in = CAMERA_MODULE_TYPE_SHARP;
|
||||
}
|
||||
else if (CAMERAi_IsMicronModule(CAMERA_SELECT_IN))
|
||||
{
|
||||
types.in = CAMERA_MODULE_TYPE_MICRON;
|
||||
}
|
||||
else
|
||||
{
|
||||
types.in = CAMERA_MODULE_TYPE_UNKNOWN;
|
||||
}
|
||||
if (CAMERAi_IsSharpModule(CAMERA_SELECT_OUT))
|
||||
{
|
||||
types.out = CAMERA_MODULE_TYPE_SHARP;
|
||||
}
|
||||
else if (CAMERAi_IsMicronModule(CAMERA_SELECT_OUT))
|
||||
{
|
||||
types.out = CAMERA_MODULE_TYPE_MICRON;
|
||||
}
|
||||
else
|
||||
{
|
||||
types.out = CAMERA_MODULE_TYPE_UNKNOWN;
|
||||
}
|
||||
KamiReturnResultEx(kamiWork.command, KAMI_PXI_RESULT_SUCCESS, sizeof(CameraModuleTypes), (u8*)&types);
|
||||
}
|
||||
break;
|
||||
|
||||
case KAMI_GET_NAND_CID:
|
||||
{
|
||||
u8 buffer[16];
|
||||
sdmcGetCID( SDMC_PORT_NAND, (u32*)buffer);
|
||||
KamiReturnResultEx(kamiWork.command, KAMI_PXI_RESULT_SUCCESS, sizeof(buffer), (u8*)buffer );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_INVALID_COMMAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <twl/ltdmain_end.h>
|
||||
654
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/src/main.c
Normal file
654
build/systemMenu_tools/NandFirmWriter/ARM7.TWL/src/main.c
Normal file
@ -0,0 +1,654 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - components - armadillo.TWL
|
||||
File: main.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-08-18#$
|
||||
$Rev: 2182 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nitro/types.h>
|
||||
#include <twl/init/crt0.h>
|
||||
#include <twl/memorymap_sp.h>
|
||||
#include <twl/os.h>
|
||||
#include <twl/os/common/codecmode.h>
|
||||
#include <nitro/pad.h>
|
||||
#include <twl/aes.h>
|
||||
#include <twl/sea.h>
|
||||
#include <twl/fatfs.h>
|
||||
#include <twl/nwm.h>
|
||||
#include <twl/camera.h>
|
||||
#include <sysmenu.h>
|
||||
#include <twl/mcu.h>
|
||||
#include <twl/cdc.h>
|
||||
#include <nitro/snd.h>
|
||||
#include <twl/snd/ARM7/sndex_api.h>
|
||||
#include <twl/rtc.h>
|
||||
#include <nitro/wvr.h>
|
||||
#include <twl/spi.h>
|
||||
#include "nvram_sp.h"
|
||||
#include "kami_pxi.h"
|
||||
#include <firm/os/common/system.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
/* 各スレッド優先度 */
|
||||
#define THREAD_PRIO_SPI 2
|
||||
#define THREAD_PRIO_MCU 4 // 暫定
|
||||
#define THREAD_PRIO_SND 6
|
||||
#define THREAD_PRIO_NWM_EVENT 7
|
||||
#define THREAD_PRIO_NWM_SDIO 8
|
||||
#define THREAD_PRIO_FATFS 8
|
||||
#define THREAD_PRIO_NWM_COMMAND 9
|
||||
#define THREAD_PRIO_NWM_WPA 10
|
||||
#define THREAD_PRIO_HOTSW 11
|
||||
#define THREAD_PRIO_AES 12
|
||||
#define THREAD_PRIO_SEA 12
|
||||
#define THREAD_PRIO_RTC 12
|
||||
#define THREAD_PRIO_SNDEX 14
|
||||
#define THREAD_PRIO_FS 15
|
||||
/* OS_THREAD_LAUNCHER_PRIORITY 16 */
|
||||
|
||||
/* ROM 内登録エリアの拡張言語コード */
|
||||
#define ROMHEADER_FOR_CHINA_BIT 0x80
|
||||
#define ROMHEADER_FOR_KOREA_BIT 0x40
|
||||
|
||||
/* 使用 DMA 番号 */
|
||||
#define DMA_NO_FATFS FATFS_DMA_4 // = 0
|
||||
#define DMA_NO_NWM 3
|
||||
|
||||
/* カードチャタリングカウンタ */
|
||||
#define CHATTERING_COUNTER 0x1988 // 100ms分 (0x1988 * 15.3us = 100000us)
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void PrintDebugInfo(void);
|
||||
static OSHeapHandle InitializeAllocateSystem(void);
|
||||
static void InitializeFatfs(void);
|
||||
static void InitializeNwm(OSHeapHandle hh);
|
||||
static void InitializeCardPower(void);
|
||||
static void InitializeCdc(void);
|
||||
|
||||
static void ReadUserInfo(void);
|
||||
#ifdef NVRAM_CONFIG_DATA_EX_VERSION
|
||||
static BOOL IsValidConfigEx(void);
|
||||
static u16 GetRomValidLanguage(void);
|
||||
static s32 CheckCorrectNCDEx(NVRAMConfigEx* ncdsp);
|
||||
#else
|
||||
static s32 CheckCorrectNCD(NVRAMConfig* ncdsp);
|
||||
#endif
|
||||
static void VBlankIntr(void);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: TwlSpMain
|
||||
Description: 起動ベクタ。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
TwlSpMain(void)
|
||||
{
|
||||
OSHeapHandle heapHandle;
|
||||
|
||||
/* OS 初期化 */
|
||||
OS_Init();
|
||||
PrintDebugInfo();
|
||||
|
||||
/* NVRAM からユーザー情報読み出し */
|
||||
ReadUserInfo();
|
||||
|
||||
/* ヒープ領域設定 */
|
||||
heapHandle = InitializeAllocateSystem();
|
||||
|
||||
/* ボタン入力サーチ初期化 */
|
||||
(void)PAD_InitXYButton();
|
||||
|
||||
/* 割込み許可 */
|
||||
(void)OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
(void)OS_EnableIrq();
|
||||
(void)OS_EnableInterrupts();
|
||||
|
||||
#ifndef NAND_INITIALIZER_LIMITED_MODE
|
||||
KamiPxiInit();
|
||||
#endif
|
||||
|
||||
/* 各ライブラリ初期化 */
|
||||
AES_Init(THREAD_PRIO_AES); // AES
|
||||
SEA_Init(THREAD_PRIO_SEA); // SEA
|
||||
FS_Init(FS_DMA_NOT_USE); // FS for CARD
|
||||
FS_CreateReadServerThread(THREAD_PRIO_FS); // FS for CARD
|
||||
InitializeFatfs(); // FAT-FS
|
||||
InitializeNwm(heapHandle); // TWL 無線
|
||||
MCU_InitIrq(THREAD_PRIO_MCU); // マイコン
|
||||
|
||||
if (OSi_IsCodecTwlMode() == TRUE)
|
||||
{
|
||||
InitializeCdc(); // CODEC
|
||||
CAMERA_Init(); // カメラ
|
||||
}
|
||||
|
||||
SND_Init(THREAD_PRIO_SND); // サウンド
|
||||
SNDEX_Init(THREAD_PRIO_SNDEX); // サウンド拡張
|
||||
RTC_Init(THREAD_PRIO_RTC); // RTC
|
||||
WVR_Begin(heapHandle); // NITRO 無線
|
||||
SPI_Init(THREAD_PRIO_SPI);
|
||||
InitializeCardPower(); // カード電源ON(検査プログラム用)
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
OS_Halt();
|
||||
|
||||
/* ソフトウェアリセット要求は監視しない */
|
||||
/* AGB カートリッジの挿抜チェックは行わない */
|
||||
/* DS カードの挿抜チェックは行わない */
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PrintDebugInfo
|
||||
Description: ARM7 コンポーネントの情報をデバッグ出力する。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
PrintDebugInfo(void)
|
||||
{
|
||||
OS_TPrintf("ARM7: This component is running on TWL.\n");
|
||||
OS_TPrintf("ARM7: This component is \"armadillo.TWL\".\n");
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitializeAllocateSystem
|
||||
Description: メモリ割当てシステムを初期化する。
|
||||
Arguments: None.
|
||||
Returns: OSHeapHandle - WRAM アリーナ上に確保されたヒープのハンドルを返す。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static OSHeapHandle
|
||||
InitializeAllocateSystem(void)
|
||||
{
|
||||
OSHeapHandle hh;
|
||||
void* subLo = (void*)OS_GetWramSubArenaLo();
|
||||
void* subHi = (void*)OS_GetWramSubArenaHi();
|
||||
void* privLo = (void*)OS_GetWramSubPrivArenaLo();
|
||||
void* privHi = (void*)OS_GetWramSubPrivArenaHi();
|
||||
|
||||
if (((u32)privLo == HW_PRV_WRAM) && ((u32)subHi == HW_PRV_WRAM) && ((u32)subLo < HW_PRV_WRAM))
|
||||
{
|
||||
/* SUB アリーナを SUBPRIV アリーナに吸収 */
|
||||
OS_SetWramSubArenaHi(subLo);
|
||||
OS_SetWramSubPrivArenaLo(subLo);
|
||||
privLo = subLo;
|
||||
}
|
||||
|
||||
/* アリーナを 0 クリア */
|
||||
MI_CpuClear8(privLo, (u32)privHi - (u32)privLo);
|
||||
|
||||
/* ヒープ作成初期化 */
|
||||
privLo = OS_InitAlloc(OS_ARENA_WRAM_SUBPRIV, privLo, privHi, 1);
|
||||
hh = OS_CreateHeap(OS_ARENA_WRAM_SUBPRIV, privLo, privHi);
|
||||
if (hh < 0)
|
||||
{
|
||||
OS_Panic("ARM7: Failed to create heap.\n");
|
||||
}
|
||||
|
||||
/* カレントヒープに設定 */
|
||||
(void)OS_SetCurrentHeap(OS_ARENA_WRAM_SUBPRIV, hh);
|
||||
|
||||
/* ヒープサイズの確認 */
|
||||
{
|
||||
u32 heapSize;
|
||||
|
||||
heapSize = (u32)OS_CheckHeap(OS_ARENA_WRAM_SUBPRIV, hh);
|
||||
|
||||
if (heapSize <= 0)
|
||||
{
|
||||
OS_Panic("ARM7: Failed to create heap.\n");
|
||||
}
|
||||
OS_TPrintf("ARM7: heap size [%d]\n", heapSize);
|
||||
}
|
||||
|
||||
return hh;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitializeFatfs
|
||||
Description: FATFSライブラリを初期化する。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
InitializeFatfs(void)
|
||||
{
|
||||
// FATFSライブラリの初期化
|
||||
if(!FATFS_Init( FATFS_DMA_4, FATFS_DMA_5, THREAD_PRIO_FATFS))
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitializeNwm
|
||||
Description: NWMライブラリを初期化する。
|
||||
Arguments: hh - 利用可能なヒープのハンドルを指定。
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
InitializeNwm(OSHeapHandle hh)
|
||||
{
|
||||
NwmspInit nwmInit;
|
||||
|
||||
/* [TODO] 確保しているヒープ領域が新無線一式が必要としているメモリ量以上かのチェックが必要 */
|
||||
|
||||
nwmInit.cmdPrio = THREAD_PRIO_NWM_COMMAND;
|
||||
nwmInit.evtPrio = THREAD_PRIO_NWM_EVENT;
|
||||
nwmInit.sdioPrio = THREAD_PRIO_NWM_SDIO;
|
||||
|
||||
nwmInit.dmaNo = DMA_NO_NWM;
|
||||
nwmInit.drvHeap.id = OS_ARENA_WRAM_SUBPRIV;
|
||||
nwmInit.drvHeap.handle = hh;
|
||||
|
||||
nwmInit.wpaPrio = THREAD_PRIO_NWM_WPA;
|
||||
nwmInit.wpaHeap.id = OS_ARENA_WRAM_SUBPRIV;
|
||||
nwmInit.wpaHeap.handle = hh;
|
||||
|
||||
NWMSP_Init(&nwmInit);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitializeCardPower
|
||||
Description: カード電源をONする。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
InitializeCardPower(void)
|
||||
{
|
||||
// チャッタリングカウンタの値を設定
|
||||
reg_MI_MC1 = (u32)((reg_MI_MC1 & ~REG_MI_MC1_CC_MASK) |
|
||||
(CHATTERING_COUNTER << REG_MI_MC1_CC_SHIFT));
|
||||
|
||||
// チャタリングカウンタ分待つことによりCDETが0になる
|
||||
OS_SpinWait( OS_MSEC_TO_CPUCYC(200) );
|
||||
|
||||
// カードスロット1電源ON
|
||||
HOTSWi_TurnCardPowerOn(1);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitializeCdc
|
||||
Description: CDCライブラリを初期化する。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
InitializeCdc(void)
|
||||
{
|
||||
u32 spiLockId;
|
||||
|
||||
spiLockId = (u32)OS_GetLockID();
|
||||
if (spiLockId == OS_LOCK_ID_ERROR)
|
||||
{
|
||||
OS_Warning("OS_GetLockID failed.\n");
|
||||
}
|
||||
|
||||
/* CODEC 初期化 */
|
||||
SPI_Lock(spiLockId);
|
||||
CDC_Init();
|
||||
SPI_Unlock(spiLockId);
|
||||
}
|
||||
|
||||
//#ifdef WM_PRECALC_ALLOWEDCHANNEL
|
||||
//extern u16 WMSP_GetAllowedChannel(u16 bitField);
|
||||
//#endif
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ReadUserInfo
|
||||
|
||||
Description: NVRAMからユーザー情報を読み出し、共有領域に展開する。
|
||||
ミラーリングされているバッファが両方壊れている場合は、
|
||||
共有領域のユーザー情報格納場所をクリアする。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void ReadUserInfo(void)
|
||||
{
|
||||
s32 offset;
|
||||
#ifdef NVRAM_CONFIG_DATA_EX_VERSION
|
||||
NVRAMConfigEx temp[2];
|
||||
#else
|
||||
NVRAMConfig temp[2];
|
||||
#endif
|
||||
s32 check;
|
||||
u8 *p = OS_GetSystemWork()->nvramUserInfo;
|
||||
|
||||
// オフセット読み出し
|
||||
#ifdef NVRAM_CONFIG_CONST_ADDRESS
|
||||
offset = NVRAM_CONFIG_DATA_ADDRESS_DUMMY;
|
||||
#else
|
||||
NVRAM_ReadDataBytes(NVRAM_CONFIG_DATA_OFFSET_ADDRESS, NVRAM_CONFIG_DATA_OFFSET_SIZE,
|
||||
(u8 *)(&offset));
|
||||
offset <<= NVRAM_CONFIG_DATA_OFFSET_SHIFT;
|
||||
#endif
|
||||
|
||||
#ifdef NVRAM_CONFIG_DATA_EX_VERSION
|
||||
// ミラーされた2つのデータを読み出し
|
||||
NVRAM_ReadDataBytes((u32)offset, sizeof(NVRAMConfigEx), (u8 *)(&temp[0]));
|
||||
NVRAM_ReadDataBytes((u32)(offset + SPI_NVRAM_PAGE_SIZE), sizeof(NVRAMConfigEx),
|
||||
(u8 *)(&temp[1]));
|
||||
// 2つの内どちらを使うか判断
|
||||
check = CheckCorrectNCDEx(temp);
|
||||
#else
|
||||
// ミラーされた2つのデータを読み出し
|
||||
NVRAM_ReadDataBytes((u32)offset, sizeof(NVRAMConfig), (u8 *)(&temp[0]));
|
||||
NVRAM_ReadDataBytes((u32)(offset + SPI_NVRAM_PAGE_SIZE), sizeof(NVRAMConfig), (u8 *)(&temp[1]));
|
||||
// 2つの内どちらを使うか判断
|
||||
check = CheckCorrectNCD(temp);
|
||||
#endif
|
||||
|
||||
if (check >= 3)
|
||||
{
|
||||
// アプリケーションの起動を抑制
|
||||
MI_CpuFill32(p, 0xffffffff, sizeof(NVRAMConfig));
|
||||
}
|
||||
else if (check)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
// ニックネームを補正
|
||||
if (temp[check - 1].ncd.owner.nickname.length < NVRAM_CONFIG_NICKNAME_LENGTH)
|
||||
{
|
||||
for (i = NVRAM_CONFIG_NICKNAME_LENGTH;
|
||||
i > temp[check - 1].ncd.owner.nickname.length; i--)
|
||||
{
|
||||
temp[check - 1].ncd.owner.nickname.str[i - 1] = 0x0000;
|
||||
}
|
||||
}
|
||||
// コメントを補正
|
||||
if (temp[check - 1].ncd.owner.comment.length < NVRAM_CONFIG_COMMENT_LENGTH)
|
||||
{
|
||||
for (i = NVRAM_CONFIG_COMMENT_LENGTH; i > temp[check - 1].ncd.owner.comment.length;
|
||||
i--)
|
||||
{
|
||||
temp[check - 1].ncd.owner.comment.str[i - 1] = 0x0000;
|
||||
}
|
||||
}
|
||||
// 共有領域にストア
|
||||
MI_CpuCopy32(&temp[check - 1], p, sizeof(NVRAMConfig));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 共有領域をクリア
|
||||
MI_CpuClear32(p, sizeof(NVRAMConfig));
|
||||
}
|
||||
|
||||
// 無線MACアドレスをユーザー情報の後ろに展開
|
||||
{
|
||||
u8 wMac[6];
|
||||
|
||||
// NVRAMからMACアドレスを読み出し
|
||||
NVRAM_ReadDataBytes(NVRAM_CONFIG_MACADDRESS_ADDRESS, 6, wMac);
|
||||
// 展開先アドレスを計算
|
||||
p = (u8 *)((u32)p + ((sizeof(NVRAMConfig) + 3) & ~0x00000003));
|
||||
// 共有領域に展開
|
||||
MI_CpuCopy8(wMac, p, 6);
|
||||
}
|
||||
/*
|
||||
#ifdef WM_PRECALC_ALLOWEDCHANNEL
|
||||
// 使用可能チャンネルから使用許可チャンネルを計算
|
||||
{
|
||||
u16 enableChannel;
|
||||
u16 allowedChannel;
|
||||
|
||||
// 使用可能チャンネルを読み出し
|
||||
NVRAM_ReadDataBytes(NVRAM_CONFIG_ENABLECHANNEL_ADDRESS, 2, (u8 *)(&enableChannel));
|
||||
// 使用許可チャンネルを計算
|
||||
allowedChannel = WMSP_GetAllowedChannel((u16)(enableChannel >> 1));
|
||||
// 展開先アドレスを計算(MACアドレスの後ろの2バイト)
|
||||
p = (u8 *)((u32)p + 6);
|
||||
// 共有領域に展開
|
||||
*((u16 *)p) = allowedChannel;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef NVRAM_CONFIG_DATA_EX_VERSION
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: IsValidConfigEx
|
||||
|
||||
Description: ユーザー情報が拡張コンフィグに対応しているかどうかを調査する。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: BOOL - 拡張ユーザー情報が有効な場合にTRUEを返す。
|
||||
無効である場合はFALSEを返す。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL IsValidConfigEx(void)
|
||||
{
|
||||
u8 ipl2_type;
|
||||
|
||||
NVRAM_ReadDataBytes(NVRAM_CONFIG_IPL2_TYPE_ADDRESS, NVRAM_CONFIG_IPL2_TYPE_SIZE, &ipl2_type);
|
||||
if (ipl2_type == NVRAM_CONFIG_IPL2_TYPE_NORMAL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (ipl2_type & NVRAM_CONFIG_IPL2_TYPE_EX_MASK)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: GetRomValidLanguage
|
||||
|
||||
Description: ROM内登録エリアの情報から、拡張言語コードの対応言語ビットマップ
|
||||
に関する情報を抽出する。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: u16 - DSカード、もしくは マルチブートバイナリが対応している
|
||||
言語コードのビットマップを返す。DSカードが拡張言語
|
||||
コードに対応していない場合は 0 を返す。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static u16 GetRomValidLanguage(void)
|
||||
{
|
||||
u16 ret = 0x0000;
|
||||
u8 langBit = OS_GetSystemWork()->rom_header[0x1d];
|
||||
|
||||
// ROM内登録エリアの拡張言語コードを確認
|
||||
if (langBit == ROMHEADER_FOR_CHINA_BIT)
|
||||
{
|
||||
// for CHINA
|
||||
ret |= (0x0001 << NVRAM_CONFIG_LANG_CHINESE);
|
||||
}
|
||||
else if (langBit == ROMHEADER_FOR_KOREA_BIT)
|
||||
{
|
||||
// for KOREA
|
||||
ret |= (0x0001 << NVRAM_CONFIG_LANG_HANGUL);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CheckCorrectNCDEx
|
||||
|
||||
Description: ミラーリングされているユーザー情報のどちらを使うべきか判定する。
|
||||
|
||||
Arguments: nvdsp - 比較するコンフィグデータ2つの配列。
|
||||
|
||||
Returns: s32 - 0: 両方不適切。
|
||||
1: 配列[ 0 ]が適切。
|
||||
2: 配列[ 1 ]が適切。
|
||||
3: アプリの起動を抑制すべき。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static s32 CheckCorrectNCDEx(NVRAMConfigEx * ncdsp)
|
||||
{
|
||||
u16 i;
|
||||
u16 calc_crc;
|
||||
s32 crc_flag = 0;
|
||||
u16 saveCount;
|
||||
|
||||
// IPLが拡張言語コードに対応しているか
|
||||
if (IsValidConfigEx())
|
||||
{
|
||||
// IPLが拡張言語コードに対応している場合
|
||||
u16 rom_valid_language = GetRomValidLanguage();
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
calc_crc = SVC_GetCRC16(0xffff, (void *)(&ncdsp[i].ncd), sizeof(NVRAMConfigData));
|
||||
if ((ncdsp[i].crc16 == calc_crc) && (ncdsp[i].saveCount < NVRAM_CONFIG_SAVE_COUNT_MAX))
|
||||
{
|
||||
// CRC が正しく saveCount 値が 0x80 未満のデータを正当と判断
|
||||
calc_crc =
|
||||
SVC_GetCRC16(0xffff, (void *)(&ncdsp[i].ncd_ex), sizeof(NVRAMConfigDataEx));
|
||||
if ((ncdsp[i].crc16_ex == calc_crc)
|
||||
&& ((0x0001 << ncdsp[i].ncd_ex.language) &
|
||||
(ncdsp[i].ncd_ex.valid_language_bitmap)))
|
||||
{
|
||||
// 拡張データ用 CRC が正しく、設定言語コードが対応言語コードに含まれる場合に正当と判断
|
||||
if (rom_valid_language & ncdsp[i].ncd_ex.valid_language_bitmap)
|
||||
{
|
||||
// 拡張言語コードで通常言語コードを上書き
|
||||
ncdsp[i].ncd.option.language = ncdsp[i].ncd_ex.language;
|
||||
}
|
||||
if (rom_valid_language & (0x0001 << NVRAM_CONFIG_LANG_CHINESE) & ~ncdsp[i].
|
||||
ncd_ex.valid_language_bitmap)
|
||||
{
|
||||
// ROM 内登録エリアに"中国語"拡張言語コードが設定されているが、
|
||||
// IPL2の対応言語コードに"中国語"拡張言語コードが含まれない場合は起動を抑制
|
||||
return 3;
|
||||
}
|
||||
crc_flag |= (1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// IPLが拡張言語コードに対応していない場合
|
||||
u16 rom_valid_language = GetRomValidLanguage();
|
||||
|
||||
if (rom_valid_language & (0x0001 << NVRAM_CONFIG_LANG_CHINESE))
|
||||
{
|
||||
// ROM 内登録エリアに"中国語"拡張言語コードが設定されている場合は起動を抑制
|
||||
return 3;
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
calc_crc = SVC_GetCRC16(0xffff, (void *)(&ncdsp[i].ncd), sizeof(NVRAMConfigData));
|
||||
if ((ncdsp[i].crc16 == calc_crc) && (ncdsp[i].saveCount < NVRAM_CONFIG_SAVE_COUNT_MAX))
|
||||
{
|
||||
// CRC が正しく saveCount 値が 0x80 未満のデータを正当と判断
|
||||
crc_flag |= (1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 正当なデータのうちどのデータが有効かを判定する。
|
||||
switch (crc_flag)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
// 片方のCRCだけ正常
|
||||
return crc_flag;
|
||||
|
||||
case 3:
|
||||
// 両方ともCRCが正しければどちらが最新のデータか判断する。
|
||||
saveCount = (u8)((ncdsp[0].saveCount + 1) & NVRAM_CONFIG_SAVE_COUNT_MASK);
|
||||
if (saveCount == ncdsp[1].saveCount)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 両方ともCRCが不正
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CheckCorrectNCD
|
||||
|
||||
Description: ミラーリングされているユーザー情報のどちらを使うべきか判定する。
|
||||
|
||||
Arguments: nvdsp - 比較するコンフィグデータ2つの配列。
|
||||
|
||||
Returns: s32 - 0: 両方不適切。
|
||||
1: 配列[ 0 ]が適切。
|
||||
2: 配列[ 1 ]が適切。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static s32 CheckCorrectNCD(NVRAMConfig *ncdsp)
|
||||
{
|
||||
u16 i;
|
||||
u16 calc_crc;
|
||||
s32 crc_flag = 0;
|
||||
u16 saveCount;
|
||||
|
||||
// 各ミラーデータのCRC & saveCount正当性チェック
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
calc_crc = SVC_GetCRC16(0xffff, (void *)(&ncdsp[i].ncd), sizeof(NVRAMConfigData));
|
||||
|
||||
if ((ncdsp[i].crc16 == calc_crc) && (ncdsp[i].saveCount < NVRAM_CONFIG_SAVE_COUNT_MAX))
|
||||
{
|
||||
// CRCが正しく、saveCount値が0x80未満のデータを正当と判断。
|
||||
crc_flag |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
// 正当なデータのうちどのデータが有効かを判定する。
|
||||
switch (crc_flag)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
// 片方のCRCだけ正常
|
||||
return crc_flag;
|
||||
|
||||
case 3:
|
||||
// 両方ともCRCが正しければどちらが最新のデータか判断する。
|
||||
saveCount = (u8)((ncdsp[0].saveCount + 1) & NVRAM_CONFIG_SAVE_COUNT_MASK);
|
||||
if (saveCount == ncdsp[1].saveCount)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 両方ともCRCが不正
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: VBlankIntr
|
||||
Description: V ブランク割り込みベクタ。
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern BOOL PMi_Initialized;
|
||||
extern void PM_SelfBlinkProc(void);
|
||||
|
||||
static void
|
||||
VBlankIntr(void)
|
||||
{
|
||||
if (PMi_Initialized)
|
||||
{
|
||||
PM_SelfBlinkProc();
|
||||
}
|
||||
}
|
||||
57
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/ARM9-TS.lsf
Normal file
57
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/ARM9-TS.lsf
Normal file
@ -0,0 +1,57 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - include
|
||||
# File: ARM9-TS.lsf
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded insructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2007-12-05#$
|
||||
# $Rev: 2840 $
|
||||
# $Author: yosizaki $
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# TWL LCF SPEC FILE
|
||||
#
|
||||
|
||||
Static $(TARGET_NAME)
|
||||
{
|
||||
Address $(ADDRESS_STATIC)
|
||||
Object $(OBJS_STATIC)
|
||||
Library $(LLIBS) $(GLIBS) $(CW_LIBS)
|
||||
StackSize 4096 4096
|
||||
}
|
||||
|
||||
Autoload ITCM
|
||||
{
|
||||
Address $(ADDRESS_ITCM)
|
||||
Object * (.itcm)
|
||||
Object $(OBJS_AUTOLOAD) (.text)
|
||||
Object $(OBJS_AUTOLOAD) (.rodata)
|
||||
Object $(OBJS_AUTOLOAD) (.init)
|
||||
Object $(OBJS_AUTOLOAD) (.ctor)
|
||||
Object $(OBJS_AUTOLOAD) (.sinit)
|
||||
}
|
||||
|
||||
Autoload DTCM
|
||||
{
|
||||
Address $(ADDRESS_DTCM)
|
||||
Object * (.dtcm)
|
||||
Object $(OBJS_AUTOLOAD) (.data)
|
||||
Object $(OBJS_AUTOLOAD) (.sdata)
|
||||
Object $(OBJS_AUTOLOAD) (.bss)
|
||||
Object $(OBJS_AUTOLOAD) (.sbss)
|
||||
}
|
||||
|
||||
Ltdautoload LTDMAIN
|
||||
{
|
||||
# NITRO/TWL 共有のオーバーレイが在る場合は、さらにその後ろに配置する必要があります。
|
||||
After $(TARGET_NAME)
|
||||
Object * (.ltdmain)
|
||||
Object $(OBJS_LTDAUTOLOAD)
|
||||
Library $(LLIBS_EX) $(GLIBS_EX)
|
||||
}
|
||||
131
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/Makefile
Normal file
131
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/Makefile
Normal file
@ -0,0 +1,131 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlIPL - systemMenu_RED - NandInitializerRed
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2009-03-11#$
|
||||
# $Rev: 2763 $
|
||||
# $Author: aoki_ryoma $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#============================================================================
|
||||
#製品鍵を使った書き込みを行う場合は、TwlIPL/build/buildtools/commondefsの"FIRM_USE_PRODUCT_KEYS=TRUE"を有効にしてください。
|
||||
#============================================================================
|
||||
#============================================================================
|
||||
# ワイヤレスの強制Disableフラグを設定可能にする場合定義します。(要:Make Clean)
|
||||
# MACRO_FLAGS += -DUSE_WIRELESS_FORCE_DISABLE_SETTING
|
||||
#============================================================================
|
||||
#============================================================================
|
||||
# 各種データを書き込み可能にする場合定義します。(要:Make Clean)
|
||||
# 具体的には TWLFontTable.dat wrap.bin cert.sys の3つです。
|
||||
# MACRO_FLAGS += -DUSE_WRITE_VARIOUS_DATA
|
||||
#============================================================================
|
||||
#============================================================================
|
||||
# dev.kpを書き込み可能にする場合定義します。(要:Make Clean)
|
||||
#MACRO_FLAGS += -DWRITE_DEVKP_ENABLE
|
||||
#============================================================================
|
||||
#============================================================================
|
||||
# マリクラデバッグ用として作成する場合定義します。(要:Make Clean)
|
||||
# ・自動処理において"nand:/shared2/launcher/wrap.bin"を作成します。
|
||||
# ・自動処理において開発用CLSの証明書(cert.sys)を書き込みます。
|
||||
# ・自動処理の最後に本体初期化を行います。
|
||||
#MACRO_FLAGS += -DMARIOCLUB_VERSION
|
||||
#============================================================================
|
||||
|
||||
SYSM_DISABLE_DEBUG = FALSE
|
||||
|
||||
TARGET_FIRM = SYSTEMMENU
|
||||
TARGET_PLATFORM = TWL
|
||||
TWL_ARCHGEN = LIMITED
|
||||
|
||||
#TARGET_CODEGEN = THUMB
|
||||
|
||||
TITLEID_LO = 0NRA
|
||||
#TARGET_TAD =
|
||||
|
||||
TARGET_BIN = NandFirmWriter.srl
|
||||
LCFILE_SPEC = ARM9-TS.lsf
|
||||
ROM_SPEC = main.rsf
|
||||
|
||||
MAKEROM_ARM7_BASE = ../ARM7.TWL/bin/$(TWL_BUILDTYPE_ARM7)/armadillo
|
||||
MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT)
|
||||
|
||||
SRCS = main.c \
|
||||
common.c \
|
||||
font.c \
|
||||
screen.c \
|
||||
hwi.c \
|
||||
kami_pxi.c \
|
||||
kami_write_nandfirm.c \
|
||||
|
||||
LINCLUDES = ../common/include \
|
||||
$(ROOT)/build/libraries/lcfg/ARM9.TWL/include \
|
||||
../../common/ARM9/include
|
||||
|
||||
SRCDIR = src \
|
||||
../../HWInfoWriter/ARM9/src \
|
||||
../../common/ARM9/src
|
||||
|
||||
#LCFILE = # using default
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#ifneq ($(TWL_IPL_RED_PRIVATE_ROOT),)
|
||||
#ifdef FIRM_USE_PRODUCT_KEYS
|
||||
#MAKEROM_FLAGS += -DHWINFO_PRIVKEY='private_HWInfo.der' \
|
||||
# -DHWID_PRIVKEY='private_HWID.der'
|
||||
#else
|
||||
#MAKEROM_FLAGS += -DHWINFO_PRIVKEY='private_HWInfo_dev.der' \
|
||||
# -DHWID_PRIVKEY='private_HWID_dev.der'
|
||||
#endif
|
||||
#endif
|
||||
|
||||
MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' \
|
||||
-DPRIVKEY_PATH='$(TWL_KEYSDIR)/rsa' \
|
||||
-DCARD_REGION='$(CARD_REGION)' \
|
||||
-DDISABLE_DEBUG='$(SYSM_DISABLE_DEBUG)'
|
||||
|
||||
MAKETAD_FLAGS += -s
|
||||
|
||||
SYSMENU_LIBS = \
|
||||
libnamut$(TWL_LIBSUFFIX).a
|
||||
|
||||
SDK_APPEND_LIBS = \
|
||||
libes$(TWL_LIBSUFFIX).a \
|
||||
libboc$(TWL_LIBSUFFIX).a \
|
||||
libsfs$(TWL_LIBSUFFIX).a \
|
||||
libnam$(TWL_LIBSUFFIX).a \
|
||||
libsea$(TWL_LIBSUFFIX).a \
|
||||
liblcfg$(TWL_LIBSUFFIX).a \
|
||||
libna$(TWL_LIBSUFFIX).a \
|
||||
liberrorlog$(TWL_LIBSUFFIX).a
|
||||
|
||||
LLIBRARIES += $(SYSMENU_LIBS) $(SDK_APPEND_LIBS)
|
||||
|
||||
MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
|
||||
|
||||
#LDIRT_CLEAN =
|
||||
#INSTALL_TARGETS =
|
||||
INSTALL_DIR = $(SDK_NMENU_DATADIR)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
#include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#===== End of Makefile =====
|
||||
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - tests - appjumpTest
|
||||
File: common.h
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-08-30#$
|
||||
$Rev: 8166 $
|
||||
$Author: nishimoto_takashi $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
#include <twl.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define KEY_REPEAT_START 25 // キーリピート開始までのフレーム数
|
||||
#define KEY_REPEAT_SPAN 10 // キーリピートの間隔フレーム数
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
構造体 定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// キー入力情報
|
||||
typedef struct KeyInfo
|
||||
{
|
||||
u16 cnt; // 未加工入力値
|
||||
u16 trg; // 押しトリガ入力
|
||||
u16 up; // 離しトリガ入力
|
||||
u16 rep; // 押し維持リピート入力
|
||||
} KeyInfo;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Prototype
|
||||
*---------------------------------------------------------------------------*/
|
||||
void InitCommon(void);
|
||||
|
||||
void ReadKey(KeyInfo* pKey);
|
||||
|
||||
void VBlankIntr(void);
|
||||
|
||||
/*===========================================================================*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - WCM - demos - wcm-list-2
|
||||
File: font.h
|
||||
|
||||
Copyright 2007-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-09-17#$
|
||||
$Rev: 8556 $
|
||||
$Author: okubata_ryoma $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef FONT_H_
|
||||
#define FONT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
#include <nitro/types.h>
|
||||
|
||||
extern const u32 d_CharData[8 * 256];
|
||||
extern const u32 d_PaletteData[8 * 16];
|
||||
|
||||
/*===========================================================================*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* FONT_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
@ -0,0 +1,112 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_pxi.h
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-07-25#$
|
||||
$Rev: 2003 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TWL_KAMI_TEST_KAMITEST_H_
|
||||
#define TWL_KAMI_TEST_KAMITEST_H_
|
||||
|
||||
#include "fifo.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
// 処理結果定義
|
||||
typedef enum KAMIResult
|
||||
{
|
||||
KAMI_RESULT_SUCCESS = 0,
|
||||
KAMI_RESULT_SUCCESS_TRUE = 0,
|
||||
KAMI_RESULT_SUCCESS_FALSE,
|
||||
KAMI_RESULT_INVALID_COMMAND,
|
||||
KAMI_RESULT_INVALID_PARAMETER,
|
||||
KAMI_RESULT_ILLEGAL_STATUS,
|
||||
KAMI_RESULT_BUSY,
|
||||
KAMI_RESULT_FATAL_ERROR,
|
||||
KAMI_RESULT_SEND_ERROR,
|
||||
KAMI_RESULT_MAX
|
||||
}
|
||||
KAMIResult;
|
||||
|
||||
|
||||
typedef enum {
|
||||
FORMAT_MODE_QUICK, // Quickフォーマット
|
||||
FORMAT_MODE_FULL // Fullフォーマット(各パーティション内を0xFFで埋める)
|
||||
} FormatMode;
|
||||
|
||||
// コールバック
|
||||
typedef void (*KAMICallback)(KAMIResult result, void *arg);
|
||||
|
||||
|
||||
void KamiPxiInit( void );
|
||||
|
||||
KAMIResult ExeFormatAsync(FormatMode format_mode, KAMICallback callback);
|
||||
KAMIResult ExeFormat(FormatMode format_mode);
|
||||
KAMIResult kamiNandIo(u32 block, void* buffer, u32 count, BOOL is_read);
|
||||
KAMIResult kamiMcuWriteFirm(void* buffer );
|
||||
KAMIResult kamiMcuIo(u32 reg_no, void* buffer, u32 value, BOOL is_read);
|
||||
KAMIResult kamiARM7Io(u32 addr, u32* buffer, u32 value, BOOL is_read);
|
||||
KAMIResult kamiCDC_GoDsMode( void );
|
||||
KAMIResult kamiClearNandErrorLog( void );
|
||||
KAMIResult kamiGetCameraModuleTypesAsync( CameraModuleTypes *pTypes, KAMICallback callback, void* arg );
|
||||
KAMIResult kamiGetCameraModuleTypes( CameraModuleTypes *pTypes );
|
||||
KAMIResult kamiGetNandCID( void* buffer );
|
||||
|
||||
// (重要)
|
||||
// ARM7が読み書きするためリード前はInvalidate、ライト前はフラッシュしてください。
|
||||
//
|
||||
static KAMIResult kamiNandRead(u32 block, void* buffer, u32 count)
|
||||
{
|
||||
return kamiNandIo(block, buffer, count, TRUE);
|
||||
}
|
||||
static KAMIResult kamiNandWrite(u32 block, void* buffer, u32 count)
|
||||
{
|
||||
return kamiNandIo(block, buffer, count, FALSE);
|
||||
}
|
||||
static KAMIResult kamiMcuRead(u8 reg_no, void* buffer)
|
||||
{
|
||||
return kamiMcuIo((u32)reg_no, buffer, 0, TRUE);
|
||||
}
|
||||
static KAMIResult kamiMcuWrite(u8 reg_no, u8 value)
|
||||
{
|
||||
return kamiMcuIo((u32)reg_no, NULL, (u32)value, FALSE);
|
||||
}
|
||||
static KAMIResult kamiARM7Read(u32 addr, void* buffer)
|
||||
{
|
||||
return kamiARM7Io(addr, buffer, 0, TRUE);
|
||||
}
|
||||
static KAMIResult kamiARM7Write(u32 addr, u8 value)
|
||||
{
|
||||
return kamiARM7Io(addr, NULL, value, FALSE);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* TWL_KAMI_TEST_KAMITEST_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_write_nandfirm.h
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-04-22#$
|
||||
$Rev: 1212 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef KAMI_WRITE_NAND_FIRM
|
||||
#define KAMI_WRITE_NAND_FIRM
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Œ^’è‹`
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
typedef void* (*KAMIAlloc)(u32 size);
|
||||
typedef void (*KAMIFree)(void* ptr);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
ŠÖ<EFBFBD>”’è‹`
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL NandfirmProcess(void);
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* KAMI_WRITE_NAND_FIRM */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - WCM - demos - wcm-list-2
|
||||
File: screen.h
|
||||
|
||||
Copyright 2007-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-09-17#$
|
||||
$Rev: 8556 $
|
||||
$Author: okubata_ryoma $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef SCREEN_H_
|
||||
#define SCREEN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
#include <nitro/types.h>
|
||||
|
||||
// ƒtƒHƒ“ƒg‚Ì<E2809A>F
|
||||
#define COLOR_BLACK 0x10
|
||||
#define COLOR_RED 0x11
|
||||
#define COLOR_GREEN 0x12
|
||||
#define COLOR_BLUE 0x13
|
||||
#define COLOR_YELLOW 0x14
|
||||
#define COLOR_PURPLE 0x15
|
||||
#define COLOR_L_BLUE 0x16
|
||||
#define COLOR_D_RED 0x17
|
||||
#define COLOR_D_GREEN 0x18
|
||||
#define COLOR_D_BLUE 0x19
|
||||
#define COLOR_D_YELLOW 0x1a
|
||||
#define COLOR_D_PURPLE 0x1b
|
||||
#define COLOR_D_L_BLUE 0x1c
|
||||
#define COLOR_GRAY 0x1d
|
||||
#define COLOR_D_GRAY 0x1e
|
||||
#define COLOR_WHITE 0x1f
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
ŠÖ<EFBFBD>” ’è‹`
|
||||
*---------------------------------------------------------------------------*/
|
||||
void InitScreen(void);
|
||||
void ClearScreen(void);
|
||||
void ClearMainScreen(void);
|
||||
void ClearSubScreen(void);
|
||||
void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...);
|
||||
void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...);
|
||||
void UpdateScreen(void);
|
||||
|
||||
/*===========================================================================*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* SCREEN_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
232
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/main.rsf
Normal file
232
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/main.rsf
Normal file
@ -0,0 +1,232 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - include
|
||||
# File: ROM-BB.rsf
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded insructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2008-01-07#$
|
||||
# $Rev: 436 $
|
||||
# $Author: yosiokat $
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# TWL ROM SPEC FILE
|
||||
#
|
||||
|
||||
Arm9
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)"
|
||||
Elf "$(MAKEROM_ARM9:r).tef"
|
||||
}
|
||||
|
||||
Arm7
|
||||
{
|
||||
Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)"
|
||||
Elf "$(MAKEROM_ARM7_BASE:r).tef"
|
||||
}
|
||||
|
||||
Arm9.Ltd
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)"
|
||||
}
|
||||
|
||||
Arm7.Ltd
|
||||
{
|
||||
Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)"
|
||||
}
|
||||
|
||||
Property
|
||||
{
|
||||
###
|
||||
### Settings for FinalROM
|
||||
###
|
||||
#### BEGIN
|
||||
#
|
||||
# TITLE NAME: Your product name within 12bytes
|
||||
#
|
||||
#TitleName "YourAppName"
|
||||
|
||||
#
|
||||
# MAKER CODE: Your company ID# in 2 ascii words
|
||||
# issued by NINTENDO
|
||||
#
|
||||
#MakerCode "00"
|
||||
|
||||
#
|
||||
# REMASTER VERSION: Mastering version
|
||||
#
|
||||
RomVersion 2
|
||||
|
||||
#
|
||||
# ROM SPEED TYPE: [MROM/1TROM/UNDEFINED]
|
||||
#
|
||||
RomSpeedType $(MAKEROM_ROMSPEED)
|
||||
|
||||
#
|
||||
# ROM SIZE: in bit [64M/128M/256M/512M/1G/2G]
|
||||
#
|
||||
#RomSize 2G
|
||||
|
||||
#
|
||||
# ROM PADDING: TRUE if finalrom
|
||||
#
|
||||
#RomFootPadding TRUE
|
||||
|
||||
#
|
||||
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
|
||||
#
|
||||
#RomHeaderTemplate ./etc/rom_header.template.sbin
|
||||
|
||||
#
|
||||
# BANNER FILE: generated from Banner Spec File
|
||||
#
|
||||
BannerFile ../banner/banner.bnr
|
||||
|
||||
###
|
||||
### Setting for TWL
|
||||
###
|
||||
|
||||
#
|
||||
# ROM HEADER Ltd: Provided to every product by NINTENDO
|
||||
#
|
||||
RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin
|
||||
|
||||
#
|
||||
# Digest parameters:
|
||||
#
|
||||
DigestParam 1024 32
|
||||
|
||||
#
|
||||
# WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD]
|
||||
# don't have to edit
|
||||
#
|
||||
WramMapping MAP_TS_SCR
|
||||
|
||||
#
|
||||
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
|
||||
#
|
||||
CardRegion ALL
|
||||
|
||||
#
|
||||
# CommonClientKey: launcher deliver common client Key [TRUE/FALSE]
|
||||
#
|
||||
CommonClientKey TRUE
|
||||
|
||||
#
|
||||
# HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE]
|
||||
#
|
||||
HwAESSlotB TRUE
|
||||
|
||||
#
|
||||
# HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE]
|
||||
#
|
||||
HwAESSlotC TRUE
|
||||
|
||||
#
|
||||
# SDCardAccess: sd card access control [TRUE/FALSE]
|
||||
#
|
||||
SDCardAccess TRUE
|
||||
|
||||
#
|
||||
# NANDAccess: NAND access control [TRUE/FALSE]
|
||||
#
|
||||
NANDAccess TRUE
|
||||
|
||||
#
|
||||
# Codec mode:
|
||||
# don't have to edit
|
||||
#
|
||||
CodecMode $(MAKEROM_CODEC_MODE)
|
||||
|
||||
#
|
||||
# SCFG: scfg lock [TRUE/FALSE]
|
||||
#
|
||||
LockSCFG FALSE
|
||||
|
||||
#
|
||||
# DisableDebug :最終ROMでは、実行時にデバッグできないようにTRUEにする必要があります。
|
||||
#
|
||||
DisableDebug $(DISABLE_DEBUG)
|
||||
|
||||
###
|
||||
#### END
|
||||
}
|
||||
|
||||
|
||||
AppendProperty
|
||||
{
|
||||
#
|
||||
# Publisher : "Nintendo"
|
||||
# don't have to edit
|
||||
Publisher Nintendo
|
||||
|
||||
#
|
||||
# Application type : [USER/SYSTEM]
|
||||
# don't have to edit
|
||||
AppType System
|
||||
|
||||
#
|
||||
# launch title on the launcher : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
Launch TRUE
|
||||
|
||||
#
|
||||
# Data only title : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
DataOnly FALSE
|
||||
|
||||
#
|
||||
# Secure title : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
Secure TRUE
|
||||
|
||||
#
|
||||
# Boot allowed Media: [GameCard/NAND]
|
||||
#
|
||||
Media GameCard
|
||||
|
||||
#
|
||||
# GameCode for TitleID : Your GameCode in 4 ascii words
|
||||
#
|
||||
GameCode $(TITLEID_LO)
|
||||
|
||||
#
|
||||
# Public save data size: [16K/32K/64K/128K/256K/512K/1M/2M/4M/8M]
|
||||
#
|
||||
#PublicSaveDataSize 32K
|
||||
|
||||
#
|
||||
# Private save data size: [16K/32K/64K/128K/256K/512K/1M/2M/4M/8M]
|
||||
#
|
||||
#PrivateSaveDataSize 16K
|
||||
|
||||
#
|
||||
# Enable SubBannerFile
|
||||
#SubBannerFile TRUE
|
||||
}
|
||||
|
||||
|
||||
RomSpec
|
||||
{
|
||||
Offset 0x00000000
|
||||
Segment ALL
|
||||
HostRoot $(TWL_IPL_RED_ROOT)/build/systemMenu_tools/NandInitializerRed/data
|
||||
Root /data
|
||||
File cert.sys
|
||||
HostRoot $(PRIVKEY_PATH)
|
||||
Root /key
|
||||
File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY)
|
||||
}
|
||||
156
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/common.c
Normal file
156
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/common.c
Normal file
@ -0,0 +1,156 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - tests - appjumpTest
|
||||
File: common.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-08-25#$
|
||||
$Rev: 8074 $
|
||||
$Author: nishimoto_takashi $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#include "common.h"
|
||||
|
||||
static void InitInterrupts(void);
|
||||
static void InitHeap(void);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCommon
|
||||
|
||||
Description: 基本的な初期化関数をここで呼ぶ。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void InitCommon(void)
|
||||
{
|
||||
OS_Init();
|
||||
OS_InitTick();
|
||||
OS_InitAlarm();
|
||||
GX_Init();
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
CARD_Init(); // 新規追加
|
||||
CARD_Enable(TRUE); // 新規追加
|
||||
|
||||
InitHeap();
|
||||
InitInterrupts();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ReadKey
|
||||
|
||||
Description: キー入力情報を取得し、入力情報構造体を編集する。
|
||||
押しトリガ、離しトリガ、押し継続リピートトリガ を検出する。
|
||||
|
||||
Arguments: pKey - 編集するキー入力情報構造体を指定する。
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void ReadKey(KeyInfo* pKey)
|
||||
{
|
||||
static u16 repeat_count[12];
|
||||
int i;
|
||||
u16 r;
|
||||
|
||||
r = PAD_Read();
|
||||
pKey->trg = 0x0000;
|
||||
pKey->up = 0x0000;
|
||||
pKey->rep = 0x0000;
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
if (r & (0x0001 << i))
|
||||
{
|
||||
if (!(pKey->cnt & (0x0001 << i)))
|
||||
{
|
||||
pKey->trg |= (0x0001 << i); // 押しトリガ
|
||||
repeat_count[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (repeat_count[i] > KEY_REPEAT_START)
|
||||
{
|
||||
pKey->rep |= (0x0001 << i); // 押し継続リピート
|
||||
repeat_count[i] = (u16) (KEY_REPEAT_START - KEY_REPEAT_SPAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
repeat_count[i]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pKey->cnt & (0x0001 << i))
|
||||
{
|
||||
pKey->up |= (0x0001 << i); // 離しトリガ
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pKey->cnt = r; // 未加工キー入力
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitInterrupts
|
||||
|
||||
Description: 割り込み設定を初期化する。
|
||||
V ブランク割り込みを許可し、割り込みハンドラを設定する。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitInterrupts(void)
|
||||
{
|
||||
// V ブランク割り込み設定
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
|
||||
// 割り込み許可
|
||||
(void)OS_EnableIrq();
|
||||
(void)OS_EnableInterrupts();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitHeap
|
||||
|
||||
Description: メインメモリ上のアリーナにてメモリ割当てシステムを初期化する。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitHeap(void)
|
||||
{
|
||||
void* tempLo;
|
||||
OSHeapHandle hh;
|
||||
|
||||
// メインメモリ上のアリーナにヒープをひとつ作成
|
||||
tempLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1);
|
||||
OS_SetArenaLo(OS_ARENA_MAIN, tempLo);
|
||||
hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi());
|
||||
if (hh < 0)
|
||||
{
|
||||
// ヒープ作成に失敗した場合は異常終了
|
||||
OS_Panic("ARM9: Fail to create heap...\n");
|
||||
}
|
||||
(void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
585
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/font.c
Normal file
585
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/font.c
Normal file
@ -0,0 +1,585 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NitroWiFi - WCM - demos - wcm-list
|
||||
File: font.c
|
||||
|
||||
Copyright 2005-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Log: font.c,v $
|
||||
Revision 1.2 2006/03/10 09:22:43 kitase_hirotake
|
||||
INDENT SOURCE
|
||||
|
||||
Revision 1.1 2005/07/21 08:21:06 adachi_hiroaki
|
||||
<EFBFBD>V‹K’ljÁ
|
||||
|
||||
|
||||
$NoKeywords: $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#include "font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Character data
|
||||
*---------------------------------------------------------------------------*/
|
||||
const u32 d_CharData[8 * 256] =
|
||||
{
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x01010010, 0x01010010, 0x00000110, // 0001h
|
||||
0x00011010, 0x01100010, 0x00000010, 0x00000010,
|
||||
0x00000000, 0x01011010, 0x01010010, 0x00010010, // 0002h
|
||||
0x00100010, 0x00100010, 0x00100001, 0x00100001,
|
||||
0x00000000, 0x01010001, 0x01010001, 0x01111111, // 0003h
|
||||
0x00000001, 0x00000001, 0x00000001, 0x01111110,
|
||||
0x00000000, 0x01010000, 0x01111111, 0x00100000, // 0004h
|
||||
0x00100000, 0x00010000, 0x00001000, 0x00000110,
|
||||
0x00000000, 0x01010000, 0x01010100, 0x00001010, // 0005h
|
||||
0x00010001, 0x00100001, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x01011000, 0x01011000, 0x01111111, // 0006h
|
||||
0x00001000, 0x00101010, 0x01001010, 0x01001001,
|
||||
0x00000000, 0x01010010, 0x01101111, 0x01010010, // 0007h
|
||||
0x00010010, 0x00010010, 0x00010010, 0x00001001,
|
||||
0x00000000, 0x01010010, 0x01011111, 0x00000100, // 0008h
|
||||
0x00011111, 0x00001000, 0x00000001, 0x00011110,
|
||||
0x00000000, 0x01010000, 0x01011000, 0x00000110, // 0009h
|
||||
0x00000001, 0x00000110, 0x00011000, 0x00100000,
|
||||
0x00000000, 0x01010000, 0x01111101, 0x00010001, // 000ah
|
||||
0x00010001, 0x00010001, 0x00010001, 0x00001010,
|
||||
0x00000000, 0x01010000, 0x01011110, 0x00100000, // 000bh
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00111110,
|
||||
0x00000000, 0x01010100, 0x01011111, 0x00001000, // 000ch
|
||||
0x00010000, 0x00000001, 0x00000001, 0x00011110,
|
||||
0x00000000, 0x01010001, 0x01010001, 0x00000001, // 000dh
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x01010000, 0x01111111, 0x00011000, // 000eh
|
||||
0x00010100, 0x00010100, 0x00011000, 0x00001100,
|
||||
0x00000000, 0x01010010, 0x01111111, 0x00010010, // 000fh
|
||||
0x00010010, 0x00000010, 0x00000010, 0x00111100,
|
||||
0x00000000, 0x00001110, 0x01010100, 0x01010010, // 0010h
|
||||
0x00111111, 0x00000100, 0x00000100, 0x00011000,
|
||||
0x00000000, 0x01010100, 0x01011111, 0x00000100, // 0011h
|
||||
0x01110100, 0x00000010, 0x00001010, 0x01110010,
|
||||
0x00000000, 0x01010100, 0x01011111, 0x00000010, // 0012h
|
||||
0x00011110, 0x00100001, 0x00100000, 0x00011110,
|
||||
0x00000000, 0x01010000, 0x01011100, 0x00100011, // 0013h
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x01010000, 0x01111111, 0x00010000, // 0014h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00110000,
|
||||
0x00000000, 0x01010010, 0x01010010, 0x00001100, // 0015h
|
||||
0x00000010, 0x00000001, 0x00000001, 0x00111110,
|
||||
0x00000000, 0x01010001, 0x01111101, 0x00010001, // 0016h
|
||||
0x00010001, 0x00111001, 0x01010101, 0x00011001,
|
||||
0x00000000, 0x01010100, 0x01010011, 0x01110010, // 0017h
|
||||
0x00010001, 0x00010001, 0x00001010, 0x00000100,
|
||||
0x00000000, 0x01011110, 0x01011000, 0x00000100, // 0018h
|
||||
0x00101001, 0x01010001, 0x01010001, 0x00001100,
|
||||
0x00000000, 0x01010000, 0x01011100, 0x00010010, // 0019h
|
||||
0x00010010, 0x00100001, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x01011101, 0x01010001, 0x00111101, // 001ah
|
||||
0x00010001, 0x00011001, 0x00110101, 0x00001001,
|
||||
0x00000000, 0x01110001, 0x01011101, 0x00110001, // 001bh
|
||||
0x00010001, 0x00111001, 0x01010101, 0x00011001,
|
||||
0x00000000, 0x01110100, 0x01010011, 0x00110010, // 001ch
|
||||
0x00010001, 0x00010001, 0x00001010, 0x00000100,
|
||||
0x00000000, 0x01101110, 0x01011000, 0x00100100, // 001dh
|
||||
0x00101001, 0x01010001, 0x01010001, 0x00001100,
|
||||
0x00000000, 0x01110000, 0x01011100, 0x00110010, // 001eh
|
||||
0x00010010, 0x00100001, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x01111101, 0x01010001, 0x00111101, // 001fh
|
||||
0x00010001, 0x00011001, 0x00110101, 0x00001001,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0020h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00001000, 0x00001000, 0x00001000, // 0021h
|
||||
0x00001000, 0x00001000, 0x00000000, 0x00001000,
|
||||
0x00000000, 0x01101100, 0x01001000, 0x00100100, // 0022h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00100100, 0x01111111, 0x00100100, // 0023h
|
||||
0x00100100, 0x01111111, 0x00010010, 0x00010010,
|
||||
0x00000000, 0x00001000, 0x01111110, 0x00001001, // 0024h
|
||||
0x00111110, 0x01001000, 0x00111111, 0x00001000,
|
||||
0x00000000, 0x01000010, 0x00100101, 0x00010010, // 0025h
|
||||
0x00001000, 0x00100100, 0x01010010, 0x00100001,
|
||||
0x00000000, 0x00001110, 0x00010001, 0x00001001, // 0026h
|
||||
0x01000110, 0x00101001, 0x00110001, 0x01001110,
|
||||
0x00000000, 0x00011000, 0x00010000, 0x00001000, // 0027h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x01110000, 0x00001000, 0x00000100, // 0028h
|
||||
0x00000100, 0x00000100, 0x00001000, 0x01110000,
|
||||
0x00000000, 0x00000111, 0x00001000, 0x00010000, // 0029h
|
||||
0x00010000, 0x00010000, 0x00001000, 0x00000111,
|
||||
0x00000000, 0x00001000, 0x01001001, 0x00101010, // 002ah
|
||||
0x00011100, 0x00101010, 0x01001001, 0x00001000,
|
||||
0x00000000, 0x00001000, 0x00001000, 0x00001000, // 002bh
|
||||
0x01111111, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002ch
|
||||
0x00000000, 0x00001100, 0x00001000, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002dh
|
||||
0x01111111, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 002eh
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00001100,
|
||||
0x00000000, 0x01000000, 0x00100000, 0x00010000, // 002fh
|
||||
0x00001000, 0x00000100, 0x00000010, 0x00000001,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0030h
|
||||
0x01000001, 0x01000001, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00011100, 0x00010000, 0x00010000, // 0031h
|
||||
0x00010000, 0x00010000, 0x00010000, 0x00010000,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0032h
|
||||
0x00111110, 0x00000001, 0x00000001, 0x01111111,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000000, // 0033h
|
||||
0x00111110, 0x01000000, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00100000, 0x00110000, 0x00101000, // 0034h
|
||||
0x00100100, 0x00100010, 0x01111111, 0x00100000,
|
||||
0x00000000, 0x01111111, 0x00000001, 0x00111111, // 0035h
|
||||
0x01000000, 0x01000000, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00111110, 0x00000001, 0x00111111, // 0036h
|
||||
0x01000001, 0x01000001, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x01111111, 0x00100000, 0x00100000, // 0037h
|
||||
0x00010000, 0x00010000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0038h
|
||||
0x00111110, 0x01000001, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000001, // 0039h
|
||||
0x01000001, 0x01111110, 0x01000000, 0x00111110,
|
||||
0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003ah
|
||||
0x00000000, 0x00000000, 0x00001100, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00001100, 0x00000000, // 003bh
|
||||
0x00000000, 0x00001100, 0x00001000, 0x00000100,
|
||||
0x00000000, 0x01100000, 0x00011000, 0x00000110, // 003ch
|
||||
0x00000001, 0x00000110, 0x00011000, 0x01100000,
|
||||
0x00000000, 0x00000000, 0x01111111, 0x00000000, // 003dh
|
||||
0x00000000, 0x00000000, 0x01111111, 0x00000000,
|
||||
0x00000000, 0x00000011, 0x00001100, 0x00110000, // 003eh
|
||||
0x01000000, 0x00110000, 0x00001100, 0x00000011,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x01000001, // 003fh
|
||||
0x00110000, 0x00001000, 0x00000000, 0x00001000,
|
||||
0x00000000, 0x00011100, 0x00100010, 0x01001001, // 0040h
|
||||
0x01010101, 0x01010101, 0x01010101, 0x00111010,
|
||||
0x00000000, 0x00001000, 0x00010100, 0x00010100, // 0041h
|
||||
0x00100010, 0x00111110, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0042h
|
||||
0x00111111, 0x01000001, 0x01000001, 0x00111111,
|
||||
0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0043h
|
||||
0x00000001, 0x00000001, 0x01000010, 0x00111100,
|
||||
0x00000000, 0x00011111, 0x00100001, 0x01000001, // 0044h
|
||||
0x01000001, 0x01000001, 0x00100001, 0x00011111,
|
||||
0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0045h
|
||||
0x01111111, 0x00000001, 0x00000001, 0x01111111,
|
||||
0x00000000, 0x01111111, 0x00000001, 0x00000001, // 0046h
|
||||
0x00111111, 0x00000001, 0x00000001, 0x00000001,
|
||||
0x00000000, 0x00111100, 0x01000010, 0x00000001, // 0047h
|
||||
0x01111001, 0x01000001, 0x01000010, 0x00111100,
|
||||
0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0048h
|
||||
0x01111111, 0x01000001, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00111110, 0x00001000, 0x00001000, // 0049h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00111110,
|
||||
0x00000000, 0x01000000, 0x01000000, 0x01000000, // 004ah
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x01100001, 0x00011001, 0x00000101, // 004bh
|
||||
0x00000011, 0x00000101, 0x00011001, 0x01100001,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00000001, // 004ch
|
||||
0x00000001, 0x00000001, 0x00000001, 0x01111111,
|
||||
0x00000000, 0x01000001, 0x01100011, 0x01010101, // 004dh
|
||||
0x01001001, 0x01000001, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x01000001, 0x01000011, 0x01000101, // 004eh
|
||||
0x01001001, 0x01010001, 0x01100001, 0x01000001,
|
||||
0x00000000, 0x00011100, 0x00100010, 0x01000001, // 004fh
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0050h
|
||||
0x00111111, 0x00000001, 0x00000001, 0x00000001,
|
||||
0x00000000, 0x00011100, 0x00100010, 0x01000001, // 0051h
|
||||
0x01000001, 0x01011001, 0x00100010, 0x01011100,
|
||||
0x00000000, 0x00111111, 0x01000001, 0x01000001, // 0052h
|
||||
0x00111111, 0x01000001, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00111110, 0x01000001, 0x00000001, // 0053h
|
||||
0x00111110, 0x01000000, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x01111111, 0x00001000, 0x00001000, // 0054h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0055h
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x01000001, 0x01000001, 0x00100010, // 0056h
|
||||
0x00100010, 0x00010100, 0x00010100, 0x00001000,
|
||||
0x00000000, 0x01000001, 0x01000001, 0x01000001, // 0057h
|
||||
0x01001001, 0x01010101, 0x01100011, 0x01000001,
|
||||
0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0058h
|
||||
0x00001000, 0x00010100, 0x00100010, 0x01000001,
|
||||
0x00000000, 0x01000001, 0x00100010, 0x00010100, // 0059h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x01111111, 0x00100000, 0x00010000, // 005ah
|
||||
0x00001000, 0x00000100, 0x00000010, 0x01111111,
|
||||
0x00000000, 0x01111100, 0x00000100, 0x00000100, // 005bh
|
||||
0x00000100, 0x00000100, 0x00000100, 0x01111100,
|
||||
0x00000000, 0x00100010, 0x00010100, 0x00111110, // 005ch
|
||||
0x00001000, 0x00111110, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00011111, 0x00010000, 0x00010000, // 005dh
|
||||
0x00010000, 0x00010000, 0x00010000, 0x00011111,
|
||||
0x00000000, 0x00001000, 0x00010100, 0x00100010, // 005eh
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 005fh
|
||||
0x00000000, 0x00000000, 0x00000000, 0x01111111,
|
||||
0x00000000, 0x00010000, 0x00001000, 0x00011000, // 0060h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00011110, 0x00100001, // 0061h
|
||||
0x00111110, 0x00100001, 0x00100001, 0x01011110,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00111111, // 0062h
|
||||
0x01000001, 0x01000001, 0x01000001, 0x00111111,
|
||||
0x00000000, 0x00000000, 0x00111100, 0x01000010, // 0063h
|
||||
0x00000001, 0x00000001, 0x01000010, 0x00111100,
|
||||
0x00000000, 0x01000000, 0x01000000, 0x01111110, // 0064h
|
||||
0x01000001, 0x01000001, 0x01000001, 0x01111110,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0065h
|
||||
0x01111111, 0x00000001, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00110000, 0x00001000, 0x00001000, // 0066h
|
||||
0x01111111, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00000000, 0x01111110, 0x01000001, // 0067h
|
||||
0x01000001, 0x01111110, 0x01000000, 0x00111110,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0068h
|
||||
0x00111111, 0x01000001, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00001000, 0x00000000, 0x00001000, // 0069h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00100000, 0x00000000, 0x00100000, // 006ah
|
||||
0x00100000, 0x00100001, 0x00100001, 0x00011110,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x01100001, // 006bh
|
||||
0x00011001, 0x00000111, 0x00011001, 0x01100001,
|
||||
0x00000000, 0x00001000, 0x00001000, 0x00001000, // 006ch
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00000000, 0x00110111, 0x01001001, // 006dh
|
||||
0x01001001, 0x01001001, 0x01001001, 0x01001001,
|
||||
0x00000000, 0x00000000, 0x00111111, 0x01000001, // 006eh
|
||||
0x01000001, 0x01000001, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00000000, 0x00011100, 0x00100010, // 006fh
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x00000000, 0x00111101, 0x01000011, // 0070h
|
||||
0x01000001, 0x01000011, 0x00111101, 0x00000001,
|
||||
0x00000000, 0x00000000, 0x01011110, 0x01100001, // 0071h
|
||||
0x01000001, 0x01100001, 0x01011110, 0x01000000,
|
||||
0x00000000, 0x00000000, 0x00110001, 0x00001101, // 0072h
|
||||
0x00000011, 0x00000001, 0x00000001, 0x00000001,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x01000001, // 0073h
|
||||
0x00001110, 0x00110000, 0x01000001, 0x00111110,
|
||||
0x00000000, 0x00000100, 0x00000100, 0x01111111, // 0074h
|
||||
0x00000100, 0x00000100, 0x00000100, 0x01111000,
|
||||
0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0075h
|
||||
0x01000001, 0x01000001, 0x01000001, 0x01111110,
|
||||
0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0076h
|
||||
0x00100010, 0x00100010, 0x00010100, 0x00001000,
|
||||
0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0077h
|
||||
0x01001001, 0x00101010, 0x00101010, 0x00010100,
|
||||
0x00000000, 0x00000000, 0x00100001, 0x00010010, // 0078h
|
||||
0x00001100, 0x00001100, 0x00010010, 0x00100001,
|
||||
0x00000000, 0x00000000, 0x01000001, 0x01000001, // 0079h
|
||||
0x00100010, 0x00011100, 0x00001000, 0x00000110,
|
||||
0x00000000, 0x00000000, 0x00111111, 0x00010000, // 007ah
|
||||
0x00001000, 0x00000100, 0x00000010, 0x00111111,
|
||||
0x00000000, 0x00001000, 0x00011110, 0x01100100, // 007bh
|
||||
0x00011000, 0x00100100, 0x00000100, 0x01111000,
|
||||
0x00000000, 0x00000000, 0x00011110, 0x00000100, // 007ch
|
||||
0x00011110, 0x00110101, 0x00101101, 0x00010010,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00010001, // 007dh
|
||||
0x00100001, 0x00100001, 0x00000001, 0x00000010,
|
||||
0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007eh
|
||||
0x00011110, 0x00100000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x00000000, 0x00011100, 0x00000000, // 007fh
|
||||
0x00111110, 0x00010000, 0x00001100, 0x00110010,
|
||||
0x00000000, 0x00000000, 0x00000100, 0x00101111, // 0080h
|
||||
0x01000100, 0x00011110, 0x00100101, 0x00010110,
|
||||
0x00000000, 0x00000000, 0x00001010, 0x00011110, // 0081h
|
||||
0x00101011, 0x00100010, 0x00010100, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00001000, 0x00011101, // 0082h
|
||||
0x00101011, 0x00101001, 0x00011001, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00001000, 0x00111000, // 0083h
|
||||
0x00001000, 0x00011110, 0x00101001, 0x00000110,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00011100, // 0084h
|
||||
0x00100011, 0x00100000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x00000110, 0x01001001, 0x00110000, // 0085h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000100, 0x00111111, 0x00000100, // 0086h
|
||||
0x00111110, 0x01010101, 0x01001101, 0x00100110,
|
||||
0x00000000, 0x00000000, 0x00100001, 0x01000001, // 0087h
|
||||
0x01000001, 0x01000001, 0x00000001, 0x00000010,
|
||||
0x00000000, 0x00111100, 0x00000000, 0x00111110, // 0088h
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x00011100, 0x00000000, 0x00111110, // 0089h
|
||||
0x00010000, 0x00001000, 0x00010100, 0x01100010,
|
||||
0x00000000, 0x00100100, 0x01011111, 0x00000100, // 008ah
|
||||
0x00111110, 0x01000101, 0x01000101, 0x00100010,
|
||||
0x00000000, 0x00100010, 0x01001111, 0x01010010, // 008bh
|
||||
0x01010010, 0x00010010, 0x00010010, 0x00001001,
|
||||
0x00000000, 0x00000100, 0x00111110, 0x00001000, // 008ch
|
||||
0x00111110, 0x00010000, 0x00000010, 0x00111100,
|
||||
0x00000000, 0x00100000, 0x00011000, 0x00000110, // 008dh
|
||||
0x00000001, 0x00000110, 0x00011000, 0x00100000,
|
||||
0x00000000, 0x00100000, 0x01111101, 0x00100001, // 008eh
|
||||
0x00100001, 0x00100001, 0x00100001, 0x00010010,
|
||||
0x00000000, 0x00011110, 0x00100000, 0x00000000, // 008fh
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00111110,
|
||||
0x00000000, 0x00001000, 0x01111111, 0x00010000, // 0090h
|
||||
0x00100000, 0x00000010, 0x00000010, 0x00111100,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x00000001, // 0091h
|
||||
0x01000001, 0x01000001, 0x00100010, 0x00011100,
|
||||
0x00000000, 0x00010000, 0x01111111, 0x00011000, // 0092h
|
||||
0x00010100, 0x00010100, 0x00011000, 0x00001100,
|
||||
0x00000000, 0x00100010, 0x01111111, 0x00100010, // 0093h
|
||||
0x00100010, 0x00000010, 0x00000010, 0x01111100,
|
||||
0x00000000, 0x00111100, 0x00010000, 0x00001100, // 0094h
|
||||
0x01111111, 0x00001000, 0x00001000, 0x00110000,
|
||||
0x00000000, 0x00000100, 0x00011111, 0x00000100, // 0095h
|
||||
0x01110100, 0x00000010, 0x00001010, 0x01110010,
|
||||
0x00000000, 0x00001000, 0x01111111, 0x00000100, // 0096h
|
||||
0x00111100, 0x01000010, 0x01000000, 0x00111100,
|
||||
0x00000000, 0x00000000, 0x00011100, 0x00100011, // 0097h
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x01111111, 0x00010000, 0x00001000, // 0098h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00110000,
|
||||
0x00000000, 0x00000010, 0x00110010, 0x00001100, // 0099h
|
||||
0x00000010, 0x00000001, 0x00000001, 0x00111110,
|
||||
0x00000000, 0x00100100, 0x01001111, 0x01000010, // 009ah
|
||||
0x00010001, 0x00111100, 0x00010010, 0x00001100,
|
||||
0x00000000, 0x00000010, 0x01111010, 0x01000010, // 009bh
|
||||
0x00000010, 0x00000010, 0x00001010, 0x01110010,
|
||||
0x00000000, 0x00100010, 0x00111110, 0x01010010, // 009ch
|
||||
0x01001011, 0x01101101, 0x01010101, 0x00110010,
|
||||
0x00000000, 0x00110010, 0x01001011, 0x01000110, // 009dh
|
||||
0x01000110, 0x01110010, 0x01001011, 0x00110010,
|
||||
0x00000000, 0x00011100, 0x00101010, 0x01001001, // 009eh
|
||||
0x01001001, 0x01000101, 0x01000101, 0x00110010,
|
||||
0x00000000, 0x00100001, 0x01111101, 0x00100001, // 009fh
|
||||
0x00100001, 0x00111001, 0x01100101, 0x00011001,
|
||||
0x00000000, 0x00000100, 0x00100011, 0x01100010, // 00a0h
|
||||
0x00100001, 0x00100001, 0x00010010, 0x00001100,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a1h
|
||||
0x00000000, 0x00000100, 0x00001010, 0x00000100,
|
||||
0x00000000, 0x01110000, 0x00010000, 0x00010000, // 00a2h
|
||||
0x00010000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a3h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00001110,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00a4h
|
||||
0x00000000, 0x00000010, 0x00000100, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00011000, // 00a5h
|
||||
0x00011000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x01111111, 0x01000000, 0x01111111, // 00a6h
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x00000000, 0x00111111, 0x00100000, // 00a7h
|
||||
0x00010100, 0x00001100, 0x00000100, 0x00000010,
|
||||
0x00000000, 0x00000000, 0x00100000, 0x00100000, // 00a8h
|
||||
0x00010000, 0x00001111, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x00000000, 0x00000100, 0x00111111, // 00a9h
|
||||
0x00100001, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00aah
|
||||
0x00001000, 0x00001000, 0x00001000, 0x01111111,
|
||||
0x00000000, 0x00000000, 0x00010000, 0x00111111, // 00abh
|
||||
0x00011000, 0x00010100, 0x00010010, 0x00011001,
|
||||
0x00000000, 0x00000000, 0x00000010, 0x00111111, // 00ach
|
||||
0x00100010, 0x00010010, 0x00000100, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00111110, // 00adh
|
||||
0x00100000, 0x00100000, 0x00100000, 0x01111111,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00aeh
|
||||
0x00111110, 0x00100000, 0x00100000, 0x00111110,
|
||||
0x00000000, 0x00000000, 0x00100101, 0x00101010, // 00afh
|
||||
0x00101010, 0x00100000, 0x00010000, 0x00001110,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00b0h
|
||||
0x01111111, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x01111111, 0x01000000, 0x00101000, // 00b1h
|
||||
0x00011000, 0x00001000, 0x00001000, 0x00000100,
|
||||
0x00000000, 0x01000000, 0x00100000, 0x00011000, // 00b2h
|
||||
0x00010111, 0x00010000, 0x00010000, 0x00010000,
|
||||
0x00000000, 0x00001000, 0x01111111, 0x01000001, // 00b3h
|
||||
0x01000001, 0x01000000, 0x00100000, 0x00011000,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x00001000, // 00b4h
|
||||
0x00001000, 0x00001000, 0x00001000, 0x01111111,
|
||||
0x00000000, 0x00100000, 0x01111111, 0x00110000, // 00b5h
|
||||
0x00101000, 0x00100100, 0x00100010, 0x00110001,
|
||||
0x00000000, 0x00000100, 0x01111111, 0x01000100, // 00b6h
|
||||
0x01000100, 0x01000100, 0x01000010, 0x00100001,
|
||||
0x00000000, 0x00000100, 0x00111111, 0x00001000, // 00b7h
|
||||
0x01111111, 0x00010000, 0x00010000, 0x00010000,
|
||||
0x00000000, 0x01111100, 0x01000100, 0x01000100, // 00b8h
|
||||
0x01000010, 0x01000000, 0x00100000, 0x00011000,
|
||||
0x00000000, 0x00000010, 0x01111110, 0x00100010, // 00b9h
|
||||
0x00100001, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00bah
|
||||
0x01000000, 0x01000000, 0x01000000, 0x01111110,
|
||||
0x00000000, 0x00100010, 0x01111111, 0x00100010, // 00bbh
|
||||
0x00100010, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x00000011, 0x00000100, 0x01000011, // 00bch
|
||||
0x01000100, 0x00100000, 0x00011000, 0x00000111,
|
||||
0x00000000, 0x01111111, 0x01000000, 0x00100000, // 00bdh
|
||||
0x00010000, 0x00011000, 0x00100100, 0x01000011,
|
||||
0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00beh
|
||||
0x00100010, 0x00000010, 0x00000010, 0x01111100,
|
||||
0x00000000, 0x01000001, 0x01000010, 0x01000000, // 00bfh
|
||||
0x00100000, 0x00100000, 0x00011000, 0x00000110,
|
||||
0x00000000, 0x01111110, 0x01000010, 0x01001110, // 00c0h
|
||||
0x01110001, 0x01000000, 0x00100000, 0x00011000,
|
||||
0x00000000, 0x01100000, 0x00011110, 0x00010000, // 00c1h
|
||||
0x01111111, 0x00010000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01000101, 0x01001010, 0x01001010, // 00c2h
|
||||
0x01000000, 0x00100000, 0x00010000, 0x00001110,
|
||||
0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00c3h
|
||||
0x00010000, 0x00010000, 0x00001000, 0x00000110,
|
||||
0x00000000, 0x00000010, 0x00000010, 0x00000110, // 00c4h
|
||||
0x00011010, 0x01100010, 0x00000010, 0x00000010,
|
||||
0x00000000, 0x00010000, 0x00010000, 0x01111111, // 00c5h
|
||||
0x00010000, 0x00010000, 0x00001000, 0x00000110,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x00000000, // 00c6h
|
||||
0x00000000, 0x00000000, 0x00000000, 0x01111111,
|
||||
0x00000000, 0x01111110, 0x01000000, 0x01000100, // 00c7h
|
||||
0x00101000, 0x00010000, 0x00101000, 0x01000110,
|
||||
0x00000000, 0x00001000, 0x01111111, 0x00100000, // 00c8h
|
||||
0x00010000, 0x00011100, 0x01101011, 0x00001000,
|
||||
0x00000000, 0x01000000, 0x01000000, 0x01000000, // 00c9h
|
||||
0x00100000, 0x00100000, 0x00011000, 0x00000111,
|
||||
0x00000000, 0x00010010, 0x00100010, 0x00100010, // 00cah
|
||||
0x01000010, 0x01000010, 0x01000001, 0x01000001,
|
||||
0x00000000, 0x00000001, 0x00000001, 0x01111111, // 00cbh
|
||||
0x00000001, 0x00000001, 0x00000001, 0x01111110,
|
||||
0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cch
|
||||
0x01000000, 0x00100000, 0x00010000, 0x00001110,
|
||||
0x00000000, 0x00000000, 0x00000100, 0x00001010, // 00cdh
|
||||
0x00010001, 0x00100001, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x00001000, 0x00001000, 0x01111111, // 00ceh
|
||||
0x00001000, 0x00101010, 0x01001010, 0x01001001,
|
||||
0x00000000, 0x01111111, 0x01000000, 0x01000000, // 00cfh
|
||||
0x00100010, 0x00010100, 0x00001000, 0x00010000,
|
||||
0x00000000, 0x00001110, 0x01110000, 0x00001110, // 00d0h
|
||||
0x01110000, 0x00000110, 0x00011000, 0x01100000,
|
||||
0x00000000, 0x00001000, 0x00001000, 0x00000100, // 00d1h
|
||||
0x00000100, 0x00100010, 0x01000010, 0x01111111,
|
||||
0x00000000, 0x01000000, 0x01000000, 0x00100100, // 00d2h
|
||||
0x00101000, 0x00010000, 0x00101100, 0x01000011,
|
||||
0x00000000, 0x01111111, 0x00000100, 0x01111111, // 00d3h
|
||||
0x00000100, 0x00000100, 0x00000100, 0x01111000,
|
||||
0x00000000, 0x00000010, 0x01111111, 0x01000010, // 00d4h
|
||||
0x00100010, 0x00010100, 0x00000100, 0x00000100,
|
||||
0x00000000, 0x00000000, 0x00111110, 0x00100000, // 00d5h
|
||||
0x00100000, 0x00100000, 0x00100000, 0x01111111,
|
||||
0x00000000, 0x01111110, 0x01000000, 0x01000000, // 00d6h
|
||||
0x01111110, 0x01000000, 0x01000000, 0x01111110,
|
||||
0x00000000, 0x00111110, 0x00000000, 0x01111111, // 00d7h
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00d8h
|
||||
0x01000010, 0x01000000, 0x00100000, 0x00011000,
|
||||
0x00000000, 0x00001010, 0x00001010, 0x00001010, // 00d9h
|
||||
0x01001010, 0x01001010, 0x00101010, 0x00011001,
|
||||
0x00000000, 0x00000010, 0x00000010, 0x01000010, // 00dah
|
||||
0x01000010, 0x00100010, 0x00010010, 0x00001110,
|
||||
0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dbh
|
||||
0x01000001, 0x01000001, 0x01000001, 0x01111111,
|
||||
0x00000000, 0x01111111, 0x01000001, 0x01000001, // 00dch
|
||||
0x01000000, 0x01000000, 0x00100000, 0x00011100,
|
||||
0x00000000, 0x01000011, 0x01000100, 0x01000000, // 00ddh
|
||||
0x01000000, 0x00100000, 0x00010000, 0x00001111,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00deh
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h
|
||||
0x00101001, 0x01010001, 0x01010001, 0x00001100,
|
||||
0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h
|
||||
0x00010010, 0x00100001, 0x01000000, 0x00000000,
|
||||
0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h
|
||||
0x00100001, 0x00111001, 0x01100101, 0x00011001,
|
||||
0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h
|
||||
0x00010000, 0x00011100, 0x00110010, 0x00001100,
|
||||
0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h
|
||||
0x00111110, 0x01100101, 0x00100101, 0x00010010,
|
||||
0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h
|
||||
0x00000110, 0x01000101, 0x01000101, 0x00111110,
|
||||
0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h
|
||||
0x01010010, 0x01010101, 0x01001101, 0x00100110,
|
||||
0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h
|
||||
0x00011111, 0x01000010, 0x01000010, 0x00111100,
|
||||
0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h
|
||||
0x01000010, 0x00100100, 0x00000100, 0x00000100,
|
||||
0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h
|
||||
0x01001001, 0x01001001, 0x00111000, 0x00000100,
|
||||
0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah
|
||||
0x00001000, 0x00011110, 0x00101001, 0x00000110,
|
||||
0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh
|
||||
0x00111010, 0x01000110, 0x01000000, 0x00111000,
|
||||
0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech
|
||||
0x01000110, 0x01000000, 0x00100000, 0x00011000,
|
||||
0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh
|
||||
0x01000011, 0x01001100, 0x01010010, 0x00111100,
|
||||
0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh
|
||||
0x00100110, 0x00100010, 0x00100011, 0x01000010,
|
||||
0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh
|
||||
0x01000011, 0x01000000, 0x01000010, 0x00111100,
|
||||
0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h
|
||||
0x01000010, 0x01000011, 0x01000010, 0x00110010,
|
||||
0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h
|
||||
0x01000110, 0x01000101, 0x01000101, 0x00111001,
|
||||
0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h
|
||||
0x00100100, 0x00100100, 0x00100010, 0x00010001,
|
||||
0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h
|
||||
0x00111111, 0x00001000, 0x00001000, 0x00001000,
|
||||
0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h
|
||||
0x00100001, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h
|
||||
0x00100001, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01010000, 0x01111111, 0x00100000, // 00f6h
|
||||
0x00100000, 0x00100000, 0x00100000, 0x00111111,
|
||||
0x00000000, 0x01010010, 0x01010010, 0x00111111, // 00f7h
|
||||
0x00010010, 0x00010000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01010011, 0x01010100, 0x00100011, // 00f8h
|
||||
0x00100100, 0x00010000, 0x00001000, 0x00000111,
|
||||
0x00000000, 0x01010000, 0x01011111, 0x00010000, // 00f9h
|
||||
0x00001000, 0x00001100, 0x00010010, 0x00100001,
|
||||
0x00000000, 0x01010010, 0x01111111, 0x00100010, // 00fah
|
||||
0x00010010, 0x00000010, 0x00000010, 0x00111100,
|
||||
0x00000000, 0x01010001, 0x01010010, 0x00100000, // 00fbh
|
||||
0x00100000, 0x00010000, 0x00001000, 0x00000110,
|
||||
0x00000000, 0x01011110, 0x01010010, 0x00100110, // 00fch
|
||||
0x00111001, 0x00100000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x01010000, 0x01011110, 0x00010000, // 00fdh
|
||||
0x01111111, 0x00010000, 0x00010000, 0x00001100,
|
||||
0x00000000, 0x00100101, 0x01001010, 0x00101010, // 00feh
|
||||
0x00100000, 0x00010000, 0x00001000, 0x00000111,
|
||||
0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh
|
||||
0x00001000, 0x00001000, 0x00001000, 0x00000110
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Palette data
|
||||
*---------------------------------------------------------------------------*/
|
||||
const u32 d_PaletteData[8 * 16] =
|
||||
{
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, // black
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x001f0000, 0x00000000, 0x00000000, 0x00000000, // red
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00180000, 0x00000000, 0x00000000, 0x00000000, // dark red
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
684
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/kami_pxi.c
Normal file
684
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/kami_pxi.c
Normal file
@ -0,0 +1,684 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_pxi.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-07-25#$
|
||||
$Rev: 2003 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include "kami_pxi.h"
|
||||
#include "fifo.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
// 詰めてコピーする
|
||||
#define KAMI_PACK_U16(d, s) \
|
||||
((d)[0] = (u8)((*((u16*)s) >> 0) & 0xFF), \
|
||||
(d)[1] = (u8)((*((u16*)s) >> 8) & 0xFF))
|
||||
|
||||
#define KAMI_PACK_U32(d, s) \
|
||||
((d)[0] = (u8)((*((u32*)s) >> 0) & 0xFF), \
|
||||
(d)[1] = (u8)((*((u32*)s) >> 8) & 0xFF), \
|
||||
(d)[2] = (u8)((*((u32*)s) >> 16) & 0xFF), \
|
||||
(d)[3] = (u8)((*((u32*)s) >> 24) & 0xFF))
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
型定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct KamiWork
|
||||
{
|
||||
BOOL lock;
|
||||
|
||||
KamiCommand command;
|
||||
KAMIPxiResult result;
|
||||
KAMICallback callback;
|
||||
void* arg;
|
||||
|
||||
u32 total;
|
||||
u32 current;
|
||||
u8* data;
|
||||
}
|
||||
KamiWork;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
静的変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL kamiInitialized;
|
||||
static KamiWork kamiWork;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL KamiSendPxiCommand(KamiCommand command, u8 size, u8 data);
|
||||
static void KamiSendPxiData(u8 *pData);
|
||||
static void KamiPxiCallback(PXIFifoTag tag, u32 data, BOOL err);
|
||||
static void KamiDone(KAMIResult result);
|
||||
static void KamiWaitBusy(void);
|
||||
|
||||
|
||||
void KamiPxiInit( void )
|
||||
{
|
||||
kamiWork.lock = FALSE;
|
||||
|
||||
PXI_Init();
|
||||
while ( !PXI_IsCallbackReady(PXI_FIFO_TAG_KAMITEST, PXI_PROC_ARM7 ))
|
||||
{
|
||||
}
|
||||
PXI_SetFifoRecvCallback(PXI_FIFO_TAG_KAMITEST, KamiPxiCallback);
|
||||
if ( 0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, KAMITEST_PXI_START_BIT | (KAMI_TEST_COMMAND << KAMITEST_PXI_COMMAND_SHIFT), 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
//typedef void (*KAMICallback)(KAMIResult result, void *arg);
|
||||
/*
|
||||
void CDC_ReadCallback(KAMIResult result, void* arg);
|
||||
void CDC_ReadCallback(KAMIResult result, void* arg)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: フォーマット実行関数
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: FormatMode
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult ExeFormatAsync(FormatMode format_mode, KAMICallback callback)
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = callback;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = 0;
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_EXE_FORMAT, 1, format_mode) == FALSE)
|
||||
{
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
return KAMI_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
KAMIResult ExeFormat(FormatMode format_mode)
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = 0;
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_EXE_FORMAT, 1, format_mode))
|
||||
{
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NANDアクセス関数
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiNandIo(u32 block, void* buffer, u32 count, BOOL is_read)
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
u8 data[12];
|
||||
int i;
|
||||
|
||||
MI_CpuClear8( data, sizeof(data));
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = 0;
|
||||
|
||||
// データ作成
|
||||
KAMI_PACK_U32(&data[0], &block);
|
||||
KAMI_PACK_U32(&data[4], &buffer);
|
||||
KAMI_PACK_U32(&data[8], &count);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_NAND_IO, 13, (u8)is_read))
|
||||
{
|
||||
for (i = 0; i < 12; i+=3)
|
||||
{
|
||||
KamiSendPxiData(&data[i]);
|
||||
}
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiMcuWriteFirm
|
||||
|
||||
Description: MCUファーム更新関数
|
||||
|
||||
Arguments: buffer : new mcu data buffer
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiMcuWriteFirm(void* buffer )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
u8 data[4+2]; // 3の倍数
|
||||
int i;
|
||||
|
||||
MI_CpuClear8( data, sizeof(data));
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
|
||||
// データ作成
|
||||
KAMI_PACK_U32(&data[0], &buffer);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_MCU_WRITE_FIRM, 5, (u8)0))
|
||||
{
|
||||
for (i = 0; i < 4; i+=3)
|
||||
{
|
||||
KamiSendPxiData(&data[i]);
|
||||
}
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: MCUアクセス関数
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiMcuIo(u32 reg_no, void* buffer, u32 value, BOOL is_read)
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
u8 data[12];
|
||||
int i;
|
||||
|
||||
MI_CpuClear8( data, sizeof(data));
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
if (is_read)
|
||||
{
|
||||
kamiWork.data = (u8*)buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiWork.data = 0;
|
||||
}
|
||||
|
||||
// データ作成
|
||||
KAMI_PACK_U32(&data[0], ®_no);
|
||||
KAMI_PACK_U32(&data[4], &value);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_MCU_IO, 13, (u8)is_read))
|
||||
{
|
||||
for (i = 0; i < 12; i+=3)
|
||||
{
|
||||
KamiSendPxiData(&data[i]);
|
||||
}
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ARM7アクセス関数
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiARM7Io(u32 addr, u32* buffer, u32 value, BOOL is_read)
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
u8 data[12];
|
||||
int i;
|
||||
|
||||
MI_CpuClear8( data, sizeof(data));
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
if (is_read)
|
||||
{
|
||||
kamiWork.data = (u8*)buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
kamiWork.data = 0;
|
||||
}
|
||||
|
||||
// データ作成
|
||||
KAMI_PACK_U32(&data[0], &addr);
|
||||
KAMI_PACK_U32(&data[4], &value);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_ARM7_IO, 13, (u8)is_read))
|
||||
{
|
||||
for (i = 0; i < 12; i+=3)
|
||||
{
|
||||
KamiSendPxiData(&data[i]);
|
||||
}
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiCDC_GoDsMode
|
||||
|
||||
Description: CODECをDSモードへ遷移させる関数
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiCDC_GoDsMode( void )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = 0;
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_CDC_GO_DSMODE, 0, (u8)0))
|
||||
{
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiClearNandErrorLog
|
||||
|
||||
Description: NVRAMのNANDエラー情報をクリアします。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiClearNandErrorLog( void )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = 0;
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_CLEAR_NAND_ERRORLOG, 0, (u8)0))
|
||||
{
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiGetCameraModuleTypesAsync
|
||||
|
||||
Description: カメラモジュールタイプを取得します(非同期版)
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiGetCameraModuleTypesAsync( CameraModuleTypes *pTypes, KAMICallback callback, void* arg )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
if (pTypes == NULL)
|
||||
{
|
||||
return KAMI_RESULT_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
kamiWork.callback = callback;
|
||||
kamiWork.arg = arg;
|
||||
kamiWork.data = (u8*)pTypes;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_GET_CAMERA_MODULE_TYPE, 0, 0))
|
||||
{
|
||||
return KAMI_RESULT_SUCCESS;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiGetCameraModuleTypes
|
||||
|
||||
Description: カメラモジュールタイプを取得します(同期版)
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiGetCameraModuleTypes( CameraModuleTypes *pTypes )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
|
||||
if (pTypes == NULL)
|
||||
{
|
||||
return KAMI_RESULT_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = (u8*)pTypes;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_GET_CAMERA_MODULE_TYPE, 0, 0))
|
||||
{
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiGetNandCID
|
||||
|
||||
Description: NANDのCIDを取得します。
|
||||
|
||||
Arguments: buffer : 16バイトバッファ
|
||||
|
||||
Returns:
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
KAMIResult kamiGetNandCID(void* buffer )
|
||||
{
|
||||
OSIntrMode enabled;
|
||||
u8 data[4+2]; // 3の倍数
|
||||
|
||||
MI_CpuClear8( data, sizeof(data));
|
||||
|
||||
// ロック
|
||||
enabled = OS_DisableInterrupts();
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
return KAMI_RESULT_BUSY;
|
||||
}
|
||||
kamiWork.lock = TRUE;
|
||||
(void)OS_RestoreInterrupts(enabled);
|
||||
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = 0;
|
||||
kamiWork.data = (u8*)buffer;
|
||||
|
||||
if (KamiSendPxiCommand(KAMI_GET_NAND_CID, 0, 0))
|
||||
{
|
||||
KamiWaitBusy();
|
||||
return (KAMIResult)kamiWork.result;
|
||||
}
|
||||
|
||||
return KAMI_RESULT_SEND_ERROR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
PXI関連
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static BOOL KamiSendPxiCommand(KamiCommand command, u8 size, u8 data)
|
||||
{
|
||||
u32 pxiData = (u32)(KAMITEST_PXI_START_BIT |
|
||||
((command << KAMITEST_PXI_COMMAND_SHIFT) & KAMITEST_PXI_COMMAND_MASK) |
|
||||
((size << KAMITEST_PXI_DATA_NUMS_SHIFT) & KAMITEST_PXI_DATA_NUMS_MASK) |
|
||||
((data << KAMITEST_PXI_1ST_DATA_SHIFT) & KAMITEST_PXI_1ST_DATA_MASK));
|
||||
if (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, pxiData, 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void KamiSendPxiData(u8 *pData)
|
||||
{
|
||||
u32 pxiData = (u32)((pData[0] << 16) | (pData[1] << 8) | pData[2]);
|
||||
while (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_KAMITEST, pxiData, 0))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void KamiPxiCallback(PXIFifoTag tag, u32 data, BOOL err)
|
||||
{
|
||||
#pragma unused( tag )
|
||||
if (err)
|
||||
{
|
||||
KamiDone(KAMI_RESULT_FATAL_ERROR);
|
||||
return;
|
||||
}
|
||||
if (data & KAMITEST_PXI_START_BIT) // 先頭データ
|
||||
{
|
||||
if (data & KAMITEST_PXI_RESULT_BIT)
|
||||
{
|
||||
kamiWork.total = (u8)((data & KAMITEST_PXI_DATA_NUMS_MASK) >> KAMITEST_PXI_DATA_NUMS_SHIFT);
|
||||
kamiWork.current = 0;
|
||||
kamiWork.command = (KamiCommand)((data & KAMITEST_PXI_COMMAND_MASK) >> KAMITEST_PXI_COMMAND_SHIFT);
|
||||
kamiWork.result = (KAMIPxiResult)((data & KAMITEST_PXI_1ST_DATA_MASK) >> KAMITEST_PXI_1ST_DATA_SHIFT);
|
||||
}
|
||||
else // 未知のデータ
|
||||
{
|
||||
KamiDone(KAMI_RESULT_FATAL_ERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else // 後続データ
|
||||
{
|
||||
if (kamiWork.data == NULL)
|
||||
{
|
||||
KamiDone(KAMI_RESULT_FATAL_ERROR);
|
||||
return;
|
||||
}
|
||||
if (kamiWork.current < kamiWork.total-1)
|
||||
{
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0xFF0000) >> 16);
|
||||
}
|
||||
if (kamiWork.current < kamiWork.total-1)
|
||||
{
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0x00FF00) >> 8);
|
||||
}
|
||||
if (kamiWork.current < kamiWork.total-1)
|
||||
{
|
||||
kamiWork.data[kamiWork.current++] = (u8)((data & 0x0000FF) >> 0);
|
||||
}
|
||||
}
|
||||
if (kamiWork.current == kamiWork.total-1)
|
||||
{
|
||||
KAMIResult result;
|
||||
switch (kamiWork.result)
|
||||
{
|
||||
case KAMI_PXI_RESULT_SUCCESS: // alias KAMI_PXI_RESULT_SUCCESS_TRUE
|
||||
result = KAMI_RESULT_SUCCESS; // alias KAMI_RESULT_SUCCESS_TRUE
|
||||
break;
|
||||
case KAMI_PXI_RESULT_SUCCESS_FALSE:
|
||||
result = KAMI_RESULT_SUCCESS_FALSE;
|
||||
break;
|
||||
case KAMI_PXI_RESULT_INVALID_COMMAND:
|
||||
result = KAMI_RESULT_INVALID_COMMAND;
|
||||
break;
|
||||
case KAMI_PXI_RESULT_INVALID_PARAMETER:
|
||||
result = KAMI_RESULT_INVALID_PARAMETER;
|
||||
break;
|
||||
case KAMI_PXI_RESULT_ILLEGAL_STATUS:
|
||||
result = KAMI_RESULT_ILLEGAL_STATUS;
|
||||
break;
|
||||
case KAMI_PXI_RESULT_BUSY:
|
||||
result = KAMI_RESULT_BUSY;
|
||||
break;
|
||||
default:
|
||||
result = KAMI_RESULT_FATAL_ERROR;
|
||||
}
|
||||
KamiDone(result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
extern void PXIi_HandlerRecvFifoNotEmpty(void);
|
||||
static void KamiWaitBusy(void)
|
||||
{
|
||||
volatile BOOL *p = &kamiWork.lock;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (OS_GetCpsrIrq() == OS_INTRMODE_IRQ_DISABLE)
|
||||
{
|
||||
PXIi_HandlerRecvFifoNotEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void KamiDone(KAMIResult result)
|
||||
{
|
||||
KAMICallback callback = kamiWork.callback;
|
||||
void* arg = kamiWork.arg;
|
||||
kamiWork.callback = NULL;
|
||||
kamiWork.arg = NULL;
|
||||
if (kamiWork.lock)
|
||||
{
|
||||
kamiWork.lock = FALSE;
|
||||
}
|
||||
if (callback)
|
||||
{
|
||||
callback(result, arg);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,467 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: kami_write_nandfirm.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-09-08#$
|
||||
$Rev: 2427 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include <twl/fatfs.h>
|
||||
#include <nitro/card.h>
|
||||
#include <nitro/snd.h>
|
||||
#include <twl/nam.h>
|
||||
#include <nitro/nvram.h>
|
||||
#include <firm/format/firm_common.h>
|
||||
#include <../build/libraries/spi/ARM9/include/spi.h>
|
||||
|
||||
#include "common_utility.h"
|
||||
#include "kami_write_nandfirm.h"
|
||||
#include "kami_pxi.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
マクロ定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// NANDファーム書き込みの際にNVRAMの未割り当て領域+予約領域を0クリアする場合は定義します(開発用)
|
||||
//#define CLEAR_NON_ASIGNED_AREA_AND_RESERVED_AREA_ALL
|
||||
|
||||
#define ROUND_UP(value, alignment) \
|
||||
(((u32)(value) + (alignment-1)) & ~(alignment-1))
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define NAND_BLOCK_BYTE 0x200
|
||||
#define NAND_FIRM_START_OFFSET 0x200
|
||||
#define NAND_FIRM_START_OFFSET_IN_FILE 0x200
|
||||
|
||||
#define NVRAM_PAGE_SIZE 0x100
|
||||
#define NVRAM_NORFIRM_RESERVED_ADDRESS 0x200
|
||||
#define NVRAM_NORFIRM_NANDBOOT_FLAG_OFFSET 0xff
|
||||
#define NVRAM_NORFIRM_NANDBOOT_FLAG 0x80
|
||||
|
||||
#define NVRAM_NON_ASIGNED_AREA_ADDRESS 0x300
|
||||
|
||||
|
||||
#define DOT_OF_MENU_SPACE 8
|
||||
#define CHAR_OF_MENU_SPACE 1
|
||||
#define CURSOR_ORIGIN_X 32
|
||||
#define CURSOR_ORIGIN_Y 40
|
||||
|
||||
#define FILE_NUM_MAX 16
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static u8 sNvramPageSizeBuffer[NVRAM_PAGE_SIZE] ATTRIBUTE_ALIGN(32); // ARM7からアクセスするためスタックでは駄目
|
||||
static u32 sReservedAreaEndAddress;
|
||||
|
||||
static s32 sMenuSelectNo;
|
||||
static char sFilePath[FILE_NUM_MAX][FS_ENTRY_LONGNAME_MAX];
|
||||
static u8 sFileNum;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static void kamiEraseNandfirmVersion( u32 nandfirmsize );
|
||||
BOOL GetNandFirmBinPath(void);
|
||||
BOOL kamiWriteNandfirm(const char* pFullPath, NAMAlloc allocFunc, NAMFree freeFunc);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: プロセス
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: next sequence
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL NandfirmProcess(void)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
char full_path[FS_ENTRY_LONGNAME_MAX+6];
|
||||
|
||||
if( !GetNandFirmBinPath() )
|
||||
{
|
||||
OS_PutString("Failed GetNandFirmBinPath()\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// sMenuSelectNoの初期化をしておく
|
||||
sMenuSelectNo = 0;
|
||||
|
||||
if (STD_GetStringLength(sFilePath[sMenuSelectNo]))
|
||||
{
|
||||
// .nandのフルパスを作成
|
||||
MakeFullPathForSD(sFilePath[sMenuSelectNo], full_path);
|
||||
ret = kamiWriteNandfirm(full_path, OS_AllocFromMain, OS_FreeToMain);
|
||||
}
|
||||
|
||||
// 今回の結果を表示
|
||||
if ( ret == TRUE )
|
||||
{
|
||||
OS_PutString("NandFirmWrite Success\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
OS_PutString("NandFirmWrite Fail\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: GetNandFirmBinPath
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: no
|
||||
|
||||
Returns: BOOL
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL GetNandFirmBinPath(void)
|
||||
{
|
||||
FSFile dir;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
// 配列クリア
|
||||
MI_CpuClear8( sFilePath, sizeof(sFilePath) );
|
||||
|
||||
// ファイル数初期化
|
||||
sFileNum = 0;
|
||||
|
||||
// SDカードのルートディレクトリを検索
|
||||
if ( !FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_R | FS_FILEMODE_W) )
|
||||
{
|
||||
ret = FALSE;
|
||||
OS_TPrintf("Error FS_OpenDirectory(sdmc:/)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
FSDirectoryEntryInfo info[1];
|
||||
OS_Printf("[%s]:\n", "sdmc:/");
|
||||
|
||||
//kamiFontPrintfConsole(CONSOLE_ORANGE, "------ nand file list -----\n");
|
||||
|
||||
// .nand を探してファイル名を保存しておく
|
||||
while (FS_ReadDirectory(&dir, info))
|
||||
{
|
||||
OS_Printf(" %s", info->longname);
|
||||
if ((info->attributes & (FS_ATTRIBUTE_DOS_DIRECTORY | FS_ATTRIBUTE_IS_DIRECTORY)) != 0)
|
||||
{
|
||||
OS_Printf("/\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
char* pExtension;
|
||||
OS_Printf(" (%d BYTEs)\n", info->filesize);
|
||||
|
||||
// 拡張子のチェック
|
||||
pExtension = STD_SearchCharReverse( info->longname, '.');
|
||||
if (pExtension)
|
||||
{
|
||||
if (!STD_CompareString( pExtension, ".nand") || !STD_CompareString( pExtension, ".NAND"))
|
||||
{
|
||||
STD_CopyString( sFilePath[sFileNum], info->longname );
|
||||
//kamiFontPrintfConsole(CONSOLE_ORANGE, "%d:%s\n", sFileNum, info->longname);
|
||||
|
||||
// 最大16個で終了
|
||||
if (++sFileNum >= FILE_NUM_MAX)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(void)FS_CloseDirectory(&dir);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiWriteNandfirm
|
||||
|
||||
Description:
|
||||
|
||||
Arguments: no
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
BOOL kamiWriteNandfirm(const char* pFullPath, NAMAlloc allocFunc, NAMFree freeFunc)
|
||||
{
|
||||
FSFile file;
|
||||
|
||||
BOOL open_is_ok;
|
||||
BOOL read_is_ok;
|
||||
u8* pTempBuf;
|
||||
u32 file_size;
|
||||
u32 nandfirm_size;
|
||||
u32 alloc_size;
|
||||
u32 write_block;
|
||||
BOOL result = TRUE;
|
||||
u16 crc_w1, crc_w2;
|
||||
u16 crc_r1, crc_r2;
|
||||
u16 crc_norfirm_reserved_area_w, crc_norfirm_reserved_area_r;
|
||||
#ifdef CLEAR_NON_ASIGNED_AREA_AND_RESERVED_AREA_ALL
|
||||
u32 write_offset;
|
||||
#endif // CLEAR_NON_ASIGNED_AREA_AND_RESERVED_AREA_ALL
|
||||
|
||||
// .nandファイルオープン
|
||||
FS_InitFile(&file);
|
||||
open_is_ok = FS_OpenFile(&file, pFullPath);
|
||||
if (!open_is_ok)
|
||||
{
|
||||
OS_Warning("Failure! FS_OpenFile");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// サイズチェック
|
||||
file_size = FS_GetFileLength(&file) ;
|
||||
if (file_size > (800*1024))
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "too big file size!\n");
|
||||
FS_CloseFile(&file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
nandfirm_size = file_size - NAND_FIRM_START_OFFSET_IN_FILE;
|
||||
|
||||
// バッファ確保
|
||||
// 書き込みがブロック単位(512byte)であることを考慮し512アライメントを確保
|
||||
alloc_size = MATH_ROUNDUP(file_size, 512);
|
||||
pTempBuf = allocFunc( alloc_size );
|
||||
if (pTempBuf == NULL)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail Alloc()!\n");
|
||||
FS_CloseFile(&file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MI_CpuClear8( pTempBuf, alloc_size );
|
||||
|
||||
// .nandファイルリード
|
||||
DC_FlushRange(pTempBuf, alloc_size);
|
||||
read_is_ok = FS_ReadFile( &file, pTempBuf, (s32)file_size );
|
||||
DC_FlushRange(pTempBuf, file_size);
|
||||
if (!read_is_ok)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail FS_ReadFile!\n");
|
||||
FS_CloseFile(&file);
|
||||
freeFunc(pTempBuf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ファイルクローズ
|
||||
FS_CloseFile(&file);
|
||||
|
||||
// 書き込み前のCRCを計算
|
||||
crc_w1 = SVC_GetCRC16( 0xffff, pTempBuf, sizeof(NORHeaderDS) );
|
||||
crc_w2 = SVC_GetCRC16( 0xffff, pTempBuf+NAND_FIRM_START_OFFSET_IN_FILE, nandfirm_size );
|
||||
|
||||
// まずNORHeaderDS領域を書き込む(40byte?)
|
||||
if (NVRAMi_Write(0, sizeof(NORHeaderDS), (void*)pTempBuf) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Write()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
// CRCを計算するので念のためにクリアしてからリードする
|
||||
MI_CpuClear8( pTempBuf, sizeof(NORHeaderDS) );
|
||||
DC_FlushRange(pTempBuf, sizeof(NORHeaderDS));
|
||||
|
||||
// CRCチェックのためNvramからリード
|
||||
if (NVRAMi_Read(0, sizeof(NORHeaderDS), pTempBuf) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
OS_PutString("Fail NVRAMi_Read()!\n");
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Read()!\n");
|
||||
}
|
||||
DC_FlushRange(pTempBuf, sizeof(NORHeaderDS));
|
||||
|
||||
// 書き込み後のCRCを計算
|
||||
crc_r1 = SVC_GetCRC16( 0xffff, pTempBuf, sizeof(NORHeaderDS) );
|
||||
|
||||
// NVRAM先頭部分のCRC比較
|
||||
if ( crc_w1 != crc_r1 )
|
||||
{
|
||||
freeFunc(pTempBuf);
|
||||
//kamiFontPrintfConsoleEx(1, "Fail! CRC check %x!=%x\n", crc_w1, crc_r1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// nandfirm 起動フラグを立てる
|
||||
MI_CpuClear8( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
sNvramPageSizeBuffer[NVRAM_NORFIRM_NANDBOOT_FLAG_OFFSET] = NVRAM_NORFIRM_NANDBOOT_FLAG;
|
||||
DC_FlushRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE);
|
||||
|
||||
// NORファームリザーブ領域の書き込みデータのCRCを計算
|
||||
crc_norfirm_reserved_area_w = SVC_GetCRC16( 0xffff, sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
if (NVRAMi_Write(NVRAM_NORFIRM_RESERVED_ADDRESS, NVRAM_PAGE_SIZE, sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Write()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
// CRCを計算するので念のためにクリアしてからリードする
|
||||
MI_CpuClear8( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
// 読み込みはARM7が直接メモリに書き出すため
|
||||
DC_FlushRange(sNvramPageSizeBuffer, NVRAM_PAGE_SIZE);
|
||||
|
||||
if (NVRAMi_Read(NVRAM_NORFIRM_RESERVED_ADDRESS, NVRAM_PAGE_SIZE, sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Read()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
// 書き込み後のCRCを計算
|
||||
DC_FlushRange(sNvramPageSizeBuffer, NVRAM_PAGE_SIZE);
|
||||
crc_norfirm_reserved_area_r = SVC_GetCRC16( 0xffff, sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
// NORファームリザーブ領域のCRC比較
|
||||
if ( crc_norfirm_reserved_area_w != crc_norfirm_reserved_area_r )
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail! Norfirm Reserved Area CRC check %x!=%x\n", crc_norfirm_reserved_area_w, crc_norfirm_reserved_area_r);
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
#ifdef CLEAR_NON_ASIGNED_AREA_AND_RESERVED_AREA_ALL
|
||||
DC_InvalidateRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
// 未割り当て領域+予約領域を0クリアします(開発用)
|
||||
if (NVRAMi_Read(NVRAM_CONFIG_DATA_OFFSET_ADDRESS, NVRAM_PAGE_SIZE, &sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Read()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
sReservedAreaEndAddress = (u32)(*(u16 *)sNvramPageSizeBuffer << NVRAM_CONFIG_DATA_OFFSET_SHIFT) - 0xA00;// TWL WiFi設定 + NTR WiFi設定 を差し引く
|
||||
//OS_Printf("end = %x\n", sReservedAreaEndAddress);
|
||||
|
||||
MI_CpuFill8( sNvramPageSizeBuffer, 0x00, NVRAM_PAGE_SIZE );
|
||||
DC_FlushRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
for (write_offset=NVRAM_NON_ASIGNED_AREA_ADDRESS; write_offset < sReservedAreaEndAddress; write_offset += NVRAM_PAGE_SIZE)
|
||||
{
|
||||
if (NVRAMi_Write(write_offset, NVRAM_PAGE_SIZE, sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Write()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
}
|
||||
//OS_Printf("write_offset = %x\n", write_offset);
|
||||
#else
|
||||
// 未割り当て領域先頭256byte+予約領域を0クリアします
|
||||
|
||||
MI_CpuFill8( sNvramPageSizeBuffer, 0x00, NVRAM_PAGE_SIZE );
|
||||
DC_FlushRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
if (NVRAMi_Write(NVRAM_NON_ASIGNED_AREA_ADDRESS, NVRAM_PAGE_SIZE, sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Write()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
DC_InvalidateRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
if (NVRAMi_Read(NVRAM_CONFIG_DATA_OFFSET_ADDRESS, NVRAM_PAGE_SIZE, &sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Read()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
sReservedAreaEndAddress = (u32)(*(u16 *)sNvramPageSizeBuffer << NVRAM_CONFIG_DATA_OFFSET_SHIFT) - 0xA00;// TWL WiFi設定 + NTR WiFi設定 を差し引く
|
||||
|
||||
MI_CpuFill8( sNvramPageSizeBuffer, 0x00, NVRAM_PAGE_SIZE );
|
||||
DC_FlushRange( sNvramPageSizeBuffer, NVRAM_PAGE_SIZE );
|
||||
|
||||
if (NVRAMi_Write(sReservedAreaEndAddress - 0x100, NVRAM_PAGE_SIZE, sNvramPageSizeBuffer) != NVRAM_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail NVRAMi_Write()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// NANDログ情報のクリア
|
||||
if (kamiClearNandErrorLog() != KAMI_RESULT_SUCCESS)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "Fail kamiClearNandErrorLog()\n");
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
// nandfirmバージョンの消去(デバッグ用)
|
||||
kamiEraseNandfirmVersion(nandfirm_size);
|
||||
|
||||
// kamiFontPrintfConsoleEx(0, "NAND Firm Import Start!\n");
|
||||
|
||||
// NAND書き込み
|
||||
write_block = nandfirm_size/NAND_BLOCK_BYTE + (nandfirm_size % NAND_BLOCK_BYTE != 0);
|
||||
kamiNandWrite( NAND_FIRM_START_OFFSET/NAND_BLOCK_BYTE, pTempBuf+NAND_FIRM_START_OFFSET, write_block ); // ブロック単位、バイト単位、ブロック単位
|
||||
// kamiFontLoadScreenData();
|
||||
|
||||
// CRCを計算するので念のためにクリアしてからリードする
|
||||
MI_CpuClear8( pTempBuf, nandfirm_size );
|
||||
DC_FlushRange(pTempBuf, nandfirm_size);
|
||||
|
||||
// CRCチェックのためNandからリード
|
||||
if (kamiNandRead(NAND_FIRM_START_OFFSET/NAND_BLOCK_BYTE, pTempBuf, write_block ) == KAMI_RESULT_SEND_ERROR)
|
||||
{
|
||||
//kamiFontPrintfConsoleEx(1, "kamiNandRead ... %s!\n", "ERROR");
|
||||
}
|
||||
DC_FlushRange(pTempBuf, nandfirm_size);
|
||||
|
||||
// 書き込み後のCRCを計算
|
||||
crc_r2 = SVC_GetCRC16( 0xffff, pTempBuf, nandfirm_size );
|
||||
|
||||
// NAND部分についてのCRCチェック
|
||||
if (crc_w2 == crc_r2)
|
||||
{
|
||||
// kamiFontPrintfConsoleEx(0, "Success! CRC check %x==%x\n", crc_w2, crc_r2);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = FALSE;
|
||||
//kamiFontPrintfConsoleEx(1, "Fail! CRC check %x!=%x\n", crc_w2, crc_r2);
|
||||
}
|
||||
|
||||
// メモリ解放
|
||||
freeFunc(pTempBuf);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: kamiEraseNandfirmVersion
|
||||
|
||||
Description: nandfirmのバージョン情報を消去します。(デバッグ用)
|
||||
|
||||
Arguments: no
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void kamiEraseNandfirmVersion( u32 nandfirmsize )
|
||||
{
|
||||
u8 buffer[NAND_BLOCK_BYTE];
|
||||
u32 blockNo;
|
||||
|
||||
if ((nandfirmsize % NAND_BLOCK_BYTE)==0)
|
||||
{
|
||||
blockNo = NAND_FIRM_START_OFFSET/NAND_BLOCK_BYTE + nandfirmsize/NAND_BLOCK_BYTE;
|
||||
MI_CpuClear8( buffer, NAND_BLOCK_BYTE );
|
||||
DC_FlushRange(buffer, NAND_BLOCK_BYTE);
|
||||
kamiNandWrite( blockNo, buffer, 1 ); // ブロック単位、バイト単位、ブロック単位
|
||||
}
|
||||
}
|
||||
271
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/main.c
Normal file
271
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/main.c
Normal file
@ -0,0 +1,271 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - NandInitializer
|
||||
File: main.c
|
||||
|
||||
Copyright 2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2009-04-16#$
|
||||
$Rev: 2809 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include <nitro/snd.h>
|
||||
#include <twl/fatfs.h>
|
||||
#include <nitro/card.h>
|
||||
#include <twl/nam.h>
|
||||
#include <twl/os/common/format_rom.h>
|
||||
#include <sysmenu/namut.h>
|
||||
#include "kami_pxi.h"
|
||||
#include "common.h"
|
||||
#include "screen.h"
|
||||
#include "kami_write_nandfirm.h"
|
||||
#include "hwi.h"
|
||||
|
||||
#define SCRAMBLE_MASK 0x00406000
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
static FSEventHook sSDHook;
|
||||
|
||||
// キー入力
|
||||
static KeyInfo gKey;
|
||||
|
||||
// 書き込み結果
|
||||
static BOOL gProc;
|
||||
static BOOL gResult;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部関数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void VBlankIntr(void);
|
||||
static void InitAllocation(void);
|
||||
static void DrawScene(void);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: TwlMain
|
||||
|
||||
Description: main
|
||||
|
||||
Arguments: None
|
||||
|
||||
Returns: None
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
TwlMain()
|
||||
{
|
||||
// 製品ビルドランチャー&デバッガ上での起動対応
|
||||
if ( OS_GetRunningConsoleType() & OS_CONSOLE_TWLDEBUGGER )
|
||||
{
|
||||
ROM_Header *dh = (void *)HW_ROM_HEADER_BUF;
|
||||
dh->s.game_cmd_param &= ~SCRAMBLE_MASK;
|
||||
}
|
||||
|
||||
OS_Init();
|
||||
OS_InitTick();
|
||||
OS_InitArena();
|
||||
PXI_Init();
|
||||
OS_InitLock();
|
||||
OS_InitArenaEx();
|
||||
OS_InitIrqTable();
|
||||
OS_SetIrqStackChecker();
|
||||
MI_Init();
|
||||
OS_InitVAlarm();
|
||||
OSi_InitVramExclusive();
|
||||
OS_InitThread();
|
||||
OS_InitReset();
|
||||
GX_Init();
|
||||
FX_Init();
|
||||
SND_Init();
|
||||
SNDEX_Init();
|
||||
TP_Init();
|
||||
RTC_Init();
|
||||
|
||||
#ifndef NAND_INITIALIZER_LIMITED_MODE
|
||||
KamiPxiInit(); /* 独自PXI初期化 */
|
||||
#endif
|
||||
|
||||
// Vブランク割り込み設定
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
|
||||
(void)OS_EnableIrq();
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
|
||||
// initialize file-system
|
||||
FS_Init(FS_DMA_NOT_USE);
|
||||
|
||||
// SDカードの挿抜イベント監視コールバック設定
|
||||
// FS_RegisterEventHook("sdmc", &sSDHook, SDEvents, NULL);
|
||||
|
||||
// FS_Initの後の方が良い模様
|
||||
InitAllocation();
|
||||
|
||||
InitScreen();
|
||||
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
|
||||
ClearScreen();
|
||||
|
||||
/* always preload FS table for faster directory access. */
|
||||
{
|
||||
u32 need_size = FS_GetTableSize();
|
||||
void *p_table = OS_Alloc(need_size);
|
||||
SDK_ASSERT(p_table != NULL);
|
||||
(void)FS_LoadTable(p_table, need_size);
|
||||
}
|
||||
|
||||
#ifdef TWL_CAPTURE_VERSION
|
||||
// memory-launcher経由で立ち上がるTWLCaptureSystemWriterでは
|
||||
// RED_LAUNCHER_VERが0でフォーマットに失敗するので強制的に書き換える
|
||||
MI_StoreLE8((void*)HW_TWL_RED_LAUNCHER_VER, 1);
|
||||
#endif
|
||||
|
||||
#ifdef AUTO_FORMAT_MODE
|
||||
// 検査工程ではNANDが初期化されていないがその状態でFATにアクセスすると
|
||||
// 問題があるため強制的にフォーマットを行う 2008/06/18
|
||||
// ExeFormat(FORMAT_MODE_QUICK);
|
||||
//
|
||||
// Secure情報を読み込む前にフォーマットしてしまうとSecure情報が消えてしまう。
|
||||
// そうするとシリアルNoが書き換わってしまうのでこの処理はなくす。
|
||||
// 検査工程と異なりNandInitializerが実行される段階ではフォーマット済みなはず。
|
||||
// 仮に未フォーマットであったとしてもBadFormat扱いとなる。2009/03/05
|
||||
#endif
|
||||
|
||||
// NAMライブラリ初期化
|
||||
NAM_Init( OS_AllocFromMain, OS_FreeToMain);
|
||||
NAMUT_Init( OS_AllocFromMain, OS_FreeToMain);
|
||||
|
||||
#ifndef TWL_CAPTURE_VERSION
|
||||
// HWInfo関連の前準備
|
||||
switch (HWI_Init( OS_AllocFromMain, OS_FreeToMain ))
|
||||
{
|
||||
case HWI_INIT_FAILURE:
|
||||
OS_PutString("HWI_INIT() Failure!\n");
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_PRO_SIGNATURE_MODE:
|
||||
OS_PutString("[PRO Signature MODE]\n");
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_DEV_SIGNATURE_MODE:
|
||||
OS_PutString("[DEV Signature MODE]\n");
|
||||
break;
|
||||
case HWI_INIT_SUCCESS_NO_SIGNATRUE_MODE:
|
||||
OS_PutString("[No Signature MODE]\n");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
gResult = FALSE;
|
||||
gProc = FALSE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
// キー入力情報取得
|
||||
ReadKey(&gKey);
|
||||
|
||||
if (gKey.trg & PAD_BUTTON_A)
|
||||
{
|
||||
OS_PutString("A\n");
|
||||
|
||||
gResult = FALSE;
|
||||
gProc = FALSE;
|
||||
|
||||
// 書き込み関数
|
||||
gResult = NandfirmProcess();
|
||||
|
||||
gProc = TRUE;
|
||||
}
|
||||
|
||||
DrawScene();
|
||||
|
||||
// コマンドフラッシュ
|
||||
(void)SND_FlushCommand(SND_COMMAND_NOBLOCK);
|
||||
|
||||
// Vブランク待ち
|
||||
OS_WaitVBlankIntr();
|
||||
|
||||
// ARM7コマンド応答受信
|
||||
while (SND_RecvCommandReply(SND_COMMAND_NOBLOCK) != NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// 画面クリア
|
||||
ClearScreen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void DrawScene(void)
|
||||
{
|
||||
PutMainScreen( 5, 2, 0xf8, " ------------------- ");
|
||||
PutMainScreen( 5, 3, 0xf8, " - - ");
|
||||
PutMainScreen( 5, 4, 0xf8, " - NandFirm Writer - ");
|
||||
PutMainScreen( 5, 5, 0xf8, " - - ");
|
||||
PutMainScreen( 5, 6, 0xf8, " ------------------- ");
|
||||
|
||||
PutMainScreen( 3, 9, 0xff, "Please Insert SD Card and");
|
||||
PutMainScreen( 3,11, 0xff, "Push A Button.");
|
||||
|
||||
if( gProc )
|
||||
{
|
||||
if( gResult )
|
||||
{
|
||||
PutMainScreen( 4, 15, 0xf2, "NandFirm Write Successed!!");
|
||||
}
|
||||
else
|
||||
{
|
||||
PutMainScreen( 4, 15, 0xf1, "NandFirm Write Failed...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: VBlankIntr
|
||||
|
||||
Description: VBlank割り込み処理
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
VBlankIntr(void)
|
||||
{
|
||||
// テキスト表示を更新
|
||||
UpdateScreen();
|
||||
|
||||
OS_SetIrqCheckFlag(OS_IE_V_BLANK); // checking VBlank interrupt
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitAllocation
|
||||
|
||||
Description: ヒープの初期化.
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitAllocation(void)
|
||||
{
|
||||
void *tmp;
|
||||
OSHeapHandle hh;
|
||||
|
||||
/* アリーナの初期化 */
|
||||
tmp = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1);
|
||||
OS_SetArenaLo(OS_ARENA_MAIN, tmp);
|
||||
hh = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi());
|
||||
if (hh < 0)
|
||||
OS_Panic("ARM9: Fail to create heap...\n");
|
||||
hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh);
|
||||
}
|
||||
|
||||
194
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/screen.c
Normal file
194
build/systemMenu_tools/NandFirmWriter/ARM9.TWL/src/screen.c
Normal file
@ -0,0 +1,194 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - WCM - demos - wcm-list-2
|
||||
File: screen.c
|
||||
|
||||
Copyright 2007-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-09-17#$
|
||||
$Rev: 8556 $
|
||||
$Author: okubata_ryoma $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#include <nitro.h>
|
||||
#include "screen.h"
|
||||
#include "font.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数 定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define TEXT_SCREEN_SIZE 2048
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
内部変数 定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// 仮想スクリーン[ 上下画面 ][ BG 枚数 ][ キャラクタ数 ]
|
||||
static u16 gScreen[2 ][ 1 ][ TEXT_SCREEN_SIZE / sizeof(u16) ] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: 文字表示システムのために、表示設定を初期化する。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void InitScreen(void)
|
||||
{
|
||||
// 各 V-RAM 初期化
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
// OAM 初期化
|
||||
MI_CpuFillFast((void*)HW_OAM, 0xc0, HW_OAM_SIZE);
|
||||
MI_CpuFillFast((void*)HW_DB_OAM, 0xc0, HW_DB_OAM_SIZE);
|
||||
|
||||
// パレット初期化
|
||||
MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE);
|
||||
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE);
|
||||
|
||||
// 上画面設定
|
||||
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D);
|
||||
|
||||
GX_SetBankForBG(GX_VRAM_BG_128_A);
|
||||
G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000,
|
||||
GX_BG_EXTPLTT_01);
|
||||
G2_SetBG0Priority(0);
|
||||
|
||||
GX_SetVisiblePlane(GX_PLANEMASK_BG0);
|
||||
GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData));
|
||||
GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData));
|
||||
((u16*)HW_PLTT)[0] = 0x0000; // black
|
||||
MI_CpuFillFast(gScreen[0][0], 0, TEXT_SCREEN_SIZE);
|
||||
DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE);
|
||||
GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE);
|
||||
|
||||
// 下画面設定
|
||||
GX_SetBankForSubBG(GX_VRAM_SUB_BG_32_H);
|
||||
G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0x0000, GX_BG_CHARBASE_0x04000,
|
||||
GX_BG_EXTPLTT_01);
|
||||
G2S_SetBG0Priority(0);
|
||||
GXS_SetGraphicsMode(GX_BGMODE_0);
|
||||
GXS_SetVisiblePlane(GX_PLANEMASK_BG0);
|
||||
GXS_LoadBG0Char(d_CharData, 0, sizeof(d_CharData));
|
||||
GXS_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData));
|
||||
((u16*)HW_DB_PLTT)[0] = 0x0000; // black
|
||||
MI_CpuFillFast(gScreen[1][0], 0, TEXT_SCREEN_SIZE);
|
||||
DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE);
|
||||
GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ClearScreen
|
||||
|
||||
Description: 画面のテキスト表示をクリアする。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void ClearScreen(void)
|
||||
{
|
||||
MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE);
|
||||
MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE);
|
||||
}
|
||||
void ClearMainScreen(void)
|
||||
{
|
||||
MI_CpuClearFast(gScreen[0][0], TEXT_SCREEN_SIZE);
|
||||
|
||||
}
|
||||
void ClearSubScreen(void)
|
||||
{
|
||||
MI_CpuClearFast(gScreen[1][0], TEXT_SCREEN_SIZE);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PutMainScreen
|
||||
|
||||
Description: メイン画面にテキスト出力する。
|
||||
|
||||
Arguments: text - 出力する文字列。
|
||||
... - 仮想引数。
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void PutMainScreen(s32 x, s32 y, u8 palette, char* text, ...)
|
||||
{
|
||||
va_list vlist;
|
||||
char temp[33];
|
||||
s32 i;
|
||||
|
||||
va_start(vlist, text);
|
||||
(void)vsnprintf(temp, 33, text, vlist);
|
||||
va_end(vlist);
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
if (temp[i] == 0x00)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
gScreen[0][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PrintSubScreen
|
||||
|
||||
Description: サブ画面にテキスト出力する。
|
||||
|
||||
Arguments: text - 出力する文字列。
|
||||
... - 仮想引数。
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void PutSubScreen(s32 x, s32 y, u8 palette, char* text, ...)
|
||||
{
|
||||
va_list vlist;
|
||||
char temp[33];
|
||||
s32 i;
|
||||
|
||||
va_start(vlist, text);
|
||||
(void)vsnprintf(temp, 33, text, vlist);
|
||||
va_end(vlist);
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
if (temp[i] == 0x00)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
gScreen[1][0][((y * 32) + x + i) % (32 * 32)] = (u16) (palette << 12 | temp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: UpdateScreen
|
||||
|
||||
Description: 仮想スクリーンを V-RAM に反映する。
|
||||
V ブランク期間中での呼び出しを想定。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
void UpdateScreen(void)
|
||||
{
|
||||
// 仮想スクリーンを V-RAM に反映
|
||||
DC_StoreRange(gScreen[0][0], TEXT_SCREEN_SIZE);
|
||||
GX_LoadBG0Scr(gScreen[0][0], 0, TEXT_SCREEN_SIZE);
|
||||
DC_StoreRange(gScreen[1][0], TEXT_SCREEN_SIZE);
|
||||
GXS_LoadBG0Scr(gScreen[1][0], 0, TEXT_SCREEN_SIZE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
34
build/systemMenu_tools/NandFirmWriter/Makefile
Normal file
34
build/systemMenu_tools/NandFirmWriter/Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - tests - camera
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2008-08-05#$
|
||||
# $Rev: 2098 $
|
||||
# $Author: kamikawa $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = \
|
||||
banner \
|
||||
ARM7.TWL \
|
||||
ARM9.TWL \
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
47
build/systemMenu_tools/NandFirmWriter/banner/Makefile
Normal file
47
build/systemMenu_tools/NandFirmWriter/banner/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlIPL
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: 2008-07-01#$
|
||||
# $Rev: 1750 $
|
||||
# $Author: nakasima $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||
|
||||
ICON_DIR = ./icon
|
||||
|
||||
BANNER_ICON = $(ICON_DIR)/gameIcon.bmp
|
||||
BANNER_SPEC = banner_v3.bsf
|
||||
|
||||
TARGETS = banner.bnr
|
||||
INSTALL_DIR = ./
|
||||
INSTALL_TARGETS = $(TARGETS)
|
||||
|
||||
BANNER_ICON_NAME = $(basename $(BANNER_ICON))
|
||||
BANNER_ICON_MIDDLE = $(addprefix $(BANNER_ICON_NAME), .nbfs .nbfc .nbfp)
|
||||
|
||||
LDIRT_CLEAN = $(TARGETS) \
|
||||
$(BANNER_ICON_MIDDLE) \
|
||||
$(TARGETS:.bnr=.srl)
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# build
|
||||
#----------------------------------------------------------------------------
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE)
|
||||
$(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
|
||||
|
||||
#
|
||||
BIN
build/systemMenu_tools/NandFirmWriter/banner/banner_v3.bsf
Normal file
BIN
build/systemMenu_tools/NandFirmWriter/banner/banner_v3.bsf
Normal file
Binary file not shown.
BIN
build/systemMenu_tools/NandFirmWriter/banner/icon/gameIcon.bmp
Normal file
BIN
build/systemMenu_tools/NandFirmWriter/banner/icon/gameIcon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
104
build/systemMenu_tools/NandFirmWriter/common/include/fifo.h
Normal file
104
build/systemMenu_tools/NandFirmWriter/common/include/fifo.h
Normal file
@ -0,0 +1,104 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - camera-test - include
|
||||
File: fifo.h
|
||||
|
||||
Copyright 2007 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: 2008-07-25#$
|
||||
$Rev: 2003 $
|
||||
$Author: kamikawa $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef TWL_KAMI_TEST_FIFO_H_
|
||||
#define TWL_KAMI_TEST_FIFO_H_
|
||||
|
||||
#include <twl/types.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
定数定義
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define PXI_FIFO_TAG_KAMITEST PXI_FIFO_TAG_USER_1
|
||||
|
||||
#define KAMI_PXI_CONTINUOUS_PACKET_MAX 10
|
||||
#define KAMITEST_PXI_DATA_SIZE_MAX ((KAMI_PXI_CONTINUOUS_PACKET_MAX-1)*3+1) // 最大データ数
|
||||
|
||||
#define KAMITEST_PXI_START_BIT 0x02000000 // 先頭パケットを意味する
|
||||
#define KAMITEST_PXI_RESULT_BIT 0x00008000 // PXIの応答を示す
|
||||
|
||||
#define KAMITEST_PXI_COMMAND_SHIFT 8 // コマンド格納部分の位置
|
||||
#define KAMITEST_PXI_COMMAND_MASK 0x00007f00 // コマンド格納部分のマスク
|
||||
#define KAMITEST_PXI_DATA_NUMS_MASK 0x00ff0000 // データ数領域
|
||||
#define KAMITEST_PXI_DATA_NUMS_SHIFT 16 // データ数位置
|
||||
#define KAMITEST_PXI_1ST_DATA_MASK 0x000000ff // 先頭パケットのデータ領域
|
||||
#define KAMITEST_PXI_1ST_DATA_SHIFT 0 // 先頭パケットのデータ位置
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef enum KAMIPxiResult
|
||||
{
|
||||
KAMI_PXI_RESULT_SUCCESS = 0, // 処理成功 (void/void*型) // 場合により後続パケットあり
|
||||
KAMI_PXI_RESULT_SUCCESS_TRUE = 0, // 処理成功 (BOOL型)
|
||||
KAMI_PXI_RESULT_SUCCESS_FALSE, // 処理成功 (BOOL型)
|
||||
KAMI_PXI_RESULT_INVALID_COMMAND, // 不正なPXIコマンド
|
||||
KAMI_PXI_RESULT_INVALID_PARAMETER, // 不正なパラメータ
|
||||
KAMI_PXI_RESULT_ILLEGAL_STATUS, // KAMIの状態により処理を実行不可
|
||||
KAMI_PXI_RESULT_BUSY, // 他のリクエストを実行中
|
||||
KAMI_PXI_RESULT_FATAL_ERROR, // その他何らかの原因で処理に失敗
|
||||
KAMI_PXI_RESULT_MAX
|
||||
}
|
||||
KAMIPxiResult;
|
||||
|
||||
|
||||
typedef enum KamiCommand
|
||||
{
|
||||
KAMI_TEST_COMMAND,
|
||||
KAMI_EXE_FORMAT,
|
||||
KAMI_NAND_IO,
|
||||
KAMI_MCU_IO,
|
||||
KAMI_MCU_WRITE_FIRM,
|
||||
KAMI_ARM7_IO,
|
||||
KAMI_CDC_GO_DSMODE,
|
||||
KAMI_CLEAR_NAND_ERRORLOG,
|
||||
KAMI_GET_CAMERA_MODULE_TYPE,
|
||||
KAMI_GET_NAND_CID
|
||||
}
|
||||
KamiCommand;
|
||||
|
||||
|
||||
typedef enum CameraModuleType
|
||||
{
|
||||
CAMERA_MODULE_TYPE_UNKNOWN,
|
||||
CAMERA_MODULE_TYPE_SHARP,
|
||||
CAMERA_MODULE_TYPE_MICRON
|
||||
}
|
||||
CameraModuleType;
|
||||
|
||||
|
||||
typedef struct CameraModuleTypes
|
||||
{
|
||||
CameraModuleType in;
|
||||
CameraModuleType out;
|
||||
}
|
||||
CameraModuleTypes;
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* TWL_KAMI_TEST_FIFO_H_ */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
BIN
build/systemMenu_tools/NandFirmWriter/data/cert.sys
Normal file
BIN
build/systemMenu_tools/NandFirmWriter/data/cert.sys
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user