build/testsフォルダを削除

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/branches/20120221_1_4_6@3050 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
(no author) 2012-02-21 04:53:51 +00:00
parent 061bde473f
commit 52f0472a44
748 changed files with 0 additions and 114032 deletions

View File

@ -1,150 +0,0 @@
#/*---------------------------------------------------------------------------*
# Project: TwlIPL - tests - DisplaySystemInformation
# File: makefile
#
# Copyright **** 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_FIRM = SYSTEMMENU
TARGET_PLATFORM = TWL
TWL_ARCHGEN = LIMITED
######################################
FILE_IDX = 0
IS_SECURE_APP = TRUE
IS_NAND_APP = FALSE
NAND_ACCESS = TRUE
AES_SLOT = FALSE
INVISIBLE_SCFG = TRUE
GAMECODE = 0BZA
######################################
ROM_HEADER_TEMPLATE = $(SYSMENU_ROM_HEADER_DIR)/$(GAMECODE)/rom_header_$(call toLower,$(GAMECODE)).template.sbin
LIBSYSCALL = $(SYSMENU_ROM_HEADER_DIR)/$(GAMECODE)/libsyscall.a
MACRO_FLAGS += -DNAM_ENABLE=$(IS_SECURE_APP) -DDISPINFO_BIN_IDX=N -DVERSION_VIEWER=TRUE
TWL_NANDAPP = $(IS_NAND_APP)
DISP_INFO = $(call eupath,$(TWL_IPL_RED_ROOT)/build/tests/DisplaySystemInformation)
SUBDIRS =
MISC_DIR = ../../../systemMenu_RED/misc
SRCDIR = $(DISP_INFO)/ARM9/src
SRCS = main.c viewSystemInfo.c drawFunc.c control.c\
strResource.c misc.c util.c\
get_versionData.c \
$(MISC_DIR)/src/cmn.c
LINCLUDES += $(MISC_DIR)/include \
$(DISP_INFO)/common/include \
$(ES_ROOT)/twl/include
TARGET_NAME = AppVersionViewer
TARGET_BIN = $(TARGET_NAME).$(FILE_SUFFIX)
SYSMENU_LIBS = \
liblcfg$(TWL_LIBSUFFIX).a \
libsysmenu$(TWL_LIBSUFFIX).a \
libsysmmcu$(TWL_LIBSUFFIX).a \
libsysmutil$(TWL_LIBSUFFIX).a \
libboot$(TWL_LIBSUFFIX).a \
libds$(TWL_LIBSUFFIX).a \
liberrorlog$(TWL_LIBSUFFIX).a \
libhotsw$(TWL_LIBSUFFIX).a \
libdht$(TWL_LIBSUFFIX).a \
libreloc_info$(TWL_LIBSUFFIX).a \
libnamut$(TWL_LIBSUFFIX).a \
libsharedfont_launcher$(TWL_LIBSUFFIX).a \
WDS$(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 \
libreboot$(TWL_LIBSUFFIX).a \
libna$(TWL_LIBSUFFIX).a
LLIBRARIES += $(SYSMENU_LIBS) $(SDK_APPEND_LIBS)
#=============================================================================
include $(TWLSDK_ROOT)/add-ins/es/commondefs.es
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
ifeq ($(IS_SECURE_APP),TRUE)
DEFAULT_COMP_ARM7 = armadillo
WRAM_MAP = MAP_TS_SCR
APPTYPE = SYSTEM
MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
ROM_SPEC = main.rsf
MAKETAD_OPTION += -s
else
WRAM_MAP = $(MAKEROM_WRAM_MAPPING)
DEFAULT_COMP_ARM7 = racoon
APPTYPE = USER
ROM_SPEC = main_normal.rsf
endif
ifeq ($(IS_NAND_APP),TRUE)
MEDIA = NAND
FILE_SUFFIX = tad
else
MEDIA = GAMECARD
FILE_SUFFIX = srl
endif
ifeq ($(INVISIBLE_SCFG),TRUE)
SCFG_SUFFIX = LockSCFG
else
SCFG_SUFFIX = UnlockSCFG
endif
BINDIR = ./bin/$(TWL_BUILDTYPE)
OBJDIR = ./obj/$(TWL_BUILDTYPE)
MAKEROM_FLAGS += -DDISPINFO_WRAM_MAP=$(WRAM_MAP) \
-DDISPINFO_APPTYPE=$(APPTYPE) \
-DDISPINFO_SECURE=$(IS_SECURE_APP) \
-DDISPINFO_MEDIA=$(MEDIA) \
-DDISPINFO_NANDACCESS=$(NAND_ACCESS) \
-DDISPINFO_LOCKSCFG=$(INVISIBLE_SCFG) \
-DDISPINFO_AES=$(AES_SLOT) \
-DDISPINFO_GAMECODE=$(GAMECODE) \
-DROM_HEADER_TEMPLATE='$(call empath,$(ROM_HEADER_TEMPLATE))'
DEFAULT_MAKEROM_ARM7_BASE = $(DISP_INFO)/ARM7_$(DEFAULT_COMP_ARM7)/bin/$(TWL_BUILDTYPE_ARM7)/$(DEFAULT_COMP_ARM7)
DEFAULT_MAKEROM_ARM7 = $(DEFAULT_MAKEROM_ARM7_BASE).$(TWL_ELF_EXT)
#----------------------------------------------------------------------------
do-build: $(TARGETS)
#----------------------------------------------------------------------------
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
#include $(TWLSDK_ROOT)/build/buildtools/modulerules
#include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,248 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 "DispInfo"
#
# MAKER CODE: Your company ID# in 2 ascii words
# issued by NINTENDO
#
MakerCode 01
#
# 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 $(ROM_HEADER_TEMPLATE)
#
# BANNER FILE: generated from Banner Spec File
#
#BannerFile ./etc/myGameBanner.bnr
BannerFile ../banner/banner.bnr
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_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 FALSE
#
# HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE]
#
#HwAESSlotB FALSE
#
# HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE]
#
#HwAESSlotC FALSE
#
# SDCardAccess: sd card access control [TRUE/FALSE]
#
#SDCardAccess $(DISPINFO_SDACCESS)
#
# NANDAccess: NAND access control [TRUE/FALSE]
#
#NANDAccess FALSE
NANDAccess $(DISPINFO_NANDACCESS)
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
LockSCFG $(DISPINFO_LOCKSCFG)
HwAESSlotA_SSLClientCert $(DISPINFO_AES)
DisableDebug TRUE
###
#### END
}
AppendProperty
{
#
# Publisher : "Nintendo"
# don't have to edit
#Publisher Nintendo
#
# Application type : [USER/SYSTEM]
# don't have to edit
AppType $(DISPINFO_APPTYPE)
# AppType SYSTEM
#
# launch title on the launcher : [TRUE/FALSE]
# don't have to edit
Launch TRUE
#
# Boot allowed Media: [GameCard]
#
Media $(DISPINFO_MEDIA)
# Media NAND
#
# Data only title : [TRUE/FALSE]
# don't have to edit
##DataOnly FALSE
#
# Secure title : [TRUE/FALSE]
# don't have to edit
Secure $(DISPINFO_SECURE)
# Secure TRUE
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
GameCode $(DISPINFO_GAMECODE)
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 0K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 0K
#
# Enable SubBannerFile
#SubBannerFile FALSE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot ../../../systemMenu_RED/data
Root /data
File NTR_IPL_font_m.NFTR
}

View File

@ -1,49 +0,0 @@
#! 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)/icon.bmp
BANNER_SPEC = banner_v3.bsf
TARGETS = banner.bnr
INSTALL_DIR = ./
INSTALL_TARGETS = $(TARGETS)
BANNER_ICON_NAME = $(basename $(BANNER_ICON))
LDIRT_CLEAN = $(TARGETS) \
$(BANNER_ICON_NAME).nbfs \
$(BANNER_ICON_NAME).nbfc \
$(BANNER_ICON_NAME).nbfp \
$(TARGETS:.bnr=.srl)
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
#----------------------------------------------------------------------------
# build
#----------------------------------------------------------------------------
do-build: $(TARGETS)
$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON)
$(NTEXCONV) -no -bg -bgb -bgnc $(BANNER_ICON) >/dev/null && \
$(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
#

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

View File

@ -1,47 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CalcHMAC_forBroadOn
# 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:: #$
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
SRCS = CalcHMAC_forBroadOn.c
TARGET_BIN = CalcHMAC_forBroadOn.srl
TITLEID_LO = 0BRA
ROM_SPEC = main.rsf
include $(TWLSDK_ROOT)/build/buildtools/commondefs
LINCLUDES = $(ROOT)/build/libraries/lcfg/ARM9.TWL/include
LLIBRARIES = liblcfg$(TWL_LIBSUFFIX).a
ifneq ($(TWL_IPL_RED_PRIVATE_ROOT),)
MAKEROM_FLAGS += -DHWINFO_PRIVKEY='private_HWInfo.der'
endif
MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' \
-DPRIVKEY_PATH='$(TWL_IPL_RED_PRIVATE_ROOT)/keys/rsa' \
-DCARD_REGION='$(CARD_REGION)'
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,171 +0,0 @@
#----------------------------------------------------------------------------
# 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 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 $(TWLSDK_ROOT)/include/twl/specfiles/default.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 ALL
#
# 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)
###
#### END
}
AppendProperty
{
#
# Publisher : "Nintendo"
# don't have to edit
Publisher Nintendo
#
# Boot allowed Media: [GameCard/NAND]
#
Media GameCard
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
GameCode $(TITLEID_LO)
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot $(PRIVKEY_PATH)
Root /key
File $(HWINFO_PRIVKEY)
}

View File

@ -1,368 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <nitro.h>
#include <nitro/misc.h>
#include <twl/crypto/rsa.h>
#include <nitro/crypto/util.h>
#include <twl/lcfg/common/TWLHWInfo.h>
#include <twl/lcfg/common/api.h>
#include "TWLStoreFile.h"
// define data------------------------------------------------------------------
#define HWINFO_PRIVKEY_PATH "rom:key/private_HWInfo.der" // 製品用秘密鍵
#define RSA_KEY_LENGTH_1024 RSA_KEY_LENGTH
#define HWINFO_S_BODY_SIZE 0x1C
#define PATH_K00A317_JP "sdmc:/hwinfo_s/HWInfo_S.K00A317_JP.dat"
#define PATH_K00A317_US "sdmc:/hwinfo_s/HWInfo_S.K00A317_US.dat"
#define PATH_K00A317_EU "sdmc:/hwinfo_s/HWInfo_S.K00A317_EU.dat"
#define PATH_K00A317_AU "sdmc:/hwinfo_s/HWInfo_S.K00A317_AU.dat"
#define PATH_K00A319_JP "sdmc:/hwinfo_s/HWInfo_S.K00A319_JP.dat"
#define PATH_K00A319_US "sdmc:/hwinfo_s/HWInfo_S.K00A319_US.dat"
#define PATH_K00A319_EU "sdmc:/hwinfo_s/HWInfo_S.K00A319_EU.dat"
#define PATH_K00A319_AU "sdmc:/hwinfo_s/HWInfo_S.K00A319_AU.dat"
//------------------------------------------------------------------------------
extern s32 CRYPTO_RSA_Sign_custom(CRYPTORSASignContext *context, CRYPTORSASignParam *param);
//------------------------------------------------------------------------------
static u8 s_privKey[ 4096 ] ATTRIBUTE_ALIGN(32);
static TSFHeader s_header;
/*----------------------------------------------------------------------------*/
static const u64 FuseID_K00A317 = 0x08a1080105112134LLU;
static const u64 FuseID_K00A319 = 0x08a1080105112122LLU;
/*----------------------------------------------------------------------------*/
static const u8 HWINFO_S_K00A317_JP[HWINFO_S_BODY_SIZE] =
{
0x01, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x00, /* region */
'T', 'J', 'N', '5', '6', '3', '2', '0',
'4', '0', '2', '0', 0x00, 'K', 0x00, /* serialNo */
'J', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A317_US[HWINFO_S_BODY_SIZE] =
{
0x26, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x01, /* region */
'T', 'N', '5', '6', '3', '2', '0', '4',
'0', '2', '0', 0x00, 0x00, 'K', 0x00, /* serialNo */
'E', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A317_EU[HWINFO_S_BODY_SIZE] =
{
0x3E, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x02, /* region */
'T', 'E', 'N', '5', '6', '3', '2', '0',
'4', '0', '2', '0', 0x00, 'K', 0x00, /* serialNo */
'P', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A317_AU[HWINFO_S_BODY_SIZE] =
{
0x02, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x03, /* region */
'T', 'A', 'N', '5', '6', '3', '2', '0',
'4', '0', '2', '0', 0x00, 'K', 0x00, /* serialNo */
'U', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
/*----------------------------------------------------------------------------*/
static const u8 HWINFO_S_K00A319_JP[HWINFO_S_BODY_SIZE] =
{
0x01, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x00, /* region */
'T', 'J', 'N', '3', '5', '3', '8', '9',
'0', '3', '3', '4', 0x00, 'K', 0x00, /* serialNo */
'J', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A319_US[HWINFO_S_BODY_SIZE] =
{
0x26, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x01, /* region */
'T', 'N', '3', '5', '3', '8', '9', '0',
'3', '3', '4', 0x00, 0x00, 'K', 0x00, /* serialNo */
'E', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A319_EU[HWINFO_S_BODY_SIZE] =
{
0x3E, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x02, /* region */
'T', 'E', 'N', '3', '5', '3', '8', '9',
'0', '3', '3', '4', 0x00, 'K', 0x00, /* serialNo */
'P', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
static const u8 HWINFO_S_K00A319_AU[HWINFO_S_BODY_SIZE] =
{
0x02, 0x00, 0x00, 0x00, /* validLanguageBitmap */
0x00, 0x00, 0x00, 0x00, /* flags, rsv */
0x03, /* region */
'T', 'A', 'N', '3', '5', '3', '8', '9',
'0', '3', '3', '4', 0x00, 'K', 0x00, /* serialNo */
'U', 'A', 'N', 'H' /* launcherTitleID_Lo */
};
//================================================================================
static void CalcHWSecureInfoHMAC( void *pDstHMAC, const void* body, u64 fuseID )
{
u8 key[SVC_SHA1_DIGEST_SIZE];
int i;
SVC_CalcSHA1(key, &fuseID, sizeof(u64));
SVC_CalcHMACSHA1( pDstHMAC, body, HWINFO_S_BODY_SIZE, key, SVC_SHA1_DIGEST_SIZE);
OS_TPrintf( "key : " );
for( i = 0; i < SVC_SHA1_DIGEST_SIZE; i++ ) {
OS_TPrintf( "%02x", key[ i ] );
}
OS_TPrintf( "\n" );
OS_TPrintf( "hmac: " );
for( i = 0; i < SVC_SHA1_DIGEST_SIZE; i++ ) {
OS_TPrintf( "%02x", ((u8 *)pDstHMAC)[ i ] );
}
OS_TPrintf( "\n" );
return;
}
// 署名算出BERエンコードなし
static BOOL CalcSignature( void *pDstSign, const void *pSrc, u32 len, const u8 *pPrivKeyDER, u32 keyFileLen, u32 keyLen )
{
CRYPTORSASignContext context;
CRYPTORSASignInitParam initParam;
CRYPTORSASignParam param;
int result_len;
initParam.key = (void*)pPrivKeyDER;
initParam.key_len = keyFileLen;
if( CRYPTO_RSA_SignInit(&context, &initParam) != 0 ) {
return FALSE;
}
param.in = (void *)pSrc;
param.in_len = len;
param.out = pDstSign;
param.out_size = keyLen;
result_len = CRYPTO_RSA_Sign_custom(&context, &param);
if( result_len != keyLen ) {
return FALSE;
}
return CRYPTO_RSA_SignTerminate(&context) == 0 ? TRUE : FALSE;
}
static BOOL LCFGi_THW_WriteSecureInfoCustom( char *pPath, const LCFGTWLHWSecureInfo *pSrcInfo, u64 fuseID, const u8 *pPrivKeyDER, u32 keyFileLen )
{
TSFHeader header;
// ヘッダ初期化
MI_CpuClear8( &header, sizeof(TSFHeader) );
header.version = LCFG_TWL_HWINFO_SECURE_VERSION;
header.bodyLength = sizeof( LCFGTWLHWSecureInfo );
// ヘッダ署名算出
{
u8 hmac_sha1[ SVC_SHA1_DIGEST_SIZE ];
CalcHWSecureInfoHMAC( hmac_sha1, pSrcInfo, fuseID );
if( !CalcSignature( (void *)header.digest.rsa, hmac_sha1, SVC_SHA1_DIGEST_SIZE, pPrivKeyDER, keyFileLen, RSA_KEY_LENGTH_1024 ) ) {
return FALSE;
}
}
// ファイル生成
(void)FS_CreateFileAuto( pPath, FS_PERMIT_R | FS_PERMIT_W );
{
#define HWINFO_FILE_LEN ( 16 * 1024 )
FSFile file[1];
char *pBuffer = OS_Alloc( HWINFO_FILE_LEN );
if( !FS_OpenFileEx( file, pPath, FS_FILEMODE_RW ) ) {
return FALSE;
}
if( FS_SetFileLength( file, HWINFO_FILE_LEN ) != FS_RESULT_SUCCESS ) {
(void)FS_CloseFile( file );
return FALSE;
}
if( pBuffer ) {
MI_CpuFillFast( pBuffer, 0xffffffff, HWINFO_FILE_LEN );
(void)FS_WriteFile( file, pBuffer, HWINFO_FILE_LEN );
}
(void)FS_CloseFile( file );
}
// ライト
if( !LCFGi_TSF_WriteFile( pPath, &header, (const void *)pSrcInfo, NULL ) ) {
return FALSE;
}
return TRUE;
}
// 秘密鍵のリード
static BOOL ReadPrivateKey( void *pBuffer, u32 *pKeyFileLen, char *pPath )
{
BOOL retval = TRUE;
FSFile file;
FS_InitFile( &file );
if( !FS_OpenFileEx( &file, pPath, FS_FILEMODE_R ) )
{
OS_TPrintf( "PrivateKey read failed.\n" );
retval = FALSE;
}else {
*pKeyFileLen = FS_GetFileLength( &file );
if( *pKeyFileLen > 0 ) {
if( FS_ReadFile( &file, pBuffer, (s32)*pKeyFileLen ) == *pKeyFileLen ) {
OS_TPrintf( "PrivateKey read succeeded.\n" );
}else {
OS_TPrintf( "PrivateKey read failed.\n" );
retval = FALSE;
}
}
FS_CloseFile( &file );
}
return retval;
}
/*---------------------------------------------------------------------------*
Name: InitAllocSystem
Description: OS_Alloc 使
Arguments:
Returns:
*---------------------------------------------------------------------------*/
static void InitAllocSystem()
{
void* newArenaLo;
OSHeapHandle hHeap;
// メインアリーナのアロケートシステムを初期化
newArenaLo = OS_InitAlloc(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 1);
OS_SetMainArenaLo(newArenaLo);
// メインアリーナ上にヒープを作成
hHeap = OS_CreateHeap(OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi());
OS_SetCurrentHeap(OS_ARENA_MAIN, hHeap);
}
extern u64 g_HWInfoFuseROM;
extern char *g_pHwInfoPath;
/*---------------------------------------------------------------------------*
Name: TwlMain
Description: main
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void TwlMain(void)
{
BOOL retval;
u32 keyLen;
OS_Init();
InitAllocSystem();
(void)OS_SetIrqMask(0);
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
(void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV);
FS_Init( FS_DMA_NOT_USE );
CRYPTO_SetMemAllocator( OS_AllocFromMain, OS_FreeToMain, NULL );
OS_TPrintf("---- HMAC over HWInfo_S for PROD boards @ BroadOn ----\n");
if( !ReadPrivateKey( s_privKey, &keyLen, HWINFO_PRIVKEY_PATH ) ) {
OS_TPrintf("PrivateKey read failed.\n");
}else {
OS_TPrintf("TS-Board: K00A317\n");
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A317_JP, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A317_JP, FuseID_K00A317, s_privKey, keyLen );
OS_TPrintf(" JP: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A317_US, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A317_US, FuseID_K00A317, s_privKey, keyLen );
OS_TPrintf(" US: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A317_EU, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A317_EU, FuseID_K00A317, s_privKey, keyLen );
OS_TPrintf(" EU: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A317_AU, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A317_AU, FuseID_K00A317, s_privKey, keyLen );
OS_TPrintf(" AU: %s\n", retval ? "succeeded" : "failed" );
OS_TPrintf("TS-Board: K00A319\n");
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A319_JP, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A319_JP, FuseID_K00A319, s_privKey, keyLen );
OS_TPrintf(" JP: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A319_US, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A319_US, FuseID_K00A319, s_privKey, keyLen );
OS_TPrintf(" US: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A319_EU, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A319_EU, FuseID_K00A319, s_privKey, keyLen );
OS_TPrintf(" EU: %s\n", retval ? "succeeded" : "failed" );
retval = LCFGi_THW_WriteSecureInfoCustom( PATH_K00A319_AU, (const LCFGTWLHWSecureInfo *)HWINFO_S_K00A319_AU, FuseID_K00A319, s_privKey, keyLen );
OS_TPrintf(" AU: %s\n", retval ? "succeeded" : "failed" );
}
#if 0
OS_TPrintf("---- Verify phase ----\n");
{
OS_TPrintf("TS-Board: K00A317\n");
g_HWInfoFuseROM = FuseID_K00A317;
g_pHwInfoPath = PATH_K00A317_JP;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" JP: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A317_US;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" US: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A317_EU;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" EU: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A317_AU;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" AU: %s\n", retval ? "succeeded" : "failed" );
OS_TPrintf("TS-Board: K00A319\n");
g_HWInfoFuseROM = FuseID_K00A319;
g_pHwInfoPath = PATH_K00A319_JP;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" JP: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A319_US;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" US: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A319_EU;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" EU: %s\n", retval ? "succeeded" : "failed" );
g_pHwInfoPath = PATH_K00A319_AU;
retval = LCFG_ReadHWSecureInfo();
OS_TPrintf(" AU: %s\n", retval ? "succeeded" : "failed" );
}
#endif
OS_Terminate();
}

View File

@ -1,207 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - MB - demos - card_copy
# File: Makefile
#
# Copyright 2009 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 = banner
# MBライブラリのサンプルはマルチブート機能を使うため、
# 同じ通信環境(無線あるいは有線)どうしの開発機材を複数必要とします。
# $TwlSDK/bin/ARM9-TS/Release/ ディレクトリにある
# mb_child.bin プログラムが最終実機におけるマルチブート子機と同等の
# 機能を提供するサンプルになっていますので、
# このバイナリをサンプルプログラムと同じ方法で他の機材に読み込み、
# 一緒に実行してください。
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
TWL_ARCHGEN := HYBRID
#-------------------------
#-- NAND アプリのビルドを指定します。
TWL_NANDAPP = TRUE
#----------------------------------------------------------------------------
# このプログラムで使用するソースファイルは以下の通りです.
#----------------------------------------------------------------------------
SRCDIR = ./src
INCDIR = ./include
SRCS = main.c \
common.c \
disp.c \
font.c \
child.c \
parent.c \
text.c \
# サンプルの簡略化のため WH モジュールを使用します.
WH_DIR = $(ROOT)/build/demos/wireless_shared/wh
SRCDIR += $(WH_DIR)
INCDIR += $(WH_DIR)
SRCS += $(WH_DIR)/wh.c
# サンプルの簡略化のため MBP モジュールを使用します.
MBP_DIR = $(ROOT)/build/demos/wireless_shared/mbp
SRCDIR += $(MBP_DIR)
INCDIR += $(MBP_DIR)
SRCS += $(MBP_DIR)/mbp.c
#----------------------------------------------------------------------------
# アプリケーションの一般的な設定は以下の通りです.
#----------------------------------------------------------------------------
TARGET_BIN = card_copy.srl
TWL_MAKEROM = TRUE
# プログラムの各セグメントを圧縮する場合はこのフラグを有効にします.
# 圧縮されたセグメントは CARD-ROM 上でのバイナリサイズが削減され
# CARD-ROM またはワイヤレス経由でのロード時間が短縮されるかわりに,
# 実行時は展開のためにいくらかの CPU 時間を消費します.
TWL_COMPRESS = TRUE
# ワイヤレスダウンロード子機としてオーバーレイを使用する場合,
# NITRO_DIGEST を有効にする必要があります.
TWL_DIGEST = TRUE
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/commondefs
do-build: $(TARGETS)
#----------------------------------------------------------------------------
ifeq ($(TARGET_PLATFORM),TWL)
ROM_SPEC = main.TWL.rsf
#LCFILE_SPEC = main.TWL.lsf
else
ROM_SPEC = main.rsf
#LCFILE_SPEC = main.lsf
endif
# MBのコールバック内で複雑な処理をする場合には、lcfファイルで
# IRQスタックサイズを少し大きめに設定しておいた方が安全です。
# 特にOS_Printf()は大量のスタックを消費するので、コールバック内では
# できるだけ軽量版のOS_TPrintf()を使用するようにしてください。
#----------------------------------------------------------------------------
# クローンブート親機としての特別な設定は以下の通りです.
#----------------------------------------------------------------------------
# セキュリティ目的の親機専用領域 .parent セクションを配置するため
# クローンブート用リンク設定テンプレートを指定します.
#
# .parent セクションの内容はDSダウンロードプレイ子機には送信されません.
# このセクションに親機専用かつ必須の関数を配置することによって,
# 傍受された受信内容から親機自身を再現することを不可能にします.
# コードの配置にあたっては, 以下の点に注意してください.
# ・.text/.rodata セクション以外を含まないこと
# ・親機のみが必要とする重要な処理を含むこと
#
# .parent セクションは, 該当するコードについて以下のように配置します.
#
# #include <nitro/parent_begin.h>
#
# void ForParentOnly(void)
# {
# /* 何か親機固有の処理 */
# }
#
# #include <nitro/parent_end.h>
#
# このサンプルデモでは parent.c の全ての関数を .parent セクションに
# 配置しています. 詳細はソースコードを参照ください.
ifeq ($(TARGET_PLATFORM),TWL)
LCFILE_TEMPLATE = $(TWL_SPECDIR)/ARM9-TS-cloneboot-C.lcf.template
else
LCFILE_TEMPLATE = $(NITRO_SPECDIR)/ARM9-TS-cloneboot-C.lcf.template
endif
# 製品版アプリケーションのために各々へ配布された
# 正式なシステムコールライブラリをここで指定します.
# このサンプルでは暫定用として、あらかじめこのディレクトリに,
# SDK 付属版(lib/ARM9-TS/etc/libsyscall.a)のコピーを置いてあります.
# このデモを元にしてアプリケーションを作られる場合は、弊社サポートより
# 配布させていただいている libsyscal.a でこの暫定システムコールを
# 上書きしてください.
LIBSYSCALL = ./etc/libsyscall.a
LIBSYSCALL_CHILD = ./etc/libsyscall_child.bin
#----------------------------------------------------------------------------
# アプリケーションを製品版で実行させるための事前認証手続きは以下の通りです.
#----------------------------------------------------------------------------
# 事前認証手続きはおおよそ以下の流れになります.
# 詳細は「DSダウンロードプレイ解説」を参照ください.
# (/docs/TechnicalNotes/AboutMultiBoot.doc)
#
# (0) クローンブートなら emuchild コマンドで送信用プログラムを用意します.
# そうでなければ main.srl をそのまま用意します.
# この makefile では, 用意したものを bin/sign.srl とします.
#
# (1) 認証コード取得のため, (0) で用意した tmp/sign.srl をサーバへ送付します.
# この作業はご使用のブラウザから手作業で行う必要があります.
# この makefile では, 取得した認証コードを bin/sign.sgn とします.
#
# (2) attachsign コマンドを使用して, (1) で取得した bin/sign.sgn と
# main.srl を結合した最終プログラムを生成します.
# この makefile では, 生成物を main_with_sign.srl とします.
#
# クローンブートの場合は通常のDSダウンロードプレイプログラムと若干異なり,
# 自身のプログラムでなく emuchild で加工したプログラムをサーバへ送付します.
presign:
$(EMUCHILD) \
bin/$(TWL_BUILDTYPE)/$(TARGET_BIN) \
$(LIBSYSCALL_CHILD) \
bin/sign.srl
# 得られた認証コードをバイナリに含める手続きはクローンブートも通常と同様です.
postsign:
$(ATTACHSIGN) \
bin/$(TWL_BUILDTYPE)/$(TARGET_BIN) \
bin/sign.sgn \
main_with_sign.srl && \
$(MAKETAD) \
main_with_sign.srl \
$(MAKETAD_OPTION) \
-o bin/$(TWL_BUILDTYPE)/card_copy.tad
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
ifdef TWL_ELFTOBIN
$(TARGETS): $(ELFTOBIN_ARM7)
else #TWL_ELFTOBIN
$(TARGETS): $(MAKEROM_ARM7)
endif #TWL_ELFTOBIN
#===== End of Makefile =====

View File

@ -1,49 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - nandApp - demos - card_backup
# 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TARGET_PLATFORM = TWL
include $(TWLSDK_ROOT)/build/buildtools/commondefs
MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe
ICON_DIR = ../data
BANNER_ICON = $(ICON_DIR)/myGameIcon.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 $(TWLSDK_ROOT)/build/buildtools/modulerules
#----------------------------------------------------------------------------
# build
#----------------------------------------------------------------------------
do-build: $(TARGETS)
$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE)
$(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
#

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

View File

@ -1 +0,0 @@
<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η<EFBFBD>ή<EFBFBD>η

View File

@ -1,53 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - WBT - demos - wbt-1
File: bt.h
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.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef NITRO_BUILD_DEMOS_WBT_WBT1_INCLUDE_BT_H_
#define NITRO_BUILD_DEMOS_WBT_WBT1_INCLUDE_BT_H_
#include <nitro/wbt.h>
/* ブロックデータの数 */
#define NUM_OF_BT_LIST 3
/* 1ブロックデータのサイズ */
#define BT_DATA_SIZE 0x10000
//親機のパケットサイズ
#define BT_PARENT_PACKET_SIZE WC_PARENT_DATA_SIZE_MAX
//子機のパケットサイズ
#define BT_CHILD_PACKET_SIZE WC_CHILD_DATA_SIZE_MAX
#define SDK_MAKEGGID_SYSTEM(num) (0x003FFF00 | (num))
#define GGID_WBT_1 SDK_MAKEGGID_SYSTEM(0x30)
#define WC_PARENT_DATA_SIZE_MAX 128
#define WC_CHILD_DATA_SIZE_MAX 16
/* 親機用ブロック登録関数 */
extern void bt_register_blocks(void);
/* ブロック転送汎用コールバック関数 */
extern void bt_callback(void *arg);
/* 子機用ブロック転送開始関数 */
extern void bt_start(void);
/* 子機用ブロック転送終了関数 */
extern void bt_stop(void);
#endif /* NITRO_BUILD_DEMOS_WBT_WBT1_INCLUDE_BT_H_ */

View File

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: common.h
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef MB_DEMO_COMMON_H_
#define MB_DEMO_COMMON_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <nitro.h>
#define CARD_SECURE_AREA_OFFSET 0x4000 // 16KB
#define CARD_GAME_AREA_OFFSET 0x8000 // 32KB
//============================================================================
// 関数宣言
//============================================================================
/*
* multiboot-Model NitroMain() .
* MB_IsMultiBootChild() == FALSE .
*/
void ParentMain(void);
/*
* multiboot-Model NitroMain() .
* MB_IsMultiBootChild() == TRUE .
*/
void ChildMain(void);
/*
* .parent .
* , ParentMain() .
*/
void ParentIdentifier(void);
/* それ以外は全て multiboot-Model と同じです */
void CommonInit();
void ReadKey(void);
u16 GetPressKey(void);
u16 GetTrigKey(void);
void InitAllocateSystem(void);
/*---------------------------------------------------------------------------*
Name: IS_PAD_PRESS
Description:
Arguments:
Returns: TRUE
FALSE
*---------------------------------------------------------------------------*/
static inline BOOL IS_PAD_PRESS(u16 flag)
{
return (GetPressKey() & flag) == flag;
}
/*---------------------------------------------------------------------------*
Name: IS_PAD_TRIGGER
Description:
Arguments:
Returns: TRUE
FALSE
*---------------------------------------------------------------------------*/
static inline BOOL IS_PAD_TRIGGER(u16 flag)
{
return (GetTrigKey() & flag) == flag;
}
/*---------------------------------------------------------------------------*
Name: MpSendCallback
Description: MPデータ送信後に呼び出される関数
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void MpSendCallback(BOOL result);
/*---------------------------------------------------------------------------*
Name: MpReceiveCallback
Description: MPデータ受信時に呼び出される関数
Arguments: aid - aid( 0 )
data - (NULL )
length -
Returns: None.
*---------------------------------------------------------------------------*/
void MpReceiveCallback(u16 aid, u16 *data, u16 length);
/*---------------------------------------------------------------------------*
Name: ModeParent
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void ModeParent(void);
/*---------------------------------------------------------------------------*
Name: ModeChild
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void ModeChild(void);
/*---------------------------------------------------------------------------*
Name: BlockTransferMain
Description:
Arguments: arg - WM
Returns: None.
*---------------------------------------------------------------------------*/
void BlockTransferMain(void);
/*---------------------------------------------------------------------------*
Name: BlockTransferCallback
Description:
Arguments: arg - WM
Returns: None.
*---------------------------------------------------------------------------*/
void BlockTransferCallback(void *arg);
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // MB_DEMO_COMMON_H_

View File

@ -1,87 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: disp.h
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef MB_DEMO_DISP_H_
#define MB_DEMO_DISP_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <nitro.h>
/*
* .
*/
/* OBJ番号の割り振り */
enum
{
TITLE_STRING_OBJNO = 0,
PARENT_STRING_OBJNO = 10,
CHILD_STRING_OBJNO = 22,
PLIST_STRING_OBJNO = 33,
CLIST_STRING_OBJNO = 39,
CURSOR_OBJNO = 45,
PARENT_NAME_OBJNO = 46,
FILENAME_OBJNO = 82,
MESSAGE_OBJNO = 104
};
/* テキスト用パレットカラー */
enum
{
PLTT_BLACK = 0,
PLTT_BLUE = 1,
PLTT_RED = 2,
PLTT_PURPLE = 3,
PLTT_GREEN = 4,
PLTT_CYAN = 5,
PLTT_YELLOW = 6,
PLTT_WHITE = 7
};
//============================================================================
// 関数宣言
//============================================================================
void DispInit(void);
void DispOn(void);
void DispOff(void);
void DispVBlankFunc(void);
void ObjSet(s32 objNo, s32 x, s32 y, s32 charNo, s32 paletteNo);
void ObjSetString(s32 startobjNo, s32 x, s32 y, const char *string, s32 paletteNo);
void ObjClear(s32 objNo);
void ObjClearRange(s32 start, s32 end);
void ObjSetMessage(const char *message);
void BgPutChar(s32 x, s32 y, s32 palette, s8 c);
void BgPutStringN(s32 x, s32 y, s32 palette, const char *text, s32 num);
void BgPutString(s32 x, s32 y, s32 palette, const char *text);
void BgPrintStr(s32 x, s32 y, s32 palette, const char *text, ...);
void BgSetMessage(s32 palette, const char *text, ...);
void BgClear(void);
void BgColorString(s16 x, s16 y, s16 length, u8 palette);
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // MB_DEMO_DISP_H_

View File

@ -1,37 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: font.h
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.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef MB_DEMO_FONT_H_
#define MB_DEMO_FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <nitro/types.h>
extern const u16 samplePlttData[16][16];
extern const u32 sampleFontCharData[8 * 0x100];
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // MB_DEMO_DISP_H_

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: gmain.h
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef MB_DEMO_GMAIN_H_
#define MB_DEMO_GMAIN_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <nitro.h>
typedef struct
{
u32 count; // フレーム情報
u16 key; // キー情報
u16 padding;
}
GShareData;
//============================================================================
// 関数宣言
//============================================================================
void GInitDataShare(void);
void GStepDataShare(s32 frame);
void GMain(void);
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // MB_DEMO_GMAIN_H_

View File

@ -1,81 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - WBT - demos - wbt-1
File: font.h
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef _TEXT_H_
#define _TEXT_H_
#define NUM_OF_SCREEN 4
#define X_LINE_MAX (32)
#define Y_LINE_MAX (24)
#define LINE_BUF_X_SIZE 32
#define LINE_BUF_Y_SIZE 24
typedef struct LINE_BUF_s
{
int buf[LINE_BUF_X_SIZE];
u16 col[LINE_BUF_X_SIZE];
int last_count;
int cur_count;
struct LINE_BUF_s *prev;
struct LINE_BUF_s *next;
}
LINE_BUF;
typedef struct
{
int *num_x, *num_y;
LINE_BUF *start;
LINE_BUF *cur;
}
TEXT_BUF;
typedef struct
{
TEXT_BUF text_buf;
u16 *screen;
u16 x_line;
u16 y_line;
u16 palette;
u16 padding;
}
TEXT_CTRL;
int init_text_buf_sys(void *heap_start, void *heap_end);
void m_putchar(TEXT_CTRL * tc, int c);
void m_set_palette(TEXT_CTRL * tc, u16 num);
u16 m_get_palette(TEXT_CTRL * tc);
void init_text(TEXT_CTRL * tc, u16 *screen, u16 palette);
void text_buf_to_vram(TEXT_CTRL * tc);
extern TEXT_CTRL *tc[NUM_OF_SCREEN];
void mfprintf(TEXT_CTRL * tc, const char *fmt, ...);
void mprintf(const char *fmt, ...);
#endif /* _TEXT_H_ */

View File

@ -1,61 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: wh_config.h
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef CLONEBOOT_WH_CONFIG_H_
#define CLONEBOOT_WH_CONFIG_H_
//#include <default/wh_config.h>
// 無線で使用するDMA番号
#define WH_DMA_NO 2
// 子機最大数(親機を含まない数)
#define WH_CHILD_MAX 1
// シェア出来るデータの最大サイズ
#define WH_DS_DATA_SIZE 12
// 1回の通信で送れるデータの最大サイズ
// データシェアリングに加えて通常の通信をする場合は、その分だけ
// ここの値を増やしてください。その際は、複数パケット送信による追加の
// ヘッダフッタ分を加算する必要があります。
// 詳しくは docs/TechnicalNotes/WirelessManager.doc を参照してください。
// GUIDELINE : ガイドライン準拠ポイント(6.3.2)
// リファレンスのワイヤレスマネージャ(WM)→図表・情報→無線通信時間計算シート
// で計算した MP 通信1回分の所要時間が 5600 μ秒以下となることを推奨しています。
#define WH_PARENT_MAX_SIZE 16
#define WH_CHILD_MAX_SIZE (WH_CHILD_SIZE + 4)
#define WH_CHILD_SIZE 128
// 1ピクチャーフレームあたりのMP通信回数上限
// データシェアリングとブロック転送など複数のプロトコルを並行する場合は
// この値を1より大きく(または無制限を示す0に)設定する必要があります。
// そうでない場合、もっとも優先度の高い1つのプロトコル以外は
// MP通信を一切実行できなくなってしまいます。
#define WH_MP_FREQUENCY 1
// 通常の MP 通信で使用するポート
#define WH_DATA_PORT 14
// 通常の MP 通信で使用する優先度
#define WH_DATA_PRIO WM_PRIORITY_NORMAL
// データシェアリングで使用するポート
#define WH_DS_PORT 13
#endif /* CLONEBOOT_WH_CONFIG_H_ */

View File

@ -1,59 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - MB - demos - cloneboot
# File: main.lsf
#
# Copyright 2004-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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#
# Twl LCF SPEC FILE
#
Static $(TARGET_NAME)
{
Address $(ADDRESS_STATIC)
Object $(OBJS_STATIC)
Library $(LLIBS) $(GLIBS) $(CW_LIBS)
# increase capacity of IRQ stack.
StackSize 0 0x800
}
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)
}

View File

@ -1,111 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - MB - demos - cloneboot
# File: main.rsf
#
# 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.
#
# $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
{
RomSpeedType $(MAKEROM_ROMSPEED)
WramMapping $(MAKEROM_WRAM_MAPPING)
RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin
CardRegion ALL
#
# BANNER FILE: generated from Banner Spec File
#
BannerFile "banner/banner.bnr"
#
# SDCardAccess: sd card access control [TRUE/FALSE]
#
SDCardAccess TRUE
}
AppendProperty
{
#
# Boot allowed Media: [GameCard]
#
Media NAND
#
# InitialCode : Your InitialCode in 4 ascii words
#
InitialCode 0DSC
#
# Public save data size: [0-/0K-/0M-]
#
#PublicSaveDataSize 256K
#
# Private save data size: [0-/0K-/0M-]
#
#PrivateSaveDataSize 256K
#
# Enable SubBannerFile
#SubBannerFile FALSE
}
RomSpec
{
Offset 0x00000000
Segment ALL
Align 512
Padding 0xFF
HostRoot data
Root /data
File icon.char
HostRoot data
Root /data
File icon.plt
}

View File

@ -1,44 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - MB - demos - cloneboot
# File: main.lsf
#
# Copyright 2004-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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#
# Nitro LCF SPEC FILE
#
Static $(TARGET_NAME)
{
Address $(ADDRESS_STATIC)
Object $(OBJS_STATIC)
Library $(LLIBS) $(GLIBS) $(CW_LIBS)
# increase capacity of IRQ stack.
StackSize 0 0x800
}
Autoload ITCM
{
Address $(ADDRESS_ITCM)
Object * (.itcm)
Object $(OBJS_AUTOLOAD) (.text)
}
Autoload DTCM
{
Address $(ADDRESS_DTCM)
Object * (.dtcm)
Object $(OBJS_AUTOLOAD) (.data)
Object $(OBJS_AUTOLOAD) (.bss)
}

View File

@ -1,59 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - MB - demos - cloneboot
# File: main.rsf
#
# 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.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#
# Nitro ROM SPEC FILE
#
Arm9
{
Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)"
OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)"
OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)"
Elf "$(MAKEROM_ARM9:r).nef"
}
Arm7
{
Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)"
OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)"
OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)"
Elf "$(MAKEROM_ARM7:r).nef"
}
Property
{
RomSpeedType $(MAKEROM_ROMSPEED)
}
RomSpec
{
Offset 0x00000000
Segment ALL
Align 512
Padding 0xFF
HostRoot data
Root /data
File icon.char
HostRoot data
Root /data
File icon.plt
}

