mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
自己ハッシュチェックプログラム
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1970 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
0a09bbe682
commit
594541beb1
79
build/tests/HashCheckTemplate/ARM7/Makefile
Normal file
79
build/tests/HashCheckTemplate/ARM7/Makefile
Normal file
@ -0,0 +1,79 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - components - racoon.TWL
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
override TARGET_PLATFORM = TWL
|
||||
override TWL_PROC = ARM7
|
||||
override TWL_ARCHGEN = LIMITED
|
||||
TWL_NO_STD_PCHDR = True
|
||||
TWL_CODEGEN ?= ALL
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCDIR += $(ROOT)/build/components/mongoose.TWL/src
|
||||
|
||||
SRCS = main.c initScfg.c
|
||||
|
||||
TARGET_NAME = racoon_hct
|
||||
|
||||
TARGET_NEF = $(TARGET_NAME).tef
|
||||
LCFILE_SPEC = racoon_hct.lsf
|
||||
LCFILE_TEMPLATE = $(ROOT)/build/components/racoon.TWL/racoon.lcf.template
|
||||
LDRES_TEMPLATE = $(ROOT)/build/components/racoon.TWL/racoon.response.template
|
||||
|
||||
LLIBRARY_DIRS += ../crt/ARM7/obj/ARM7-TS.LTD/$(TWL_BUILD_DIR)
|
||||
CRT0_O = crt0_hct.LTD.TWL.o
|
||||
|
||||
# スタック不足防止の為、インライン展開せずにコンパイルする
|
||||
CCFLAGS_OPT = -O4 -inline off
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#MACRO_FLAGS += -DSDK_ARM7COMP_LTD
|
||||
|
||||
ifeq ($(TWL_PLATFORM),BB)
|
||||
MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037e0000'
|
||||
else
|
||||
MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037c0000'
|
||||
endif
|
||||
|
||||
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
|
||||
#LLIBRARIES += libwl_sp.TWL.LTD.a libsdio_hcd_twl$(TWL_LIBSUFFIX).a libsdio_busdriver$(TWL_LIBSUFFIX).a libsdio_lib$(TWL_LIBSUFFIX).a libARM7athdrv$(TWL_LIBSUFFIX).a
|
||||
LLIBRARIES += libwl_sp.TWL.LTD.a
|
||||
#LLIBRARIES += libwl_sp$(TWL_LIBSUFFIX).a \
|
||||
# libcdc_sp$(TWL_LIBSUFFIX).a \
|
||||
# libtpex_sp$(TWL_LIBSUFFIX).a \
|
||||
# libmicex_sp$(TWL_LIBSUFFIX).a \
|
||||
# libsdio_hcd_twl$(TWL_LIBSUFFIX).a \
|
||||
# libsdio_busdriver$(TWL_LIBSUFFIX).a \
|
||||
# libsdio_lib$(TWL_LIBSUFFIX).a \
|
||||
# librompatch_sp$(TWL_LIBSUFFIX).a \
|
||||
# libARM7athdrv$(TWL_LIBSUFFIX).a
|
||||
|
||||
LDEPENDS_NEF = $(TWL_LIBS) $(LLIBRARIES)
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#===== End of Makefile =====
|
||||
231
build/tests/HashCheckTemplate/ARM7/racoon_hct.lsf
Normal file
231
build/tests/HashCheckTemplate/ARM7/racoon_hct.lsf
Normal file
@ -0,0 +1,231 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - components - racoon.TWL
|
||||
# File: racoon.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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Nitro LCF SPEC FILE
|
||||
#
|
||||
#--------
|
||||
Static $(TARGET_NAME)
|
||||
{
|
||||
Address 0x02380000
|
||||
Library $(CRT0_O) \
|
||||
libos_sp$(LIBSUFFIX).a \
|
||||
libsyscall_sp.twl.a \
|
||||
libmi_sp$(LIBSUFFIX).a
|
||||
Object $(OBJDIR)/initScfg.o
|
||||
StackSize 1024 1024
|
||||
}
|
||||
|
||||
#--------
|
||||
Autoload WRAM
|
||||
{
|
||||
Address $(ADDRESS_LTDWRAM)
|
||||
|
||||
Library libsubpsyscall.a \
|
||||
$(CW_LIBS) \
|
||||
libpad_sp$(LIBSUFFIX).a \
|
||||
libpxi_sp$(LIBSUFFIX).a \
|
||||
libstd_sp$(LIBSUFFIX).a \
|
||||
libexi_sp$(LIBSUFFIX).a \
|
||||
libsnd_sp$(LIBSUFFIX).a \
|
||||
libspi_sp$(LIBSUFFIX).a \
|
||||
libpm_sp$(LIBSUFFIX).a \
|
||||
libmath_sp$(LIBSUFFIX).a \
|
||||
libscfg_sp$(LIBSUFFIX).a \
|
||||
libtp_sp$(LIBSUFFIX).a \
|
||||
libmic_sp$(LIBSUFFIX).a \
|
||||
libfs_sp$(LIBSUFFIX).a \
|
||||
libcard_sp$(LIBSUFFIX).a \
|
||||
libi2c_sp$(LIBSUFFIX).a \
|
||||
libcamera_sp$(LIBSUFFIX).a \
|
||||
libcdc_sp$(LIBSUFFIX).a \
|
||||
libsndex_sp$(LIBSUFFIX).a \
|
||||
libtpex_sp$(LIBSUFFIX).a \
|
||||
libmicex_sp$(LIBSUFFIX).a \
|
||||
libmcu_sp$(LIBSUFFIX).a \
|
||||
|
||||
Library libsdio_sp$(LIBSUFFIX).a
|
||||
|
||||
Library libnvram_sp$(LIBSUFFIX).a
|
||||
Library librtc_sp$(LIBSUFFIX).a
|
||||
|
||||
|
||||
Object * (.etable)
|
||||
Object * (.wram)
|
||||
Object * (.ltdwram)
|
||||
Object $(OBJDIR)/main.o
|
||||
|
||||
# caches in fatfs library, that should be on WRAM.
|
||||
# 2007/12/11 OBJECT() による .bss シンボルのリンクがうまくいかないので、
|
||||
# 変数定義箇所に pragma で .ltdwram セクションに含まれるように暫定対策しました。
|
||||
# Object OBJECT( FATFSi___mem_drives_structures , libfatfs_sp$(LIBSUFFIX).a) (.bss)
|
||||
|
||||
#####
|
||||
# Sub-routines in WL library , that should be on WRAM.
|
||||
# in TaskMan.o
|
||||
Object OBJECT( MainTaskRoutine , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AddTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DeleteTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( LowestIdleTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ExecuteMessage , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in BufMan.o
|
||||
Object OBJECT( NewHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DeleteHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AllocateHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ReleaseHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( MoveHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AddHeapBuf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( GetHeapBufNextAdrs , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in WlCmdIf.o
|
||||
Object OBJECT( RequestCmdTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( SendMessageToWmDirect , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in WlNic.o
|
||||
Object OBJECT( WStart , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WStop , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WSetStaState , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in WlIntr.o
|
||||
Object OBJECT( WlIntr , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrPreTbtt , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrTbtt , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrActEnd , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# Object OBJECT( WlIntrAckCntOvf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrCntOvf , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrTxErr , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrRxCntup , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrTxEnd , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrRxEnd , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrMpEnd , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrStartTx , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrStartRx , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( SetParentTbttTxq , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( MacBugTxMp , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AdjustRingPointer , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( CheckKeyTxEnd , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in WlIntrTask.o
|
||||
Object OBJECT( WlIntrTxBeaconTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrTxEndTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrRxEndTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WlIntrMpEndTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( SetParentTbttTxqTask , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( TakeoutRxFrame , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in TxCtrl.o
|
||||
Object OBJECT( InitTxCtrl , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in RxCtrl.o
|
||||
Object OBJECT( InitRxCtrl , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
# in WaitLoop.o
|
||||
Object OBJECT( WaitLoop_Rxpe , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WaitLoop_Waitus , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WaitLoop_ClrAid , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WaitLoop_BbpAccess , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( WaitLoop_RfAccess , libwl_sp$(LIBSUFFIX).a ) (.text)
|
||||
|
||||
|
||||
}
|
||||
|
||||
#--------
|
||||
Ltdautoload RSVWRAM
|
||||
{
|
||||
Address 0x03040000
|
||||
Object * (.rsvwram)
|
||||
Library libathdrv_sp$(LIBSUFFIX).a (.bss)
|
||||
Library libathdrv_sp$(LIBSUFFIX).a (.data)
|
||||
|
||||
#####
|
||||
# Sub-routines in TWL WIRELESS Driver , that should be on WRAM.
|
||||
Object OBJECT( HTCSendPktCompletionHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCIssueSend, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCTrySend, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCSendPkt, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCProcessCreditRpt, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DevRecvPacket, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCProcessRecvHeader, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCRecvCompleteHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCRecvMessagePendingHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCAddReceivePkt, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AR6KFreeIOPacket, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( AR6KAllocIOPacket, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DevRWCompletionHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DevGetEventAsyncHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DevCheckPendingRecvMsgsAsync, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DevDsrHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HIFReadWrite, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( hifRWCompletionHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( hifIRQHandler, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HIFAckInterrupt, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ar6000_credit_distribute, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_alloc, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_alloc_rx, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_put, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_push, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_pull, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_free, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_to_data, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_to_len, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( a_netbuf_headroom, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( nin_drv_return_netbuf, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ath_queue_remove_from_head, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ath_queue_insert_tail, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ar6000_alloc_cookie, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( nin_driver_tx, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( nin_tx_complete, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_dix_2_dot3, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_data_hdr_add, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_data_hdr_remove, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( nin_rx, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ar6000_ibss_map_epid, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DL_ListInsertTail, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( DL_ListRemove, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_control_rx, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_cmd_send, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( ar6000_control_tx, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( wmi_implicit_create_pstream, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCAllocControlBuffer, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( HTCFreeControlBuffer, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( BMILZData, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( bmiBufferSend, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
Object OBJECT( BMIWriteMemory, libathdrv_sp$(LIBSUFFIX).a ) (.text)
|
||||
|
||||
|
||||
# FATFS core symbols
|
||||
Object OBJECT(FATFSi_lfi2text, libfatfs_sp$(LIBSUFFIX).a) (.text) # 360 BYTEs
|
||||
Object OBJECT(FATFSi_pc_findin, libfatfs_sp$(LIBSUFFIX).a) (.text) # 904 BYTEs
|
||||
Object OBJECT(FATFSi_pc_patcmp_vfat, libfatfs_sp$(LIBSUFFIX).a) (.text) # 436 BYTEs
|
||||
Object OBJECT(FATFSi_pc_ascii_mfile, libfatfs_sp$(LIBSUFFIX).a) (.text) # 160 BYTEs
|
||||
Object OBJECT(FATFSi_map_ascii_to_unicode, libfatfs_sp$(LIBSUFFIX).a) (.text) # 48 BYTEs
|
||||
Object OBJECT(SDCARD_Intr_Thread, libfatfs_sp$(LIBSUFFIX).a) (.text) # 520 BYTEs
|
||||
Object OBJECT(FATFSi_unicode_cmp_to_ascii_char, libfatfs_sp$(LIBSUFFIX).a) (.text) # 40 BYTEs
|
||||
Object OBJECT(FATFSi_pc_read_blk, libfatfs_sp$(LIBSUFFIX).a) (.text) # 352 BYTEs
|
||||
}
|
||||
|
||||
#--------
|
||||
Ltdautoload LTDMAIN
|
||||
{
|
||||
Address 0x02f88000
|
||||
|
||||
Object * (.ltdmain)
|
||||
Library libwm_sp$(LIBSUFFIX).a \
|
||||
libnwm_sp$(LIBSUFFIX).a \
|
||||
libwvr_sp$(LIBSUFFIX).a \
|
||||
libwl_sp$(LIBSUFFIX).a
|
||||
|
||||
Library libwpa_sp$(LIBSUFFIX).a
|
||||
Library libathdrv_sp$(LIBSUFFIX).a
|
||||
|
||||
Library libfatfs_sp$(LIBSUFFIX).a \
|
||||
libaes_sp$(LIBSUFFIX).a
|
||||
Library $(ISDBG_LIBS_TWL)
|
||||
Library $(ISDBG_LIBS_NITRO)
|
||||
}
|
||||
67
build/tests/HashCheckTemplate/ARM9/Makefile
Normal file
67
build/tests/HashCheckTemplate/ARM9/Makefile
Normal file
@ -0,0 +1,67 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - demos - simpleShoot-1
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
TWL_NANDAPP = TRUE
|
||||
|
||||
TARGET_FIRM = SYSTEMMENU
|
||||
TARGET_PLATFORM = TWL
|
||||
TWL_ARCHGEN = LIMITED
|
||||
|
||||
TARGET_NAME = HashCheckTemplate
|
||||
TARGET_BIN = $(TARGET_NAME).tad
|
||||
|
||||
TITLEID_LO = CTMP
|
||||
|
||||
ROM_SPEC = main.rsf
|
||||
LCFILE_TEMPLATE = hct.lcf.template
|
||||
|
||||
MISC_DIR = $(SYSMENU_ROOT)/build/systemMenu_RED/misc
|
||||
|
||||
SRCS = main.c HashCheckTemplate.c \
|
||||
$(MISC_DIR)/src/misc.c $(MISC_DIR)/src/cmn.c
|
||||
|
||||
LINCLUDES = $(MISC_DIR)/include
|
||||
LLIBRARY_DIRS += ../crt/ARM9/obj/ARM9-TS.HYB/$(TWL_BUILD_DIR)
|
||||
|
||||
CRT0_O = crt0_hct.FLX.TWL.o
|
||||
|
||||
MAKEROM_FLAGS += -F -DTITLEID_LO='$(TITLEID_LO)'
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||
|
||||
DEFAULT_COMP_ARM7 = racoon_hct
|
||||
DEFAULT_MAKEROM_ARM7_BASE = ../ARM7/bin/$(TWL_BUILDTYPE_ARM7)/$(DEFAULT_COMP_ARM7)
|
||||
DEFAULT_MAKEROM_ARM7 = $(DEFAULT_MAKEROM_ARM7_BASE).$(TWL_ELF_EXT)
|
||||
|
||||
|
||||
LDIRT_CLEAN = $(TARGET_TAD)
|
||||
INSTALL_TARGETS = $(TARGET_TAD)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build : $(TARGETS)
|
||||
|
||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#===== End of Makefile =====
|
||||
1048
build/tests/HashCheckTemplate/ARM9/hct.lcf.template
Normal file
1048
build/tests/HashCheckTemplate/ARM9/hct.lcf.template
Normal file
File diff suppressed because it is too large
Load Diff
185
build/tests/HashCheckTemplate/ARM9/main.rsf
Normal file
185
build/tests/HashCheckTemplate/ARM9/main.rsf
Normal file
@ -0,0 +1,185 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# 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 0
|
||||
|
||||
#
|
||||
# ROM SPEED TYPE: [MROM/1TROM/UNDEFINED]
|
||||
#
|
||||
RomSpeedType $(MAKEROM_ROMSPEED)
|
||||
|
||||
#
|
||||
# ROM SIZE: in bit [64M/128M/256M/512M/1G/2G]
|
||||
#
|
||||
#RomSize 128M
|
||||
#RomSize 256M
|
||||
|
||||
#
|
||||
# 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 $(MAKEROM_WRAM_MAPPING)
|
||||
|
||||
#
|
||||
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
|
||||
#
|
||||
CardRegion Japan
|
||||
|
||||
#
|
||||
# Codec mode:
|
||||
# don't have to edit
|
||||
#
|
||||
CodecMode $(MAKEROM_CODEC_MODE)
|
||||
|
||||
###
|
||||
#### END
|
||||
}
|
||||
|
||||
|
||||
AppendProperty
|
||||
{
|
||||
#
|
||||
# Publisher : "Nintendo"
|
||||
# don't have to edit
|
||||
Publisher Nintendo
|
||||
|
||||
#
|
||||
# Application type : [USER/SYSTEM]
|
||||
# don't have to edit
|
||||
AppType User
|
||||
|
||||
#
|
||||
# launch title on the launcher : [TRUE/FALSE]
|
||||
# don't have to edit
|
||||
Launch TRUE
|
||||
|
||||
#
|
||||
# Boot allowed Media: [GameCard/NAND]
|
||||
#
|
||||
Media NAND
|
||||
|
||||
#
|
||||
# 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_RED/data
|
||||
Root /data
|
||||
File NTR_IPL_font_m.NFTR
|
||||
}
|
||||
150
build/tests/HashCheckTemplate/ARM9/src/HashCheckTemplate.c
Normal file
150
build/tests/HashCheckTemplate/ARM9/src/HashCheckTemplate.c
Normal file
@ -0,0 +1,150 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlIPL
|
||||
File: HashCheckTemplate.c
|
||||
|
||||
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:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include <sysmenu.h>
|
||||
#include "misc.h"
|
||||
#include "HashCheckTemplate.h"
|
||||
|
||||
// define data------------------------------------------
|
||||
#define RETURN_BUTTON_TOP_X 2
|
||||
#define RETURN_BUTTON_TOP_Y 21
|
||||
#define RETURN_BUTTON_BOTTOM_X ( RETURN_BUTTON_TOP_X + 8 )
|
||||
#define RETURN_BUTTON_BOTTOM_Y ( RETURN_BUTTON_TOP_Y + 2 )
|
||||
|
||||
#define UNDEF_CODE 0xe7ffdeff
|
||||
|
||||
// extern data------------------------------------------
|
||||
|
||||
// function's prototype declaration---------------------
|
||||
|
||||
// global variable -------------------------------------
|
||||
RTCDrawProperty g_rtcDraw = {
|
||||
TRUE, RTC_DATE_TOP_X, RTC_DATE_TOP_Y, RTC_TIME_TOP_X, RTC_TIME_TOP_Y
|
||||
};
|
||||
|
||||
// static variable -------------------------------------
|
||||
static BOOL s_switch = FALSE;
|
||||
|
||||
//static u32 dummy[1024*1024/2]={1,2,3,};//2MB
|
||||
|
||||
// const data -----------------------------------------
|
||||
|
||||
//======================================================
|
||||
// 再配置チェッカー(多分ここからやる事は表示のみ)
|
||||
//======================================================
|
||||
|
||||
static void draw_sub1(u8 *ram_addr, u8 *header_addr, int y)
|
||||
{
|
||||
int l;
|
||||
PrintfSJIS(8,y,TXT_UCOLOR_DARKGREEN, "ARM9FLX ( VERIFY %s ) :",( (*(u32 *)0x02000180 == UNDEF_CODE) ? "OK" : "NG" ));
|
||||
|
||||
for (l=0; l<20; l++)
|
||||
{
|
||||
PrintfSJIS(24+(l%10)*19, y+12+12*(l/10), TXT_COLOR_BLACK, "%.2x", *(ram_addr+l));
|
||||
if(s_switch)
|
||||
{
|
||||
PrintfSJIS(24+(l%10)*19, y+12+12*(l/10), (*(ram_addr+l) != *(header_addr+l)) ? TXT_COLOR_RED : TXT_COLOR_BLUE, "%.2x", *(header_addr+l));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_sub2(u8 *ram_addr, u8 *header_addr, int y, const u16 *str)
|
||||
{
|
||||
int l;
|
||||
PutStringUTF16(8,y,TXT_UCOLOR_DARKGREEN, str);
|
||||
for (l=0; l<20; l++)
|
||||
{
|
||||
PrintfSJIS(24+(l%10)*19, y+12+12*(l/10), TXT_COLOR_BLACK, "%.2x", *(ram_addr+l));
|
||||
if(s_switch )
|
||||
{
|
||||
PrintfSJIS(24+(l%10)*19, y+12+12*(l/10), (*(ram_addr+l) != *(header_addr+l)) ? TXT_COLOR_RED : TXT_COLOR_BLUE, "%.2x", *(header_addr+l));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void encryObjdraw(void)
|
||||
{
|
||||
int l;
|
||||
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
|
||||
PutStringUTF16( 1 * 8, 0 * 8, TXT_COLOR_BLUE, (const u16 *)L"decrypted encryObj (first 200 bytes)");
|
||||
for (l=0; l<50; l++)
|
||||
{
|
||||
PrintfSJIS(4+(l%4)*64, 24+12*(l/4), TXT_COLOR_BLACK, "%.8x", *(((u32 *)0x02000180)+l) );
|
||||
}
|
||||
}
|
||||
|
||||
static void draw()
|
||||
{
|
||||
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
|
||||
|
||||
PutStringUTF16( 1 * 8, 0 * 8, TXT_COLOR_BLUE, (const u16 *)L"HashCheckTemplate");
|
||||
PutStringUTF16( 3 * 8, 1 * 12, TXT_COLOR_BLACK, (const u16 *)L"Press A to Check Digest....");
|
||||
|
||||
draw_sub1((u8 *)0x02000100, (u8 *)(HW_TWL_ROM_HEADER_BUF + 0x300), 12*2+4 );
|
||||
|
||||
draw_sub2((u8 *)0x02000120, (u8 *)(HW_TWL_ROM_HEADER_BUF + 0x314), 12*5+8, (const u16 *)L"ARM7FLX :" );
|
||||
draw_sub2((u8 *)0x02000140, (u8 *)(HW_TWL_ROM_HEADER_BUF + 0x350), 12*8+12, (const u16 *)L"ARM9LTD :" );
|
||||
draw_sub2((u8 *)0x02000160, (u8 *)(HW_TWL_ROM_HEADER_BUF + 0x364), 12*11+16, (const u16 *)L"ARM7LTD :" );
|
||||
}
|
||||
|
||||
// 初期化
|
||||
void HashCheckTemplateInit( void )
|
||||
{
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
draw();
|
||||
|
||||
GetAndDrawRTCData( &g_rtcDraw, TRUE );
|
||||
|
||||
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
static u32 c;
|
||||
// メインループ
|
||||
void HashCheckTemplateMain(void)
|
||||
{
|
||||
BOOL tp_cancel = FALSE;
|
||||
|
||||
ReadTP(); // タッチパネル入力の取得
|
||||
|
||||
// [RETURN]ボタン押下チェック
|
||||
if(tpd.disp.touch) {
|
||||
tp_cancel = WithinRangeTP( RETURN_BUTTON_TOP_X * 8, RETURN_BUTTON_TOP_Y * 8 - 4,
|
||||
RETURN_BUTTON_BOTTOM_X * 8, RETURN_BUTTON_BOTTOM_Y * 8 - 4, &tpd.disp );
|
||||
}
|
||||
|
||||
if( ( pad.trg & PAD_BUTTON_A )) {
|
||||
s_switch = !s_switch;
|
||||
draw();
|
||||
}
|
||||
|
||||
if( ( pad.trg & PAD_BUTTON_X )) {
|
||||
encryObjdraw();
|
||||
}
|
||||
|
||||
if( ( pad.trg & PAD_BUTTON_B ) || tp_cancel ) {
|
||||
// SYSM_RebootLauncher();
|
||||
}
|
||||
|
||||
GetAndDrawRTCData( &g_rtcDraw, FALSE );
|
||||
}
|
||||
|
||||
|
||||
37
build/tests/HashCheckTemplate/ARM9/src/HashCheckTemplate.h
Normal file
37
build/tests/HashCheckTemplate/ARM9/src/HashCheckTemplate.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlIPL
|
||||
File: HashCheckTemplate.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:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __HASH_CHECK_TEMPLATE_H__
|
||||
#define __HASH_CHECK_TEMPLATE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <twl.h>
|
||||
|
||||
// define data----------------------------------------------------------
|
||||
|
||||
void HashCheckTemplateInit( void );
|
||||
void HashCheckTemplateMain( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __HASH_CHECK_TEMPLATE_H__
|
||||
87
build/tests/HashCheckTemplate/ARM9/src/main.c
Normal file
87
build/tests/HashCheckTemplate/ARM9/src/main.c
Normal file
@ -0,0 +1,87 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlIPL
|
||||
File: main.c
|
||||
|
||||
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:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include "misc.h"
|
||||
#include "HashCheckTemplate.h"
|
||||
|
||||
// extern data-----------------------------------------------------------------
|
||||
|
||||
// define data-----------------------------------------------------------------
|
||||
|
||||
// function's prototype-------------------------------------------------------
|
||||
static void INTR_VBlank( void );
|
||||
|
||||
// global variable-------------------------------------------------------------
|
||||
|
||||
// static variable-------------------------------------------------------------
|
||||
|
||||
// const data------------------------------------------------------------------
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// function's description
|
||||
// ============================================================================
|
||||
void TwlMain(void)
|
||||
{
|
||||
|
||||
// 初期化----------------------------------
|
||||
OS_Init();
|
||||
|
||||
(void)OS_EnableIrq();
|
||||
(void)OS_EnableInterrupts();
|
||||
|
||||
GX_Init();
|
||||
GX_SetPower(GX_POWER_ALL); // 各ロジック パワーON
|
||||
|
||||
// 割り込み許可----------------------------
|
||||
(void)OS_SetIrqFunction(OS_IE_V_BLANK, INTR_VBlank);
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
|
||||
// デバイス初期化-------------------------------
|
||||
TP_Init();
|
||||
(void)RTC_Init();
|
||||
|
||||
// システムの初期化------------------
|
||||
OS_SetArenaHi(OS_ARENA_MAIN, (void *)0x02d00000);// arm9MMEMheap
|
||||
InitAllocator();
|
||||
|
||||
InitBG();
|
||||
HashCheckTemplateInit();
|
||||
// メインループ----------------------------
|
||||
while(1){
|
||||
OS_WaitIrq(1, OS_IE_V_BLANK); // Vブランク割り込み待ち
|
||||
|
||||
ReadKeyPad(); // キー入力の取得
|
||||
ReadTP(); // TP入力の取得
|
||||
|
||||
HashCheckTemplateMain();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// 割り込み処理
|
||||
// ============================================================================
|
||||
|
||||
// Vブランク割り込み
|
||||
static void INTR_VBlank(void)
|
||||
{
|
||||
OS_SetIrqCheckFlag(OS_IE_V_BLANK); // Vブランク割込チェックのセット
|
||||
}
|
||||
|
||||
30
build/tests/HashCheckTemplate/Makefile
Normal file
30
build/tests/HashCheckTemplate/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
#! 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = banner crt ARM7 ARM9
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
47
build/tests/HashCheckTemplate/banner/Makefile
Normal file
47
build/tests/HashCheckTemplate/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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
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) -d -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
|
||||
|
||||
#
|
||||
BIN
build/tests/HashCheckTemplate/banner/banner_v3.bsf
Normal file
BIN
build/tests/HashCheckTemplate/banner/banner_v3.bsf
Normal file
Binary file not shown.
BIN
build/tests/HashCheckTemplate/banner/icon/gameIcon.bmp
Normal file
BIN
build/tests/HashCheckTemplate/banner/icon/gameIcon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
52
build/tests/HashCheckTemplate/crt/ARM7/Makefile
Normal file
52
build/tests/HashCheckTemplate/crt/ARM7/Makefile
Normal file
@ -0,0 +1,52 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - init - ARM7.TWL
|
||||
# File: Makefile.LTD
|
||||
#
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
override TARGET_PLATFORM = TWL
|
||||
|
||||
# Codegen for sub processer
|
||||
override TWL_PROC = ARM7
|
||||
|
||||
# Avoid to use pre-compile-header of "nitro.h"
|
||||
TWL_NO_STD_PCHDR = True
|
||||
|
||||
# Avoid to build THUMB version object
|
||||
override TWL_CODEGEN = ARM
|
||||
|
||||
# Avoid to build HYBRID version object
|
||||
override TWL_ARCHGEN = LIMITED
|
||||
|
||||
SRCDIR = src
|
||||
INCDIR = ../common/include
|
||||
|
||||
SRCS = crt0_hct.LTD.c
|
||||
TARGET_OBJ = crt0_hct.LTD.TWL.o
|
||||
|
||||
MACRO_FLAGS += -DSDK_NOINIT
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(OBJDIR)/$(TARGET_OBJ): $(OBJDIR)/$(SRCS:.c=.o)
|
||||
$(CP) $< $@
|
||||
|
||||
#===== End of Makefile =====
|
||||
866
build/tests/HashCheckTemplate/crt/ARM7/src/crt0_hct.LTD.c
Normal file
866
build/tests/HashCheckTemplate/crt/ARM7/src/crt0_hct.LTD.c
Normal file
@ -0,0 +1,866 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - libraries - init - ARM7.TWL
|
||||
File: crt0.LTD.c
|
||||
|
||||
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:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nitro/types.h>
|
||||
#include <nitro/hw/common/armArch.h>
|
||||
#include <nitro/os/common/emulator.h>
|
||||
#include <nitro/os/common/printf.h>
|
||||
#include <twl/init/crt0.h>
|
||||
#include <twl/memorymap_sp.h>
|
||||
#include <twl/hw/common/mmap_wramEnv.h>
|
||||
#include <twl/os/common/format_rom.h>
|
||||
#include <twl/version.h>
|
||||
#include "boot_sync.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void _start(void);
|
||||
void _start_AutoloadDoneCallback(void* argv[]);
|
||||
void INIT_InitializeScfg(void);
|
||||
|
||||
#define SDK_NITROCODE_LE 0x2106c0de
|
||||
#define SDK_NITROCODE_BE 0xdec00621
|
||||
|
||||
#define SDK_TWLCODE_LE 0x6314c0de
|
||||
#define SDK_TWLCODE_BE 0xdec01463
|
||||
|
||||
/* 外部関数参照定義 */
|
||||
extern void OS_IrqHandler(void);
|
||||
extern void _fp_init(void);
|
||||
extern void __call_static_initializers(void);
|
||||
|
||||
/* 内部関数プロトタイプ定義 */
|
||||
static void INITi_SetHMACSHA1ToAppParam(void);
|
||||
static void INITi_DoAutoload(void);
|
||||
static void INITi_ShelterLtdBinary(void);
|
||||
static BOOL INITi_IsRunOnTwl( void );
|
||||
static void INITi_CopySysConfig( void );
|
||||
static void INITi_DetectMainMemorySize(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);
|
||||
|
||||
/* リンカスクリプトにより定義されるシンボル参照 */
|
||||
extern void SDK_AUTOLOAD_LIST(void);
|
||||
extern void SDK_AUTOLOAD_LIST_END(void);
|
||||
extern void SDK_AUTOLOAD_START(void);
|
||||
extern void SDK_STATIC_BSS_START(void);
|
||||
extern void SDK_STATIC_BSS_END(void);
|
||||
|
||||
void* const _start_ModuleParams[] =
|
||||
{
|
||||
(void*)SDK_AUTOLOAD_LIST,
|
||||
(void*)SDK_AUTOLOAD_LIST_END,
|
||||
(void*)SDK_AUTOLOAD_START,
|
||||
(void*)SDK_STATIC_BSS_START,
|
||||
(void*)SDK_STATIC_BSS_END,
|
||||
(void*)0, // CompressedStaticEnd. This fixed number will be updated by compstatic tool.
|
||||
(void*)SDK_CURRENT_VERSION_NUMBER,
|
||||
(void*)SDK_NITROCODE_BE,
|
||||
(void*)SDK_NITROCODE_LE,
|
||||
};
|
||||
|
||||
extern void SDK_LTDAUTOLOAD_LIST(void);
|
||||
extern void SDK_LTDAUTOLOAD_LIST_END(void);
|
||||
extern void SDK_LTDAUTOLOAD_START(void);
|
||||
|
||||
void* const _start_LtdModuleParams[] =
|
||||
{
|
||||
(void*)SDK_LTDAUTOLOAD_LIST,
|
||||
(void*)SDK_LTDAUTOLOAD_LIST_END,
|
||||
(void*)SDK_LTDAUTOLOAD_START,
|
||||
(void*)0, // CompressedLtdautoloadEnd. This fixed number will be updated by compstatic tool.
|
||||
(void*)SDK_TWLCODE_BE,
|
||||
(void*)SDK_TWLCODE_LE,
|
||||
};
|
||||
|
||||
extern void SDK_LTDAUTOLOAD_LTDMAIN_START(void);
|
||||
|
||||
void* const _start_LtdMainParams[] =
|
||||
{
|
||||
(void*)SDK_LTDAUTOLOAD_LTDMAIN_START,
|
||||
};
|
||||
|
||||
#ifdef DEBUG_WRAM_SETTING
|
||||
u32 const wramMapping[12] = {
|
||||
0x8d898581, 0x8c888480, 0x9c989490, 0x8c888480,
|
||||
0x9c989490, 0x00000000, 0x09403900, 0x09803940,
|
||||
0x080037c0, 0x09403900, 0x09803940, 0x0000000f
|
||||
};
|
||||
#endif
|
||||
|
||||
#define DIGEST_HASH_BLOCK_SIZE_SHA1 (512/8)
|
||||
static const u8 s_digestDefaultKey[ DIGEST_HASH_BLOCK_SIZE_SHA1 ] =
|
||||
{
|
||||
0x21, 0x06, 0xc0, 0xde,
|
||||
0xba, 0x98, 0xce, 0x3f,
|
||||
0xa6, 0x92, 0xe3, 0x9d,
|
||||
0x46, 0xf2, 0xed, 0x01,
|
||||
|
||||
0x76, 0xe3, 0xcc, 0x08,
|
||||
0x56, 0x23, 0x63, 0xfa,
|
||||
0xca, 0xd4, 0xec, 0xdf,
|
||||
0x9a, 0x62, 0x78, 0x34,
|
||||
|
||||
0x8f, 0x6d, 0x63, 0x3c,
|
||||
0xfe, 0x22, 0xca, 0x92,
|
||||
0x20, 0x88, 0x97, 0x23,
|
||||
0xd2, 0xcf, 0xae, 0xc2,
|
||||
|
||||
0x32, 0x67, 0x8d, 0xfe,
|
||||
0xca, 0x83, 0x64, 0x98,
|
||||
0xac, 0xfd, 0x3e, 0x37,
|
||||
0x87, 0x46, 0x58, 0x24,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
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 ; ハンドシェイク完了 */
|
||||
};
|
||||
|
||||
#ifdef DEBUG_WRAM_SETTING
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: WaitAgreement
|
||||
Description: ARM9 の起動ベクタが特定の状態になるまで待つ。
|
||||
メインメモリでないメモリ空間で実行される必要がある。
|
||||
Arguments: r0 - 同期用フェーズ管理変数へのポインタ。
|
||||
r1 - 待機するフェーズ番号。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const u32 microcode_WaitAgreement[7] =
|
||||
{
|
||||
0xe1d020b0, /* @1: ldrh r2, [r0] ; フェーズ管理変数を共有メモリから読む */
|
||||
0xe1510002, /* cmp r1, r2 ; 待機フェーズ番号と比較 */
|
||||
0x012fff1e, /* bxeq lr ; 一致していれば待機完了 */
|
||||
0xe3a03010, /* mov r3, #16 ; 空ループ回数初期化 */
|
||||
0xe2533001, /* @2: subs r3, r3, #1 ; 空ループ回数 -- */
|
||||
0x1afffffd, /* bne @2 ; 16 回ループ */
|
||||
0xeafffff8 /* b @1 ; 先頭に戻る */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: GotoMain
|
||||
Description: ARM9 に特定の状態になったことを伝えた上で、Main 関数へジャンプ
|
||||
する。メインメモリでないメモリ空間で実行される必要がある。
|
||||
Arguments: r0 - Main 関数のポインタ。Main 関数が Thumb コードである場合
|
||||
には、bx 命令でジャンプするため最下位ビットが 1 になって
|
||||
いる必要がある。
|
||||
r1 - 同期用フェーズ管理変数へのポインタ。
|
||||
r2 - ARM9 に伝えるフェーズ番号。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const u32 microcode_GotoMain[2] =
|
||||
{
|
||||
0xe1c120b0, /* strh r2, [r1] ; フェーズ管理変数を更新 */
|
||||
0xe12fff10 /* bx r0 ; Main 関数へジャンプ */
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#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] // Use that LSB of HW_REG_BASE is 0b0
|
||||
|
||||
/* ハンドシェイク用マイクロコードを専用 WRAM にコピー */
|
||||
ldr r1, =microcode_ShakeHand
|
||||
ldr r2, =HW_PRV_WRAM
|
||||
add r3, r2, #40
|
||||
@001: ldr r0, [r1], #4
|
||||
str r0, [r2], #4
|
||||
cmp r2, r3
|
||||
blt @001
|
||||
|
||||
/* 専用 WRAM 上のコードで ARM9 とハンドシェイク */
|
||||
ldr r0, =HW_BOOT_SHAKEHAND_9
|
||||
ldr r1, =HW_BOOT_SHAKEHAND_7
|
||||
ldr r2, =HW_PRV_WRAM
|
||||
mov lr, pc
|
||||
bx r2
|
||||
|
||||
// ロードされたアプリのダイジェストを計算してアプリ間パラメータに格納
|
||||
bl INITi_SetHMACSHA1ToAppParam
|
||||
|
||||
@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 stack check code
|
||||
mov r0, #HW_PSR_SYS_MODE
|
||||
msr cpsr_csfx, r0
|
||||
sub sp, r1, #4 // 4 bytes for 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
|
||||
|
||||
/* SCFG を HW_SYS_CONF_BUF へコピー */
|
||||
bl INIT_InitializeScfg
|
||||
bl INITi_CopySysConfig
|
||||
|
||||
/* TWL ハードウェア上で動作しているかどうかを調査 */
|
||||
bl INITi_IsRunOnTwl
|
||||
/* TWL ハードウェア上で動作していない場合は永久ループ */
|
||||
@012: bne @012
|
||||
|
||||
/* プリロードパラメータアドレスが格納されていない場合は、デフォルト値をセット */
|
||||
ldr r0, =HW_PRELOAD_PARAMETER_ADDR
|
||||
ldr r1, [r0]
|
||||
cmp r1, #0
|
||||
ldreq r1, =HW_PARAM_TWL_SETTINGS_DATA_DEFAULT
|
||||
streq r1, [r0]
|
||||
|
||||
@020:
|
||||
/* 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
|
||||
|
||||
//---- detect main memory size
|
||||
bl INITi_DetectMainMemorySize
|
||||
|
||||
#ifndef SDK_FINALROM
|
||||
//---- set debug print window
|
||||
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
|
||||
|
||||
/* 割り込みベクタ設定 */
|
||||
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
|
||||
|
||||
@030:
|
||||
/* Main 関数へのジャンプ用マイクロコードをスタックの底にコピー */
|
||||
ldr r1, =microcode_GotoMain
|
||||
ldr r0, [r1], #4
|
||||
str r0, [sp, #-4]
|
||||
ldr r0, [r1]
|
||||
str r0, [sp]
|
||||
|
||||
/* マイクロコードを経由して Main 関数へジャンプ */
|
||||
ldr r0, =TwlSpMain
|
||||
ldr r1, =HW_BOOT_SYNC_PHASE
|
||||
mov r2, #BOOT_SYNC_PHASE_4
|
||||
ldr lr, =HW_RESET_VECTOR
|
||||
sub r3, sp, #4
|
||||
bx r3
|
||||
}
|
||||
|
||||
#include <nitro/mi/stream.h>
|
||||
#include <twl/os/common/systemCall.h>
|
||||
#include <nitro/mi.h>
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_SetHMACSHA1ToAppParam
|
||||
Description: ROMがロードされた各アプリ領域のHMACSHA1を計算し、特定のアドレ
|
||||
スに保存
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define UNDEF_CODE 0xe7ffdeff
|
||||
#define ENCRYPT_DEF_SIZE 0x800
|
||||
#define DGT_TGT_ADDR ( HW_MAIN_MEM + 0x0100 )
|
||||
|
||||
static void INITi_SetHMACSHA1ToAppParam(void)
|
||||
{
|
||||
u32 *arm9_flx_addr = (u32 *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x028));
|
||||
u32 *p_arm9encryObjVerify = (u32 *)(DGT_TGT_ADDR + 4 * 32);
|
||||
int l;
|
||||
SVCHMACSHA1Context *pCon = ( SVCHMACSHA1Context * ) (0x2000300 - sizeof(SVCHMACSHA1Context));
|
||||
//SVCHMACSHA1Context *pCon = &Con;
|
||||
|
||||
// arm9_flx
|
||||
for( l=0; l<ENCRYPT_DEF_SIZE/4; l++ )
|
||||
{
|
||||
if((u32)p_arm9encryObjVerify < (u32)pCon)
|
||||
{
|
||||
*p_arm9encryObjVerify = arm9_flx_addr[l];
|
||||
p_arm9encryObjVerify++;
|
||||
}
|
||||
}
|
||||
MI_CpuClear8( (void *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x028)), ENCRYPT_DEF_SIZE);// 折角MI使えるので、4バイト境界で困らないように8で
|
||||
SVC_HMACSHA1Init(pCon, (void *)s_digestDefaultKey, DIGEST_HASH_BLOCK_SIZE_SHA1);
|
||||
SVC_HMACSHA1Update(pCon, (void *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x028)), *((u32 *)(HW_TWL_ROM_HEADER_BUF + 0x02c)));
|
||||
SVC_HMACSHA1GetHash(pCon, (void *)DGT_TGT_ADDR);
|
||||
// arm7_flx
|
||||
SVC_HMACSHA1Init(pCon, (void *)s_digestDefaultKey, DIGEST_HASH_BLOCK_SIZE_SHA1);
|
||||
SVC_HMACSHA1Update(pCon, (void *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x038)), *((u32 *)(HW_TWL_ROM_HEADER_BUF + 0x03c)));
|
||||
SVC_HMACSHA1GetHash(pCon, (void *)(DGT_TGT_ADDR + 32));
|
||||
// arm9_ltd
|
||||
SVC_HMACSHA1Init(pCon, (void *)s_digestDefaultKey, DIGEST_HASH_BLOCK_SIZE_SHA1);
|
||||
SVC_HMACSHA1Update(pCon, (void *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x1c8)), *((u32 *)(HW_TWL_ROM_HEADER_BUF + 0x1cc)));
|
||||
SVC_HMACSHA1GetHash(pCon, (void *)(DGT_TGT_ADDR + 2 * 32));
|
||||
// arm7_ltd
|
||||
SVC_HMACSHA1Init(pCon, (void *)s_digestDefaultKey, DIGEST_HASH_BLOCK_SIZE_SHA1);
|
||||
SVC_HMACSHA1Update(pCon, (void *)(*(u32 *)(HW_TWL_ROM_HEADER_BUF + 0x1d8)), *((u32 *)(HW_TWL_ROM_HEADER_BUF + 0x1dc)));
|
||||
SVC_HMACSHA1GetHash(pCon, (void *)(DGT_TGT_ADDR + 3 * 32));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_DoAutoload
|
||||
Description: リンク情報に沿って、各オートロードブロックの固定データ部の展開
|
||||
及び変数部の 0 クリアを行う。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* < 二段階オートロード >
|
||||
* 0x02380000 に crt0 及び一段目ロード元バイナリが配置されている。
|
||||
* NITRO と共有可能な WRAM 上に配置されるべきバイナリデータを 0x037c0000 にロードする。
|
||||
* TWL でしか動作しない WRAM 上に配置されるべきバイナリデータを続きのアドレスにロードする。
|
||||
* 0x02400000 に ARM9 の二段目ロード元バイナリが配置されている。
|
||||
* 0x04000 バイト分はカード ROM から再読み出し不可なので、0x02f80000 - 0x02f84000 に退避する。
|
||||
* 0x02e80000 に二段目ロード元バイナリが配置されている。
|
||||
* 0x04000 バイト分はカード ROM から再読み出し不可なので、0x02f84000 - 0x02f88000 に退避する。
|
||||
* NITRO と共有可能な MAIN 上に配置されるべきバイナリデータを 0x02f88000 にロードする。
|
||||
* TWL でしか動作しない MAIN 上に配置されるべきバイナリデータを続きのアドレスにロードする。
|
||||
*/
|
||||
static asm void
|
||||
INITi_DoAutoload(void)
|
||||
{
|
||||
stmfd sp!, {lr}
|
||||
|
||||
@01_autoload:
|
||||
/* WRAM 用ブロックをオートロード */
|
||||
ldr r0, =_start_ModuleParams
|
||||
ldr r12, [r0] // r12 = SDK_AUTOLOAD_LIST
|
||||
ldr r3, [r0, #4] // r3 = SDK_AUTOLOAD_LIST_END
|
||||
ldr r1, [r0, #8] // r1 = SDK_AUTOLOAD_START
|
||||
@01_segments_loop:
|
||||
cmp r12, r3
|
||||
bge @02_start
|
||||
/* 固定セクション */
|
||||
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 // r0 = start address of source range of static initializers table
|
||||
#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 = size of bss section
|
||||
bl INITi_Fill32
|
||||
ldmfd sp!, {r1} // r1 = end address of source range of the autoload segment
|
||||
b @01_segments_loop
|
||||
|
||||
@02_start:
|
||||
#ifndef SDK_SYSMENU_BUILD
|
||||
/* 再読み出し不可部分を退避 */
|
||||
bl INITi_ShelterLtdBinary
|
||||
#endif // SDK_SYSMENU_BUILD
|
||||
|
||||
/* メインメモリ用オートロードブロックの存在を確認 */
|
||||
ldr r1, =HW_TWL_ROM_HEADER_BUF
|
||||
ldr r0, [r1, #ROM_Header.s.sub_ltd_size]
|
||||
cmp r0, #0
|
||||
beq @03_start
|
||||
|
||||
@02_autoload:
|
||||
/* メインメモリ用ブロックをオートロード */
|
||||
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_AUTOLOAD_START
|
||||
@02_segments_loop:
|
||||
cmp r12, r3
|
||||
bge @03_start
|
||||
/* 固定セクション */
|
||||
ldr r0, [r12], #4
|
||||
ldr r2, [r12], #4
|
||||
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}
|
||||
mov r1, #0
|
||||
ldr r2, [r12], #4
|
||||
bl INITi_Fill32
|
||||
ldmfd sp!, {r1}
|
||||
b @02_segments_loop
|
||||
|
||||
@03_start:
|
||||
/* オートロード完了コールバック関数呼び出し */
|
||||
ldr r0, =_start_ModuleParams
|
||||
ldr r1, =_start_LtdModuleParams
|
||||
ldmfd sp!, {lr}
|
||||
b _start_AutoloadDoneCallback
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_ShelterLtdBinary
|
||||
Description: TWL 専用のオートロード元バイナリデータの内、カード ROM から
|
||||
再読み出しできない領域のデータを退避エリアに退避する。
|
||||
再読み出しできない領域のデータは ARM7 用と ARM9 用の拡張常駐
|
||||
モジュールの2つに分かれている可能性があるので、冗長ではあるが
|
||||
両方の先頭から 0x4000 分をそれぞれ退避する。
|
||||
Arguments: なし。
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void
|
||||
INITi_ShelterLtdBinary(void)
|
||||
{
|
||||
stmfd sp!, {lr}
|
||||
|
||||
/* NAND からブートした場合には退避するデータの使い道がない為、処理をスキップ */
|
||||
ldr r3, =HW_TWL_ROM_HEADER_BUF
|
||||
ldr r0, [r3, #ROM_Header.s.titleID_Hi]
|
||||
tst r0, #TITLE_ID_HI_MEDIA_MASK
|
||||
ldmnefd sp!, {pc}
|
||||
|
||||
@shelter_arm7_ltdautoload_src:
|
||||
/* ARM7 用拡張常駐モジュールの存在を確認 */
|
||||
ldr r1, [r3, #ROM_Header.s.sub_ltd_size]
|
||||
cmp r1, #0
|
||||
beq @shelter_arm9_ltdautoload_src
|
||||
|
||||
/* ARM7 用拡張常駐モジュールの先頭 16K bytes を退避 */
|
||||
ldr r1, [r3, #ROM_Header.s.sub_ltd_ram_address]
|
||||
ldr r0, =_start_LtdMainParams
|
||||
ldr r0, [r0]
|
||||
mov r2, #0x4000 // r2 = size of shelter buffer
|
||||
sub r0, r0, r2 // r0 = SDK_LTDAUTOLOAD_LTDMAIN_START - 0x4000
|
||||
bl INITi_Copy32
|
||||
|
||||
@shelter_arm9_ltdautoload_src:
|
||||
/* ARM9 用拡張常駐モジュールの存在を確認 */
|
||||
ldr r3, =HW_TWL_ROM_HEADER_BUF
|
||||
ldr r1, [r3, #ROM_Header.s.main_ltd_size]
|
||||
cmp r1, #0
|
||||
beq @end
|
||||
|
||||
/* ARM9 用拡張常駐モジュールの先頭 16K bytes を退避 */
|
||||
ldr r1, [r3, #ROM_Header.s.main_ltd_ram_address]
|
||||
ldr r0, =_start_LtdMainParams
|
||||
ldr r0, [r0]
|
||||
mov r2, #0x4000 // r2 = size of shelter buffer
|
||||
sub r0, r0, r2
|
||||
sub r0, r0, r2 // r0 = SDK_LTDAUTOLOAD_LTDMAIN_START - 0x8000
|
||||
bl INITi_Copy32
|
||||
|
||||
@end:
|
||||
ldmfd sp!, {pc}
|
||||
}
|
||||
|
||||
#ifndef SDK_NOINIT
|
||||
/*---------------------------------------------------------------------------*
|
||||
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
|
||||
stmdb sp!, {r1}
|
||||
mov lr, pc
|
||||
bx r0
|
||||
ldmia sp!, {r1}
|
||||
/* 一旦呼び出したポインタはゼロクリア (IRQスタックを間借りしている為) */
|
||||
mov r0, #0
|
||||
str r0, [r1], #4
|
||||
b @001
|
||||
|
||||
@002: ldmia sp!, {lr}
|
||||
bx lr
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
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: NitroSpStartUp
|
||||
Description: Hook for user start up.
|
||||
Arguments: None.
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
SDK_WEAK_SYMBOL void
|
||||
NitroSpStartUp(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_IsRunOnTwl
|
||||
|
||||
Description: check running platform
|
||||
|
||||
This function is used in only Nitro-TWL hybrid mode.
|
||||
(In Nitro mode and TWL limited mode, treated as constant)
|
||||
|
||||
Arguments: None
|
||||
|
||||
Returns: TRUE : running on TWL
|
||||
FALSE : running on NITRO
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm BOOL INITi_IsRunOnTwl( void )
|
||||
{
|
||||
ldr r0, =HW_PRV_WRAM_SYSRV
|
||||
ldrb r0, [r0,#HWi_WSYS08_WRAMOFFSET]
|
||||
and r0, r0, #HWi_WSYS08_ROM_ARM9SEC_MASK | HWi_WSYS08_ROM_ARM9RSEL_MASK
|
||||
cmp r0, #HWi_WSYS08_ROM_ARM9SEC_MASK
|
||||
moveq r0, #TRUE
|
||||
movne r0, #FALSE
|
||||
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INIT_InitializeScfg
|
||||
|
||||
Description: ローダーが行う SCFG ブロックへの設定処理を代行する為の関数。
|
||||
処理の実体は crt0 の外部に定義するため、弱シンボルとする。
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
SDK_WEAK_SYMBOL asm void
|
||||
INIT_InitializeScfg(void)
|
||||
{
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_CopySysConfig
|
||||
|
||||
Description: copy SCFG registers to HW_SYS_CONF_BUF and HW_PRV_WRAM_SYSRV
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
static asm void INITi_CopySysConfig( void )
|
||||
{
|
||||
//---- copy scfg setting
|
||||
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: detect main memory size.
|
||||
result is written into (u32*)HW_MMEMCHECKER_SUB.
|
||||
value is [OS_CONSOLE_SIZE_4MB|OS_CONSOLE_SIZE_8MB|
|
||||
OS_CONSOLE_SIZE_16MB|OS_CONSOLE_SIZE_32MB]
|
||||
|
||||
Arguments: None.
|
||||
|
||||
Returns: None.
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define OSi_IMAGE_DIFFERENCE 0x400000
|
||||
#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 )
|
||||
{
|
||||
stmfd sp!, {lr}
|
||||
|
||||
//---- detect memory size
|
||||
mov r0, #OS_CONSOLE_SIZE_4MB
|
||||
mov r1, #0
|
||||
|
||||
ldr r2, =HW_MMEMCHECKER_SUB
|
||||
sub r3, r2, #OSi_IMAGE_DIFFERENCE
|
||||
@1:
|
||||
strh r1, [r2]
|
||||
ldrh r12, [r3]
|
||||
cmp r1, r12
|
||||
bne @2
|
||||
|
||||
add r1, r1, #1
|
||||
cmp r1, #2 // check 2 loop
|
||||
bne @1
|
||||
|
||||
//---- 4MB
|
||||
b @3
|
||||
|
||||
//---- 8MB or 16MB or 32MB
|
||||
@2:
|
||||
// check if running on twl/nitro
|
||||
bl INITi_IsRunOnTwl
|
||||
movne r0, #OS_CONSOLE_SIZE_8MB
|
||||
bne @3
|
||||
|
||||
//---- 16MB or 32MB
|
||||
add r3, r2, #OSi_IMAGE_DIFFERENCE2
|
||||
mov r0, #OS_CONSOLE_SIZE_16MB
|
||||
ldrb r2, [r3]
|
||||
|
||||
mov r1, #OSi_CHECKNUM1
|
||||
strb r1, [r3]
|
||||
|
||||
ldr r12, =OSi_100usWAIT
|
||||
@4 subs r12, r12, #4
|
||||
bcs @4
|
||||
|
||||
ldrb r1, [r3]
|
||||
cmp r1, #OSi_CHECKNUM1
|
||||
bne @3
|
||||
|
||||
mov r1, #OSi_CHECKNUM2
|
||||
strb r1, [r3]
|
||||
|
||||
ldr r12, =OSi_100usWAIT
|
||||
@5 subs r12, r12, #4
|
||||
bcs @5
|
||||
|
||||
ldrb r1, [r3]
|
||||
cmp r1, #OSi_CHECKNUM2
|
||||
moveq r0, #OS_CONSOLE_SIZE_32MB
|
||||
|
||||
@3:
|
||||
//---- check SMX_CNT
|
||||
strb r2, [r3]
|
||||
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
|
||||
strh r0, [r2]
|
||||
|
||||
ldmfd sp!, {lr}
|
||||
bx lr
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: INITi_Copy32
|
||||
Description: 可能な限り 32 バイト単位で、半端な分は 4 バイト単位でコピーを
|
||||
行う。
|
||||
スタックを 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 バイト単位で、半端な分は 4 バイト単位でバッファ
|
||||
内容を指定データで埋める。
|
||||
スタックを 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>
|
||||
54
build/tests/HashCheckTemplate/crt/ARM9/Makefile
Normal file
54
build/tests/HashCheckTemplate/crt/ARM9/Makefile
Normal file
@ -0,0 +1,54 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - init - ARM9.TWL
|
||||
# File: Makefile.FLX
|
||||
#
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
override TARGET_PLATFORM = TWL
|
||||
|
||||
# Codegen for main processer
|
||||
override TWL_PROC = ARM9
|
||||
|
||||
# Avoid to build THUMB version object
|
||||
override TWL_CODEGEN = ARM
|
||||
|
||||
# Avoid to build LIMITED version object
|
||||
override TWL_ARCHGEN = HYBRID
|
||||
|
||||
# Avoid to use pre-compile-header of "nitro.h"
|
||||
TWL_NO_STD_PCHDR = True
|
||||
|
||||
# build ARM & THUMB libraries
|
||||
TWL_CODEGEN ?= ALL
|
||||
|
||||
SRCDIR = src
|
||||
INCDIR = ../common/include
|
||||
|
||||
SRCS = crt0_hct.FLX.c
|
||||
TARGET_OBJ = crt0_hct.FLX.TWL.o
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(OBJDIR)/$(TARGET_OBJ): $(OBJDIR)/$(SRCS:.c=.o)
|
||||
$(CP) $< $@
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
54
build/tests/HashCheckTemplate/crt/ARM9/Makefile.FLX
Normal file
54
build/tests/HashCheckTemplate/crt/ARM9/Makefile.FLX
Normal file
@ -0,0 +1,54 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - init - ARM9.TWL
|
||||
# File: Makefile.FLX
|
||||
#
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
override TARGET_PLATFORM = TWL
|
||||
|
||||
# Codegen for main processer
|
||||
override TWL_PROC = ARM9
|
||||
|
||||
# Avoid to build THUMB version object
|
||||
override TWL_CODEGEN = ARM
|
||||
|
||||
# Avoid to build LIMITED version object
|
||||
override TWL_ARCHGEN = HYBRID
|
||||
|
||||
# Avoid to use pre-compile-header of "nitro.h"
|
||||
TWL_NO_STD_PCHDR = True
|
||||
|
||||
# build ARM & THUMB libraries
|
||||
TWL_CODEGEN ?= ALL
|
||||
|
||||
SRCDIR = src
|
||||
INCDIR = ../common/include
|
||||
|
||||
SRCS = crt0_hct.FLX.c
|
||||
TARGET_OBJ = crt0_hct.FLX.TWL.o
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(OBJDIR)/$(TARGET_OBJ): $(OBJDIR)/$(SRCS:.c=.o)
|
||||
$(CP) $< $@
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
1068
build/tests/HashCheckTemplate/crt/ARM9/src/crt0_hct.FLX.c
Normal file
1068
build/tests/HashCheckTemplate/crt/ARM9/src/crt0_hct.FLX.c
Normal file
File diff suppressed because it is too large
Load Diff
31
build/tests/HashCheckTemplate/crt/Makefile
Normal file
31
build/tests/HashCheckTemplate/crt/Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - init
|
||||
# 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:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
TARGET_PLATFORM := TWL NITRO
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = ARM9 ARM7
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#===== End of Makefile =====
|
||||
35
build/tests/HashCheckTemplate/crt/common/include/boot_sync.h
Normal file
35
build/tests/HashCheckTemplate/crt/common/include/boot_sync.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - libraries - init - common
|
||||
File: boot_sync.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:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef TWL_LIBRARIES_INIT_COMMON_BOOT_SYNC_H_
|
||||
#define TWL_LIBRARIES_INIT_COMMON_BOOT_SYNC_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#define BOOT_SYNC_PHASE_1 1
|
||||
#define BOOT_SYNC_PHASE_2 2
|
||||
#define BOOT_SYNC_PHASE_3 3
|
||||
#define BOOT_SYNC_PHASE_4 4
|
||||
#define BOOT_SYNC_PHASE_5 5
|
||||
#define BOOT_SYNC_PHASE_6 6
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* TWL_LIBRARIES_INIT_COMMON_BOOT_SYNC_H_ */
|
||||
Loading…
Reference in New Issue
Block a user