View File

@ -1,27 +0,0 @@
【card_copy操作手順】
1. TWL 開発機へ NMenu または NandInitializer で card_copy_*.tad をインポート(インポート済みなら不要)
2. TWL メニューから「カードコピーマルチブート」 NAND アプリを起動
3. NTR へ吸い出したい DS カードを差す
4. NTR の DS ダウンロードメニューを起動
5. NTR の DS ダウンロードメニューへ "CardCopyMultiBoot" リストが出たら選択
6. DS カード→無線→ SD カードの転送が開始する
7.「Sent/Received ROM size=....」という表示が出たら、SD カードの card_dump.sbin へ
ゲーム領域の吸出しが完了
【TwlSDK変更箇所】
build/libraries/card/common/src/card_common.c
CARDAccessLevel CARDi_GetAccessLevel(void)
{
.
.
else if (!OS_IsRunOnTwl())
{
level = CARD_ACCESS_LEVEL_FULL; // CARD_ACCESS_LEVEL_BACKUP から変更
}
.
.
return level;
}

View File

@ -1,298 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: child.c
Copyright 2006-2009 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.h>
#include <nitro/wm.h>
#include <nitro/mb.h>
#include "common.h"
#include "disp.h"
#include "gmain.h"
#include "wh.h"
#include "bt.h"
/* このデモで使用する GGID */
#define WH_GGID SDK_MAKEGGID_SYSTEM(0x22)
//============================================================================
// プロトタイプ宣言
//============================================================================
static void ModeConnect(void); // 親機への接続開始
static void ModeError(void); // エラー表示画面
static void ModeWorking(void); // ビジー画面
//static void ChildReceiveCallback(WMmpRecvBuf *data);
static BOOL PulledOutCallback(void);
// ブロック転送状態通知関数
void BlockTransferCallback(void *arg);
//============================================================================
// 変数定義
//============================================================================
static s32 gFrame; // フレームカウンタ
static WMBssDesc gMBParentBssDesc ATTRIBUTE_ALIGN(32);
//============================================================================
// 関数定義
//============================================================================
/*---------------------------------------------------------------------------*
Name: ChildMain
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ChildMain(void)
{
// 画面、OSの初期化
CommonInit();
CARD_Enable(TRUE);
CARD_SetPulledOutCallback(PulledOutCallback);
CARD_LockRom((u16)OS_GetLockID());
// 自分がマルチブートから起動した子機であるかどうかをチェックします。
if (!MB_IsMultiBootChild())
{
OS_Panic("not found Multiboot child flag!\n");
}
//--------------------------------------------------------------
// マルチブートで起動した場合、一旦リセットされ通信が切断されます。
// ブート後もブートした親機のBssDescを保持しているため、この情報を使って
// 親機へ再接続してください。
// この時、BssDescからMACアドレスのみを取り出してMACアドレス指定で
// 親のスキャンから接続を行なう場合は特に問題ありませんが、保持されている
// BssDescを使って直に親機に接続を行なう場合には、通信サイズや転送モードを
// あらかじめ親子の間で合わせて設定しておく必要があります。
//--------------------------------------------------------------
/*
*
* WMBssDescは32バイトにアラインされている必要があります
* MACアドレスで再スキャンすることなしに再接続させる場合は
* /KS/CSフラグはあらかじめ合わせておいてください
* 0
*/
MB_ReadMultiBootParentBssDesc(&gMBParentBssDesc, WH_PARENT_MAX_SIZE, // 親機最大送信サイズ
WH_CHILD_MAX_SIZE, // 子機最大送信サイズ
0, // キーシェアリングフラグ
0); // 連続転送モードフラグ
// 親を再スキャンすること無しに、接続する場合には親機と子機でtgidを合わせる
// 必要があります。
// 親機は再起動後に無関係のIPLからの接続されるのを避ける為にtgidを変更し、
// 子機側もそれに合わせてtgidを変更する必要があります。
// このデモでは親機、子機ともにtgidを1インクリメントしています。
gMBParentBssDesc.gameInfo.tgid++;
WH_PrintBssDesc( &gMBParentBssDesc );
// 画面初期化
DispInit();
// ヒープの初期化
InitAllocateSystem();
// 割り込み有効
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
{ /* FS 初期化 */
static u32 fs_tablework[0x100 / 4];
FS_Init(FS_DMA_NOT_USE);
(void)FS_LoadTable(fs_tablework, sizeof(fs_tablework));
}
//********************************
// 無線初期化
if (!WH_Initialize())
{
OS_Panic("WH_Initialize failed.");
}
//********************************
// WH_SetSessionUpdateCallback(BlockTransferCallback);
// WH_SetGgid(WH_GGID);
// LCD表示開始
GX_DispOn();
GXS_DispOn();
// デバッグ文字列出力
OS_TPrintf("MB child: Simple DataSharing demo started.\n");
// キー入力情報取得の空呼び出し(IPL での A ボタン押下対策)
ReadKey();
/* メインルーチン */
for (gFrame = 0; TRUE; gFrame++)
{
// キー入力情報取得
ReadKey();
// スクリーンクリア
// BgClear();
// 通信状態により処理を振り分け
switch (WH_GetSystemState())
{
case WH_SYSSTATE_ERROR:
case WH_SYSSTATE_CONNECT_FAIL:
{
// WM_StartConnect()に失敗した場合にはWM内部のステートが不正になっている為
// 一度WM_ResetでIDLEステートにリセットする必要があります。
WH_Reset();
}
break;
case WH_SYSSTATE_IDLE:
{
static retry = 0;
enum
{
MAX_RETRY = 5
};
if (retry < MAX_RETRY)
{
ModeConnect();
retry++;
break;
}
// MAX_RETRYで親機に接続できなければERROR表示
}
// case WH_SYSSTATE_ERROR:
// ModeError();
break;
case WH_SYSSTATE_BUSY:
case WH_SYSSTATE_SCANNING:
ModeWorking();
break;
case WH_SYSSTATE_CONNECTED:
{
ModeChild();
}
break;
}
// 電波受信強度の表示
{
int level;
level = WH_GetLinkLevel();
BgPrintStr(31, 23, 0xf, "%d", level);
}
// Vブランク待ち
OS_WaitVBlankIntr();
}
}
/*---------------------------------------------------------------------------*
Name: ModeConnect
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void ModeConnect(void)
{
//#define USE_DIRECT_CONNECT
// 親機の再スキャンなしに直接接続する場合。
#ifdef USE_DIRECT_CONNECT
//********************************
(void)WH_ChildConnect(WH_CONNECTMODE_MP_CHILD, &gMBParentBssDesc);
// WH_SetReceiver(MpReceiveCallback);
// (void)WH_ChildConnect(WH_CONNECTMODE_DS_CHILD, &gMBParentBssDesc);
// WH_ChildConnect(WH_CONNECTMODE_MP_CHILD, &gMBParentBssDesc, TRUE);
// WH_ChildConnect(WH_CONNECTMODE_KS_CHILD, &gMBParentBssDesc, TRUE);
//********************************
#else
WH_SetGgid(gMBParentBssDesc.gameInfo.ggid);
// 親機の再スキャンを実行する場合。
//********************************
(void)WH_ChildConnectAuto(WH_CONNECTMODE_MP_CHILD, gMBParentBssDesc.bssid,
gMBParentBssDesc.channel);
// WH_ChildConnect(WH_CONNECTMODE_MP_CHILD, &gMBParentBssDesc, TRUE);
// WH_ChildConnect(WH_CONNECTMODE_KS_CHILD, &gMBParentBssDesc, TRUE);
//********************************
#endif
WH_SetReceiver(MpReceiveCallback);
}
/*---------------------------------------------------------------------------*
Name: ModeError
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void ModeError(void)
{
BgPrintStr(5, 10, 0x1, "======= ERROR! =======");
if (WH_GetLastError() == WM_ERRCODE_OVER_MAX_ENTRY)
{
BgPrintStr(5, 13, 0xf, "OVER_MAX_ENTRY");
}
}
/*---------------------------------------------------------------------------*
Name: ModeWorking
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void ModeWorking(void)
{
BgPrintStr(9, 11, 0xf, "Now working...");
if (IS_PAD_TRIGGER(PAD_BUTTON_START))
{
//********************************
(void)WH_Finalize();
//********************************
}
}
/*---------------------------------------------------------------------------*
Name: PulledOutCallback
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static BOOL PulledOutCallback(void)
{
return TRUE;
}

View File

@ -1,402 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: common.c
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <nitro.h>
#include <nitro/wm.h>
#include <nitro/mb.h>
#include "wh.h"
#include "common.h"
#include "disp.h"
#include "text.h"
#include "bt.h"
#define DEFAULT_CHAN 1
extern OSMessageQueue mesgQueue;
static void ModeSelect(void); // 親機/子機 選択画面
static void ModeStartParent(void); // 使用率が低いチャンネルを計算し終えた状態
// データ送信時に呼び出される関数
void ParentSendCallback(void);
void ChildSendCallback(void);
static void VBlankIntr(void);
/*
* 使.
*/
static u16 padPress;
static u16 padTrig;
// データ受信時に呼び出される関数
void ParentReceiveCallback(u16 aid, u16 *data, u16 length);
void ChildReceiveCallback(u16 aid, u16 *data, u16 length);
// ブロック転送状態通知関数
void BlockTransferCallback(void *arg);
// 表示用送受信バッファ
static u8 gSendBuf[256] ATTRIBUTE_ALIGN(32);
u8 gRecvBuf[1 + WM_NUM_MAX_CHILD][256] ATTRIBUTE_ALIGN(32);
static BOOL gRecvFlag[1 + WM_NUM_MAX_CHILD];
static u32 send_counter[16];
static u32 recv_counter[16];
TEXT_CTRL *tc[NUM_OF_SCREEN];
static BOOL gFirstSendAtChild;
static BOOL wbt_available = FALSE;
static u16 connected_bitmap = 0;
/*---------------------------------------------------------------------------*
Name: ReadKey
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ReadKey(void)
{
u16 currData = PAD_Read();
padTrig = (u16)(~padPress & currData);
padPress = currData;
}
/*---------------------------------------------------------------------------*
Name: GetPressKey
Description:
Arguments: None
Returns:
*---------------------------------------------------------------------------*/
u16 GetPressKey(void)
{
return padPress;
}
/*---------------------------------------------------------------------------*
Name: GetTrigKey
Description:
Arguments: None
Returns:
*---------------------------------------------------------------------------*/
u16 GetTrigKey(void)
{
return padTrig;
}
/*---------------------------------------------------------------------------*
Name: CommonInit
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void CommonInit(void)
{
/* OS 初期化 */
OS_Init();
OS_InitTick();
OS_InitAlarm();
OS_InitThread();
FX_Init();
CARD_Init();
/* GX 初期化 */
GX_Init();
GX_DispOff();
GXS_DispOff();
/* Vブランク割込設定 */
(void)OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
(void)GX_VBlankIntr(TRUE);
// キーを一回空読み
ReadKey();
}
/*---------------------------------------------------------------------------*
Name: InitAllocateSystem
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void InitAllocateSystem(void)
{
void *tempLo;
OSHeapHandle hh;
// OS_Initは呼ばれているという前提
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");
}
hh = OS_SetCurrentHeap(OS_ARENA_MAIN, hh);
}
/*---------------------------------------------------------------------------*
Name: VBlankIntr
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void VBlankIntr(void)
{
DispVBlankFunc();
//---- 割り込みチェックフラグ
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
}
/*---------------------------------------------------------------------------*
Name: MpSendCallback
Description: MPデータ送信後に呼び出される関数
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void MpSendCallback(BOOL result)
{
#pragma unused( result )
CARDRomHeader* rh = (void*)CARD_GetRomHeader();
u32 rh_size = sizeof(CARDRomHeaderNTR);
u32 limit = rh->rom_size + CARD_ROM_PAGE_SIZE;
u32 offset = WH_CHILD_SIZE * send_counter[0];
BgSetMessage(PLTT_YELLOW, " Sending: ROM addr=0x%x", offset);
if ( offset < limit )
{
if ( offset < rh_size )
{
u32 rem = rh_size%WH_CHILD_SIZE;
MI_CpuCopy8( &((u8*)rh)[offset], gSendBuf, WH_CHILD_SIZE );
if ( offset >= MATH_ROUNDDOWN(rh_size, WH_CHILD_SIZE) )
{
MI_CpuFill8( &gSendBuf[rem], 0, WH_CHILD_SIZE - rem );
}
}
else
if ( offset < CARD_GAME_AREA_OFFSET )
{
MI_CpuFill8(gSendBuf, 0, WH_CHILD_SIZE);
}
else
{
CARD_ReadRom( MI_DMA_NOT_USE, (void*)offset, gSendBuf, WH_CHILD_SIZE );
}
gSendBuf[WH_CHILD_SIZE] = FALSE;
if ( (offset + WH_CHILD_SIZE) >= limit )
{
gSendBuf[WH_CHILD_SIZE] = TRUE;
}
(void)WH_SendData(gSendBuf, WH_CHILD_MAX_SIZE, NULL);
send_counter[0]++;
}
else
{
BgSetMessage(PLTT_RED, " Sent ROM size=0x%x ", MATH_ROUNDUP(limit, WH_CHILD_SIZE) - CARD_GAME_AREA_OFFSET);
}
}
/*---------------------------------------------------------------------------*
Name: MpReceiveCallback
Description: MPデータ受信時に呼び出される関数
Arguments: aid - aid( 0 )
data - (NULL )
length -
Returns: None.
*---------------------------------------------------------------------------*/
void MpReceiveCallback(u16 aid, u16 *data, u16 length)
{
SDK_MAX_ASSERT(aid, 15);
// 子機
if ( MB_IsMultiBootChild() )
{
if (aid == 0)
{
if (data && *data == TRUE)
{
MpSendCallback( TRUE );
}
}
return;
}
// 親機
if (data != NULL)
{
gRecvFlag[aid] = TRUE;
// コピー元は2バイトアライン(4バイトアラインでない)
if (aid == 0)
{
// 親機から受信した場合
MI_CpuCopy8(data, &gRecvBuf[aid][0], length);
}
else
{
static u32 offset = CARD_GAME_AREA_OFFSET;
offset += WH_CHILD_SIZE;
MI_CpuCopy8(data, &gRecvBuf[aid][0], length);
BgSetMessage(PLTT_YELLOW, " Receiving: ROM addr=0x%x", offset);
if ( gRecvBuf[aid][WH_CHILD_SIZE] == TRUE )
{
BgSetMessage(PLTT_RED, " Received ROM size=0x%x ", offset - CARD_GAME_AREA_OFFSET);
}
(void)OS_SendMessage(&mesgQueue, (OSMessage)&gRecvBuf[aid][0], OS_MESSAGE_BLOCK);
}
}
else
{
gRecvFlag[aid] = FALSE;
}
}
/*---------------------------------------------------------------------------*
Name: ModeSelect
Description: /
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void ModeSelect(void)
{
// カウンタクリア
MI_CpuClear(send_counter, sizeof(send_counter));
MI_CpuClear(recv_counter, sizeof(recv_counter));
if (!MB_IsMultiBootChild())
{
BgSetMessage(PLTT_YELLOW, " Connect as PARENT");
//********************************
(void)WH_ParentConnect(WH_CONNECTMODE_MP_PARENT, 0x0000, DEFAULT_CHAN); // WH_GetMeasureChannel()
WH_SetReceiver(MpReceiveCallback);
//********************************
}
else
{
static const u8 ANY_PARENT[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
BgSetMessage(PLTT_YELLOW, " Connect as CHILD");
//********************************
(void)WH_ChildConnectAuto(WH_CONNECTMODE_MP_CHILD, ANY_PARENT, DEFAULT_CHAN);
//********************************
}
}
/*---------------------------------------------------------------------------*
Name: ModeParent
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void ModeParent(void)
{
BgPutString(6, 1, PLTT_RED, "Card Copy Multi Boot");
BgPrintStr(11, 3, PLTT_YELLOW, "Parent mode");
// BgPrintStr(4, 3, 0x4, "Send: %08X", gSendBuf[0]);
BgPrintStr(4, 5, 0x4, "Receive:");
{
s32 i;
for (i = 1; i < (WM_NUM_MAX_CHILD + 1); i++)
{
if (gRecvFlag[i])
{
BgPrintStr(5, (s16)(6 + i), 0x4, "Child%02d: %08X", i, gRecvBuf[i][0]);
}
else
{
BgPrintStr(5, (s16)(6 + i), 0x7, "No child");
}
}
}
}
/*---------------------------------------------------------------------------*
Name: ModeChild
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void ModeChild(void)
{
BgPutString(6, 1, PLTT_RED, "Card Copy Multi Boot");
BgPutString(11, 3, PLTT_YELLOW, "Child mode");
if ( !gFirstSendAtChild )
{
BgSetMessage(PLTT_WHITE, " Push A Button to start ");
}
if ( !gFirstSendAtChild ) // (GetTrigKey() & PAD_BUTTON_A) )
{
MpSendCallback( TRUE );
gFirstSendAtChild = TRUE;
}
}

View File

@ -1,445 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: disp.c
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
//----------------------------------------------------------------------
// 文字列表示の基本的な機能.
//----------------------------------------------------------------------
#include <nitro.h>
#include "disp.h"
//============================================================================
// プロトタイプ宣言
//============================================================================
static void VramClear(void);
static void ObjInitForPrintStr(void);
static void BgInitForPrintStr(void);
//============================================================================
// 定数定義
//============================================================================
#define BGSTR_MAX_LENGTH 32
//============================================================================
// 変数定義
//============================================================================
/* 仮想スクリーン */
static u16 vscr[32 * 32];
/* V ブランク転送用テンポラリ OAM */
static GXOamAttr oamBak[128];
/* 各種描画用 */
extern const u32 sampleFontCharData[8 * 0xe0];
extern const u16 samplePlttData[16][16];
//============================================================================
// 関数定義
//============================================================================
/*---------------------------------------------------------------------------*
Name: BgInitForPrintStr
Description: BG文字描画の初期化 (BG0固定, VRAM-C, BGモード0)
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void BgInitForPrintStr(void)
{
GX_SetBankForBG(GX_VRAM_BG_128_C);
G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, GX_BG_COLORMODE_16, GX_BG_SCRBASE_0xf800, /* SCR ベースブロック 31 */
GX_BG_CHARBASE_0x00000, /* CHR ベースブロック 0 */
GX_BG_EXTPLTT_01);
G2_SetBG0Priority(0);
G2_BG0Mosaic(FALSE);
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D);
G2_SetBG0Offset(0, 0);
GX_LoadBG0Char(sampleFontCharData, 0, sizeof(sampleFontCharData));
GX_LoadBGPltt(samplePlttData, 0, sizeof(samplePlttData));
MI_CpuFillFast((void *)vscr, 0, sizeof(vscr));
DC_FlushRange(vscr, sizeof(vscr));
DC_WaitWriteBufferEmpty();
GX_LoadBG0Scr(vscr, 0, sizeof(vscr));
}
/*---------------------------------------------------------------------------*
Name: ObjInitForPrintStr
Description: OBJの初期化 (VRAM-B, 2Dモード)
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void ObjInitForPrintStr(void)
{
GX_SetBankForOBJ(GX_VRAM_OBJ_128_B);
GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_2D);
MI_DmaFill32(3, oamBak, 0xc0, sizeof(oamBak));
GX_LoadOBJ(sampleFontCharData, 0, sizeof(sampleFontCharData));
GX_LoadOBJPltt(samplePlttData, 0, sizeof(samplePlttData));
}
/*---------------------------------------------------------------------------*
Name: VramClear
Description: VRAMクリア
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
static void VramClear(void)
{
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
(void)GX_DisableBankForLCDC();
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE);
MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE);
MI_CpuFillFast((void *)HW_DB_OAM, 192, HW_DB_OAM_SIZE);
MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE);
}
/*---------------------------------------------------------------------------*
Name: DispInit
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void DispInit(void)
{
/* 描画設定初期化 */
VramClear();
// OBJ初期化
ObjInitForPrintStr();
// BG初期化
BgInitForPrintStr();
GX_SetVisiblePlane(GX_PLANEMASK_BG0 | GX_PLANEMASK_OBJ);
}
/*---------------------------------------------------------------------------*
Name: DispOn
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void DispOn(void)
{
/* 表示開始 */
GX_DispOn();
GXS_DispOn();
}
/*---------------------------------------------------------------------------*
Name: DispOff
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void DispOff(void)
{
/* 表示開始 */
GX_DispOff();
GXS_DispOff();
}
/*---------------------------------------------------------------------------*
Name: DispVBlankFunc
Description: VBlank処理
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void DispVBlankFunc(void)
{
//---- OAMの更新
DC_FlushRange(oamBak, sizeof(oamBak));
/* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */
// DC_WaitWriteBufferEmpty();
MI_DmaCopy32(3, oamBak, (void *)HW_OAM, sizeof(oamBak));
//---- BGスクリーン更新
DC_FlushRange(vscr, sizeof(vscr));
/* DMA操作でIOレジスタへアクセスするのでキャッシュの Wait は不要 */
// DC_WaitWriteBufferEmpty();
GX_LoadBG0Scr(vscr, 0, sizeof(vscr));
}
/*---------------------------------------------------------------------------*
Name: ObjSet
Description: OBJの描画設定
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ObjSet(s32 objNo, s32 x, s32 y, s32 charNo, s32 paletteNo)
{
G2_SetOBJAttr((GXOamAttr *)&oamBak[objNo],
x,
y,
0,
GX_OAM_MODE_NORMAL,
FALSE,
GX_OAM_EFFECT_NONE, GX_OAM_SHAPE_8x8, GX_OAM_COLOR_16, charNo, paletteNo, 0);
}
/*---------------------------------------------------------------------------*
Name: ObjSetString
Description: OBJで文字を描画
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ObjSetString(s32 startobjNo, s32 x, s32 y, const char *string, s32 paletteNo)
{
s32 i;
for (i = 0; (string[i] != '\0') && (i < 24); i++)
{
ObjSet(startobjNo + i, x + i * 8, y, (s32)string[i], paletteNo);
}
}
/*---------------------------------------------------------------------------*
Name: ObjClear
Description: OBJ
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ObjClear(s32 objNo)
{
ObjSet(objNo, 256 * 8, 192 * 8, 0, 0);
}
/*---------------------------------------------------------------------------*
Name: ObjClearRange
Description: OBJ ()
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ObjClearRange(s32 start, s32 end)
{
s32 i;
for (i = start; i <= end; i++)
{
ObjClear(i);
}
}
/*---------------------------------------------------------------------------*
Name: ObjSetMessage
Description: ( 24)
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void ObjSetMessage(const char *message)
{
ObjSetString(MESSAGE_OBJNO, 4 * 8, 22 * 8, message, 7);
}
/*---------------------------------------------------------------------------*
Name: BgPutStringN
Description: BGのN文字出力
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgPutStringN(s32 x, s32 y, s32 palette, const char *text, s32 num)
{
s32 i;
if (num > BGSTR_MAX_LENGTH)
{
num = BGSTR_MAX_LENGTH;
}
for (i = 0; i < num; i++)
{
if (text[i] == '\0')
{
break;
}
BgPutChar(x + i, y, palette, text[i]);
}
}
/*---------------------------------------------------------------------------*
Name: BgPutChar
Description: BG文字出力
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgPutChar(s32 x, s32 y, s32 palette, s8 c)
{
vscr[((y * 32) + x) % (32 * 32)] = (u16)((palette << 12) | c);
}
/*---------------------------------------------------------------------------*
Name: BgPutString
Description: BG 32
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgPutString(s32 x, s32 y, s32 palette, const char *text)
{
BgPutStringN(x, y, palette, text, BGSTR_MAX_LENGTH);
}
/*---------------------------------------------------------------------------*
Name: BgPrintStr
Description: BG
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgPrintStr(s32 x, s32 y, s32 palette, const char *text, ...)
{
char temp[(BGSTR_MAX_LENGTH + 1) * 2];
va_list vlist;
MI_CpuClear8(temp, sizeof(temp));
va_start(vlist, text);
(void)vsnprintf(temp, sizeof(temp) - 1, text, vlist);
va_end(vlist);
BgPutString(x, y, palette, temp);
}
/*---------------------------------------------------------------------------*
Name: BgSetMessage
Description: BGメッセージセット
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgSetMessage(s32 palette, const char *text, ...)
{
char temp[(BGSTR_MAX_LENGTH + 1) * 2];
va_list vlist;
MI_CpuClear8(temp, sizeof(temp));
va_start(vlist, text);
(void)vsnprintf(temp, sizeof(temp) - 1, text, vlist);
va_end(vlist);
BgPutString(4, 22, palette, temp);
}
/*---------------------------------------------------------------------------*
Name: BgClear
Description: BGクリア
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void BgClear(void)
{
MI_CpuClearFast(vscr, sizeof(vscr));
}
/*---------------------------------------------------------------------------*
Name: BgColorString
Description:
Arguments: x - x ( × 8 )
y - y ( × 8 )
length -
palette -
Returns: None.
*---------------------------------------------------------------------------*/
void BgColorString(s16 x, s16 y, s16 length, u8 palette)
{
s32 i;
u16 temp;
s32 index;
if (length < 0)
{
return;
}
for (i = 0; i < length; i++)
{
index = ((y * 32) + x + i) % (32 * 32);
temp = vscr[index];
temp &= 0x0fff;
temp |= (palette << 12);
vscr[index] = temp;
}
}

View File

@ -1,552 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
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.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <nitro.h>
/*---------------------- パレットデータ ---------------------------*/
#define RGB555(r,g,b) ( (b) << 10 | (g) <<5 | (r) )
const u16 samplePlttData[16][16] = {
{RGB555(0, 0, 0), RGB555(0, 0, 0), RGB555(0, 0, 0), RGB555(0, 0, 0),}, // Black
{RGB555(31, 31, 31), RGB555(0, 0, 31), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue
{RGB555(31, 31, 31), RGB555(31, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // Red
{RGB555(31, 31, 31), RGB555(31, 0, 31), RGB555(31, 0, 31), RGB555(31, 0, 31),}, // Purple
{RGB555(31, 31, 31), RGB555(0, 31, 0), RGB555(0, 31, 0), RGB555(0, 31, 0),}, // Green
{RGB555(31, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31),}, // Cyan
{RGB555(31, 31, 31), RGB555(31, 31, 0), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // Yellow
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
};
/*---------------------- フォントデータ -------------------------*/
const u32 sampleFontCharData[8 * 0x100] = {
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
};

View File

@ -1,97 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: main.c
Copyright 2005-2009 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$
*---------------------------------------------------------------------------*/
#ifdef SDK_TWL
#include <twl.h>
#else
#include <nitro.h>
#endif
#include "common.h"
/*
* .
*
* MBライブラリのサンプルはマルチブート機能を使うため
* ()
* $TwlSDK/bin/ARM9-TS/Rom/
* mb_child_NITRO.srl, mb_child_TWL.srl
*
*
*
*
*/
/*
* WH 使
*
* WH
* WH
* wm/dataShare-Model
*/
/******************************************************************************/
//============================================================================
// 関数定義
//============================================================================
/*---------------------------------------------------------------------------*
Name: NitroMain / TwlMain
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
#ifdef SDK_TWL
void TwlMain(void)
#else
void NitroMain(void)
#endif
{
/*
* , multiboot-Model 使
* DSダウンロードプレイ子機プログラムかどうかを判断して
* .
*
*
* 1. CARD
* 2. 8kB
* 3. /
* .
*
*
*
* CARD-ROM .
* , DSダウンロードプレイの親機と子機の間に全く共通点が無ければ
* .
*/
if (!MB_IsMultiBootChild())
{
ParentMain();
}
else
{
ChildMain();
}
/* 制御はここへ及びません */
}

View File

@ -1,585 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - MB - demos - cloneboot
File: parent.c
Copyright 2006-2009 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 <nitro/wm.h>
#include <nitro/mb.h>
#include "mbp.h"
#include "common.h"
#include "disp.h"
#include "gmain.h"
#include "wh.h"
#include "bt.h"
/******************************************************************************/
void sd_proc(void *p1);
static void GetChannelMain(void);
static BOOL ConnectMain(u16 tgid);
static void PrintChildState(void);
static BOOL JudgeConnectableChild(WMStartParentCallback *cb);
// ブロック転送状態通知関数
void BlockTransferCallback(void *arg);
//============================================================================
// 定数定義
//============================================================================
#define STACK_SIZE 1024
#define THREAD1_PRIO 15
#define MESSAGE_RECV (OSMessage)100
/* このデモで使用する GGID */
#define WH_GGID SDK_MAKEGGID_SYSTEM(0x22)
/* このデモがダウンロードさせるプログラム情報 */
const MBGameRegistry mbGameList = {
/*
* NULL .
* MBP MBP_RegistFile() ,
* MB_RegisterFile() .
*/
NULL,
(u16 *)L"CardCopyMultiBoot", // ゲーム名
(u16 *)L"CardCopyMultiBoot(cloneboot)", // ゲーム内容説明
"/data/icon.char", // アイコンキャラクタデータ
"/data/icon.plt", // アイコンパレットデータ
WH_GGID, // GGID
MBP_CHILD_MAX + 1, // 最大プレイ人数、親機の数も含めた人数
};
//============================================================================
// 変数定義
//============================================================================
OSThread sd_thread;
u32 stack1[STACK_SIZE / sizeof(u32)];
OSMessage mesgBuffer[10];
OSMessageQueue mesgQueue;
FSFile file;
BOOL writable = TRUE;
static s32 gFrame; // フレームカウンタ
extern u8 gRecvBuf[];
//-----------------------
// 通信経路の保持用
//-----------------------
static u16 sChannel = 0;
static const MBPChildInfo *sChildInfo[MBP_CHILD_MAX];
//============================================================================
// 関数定義
//============================================================================
void sd_proc(void *p1)
{
#pragma unused(p1)
OSMessage src;
while (1)
{
writable = TRUE;
(void)WH_SendData(&writable, sizeof(writable), NULL);
(void)OS_ReceiveMessage(&mesgQueue, &src, OS_MESSAGE_BLOCK);
writable = FALSE;
if (FS_WriteFile(&file, (void*)src, WH_CHILD_SIZE) == -1)
{
BgPutString(8, 3, 0x2, "Write SD File error!");
OS_WaitVBlankIntr();
OS_Terminate();
}
if ( ((u8*)src)[WH_CHILD_SIZE] == TRUE )
{
(void)FS_CloseFile(&file);
}
}
}
/*****************************************************************************/
/* 親機専用領域 .parent セクションの定義範囲を開始します */
#include <nitro/parent_begin.h>
/*****************************************************************************/
/*---------------------------------------------------------------------------*
Name: ParentMain
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void ParentMain(void)
{
FSFile dir;
u16 tgid = 0;
// 画面、OSの初期化
CommonInit();
// 画面初期化
DispInit();
// ヒープの初期化
InitAllocateSystem();
// WH に情報を設定
WH_SetGgid(WH_GGID);
// 割り込み有効
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
DispOn();
// FS 初期化
{
static u32 fs_tablework[0x100 / 4];
FS_Init(FS_DMA_NOT_USE);
(void)FS_LoadTable(fs_tablework, sizeof(fs_tablework));
}
FS_InitFatDriver();
{
static const char *path = "sdmc:/card_dump.sbin";
FS_InitFile(&file);
(void)FS_OpenDirectory(&dir, "sdmc:/", FS_FILEMODE_RW);
(void)FS_CreateFile(path, FS_PERMIT_R|FS_PERMIT_W);
if (!FS_OpenFileEx(&file, path, FS_FILEMODE_RW))
{
BgPutString(8, 1, 0x2, "Cannot open writable SD File!");
OS_WaitVBlankIntr();
OS_Terminate();
}
(void)FS_SetFileLength(&file, 0);
}
while (TRUE)
{
OS_WaitVBlankIntr();
// トラフィックの少ないチャンネルの検索処理
GetChannelMain();
/*
* tgidは親機が起動の度に基本的には前回と違う値を設定します
* tgidで起動しなければ
*
* tgidを保存しておく
*
*/
// マルチブート配信処理
if (ConnectMain(++tgid))
{
// マルチブート子機の起動に成功
break;
}
else
{
// WH モジュールを終了させて繰り返し
WH_Finalize();
while(WH_GetSystemState()==WH_SYSSTATE_BUSY){}
(void)WH_End();
while(WH_GetSystemState()==WH_SYSSTATE_BUSY){}
}
}
//--------------
// マルチブート後は子機がリセットされ通信が一旦切断されます。
// また現状親機も一度MB_End()から通信を終了する必要があります。
// 親子共一度完全に切断された状態で一から通信を確立してください。
//
// またこの時子機のaidがシャッフルされるため、もし必要があれば
// マルチブート前のaidとMACアドレスの組み合わせを保存しておき、
// 再接続時に新しいaidとの結びつけを行なってください。
//--------------
#if !defined(MBP_USING_MB_EX)
if (!WH_Initialize())
{
OS_Panic("WH_Initialize failed.");
}
#endif
// 接続子機の判定用関数を設定
WH_SetJudgeAcceptFunc(JudgeConnectableChild);
// SDスレッド生成
OS_InitMessageQueue(&mesgQueue, &mesgBuffer[0], 10);
OS_CreateThread(&sd_thread, sd_proc, NULL, stack1 + STACK_SIZE / sizeof(u32), STACK_SIZE, THREAD1_PRIO);
/* メインルーチン */
while (TRUE)
{
OS_WaitVBlankIntr();
ReadKey();
// BgClear();
switch (WH_GetSystemState())
{
case WH_SYSSTATE_ERROR:
case WH_SYSSTATE_CONNECT_FAIL:
WH_Reset();
break;
case WH_SYSSTATE_IDLE:
/* ----------------
*
* tgid及びchannelを合わせる必要があります
* channelとマルチブート時のtgid+1
* 使
*
* MACアドレスを指定して再スキャンさせる場合には同じtgid, channelでなくても
*
* ---------------- */
(void)WH_ParentConnect(WH_CONNECTMODE_MP_PARENT, (u16)(tgid + 1), sChannel);
WH_SetReceiver(MpReceiveCallback);
// SDスレッド起動
OS_WakeupThreadDirect(&sd_thread);
break;
case WH_SYSSTATE_CONNECTED:
{
BgPutString(8, 1, 0x2, "Parent mode");
// ModeChild();
}
break;
}
// 子機状態を表示する
ModeParent();
}
}
/*---------------------------------------------------------------------------*
Name: GetChannelMain
Description: 使使調
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void GetChannelMain(void)
{
/*-----------------------------------------------*
* 使調
* 使
* WM_MeasureChannel()IDLE状態になる必要があり
* IDLE状態に止まる事がないので実行できません
* WM_Initializeを呼んで電波使用率を調べてからWM_Endで終了し
* MB_Initを実行する
*-----------------------------------------------*/
if (!WH_Initialize())
{
OS_Panic("WH_Initialize failed.");
}
while (TRUE)
{
ReadKey();
BgClear();
BgSetMessage(PLTT_YELLOW, " Search Channel ");
switch (WH_GetSystemState())
{
//-----------------------------------------
// 初期化完了
case WH_SYSSTATE_IDLE:
// BgSetMessage(PLTT_WHITE, " Push A Button to start ");
// if (IS_PAD_TRIGGER(PAD_BUTTON_A))
{
BgSetMessage(PLTT_YELLOW, "Check Traffic ratio ");
(void)WH_StartMeasureChannel();
}
break;
//-----------------------------------------
// チャンネル検索完了
case WH_SYSSTATE_MEASURECHANNEL:
{
sChannel = WH_GetMeasureChannel();
#if !defined(MBP_USING_MB_EX)
(void)WH_End();
#else
/* IDLE 状態を維持したままマルチブート処理へ */
return;
#endif
}
break;
//-----------------------------------------
// WM終了
case WH_SYSSTATE_STOP:
/* WM_Endが完了したらマルチブート処理へ */
return;
//-----------------------------------------
// ビジー中
case WH_SYSSTATE_BUSY:
break;
//-----------------------------------------
// エラー発生
case WH_SYSSTATE_ERROR:
(void)WH_Reset();
break;
//-----------------------------------------
default:
OS_Panic("Illegal State\n");
}
OS_WaitVBlankIntr(); // Vブランク割込終了待ち
}
}
/*---------------------------------------------------------------------------*
Name: ConnectMain
Description:
Arguments: tgid tgidを指定します.
Returns: TRUE,
FALSE
*---------------------------------------------------------------------------*/
static BOOL ConnectMain(u16 tgid)
{
MBP_Init(mbGameList.ggid, tgid);
while (TRUE)
{
ReadKey();
BgClear();
BgPutString(6, 1, PLTT_RED, "Card Copy Multi Boot");
BgSetMessage(PLTT_YELLOW, " MB Parent ");
switch (MBP_GetState())
{
//-----------------------------------------
// アイドル状態
case MBP_STATE_IDLE:
{
MBP_Start(&mbGameList, sChannel);
}
break;
//-----------------------------------------
// 子機からのエントリー受付中
case MBP_STATE_ENTRY:
{
BgSetMessage(PLTT_YELLOW, " Wait for list on MB menu ");
// BgSetMessage(PLTT_WHITE, " Now Accepting ");
if (IS_PAD_TRIGGER(PAD_BUTTON_B))
{
// Bボタンでマルチブートキャンセル
// MBP_Cancel();
break;
}
// エントリー中の子機が一台でも存在すれば開始可能とする
if (MBP_GetChildBmp(MBP_BMPTYPE_ENTRY) ||
MBP_GetChildBmp(MBP_BMPTYPE_DOWNLOADING) ||
MBP_GetChildBmp(MBP_BMPTYPE_BOOTABLE))
{
BgSetMessage(PLTT_WHITE, " Push START Button to start ");
// if (IS_PAD_TRIGGER(PAD_BUTTON_START))
{
// ダウンロード開始
MBP_StartDownloadAll();
}
}
}
break;
//-----------------------------------------
// プログラム配信処理
case MBP_STATE_DATASENDING:
{
// 全員がダウンロード完了しているならばスタート可能.
if (MBP_IsBootableAll())
{
// ブート開始
MBP_StartRebootAll();
}
}
break;
//-----------------------------------------
// リブート処理
case MBP_STATE_REBOOTING:
{
BgSetMessage(PLTT_WHITE, " Rebooting now ");
}
break;
//-----------------------------------------
// 再接続処理
case MBP_STATE_COMPLETE:
{
// 全員無事に接続完了したらマルチブート処理は終了し
// 通常の親機として無線を再起動する。
BgSetMessage(PLTT_WHITE, " Reconnecting now ");
OS_WaitVBlankIntr();
return TRUE;
}
break;
//-----------------------------------------
// エラー発生
case MBP_STATE_ERROR:
{
// 通信をキャンセルする
MBP_Cancel();
}
break;
//-----------------------------------------
// 通信キャンセル処理中
case MBP_STATE_CANCEL:
// None
break;
//-----------------------------------------
// 通信異常終了
case MBP_STATE_STOP:
OS_WaitVBlankIntr();
return FALSE;
}
// 子機状態を表示する
PrintChildState();
OS_WaitVBlankIntr(); // Vブランク割込終了待ち
}
}
/*---------------------------------------------------------------------------*
Name: PrintChildState
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void PrintChildState(void)
{
static const char *STATE_NAME[] = {
"NONE ",
"CONNECTING ",
"REQUEST ",
"ENTRY ",
"DOWNLOADING",
"BOOTABLE ",
"BOOTING ",
};
enum
{
STATE_DISP_X = 2,
INFO_DISP_X = 15,
BASE_DISP_Y = 2
};
u16 i;
/* 子機リストの表示 */
for (i = 1; i <= MBP_CHILD_MAX; i++)
{
const MBPChildInfo *childInfo;
MBPChildState childState = MBP_GetChildState(i);
const u8 *macAddr;
SDK_ASSERT(childState < MBP_CHILDSTATE_NUM);
// 状態表示
BgPutString(STATE_DISP_X, i + BASE_DISP_Y, PLTT_WHITE, STATE_NAME[childState]);
// ユーザー情報表示
childInfo = MBP_GetChildInfo(i);
macAddr = MBP_GetChildMacAddress(i);
if (macAddr != NULL)
{
BgPrintStr(INFO_DISP_X, i + BASE_DISP_Y, PLTT_WHITE,
"%02x%02x%02x%02x%02x%02x",
macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]);
}
}
}
/*---------------------------------------------------------------------------*
Name: JudgeConnectableChild
Description:
Arguments: cb .
Returns: TRUE.
FALSE.
*---------------------------------------------------------------------------*/
static BOOL JudgeConnectableChild(WMStartParentCallback *cb)
{
u16 playerNo;
/* cb->aid の子機のマルチブート時のaidをMACアドレスから検索します */
playerNo = MBP_GetPlayerNo(cb->macAddress);
OS_TPrintf("MB child(%d) -> MP child(%d)\n", playerNo, cb->aid);
if (playerNo == 0)
{
return FALSE;
}
sChildInfo[playerNo - 1] = MBP_GetChildInfo(playerNo);
return TRUE;
}
/*****************************************************************************/
/* 親機専用領域 .parent セクションの定義範囲を終了します */
#include <nitro/parent_end.h>
/*****************************************************************************/

View File

@ -1,385 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - WBT - demos - wbt-1
File: text.c
Copyright 2006-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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifdef SDK_TWL
#include <twl.h>
#else
#include <nitro.h>
#endif
#include "text.h"
#define TAB_SIZE 8
/*****************************************************/
static LINE_BUF *lb_free_ptr;
static int x_size = X_LINE_MAX;
static int y_size = Y_LINE_MAX;
static void link_line_buf(LINE_BUF * m, LINE_BUF * s)
{
if (m->next != NULL)
{
s->next = m->next;
(s->next)->prev = s;
}
else
s->next = NULL;
m->next = s;
s->prev = m;
}
static void unlink_line_buf(LINE_BUF * s)
{
if ((s->prev != NULL) && (s->next != NULL))
{
(s->prev)->next = s->next;
(s->next)->prev = s->prev;
s->next = NULL;
s->prev = NULL;
}
else if (s->next != NULL)
{
s->prev = NULL;
(s->next)->prev = NULL;
s->next = NULL;
}
else if (s->prev != NULL)
{
s->next = NULL;
(s->prev)->next = NULL;
s->prev = NULL;
}
}
static LINE_BUF *alloc_line_buf(void)
{
LINE_BUF *tmp;
tmp = lb_free_ptr;
lb_free_ptr = lb_free_ptr->next;
unlink_line_buf(tmp);
tmp->last_count = 0;
tmp->cur_count = 0;
#if 0
for (i = 0; i < LINE_BUF_X_SIZE; i++)
tmp->buf[i] = 0x20;
#endif
return (tmp);
}
static void free_line_buf(LINE_BUF * lb)
{
lb->next = lb_free_ptr;
lb->prev = NULL;
(lb->next)->prev = lb;
lb_free_ptr = lb;
}
static int init_lb_heap(void *heap_start, void *heap_end)
{
int i;
LINE_BUF *lb_heap = (LINE_BUF *) heap_start;
lb_free_ptr = (LINE_BUF *) heap_start;
lb_heap[0].prev = NULL;
i = 0;
while ((u32)&(lb_heap[i + 1]) < (u32)heap_end)
{
link_line_buf(&(lb_heap[i]), &(lb_heap[i + 1]));
i++;
}
lb_heap[i].next = NULL;
return i; /* num of line buffer */
}
static void init_text_buf(TEXT_BUF * tb)
{
tb->num_y = &y_size;
tb->num_x = &x_size;
tb->start = tb->cur = alloc_line_buf();
}
void init_text(TEXT_CTRL * tc, u16 *screen, u16 palette)
{
tc->screen = screen;
tc->x_line = 0;
tc->y_line = 0;
tc->palette = palette;
init_text_buf(&(tc->text_buf));
}
void m_set_palette(TEXT_CTRL * tc, u16 num)
{
tc->palette = (u16)(0x0f & num);
}
u16 m_get_palette(TEXT_CTRL * tc)
{
return tc->palette;
}
static void clear_line(TEXT_CTRL * tc)
{
int i;
i = tc->x_line;
for (; i < X_LINE_MAX; i++)
tc->screen[(tc->y_line * X_LINE_MAX) + i] = 0;
}
static void add_y_line(TEXT_CTRL * tc, u16 num)
{
tc->y_line += num;
if (tc->y_line > Y_LINE_MAX)
{
tc->y_line = 0;
}
}
static void add_x_line(TEXT_CTRL * tc, u16 num)
{
tc->x_line += num;
if (tc->x_line > X_LINE_MAX)
{
tc->x_line = 0;
tc->y_line++;
if (tc->y_line > Y_LINE_MAX)
{
tc->y_line = 0;
}
}
}
static void put_char_vram(TEXT_CTRL * tc, int c, u16 col)
{
switch (c)
{
case '\0':
break;
case '\n':
clear_line(tc);
tc->x_line = 0;
add_y_line(tc, 1);
break;
case '\r':
tc->x_line = 0;
break;
case '\t':
add_x_line(tc, TAB_SIZE);
break;
case '\f':
tc->x_line = 0;
tc->y_line = 0;
clear_line(tc);
break;
case '\b': /* Back Space */
case '\v': /* Vertical Tab */
break;
default:
if ((c < 0x20) || (0x7f < c))
c = 0x20; /* white space */
tc->screen[(tc->y_line * X_LINE_MAX) + tc->x_line] = (u16)((col << 12) | (0x00ff & c));
add_x_line(tc, 1);
}
}
/**********************/
void m_putchar(TEXT_CTRL * tc, int c)
{
int i;
LINE_BUF *tmp;
TEXT_BUF *tb = &(tc->text_buf);
switch (c)
{
case '\0':
break;
case '\n':
if (tb->cur->next == NULL)
{
tmp = tb->cur; /* 表示開始バッファを再計算 */
for (i = 0; i < *(tb->num_y) - 1 && i < LINE_BUF_Y_SIZE; i++)
{
if (tmp->prev == NULL)
break;
tmp = tmp->prev;
}
tb->start = tmp;
while (tmp->prev != NULL)
{ /* いらないバッファを解放 */
tmp = tmp->prev;
unlink_line_buf(tmp);
free_line_buf(tmp);
}
tmp = alloc_line_buf(); /* バッファを1つ取得 */
link_line_buf(tb->cur, tmp); /* 取得したバッファをカレント
*/
tb->cur = tmp; /* カレントバッファを更新 */
tb->cur->cur_count = 0;
tb->cur->last_count = 0;
}
else
{
tb->cur = tb->cur->next;
tb->cur->cur_count = 0;
tb->cur->last_count = 0;
}
break;
case '\r':
tb->cur->cur_count = 0;
break;
case '\t':
tb->cur->cur_count += TAB_SIZE;
if (tb->cur->cur_count > LINE_BUF_X_SIZE)
tb->cur->cur_count = LINE_BUF_X_SIZE;
if (tb->cur->cur_count > tb->cur->last_count)
tb->cur->last_count = tb->cur->cur_count;
break;
case '\f':
tb->cur = tb->start;
tb->cur->cur_count = 0;
tb->cur->last_count = 0;
break;
case '\a': /* BELL */
break;
case '\b': /* Back Space */
if (tb->cur->cur_count > 0)
tb->cur->cur_count--;
break;
case '\v': /* Vertical Tab */
break;
default:
tb->cur->buf[tb->cur->cur_count] = c;
tb->cur->col[tb->cur->cur_count] = tc->palette;
tb->cur->cur_count++;
if (tb->cur->cur_count > LINE_BUF_X_SIZE)
{
tb->cur->cur_count = LINE_BUF_X_SIZE;
break;
}
if (tb->cur->cur_count > tb->cur->last_count)
tb->cur->last_count = tb->cur->cur_count;
break;
}
}
int init_text_buf_sys(void *heap_start, void *heap_end)
{
return init_lb_heap(heap_start, heap_end);
}
void text_buf_to_vram(TEXT_CTRL * tc)
{
int x_line, line_no;
int c;
u16 col;
LINE_BUF *lb;
TEXT_BUF *tb = &(tc->text_buf);
lb = tb->start;
put_char_vram(tc, '\f', (u16)0);
for (line_no = 0; line_no < (*tb->num_y + 1); line_no++)
{
x_line = 0;
if (lb == NULL)
break;
while (x_line < lb->last_count)
{
if (x_line >= (*tb->num_x + 1))
{
break;
}
else
{
c = lb->buf[x_line];
col = lb->col[x_line];
put_char_vram(tc, c, col);
}
x_line++;
}
if (x_line <= *tb->num_x)
{
put_char_vram(tc, '\n', (u16)0);
}
lb = lb->next;
}
for (; line_no <= *tb->num_y; line_no++)
{
put_char_vram(tc, '\n', (u16)0);
}
}
void mprintf(const char *text, ...)
{
va_list vlist;
char temp[32];
s32 i = 0;
va_start(vlist, text);
(void)OS_VSNPrintf(temp, 32, text, vlist);
va_end(vlist);
for (i = 0; i < 33; i++)
{
m_putchar(tc[0], (int)temp[i]);
if (temp[i] == '\n')
{
break;
}
}
if (i > 32)
m_putchar(tc[0], '\n');
}
void mfprintf(TEXT_CTRL * tc, const char *text, ...)
{
va_list vlist;
char temp[32];
s32 i = 0;
va_start(vlist, text);
(void)OS_VSNPrintf(temp, 32, text, vlist);
va_end(vlist);
for (i = 0; i < 33; i++)
{
m_putchar(tc, (int)temp[i]);
if (temp[i] == '\n')
{
break;
}
}
if (i > 32)
m_putchar(tc, '\n');
}

View File

@ -1,32 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckCardAccess
# 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
SUBDIRS =
SUBMAKES = Makefile.off Makefile.normal Makefile.game
include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/commondefs
#----------------------------------------------------------------------------
do-build : $(TARGETS)
include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/modulerules
#----------------------------------------------------------------------------
#===== End of Makefile =====

View File

@ -1,47 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckCardAccess
# File: Makefile.game
#
# 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:: #$
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TWL_NANDAPP = TRUE
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
TARGET_NAME = finalize_check_game
BINDIR = ./bin/$(TWL_BUILDTYPE)/$(TARGET_NAME)
TARGET_BIN = $(TARGET_NAME).tad
SRCS = ./src/main.c ./src/font.c
MACRO_FLAGS += -DMY_TARGET_NAME=\"$(basename $(TARGET_BIN))\"
#-------------------------
ROM_SPEC = game_mode.rsf
include $(TWLSDK_ROOT)/build/buildtools/commondefs
include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib
#----------------------------------------------------------------------------
.PHONY: build_time
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,47 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckCardAccess
# File: Makefile.normal
#
# 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:: #$
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TWL_NANDAPP = TRUE
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
TARGET_NAME = finalize_check_normal
BINDIR = ./bin/$(TWL_BUILDTYPE)/$(TARGET_NAME)
TARGET_BIN = $(TARGET_NAME).tad
SRCS = ./src/main.c ./src/font.c
MACRO_FLAGS += -DMY_TARGET_NAME=\"$(basename $(TARGET_BIN))\"
#-------------------------
ROM_SPEC = normal_mode.rsf
include $(TWLSDK_ROOT)/build/buildtools/commondefs
include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib
#----------------------------------------------------------------------------
.PHONY: build_time
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,47 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckCardAccess
# File: Makefile.off
#
# 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:: #$
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TWL_NANDAPP = TRUE
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
TARGET_NAME = finalize_check_slotpoweroff
BINDIR = ./bin/$(TWL_BUILDTYPE)/$(TARGET_NAME)
TARGET_BIN = $(TARGET_NAME).tad
SRCS = ./src/main.c ./src/font.c
MACRO_FLAGS += -DMY_TARGET_NAME=\"$(basename $(TARGET_BIN))\"
#-------------------------
ROM_SPEC = slot_power_off.rsf
include $(TWLSDK_ROOT)/build/buildtools/commondefs
include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib
#----------------------------------------------------------------------------
.PHONY: build_time
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,243 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 "MY APP NAME"
#
# MAKER CODE: Your company ID# in 2 ascii words
# issued by NINTENDO
#
#MakerCode 01
#
# 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/4G]
#
#RomSize 256M
#
# ROM PADDING: TRUE if finalrom
#
#RomFootPadding TRUE
#
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
#
# RomHeaderTemplate ../rh/0C5A/rom_header_0c5a.template.sbin
#
# BANNER FILE: generated from Banner Spec File
#
# BannerFile "banner_LTD/banner.bnr"
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD]
# don't have to edit
#
WramMapping $(MAKEROM_WRAM_MAPPING)
#
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
#
CardRegion ALL
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
#
# Agree EULA [TRUE/FALSE]
#
#AgreeEULA FALSE
#
# Agree EULA version [1 - 255]
#
#AgreeEULAVersion 1
###
#### END
}
AppendProperty
{
#
# Boot allowed Media: [GameCard]
#
Media NAND
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
#GameCode 4CDA
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 0K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 0K
#
# Enable SubBannerFile
#SubBannerFile TRUE
#
# Game card power on: [TRUE/FALSE]
#
#GameCardOn FALSE
#
# Game card transferd to nitro mode: [TRUE/FALSE]
#
GameCardNitroMode TRUE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot $(MAKEROM_ROMROOT)
Root /
File $(MAKEROM_ROMFILES)
}
Rating
{
#
# Permited age to play for each rating organization
#
# Supported organization
# - CERO (OGN0) : for Japan
# - ESRB (OGN1) : for North America
# - BBFC (OGN2) : obsolete organization
# - USK (OGN3) : for German
# - PEGI_GEN (OGN4) : for Europe
# - PEGI_FINLAND (OGN5) : obsolete organization
# - PEGI_PRT (OGN6) : for Portugal
# - PEGI_BBFC (OGN7) : for UK
# - OFLC (OGN8) : for Australia and NewZealand
# - GRB (OGN9) : for Korea
# - OGN10 : reserved
# - OGN11 : reserved
# - OGN12 : reserved
# - OGN13 : reserved
# - OGN14 : reserved
# - OGN15 : reserved
#
# Available age [ 0 - 31 / PENDING / FREE ]
CERO FREE
# ESRB FREE
# USK FREE
# PEGI_GEN FREE
# PEGI_PRT FREE
# PEGI_BBFC FREE
# OFLC FREE
# GRB FREE
}

View File

@ -1,243 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 "MY APP NAME"
#
# MAKER CODE: Your company ID# in 2 ascii words
# issued by NINTENDO
#
#MakerCode 01
#
# 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/4G]
#
#RomSize 256M
#
# ROM PADDING: TRUE if finalrom
#
#RomFootPadding TRUE
#
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
#
# RomHeaderTemplate ../rh/0C4A/rom_header_0c4a.template.sbin
#
# BANNER FILE: generated from Banner Spec File
#
# BannerFile "banner_LTD/banner.bnr"
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD]
# don't have to edit
#
WramMapping $(MAKEROM_WRAM_MAPPING)
#
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
#
CardRegion ALL
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
#
# Agree EULA [TRUE/FALSE]
#
#AgreeEULA FALSE
#
# Agree EULA version [1 - 255]
#
#AgreeEULAVersion 1
###
#### END
}
AppendProperty
{
#
# Boot allowed Media: [GameCard]
#
Media NAND
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
#GameCode 4CDA
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 0K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 0K
#
# Enable SubBannerFile
#SubBannerFile TRUE
#
# Game card power on: [TRUE/FALSE]
#
GameCardOn TRUE
#
# Game card transferd to nitro mode: [TRUE/FALSE]
#
#GameCardNitroMode FALSE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot $(MAKEROM_ROMROOT)
Root /
File $(MAKEROM_ROMFILES)
}
Rating
{
#
# Permited age to play for each rating organization
#
# Supported organization
# - CERO (OGN0) : for Japan
# - ESRB (OGN1) : for North America
# - BBFC (OGN2) : obsolete organization
# - USK (OGN3) : for German
# - PEGI_GEN (OGN4) : for Europe
# - PEGI_FINLAND (OGN5) : obsolete organization
# - PEGI_PRT (OGN6) : for Portugal
# - PEGI_BBFC (OGN7) : for UK
# - OFLC (OGN8) : for Australia and NewZealand
# - GRB (OGN9) : for Korea
# - OGN10 : reserved
# - OGN11 : reserved
# - OGN12 : reserved
# - OGN13 : reserved
# - OGN14 : reserved
# - OGN15 : reserved
#
# Available age [ 0 - 31 / PENDING / FREE ]
CERO FREE
# ESRB FREE
# USK FREE
# PEGI_GEN FREE
# PEGI_PRT FREE
# PEGI_BBFC FREE
# OFLC FREE
# GRB FREE
}

View File

@ -1,243 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 "MY APP NAME"
#
# MAKER CODE: Your company ID# in 2 ascii words
# issued by NINTENDO
#
#MakerCode 01
#
# 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/4G]
#
#RomSize 256M
#
# ROM PADDING: TRUE if finalrom
#
#RomFootPadding TRUE
#
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
#
# RomHeaderTemplate ../rh/0C3A/rom_header_0c3a.template.sbin
#
# BANNER FILE: generated from Banner Spec File
#
# BannerFile "banner_LTD/banner.bnr"
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD]
# don't have to edit
#
WramMapping $(MAKEROM_WRAM_MAPPING)
#
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
#
CardRegion ALL
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
#
# Agree EULA [TRUE/FALSE]
#
#AgreeEULA FALSE
#
# Agree EULA version [1 - 255]
#
#AgreeEULAVersion 1
###
#### END
}
AppendProperty
{
#
# Boot allowed Media: [GameCard]
#
Media NAND
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
#GameCode 4CDA
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 0K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 0K
#
# Enable SubBannerFile
#SubBannerFile TRUE
#
# Game card power on: [TRUE/FALSE]
#
#GameCardOn FALSE
#
# Game card transferd to nitro mode: [TRUE/FALSE]
#
#GameCardNitroMode FALSE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot $(MAKEROM_ROMROOT)
Root /
File $(MAKEROM_ROMFILES)
}
Rating
{
#
# Permited age to play for each rating organization
#
# Supported organization
# - CERO (OGN0) : for Japan
# - ESRB (OGN1) : for North America
# - BBFC (OGN2) : obsolete organization
# - USK (OGN3) : for German
# - PEGI_GEN (OGN4) : for Europe
# - PEGI_FINLAND (OGN5) : obsolete organization
# - PEGI_PRT (OGN6) : for Portugal
# - PEGI_BBFC (OGN7) : for UK
# - OFLC (OGN8) : for Australia and NewZealand
# - GRB (OGN9) : for Korea
# - OGN10 : reserved
# - OGN11 : reserved
# - OGN12 : reserved
# - OGN13 : reserved
# - OGN14 : reserved
# - OGN15 : reserved
#
# Available age [ 0 - 31 / PENDING / FREE ]
CERO FREE
# ESRB FREE
# USK FREE
# PEGI_GEN FREE
# PEGI_PRT FREE
# PEGI_BBFC FREE
# OFLC FREE
# GRB FREE
}

View File

@ -1,579 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos.TWL - snd - extraFunc
File: font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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
*---------------------------------------------------------------------------*/

View File

@ -1,36 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos.TWL - snd - extraFunc
File: font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef FONT_H_
#define FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <twl/types.h>
extern const u32 d_CharData[8 * 256];
extern const u32 d_PaletteData[8 * 16];
/*===========================================================================*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // FONT_H_

View File

@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - HOTSW - include
File: type.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.
*---------------------------------------------------------------------------*/
#ifndef __HOTSW_TYPES_H__
#define __HOTSW_TYPES_H__
#include <twl.h>
#include <twl/os/common/format_rom.h>
#include "romSpec.h"
#ifdef __cplusplus
extern "C" {
#endif
static inline void HOTSW_WaitCardCtrl(void)
{
while( reg_MI_MCCNT1_A & REG_MI_MCCNT1_START_MASK ){}
}
// Define -------------------------------------------------------------------
// --- Boot Segment
#define BOOT_SEGMENT_SIZE 0x1000
// --- Secure Segment
#define SECURE_SEGMENT_START 0x4000
#define SECURE_SEGMENT_SIZE 0x4000
#define SECURE_SEGMENT_END (SECURE_SEGMENT_START + SECURE_SEGMENT_SIZE)
// --- TWL Card
#define TWLCARD_BORDER_OFFSET 0x80000
// --- Page / Segment (Byte)
#define PAGE_SIZE 0x200
#define ONE_SEGMENT_SIZE 0x1000
// --- Page / Segment (Word)
#define PAGE_WORD_SIZE 0x80
#define ONE_SEGMENT_WORD_SIZE 0x400
// --- Rom Emulation
#define ROM_EMULATION_DATA_SIZE 0x20
// --- Thread
#define HOTSW_THREAD_STACK_SIZE (1024 * 2)
#define HOTSW_DMA_MSG_NUM 8
#define HOTSW_INSERT_MSG_NUM 16
#define HOTSW_PULLED_MSG_NUM 16
#define HOTSW_CTRL_MSG_NUM 8
#define HOTSW_MSG_BUFFER_NUM (HOTSW_INSERT_MSG_NUM + HOTSW_PULLED_MSG_NUM + HOTSW_CTRL_MSG_NUM)
#define HOTSW_POLLING_CTRL_BUFFER_NUM 4
// --- Card Control Reg 0
#define HOTSW_E2PROM_CTRL_MASK 0x00ff
// --- Card Control Reg 1
#define START_FLG_MASK 0x80000000
#define READY_FLG_MASK 0x00800000
#define LATENCY1_SHIFT 0
#define LATENCY1_MASK 0x00001fff
#define DS_SHIFT 13
#define DS_MASK 0x00002000
#define SE_SHIFT 14
#define SE_MASK 0x00004000
#define SCR_SHIFT 15
#define SCR_MASK 0x00008000
#define LATENCY2_SHIFT 16
#define LATENCY2_MASK 0x003f0000
#define CS_SHIFT 22
#define CS_MASK 0x00400000
#define RDY_SHIFT 23
#define RDY_MASK 0x00800000
#define PC_SHIFT 24
#define PC_MASK 0x07000000
#define CT_SHIFT 27
#define CT_MASK 0x08000000
#define TRM_SHIFT 28
#define TRM_MASK 0x10000000
#define RESB_SHIFT 29
#define RESB_MASK 0x20000000
#define WR_SHIFT 30
#define WR_MASK 0x40000000
#define START_SHIFT 31
#define START_MASK 0x80000000
#define SCRAMBLE_MASK 0x1040e000 // スクランブル関係のフラグマスク
#define SECURE_COMMAND_SCRAMBLE_MASK 0x00406000 // CS SE DSのマスク
// --- Page Count
#define PAGE_0 0x0UL << PC_SHIFT
#define PAGE_1 0x1UL << PC_SHIFT
#define PAGE_2 0x2UL << PC_SHIFT
#define PAGE_4 0x3UL << PC_SHIFT
#define PAGE_8 0x4UL << PC_SHIFT
#define PAGE_16 0x5UL << PC_SHIFT
#define PAGE_32 0x6UL << PC_SHIFT
#define PAGE_STAT 0x7UL << PC_SHIFT
// union ---------------------------------------------------------------------
typedef union
{
u64 dw;
u8 b[8];
} Cmd64;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // __HOTSW_TYPES_H__

View File

@ -1,768 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos - CARD - hotswDebug
File: main_finalize.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.
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <twl/os/common/format_rom.h>
#include "DEMO.h"
#include "hotswTypes.h"
#include "font.h"
#define SDK_MAKERCODE '10'
#define DIGEST_HASH_BLOCK_SIZE_SHA1 (512/8)
#define MY_TEMP_BUFFER_SIZE 0x80000
#define GAME_FIELD_START_ADDRESS 0x8000
#define ONE_SEGMENT_PAGE_NUM 8
#define READY_MASK 0x00800000
#define CARD_COMMAND_MASK 0x07000000
#define MY_ROMHEADER_TWL ((ROM_Header_Short *)HW_TWL_CARD_ROM_HEADER_BUF)
#define MY_ROMHEADER_NTR ((ROM_Header_Short *)HW_CARD_ROM_HEADER)
#define MY_ROMHEADER_NAND ((ROM_Header_Short *)HW_TWL_ROM_HEADER_BUF)
// ---------------------------------------------------------------
// HMACSHA1の鍵
static 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
};
static u32 rhBuf[BOOT_SEGMENT_SIZE/sizeof(u32)];
static u32 checkBuf[MY_TEMP_BUFFER_SIZE/sizeof(u32)];
static u16 card_lock_id;
static BOOL error, flxhash, ltdhash, romheader;
static BOOL isTwlApplication;
static BOOL isTwlCard;
static ROM_Header_Short *rh;
static u16 screen[32 * 32] ATTRIBUTE_ALIGN(HW_CACHE_LINE_SIZE);
// ---------------------------------------------------------------
static void CheckMirrorImage(void);
static int CompRomHeaderForNTR(void* buf);
static void CheckRomHeader(void);
static BOOL CheckHashValue(void* buf, u32 size, void* digest);
static void MY_LoadCard_arm7Static(void);
static void MY_LoadCard_arm7LtdStatic(void);
static void CheckBackupDevice(void);
static void ShowResult(void);
static void debugMessage(void);
static void ReadBootSegNormal(void* buf);
static void SetCommand(Cmd64 *cndLE);
static void ReadPageGame(u32 start_addr, void* buf, u32 size);
static void ReadCardData(void* dest, s32 offset, s32 length);
static void VBlankIntr (void);
static void PrintString (s16 x, s16 y, u8 palette, char *text, ...);
static void VolumeSwitchCallback(SNDEXResult result, void* arg);
/*---------------------------------------------------------------------------*
Name: NitroMain
Description: .
*---------------------------------------------------------------------------*/
void NitroMain(void)
{
CARDRomHeader *card_header = (void*)CARD_GetRomHeader();
OS_Init();
OS_InitTick();
CARD_Init();
GX_Init();
GX_DispOff();
GXS_DispOff();
if ( card_header->maker_code == SDK_MAKERCODE )
{
CARD_Enable(TRUE);
}
/* 表示設定初期化 */
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
(void)GX_DisableBankForLCDC();
MI_CpuFillFast((void*)HW_OAM, GX_LCD_SIZE_Y, HW_OAM_SIZE);
MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE);
MI_CpuFillFast((void*)HW_DB_OAM, GX_LCD_SIZE_Y, HW_DB_OAM_SIZE);
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE);
GX_SetBankForBG(GX_VRAM_BG_128_A);
G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256,
GX_BG_COLORMODE_16,
GX_BG_SCRBASE_0xf800, // SCR ベースブロック 31
GX_BG_CHARBASE_0x00000, // CHR ベースブロック 0
GX_BG_EXTPLTT_01);
G2_SetBG0Priority(0);
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D);
GX_SetVisiblePlane(GX_PLANEMASK_BG0);
GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData));
GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData));
MI_CpuClearFast((void*)screen, sizeof(screen));
DC_FlushRange(screen, sizeof(screen));
GX_LoadBG0Scr(screen, 0, sizeof(screen));
/* 割込み設定 */
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
(void)GX_VBlankIntr(TRUE);
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
/* LCD 表示開始 */
GX_DispOn();
GXS_DispOn();
PrintString(0, 0, 0xc, "+++ Card Access Check +++");
// NANDアプリがHYBの場合
if(MY_ROMHEADER_NAND->platform_code == 0x02){
PrintString(0, 2, 0x5, "<HYBRID ver.>");
}
else if(MY_ROMHEADER_NAND->platform_code == 0x03){
PrintString(0, 2, 0x6, "<LIMITED ver.>");
}
// カードアプリタイプを判別。使うRom Header Buffer を切替える
if(MY_ROMHEADER_NTR->platform_code & PLATFORM_CODE_FLAG_TWL){
PrintString(0, 5, 0xf, "- TWL Application -");
isTwlApplication = TRUE;
rh = MY_ROMHEADER_TWL;
}
else{
PrintString(0, 5, 0xf, "- NTR Application -");
isTwlApplication = FALSE;
rh = MY_ROMHEADER_NTR;
}
// カードタイプの判別
isTwlCard = (*(vu32 *)(HW_BOOT_CHECK_INFO_BUF) & HOTSW_ROMID_TWLROM_MASK) ? TRUE : FALSE;
// 注rhの初期化が終わってから呼び出す
// debugMessage();
// フラグの初期化
error = FALSE;
flxhash = TRUE;
ltdhash = TRUE;
romheader = TRUE;
// ロックIDを取得しておく
card_lock_id = (u16)OS_GetLockID();
if(isTwlApplication){
MY_LoadCard_arm7Static();
MY_LoadCard_arm7LtdStatic();
}
else{
CheckMirrorImage();
}
CheckRomHeader();
CheckBackupDevice();
ShowResult();
while(1){
// DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
}
/*---------------------------------------------------------------------------*
Name: CheckMirrorImage
Description:
Gameモード時 Gameコマンド OK
Normalコマンド All 1
Normalモード時 Gameコマンド All 1
Normalコマンド OK
SlotPowerOff時 Gameコマンド All 0
Normalコマンド All 0
*---------------------------------------------------------------------------*/
static void CheckMirrorImage(void)
{
u32 buf1[PAGE_SIZE/sizeof(u32)];
u32 buf2[PAGE_SIZE/sizeof(u32)];
u32 buf_ff[PAGE_SIZE/sizeof(u32)];
u32 buf_00[PAGE_SIZE/sizeof(u32)];
MI_CpuFill8( buf_ff, 0xff, sizeof(buf_ff) );
MI_CpuFill8( buf_00, 0x0, sizeof(buf_00) );
CARD_LockRom(card_lock_id);
// GameモードのコマンドでKey Table領域とGame領域読む
ReadCardData(buf1, (s32)0x1000, (s32)PAGE_SIZE);
ReadCardData(buf2, (s32)0x8000, (s32)PAGE_SIZE);
CARD_UnlockRom(card_lock_id);
// GameモードでKey Table領域からGame領域のイメージが読めてなかったら、不明なモード
if(MI_CpuComp8( buf1, buf2, PAGE_SIZE )){
error = TRUE;
PrintString(0, 7, 0x1, "Unknown Mode");
}
else{
// 同じデータでも ALL 1(GameMode時) or ALL 0(SlotPowerOff時)ならちゃんと読めてないので、Normalモード
if(!MI_CpuComp8( buf_ff, buf2, PAGE_SIZE ) || !MI_CpuComp8( buf_00, buf2, PAGE_SIZE )){
flxhash = FALSE;
ltdhash = FALSE;
PrintString(0, 7, 0x1, "Flx Area : Not Accessible");
}
// Key Table領域読んで、Game領域のイメージが出てたらGameモード
else{
flxhash = TRUE;
ltdhash = FALSE;
PrintString(0, 7, 0x8, "Flx Area : Accessible");
}
}
}
/*---------------------------------------------------------------------------*
Name: CheckRomHeader
Description:
*---------------------------------------------------------------------------*/
static void CheckRomHeader(void)
{
int result;
u8* pBuf = (u8 *)rhBuf;
u8* romHeader = (u8 *)rh;
CARD_LockRom(card_lock_id);
ReadBootSegNormal(pBuf);
CARD_UnlockRom(card_lock_id);
// 実際に読んだRom HeaderとIPLで読んだRom Headerを比較
if(isTwlApplication){
result = MI_CpuComp8( pBuf, romHeader, HW_TWL_CARD_ROM_HEADER_BUF_SIZE );
}
else{
result = CompRomHeaderForNTR(pBuf);
}
// 結果
if(result){
romheader = FALSE;
PrintString(0, 11, 0x1, "Boot Segment : Not Accessible");
}
else{
romheader = TRUE;
PrintString(0, 11, 0x8, "Boot Segment : Accessible");
}
// DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
static int CompRomHeaderForNTR(void* buf){
u8* pBuf = (u8 *)buf;
u8* romHeader = (u8 *)rh;
u32 remainSize = HW_CARD_ROM_HEADER_SIZE;
while(remainSize){
// マスクRomコントロール情報が変わってるので、そこは飛ばす。
if((HW_CARD_ROM_HEADER_SIZE - remainSize) == 0x60){
pBuf += 4;
romHeader += 4;
remainSize -= 4;
}
if(*pBuf == *romHeader){
remainSize--;
}
else{
// OS_TPrintf("Error (adr:0x%08x)\n", HW_CARD_ROM_HEADER_SIZE - remainSize);
// OS_TPrintf("read : 0x%02x real : 0x%02x\n", *pBuf, *romHeader);
break;
}
pBuf++;
romHeader++;
}
return (int)remainSize;
}
/*---------------------------------------------------------------------------*
Name: CheckHashValue
Description:
*---------------------------------------------------------------------------*/
static BOOL CheckHashValue(void* buf, u32 size, void* digest)
{
u8 sha1data[DIGEST_SIZE_SHA1];
BOOL retval = TRUE;
// クリア
MI_CpuClear8(sha1data, sizeof(sha1data));
// ARM7常駐モジュールのHash値照合
SVC_CalcHMACSHA1( sha1data,
buf,
size,
s_digestDefaultKey,
sizeof(s_digestDefaultKey) );
return SVC_CompareSHA1( sha1data, digest );
}
/*---------------------------------------------------------------------------*
Name: MY_LoadCard_arm7Static
Description: ARM7常駐モジュール
*---------------------------------------------------------------------------*/
static void MY_LoadCard_arm7Static(void)
{
BOOL result;
u32* pBuf = checkBuf;
CARD_LockRom(card_lock_id);
ReadCardData(pBuf, (s32)rh->sub_rom_offset, (s32)rh->sub_size);
CARD_UnlockRom(card_lock_id);
result = CheckHashValue(checkBuf, rh->sub_size, (void *)rh->sub_static_digest);
if(result){
flxhash = TRUE;
PrintString(0, 7, 0x8, "Flx Area : Accessible");
}
else{
flxhash = FALSE;
PrintString(0, 7, 0x1, "Flx Area : Not Accessible");
}
// DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
/*---------------------------------------------------------------------------*
Name: MY_LoadCard_arm7LtdStatic
Description: ARM7拡張常駐モジュール
*---------------------------------------------------------------------------*/
static void MY_LoadCard_arm7LtdStatic(void)
{
BOOL result;
u32* pBuf = checkBuf;
CARD_LockRom(card_lock_id);
ReadCardData(pBuf, (s32)rh->sub_ltd_rom_offset, (s32)rh->sub_ltd_size);
CARD_UnlockRom(card_lock_id);
result = CheckHashValue(checkBuf, rh->sub_ltd_size, (void *)rh->sub_ltd_static_digest);
if(result){
ltdhash = TRUE;
PrintString(0, 9, 0x8, "Ltd Area : Accessible");
}
else{
ltdhash = FALSE;
PrintString(0, 9, 0x1, "Ltd Area : Not Accessible");
}
// DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
/*---------------------------------------------------------------------------*
Name: CheckBackupDevice
Description: Backup Device
EEPROM 512 kbのサブ基盤と使って検査する
*---------------------------------------------------------------------------*/
static void CheckBackupDevice(void)
{
BOOL identify;
static CARDResult last_result = CARD_RESULT_SUCCESS;
CARD_LockBackup(card_lock_id);
identify = CARD_IdentifyBackup(CARD_BACKUP_TYPE_EEPROM_512KBITS);
if (!identify)
{
PrintString(0, 13, 0x1, "Backup Device Identify Error...");
error = TRUE;
CARD_UnlockBackup(card_lock_id);
return;
}
{
u32 pos = 0;
static u8 tmp_buf[65536];
int i;
const u32 page_size = CARD_GetBackupPageSize();
const u32 total_size = CARD_GetBackupTotalSize();
for (i = 0; i < page_size; ++i)
{
tmp_buf[i] = (u8)(pos * 3 + i);
}
if (!CARD_IsBackupEeprom()){
PrintString(0, 13, 0x1, "Please Use EEPROM...");
error = TRUE;
return;
}
PrintString(0, 13, 0xf, "Backup Device Check Start...");
// DEMO_DrawFlip();
while(pos < total_size){
CARD_WriteAndVerifyEepromAsync(pos, tmp_buf, page_size, NULL, NULL);
(void)CARD_WaitBackupAsync();
last_result = CARD_GetResultCode();
pos += page_size;
if (last_result != CARD_RESULT_SUCCESS){
break;
}
}
if (last_result != CARD_RESULT_SUCCESS){
PrintString(0, 14, 0x1, "Backup Device : Not Accessible");
error = TRUE;
}
else{
PrintString(0, 14, 0x8, "Backup Device : Accessible");
}
}
CARD_UnlockBackup(card_lock_id);
// DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
/*---------------------------------------------------------------------------*
Name: ReadBootSegNormal
Description: Boot Segment読み込み
*---------------------------------------------------------------------------*/
#define TIME_OUT 1000
static void ReadBootSegNormal(void* buf)
{
u32 i, loop, pc, size, counter;
u64 page = 0;
Cmd64 cndLE;
BOOL isType1;
OSTick start;
isType1 = (*(vu32 *)(HW_BOOT_CHECK_INFO_BUF) & HOTSW_ROMID_1TROM_MASK) ? FALSE : TRUE;
if(isType1){
loop = 0x1UL;
pc = 0x4UL;
size = BOOT_SEGMENT_SIZE;
}
else{
loop = ONE_SEGMENT_PAGE_NUM;
pc = 0x1UL;
size = PAGE_SIZE;
}
counter = 0;
HOTSW_WaitCardCtrl();
for(i=0; i<loop; i++){
// リトルエンディアンで作って
cndLE.dw = HSWOP_N_OP_RD_PAGE;
cndLE.dw |= page << HSWOP_N_RD_PAGE_ADDR_SHIFT;
// MCCMD レジスタ設定
SetCommand(&cndLE);
// MCCNT0 レジスタ設定
reg_MI_MCCNT0_A = (u16)((reg_MI_MCCNT0_A & 0x00ff) | REG_MI_MCCNT0_E_MASK);
// MCCNT1 レジスタ設定
reg_MI_MCCNT1_A = START_MASK | CT_MASK | PC_MASK & (pc << PC_SHIFT) | LATENCY2_MASK | LATENCY1_MASK;
start = OS_GetTick();
while(reg_MI_MCCNT1_A & START_MASK){
while(!(reg_MI_MCCNT1_A & READY_MASK)){
if(OS_TicksToMilliSeconds(OS_GetTick()-start) > TIME_OUT){
return;
}
}
*((u32 *)buf + counter++) = reg_MI_MCD1_A;
}
page++;
OS_SpinWait( 100 );
}
}
/*---------------------------------------------------------------------------*
Name: HOTSWi_SetCommand
Description:
*---------------------------------------------------------------------------*/
static void SetCommand(Cmd64 *cndLE)
{
Cmd64 cndBE;
// ビッグエンディアンに直す
cndBE.b[7] = cndLE->b[0];
cndBE.b[6] = cndLE->b[1];
cndBE.b[5] = cndLE->b[2];
cndBE.b[4] = cndLE->b[3];
cndBE.b[3] = cndLE->b[4];
cndBE.b[2] = cndLE->b[5];
cndBE.b[1] = cndLE->b[6];
cndBE.b[0] = cndLE->b[7];
// MCCMD レジスタ設定
reg_MI_MCCMD0_A = *(u32*)cndBE.b;
reg_MI_MCCMD1_A = *(u32*)&cndBE.b[4];
}
/*---------------------------------------------------------------------------*
Name: ReadPageGame
Description:
*---------------------------------------------------------------------------*/
static void ReadPageGame(u32 start_addr, void* buf, u32 size)
{
u32 loop, counter=0;
u64 i, page;
Cmd64 cndLE;
u32 rom_ctrl = *(vu32 *)(HW_CARD_ROM_HEADER + 0x60);
OSTick start;
rom_ctrl = rom_ctrl & ~CARD_COMMAND_MASK;
page = (u32)(start_addr / PAGE_SIZE);
loop = (u32)(size / PAGE_SIZE);
loop = (size % PAGE_SIZE) ? loop + 1 : loop;
HOTSW_WaitCardCtrl();
for(i=0; i<loop; i++){
// コマンド作成
cndLE.dw = HSWOP_G_OP_RD_PAGE;
cndLE.dw |= (page + i) << HSWOP_G_RD_PAGE_ADDR_SHIFT;
// MCCMD レジスタ設定
SetCommand(&cndLE);
// MCCNT0 レジスタ設定
reg_MI_MCCNT0_A = (u16)((reg_MI_MCCNT0_A & 0x00ff) | REG_MI_MCCNT0_E_MASK);
// MCCNT1 レジスタ設定
reg_MI_MCCNT1_A = rom_ctrl | START_MASK | PAGE_1;
start = OS_GetTick();
while(reg_MI_MCCNT1_A & START_MASK){
while(!(reg_MI_MCCNT1_A & READY_MASK)){
if(OS_TicksToMilliSeconds(OS_GetTick()-start) > TIME_OUT){
return;
}
}
*((u32 *)buf + counter++) = reg_MI_MCD1_A;
}
}
OS_SpinWait( 100 );
}
/*---------------------------------------------------------------------------*
Name: ReadCardData
Description: (page途中)
*---------------------------------------------------------------------------*/
static void ReadCardData(void* dest, s32 offset, s32 length)
{
static u8 page_buffer[512];
u32 page_offset = (u32)(offset & -512);
u32 buffer_offset = (u32)(offset % 512);
u32 valid_length = 512 - buffer_offset;
u32 remain_length;
// 開始アドレスがページの途中
if ( offset % 512 )
{
ReadPageGame(page_offset, page_buffer, 512);
MI_CpuCopy8(page_buffer + buffer_offset, dest, (length < valid_length ? length : valid_length));
dest = (u8*)dest + valid_length;
offset += valid_length;
length -= valid_length;
if ( length < 0)
{
return;
}
}
remain_length = (u32)(length % 512);
ReadPageGame((u32)offset, dest, (u32)(length - remain_length));
// ケツがページ途中
if( remain_length ){
dest = (u8*)dest + (length - remain_length);
offset += length - remain_length;
ReadPageGame((u32)offset, page_buffer, 512);
MI_CpuCopy8(page_buffer, dest, remain_length);
}
}
/*---------------------------------------------------------------------------*
Name: ShowResult
Description: Result表示
*---------------------------------------------------------------------------*/
static void ShowResult(void)
{
PrintString(0, 16, 0xf, "-- Result --");
if(romheader && !flxhash && !ltdhash){
PrintString(0, 18, 0x4, "Normal Mode");
}
else if((!romheader && flxhash && !ltdhash) ||
(!romheader && flxhash && ltdhash && !isTwlCard)){
PrintString(0, 18, 0x5, "Game Mode");
}
else if(!romheader && !flxhash && !ltdhash){
PrintString(0, 18, 0x6, "Slot Power Off");
}
else{
PrintString(0, 18, 0x1, "Unknown Mode");
}
if(error){
PrintString(0, 20, 0x1, "Backup Device Error");
}
// DEMO_DrawFlip();
// OS_WaitVBlankIntr();
}
/*---------------------------------------------------------------------------*
Name: debugMessage
Description:
*---------------------------------------------------------------------------*/
static void debugMessage(void)
{
PrintString(0, 4, 0xf, "amr7 NmlRomOfs : 0x%08x", rh->sub_rom_offset);
PrintString(0, 5, 0xf, "amr7 LtdRomOfs : 0x%08x", rh->sub_ltd_rom_offset);
OS_TPrintf("amr7 NmlRomOfs : 0x%08x\n", rh->sub_rom_offset);
OS_TPrintf("amr7 NmlSize : 0x%08x\n", rh->sub_size);
OS_TPrintf("amr7 LtdRomOfs : 0x%08x\n", rh->sub_ltd_rom_offset);
OS_TPrintf("amr7 LtdSize : 0x%08x\n", rh->sub_ltd_size);
}
/*---------------------------------------------------------------------------*
Name: VBlankIntr
Description:
*---------------------------------------------------------------------------*/
static void VBlankIntr (void)
{
/* 仮想スクリーンを VRAM に反映 */
DC_FlushRange(screen, sizeof(screen));
GX_LoadBG0Scr(screen, 0, sizeof(screen));
/* IRQ チェックフラグをセット */
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
}
/*---------------------------------------------------------------------------*
Name: PrintString
Description: 32
Arguments: x - x ( × 8 )
y - y ( × 8 )
palette -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
static void PrintString (s16 x, s16 y, u8 palette, char *text, ...)
{
va_list vlist;
char temp[32 + 2];
s32 i;
va_start(vlist, text);
(void)vsnprintf(temp, 33, text, vlist);
va_end(vlist);
*((u16*)(&temp[32])) = 0x0000;
for (i = 0; ; i++)
{
if (temp[i] == 0x00)
{
break;
}
screen[((y * 32) + x + i) % (32 * 32)] = (u16)((palette << 12) | temp[i]);
}
}

View File

@ -1,152 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - HOTSW - include
File: romSpec.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __HOTSW_ROMSPEC_H__
#define __HOTSW_ROMSPEC_H__
#ifdef __cplusplus
extern "C" {
#endif
// ROM memory map
#define HOTSW_PAGE_SIZE 0x200 // 512B
#define HOTSW_BOOT_SEG_SIZE 0x1000 // 4KB
#define HOTSW_LOAD_TABLE_SIZE 0x2000 // 8KB
#define HOTSW_KEYTABLE_AREA_SIZE 0x3000 // 12KB
#define HOTSW_KEYTABLE2_AREA_SIZE 0x3000 // 12KB
#define HOTSW_SECURE_AREA_SIZE 0x4000 // 16KB
#define HOTSW_SECURE2_AREA_SIZE 0x4000 // 16KB
#define HOTSW_ROMEMU_INFO_SIZE 0x20
#define HOTSW_BOOTSEGMENT_AREA_OFS 0x0000 // 0KB
#define HOTSW_KEYTABLE_AREA_OFS 0x1000 // 4KB
#define HOTSW_SECURE_AREA_OFS 0x4000 // 16KB
#define HOTSW_GAME_AREA_OFS 0x8000 // 32KB
#define HOTSW_SECURE2_AREA_OFS 0x3000 // 12KB
#define HOTSW_GAME2_AREA_OFS 0x7000 // 28KB
#define HOTSW_ROMEMU_INFO_OFS (HOTSW_SECURE_AREA_OFS - HOTSW_PAGE_SIZE + 0x160)
// ROM ID
#define HOTSW_ROMID_1TROM_MASK 0x80000000UL
#define HOTSW_ROMID_TWLROM_MASK 0x40000000UL
#define HOTSW_ROMID_RFSSUP_MASK 0x20000000UL
#define HOTSW_ROMID_SIZE_MASK 0x0000ff00UL
// ROM STATUS
#define HOTSW_ROMST_RFS_WARN_L1_MASK 0x00000004UL
#define HOTSW_ROMST_RFS_WARN_L2_MASK 0x00000008UL
#define HOTSW_ROMST_RFS_READY_MASK 0x00000020UL
// NORMAL command
#define HSWOP_N_OP_MASK 0xff00000000000000ULL
#define HSWOP_N_OP_SIZE 8
#define HSWOP_N_OP_RD_ID 0x9000000000000000ULL
#define HSWOP_N_OP_RD_PAGE 0x0000000000000000ULL
#define HSWOP_N_OP_WR_PAGE 0x8000000000000000ULL
#define HSWOP_N_OP_LD_TABLE 0x9f00000000000000ULL
#define HSWOP_N_OP_RD_CACHE_START 0x5800000000000000ULL
#define HSWOP_N_OP_RD_CACHE 0x6000000000000000ULL
#define HSWOP_N_OP_RD_CACHE_LAST 0x6800000000000000ULL
#define HSWOP_N_OP_RD_STAT 0xd600000000000000ULL
#define HSWOP_N_OP_RFS_BLK 0xb500000000000000ULL
#define HSWOP_N_OP_CHG_MODE 0x3c00000000000000ULL
#define HSWOP_N_OP_CHG2_MODE 0x3d00000000000000ULL
#define HSWOP_N_RD_ID_PAD 0x00ffffffffffffffULL
#define HSWOP_N_RD_PAGE_PAD 0x00fffffeff00ffffULL
#define HSWOP_N_CHG_MODE_PAD 0x00000000f00000ffULL
#define HSWOP_N_CHG2_MODE_PAD HSWOP_N_CHG_MODE_PAD
#define HSWOP_N_RD_PAGE_ADDR_SHIFT 33
#define HSWOP_N_RD_PAGE_ADDR_SIZE 23
#define HSWOP_N_RD_PAGE_ADDR_MASK 0x00fffffe00000000ULL
#define HSWOP_N_VAE_SHIFT 32
#define HSWOP_N_VAE_SIZE 24
#define HSWOP_N_VAE_MASK 0x00ffffff00000000ULL
#define HSWOP_N_VBI_SHIFT 8
#define HSWOP_N_VBI_SIZE 20
#define HSWOP_N_VBI_MASK 0x000000000fffff00ULL
// SECURE command
#define HSWOP_S_OP_MASK 0xf000000000000000ULL
#define HSWOP_S_OP_SIZE 4
#define HSWOP_S_OP_RD_ID 0x1000000000000000ULL
#define HSWOP_S_OP_RD_SEG 0x2000000000000000ULL
#define HSWOP_S_OP_PNG_ON 0x4000000000000000ULL
#define HSWOP_S_OP_PNG_OFF 0x6000000000000000ULL
#define HSWOP_S_OP_CHG_MODE 0xa000000000000000ULL
#define HSWOP_S_VA_SHIFT HSWOP_S_VB_SIZE
#define HSWOP_S_VA_SIZE 24
#define HSWOP_S_VA_MASK 0x00000ffffff00000ULL
#define HSWOP_S_VB_SHIFT 0
#define HSWOP_S_VB_SIZE 20
#define HSWOP_S_VB_MASK 0x00000000000fffffULL
#define HSWOP_S_VC_SHIFT (HSWOP_S_VA_SIZE + HSWOP_S_VB_SIZE)
#define HSWOP_S_VC_SIZE 16
#define HSWOP_S_VC_MASK 0x0ffff00000000000ULL
#define HSWOP_S_VD_SHIFT HSWOP_S_VA_SHIFT
#define HSWOP_S_VD_SIZE HSWOP_S_VA_SIZE
#define HSWOP_S_VD_MASK HSWOP_S_VA_MASK
// GAME command
#define HSWOP_G_OP_MASK 0xff00000000000000ULL
#define HSWOP_G_OP_SIZE 8
#define HSWOP_G_OP_RD_ID 0xb800000000000000ULL
#define HSWOP_G_OP_RD_UID 0xb900000000000000ULL
#define HSWOP_G_OP_RD_PAGE 0xb700000000000000ULL
#define HSWOP_G_OP_WR_PAGE 0x8000000000000000ULL
#define HSWOP_G_OP_RD_CACHE_START HSWOP_N_OP_RD_CACHE_START
#define HSWOP_G_OP_RD_CACHE HSWOP_N_OP_RD_CACHE
#define HSWOP_G_OP_RD_CACHE_LAST HSWOP_N_OP_RD_CACHE_LAST
#define HSWOP_G_OP_RD_STAT HSWOP_N_OP_RD_STAT
#define HSWOP_G_OP_RFS_BLK HSWOP_N_OP_RFS_BLK
#define HSWOP_G_RD_ID_PAD 0x00ffffffffffffffULL
#define HSWOP_G_RD_UID_PAD 0x00ffffffffffffffULL
#define HSWOP_G_RD_PAGE_PAD 0x00f0000000ffffffULL
#define HSWOP_G_RD_PAGE_ADDR_SHIFT 33
#define HSWOP_G_RD_PAGE_ADDR_SIZE 23
#define HSWOP_G_RD_PAGE_ADDR_MASK 0x000ffffe00000000ULL
#ifdef __cplusplus
} /* extern "C" */
#endif
/* __HOTSW_ROMSPEC_H__ */
#endif

View File

@ -1,37 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckCardMode
# 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:: #$
# $Rev$
# $Author$
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
SRCS = ./src/main.c ./src/font.c
TARGET_BIN = card_mode_check.srl
MACRO_FLAGS += -DMY_TARGET_NAME=\"$(basename $(TARGET_BIN))\"
#-------------------------
include $(TWLSDK_ROOT)/build/buildtools/commondefs
include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,579 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos.TWL - snd - extraFunc
File: font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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
*---------------------------------------------------------------------------*/

View File

@ -1,36 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos.TWL - snd - extraFunc
File: font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef FONT_H_
#define FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <twl/types.h>
extern const u32 d_CharData[8 * 256];
extern const u32 d_PaletteData[8 * 16];
/*===========================================================================*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // FONT_H_

View File

@ -1,134 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - HOTSW - include
File: type.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.
*---------------------------------------------------------------------------*/
#ifndef __HOTSW_TYPES_H__
#define __HOTSW_TYPES_H__
#include <twl.h>
#include <twl/os/common/format_rom.h>
#include "romSpec.h"
#ifdef __cplusplus
extern "C" {
#endif
static inline void HOTSW_WaitCardCtrl(void)
{
while( reg_MI_MCCNT1_A & REG_MI_MCCNT1_START_MASK ){}
}
// Define -------------------------------------------------------------------
// --- Boot Segment
#define BOOT_SEGMENT_SIZE 0x1000
// --- Secure Segment
#define SECURE_SEGMENT_START 0x4000
#define SECURE_SEGMENT_SIZE 0x4000
#define SECURE_SEGMENT_END (SECURE_SEGMENT_START + SECURE_SEGMENT_SIZE)
// --- TWL Card
#define TWLCARD_BORDER_OFFSET 0x80000
// --- Page / Segment (Byte)
#define PAGE_SIZE 0x200
#define ONE_SEGMENT_SIZE 0x1000
// --- Page / Segment (Word)
#define PAGE_WORD_SIZE 0x80
#define ONE_SEGMENT_WORD_SIZE 0x400
// --- Rom Emulation
#define ROM_EMULATION_DATA_SIZE 0x20
// --- Thread
#define HOTSW_THREAD_STACK_SIZE (1024 * 2)
#define HOTSW_DMA_MSG_NUM 8
#define HOTSW_INSERT_MSG_NUM 16
#define HOTSW_PULLED_MSG_NUM 16
#define HOTSW_CTRL_MSG_NUM 8
#define HOTSW_MSG_BUFFER_NUM (HOTSW_INSERT_MSG_NUM + HOTSW_PULLED_MSG_NUM + HOTSW_CTRL_MSG_NUM)
#define HOTSW_POLLING_CTRL_BUFFER_NUM 4
// --- Card Control Reg 0
#define HOTSW_E2PROM_CTRL_MASK 0x00ff
// --- Card Control Reg 1
#define START_FLG_MASK 0x80000000
#define READY_FLG_MASK 0x00800000
#define LATENCY1_SHIFT 0
#define LATENCY1_MASK 0x00001fff
#define DS_SHIFT 13
#define DS_MASK 0x00002000
#define SE_SHIFT 14
#define SE_MASK 0x00004000
#define SCR_SHIFT 15
#define SCR_MASK 0x00008000
#define LATENCY2_SHIFT 16
#define LATENCY2_MASK 0x003f0000
#define CS_SHIFT 22
#define CS_MASK 0x00400000
#define RDY_SHIFT 23
#define RDY_MASK 0x00800000
#define PC_SHIFT 24
#define PC_MASK 0x07000000
#define CT_SHIFT 27
#define CT_MASK 0x08000000
#define TRM_SHIFT 28
#define TRM_MASK 0x10000000
#define RESB_SHIFT 29
#define RESB_MASK 0x20000000
#define WR_SHIFT 30
#define WR_MASK 0x40000000
#define START_SHIFT 31
#define START_MASK 0x80000000
#define SCRAMBLE_MASK 0x1040e000 // スクランブル関係のフラグマスク
#define SECURE_COMMAND_SCRAMBLE_MASK 0x00406000 // CS SE DSのマスク
// --- Page Count
#define PAGE_0 0x0UL << PC_SHIFT
#define PAGE_1 0x1UL << PC_SHIFT
#define PAGE_2 0x2UL << PC_SHIFT
#define PAGE_4 0x3UL << PC_SHIFT
#define PAGE_8 0x4UL << PC_SHIFT
#define PAGE_16 0x5UL << PC_SHIFT
#define PAGE_32 0x6UL << PC_SHIFT
#define PAGE_STAT 0x7UL << PC_SHIFT
// union ---------------------------------------------------------------------
typedef union
{
u64 dw;
u8 b[8];
} Cmd64;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // __HOTSW_TYPES_H__

View File

@ -1,535 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos - CARD - hotswDebug
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.
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <twl/os/common/format_rom.h>
#include "DEMO.h"
#include "hotswTypes.h"
#include "font.h"
#define SDK_MAKERCODE '10'
#define DIGEST_HASH_BLOCK_SIZE_SHA1 (512/8)
#define MY_TEMP_BUFFER_SIZE 0x80000
#define GAME_FIELD_START_ADDRESS 0x8000
#define READY_MASK 0x00800000
#define CARD_COMMAND_MASK 0x07000000
#define MY_ROMHEADER_TWL ((ROM_Header_Short *)HW_TWL_CARD_ROM_HEADER_BUF)
#define MY_ROMHEADER_NTR ((ROM_Header_Short *)HW_CARD_ROM_HEADER)
// ---------------------------------------------------------------
// HMACSHA1の鍵
static 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
};
static u32 checkBuf[MY_TEMP_BUFFER_SIZE/sizeof(u32)] ATTRIBUTE_ALIGN(16);
static ROM_Header_Short *rh;
static BOOL isTwlApplication;
static BOOL isTwlCard;
static BOOL flxhash, ltdhash, mirrorimage;
static u16 card_lock_id;
static u16 screen[32 * 32] ATTRIBUTE_ALIGN(HW_CACHE_LINE_SIZE);
// ---------------------------------------------------------------
static BOOL CheckHashValue(void* buf, u32 size, void* digest);
static void MY_LoadCard_arm7Static(void);
static void MY_LoadCard_arm7LtdStatic(void);
static void debugMessage(void);
static void ShowResult(void);
static void SetCommand(Cmd64 *cndLE);
static void ReadIDGame(void);
static void ReadPageGame(u32 start_addr, void* buf, u32 size);
static void ReadCardData(void* dest, s32 offset, s32 length);
static void isGameModeForNTR(void);
static void VBlankIntr (void);
static void PrintString (s16 x, s16 y, u8 palette, char *text, ...);
static void VolumeSwitchCallback(SNDEXResult result, void* arg);
/*---------------------------------------------------------------------------*
Name: NitroMain
Description: .
*---------------------------------------------------------------------------*/
void NitroMain(void)
{
CARDRomHeader *card_header = (void*)CARD_GetRomHeader();
OS_Init();
OS_InitTick();
CARD_Init();
GX_Init();
GX_DispOff();
GXS_DispOff();
if ( card_header->maker_code == SDK_MAKERCODE )
{
CARD_Enable(TRUE);
}
/* 表示設定初期化 */
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
MI_CpuClearFast((void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
(void)GX_DisableBankForLCDC();
MI_CpuFillFast((void*)HW_OAM, GX_LCD_SIZE_Y, HW_OAM_SIZE);
MI_CpuClearFast((void*)HW_PLTT, HW_PLTT_SIZE);
MI_CpuFillFast((void*)HW_DB_OAM, GX_LCD_SIZE_Y, HW_DB_OAM_SIZE);
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE);
GX_SetBankForBG(GX_VRAM_BG_128_A);
G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256,
GX_BG_COLORMODE_16,
GX_BG_SCRBASE_0xf800, // SCR ベースブロック 31
GX_BG_CHARBASE_0x00000, // CHR ベースブロック 0
GX_BG_EXTPLTT_01);
G2_SetBG0Priority(0);
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D);
GX_SetVisiblePlane(GX_PLANEMASK_BG0);
GX_LoadBG0Char(d_CharData, 0, sizeof(d_CharData));
GX_LoadBGPltt(d_PaletteData, 0, sizeof(d_PaletteData));
MI_CpuClearFast((void*)screen, sizeof(screen));
DC_FlushRange(screen, sizeof(screen));
GX_LoadBG0Scr(screen, 0, sizeof(screen));
/* 割込み設定 */
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
(void)GX_VBlankIntr(TRUE);
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
/* LCD 表示開始 */
GX_DispOn();
GXS_DispOn();
PrintString(0, 0, 0xa, "***** Card Mode Check *****");
// カードアプリタイプを判別。使うRom Header Buffer を切替える
if(MY_ROMHEADER_NTR->platform_code & PLATFORM_CODE_FLAG_TWL){
PrintString(0, 2, 0xf, "- TWL Application -");
isTwlApplication = TRUE;
rh = MY_ROMHEADER_TWL;
}
else{
PrintString(0, 2, 0xf, "- NTR Application -");
isTwlApplication = FALSE;
rh = MY_ROMHEADER_NTR;
}
OS_Printf("Buf Adr : 0x%08x\n", checkBuf);
// カードタイプの判別
isTwlCard = (*(vu32 *)(HW_BOOT_CHECK_INFO_BUF) & HOTSW_ROMID_TWLROM_MASK) ? TRUE : FALSE;
// 注rhの初期化が終わってから呼び出す
debugMessage();
// フラグの初期化
flxhash = FALSE;
ltdhash = FALSE;
mirrorimage = FALSE;
// ロックIDを取得しておく
card_lock_id = (u16)OS_GetLockID();
if(isTwlApplication){
MY_LoadCard_arm7Static();
MY_LoadCard_arm7LtdStatic();
}
else{
isGameModeForNTR();
}
ShowResult();
while(1){
DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
}
/*---------------------------------------------------------------------------*
Name: ShowResult
Description:
*---------------------------------------------------------------------------*/
static void ShowResult(void)
{
PrintString(0, 13, 0xf, "-- Result --");
if(flxhash && ltdhash){
if(isTwlCard){
PrintString(0, 15, 0x6, "Game2 Mode");
}
else{
PrintString(0, 15, 0x5, "Game Mode");
}
}
else if(mirrorimage){
PrintString(0, 15, 0x5, "Game Mode");
}
else{
PrintString(0, 15, 0x1, "Unknown Mode");
}
}
/*---------------------------------------------------------------------------*
Name: debugMessage
Description:
*---------------------------------------------------------------------------*/
static void debugMessage(void)
{
PrintString(0, 4, 0xf, "amr7 NmlRomOfs : 0x%08x", rh->sub_rom_offset);
PrintString(0, 5, 0xf, "amr7 LtdRomOfs : 0x%08x", rh->sub_ltd_rom_offset);
OS_TPrintf("amr7 NmlRomOfs : 0x%08x\n", rh->sub_rom_offset);
OS_TPrintf("amr7 NmlSize : 0x%08x\n", rh->sub_size);
OS_TPrintf("amr7 LtdRomOfs : 0x%08x\n", rh->sub_ltd_rom_offset);
OS_TPrintf("amr7 LtdSize : 0x%08x\n", rh->sub_ltd_size);
}
/*---------------------------------------------------------------------------*
Name: CheckHashValue
Description:
*---------------------------------------------------------------------------*/
static BOOL CheckHashValue(void* buf, u32 size, void* digest)
{
u8 sha1data[DIGEST_SIZE_SHA1];
BOOL retval = TRUE;
// クリア
MI_CpuClear8(sha1data, sizeof(sha1data));
// ARM7常駐モジュールのHash値照合
SVC_CalcHMACSHA1( sha1data,
buf,
size,
s_digestDefaultKey,
sizeof(s_digestDefaultKey) );
return SVC_CompareSHA1( sha1data, digest );
}
/*---------------------------------------------------------------------------*
Name: MY_LoadCard_arm7Static
Description: ARM7常駐モジュール
*---------------------------------------------------------------------------*/
static void MY_LoadCard_arm7Static(void)
{
BOOL result;
u32* pBuf = checkBuf;
CARD_LockRom(card_lock_id);
ReadCardData(pBuf, (s32)rh->sub_rom_offset, (s32)rh->sub_size);
CARD_UnlockRom(card_lock_id);
result = CheckHashValue(pBuf, rh->sub_size, (void *)rh->sub_static_digest);
if(result){
flxhash = TRUE;
PrintString(0, 7, 0x8, "Flx Area : Accessible");
}
else{
flxhash = FALSE;
PrintString(0, 7, 0x1, "Flx Area : Not Accessible");
}
}
/*---------------------------------------------------------------------------*
Name: MY_LoadCard_arm7LtdStatic
Description: ARM7拡張常駐モジュール
*---------------------------------------------------------------------------*/
static void MY_LoadCard_arm7LtdStatic(void)
{
BOOL result;
u32* pBuf = checkBuf;
CARD_LockRom(card_lock_id);
ReadCardData(pBuf, (s32)rh->sub_ltd_rom_offset, (s32)rh->sub_ltd_size);
CARD_UnlockRom(card_lock_id);
result = CheckHashValue(pBuf, rh->sub_ltd_size, (void *)rh->sub_ltd_static_digest);
if(result){
ltdhash = TRUE;
PrintString(0, 9, 0x8, "Ltd Area : Accessible");
}
else{
ltdhash = FALSE;
PrintString(0, 9, 0x1, "Ltd Area : Not Accessible");
}
}
/*---------------------------------------------------------------------------*
Name: isGameModeForNTR
Description: Gameモードかどうか判定する
*---------------------------------------------------------------------------*/
static void isGameModeForNTR(void)
{
u32 buf1[PAGE_SIZE/sizeof(u32)];
u32 buf2[PAGE_SIZE/sizeof(u32)];
int result;
/* Rom Header領域を読んで、Game領域のイメージが出てたらGameモード */
ReadCardData(buf1, (s32)0, (s32)PAGE_SIZE);
ReadCardData(buf2, (s32)GAME_FIELD_START_ADDRESS, (s32)PAGE_SIZE);
result = MI_CpuComp8( buf1, buf2, PAGE_SIZE );
if(result){
mirrorimage = FALSE;
PrintString(0, 7, 0x1, "Flx Area : Not Accessible");
}
else{
mirrorimage = TRUE;
PrintString(0, 7, 0x8, "Flx Area : Accessible");
}
}
/*---------------------------------------------------------------------------*
Name: HOTSWi_SetCommand
Description:
*---------------------------------------------------------------------------*/
static void SetCommand(Cmd64 *cndLE)
{
Cmd64 cndBE;
// ビッグエンディアンに直す
cndBE.b[7] = cndLE->b[0];
cndBE.b[6] = cndLE->b[1];
cndBE.b[5] = cndLE->b[2];
cndBE.b[4] = cndLE->b[3];
cndBE.b[3] = cndLE->b[4];
cndBE.b[2] = cndLE->b[5];
cndBE.b[1] = cndLE->b[6];
cndBE.b[0] = cndLE->b[7];
// MCCMD レジスタ設定
reg_MI_MCCMD0_A = *(u32*)cndBE.b;
reg_MI_MCCMD1_A = *(u32*)&cndBE.b[4];
}
/*---------------------------------------------------------------------------*
Name: ReadIDGame
Description: IDを読み込む
*---------------------------------------------------------------------------*/
static void ReadIDGame(void)
{
u32 id;
Cmd64 cndLE;
u32 rom_ctrl = *(vu32 *)(HW_CARD_ROM_HEADER + 0x60);
rom_ctrl = rom_ctrl & ~CARD_COMMAND_MASK;
// リトルエンディアンで作って
cndLE.dw = HSWOP_G_OP_RD_ID;
// MCCMD レジスタ設定
SetCommand(&cndLE);
// MCCNT0 レジスタ設定
reg_MI_MCCNT0_A = (u16)((reg_MI_MCCNT0_A & 0x00ff) | REG_MI_MCCNT0_E_MASK);
// MCCNT1 レジスタ設定
reg_MI_MCCNT1_A = rom_ctrl | START_MASK | PAGE_1;
while(reg_MI_MCCNT1_A & START_MASK){
while(!(reg_MI_MCCNT1_A & READY_MASK)){}
id = reg_MI_MCD1_A;
}
OS_Printf("Card ID : 0x%08x\n", id);
OS_SpinWait( 100 );
}
/*---------------------------------------------------------------------------*
Name: ReadPageGame
Description:
CT=150ns Pagecount=1page Latency=RomHeaderで指定の値
*---------------------------------------------------------------------------*/
static void ReadPageGame(u32 start_addr, void* buf, u32 size)
{
u32 loop, counter=0;
u64 i, page;
Cmd64 cndLE;
u32 rom_ctrl = *(vu32 *)(HW_CARD_ROM_HEADER + 0x60);
rom_ctrl = rom_ctrl & ~CARD_COMMAND_MASK;
page = (u32)(start_addr / PAGE_SIZE);
loop = (u32)(size / PAGE_SIZE);
loop = (size % PAGE_SIZE) ? loop + 1 : loop;
for(i=0; i<loop; i++){
// コマンド作成
cndLE.dw = HSWOP_G_OP_RD_PAGE;
cndLE.dw |= (page + i) << HSWOP_G_RD_PAGE_ADDR_SHIFT;
// MCCMD レジスタ設定
SetCommand(&cndLE);
// MCCNT0 レジスタ設定
reg_MI_MCCNT0_A = (u16)((reg_MI_MCCNT0_A & 0x00ff) | REG_MI_MCCNT0_E_MASK);
// MCCNT1 レジスタ設定
reg_MI_MCCNT1_A = rom_ctrl | START_MASK | PAGE_1;
while(reg_MI_MCCNT1_A & START_MASK){
while(!(reg_MI_MCCNT1_A & READY_MASK)){}
*((u32 *)buf + counter++) = reg_MI_MCD1_A;
}
}
OS_SpinWait( 100 );
}
/*---------------------------------------------------------------------------*
Name: ReadCardData
Description: (page途中)
*---------------------------------------------------------------------------*/
static void ReadCardData(void* dest, s32 offset, s32 length)
{
static u8 page_buffer[512];
u32 page_offset = (u32)(offset & -512);
u32 buffer_offset = (u32)(offset % 512);
u32 valid_length = 512 - buffer_offset;
u32 remain_length;
// 開始アドレスがページの途中
if ( offset % 512 )
{
ReadPageGame(page_offset, page_buffer, 512);
MI_CpuCopy8(page_buffer + buffer_offset, dest, (length < valid_length ? length : valid_length));
dest = (u8*)dest + valid_length;
offset += valid_length;
length -= valid_length;
if ( length < 0)
{
return;
}
}
remain_length = (u32)(length % 512);
ReadPageGame((u32)offset, dest, (u32)(length - remain_length));
// ケツがページ途中
if( remain_length ){
dest = (u8*)dest + (length - remain_length);
offset += length - remain_length;
ReadPageGame((u32)offset, page_buffer, 512);
MI_CpuCopy8(page_buffer, dest, remain_length);
}
}
/*---------------------------------------------------------------------------*
Name: VBlankIntr
Description:
*---------------------------------------------------------------------------*/
static void VBlankIntr (void)
{
/* 仮想スクリーンを VRAM に反映 */
DC_FlushRange(screen, sizeof(screen));
GX_LoadBG0Scr(screen, 0, sizeof(screen));
/* IRQ チェックフラグをセット */
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
}
/*---------------------------------------------------------------------------*
Name: PrintString
Description: 32
Arguments: x - x ( × 8 )
y - y ( × 8 )
palette -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
static void PrintString (s16 x, s16 y, u8 palette, char *text, ...)
{
va_list vlist;
char temp[32 + 2];
s32 i;
va_start(vlist, text);
(void)vsnprintf(temp, 33, text, vlist);
va_end(vlist);
*((u16*)(&temp[32])) = 0x0000;
for (i = 0; ; i++)
{
if (temp[i] == 0x00)
{
break;
}
screen[((y * 32) + x + i) % (32 * 32)] = (u16)((palette << 12) | temp[i]);
}
}

View File

@ -1,152 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - HOTSW - include
File: romSpec.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __HOTSW_ROMSPEC_H__
#define __HOTSW_ROMSPEC_H__
#ifdef __cplusplus
extern "C" {
#endif
// ROM memory map
#define HOTSW_PAGE_SIZE 0x200 // 512B
#define HOTSW_BOOT_SEG_SIZE 0x1000 // 4KB
#define HOTSW_LOAD_TABLE_SIZE 0x2000 // 8KB
#define HOTSW_KEYTABLE_AREA_SIZE 0x3000 // 12KB
#define HOTSW_KEYTABLE2_AREA_SIZE 0x3000 // 12KB
#define HOTSW_SECURE_AREA_SIZE 0x4000 // 16KB
#define HOTSW_SECURE2_AREA_SIZE 0x4000 // 16KB
#define HOTSW_ROMEMU_INFO_SIZE 0x20
#define HOTSW_BOOTSEGMENT_AREA_OFS 0x0000 // 0KB
#define HOTSW_KEYTABLE_AREA_OFS 0x1000 // 4KB
#define HOTSW_SECURE_AREA_OFS 0x4000 // 16KB
#define HOTSW_GAME_AREA_OFS 0x8000 // 32KB
#define HOTSW_SECURE2_AREA_OFS 0x3000 // 12KB
#define HOTSW_GAME2_AREA_OFS 0x7000 // 28KB
#define HOTSW_ROMEMU_INFO_OFS (HOTSW_SECURE_AREA_OFS - HOTSW_PAGE_SIZE + 0x160)
// ROM ID
#define HOTSW_ROMID_1TROM_MASK 0x80000000UL
#define HOTSW_ROMID_TWLROM_MASK 0x40000000UL
#define HOTSW_ROMID_RFSSUP_MASK 0x20000000UL
#define HOTSW_ROMID_SIZE_MASK 0x0000ff00UL
// ROM STATUS
#define HOTSW_ROMST_RFS_WARN_L1_MASK 0x00000004UL
#define HOTSW_ROMST_RFS_WARN_L2_MASK 0x00000008UL
#define HOTSW_ROMST_RFS_READY_MASK 0x00000020UL
// NORMAL command
#define HSWOP_N_OP_MASK 0xff00000000000000ULL
#define HSWOP_N_OP_SIZE 8
#define HSWOP_N_OP_RD_ID 0x9000000000000000ULL
#define HSWOP_N_OP_RD_PAGE 0x0000000000000000ULL
#define HSWOP_N_OP_WR_PAGE 0x8000000000000000ULL
#define HSWOP_N_OP_LD_TABLE 0x9f00000000000000ULL
#define HSWOP_N_OP_RD_CACHE_START 0x5800000000000000ULL
#define HSWOP_N_OP_RD_CACHE 0x6000000000000000ULL
#define HSWOP_N_OP_RD_CACHE_LAST 0x6800000000000000ULL
#define HSWOP_N_OP_RD_STAT 0xd600000000000000ULL
#define HSWOP_N_OP_RFS_BLK 0xb500000000000000ULL
#define HSWOP_N_OP_CHG_MODE 0x3c00000000000000ULL
#define HSWOP_N_OP_CHG2_MODE 0x3d00000000000000ULL
#define HSWOP_N_RD_ID_PAD 0x00ffffffffffffffULL
#define HSWOP_N_RD_PAGE_PAD 0x00fffffeff00ffffULL
#define HSWOP_N_CHG_MODE_PAD 0x00000000f00000ffULL
#define HSWOP_N_CHG2_MODE_PAD HSWOP_N_CHG_MODE_PAD
#define HSWOP_N_RD_PAGE_ADDR_SHIFT 33
#define HSWOP_N_RD_PAGE_ADDR_SIZE 23
#define HSWOP_N_RD_PAGE_ADDR_MASK 0x00fffffe00000000ULL
#define HSWOP_N_VAE_SHIFT 32
#define HSWOP_N_VAE_SIZE 24
#define HSWOP_N_VAE_MASK 0x00ffffff00000000ULL
#define HSWOP_N_VBI_SHIFT 8
#define HSWOP_N_VBI_SIZE 20
#define HSWOP_N_VBI_MASK 0x000000000fffff00ULL
// SECURE command
#define HSWOP_S_OP_MASK 0xf000000000000000ULL
#define HSWOP_S_OP_SIZE 4
#define HSWOP_S_OP_RD_ID 0x1000000000000000ULL
#define HSWOP_S_OP_RD_SEG 0x2000000000000000ULL
#define HSWOP_S_OP_PNG_ON 0x4000000000000000ULL
#define HSWOP_S_OP_PNG_OFF 0x6000000000000000ULL
#define HSWOP_S_OP_CHG_MODE 0xa000000000000000ULL
#define HSWOP_S_VA_SHIFT HSWOP_S_VB_SIZE
#define HSWOP_S_VA_SIZE 24
#define HSWOP_S_VA_MASK 0x00000ffffff00000ULL
#define HSWOP_S_VB_SHIFT 0
#define HSWOP_S_VB_SIZE 20
#define HSWOP_S_VB_MASK 0x00000000000fffffULL
#define HSWOP_S_VC_SHIFT (HSWOP_S_VA_SIZE + HSWOP_S_VB_SIZE)
#define HSWOP_S_VC_SIZE 16
#define HSWOP_S_VC_MASK 0x0ffff00000000000ULL
#define HSWOP_S_VD_SHIFT HSWOP_S_VA_SHIFT
#define HSWOP_S_VD_SIZE HSWOP_S_VA_SIZE
#define HSWOP_S_VD_MASK HSWOP_S_VA_MASK
// GAME command
#define HSWOP_G_OP_MASK 0xff00000000000000ULL
#define HSWOP_G_OP_SIZE 8
#define HSWOP_G_OP_RD_ID 0xb800000000000000ULL
#define HSWOP_G_OP_RD_UID 0xb900000000000000ULL
#define HSWOP_G_OP_RD_PAGE 0xb700000000000000ULL
#define HSWOP_G_OP_WR_PAGE 0x8000000000000000ULL
#define HSWOP_G_OP_RD_CACHE_START HSWOP_N_OP_RD_CACHE_START
#define HSWOP_G_OP_RD_CACHE HSWOP_N_OP_RD_CACHE
#define HSWOP_G_OP_RD_CACHE_LAST HSWOP_N_OP_RD_CACHE_LAST
#define HSWOP_G_OP_RD_STAT HSWOP_N_OP_RD_STAT
#define HSWOP_G_OP_RFS_BLK HSWOP_N_OP_RFS_BLK
#define HSWOP_G_RD_ID_PAD 0x00ffffffffffffffULL
#define HSWOP_G_RD_UID_PAD 0x00ffffffffffffffULL
#define HSWOP_G_RD_PAGE_PAD 0x00f0000000ffffffULL
#define HSWOP_G_RD_PAGE_ADDR_SHIFT 33
#define HSWOP_G_RD_PAGE_ADDR_SIZE 23
#define HSWOP_G_RD_PAGE_ADDR_MASK 0x000ffffe00000000ULL
#ifdef __cplusplus
} /* extern "C" */
#endif
/* __HOTSW_ROMSPEC_H__ */
#endif

View File

@ -1,249 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 ./etc/myGameBanner.bnr
BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD]
# don't have to edit
#
WramMapping $(MAKEROM_WRAM_MAPPING)
#
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
#
CardRegion Japan
#
# CommonClientKey: launcher deliver common client Key [TRUE/FALSE]
#
#CommonClientKey FALSE
#
# HwAESSlotB: launcher deliver HW AES slot B setting [TRUE/FALSE]
#
#HwAESSlotB FALSE
#
# HwAESSlotC: launcher deliver HW AES slot C setting [TRUE/FALSE]
#
#HwAESSlotC FALSE
#
# SDCardAccess: sd card access control [TRUE/FALSE]
#
#SDCardAccess FALSE
#
# NANDAccess: NAND access control [TRUE/FALSE]
#
#NANDAccess FALSE
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
###
#### 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]
#
Media GameCard
#
# Data only title : [TRUE/FALSE]
# don't have to edit
DataOnly FALSE
#
# Secure title : [TRUE/FALSE]
# don't have to edit
Secure FALSE
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
#GameCode ABCJ
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 32K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 16K
#
# Enable SubBannerFile
#SubBannerFile TRUE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot ../../systemMenu_RED/DSHashTable
Root /sign
File DSHashTable.bin
HostRoot $(MAKEROM_SRL_ROOT)
Root /srl
# File NA22E0.035 # 1st
# File NA22J0.024 # 2nd
# File NYZYE0.E81 # last-1
# File NYZZJ0.L57 # last
File NYRVJ0.J30 # max number of overlaies
File NALKJ1.879 # max overlay size
File NA39J0.357 # mario kart
}

View File

@ -1,48 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckDSHashTable
# 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_PLATFORM := TWL
TARGET_FIRM := SYSTEMMENU
override TWL_ARCHGEN := LIMITED
SRCS = main.c
TARGET_BIN = CheckDSHashTable.srl
ROM_SPEC = CheckDSHashTable.rsf
DS_HASH_TABLE_SRL_ROOT ?= D:/SRL
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
LLIBRARIES += libdht$(TWL_LIBSUFFIX).a
MAKEROM_FLAGS += -DMAKEROM_SRL_ROOT=$(DS_HASH_TABLE_SRL_ROOT)
#----------------------------------------------------------------------------
do-build: $(TARGETS)
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,285 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - tests - CheckDSHashTable
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <sysmenu/dht/dht.h>
#define HASH_PATH "/sign/DSHashTable.bin"
/*
CARD関数の代わりにFS関数で
DHTライブラリが実装されている前提である
*/
#define ROM_PATH "/srl"
#define DS_HASH_TABLE_NUMS 3000
#define DS_HASH_TABLE_SIZE (sizeof(DHTHeader) + DS_HASH_TABLE_NUMS * sizeof(DHTDatabase))
/*
DHTファイル読み込み先
*/
static u8 dht_buffer[DS_HASH_TABLE_SIZE] ATTRIBUTE_ALIGN(32);
static DHTFile *const dht = (DHTFile*)dht_buffer;
/*
Phase2用バッファ
*/
static DHTPhase2Work p2work;
/*
*/
#include <twl/ltdmain_begin.h>
static ROM_Header_Short rom_header ATTRIBUTE_ALIGN(32); // 使うのは DHT_DS_HEADER_SIZE だけ
static u8 rom_arm9[3*1024*1024] ATTRIBUTE_ALIGN(32);
static u8 rom_arm7[1024*1024] ATTRIBUTE_ALIGN(32);
#include <twl/ltdmain_end.h>
/*
API
*/
#if 1
// FS版 (arg == FSFile*)
static BOOL ReadImage(void* dest, s32 offset, s32 length, void* arg)
{
FSFile* fp = arg;
s32 result;
if ( !FS_SeekFile(fp, offset, FS_SEEK_SET) )
{
OS_TPrintf("Cannot seek to the offset (%d bytes).\n", offset);
return FALSE;
}
result = FS_ReadFile(fp, dest, length);
if ( result != length )
{
OS_TPrintf("Cannot read the data (%d bytes).\n", length);
return FALSE;
}
return TRUE;
}
static BOOL ReadImageEx(SVCHMACSHA1Context* ctx, s32 offset, s32 length, void* arg)
{
if ( !ReadImage(p2work.buffer, offset, length, arg) )
{
return FALSE;
}
DHT_CheckHashPhase2ExUpdate(ctx, p2work.buffer, length);
return TRUE;
}
#else
#ifdef SDK_ARM9
#define PAGE_SIZE 512
// CARD版 (arg == dma no)
static BOOL ReadImage(void* dest, s32 offset, s32 length, void* arg)
{
u32 dma = (u32)arg;
CARD_ReadRom(dma, (void*)offset, dest, (u32)length);
return TRUE;
}
#else
// HOTSW版 (arg == CardBootData* cdb)
#include <hotswTypes.h>
#include <dsCardCommon.h>
static BOOL ReadImage(void* dest, s32 offset, s32 length, void* arg)
{
HotSwState retval;
if ( offset % 512 )
{
static u8 page_buffer[512];
u32 page_offset = (u32)(offset & -512);
u32 buffer_offset = (u32)(offset % 512);
u32 valid_length = 512 - buffer_offset;
retval = ReadPageGame((CardBootData*)arg, page_offset, page_buffer, 512);
if (retval != HOTSW_SUCCESS)
{
return FALSE;
}
MI_CpuCopy8(page_buffer + buffer_offset, dest, (length < valid_length ? length : valid_length));
dest = (u8*)dest + valid_length;
offset += valid_length;
length -= valid_length;
if ( length < 0)
{
return TRUE;
}
}
retval = ReadPageGame((CardBootData*)arg, (u32)offset, dest, (u32)length);
return (retval == HOTSW_SUCCESS);
}
#endif
#endif
static void VBlankIntr( void )
{
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
}
/*
*/
static BOOL CheckValidation(FSFile* fp)
{
const DHTDatabase *db;
s32 result;
// ヘッダの読み込み
result = FS_ReadFile(fp, &rom_header, DHT_DS_HEADER_SIZE);
if ( result != DHT_DS_HEADER_SIZE )
{
OS_TPrintf("Cannot read ROM header.\n");
return FALSE;
}
// ARM9部分
if ( rom_header.main_size > sizeof(rom_arm9) )
{
OS_TPrintf("Too large main size (%d > %d).\n", rom_header.main_size, sizeof(rom_arm9));
return FALSE;
}
if ( !FS_SeekFile(fp, (s32)rom_header.main_rom_offset, FS_SEEK_SET) )
{
OS_TPrintf("Cannot seek to ARM9 static.\n");
return FALSE;
}
result = FS_ReadFile(fp, rom_arm9, (s32)rom_header.main_size);
if ( result != rom_header.main_size )
{
OS_TPrintf("Cannot read ARM9 static.\n");
return FALSE;
}
// ARM7部分
if ( rom_header.sub_size > sizeof(rom_arm7) )
{
OS_TPrintf("Too large sub size (%d > %d).\n", rom_header.sub_size, sizeof(rom_arm7));
return FALSE;
}
if ( !FS_SeekFile(fp, (s32)rom_header.sub_rom_offset, FS_SEEK_SET) )
{
OS_TPrintf("Cannot seek to ARM7 static.\n");
return FALSE;
}
result = FS_ReadFile(fp, rom_arm7, (s32)rom_header.sub_size);
if ( result != rom_header.sub_size )
{
OS_TPrintf("Cannot read ARM7 static.\n");
return FALSE;
}
// データベースの検索
db = DHT_GetDatabase(dht, &rom_header);
if ( !db )
{
return FALSE;
}
//OS_TPrintf("FOUND: 0x%08X: %.4s(%d)\n", db, db->game_code, db->rom_version);
// ハッシュ計算 (1) - 隠蔽可能なはず
if ( !DHT_CheckHashPhase1(db->hash[0], &rom_header, rom_arm9, rom_arm7) )
{
return FALSE;
}
// ハッシュ計算 (2) - 隠蔽は難しいか
if ( !DHT_CheckHashPhase2(db->hash[1], &rom_header, &p2work, ReadImage, fp) )
{
// ハッシュ計算 (2ex) - 隠蔽は難しいか (失敗した場合も見ておく)
if ( !DHT_CheckHashPhase2Ex(db->hash[1], &rom_header, (DHTPhase2ExWork*)&p2work, ReadImage, ReadImageEx, fp) )
{
return FALSE;
}
return FALSE;
}
// ハッシュ計算 (2ex) - 隠蔽は難しいか
if ( !DHT_CheckHashPhase2Ex(db->hash[1], &rom_header, (DHTPhase2ExWork*)&p2work, ReadImage, ReadImageEx, fp) )
{
return FALSE;
}
return TRUE;
}
void TwlMain(void)
{
OS_Init();
OS_InitTick();
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
// 割り込み許可----------------------------
(void)OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
(void)GX_VBlankIntr(TRUE);
FS_Init(FS_DMA_NOT_USE);
{
FSFile file;
if ( !FS_OpenFileEx(&file, HASH_PATH, FS_FILEMODE_R) )
{
OS_TPanic("Cannot open %s.\n", HASH_PATH);
}
// 署名ロード
if ( !DHT_PrepareDatabase(dht, &file) )
{
OS_TPanic("Cannot prepare the database.\n");
}
FS_CloseFile(&file);
}
// 本番
{
FSFile dir;
FSDirectoryEntryInfo info;
BOOL result;
result = FS_OpenDirectory(&dir, ROM_PATH, FS_FILEMODE_R);
if ( !result )
{
OS_TPanic("Cannot open " ROM_PATH ".\n");
}
while ( FS_ReadDirectory(&dir, &info) )
{
FSFile file;
OSTick begin;
char path[FS_ENTRY_LONGNAME_MAX+sizeof(ROM_PATH)+1];
if ( info.attributes & FS_ATTRIBUTE_IS_DIRECTORY )
{
OS_TPrintf("%s is directory.\n", info.longname);
continue;
}
STD_CopyString(path, ROM_PATH "/");
STD_ConcatenateString(path, info.longname);
if (!FS_OpenFileEx(&file, path, FS_FILEMODE_R))
{
OS_TPrintf("Cannot open %s.\n", path);
continue;
}
OS_TPrintf("\nTrying %s...\n", path);
begin = OS_GetTick();
if ( !CheckValidation(&file) )
{
OS_TPrintf("Failed. %d msec (includes loading static data).\n", (int)OS_TicksToMilliSeconds(OS_GetTick()-begin));
}
else
{
OS_TPrintf("Success. %d msec (includes loading static data).\n", (int)OS_TicksToMilliSeconds(OS_GetTick()-begin));
}
FS_CloseFile(&file);
}
FS_CloseDirectory(&dir);
}
OS_TPrintf("\nDone.\n");
OS_Terminate();
}

View File

@ -1,39 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlIPL - tests - CheckPreloadParameters
# 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$
#----------------------------------------------------------------------------
TWL_NANDAPP = TRUE
TARGET_PLATFORM = TWL
SRCS = main.c
TARGET_BIN = main.tad
include $(TWLSDK_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
SUBDIRS =
#----------------------------------------------------------------------------
do-build: $(TARGETS)
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,47 +0,0 @@
#! 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) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
#

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

View File

@ -1,457 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL - tests - CheckPreloadParameters
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 <twl/lcfg/common/TWLSettings.h>
void VBlankIntr(void);
OSOwnerInfoEx s_owner;
static char *s_strCountry[ 256 ];
static char *s_strRegion[ OS_TWL_REGION_MAX ];
static char *s_strUserColor[ OS_FAVORITE_COLOR_MAX ];
static char *s_strRatingOgn[ OS_TWL_PCTL_OGN_MAX ];
static char *s_strLanguage[ OS_LANGUAGE_CODE_MAX ];
/*---------------------------------------------------------------------------*
Name: TwlMain
Description: main
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void TwlMain(void)
{
char string[ 256 ];
int srcLen, dstLen;
OS_Init();
//---- interrupt setting
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
OS_EnableIrqMask(OS_IE_V_BLANK);
OS_EnableIrq();
GX_VBlankIntr(TRUE);
OS_GetOwnerInfoEx( &s_owner );
OS_TPrintf( "Language : %02x %s\n", s_owner.language, s_strLanguage[ s_owner.language ] );
OS_TPrintf( "UserColor : %02x %s\n", s_owner.favoriteColor, s_strUserColor[ s_owner.favoriteColor ] );
OS_TPrintf( "Birthday : %02d/%02d\n", s_owner.birthday.month, s_owner.birthday.day );
{
MI_CpuClear8( string, sizeof(string) );
srcLen = (int)s_owner.nickNameLength;
dstLen = sizeof(string);
STD_ConvertStringUnicodeToSjis( string, &dstLen, s_owner.nickName, &srcLen, NULL );
OS_TPrintf( "Nickname : %s\n", string );
MI_CpuClear8( string, sizeof(string) );
srcLen = (int)s_owner.commentLength;
dstLen = sizeof(string);
STD_ConvertStringUnicodeToSjis( string, &dstLen, s_owner.comment, &srcLen, NULL );
OS_TPrintf( "Comment : %s\n", string );
}
OS_TPrintf( "Country : %s\n", s_strCountry[ s_owner.country ] );
OS_TPrintf( "IsAgreeEULA : %s\n", OS_IsAgreeEULA() ? "Agree" : "Not agree" );
OS_TPrintf( "AgreedEULAVersion : %d\n", OS_GetAgreedEULAVersion() );
OS_TPrintf( "ROMHeaderEULAVersion : %d\n", OS_GetROMHeaderEULAVersion() );
OS_TPrintf( "AvailableWireless : %s\n", OS_IsAvailableWireless() ? "TRUE" : "FALSE" );
PMi_SetWirelessLED( OS_IsAvailableWireless() ? PM_WIRELESS_LED_ON : PM_WIRELESS_LED_OFF );
{
const LCFGTWLParentalControl *pPC = (const LCFGTWLParentalControl *)OS_GetParentalControlInfoPtr();
OS_TPrintf( "ParentalControls :\n");
OS_TPrintf( " isSetParentalControl : %s\n", pPC->flags.isSetParentalControl ? "TRUE" : "FALSE" );
OS_TPrintf( " PictoChat : %s\n", pPC->flags.pictoChat ? "TRUE" : "FALSE" );
OS_TPrintf( " DS Download : %s\n", pPC->flags.dsDownload ? "TRUE" : "FALSE" );
OS_TPrintf( " Browser : %s\n", pPC->flags.browser ? "TRUE" : "FALSE" );
OS_TPrintf( " WiiPoint : %s\n", pPC->flags.wiiPoint ? "TRUE" : "FALSE" );
OS_TPrintf( " PhotoExchange : %s\n", pPC->flags.photoExchange ? "TRUE" : "FALSE" );
OS_TPrintf( " UGC : %s\n", pPC->flags.ugc ? "TRUE" : "FALSE" );
OS_TPrintf( " RatingOgn : %s\n", pPC->ogn < LCFG_TWL_PCTL_OGN_MAX ? s_strRatingOgn[ pPC->ogn ] : s_strRatingOgn[ LCFG_TWL_PCTL_OGN_MAX ] );
OS_TPrintf( " RatingAge : %d\n", pPC->ratingAge );
OS_TPrintf( " SecretQ ID : %d\n", pPC->secretQuestionID );
OS_TPrintf( " Password : %s\n", pPC->password );
MI_CpuClear8( string, sizeof(string) );
srcLen = (int)pPC->secretAnswerLength;
dstLen = sizeof(string);
STD_ConvertStringUnicodeToSjis( string, &dstLen, pPC->secretAnswer, &srcLen, NULL );
OS_TPrintf( " SecretAnswer : %s\n", string );
}
{
int i;
const u8 *p = OS_GetMovableUniqueIDPtr();
OS_TPrintf( "MovableUniqueID :" );
for( i = 0; i < OS_TWL_HWINFO_MOVABLE_UNIQUE_ID_LEN; i++ ) {
if( ( i & 0x0f ) == 0 ) {
OS_TPrintf( "\n" );
}
OS_TPrintf( " %02x,", *p++ );
}
OS_TPrintf( "\n" );
}
OS_TPrintf( "ForceDisableWireless : %s\n", OS_IsForceDisableWireless() ? "TRUE" : "FALSE" );
OS_TPrintf( "Region : %02x %s\n", OS_GetRegion(), ( OS_GetRegion() == 0xff ) ? "Invalid" : s_strRegion[ OS_GetRegion() ] );
{
u8 string[ 16 ];
OS_GetSerialNo( string );
OS_TPrintf( "SerialNo : %s\n", string );
}
OS_TPrintf("***End of demo\n");
OS_Terminate();
}
/*---------------------------------------------------------------------------*
Name: VBlankIntr
Description: main
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void VBlankIntr(void)
{
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
}
static char *s_strRegion[] = {
"JAPAN",
"AMERICA",
"EUROPA",
"AUSTRALIA",
"CHINA",
"KOREA",
};
static char *s_strUserColor[] = {
"GRAY ",
"BROWN ",
"RED ",
"PINK ",
"ORANGE ",
"YELLOW ",
"LIME_GREEN",
"GREEN ",
"DARK_GREEN",
"SEA_GREEN ",
"TURQUOISE ",
"BLUE ",
"DARK_BLUE ",
"PURPLE ",
"VIOLET ",
"MAGENTA ",
};
static char *s_strLanguage[] = {
"JAPANESE",
"ENGLISH",
"FRENCH",
"GERMAN",
"ITALIAN",
"SPANISH",
"CHINESE",
"KOREAN",
};
static char *s_strRatingOgn[] = {
"CERO",
"ESRB",
"RESERVED2",
"USK",
"PEGI_GENERAL",
"RESERVED5",
"PEGI_PORTUGAL",
"PEGI_BBFC",
"OFLC",
"GRB",
"RESERVED_A",
"RESERVED_B",
"RESERVED_C",
"RESERVED_D",
"RESERVED_E",
"UNKNOWN",
};
static char *s_strCountry[] = {
"UNDEFINED ", // 未設定
"JAPAN ", // 日本
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"Anguilla ", // アンギラ
"ANTIGUA_AND_BARBUDA", // アンティグア・バーブーダ
"ARGENTINA ", // アルゼンチン
"ARUBA", // アルバ
"BAHAMAS", // バハマ
"BARBADOS", // バルバドス
"BELIZE", // ベリーズ
"BOLIVIA", // ボリビア
"BRAZIL", // ブラジル
"BRITISH_VIRGIN_ISLANDS", // 英領ヴァージン諸島
"CANADA", // カナダ
"CAYMAN_ISLANDS", // ケイマン諸島
"CHILE ", // チリ
"COLOMBIA", // コロンビア
"COSTA_RICA", // コスタリカ
"DOMINICA", // ドミニカ国
"DOMINICAN_REPUBLIC", // ドミニカ共和国
"ECUADOR", // エクアドル
"EL_SALVADOR", // エルサルバドル
"FRENCH_GUIANA", // フランス領ギアナ
"GRENADA", // グレナダ
"GUADELOUPE", // グアドループ
"GUATEMALA ", // グアテマラ
"GUYANA", // ガイアナ
"HAITI", // ハイチ
"HONDURAS", // ホンジュラス
"JAMAICA", // ジャマイカ
"MARTINIQUE", // マルティニーク
"MEXICO", // メキシコ
"MONTSERRAT", // モントセラト
"NETHERLANDS_ANTILLES", // オランダ領アンティル
"NICARAGUA", // ニカラグア
"PANAMA ", // パナマ
"PARAGUAY", // パラグアイ
"PERU", // ペルー
"ST_KITTS_AND_NEVIS", // セントキッツ・ネイビス
"ST_LUCIA", // セントルシア
"ST_VINCENT_AND_THE_GRENADINES", // セントビンセント・グレナディーン
"SURINAME", // スリナム
"TRINIDAD_AND_TOBAGO", // トリニダード・トバゴ
"TURKS_AND_CAICOS_ISLANDS", // タークス・カイコス諸島
"UNITED_STATES", // アメリカ
"URUGUAY ", // ウルグアイ
"US_VIRGIN_ISLANDS", // 米領バージン諸島
"VENEZUELA", // ベネズエラ
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"ALBANIA ", // アルバニア
"AUSTRALIA", // オーストラリア
"AUSTRIA", // オーストリア
"BELGIUM", // ベルギー
"BOSNIA_AND_HERZEGOVINA", // ボスニア・ヘルツェゴビナ
"BOTSWANA", // ボツワナ
"BULGARIA ", // ブルガリア
"CROATIA", // クロアチア
"CYPRUS", // キプロス
"CZECH_REPUBLIC", // チェコ
"DENMARK", // デンマーク
"ESTONIA", // エストニア
"FINLAND", // フィンランド
"FRANCE", // フランス
"GERMANY", // ドイツ
"GREECE", // ギリシャ
"HUNGARY ", // ハンガリー
"ICELAND", // アイスランド
"IRELAND", // アイルランド
"ITALY", // イタリア
"LATVIA", // ラトビア
"LESOTHO", // レソト
"LIECHTENSTEIN", // リヒテンシュタイン
"LITHUANIA", // リトアニア
"LUXEMBOURG", // ルクセンブルク
"MACEDONIA", // マケドニア
"MALTA ", // マルタ
"MONTENEGRO", // モンテネグロ
"MOZAMBIQUE", // モザンビーク
"NAMIBIA", // ナミビア
"NETHERLANDS", // オランダ
"NEW_ZEALAND", // ニュージーランド
"NORWAY", // ノルウェー
"POLAND", // ポーランド
"PORTUGAL", // ポルトガル
"ROMANIA", // ルーマニア
"RUSSIA ", // ロシア
"SERBIA", // セルビア
"SLOVAKIA", // スロバキア
"SLOVENIA", // スロベニア
"SOUTH_AFRICA", // 南アフリカ
"SPAIN", // スペイン
"SWAZILAND", // スワジランド
"SWEDEN", // スウェーデン
"SWITZERLAND", // スイス
"TURKEY", // トルコ
"UNITED_KINGDOM ", // イギリス
"ZAMBIA", // ザンビア
"ZIMBABWE", // ジンバブエ
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"TAIWAN ", // 台湾
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"SOUTH_KOREA ", // 韓国
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"HONG_KONG ", // ホンコン
"MACAU", // マカオ
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"INDONESIA ", // インドネシア
"SINGAPORE ", // シンガポール
"THAILAND ", // タイ
"PHILIPPINES", // フィリピン
"MALAYSIA", // マレーシア
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"CHINA ", // 中国
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UAE ", // アラブ首長国連邦
"INDIA ", // インド
"EGYPT ", // エジプト
"OMAN", // オマーン
"QATAR", // カタール
"KUWAIT", // クウェート
"SAUDI_ARABIA", // サウジアラビア
"SYRIA", // シリア
"BAHRAIN", // バーレーン
"JORDAN", // ヨルダン
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"UNKNOWN",
"OTHERS ",
"UNKNOWN ",
};

View File

@ -1,42 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - demos - FS - overlay
# 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
TWL_ARCHGEN = LIMITED
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = main.srl
SRCS = main.c loadSharedFont.c
LLIBRARIES += libsharedfont$(TWL_LIBSUFFIX).a libna$(TWL_LIBSUFFIX).a
ROM_SPEC = ROM-TS_nand.rsf
include $(TWLSDK_ROOT)/build/buildtools/commondefs
include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,263 +0,0 @@
#----------------------------------------------------------------------------
# Project: TwlSDK - include
# File: ROM-TS.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 "MY APP NAME"
#
# 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 ./etc/myGameBanner.bnr
BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr
#
# Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingNormalJump FALSE
#
# Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE]
#
#PermitLandingTmpJump FALSE
###
### 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
# MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD]
# don't have to edit
#
WramMapping $(MAKEROM_WRAM_MAPPING)
#
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
#
CardRegion ALL
#
# SDCardAccess: sd card access control [TRUE/FALSE]
#
#SDCardAccess FALSE
#
# NANDAccess: NAND access control [TRUE/FALSE]
#
#NANDAccess FALSE
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# Disp WiFiConnection Icon for Launcher [TRUE/FALSE]
#
#WiFiConnectionIcon FALSE
#
# Disp DSWireless Icon for Launcher [TRUE/FALSE]
#
#DSWirelessIcon FALSE
#
# Disable debug [TRUE/FALSE]
#
DisableDebug FALSE
#
# Agree EULA [TRUE/FALSE]
#
#AgreeEULA FALSE
#
# Agree EULA version [0 - 255]
#
#AgreeEULAVersion 0
###
#### END
}
AppendProperty
{
#
# Boot allowed Media: [GameCard]
#
Media NAND
#
# GameCode for TitleID : Your GameCode in 4 ascii words
#
#GameCode ABCJ
#
# Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PublicSaveDataSize 0K
#
# Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#
#PrivateSaveDataSize 0K
#
# Enable SubBannerFile
#SubBannerFile TRUE
#
# Use Shared2 file index: [0-65535]
#Shared2FileIndex 0
#
# Use Shared2 file size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M]
#Shared2FileSize 0K
#
# Game card power on: [TRUE/FALSE]
#
#GameCardOn FALSE
}
RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot $(MAKEROM_ROMROOT)
Root /
File $(MAKEROM_ROMFILES)
}
Rating
{
#
# Permited age to play for each rating organization [0 - 31, ALWAYS, FREE]
#
# Supported organization
# - CERO (OGN0) : for Japan
# - ESRB (OGN1) : for North America
# - BBFC (OGN2) : obsolete organization
# - USK (OGN3) : for German
# - PEGI_GEN (OGN4) : for Europe
# - PEGI_FINLAND (OGN5) : obsolete organization
# - PEGI_PRT (OGN6) : for Portugal
# - PEGI_BBFC (OGN7) : for UK
# - OFLC (OGN8) : for Australia and NewZealand
# - GRB (OGN9) : for Korea
# - OGN10 : reserved
# - OGN11 : reserved
# - OGN12 : reserved
# - OGN13 : reserved
# - OGN14 : reserved
# - OGN15 : reserved
#
# Available age [ 0 - 31 / ALWAYS / FREE ]
CERO FREE
# ESRB FREE
# USK FREE
# PEGI_GEN FREE
# PEGI_PRT FREE
# PEGI_BBFC FREE
# OFLC FREE
# GRB FREE
}

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: loadSharedFont.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 "loadSharedFont.h"
// extern data-----------------------------------------------------------------
// define data-----------------------------------------------------------------
#define FONT_LOAD_THREAD_PRIO 13
#define THREAD_STACK_SIZE 1024
// function's prototype-------------------------------------------------------
// global variable-------------------------------------------------------------
BOOL g_isSucceededLoad[ OS_SHARED_FONT_CN_KR_MAX + 1 ];
const char *str_fontname[ OS_SHARED_FONT_CN_KR_MAX + 1 ] = {
"SHARE_FONT_WW_L",
"SHARE_FONT_WW_M",
"SHARE_FONT_WW_S",
"SHARE_FONT_CN_L",
"SHARE_FONT_CN_M",
"SHARE_FONT_CN_S",
"SHARE_FONT_KR_L",
"SHARE_FONT_KR_M",
"SHARE_FONT_KR_S",
"SHARE_FONT_CN_KR_MAX",
};
// static variable-------------------------------------------------------------
static u64 s_fontLoadThreadStack[THREAD_STACK_SIZE / sizeof(u64)];
static OSThread s_fontLoadThread;
static OSTick s_fontLoadStartTick;
static u8 *s_pFontBuffer[ OS_SHARED_FONT_CN_KR_MAX + 1 ]; // 読み込みはテストなのでロード先はstatic変数にしている。
static BOOL s_isStarted = FALSE;
// const data------------------------------------------------------------------
// ============================================================================
// 共有フォントロード
// ============================================================================
BOOL LoadSharedFontInit( void )
{
u8 *pBuffer;
int size;
s_fontLoadStartTick = OS_GetTick();
// ロードスレッド生成
OS_CreateThread(&s_fontLoadThread,
LoadSharedFontThread,
NULL,
s_fontLoadThreadStack + THREAD_STACK_SIZE / sizeof(u64),
THREAD_STACK_SIZE, FONT_LOAD_THREAD_PRIO);
// フォントロード準備
if( !OS_InitSharedFont() ) {
OS_TPrintf( "OS_InitSharedFont failed.\n" );
return FALSE;
}
size = OS_GetSharedFontTableSize();
if( size < 0 ) {
OS_TPrintf( "OS_GetSharedTableSize failed.\n" );
return FALSE;
}
pBuffer = OS_Alloc( (u32)size );
if( pBuffer == NULL ) {
OS_TPrintf( "malloc failed.\n" );
return FALSE;
}
if( !OS_LoadSharedFontTable( pBuffer ) ) {
OS_TPrintf( "OS_LoadSharedTable failed.\n" );
return FALSE;
}
// ロードスレッド起動
OS_WakeupThreadDirect(&s_fontLoadThread);
s_isStarted = TRUE;
return TRUE;
}
void LoadSharedFontThread( void *arg )
{
#pragma unused(arg)
BOOL retval = TRUE;
OSSharedFontIndex i;
for( i = OS_SHARED_FONT_WW_L; i < OS_SHARED_FONT_CN_KR_MAX + 1; i++ ) {
int size;
OS_TPrintf( "%s read.\n", str_fontname[ i ] );
size = OS_GetSharedFontSize( i );
if( size < 0 ) {
OS_TPrintf( " get font size failed.\n" );
retval = FALSE;
}
// FSのキャッシュが怪しそうなので、とりあえずアラインメントをとっておく。
size = MATH_ROUNDUP( size, 32 );
s_pFontBuffer[ i ] = OS_Alloc( (u32)size );
if( s_pFontBuffer[ i ] == NULL ) {
OS_TPrintf( " malloc failed.\n" );
retval = FALSE;
}
if( OS_LoadSharedFont( i, s_pFontBuffer[ i ] ) ) {
OS_TPrintf( " load succeeded.\n" );
g_isSucceededLoad[ i ] = TRUE;
}else {
OS_TPrintf( " load failed.\n" );
g_isSucceededLoad[ i ] = FALSE;
retval = FALSE;
}
}
OS_TPrintf( "Shared Font load time = %dms\n", OS_TicksToMilliSeconds( OS_GetTick() - s_fontLoadStartTick ) );
}
BOOL IsFinishedLoadSharedFont( void )
{
if( s_isStarted ) {
return OS_IsThreadTerminated( &s_fontLoadThread );
}else {
return TRUE;
}
}

View File

@ -1,42 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: loadSharedFont.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 __LOAD_SHARED_FONT_H__
#define __LOAD_SHARED_FONT_H__
#include <twl.h>
#include <twl/os/common/sharedFont.h>
#ifdef __cplusplus
extern "C" {
#endif
// define data-------------------------------------------------------
// global variables--------------------------------------------------
extern BOOL g_isSucceededLoad[ OS_SHARED_FONT_CN_KR_MAX + 1 ];
extern const char *str_fontname[ OS_SHARED_FONT_CN_KR_MAX + 1 ];
// function----------------------------------------------------------
BOOL LoadSharedFontInit( void );
void LoadSharedFontThread( void *arg );
BOOL IsFinishedLoadSharedFont( void );
#ifdef __cplusplus
}
#endif
#endif // __LOAD_SHARED_FONT_H__

View File

@ -1,98 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - demos - FS - overlay
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 <nitro.h>
#include "DEMO.h"
#include "loadSharedFont.h"
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: NitroMain
Description:
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void NitroMain(void)
{
OS_Init();
OS_InitTick();
(void)OS_EnableIrq();
(void)OS_EnableInterrupts();
{
OSHeapHandle hh;
void *tmp;
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_TPanic("ARM9: Fail to create heap...\n");
}
(void)OS_SetCurrentHeap(OS_ARENA_MAIN, hh);
}
DEMOInitCommon();
DEMOInitVRAM();
DEMOInitDisplayBitmap();
DEMOHookConsole();
DEMOSetBitmapTextColor(GX_RGBA(31, 31, 0, 1));
DEMOSetBitmapGroundColor(DEMO_RGB_CLEAR);
DEMOStartDisplay();
FS_Init(FS_DMA_NOT_USE);
OS_TPrintf("--------------------------------\n"
"Shared Font sample.\n");
if( LoadSharedFontInit() ) {
while( !IsFinishedLoadSharedFont() ) {
OS_WaitVBlankIntr();
}
// 結果表示
{
int i;
int ox = 10;
int oy = 60;
DEMOFillRect(0, 0, GX_LCD_SIZE_X, GX_LCD_SIZE_Y, DEMO_RGB_CLEAR);
DEMOSetBitmapTextColor(GX_RGBA(0, 31, 0, 1));
DEMOSetBitmapTextColor(GX_RGBA(31, 31, 31, 1));
DEMODrawFrame(ox, oy, 240, 10 + ( OS_SHARED_FONT_CN_KR_MAX + 1 ) * 10, GX_RGBA( 0, 31, 0, 1));
for (i = 0; i < OS_SHARED_FONT_CN_KR_MAX + 1; ++i)
{
DEMODrawText(ox + 10, oy + 5 + i * 10, "%s load %s",
str_fontname[ i ], g_isSucceededLoad[ i ] ? "suceeded" : "failed");
}
}
DEMO_DrawFlip();
OS_WaitVBlankIntr();
}
OS_Terminate();
}

View File

@ -1,60 +0,0 @@
#! 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 =
#----------------------------------------------------------------------------
TARGET_FIRM = SYSTEMMENU
TARGET_PLATFORM = TWL
TWL_ARCHGEN = LIMITED
TARGET_NUMBER = 0
TARGET_NAME = CreateDevKP
TARGET_BIN = $(TARGET_NAME).srl
TITLEID_LO = CDKP
#TARGET_TAD = $(BINDIR)/$(TITLEID_LO).$(TWL_BUILD_DIR)$(CODEGEN_ARCH).tad
ROM_SPEC = main.rsf
MISC_DIR = ../../../systemMenu_RED/misc
SRCS = main.c RomTypeTest.c \
$(MISC_DIR)/src/misc.c $(MISC_DIR)/src/cmn.c
LINCLUDES = $(MISC_DIR)/include
MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)'
MAKETAD_FLAGS += -s
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
#LDIRT_CLEAN = $(TARGET_TAD)
#----------------------------------------------------------------------------
do-build : $(TARGETS)
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
#----------------------------------------------------------------------------
#===== End of Makefile =====

View File

@ -1,204 +0,0 @@
#----------------------------------------------------------------------------
# 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_0.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 ALL
#
# Codec mode:
# don't have to edit
#
CodecMode $(MAKEROM_CODEC_MODE)
#
# SDCardAccess: sd card access control [TRUE/FALSE]
#
#SDCardAccess TRUE
SDCardAccess FALSE
#
# NandAccess: nand access control [TRUE/FALSE]
#
NANDAccess TRUE
###
#### END
}
AppendProperty
{
#
# Publisher : "Nintendo"
# don't have to edit
Publisher Nintendo
#
# Application type : [USER/SYSTEM]
# don't have to edit
#AppType USER
AppType SYSTEM
#
# launch title on the launcher : [TRUE/FALSE]
# don't have to edit
Launch TRUE
#
# Boot allowed Media: [GameCard/NAND]
#
Media GameCard
#Media NAND
#
# Secure title : [TRUE/FALSE]
# don't have to edit
Secure TRUE
#Secure FALSE
#
# 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 ../../../systemMenu_RED/data
Root /data
File NTR_IPL_font_m.NFTR
}

View File

@ -1,143 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: DS_Chat.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 "RomTypeTest.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 ENABLE_CONTENT 0
#define ENABLE_SHARED2 0
#if (ENABLE_CONTENT == 1)
#define CTRUE TRUE
#else
#define CTRUE FALSE
#endif
#if (ENABLE_SHARED2 == 1)
#define STRUE TRUE
#else
#define STRUE FALSE
#endif
#define TEST_NUM 15
typedef enum AccessPermission {
PERMISSION_NA = 0,
PERMISSION_RO,
PERMISSION_RW,
PERMISSION_ERROR,
PERMISSION_MAX
}
AccessPermission;
// extern data------------------------------------------
// function's prototype declaration---------------------
static AccessPermission RWExTestCore( char *path, char *testfile );
static AccessPermission SRLTest( void );
static AccessPermission ContentTest( void );
static void FinalizeRWTest( FSFile *file, char* filename );
static AccessPermission RWTestCore( char *path, char *testfile );
static AccessPermission RWTest( char *path );
static void TestFSPermission( void );
// global variable -------------------------------------
RTCDrawProperty g_rtcDraw = {
TRUE, RTC_DATE_TOP_X, RTC_DATE_TOP_Y, RTC_TIME_TOP_X, RTC_TIME_TOP_Y
};
// static variable -------------------------------------
// const data -----------------------------------------
static BOOL CreateFile( void )
{
int len;
FSFile file[1];
FS_InitFile( file );
// ファイル作成テスト
if ( FS_CreateFile("nand:/sys/dev.kp", FS_PERMIT_R | FS_PERMIT_W) )
{
// ファイルオープン
if ( !FS_OpenFileEx( file, "nand:/sys/dev.kp", FS_FILEMODE_W ) )
{
// ファイルオープン失敗
OS_TPrintf("%s:open failed.\n","nand:/sys/dev.kp");
return FALSE;
}
// ファイルライト
len = FS_WriteFile( file, "test", 5);
if( len != 5 )
{
// ライト失敗
OS_TPrintf("%s:write failed.\n","nand:/sys/dev.kp");
return FALSE;
}
// ファイルクローズ
if( !FS_CloseFile( file ) )
{
// クローズ失敗
OS_TPrintf("%s:close failed.\n","nand:/sys/dev.kp");
return FALSE;
}
}else
{
OS_TPrintf("%s:create failed.\n","nand:/sys/dev.kp");
return FALSE;
}
return TRUE;
}
// テストプログラムの初期化
void RomTypeTestInit( void )
{
BOOL res;
GX_DispOff();
GXS_DispOff();
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
PrintfSJIS( 1 * 8, 9 * 8, TXT_COLOR_BLACK, "CreateFile");
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
GX_DispOn();
GXS_DispOn();
res = CreateFile();
if(res)
{
PutStringUTF16( 1 * 8, 11 * 8, TXT_COLOR_BLACK, (const u16 *)L"Succeed." );
}else
{
PutStringUTF16( 1 * 8, 11 * 8, TXT_COLOR_BLACK, (const u16 *)L"NG." );
}
}

View File

@ -1,35 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlIPL
File: RomTypeTest.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 __ROM_TYPE_TEST_H__
#define __ROM_TYPE_TEST_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <twl.h>
// define data----------------------------------------------------------
void RomTypeTestInit( void );
#ifdef __cplusplus
}
#endif
#endif // __ROM_TYPE_TEST_H__

View File

@ -1,85 +0,0 @@
/*---------------------------------------------------------------------------*
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 "RomTypeTest.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();
// システムの初期化------------------
InitAllocator();
InitBG();
RomTypeTestInit();
// メインループ----------------------------
while(1){
OS_WaitIrq(1, OS_IE_V_BLANK); // Vブランク割り込み待ち
ReadKeyPad(); // キー入力の取得
ReadTP(); // TP入力の取得
}
}
// ============================================================================
// 割り込み処理
// ============================================================================
// Vブランク割り込み
static void INTR_VBlank(void)
{
OS_SetIrqCheckFlag(OS_IE_V_BLANK); // Vブランク割込チェックのセット
}

View File

@ -1,30 +0,0 @@
#! 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 ARM9
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,48 +0,0 @@
#! 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
BNRNUM = 0
ICON_DIR = ./icon
BANNER_SPEC = test-utf16_$(BNRNUM)_v3.TWL.bsf
MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe
TARGETS = banner_$(BNRNUM).bnr
INSTALL_DIR = ./
INSTALL_TARGETS = $(TARGETS)
BANNER_ICON_NAME = $(basename $(BANNER_ICON))
LDIRT_CLEAN = $(TARGETS) \
$(TARGETS:.bnr=.srl)
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
#----------------------------------------------------------------------------
# build
#----------------------------------------------------------------------------
do-build: $(TARGETS)
$(TARGETS): $(BANNER_SPEC)
$(MAKEBANNER) -p TWL $(BANNER_SPEC) $(TARGETS)
#

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

View File

@ -1,74 +0,0 @@
#! 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
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 = main.c \
kami_pxi.c \
formatter.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.SCR.TWL.o
# スタック不足防止の為、インライン展開せずにコンパイルする
CCFLAGS_OPT = -O4 -inline off
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/commondefs
MACRO_FLAGS += -DSDK_ARM7COMP_LTD -DSDK_SEA
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 \
../common/include \
../../../systemMenu_tools/common/ARM7/include \
SRCDIR += ../../../systemMenu_tools/common/ARM7/src
LLIBRARIES += libwl_sp$(TWL_LIBSUFFIX).a \
libsdio_sp$(TWL_LIBSUFFIX).a \
libathdrv_sp$(TWL_LIBSUFFIX).a \
libwpa_sp$(TWL_LIBSUFFIX).a \
LDEPENDS_NEF = $(TWL_LIBS) $(LLIBRARIES)
do-build: $(TARGETS)
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#----------------------------------------------------------------------------
endif #ifndef TWLSDK_NOCRYPTO
#===== End of Makefile =====

View File

@ -1,86 +0,0 @@
#----------------------------------------------------------------------------
# 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#
# 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
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$(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
Object * (.wram)
Object * (.ltdwram)
Object * (.rsvwram)
Object * (.main)
Object * (.ltdmain)
}

View File

@ -1,44 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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
*---------------------------------------------------------------------------*/

View File

@ -1,262 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <twl/exi/ARM7/genPort2.h>
#include "kami_pxi.h"
#include "fifo.h"
#include "twl/cdc.h"
#include "formatter.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>
typedef unsigned char byte; /* Don't change */
typedef unsigned short word; /* Don't change */
typedef unsigned long dword; /* Don't change */
#define BOOLEAN int
extern BOOL FATFSi_nandRtfsIo( int driveno, dword block, void* buffer, word count, BOOLEAN reading);
extern BOOL sdmcFormatNandLog( BOOL verify_flag);
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#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_CLEAR_NAND_ERRORLOG:
case KAMI_GET_IS_TOOL_TYPE:
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_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_IS_TOOL_TYPE:
{
IsToolType type = IS_TOOL_TYPE_ERROR;
u8 temp = I2C_ReadRegister( I2C_SLAVE_DEBUGGER, 0);
if (temp != (u8)(-1)) // 赤箱、キャプチャ以外は通信エラー
{
if (temp == 0x44)
{
type = IS_TOOL_TYPE_DEBUGGER;
}
else if (temp == 0x43)
{
type = IS_TOOL_TYPE_CAPTURE;
}
}
KamiReturnResultEx(kamiWork.command, KAMI_PXI_RESULT_SUCCESS, sizeof(IsToolType), (u8*)&type);
}
break;
default:
KamiReturnResult(kamiWork.command, KAMI_PXI_RESULT_INVALID_COMMAND);
}
}
}
#include <twl/ltdmain_end.h>

View File

@ -1,576 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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 <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"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/* 各スレッド優先度 */
#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 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();
/* 各ライブラリ初期化 */
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); // マイコン
CDC_InitLib(); // 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);
///////////////
#ifndef NAND_INITIALIZER_LIMITED_MODE
KamiPxiInit();
#endif
///////////////
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ライブラリを初期化するFATFS初期化関数内でスレッド休止
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void
InitializeFatfs(void)
{
// FATFSライブラリの初期化
if(!FATFS_Init( FATFS_DMA_4, FATFS_DMA_5, THREAD_PRIO_FATFS))
{
// do nothing
}
}
//#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 -
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 -
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();
}
}

View File

@ -1,57 +0,0 @@
#----------------------------------------------------------------------------
# Project: SystemUpdater
# 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:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#
# 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)
}

View File

@ -1,150 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: SystemUpdater
# 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$
#----------------------------------------------------------------------------
#============================================================================
#製品鍵を使った書き込みを行う場合は、TwlIPL/build/buildtools/commondefsの"FIRM_USE_PRODUCT_KEYS=TRUE"を有効にしてください。
#============================================================================
# COMPILE SWITCH for build SystemUpdater
IGNORE_VERSION_CHECK ?= TRUE
# MAKEROM SWITCH for build SystemUpdater
SYSM_DISABLE_DEBUG ?= TRUE
TARGET_FIRM = SYSTEMMENU
TARGET_PLATFORM = TWL
TWL_ARCHGEN = LIMITED
#TARGET_CODEGEN = THUMB
TITLEID_LO = 0SUA
#TARGET_TAD =
TARGET_BIN = CustomSystemUpdater_$(SYSM_REGION).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 \
font_data.c \
graphics.c \
kami_font.c \
import.c \
hwi.c \
kami_pxi.c \
kami_write_nandfirm.c \
hw_info.c \
keypad.c \
kami_copy_file.c \
debugger_hw_reset_control.c \
debugger_card_rom.c
LINCLUDES = include \
../common/include \
$(ROOT)/build/libraries/lcfg/ARM9.TWL/include \
$(ROOT)/build/libraries/fs/common/include \
../../../systemMenu_tools/common/ARM9/include \
SRCDIR = src \
../../../systemMenu_tools/HWInfoWriter/ARM9/src \
../../../systemMenu_tools/common/ARM9/src \
#LCFILE = # using default
DATA_ROOT = ../data
ROMSET_FILE = ../romset
ROM_CHECKER = ../romchecker.rb
SUMAKER = ../sumaker.rb custom
#----------------------------------------------------------------------------
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
ifeq ($(IGNORE_VERSION_CHECK),TRUE)
MACRO_FLAGS += -DIGNORE_VERSION_CHECK
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 \
libsysmenu$(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
LLIBRARIES += $(SYSMENU_LIBS) $(SDK_APPEND_LIBS)
MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
#LDIRT_CLEAN =
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN)
#INSTALL_DIR = $(SDK_NMENU_DATADIR)
INSTALL_DIR = ../bin
#----------------------------------------------------------------------------
#include $(ROMSET_FILE)
.PHONY: build_time check_rom sumaker
check_rom:
ifeq ($(DISABLE_ROMCHECK),)
$(ROM_CHECKER) $(ROMSET) $(SYSM_REGION)
$(ROM_CHECKER) $(ROMSET) VERUP
endif
#ifeq ($(DISABLE_ROMCHECK),)
# $(ROM_CHECKER) $(DATA_ROOT)/$(ROMSET)
#endif
build_time:
echo -n "#define BUILD_TIME \"`date \"+%Y/%m/%d %H:%M:%S\"`\"" > include/build_time.h
sumaker:
$(SUMAKER) $(ROMSET) $(SYSM_REGION)
do-build: sumaker check_rom build_time $(TARGETS)
#include $(TWLSDK_ROOT)/build/buildtools/modulerules
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*
Project: SystemUpdater
File: graphics.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef GRAPHICS_H_
#define GRAPHICS_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <nitro.h>
/*---------------------------------------------------------------------------*
ŠÖ<EFBFBD>è`
*---------------------------------------------------------------------------*/
void InitGraphics(void);
void DrawLine(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color);
void DrawQuad(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color);
void DrawResult(BOOL result);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* GRAPHICS_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,71 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: process_hw_info.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef HW_INFO_H_
#define HW_INFO_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <nitro.h>
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: HW情報全体のライト
Description:
Arguments: region :
wirelessForceOff : OFFならTRUEを指定
Returns: None.
*---------------------------------------------------------------------------*/
BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff );
/*---------------------------------------------------------------------------*
Name: HWInfoファイルの削除
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
BOOL DeleteHWInfoFile( void );
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* HW_INFO_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*
Project: SystemUpdater
File: import.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef PROCESS_IMPORT_H_
#define PROCESS_IMPORT_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <nitro.h>
/*---------------------------------------------------------------------------*
Œ^è`
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
ŠÖ<EFBFBD>è`
*---------------------------------------------------------------------------*/
s32 kamiImportTad(int no, int total, const char* path);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PROCESS_IMPORT_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,41 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - SystemUpdater
File: kami_copy_file.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef KAMI_COPY_FILE_H_
#define KAMI_COPY_FILE_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <twl.h>
BOOL kamiCopyFile(char* srcPath, char* dstPath);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* KAMI_COPY_FILE_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,94 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: kami_font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef KAMI_FONT_H_
#define KAMI_FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <twl.h>
extern u8 prog_state;
enum
{ STATE_NONE, STATE_SELECT, STATE_KS_PARENTINIT, STATE_KS_PARENT, STATE_KS_CHILDINIT,
STATE_KS_CHILDSCAN, STATE_KS_CHILD
};
extern OSHeapHandle heapHandle; // Heapハンドル;
extern const u16 BgScDataMain[32 * 24];
extern const u16 BgScDataSub[32 * 24];
extern const u32 sampleCharData[8 * 0x100];
extern const u16 PlttDataObj[16][16];
extern const u16 PlttDataMain[16][16];
extern const u16 PlttDataSub[16][16];
void kamiFontInit(void);
void kamiFontClear(void);
void kamiFontClearMain(void);
void kamiFontPut(u16 x, u16 y, u16 color, u16 no);
void kamiFontPrintf(s16 x, s16 y, u8 color, char *text, ...);
void kamiFontPrintfMain(s16 x, s16 y, u8 color, char *text, ...);
void kamiFontFill(s16 x, s16 y, u8 color, s16 value, s32 length);
void kamiFontFillChar(int lineNo, u8 color1, u8 color2);
void kamiFontLoadScreenData(void);
void kamiFontPrintfConsole(u8 color, const char *text, ...);
void kamiFontPrintfConsoleEx(u8 color, const char *text, ...);
// 上画面コンソール文字列用パレット
#define CONSOLE_ORANGE 0
#define CONSOLE_RED 1
#define CONSOLE_GREEN 2
// 下画面フォント用パレット
#define FONT_COLOR_BLACK 0
#define FONT_COLOR_RED 1
#define FONT_COLOR_GREEN 2
#define FONT_COLOR_BLUE 3
#define FONT_COLOR_YELLOW 4
#define FONT_COLOR_CYAN 5
#define FONT_COLOR_PURPLE 6
// 下画面背景用パレット
#define BG_COLOR_TRANS 0
#define BG_COLOR_WHITE 1
#define BG_COLOR_BLACK 2
#define BG_COLOR_GRAY 3
#define BG_COLOR_PURPLE 4
#define BG_COLOR_PINK 5
#define BG_COLOR_BLUE 6
#define BG_COLOR_GREEN 7
#define BG_COLOR_VIOLET 8
#define BG_COLOR_RED 9
#define BG_COLOR_YELLOW 10
#define BG_COLOR_NONE 0xff
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* KAMI_FONT_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,89 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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 kamiNandIo(u32 block, void* buffer, u32 count, BOOL is_read);
KAMIResult kamiClearNandErrorLog( void );
KAMIResult kamiGetIsToolType( IsToolType *pType );
// (重要)
// 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);
}
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* TWL_KAMI_TEST_KAMITEST_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,52 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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 kamiWriteNandfirm(const char* pFullPath, NAMAlloc allocFunc, NAMFree freeFunc);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* KAMI_WRITE_NAND_FIRM */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,48 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: keypad.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef KAMI_KEY_PAD_H_
#define KAMI_KEY_PAD_H_
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
#include <nitro.h>
/*---------------------------------------------------------------------------*
ŠÖ<EFBFBD>è`
*---------------------------------------------------------------------------*/
void kamiPadRead(void);
BOOL kamiPadIsTrigger(u16 key);
BOOL kamiPadIsRepeatTrigger(u16 key);
BOOL kamiPadIsPress(u16 key);
/*===========================================================================*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* KAMI_KEY_PAD_H_ */
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,734 +0,0 @@
/*---------------------------------------------------------------------------*
Project: SystemUpdater
File: font_data.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <nitro.h>
/*---------------------- BGスクリーン ---------------------------*/
const u16 BgScDataMain[32 * 24] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
const u16 BgScDataSub[32 * 24] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
/*---------------------- パレットデータ ---------------------------*/
#define RGB555(r,g,b) (b<<10|g<<5|r)
const u16 PlttDataObj[16][16] = {
{RGB555( 0, 0, 0), RGB555(31, 10, 0), RGB555(31, 0, 0), RGB555(5, 5, 20),}, // Black
{RGB555(31, 31, 31), RGB555(31, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // Red
{RGB555(31, 31, 31), RGB555(0, 31, 0), RGB555(0, 31, 0), RGB555(0, 31, 0),}, // Green
{RGB555(31, 31, 31), RGB555(0, 0, 31), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue
{RGB555(31, 31, 31), RGB555(31, 31, 0), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // Yellow
{RGB555(31, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31),}, // Cyan
{RGB555(31, 31, 31), RGB555(31, 0, 31), RGB555(31, 0, 31), RGB555(31, 0, 31),}, // Purple
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
};
// 上画面コンソール文字列パレット
const u16 PlttDataMain[16][16] = {
{RGB555(31, 31, 31), RGB555(31, 10, 0), RGB555(0, 0, 0), RGB555(0, 0, 0),}, // Orange
{RGB555(31, 31, 31), RGB555(31, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // Red
{RGB555(31, 31, 31), RGB555(0, 31, 0), RGB555(0, 31, 0), RGB555(0, 31, 0),}, // Green
{RGB555(31, 31, 31), RGB555(0, 0, 31), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue
{RGB555(31, 31, 31), RGB555(31, 31, 0), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // Yellow
{RGB555(31, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31), RGB555(0, 31, 31),}, // Cyan
{RGB555(31, 31, 31), RGB555(31, 0, 31), RGB555(31, 0, 31), RGB555(31, 0, 31),}, // Purple
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555( 5, 5, 5), RGB555( 5, 5, 5), RGB555( 5, 5, 5), RGB555(31, 31, 31),}, // Black
};
// 下画面コンソール文字列パレット
const u16 PlttDataSub[16][16] = {
{RGB555(31, 31, 31), RGB555( 0, 0, 0), RGB555(25, 25, 25), RGB555(31, 31, 31),}, // Black
{RGB555(31, 31, 31), RGB555(21, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // Red
{RGB555(31, 31, 31), RGB555( 0, 21, 0), RGB555(0, 31, 0), RGB555(0, 31, 0),}, // Green
{RGB555(31, 31, 31), RGB555( 0, 0, 21), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue
{RGB555(31, 31, 31), RGB555(21, 21, 0), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // Yellow
{RGB555(31, 31, 31), RGB555(0, 21, 21), RGB555(0, 31, 31), RGB555(0, 31, 31),}, // Cyan
{RGB555(31, 31, 31), RGB555(21, 0, 21), RGB555(31, 0, 31), RGB555(31, 0, 31),}, // Purple
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(20, 20, 20), RGB555(20, 20, 20), RGB555(20, 20, 20),}, // Gray
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
// 背景カラーはこの16番パレット
// 白 黒 灰 むらさき ピンク みずいろ 緑 青紫 赤 黄
{RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555( 0, 0, 0), RGB555(20, 20, 20), RGB555(31, 15, 31), RGB555(31, 20, 20), RGB555(20, 29, 31), RGB555(20, 31, 20), RGB555(21, 21, 31), RGB555(31, 0, 0), RGB555(31, 31, 10), RGB555(31, 31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31), } // White
};
/*---------------------- キャラクタデータ -------------------------*/
const u32 sampleCharData[8 * 0x100] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x11111111, 0x11111111, // 0001h use for import progress bar
0x11111111, 0x11111111, 0x00000000, 0x00000000,
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 0
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, // 00dfh 1
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00011110, 0x00001000, 0x00000100, // 00e0h 2
0x00101001, 0x01010001, 0x01010001, 0x00001100,
0x00000000, 0x00000000, 0x00001100, 0x00010010, // 00e1h 3
0x00010010, 0x00100001, 0x01000000, 0x00000000,
0x00000000, 0x01111101, 0x00100001, 0x01111101, // 00e2h 4
0x00100001, 0x00111001, 0x01100101, 0x00011001,
0x00000000, 0x00111100, 0x00010000, 0x00111100, // 00e3h 5
0x00010000, 0x00011100, 0x00110010, 0x00001100,
0x00000000, 0x00001110, 0x00101000, 0x00101000, // 00e4h 6
0x00111110, 0x01100101, 0x00100101, 0x00010010,
0x00000000, 0x00000100, 0x00101111, 0x01000100, // 00e5h 7
0x00000110, 0x01000101, 0x01000101, 0x00111110,
0x00000000, 0x00100010, 0x00100010, 0x00111110, // 00e6h 8
0x01010010, 0x01010101, 0x01001101, 0x00100110,
0x00000000, 0x00000100, 0x00011111, 0x00000010, // 00e7h 9
0x00011111, 0x01000010, 0x01000010, 0x00111100,
0x00000000, 0x00010010, 0x00111110, 0x01010011, // 00e8h 10
0x01000010, 0x00100100, 0x00000100, 0x00000100,
0x00000000, 0x00001000, 0x00111101, 0x01001011, // 00e9h 11
0x01001001, 0x01001001, 0x00111000, 0x00000100,
0x00000000, 0x00001000, 0x00111000, 0x00001000, // 00eah 12
0x00001000, 0x00011110, 0x00101001, 0x00000110,
0x00000000, 0x00011000, 0x00100000, 0x00000100, // 00ebh 13
0x00111010, 0x01000110, 0x01000000, 0x00111000,
0x00000000, 0x01000010, 0x01000010, 0x01000010, // 00ech 14
0x01000110, 0x01000000, 0x00100000, 0x00011000,
0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00edh 15
0x01000011, 0x01001100, 0x01010010, 0x00111100,
0x00000000, 0x00100010, 0x00110011, 0x00101010, // 00eeh 16
0x00100110, 0x00100010, 0x00100011, 0x01000010,
0x00000000, 0x00111110, 0x00010000, 0x00111100, // 00efh 17
0x01000011, 0x01000000, 0x01000010, 0x00111100,
0x00000000, 0x00000010, 0x00111011, 0x01000110, // 00f0h 18
0x01000010, 0x01000011, 0x01000010, 0x00110010,
0x00000000, 0x00000100, 0x00000100, 0x00000010, // 00f1h 19
0x01000110, 0x01000101, 0x01000101, 0x00111001,
0x00000000, 0x01010100, 0x01111111, 0x00100100, // 00f2h 20
0x00100100, 0x00100100, 0x00100010, 0x00010001,
0x00000000, 0x01010100, 0x01011111, 0x00000100, // 00f3h 21
0x00111111, 0x00001000, 0x00001000, 0x00001000,
0x00000000, 0x01011110, 0x01100010, 0x00100010, // 00f4h 22
0x00100001, 0x00100000, 0x00010000, 0x00001100,
0x00000000, 0x01010010, 0x01111110, 0x00100010, // 00f5h 23
0x00100001, 0x00100000, 0x00010000, 0x00001100,
0x33330000,
0x33330000,
0x33000000,
0x33000000, // 00f6h
0x33000000,
0x33000000,
0x33330000,
0x33330000,
0x00020000, // 00f7h
0x00020000,
0x00020000,
0x22222222,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000, // 00f8h
0x00000000,
0x00000000,
0x00000000,
0x11111111,
0x11111111,
0x11111111,
0x11111111,
0x11111111, // 00f9h
0x11111111,
0x11111111,
0x11111111,
0x11111111,
0x11111111,
0x11111111,
0x11111111,
0x11111111, // 00fah
0x11111111,
0x11111111,
0x11111111,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000, // 00fbh
0x00000000,
0x00000000,
0x22222222,
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00020000, // 00fch
0x00020000,
0x00020000,
0x22222222,
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00020000, // 00fdh
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00020000,
0x00000000, // 00feh
0x00000000,
0x00000000,
0x22222222,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00020000,
0x00220000,
0x02122222,
0x21111112,
0x21111112,
0x02122222,
0x00220000,
0x00020000,
/*
0x00022222,
0x00002112,
0x00021112,
0x00211122,
0x02111202,
0x21112000,
0x02120000,
0x00200000,
*/
/*
0x00000000, 0x01011110, 0x01010000, 0x00111111, // 00ffh
0x00001000, 0x00001000, 0x00001000, 0x00000110
*/
};
/*---------------------------------------------------------------------------*
End of file
*---------------------------------------------------------------------------*/

View File

@ -1,199 +0,0 @@
/*---------------------------------------------------------------------------*
Project: SystemUpdater
File: praphics.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
//#include <twl/mic.h>
#include <nitro/snd.h>
#include "kami_font.h"
#include "graphics.h"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: InitGraphics
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
void
InitGraphics(void)
{
GX_DispOff();
GXS_DispOff();
//---- VRAM クリア
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
//---- OAMとパレットクリア
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE);
MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE);
MI_CpuFillFast((void *)HW_DB_OAM, 192, HW_DB_OAM_SIZE);
MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE);
//---- OBJバンクの設定
GX_SetBankForOBJ(GX_VRAM_OBJ_128_A);
GX_SetBankForSubOBJ(GX_VRAM_SUB_OBJ_128_D);
//---- BGバンクの設定
GX_SetBankForBG(GX_VRAM_BG_128_B);
GX_SetBankForSubBG(GX_VRAM_SUB_BG_128_C);
//---- 表示モード設定
GX_SetGraphicsMode (GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_3D);
GX_SetVisiblePlane (GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1 | GX_PLANEMASK_OBJ);
GXS_SetVisiblePlane(GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1 | GX_PLANEMASK_OBJ);
//---- 3D初期化
G3X_Init();
G3X_InitMtxStack();
G2_SetBG0Priority(3);
G3X_AlphaTest(FALSE, 0);
G3X_AntiAlias(TRUE);
G3X_EdgeMarking(FALSE);
G3X_SetFog(FALSE, (GXFogBlend)0, (GXFogSlope)0, 0);
G3X_SetClearColor(0, 0, 0x7fff, 63, FALSE);
G3_ViewPort(0, 0, 255, 191);
G3_MtxMode(GX_MTXMODE_POSITION_VECTOR);
//---- 32KバイトのOBJで2Dマップモードで使用
GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_2D);
// スクリーンオフセット及びキャラクターオフセットの設定
GX_SetBGScrOffset(GX_BGSCROFFSET_0x00000);
GX_SetBGCharOffset(GX_BGCHAROFFSET_0x10000);
G2_SetBG1Control(
GX_BG_SCRSIZE_TEXT_256x256,
GX_BG_COLORMODE_16,
GX_BG_SCRBASE_0x0000 ,
GX_BG_CHARBASE_0x00000,
GX_BG_EXTPLTT_01
);
G2S_SetBG0Control(
GX_BG_SCRSIZE_TEXT_256x256,
GX_BG_COLORMODE_16,
GX_BG_SCRBASE_0x0000 ,
GX_BG_CHARBASE_0x04000,
GX_BG_EXTPLTT_01
);
G2S_SetBG1Control(
GX_BG_SCRSIZE_TEXT_256x256,
GX_BG_COLORMODE_16,
GX_BG_SCRBASE_0x2000 ,
GX_BG_CHARBASE_0x04000,
GX_BG_EXTPLTT_01
);
G2_BG1Mosaic(FALSE);
G2S_BG1Mosaic(FALSE);
//---- データロード
GX_LoadOBJ ( sampleCharData, 0, sizeof(sampleCharData));
GX_LoadBG1Char( sampleCharData, 0, sizeof(sampleCharData));
GX_LoadBGPltt ( PlttDataMain, 0, sizeof(PlttDataMain));
GX_LoadBG1Scr ( BgScDataMain, 0, sizeof(BgScDataMain));
GX_LoadOBJPltt( PlttDataObj, 0, sizeof(PlttDataObj));
GXS_LoadOBJ ( sampleCharData, 0, sizeof(sampleCharData));
GXS_LoadBG0Char( sampleCharData, 0, sizeof(sampleCharData));
GXS_LoadBGPltt ( PlttDataSub, 0, sizeof(PlttDataSub));
GXS_LoadBG0Scr ( BgScDataSub, 0, sizeof(BgScDataSub));
GXS_LoadOBJPltt( PlttDataObj, 0, sizeof(PlttDataObj));
GX_DispOn();
GXS_DispOn();
}
/*---------------------------------------------------------------------------*
Name: DrawLine
Description:
Arguments: sx -
sy -
ex -
ey -
color -
Returns: None.
*---------------------------------------------------------------------------*/
void
DrawLine(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color)
{
fx16 fsx = (fx16)(((sx - 128) * 0x1000) / 128);
fx16 fsy = (fx16)(((96 - sy) * 0x1000) / 96);
fx16 fex = (fx16)(((ex - 128) * 0x1000) / 128);
fx16 fey = (fx16)(((96 - ey) * 0x1000) / 96);
G3_Begin(GX_BEGIN_TRIANGLES);
{
G3_Color( color );
G3_Vtx(fsx, fsy, 0);
G3_Color( color );
G3_Vtx(fex, fey, 0);
G3_Color( color );
G3_Vtx(fsx, fsy, 1);
}
G3_End();
}
/*---------------------------------------------------------------------------*
Name: DrawQuad
Description:
Arguments: sx -
sy -
ex -
ey -
color -
Returns: None.
*---------------------------------------------------------------------------*/
void
DrawQuad(s16 sx, s16 sy, s16 ex, s16 ey, GXRgb color)
{
fx16 fsx = (fx16)(((sx - 128) * 0x1000) / 128);
fx16 fsy = (fx16)(((96 - sy) * 0x1000) / 96);
fx16 fex = (fx16)(((ex - 128) * 0x1000) / 128);
fx16 fey = (fx16)(((96 - ey) * 0x1000) / 96);
G3_Begin(GX_BEGIN_QUADS);
{
G3_Color( color );
G3_Vtx(fsx, fsy, 0);
G3_Color( color );
G3_Vtx(fex, fsy, 0);
G3_Color( color );
G3_Vtx(fex, fey, 0);
G3_Color( color );
G3_Vtx(fsx, fey, 0);
}
G3_End();
}

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - SystemUpdater
File: hw_info.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <nitro/snd.h>
#include <twl/fatfs.h>
#include <twl/lcfg.h>
#include <nitro/card.h>
#include <sysmenu/namut.h>
#include "kami_font.h"
#include "kami_pxi.h"
#include "hwi.h"
#include "hw_info.h"
//
#include "TWLHWInfo_api.h"
#include "TWLSettings_api.h"
//
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
BOOL WriteHWNormalInfoFile( void );
BOOL WriteHWSecureInfoFile( u8 region );
BOOL DeleteHWInfoFile( void );
/*---------------------------------------------------------------------------*
Name: HW情報全体のライト
Description:
Arguments: region :
Returns: None.
*---------------------------------------------------------------------------*/
BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff )
{
static const char *pMsgSecureWriting = "Writing Secure File...";
static const char *pMsgNormalWriting = "Writing Normal File...";
static const char *pMsgSignWriting = "Writing Sign File...";
static const char *pMsgSucceeded = "Success!\n";
static const char *pMsgFailed = "Failed!\n";
u32 installedSoftBoxCount = 0;
BOOL result = TRUE;
// セキュアファイルのライト
if( HWI_WriteHWSecureInfoFile( region, NULL, wirelessForceOff ) ) { // とりあえず無線は有効で。
// kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE;
}
// ノーマルファイルのライト(移行可能なユニークIDのためにセキュアファイルの後で書き込む
if( HWI_WriteHWNormalInfoFile() ) {
// kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE;
}
// HWID署名ファイルのライト
if( HWI_WriteHWIDSignFile() ) {
// kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE;
}
// CFGデータの修正
if (!HWI_ModifyLanguage( region ))
{
kamiFontPrintfConsoleEx(CONSOLE_RED, "Fail! Write TWLSettings\n" );
result = FALSE;
}
return result;
}
/*---------------------------------------------------------------------------*
Name: HWInfoファイルの削除
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
BOOL DeleteHWInfoFile( void )
{
static const char *pMsgNormalDeleting = "Deleting Normal File...";
static const char *pMsgSecureDeleting = "Deteting Secure File...";
static const char *pMsgSucceeded = "Success!\n";
static const char *pMsgFailed = "Failed!\n";
BOOL result = TRUE;
// ノーマルファイル
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgNormalDeleting );
if( HWI_DeleteHWNormalInfoFile() ) {
OS_TPrintf( "%s delete succeeded.\n", (char *)LCFG_TWL_HWINFO_NORMAL_PATH );
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
OS_TPrintf( "%s delete failed.\n", (char *)LCFG_TWL_HWINFO_NORMAL_PATH );
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE;
}
// セキュアファイル
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSecureDeleting );
if( HWI_DeleteHWSecureInfoFile() ) {
OS_TPrintf( "%s delete succeeded.\n", (char *)LCFG_TWL_HWINFO_SECURE_PATH );
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else {
OS_TPrintf( "%s delete failed.\n", (char *)LCFG_TWL_HWINFO_SECURE_PATH );
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE;
}
return result;
}

View File

@ -1,194 +0,0 @@
/*---------------------------------------------------------------------------*
Project: SystemUpdater
File: process_import.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <nitro/snd.h>
#include <twl/fatfs.h>
#include <nitro/card.h>
#include <twl/nam.h>
#include <twl/lcfg.h>
#include <sysmenu/namut.h>
#include "kami_font.h"
#include "import.h"
#include "hw_info.h"
#include "TWLHWInfo_api.h"
#include "graphics.h"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#define THREAD_STACK_SIZE (16*1024)
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
static u32 sCurrentProgress;
static vu8 sNowImport = FALSE;
static vu8 sProgress = FALSE;
static u8 sStack[THREAD_STACK_SIZE];
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
static void ProgressThread(void* arg);
static void Destructor(void* arg);
void ProgressDraw(f32 ratio);
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name: kamiImportTad
Description: .tad
Arguments: no
Returns: None.
*---------------------------------------------------------------------------*/
s32 kamiImportTad(int no, int total, const char* path)
{
NAMTadInfo tadInfo;
OSThread thread;
s32 nam_result;
kamiFontPrintfMain( 4, 9, 8, "Now Updating... %d / %d", no, total );
kamiFontLoadScreenData();
// tadファイルの情報取得
nam_result = NAM_ReadTadInfo(&tadInfo, path);
if ( nam_result != NAM_OK )
{
return nam_result;
}
// ESの仕様で古い e-ticket があると新しい e-ticket を使ったインポートができない
// 暫定対応として該当タイトルを完全削除してからインポートする
nam_result = NAM_DeleteTitleCompletely(tadInfo.titleInfo.titleId);
if ( nam_result != NAM_OK )
{
kamiFontPrintfConsole(CONSOLE_RED, "Fail! RetCode=%x\n", nam_result);
return FALSE;
}
// インポート開始フラグを立てる
sNowImport = TRUE;
// 進捗スレッド作成
MI_CpuClear8(sStack, THREAD_STACK_SIZE);
OS_CreateThread(&thread, ProgressThread, NULL,
(void*)((u32)sStack + THREAD_STACK_SIZE), THREAD_STACK_SIZE, OS_GetCurrentThread()->priority - 1);
OS_WakeupThreadDirect(&thread);
// Import開始
nam_result = NAM_ImportTad( path );
// インポート開始フラグを下げる
sNowImport = FALSE;
// 進捗スレッドの自力終了を待つ
while (sProgress){};
// InstalledSoftBoxCount, FreeSoftBoxCount の値を現在のNANDの状態に合わせて更新します。
(void)NAMUT_UpdateSoftBoxCount();
return nam_result;
}
/*---------------------------------------------------------------------------*
Name: ProgressThread
Description: .tad
100%
Arguments: arg - 使
Returns: None.
*---------------------------------------------------------------------------*/
static void ProgressThread(void* /*arg*/)
{
u32 currentSize;
u32 totalSize = 0;
u32 totalSizeBk = 0;
sProgress = TRUE;
while (sNowImport)
{
NAM_GetProgress(&currentSize, &totalSize);
if ((totalSize > 0 && totalSize == currentSize) || totalSizeBk > totalSize)
{
// 既にインポートが終了
ProgressDraw((f32)1.0);
break;
}
else if (totalSize > 0)
{
ProgressDraw((f32)currentSize/totalSize);
}
totalSizeBk = totalSize;
// Vブランク待ち
OS_WaitVBlankIntr();
}
sProgress = FALSE;
}
/*---------------------------------------------------------------------------*
Name: ProgressDraw
Description:
Arguments:
Returns: None.
*---------------------------------------------------------------------------*/
void ProgressDraw(f32 ratio)
{
s16 x = (s16)(30 + (226 - 30)*ratio);
// 3D初期化
G3X_Reset();
G3_Identity();
G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_DECAL, GX_CULL_NONE, 0, 31, 0);
// グリーンバー
DrawQuad( 30, 90, x, 95, GX_RGB(12, 25, 12));
// グレーバー
DrawQuad( 30, 90, 226, 95, GX_RGB(28, 28, 28));
// グレーダイアログ
DrawQuad( 20, 60, 236, 110, GX_RGB(25, 25, 25));
// 3Dスワップ
G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_W);
}

View File

@ -1,105 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: kami_copy_file.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <nitro/snd.h>
#include <twl/fatfs.h>
#include <nitro/card.h>
#include "kami_font.h"
#include "kami_copy_file.h"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#define ROUND_UP(value, alignment) \
(((u32)(value) + (alignment-1)) & ~(alignment-1))
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
BOOL kamiCopyFile(char* srcPath, char* dstPath)
{
FSFile file;
BOOL open_is_ok;
BOOL read_is_ok;
void* pTempBuf;
u32 file_size;
u32 alloc_size;
BOOL result = TRUE;
// ROMファイルオープン
FS_InitFile(&file);
open_is_ok = FS_OpenFile(&file, srcPath);
if (!open_is_ok)
{
OS_Printf("FS_OpenFile(\"%s\") ... ERROR!\n", srcPath);
return FALSE;
}
// ROMファイルリード
file_size = FS_GetFileLength(&file) ;
alloc_size = ROUND_UP(file_size, 32) ;
pTempBuf = OS_Alloc( alloc_size );
SDK_NULL_ASSERT(pTempBuf);
DC_InvalidateRange(pTempBuf, alloc_size);
read_is_ok = FS_ReadFile( &file, pTempBuf, (s32)file_size );
if (!read_is_ok)
{
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_ReadFile(\"%s\") ... ERROR!\n", srcPath);
FS_CloseFile(&file);
OS_Free(pTempBuf);
return FALSE;
}
// ROMファイルクローズ
FS_CloseFile(&file);
// 一旦対象データを削除する
(void)FS_DeleteFile(dstPath);
// ターゲットファイル作成
if (!FS_CreateFile(dstPath, FS_PERMIT_R | FS_PERMIT_W))
{
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_CreateFile(%s) failed.\n", dstPath);
result = FALSE;
}
else
{
// ターゲットファイルオープン
FS_InitFile(&file);
open_is_ok = FS_OpenFileEx(&file, dstPath, FS_FILEMODE_W);
if (!open_is_ok)
{
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(%s) failed.\n", dstPath);
result = FALSE;
}
// nand:sys/TWLFontTable.dat書き込み
else if (FS_WriteFile(&file, pTempBuf, (s32)file_size) == -1)
{
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_WritFile() failed.\n");
result = FALSE;
}
(void)FS_CloseFile(&file);
}
OS_Free(pTempBuf);
return result;
}

View File

@ -1,407 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: kami_font.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include "kami_font.h"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#define SCREEN_DATA_COLOR_PLTT_SHIFT 12
#define NUM_OF_PRINT_TARGET 2
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
static u8 sXPos;
static u8 sYPos;
static u32 sBackColorCharData[24*8];
static u16 sFontScreenDataMain[32 * 24] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
static u16 sFontScreenDataSub[24*32] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
static u16 sBackColorScreenData[32 * 24] = {
0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,0xf0de,
0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,0xf0df,
0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,0xf0e0,
0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,0xf0e1,
0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,0xf0e2,
0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,0xf0e3,
0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,0xf0e4,
0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,0xf0e5,
0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,0xf0e6,
0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,0xf0e7,
0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,0xf0e8,
0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,0xf0e9,
0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,0xf0ea,
0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,0xf0eb,
0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,0xf0ec,
0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,0xf0ed,
0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,0xf0ee,
0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,0xf0ef,
0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,
0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,0xf0f1,
0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,0xf0f2,
0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,0xf0f3,
0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,0xf0f4,
0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,0xf0f5,
};
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
static void kamiFontReturnConsole( void );
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*
Name:
Description:
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontInit(void)
{
// 背景用キャラクタデータ
MI_CpuCopy32( &sampleCharData[8 * 0xde], sBackColorCharData, sizeof(sBackColorCharData) );
// 背景用スクリーンデータセット
DC_FlushRange ( sBackColorScreenData, sizeof(sBackColorScreenData) );
GXS_LoadBG1Scr ( sBackColorScreenData, 0, sizeof(sBackColorScreenData) );
}
/*---------------------------------------------------------------------------*
Name:
Description:
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontLoadScreenData(void)
{
DC_FlushRange ( sFontScreenDataMain, sizeof(sFontScreenDataMain) );
GX_LoadBG0Scr ( sFontScreenDataMain, 0, sizeof(sFontScreenDataMain) );
DC_FlushRange ( sFontScreenDataSub, sizeof(sFontScreenDataSub) );
GXS_LoadBG0Scr ( sFontScreenDataSub, 0, sizeof(sFontScreenDataSub) );
// 背景キャラクタデータ書き換え
DC_FlushRange( sBackColorCharData, sizeof(sBackColorCharData) );
GXS_LoadBG0Char( sBackColorCharData, 0xde*32, sizeof(sBackColorCharData) );
}
/*---------------------------------------------------------------------------*
Name: kamiFontClear
Description:
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontClear(void)
{
MI_CpuClear8( sFontScreenDataSub, sizeof(sFontScreenDataSub) );
}
/*---------------------------------------------------------------------------*
Name: kamiFontClearMain
Description:
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontClearMain(void)
{
MI_CpuClear8( sFontScreenDataMain, sizeof(sFontScreenDataMain) );
}
/*---------------------------------------------------------------------------*
Name: kamiFontPrintf
Description: 32
Arguments: x - x ( × 8 )
y - y ( × 8 )
color -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontPrintf(s16 x, s16 y, u8 color, char *text, ...)
{
va_list vlist;
char temp[32 + 2];
s32 i;
va_start(vlist, text);
(void)vsnprintf(temp, 33, text, vlist);
va_end(vlist);
*(u16 *)(&temp[32]) = 0x0000;
for (i = 0;temp[i] != 0x00; i++)
{
sFontScreenDataSub[((y * 32) + x + i) % (24 * 32)] =
(u16)((color << SCREEN_DATA_COLOR_PLTT_SHIFT) | temp[i]);
}
}
/*---------------------------------------------------------------------------*
Name: kamiFontPrintf
Description: 32
Arguments: x - x ( × 8 )
y - y ( × 8 )
color -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontPrintfMain(s16 x, s16 y, u8 color, char *text, ...)
{
va_list vlist;
char temp[32 + 2];
s32 i;
va_start(vlist, text);
(void)vsnprintf(temp, 33, text, vlist);
va_end(vlist);
*(u16 *)(&temp[32]) = 0x0000;
for (i = 0;temp[i] != 0x00; i++)
{
sFontScreenDataMain[((y * 32) + x + i) % (24 * 32)] =
(u16)((color << SCREEN_DATA_COLOR_PLTT_SHIFT) | temp[i]);
}
}
/*---------------------------------------------------------------------------*
Name: kamiFontFillChar
Description:
Arguments: x - x ( × 8 )
y - y ( × 8 )
color -
value
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontFillChar(int lineNo, u8 color1, u8 color2)
{
s32 i;
u32 line;
int charNo = 0xde + lineNo;
if (color1 < 0x10)
{
line = (u32)(0x11111111 * color1);
for (i = 0;i<4; i++)
{
sBackColorCharData[8 * lineNo + i] = line;
}
}
if (color2 < 0x10)
{
line = (u32)(0x11111111 * color2);
for (i = 4;i<8; i++)
{
sBackColorCharData[8 * lineNo + i] = line;
}
}
}
/*---------------------------------------------------------------------------*
Name: kamiFontPrintfConsole
Description: 256
Arguments: color -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontPrintfConsole(u8 color, const char *text, ...)
{
va_list vlist;
char temp[256 + 2];
s32 i;
va_start(vlist, text);
(void)vsnprintf(temp, 256, text, vlist);
va_end(vlist);
// 終端追加
*(u16 *)(&temp[256]) = 0x0000;
for(i=0; temp[i] != 0x00; i++)
{
if (temp[i] == 0x0A)
{
// 改行コード
kamiFontReturnConsole();
}
else
{
// 一文字ずつ書き込み
sFontScreenDataMain[((sYPos * 32) + sXPos) % (24 * 32)] =
(u16)((color << SCREEN_DATA_COLOR_PLTT_SHIFT) | temp[i]);
// X座標が右端に到達した場合は改行処理
if (++sXPos >= 32)
{
kamiFontReturnConsole();
}
}
}
}
/*---------------------------------------------------------------------------*
Name: kamiFontPrintfConsoleEx
Description: 256
OS_Printfもついでに実行する
Arguments: color -
text - NULL
... -
Returns: None.
*---------------------------------------------------------------------------*/
void
kamiFontPrintfConsoleEx(u8 color, const char *text, ...)
{
va_list vlist;
char temp[256 + 2];
va_start(vlist, text);
(void)vsnprintf(temp, 256, text, vlist);
va_end(vlist);
kamiFontPrintfConsole(color, temp);
OS_TPrintf(temp);
}
/*---------------------------------------------------------------------------*
Name: kamiFontReturnConsole
Description:
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void
kamiFontReturnConsole( void )
{
sXPos = 0;
if (sYPos < 23)
{
// 次の行へ
sYPos++;
}
else
{
// 既に最終行に到達している場合シフトを行う
MI_CpuCopy32( &sFontScreenDataMain[32], sFontScreenDataMain, sizeof(u16)*32*23 );
MI_CpuClear32( &sFontScreenDataMain[32*23], sizeof(u16)*32);
}
}

View File

@ -1,370 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#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;
}
}
/*---------------------------------------------------------------------------*
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;
}
/*---------------------------------------------------------------------------*
Name: NANDアクセス関数
Description:
Arguments: None.
Returns:
*---------------------------------------------------------------------------*/
KAMIResult kamiNandIo(u32 block, void* buffer, u32 count, BOOL is_read)
{
OSIntrMode enabled;
u8 data[12];
int i;
// ロック
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, 12, (u8)is_read))
{
for (i = 0; i < 12; i+=3)
{
KamiSendPxiData(&data[i]);
}
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: kamiGetIsToolType
Description: IS-TWL-DEBUGGER or CAPTURE
Arguments: None.
Returns:
*---------------------------------------------------------------------------*/
KAMIResult kamiGetIsToolType( IsToolType *pType )
{
OSIntrMode enabled;
if (pType == 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*)pType;
(void)OS_RestoreInterrupts(enabled);
if (KamiSendPxiCommand(KAMI_GET_IS_TOOL_TYPE, 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);
}
}

View File

@ -1,332 +0,0 @@
/*---------------------------------------------------------------------------*
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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <twl/fatfs.h>
#include <nitro/card.h>
#include <twl/nam.h>
#include <nitro/nvram.h>
#include "kami_font.h"
#include "kami_pxi.h"
#include <firm/format/firm_common.h>
#include "kami_write_nandfirm.h"
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
// NANDファーム書き込みの際にNVRAMの未割り当て領域予約領域をクリアする場合は定義します開発用
//#define CLEAR_NON_ASIGNED_AREA_AND_RESERVED_AREA_ALL
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
#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
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
static u8 sNvramPageSizeBuffer[NVRAM_PAGE_SIZE] ATTRIBUTE_ALIGN(32); // ARM7からアクセスするためスタックでは駄目
static u32 sReservedAreaEndAddress;
/*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*/
void kamiEraseNandfirmVersion( u32 nandfirmsize );
/*---------------------------------------------------------------------------*
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)
{
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予約領域をクリアします
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 ); // ブロック単位、バイト単位、ブロック単位
}
}

View File

@ -1,85 +0,0 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - NandInitializer
File: keypad.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:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include "keypad.h"
/*---------------------------------------------------------------------------*
è<EFBFBD>è`
*---------------------------------------------------------------------------*/
#define KEY_REPEAT_TRIGGER_START 20
#define KEY_REPEAT_TRIGGER_TERM 5
/*---------------------------------------------------------------------------*
àÏ<EFBFBD>è`
*---------------------------------------------------------------------------*/
static u16 Cont;
static u16 Trg;
static u16 Release;
static u16 RepeatTrg;
static u8 key = 60;
static int repeat_counter;
/*---------------------------------------------------------------------------*
àŠÖ<EFBFBD>è`
*---------------------------------------------------------------------------*/
void
kamiPadRead(void)
{
u16 ReadData;
ReadData = PAD_Read();
Trg = (u16)(ReadData & (ReadData ^ Cont));
Release = (u16)(Cont & (ReadData ^ Cont));
Cont = ReadData;
RepeatTrg = Trg;
if (++repeat_counter > (KEY_REPEAT_TRIGGER_START + KEY_REPEAT_TRIGGER_TERM))
{
repeat_counter = KEY_REPEAT_TRIGGER_START;
}
if (repeat_counter == KEY_REPEAT_TRIGGER_START)
{
RepeatTrg = ReadData;
}
if (!ReadData)
{
repeat_counter = 0;
}
}
BOOL
kamiPadIsTrigger(u16 key)
{
return (Trg & key)? TRUE : FALSE;
}
BOOL
kamiPadIsRepeatTrigger(u16 key)
{
return (RepeatTrg & key)? TRUE : FALSE;
}
BOOL
kamiPadIsPress(u16 key)
{
return (Cont & key)? TRUE : FALSE;
}

View File

@ -1,123 +0,0 @@
#! make -f
#----------------------------------------------------------------------------
# Project: SystemUpdater
# 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 TARGET_CODEGEN = THUMB
override TWL_ARCHGEN = LIMITED
TARGET_FIRM = SYSTEMMENU
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
#.PHONY: no_rom_set
#no_rom_set:
# echo "Usage: make ROMSET=dirname"
#
#ifeq ($(ROMSET),)
# no_rom_set
#endif
#
# リージョンが指定されてなかったら全部やる
ifeq ($(REGION),)
include $(TWLSDK_ROOT)/build/buildtools/commondefs
do-build: do-something
clean: do-something
clobber: do-something
install: do-something
do-build: MY_GOAL=
clean: MY_GOAL=clean
clobber: MY_GOAL=clobber
install: MY_GOAL=install
do-something:
-$(REMAKE) TWLSDK_PLATFORM=TWL REGION=JPN ROMSET=$(ROMSET) DISABLE_ROMCHECK=$(DISABLE_ROMCHECK) SKIP_SUBDIR=FALSE $(MY_GOAL)
-rm `find . -name "*autogen*"`
-$(REMAKE) TWLSDK_PLATFORM=TWL REGION=AUS ROMSET=$(ROMSET) DISABLE_ROMCHECK=$(DISABLE_ROMCHECK) SKIP_SUBDIR=FALSE $(MY_GOAL)
-rm `find . -name "*autogen*"`
-$(REMAKE) TWLSDK_PLATFORM=TWL REGION=USA ROMSET=$(ROMSET) DISABLE_ROMCHECK=$(DISABLE_ROMCHECK) SKIP_SUBDIR=FALSE $(MY_GOAL)
-rm `find . -name "*autogen*"`
-$(REMAKE) TWLSDK_PLATFORM=TWL REGION=EUR ROMSET=$(ROMSET) DISABLE_ROMCHECK=$(DISABLE_ROMCHECK) SKIP_SUBDIR=FALSE $(MY_GOAL)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
else
LAUNCHER_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/Launcher
MACHINESETTINGS_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/MachineSettings
WLANFIRM_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/wlanfirm
DS_HASH_TABLE = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/DSHashTable
SHARED_FONT_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/sharedFont
NANDFIRM_DIR = $(TWL_IPL_RED_ROOT)/build/nandfirm/menu-launcher
# 既存データを使用する場合はTRUEを指定
SKIP_CREATE_DATA = TRUE
ifeq ($(SKIP_CREATE_DATA),FALSE)
SUBDIRS = $(LAUNCHER_DIR) \
$(MACHINESETTINGS_DIR) \
$(WLANFIRM_DIR) \
$(DS_HASH_TABLE) \
$(SHARED_FONT_DIR) \
$(NANDFIRM_DIR) \
data \
banner \
ARM7.TWL \
ARM9.TWL
else
SUBDIRS = banner \
ARM7.TWL \
ARM9.TWL
endif
# CustomSystemUpdater
export SYSM_REGION = $(REGION)
export ROMSET := $(ROMSET)
export DISABLE_ROMCHECK := $(DISABLE_ROMCHECK)
# COMPILE SWITCH for build SystemMenu
export SYSM_UPDATER_RELEASE = TRUE
export SYSM_DO_NOT_SHOW_LAUNCHER = TRUE
export SYSM_DISABLE_WDS_SCAN = FALSE
export SYSM_IGNORE_WLFIRM_SIGNCHECK = FALSE
export SYSM_DISABLE_WLFIRM_LOAD = FALSE
export SYSM_DISABLE_INITIAL_SETTINGS = TRUE
export SYSM_OUTSIDE_UI = TRUE
export SYSM_BUILD_FOR_PRODUCTION_TEST = FALSE
# MAKEROM SWITCH for build SystemMenu
export SYSM_DISABLE_DEBUG = FALSE
export SYSM_USE_WLANFIRM_LOCAL_PUBKEY = FALSE
#----------------------------------------------------------------------------
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
endif
#===== End of Makefile =====

Some files were not shown because too many files have changed in this diff Show More