mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
EULA設定ツールsetEULAの追加。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2563 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
cd59bcdbfb
commit
cb62762ab1
BIN
RomHeader/001A/libsyscall.a
Normal file
BIN
RomHeader/001A/libsyscall.a
Normal file
Binary file not shown.
BIN
RomHeader/001A/libsyscall_c.bin
Normal file
BIN
RomHeader/001A/libsyscall_c.bin
Normal file
Binary file not shown.
BIN
RomHeader/001A/rom_header_001a.template.sbin
Normal file
BIN
RomHeader/001A/rom_header_001a.template.sbin
Normal file
Binary file not shown.
103
build/systemMenu_tools/setEULA/ARM9/Makefile
Normal file
103
build/systemMenu_tools/setEULA/ARM9/Makefile
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: TwlIPL - SystemMenuRED - MachineSettings
|
||||||
|
# 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 =
|
||||||
|
SUBMAKES = \
|
||||||
|
$(ROOT)/build/libraries/os/ARM9.TWL/Makefile.sharedFont
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
# MAKEROM SWITCH ※最終ROM作成時は、TRUEにする
|
||||||
|
SYSM_DISABLE_DEBUG ?= TRUE
|
||||||
|
|
||||||
|
TARGET_FIRM = SYSTEMMENU
|
||||||
|
TARGET_PLATFORM = TWL
|
||||||
|
TARGET_CODEGEN ?= THUMB
|
||||||
|
TWL_ARCHGEN = LIMITED
|
||||||
|
TWL_NANDAPP = TRUE
|
||||||
|
|
||||||
|
#※RED本体設定はデバッガ対応の都合上、TITLEID_LO=HNAA, CARD_REGION=ALLとしています。
|
||||||
|
# UIG本体設定では、リージョンに合わせてTITLEID_LO, CARD_REGIONを設定してください。
|
||||||
|
##################################################################
|
||||||
|
TITLEID_LO = 001A
|
||||||
|
CARD_REGION = ALL
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
TARGET_BIN = setEULA.srl
|
||||||
|
|
||||||
|
ROM_HEADER_DIR = $(SYSMENU_ROOT)/RomHeader/$(TITLEID_LO)
|
||||||
|
SMALL_TITLEID = $(shell echo $(TITLEID_LO) | tr '[A-Z]' '[a-z]' )
|
||||||
|
ROM_HEADER_TEMPLATE = $(ROM_HEADER_DIR)/rom_header_$(SMALL_TITLEID).template.sbin
|
||||||
|
LIBSYSCALL = $(ROM_HEADER_DIR)/libsyscall.a
|
||||||
|
|
||||||
|
ROM_SPEC = main.rsf
|
||||||
|
|
||||||
|
MISC_DIR = ../../../systemMenu_RED/misc
|
||||||
|
|
||||||
|
BG_DIR = ../../../systemMenu_RED/data
|
||||||
|
|
||||||
|
SRCS = main.c MachineSetting.c setEULA.c \
|
||||||
|
$(MISC_DIR)/src/misc.c $(MISC_DIR)/src/cmn.c \
|
||||||
|
$(BG_DIR)/BGData_MachineSettings.c
|
||||||
|
|
||||||
|
LINCLUDES = $(MISC_DIR)/include
|
||||||
|
|
||||||
|
MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' \
|
||||||
|
-DCARD_REGION='$(CARD_REGION)' \
|
||||||
|
-DDISABLE_DEBUG='$(SYSM_DISABLE_DEBUG)' \
|
||||||
|
-DROM_HEADER_TEMPLATE='$(call empath,$(ROM_HEADER_TEMPLATE))'
|
||||||
|
|
||||||
|
MAKETAD_OPTION += -s
|
||||||
|
|
||||||
|
# libsysmenu.a は、RED本体設定でSVNのリビジョンを取得するためだけに使用しているので、
|
||||||
|
# UIG本体設定でリンクする必要はありません。
|
||||||
|
SYSMENU_LIBS = \
|
||||||
|
libsysmenu$(TWL_LIBSUFFIX).a \
|
||||||
|
libsysmutil$(TWL_LIBSUFFIX).a \
|
||||||
|
|
||||||
|
SDK_APPEND_LIBS = \
|
||||||
|
liblcfg$(TWL_LIBSUFFIX).a \
|
||||||
|
libsharedfont$(TWL_LIBSUFFIX).a \
|
||||||
|
libna$(TWL_LIBSUFFIX).a
|
||||||
|
|
||||||
|
LLIBRARIES += $(SYSMENU_LIBS) $(SDK_APPEND_LIBS)
|
||||||
|
|
||||||
|
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(SYSM_OUTSIDE_UI),TRUE)
|
||||||
|
MACRO_FLAGS += -DOUTSIDE_UI
|
||||||
|
endif
|
||||||
|
|
||||||
|
MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/armadillo/$(TWL_BUILDTYPE_ARM7)/armadillo
|
||||||
|
MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT)
|
||||||
|
MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
|
||||||
|
|
||||||
|
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN)
|
||||||
|
INSTALL_DIR = $(SDK_NMENU_DATADIR)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
do-build : $(TARGETS)
|
||||||
|
|
||||||
|
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
209
build/systemMenu_tools/setEULA/ARM9/main.rsf
Normal file
209
build/systemMenu_tools/setEULA/ARM9/main.rsf
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# 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 $(ROM_HEADER_TEMPLATE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# BANNER FILE: generated from Banner Spec File
|
||||||
|
#
|
||||||
|
BannerFile ../banner/banner.bnr
|
||||||
|
|
||||||
|
###
|
||||||
|
### Setting for TWL
|
||||||
|
###
|
||||||
|
|
||||||
|
#
|
||||||
|
# ROM HEADER Ltd: Provided to every product by NINTENDO
|
||||||
|
#
|
||||||
|
RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin
|
||||||
|
|
||||||
|
#
|
||||||
|
# Digest parameters:
|
||||||
|
#
|
||||||
|
DigestParam 1024 32
|
||||||
|
|
||||||
|
#
|
||||||
|
# WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD]
|
||||||
|
# don't have to edit
|
||||||
|
#
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
WramMapping MAP_TS_SCR
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# CardRegion: card region [Japan/America/Europe/Australia/China/Korea]
|
||||||
|
#
|
||||||
|
CardRegion $(CARD_REGION)
|
||||||
|
|
||||||
|
#
|
||||||
|
# NANDAccess: nand access control [TRUE/FALSE]
|
||||||
|
#
|
||||||
|
NANDAccess TRUE
|
||||||
|
|
||||||
|
#
|
||||||
|
# Codec mode:
|
||||||
|
# don't have to edit
|
||||||
|
#
|
||||||
|
CodecMode $(MAKEROM_CODEC_MODE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# DisableDebug :最終ROMでは、アプリジャンプされた際にデバッグできないようにTRUEにする必要があります。
|
||||||
|
#
|
||||||
|
DisableDebug $(DISABLE_DEBUG)
|
||||||
|
|
||||||
|
###
|
||||||
|
#### END
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AppendProperty
|
||||||
|
{
|
||||||
|
#
|
||||||
|
# Publisher : "Nintendo"
|
||||||
|
# don't have to edit
|
||||||
|
Publisher Nintendo
|
||||||
|
|
||||||
|
#
|
||||||
|
# Application type : [USER/SYSTEM]
|
||||||
|
# don't have to edit
|
||||||
|
AppType System
|
||||||
|
|
||||||
|
#
|
||||||
|
# launch title on the launcher : [TRUE/FALSE]
|
||||||
|
# don't have to edit
|
||||||
|
Launch TRUE
|
||||||
|
|
||||||
|
#
|
||||||
|
# Boot allowed Media: [GameCard/NAND]
|
||||||
|
#
|
||||||
|
Media GameCard
|
||||||
|
|
||||||
|
#
|
||||||
|
# Data only title : [TRUE/FALSE]
|
||||||
|
# don't have to edit
|
||||||
|
DataOnly FALSE
|
||||||
|
|
||||||
|
#
|
||||||
|
# Secure title : [TRUE/FALSE]
|
||||||
|
# don't have to edit
|
||||||
|
Secure TRUE
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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 FALSE
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RomSpec
|
||||||
|
{
|
||||||
|
Offset 0x00000000
|
||||||
|
Segment ALL
|
||||||
|
HostRoot ../../../systemMenu_RED/data
|
||||||
|
Root /data
|
||||||
|
File NTR_IPL_font_m.NFTR
|
||||||
|
}
|
||||||
269
build/systemMenu_tools/setEULA/ARM9/src/MachineSetting.c
Normal file
269
build/systemMenu_tools/setEULA/ARM9/src/MachineSetting.c
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlIPL
|
||||||
|
File: mainMenu.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 "MachineSetting.h"
|
||||||
|
|
||||||
|
// define data------------------------------------------
|
||||||
|
|
||||||
|
// キャンセルボタンLCD領域
|
||||||
|
#define CANCEL_BUTTON_TOP_X ( 12 * 8 )
|
||||||
|
#define CANCEL_BUTTON_TOP_Y ( 21 * 8 )
|
||||||
|
#define CANCEL_BUTTON_BOTTOM_X ( CANCEL_BUTTON_TOP_X + 5 * 8 )
|
||||||
|
#define CANCEL_BUTTON_BOTTOM_Y ( CANCEL_BUTTON_TOP_Y + 2 * 8 )
|
||||||
|
// OKボタンLCD領域
|
||||||
|
#define OK_BUTTON_TOP_X ( 22 * 8 )
|
||||||
|
#define OK_BUTTON_TOP_Y ( 21 * 8 )
|
||||||
|
#define OK_BUTTON_BOTTOM_X ( OK_BUTTON_TOP_X + 2 * 8 )
|
||||||
|
#define OK_BUTTON_BOTTOM_Y ( OK_BUTTON_TOP_Y + 2 * 8 )
|
||||||
|
|
||||||
|
// メインメニューの項目数(※ピクトチャット起動テストは除いておく)
|
||||||
|
#ifdef OUTSIDE_UI
|
||||||
|
#define SETTING_MENU_ELEMENT_NUM 5 // 社外用
|
||||||
|
#else // !OUTSIDE_UI
|
||||||
|
#define SETTING_MENU_ELEMENT_NUM 10 // 社内用
|
||||||
|
#endif // OUTSIDE_UI
|
||||||
|
|
||||||
|
// extern data------------------------------------------
|
||||||
|
|
||||||
|
extern u32 bg_char_data[8 * 6];
|
||||||
|
extern u16 bg_scr_data[32 * 32];
|
||||||
|
|
||||||
|
// function's prototype declaration---------------------
|
||||||
|
|
||||||
|
// global variable -------------------------------------
|
||||||
|
|
||||||
|
// static variable -------------------------------------
|
||||||
|
static u16 s_csr = 0;
|
||||||
|
static const u16 *s_pStrSetting[ SETTING_MENU_ELEMENT_NUM ]; // メインメニュー用文字テーブルへのポインタリスト
|
||||||
|
|
||||||
|
// const data -----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
//===============================================
|
||||||
|
// mainMenu.c
|
||||||
|
//===============================================
|
||||||
|
static const u16 *const s_pStrSettingElemTbl[ SETTING_MENU_ELEMENT_NUM ][ LCFG_TWL_LANG_CODE_MAX ] = {
|
||||||
|
{
|
||||||
|
(const u16 *)L"EULA",
|
||||||
|
(const u16 *)L"EULA",
|
||||||
|
(const u16 *)L"EULA(F)",
|
||||||
|
(const u16 *)L"EULA(G)",
|
||||||
|
(const u16 *)L"EULA(I)",
|
||||||
|
(const u16 *)L"EULA(S)",
|
||||||
|
(const u16 *)L"EULA(C)",
|
||||||
|
(const u16 *)L"EULA(K)",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static MenuPos s_settingPos[] = {
|
||||||
|
{ TRUE, 4 * 8, 2 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 4 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 6 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 8 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 10 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 12 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 14 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 16 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 18 * 8 },
|
||||||
|
{ TRUE, 4 * 8, 20 * 8 },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const MenuParam s_settingParam = {
|
||||||
|
SETTING_MENU_ELEMENT_NUM,
|
||||||
|
TXT_COLOR_BLACK,
|
||||||
|
TXT_COLOR_GREEN,
|
||||||
|
TXT_COLOR_RED,
|
||||||
|
&s_settingPos[ 0 ],
|
||||||
|
(const u16 **)&s_pStrSetting,
|
||||||
|
};
|
||||||
|
|
||||||
|
//======================================================
|
||||||
|
// メインメニュー
|
||||||
|
//======================================================
|
||||||
|
|
||||||
|
// メインメニューの初期化
|
||||||
|
void MachineSettingInit( void )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
GX_DispOff();
|
||||||
|
GXS_DispOff();
|
||||||
|
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
|
||||||
|
|
||||||
|
// BGデータのロード処理
|
||||||
|
GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data));
|
||||||
|
GX_LoadBG1Scr(bg_scr_data, 0, sizeof(bg_scr_data));
|
||||||
|
|
||||||
|
PrintfSJIS( 0, 0, TXT_COLOR_BLUE, "Set EULA", g_strIPLSvnRevision, g_strSDKSvnRevision );
|
||||||
|
|
||||||
|
// NITRO設定データのlanguageに応じたメインメニュー構成言語の切り替え
|
||||||
|
for( i = 0; i < SETTING_MENU_ELEMENT_NUM; i++ ) {
|
||||||
|
s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ LCFG_TSD_GetLanguage() ];
|
||||||
|
}
|
||||||
|
|
||||||
|
ChangeUserColor( LCFG_TSD_GetUserColor() );
|
||||||
|
DrawMenu( s_csr, &s_settingParam );
|
||||||
|
|
||||||
|
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
|
||||||
|
|
||||||
|
GX_SetVisiblePlane ( GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1);
|
||||||
|
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||||
|
GX_DispOn();
|
||||||
|
GXS_DispOn();
|
||||||
|
|
||||||
|
g_pNowProcess = MachineSettingMain;
|
||||||
|
}
|
||||||
|
|
||||||
|
// メインメニュー
|
||||||
|
int MachineSettingMain( void )
|
||||||
|
{
|
||||||
|
BOOL tp_select;
|
||||||
|
ReadTP();
|
||||||
|
|
||||||
|
//--------------------------------------
|
||||||
|
// キー入力処理
|
||||||
|
//--------------------------------------
|
||||||
|
if( pad.trg & PAD_KEY_DOWN ){ // カーソルの移動
|
||||||
|
if( ++s_csr == SETTING_MENU_ELEMENT_NUM ) {
|
||||||
|
s_csr=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( pad.trg & PAD_KEY_UP ){
|
||||||
|
if( --s_csr & 0x80 ) {
|
||||||
|
s_csr=SETTING_MENU_ELEMENT_NUM - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tp_select = SelectMenuByTP( &s_csr, &s_settingParam );
|
||||||
|
DrawMenu( s_csr, &s_settingParam );
|
||||||
|
|
||||||
|
if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐
|
||||||
|
if( s_settingPos[ s_csr ].enable ) {
|
||||||
|
/*
|
||||||
|
switch( s_csr ) {
|
||||||
|
case 0:
|
||||||
|
SelectLanguageInit();
|
||||||
|
g_pNowProcess = SelectLanguageMain;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
SetRTCInit();
|
||||||
|
g_pNowProcess = SetRTCMain;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
SetOwnerInfoInit();
|
||||||
|
g_pNowProcess = SetOwnerInfoMain;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
TP_CalibrationInit();
|
||||||
|
g_pNowProcess = TP_CalibrationMain;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
SetWirelessInit();
|
||||||
|
g_pNowProcess = SetWirelessMain;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
CleanupMachineInit();
|
||||||
|
g_pNowProcess = CleanupMachineMain;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
SelectCountryInit();
|
||||||
|
g_pNowProcess = SelectCountryMain;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
SetParentalControlInit();
|
||||||
|
g_pNowProcess = SetParentalControlMain;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
SetEULAInit();
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
SetFreeSoftBoxInit();
|
||||||
|
g_pNowProcess = SetFreeSoftBoxMain;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// とりあえずバックライト輝度変更をここで確認。
|
||||||
|
if( pad.trg & PAD_BUTTON_R) {
|
||||||
|
u8 brightness;
|
||||||
|
(void)UTL_GetBacklightBrightness( &brightness );
|
||||||
|
if( ++brightness > BACKLIGHT_BRIGHTNESS_MAX ) {
|
||||||
|
brightness = BACKLIGHT_BRIGHTNESS_MAX;
|
||||||
|
}
|
||||||
|
(void)UTL_SetBacklightBrightness( brightness );
|
||||||
|
}
|
||||||
|
if( pad.trg & PAD_BUTTON_L ) {
|
||||||
|
u8 brightness;
|
||||||
|
(void)UTL_GetBacklightBrightness( &brightness );
|
||||||
|
if( --brightness < 0 ) {
|
||||||
|
brightness = 0;
|
||||||
|
}
|
||||||
|
(void)UTL_SetBacklightBrightness( brightness );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// OK / CANCELボタンの描画
|
||||||
|
void DrawOKCancelButton(void)
|
||||||
|
{
|
||||||
|
(void)PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L"CANCEL");
|
||||||
|
(void)PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_COLOR_CYAN, (const u16 *)L"OK");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// OK or CANCELボタン押下チェック
|
||||||
|
void CheckOKCancelButton(BOOL *tp_ok, BOOL *tp_cancel)
|
||||||
|
{
|
||||||
|
*tp_cancel = WithinRangeTP( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
|
||||||
|
CANCEL_BUTTON_BOTTOM_X, CANCEL_BUTTON_BOTTOM_Y, &tpd.disp );
|
||||||
|
*tp_ok = WithinRangeTP( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y,
|
||||||
|
OK_BUTTON_BOTTOM_X, OK_BUTTON_BOTTOM_Y, &tpd.disp );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
//
|
||||||
|
// 設定終了
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// 本体設定データのライト
|
||||||
|
BOOL MY_WriteTWLSettings( void )
|
||||||
|
{
|
||||||
|
BOOL retval = FALSE;
|
||||||
|
u8 *pBuffer = Alloc( LCFG_WRITE_TEMP );
|
||||||
|
if( pBuffer != NULL ) {
|
||||||
|
// ***********************************************************
|
||||||
|
// RED本体設定では、初回起動シーケンスもフラッシュ壊れシーケンスもないので、とりあえず何でも設定したらシーケンスを終了するようにする。
|
||||||
|
LCFG_TSD_SetFlagFinishedInitialSetting( TRUE );
|
||||||
|
LCFG_TSD_SetFlagFinishedInitialSetting_Launcher( TRUE );
|
||||||
|
LCFG_TSD_SetFlagFinishedBrokenTWLSettings( TRUE );
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
retval = LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
|
||||||
|
Free( pBuffer );
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
71
build/systemMenu_tools/setEULA/ARM9/src/MachineSetting.h
Normal file
71
build/systemMenu_tools/setEULA/ARM9/src/MachineSetting.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlIPL
|
||||||
|
File: MachineSetting.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 __MACHINE_SETTING_H__
|
||||||
|
#define __MACHINE_SETTING_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include <twl.h>
|
||||||
|
|
||||||
|
|
||||||
|
// define data----------------------------------------------------------
|
||||||
|
#define TP_CSR_TOUCH_COUNT 2 // TPカーソルのチャタリング吸収のためのカウント値
|
||||||
|
#define TP_CSR_DETACH_COUNT 2 // TPカーソルを「選択」と判定するTPデタッチからのカウント値
|
||||||
|
|
||||||
|
#define HANDLE_MENU 48
|
||||||
|
#define HANDLE_RTC_VIEW 240
|
||||||
|
#define HANDLE_OK_BUTTON 255
|
||||||
|
#define HANDLE_CANCEL_BUTTON 256
|
||||||
|
|
||||||
|
// 数値入力インターフェース用ワーク(void InputDecimal()で使用)
|
||||||
|
typedef struct InputNumParam {
|
||||||
|
u16 pos_x; // 入力値の表示X位置
|
||||||
|
u16 pos_y; // 〃 Y位置
|
||||||
|
int up_count;
|
||||||
|
int down_count;
|
||||||
|
int keta_max; // 最大桁
|
||||||
|
int value_min; // 入力値の最小
|
||||||
|
int value_max; // 入力値の最大
|
||||||
|
int y_offset; // タッチパネル入力の基準位置からのYオフセット
|
||||||
|
}InputNumParam;
|
||||||
|
|
||||||
|
// global variable------------------------------------------------------
|
||||||
|
extern NNSFndAllocator g_allocator;
|
||||||
|
extern int (*g_pNowProcess)( void );
|
||||||
|
extern BOOL g_isValidTSD;
|
||||||
|
|
||||||
|
// function-------------------------------------------------------------
|
||||||
|
extern void MachineSettingInit( void );
|
||||||
|
extern int MachineSettingMain( void );
|
||||||
|
extern void SetEULAInit( void );
|
||||||
|
extern int SetEULAMain( void );
|
||||||
|
|
||||||
|
extern void DrawOKCancelButton( void );
|
||||||
|
extern void CheckOKCancelButton(BOOL *tp_ok, BOOL *tp_cancel);
|
||||||
|
extern void InputDecimal(int *tgtp, InputNumParam *inpp);
|
||||||
|
|
||||||
|
extern BOOL MY_WriteTWLSettings( void );
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // __MACHINE_SETTING_H__
|
||||||
127
build/systemMenu_tools/setEULA/ARM9/src/main.c
Normal file
127
build/systemMenu_tools/setEULA/ARM9/src/main.c
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
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 <twl/lcfg.h>
|
||||||
|
#include "misc.h"
|
||||||
|
#include "MachineSetting.h"
|
||||||
|
|
||||||
|
// extern data-----------------------------------------------------------------
|
||||||
|
|
||||||
|
// define data-----------------------------------------------------------------
|
||||||
|
|
||||||
|
// function's prototype-------------------------------------------------------
|
||||||
|
static void INTR_VBlank( void );
|
||||||
|
|
||||||
|
// global variable-------------------------------------------------------------
|
||||||
|
int (*g_pNowProcess)( void );
|
||||||
|
BOOL g_isValidTSD;
|
||||||
|
RTCDrawProperty g_rtcDraw = {
|
||||||
|
TRUE, RTC_DATE_TOP_X, RTC_DATE_TOP_Y, RTC_TIME_TOP_X, RTC_TIME_TOP_Y
|
||||||
|
};
|
||||||
|
|
||||||
|
// static variable-------------------------------------------------------------
|
||||||
|
|
||||||
|
// const data------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// function's description
|
||||||
|
// ============================================================================
|
||||||
|
void TwlMain(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 初期化----------------------------------
|
||||||
|
OS_Init();
|
||||||
|
OS_InitTick();
|
||||||
|
|
||||||
|
(void)OS_EnableIrq();
|
||||||
|
(void)OS_EnableInterrupts();
|
||||||
|
|
||||||
|
GX_Init();
|
||||||
|
GX_SetPower(GX_POWER_ALL); // 各ロジック パワーON
|
||||||
|
FS_Init( FS_DMA_NOT_USE );
|
||||||
|
|
||||||
|
SND_Init();
|
||||||
|
SNDEX_Init();
|
||||||
|
|
||||||
|
// 割り込み許可----------------------------
|
||||||
|
(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();
|
||||||
|
|
||||||
|
// ※本来ならランチャーからのパラメータチェックを行い、
|
||||||
|
// 初回起動シーケンスに入るパスがある
|
||||||
|
|
||||||
|
{
|
||||||
|
OS_TPrintf( "LCFGTWLOwnerInfo : 0x%04x\n", sizeof(LCFGTWLOwnerInfo) );
|
||||||
|
OS_TPrintf( "LCFGTWLParentalControl : 0x%04x\n", sizeof(LCFGTWLParentalControl) );
|
||||||
|
OS_TPrintf( "LCFGTWLSettingsData : 0x%04x\n", sizeof(LCFGTWLSettingsData) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// TWL設定データファイルの読み込み
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
g_isValidTSD = FALSE;
|
||||||
|
{
|
||||||
|
u8 *pBuffer = Alloc( LCFG_READ_TEMP );
|
||||||
|
if( pBuffer ) {
|
||||||
|
// NANDからTWL本体設定データをリード
|
||||||
|
if( LCFG_ReadTWLSettings( (u8 (*)[LCFG_READ_TEMP])pBuffer ) ) {
|
||||||
|
g_isValidTSD = TRUE;
|
||||||
|
}
|
||||||
|
Free( pBuffer );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UTL_CaribrateTP( LCFG_TSD_GetTPCalibrationPtr() );
|
||||||
|
|
||||||
|
InitBG();
|
||||||
|
GetAndDrawRTCData( &g_rtcDraw, TRUE );
|
||||||
|
MachineSettingInit();
|
||||||
|
SetEULAInit();
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
// メインループ----------------------------
|
||||||
|
while ( 1 ) {
|
||||||
|
OS_WaitIrq( 1, OS_IE_V_BLANK ); // Vブランク割り込み待ち
|
||||||
|
|
||||||
|
ReadKeyPad(); // キー入力の取得
|
||||||
|
|
||||||
|
(void)g_pNowProcess();
|
||||||
|
|
||||||
|
GetAndDrawRTCData( &g_rtcDraw, FALSE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// 割り込み処理
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// Vブランク割り込み
|
||||||
|
static void INTR_VBlank(void)
|
||||||
|
{
|
||||||
|
OS_SetIrqCheckFlag(OS_IE_V_BLANK); // Vブランク割込チェックのセット
|
||||||
|
}
|
||||||
|
|
||||||
641
build/systemMenu_tools/setEULA/ARM9/src/setEULA.c
Normal file
641
build/systemMenu_tools/setEULA/ARM9/src/setEULA.c
Normal file
@ -0,0 +1,641 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlIPL
|
||||||
|
File: setEULA.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 "MachineSetting.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// <処理>
|
||||||
|
// 以下のEULA設定
|
||||||
|
// ++ agree/not agreeフラグ
|
||||||
|
// ++ agree eula version
|
||||||
|
// <例外処理>
|
||||||
|
//
|
||||||
|
|
||||||
|
// テスト表示
|
||||||
|
#if 1
|
||||||
|
#define DEBUGPRINT OS_TPrintf
|
||||||
|
#else
|
||||||
|
#define DEBUGPRINT(...) ((void)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// define data----------------------------------
|
||||||
|
|
||||||
|
// ソフトウェアキーボードLCD領域
|
||||||
|
#define CLIST_LT_X 23
|
||||||
|
#define CLIST_LT_Y 50
|
||||||
|
#define CLIST_MARGIN 14
|
||||||
|
#define CLIST_KEY_PER_SEGMENT 5
|
||||||
|
#define CLIST_SEGMENT_INTERVAL 7
|
||||||
|
|
||||||
|
// キャンセルボタン領域
|
||||||
|
#define CANCEL_BUTTON_TOP_X ( 2 * 8 )
|
||||||
|
#define CANCEL_BUTTON_TOP_Y ( 21 * 8 )
|
||||||
|
#define CANCEL_BUTTON_BOTTOM_X ( CANCEL_BUTTON_TOP_X + (8 * 8) )
|
||||||
|
#define CANCEL_BUTTON_BOTTOM_Y ( CANCEL_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
|
||||||
|
// OKボタン領域
|
||||||
|
#define OK_BUTTON_TOP_X ( 26 * 8 )
|
||||||
|
#define OK_BUTTON_TOP_Y ( 21 * 8 )
|
||||||
|
#define OK_BUTTON_BOTTOM_X ( OK_BUTTON_TOP_X + (4 * 8) )
|
||||||
|
#define OK_BUTTON_BOTTOM_Y ( OK_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
|
||||||
|
// ON/OFFボタン領域
|
||||||
|
#define ON_BUTTON_TOP_X ( 6 * 8 )
|
||||||
|
#define ON_BUTTON_TOP_Y ( 8 * 8 )
|
||||||
|
#define ON_BUTTON_BOTTOM_X ( ON_BUTTON_TOP_X + (2 * 8) )
|
||||||
|
#define ON_BUTTON_BOTTOM_Y ( ON_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
#define OFF_BUTTON_TOP_X ( 18 * 8 )
|
||||||
|
#define OFF_BUTTON_TOP_Y ( 8 * 8 )
|
||||||
|
#define OFF_BUTTON_BOTTOM_X ( OFF_BUTTON_TOP_X + (3 * 8) )
|
||||||
|
#define OFF_BUTTON_BOTTOM_Y ( OFF_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
|
||||||
|
// UP/DOWNボタン領域
|
||||||
|
#define UP_BUTTON_TOP_X ( 21 * 8 )
|
||||||
|
#define UP_BUTTON_TOP_Y ( 7 * 8 )
|
||||||
|
#define UP_BUTTON_BOTTOM_X ( UP_BUTTON_TOP_X + (2 * 8) )
|
||||||
|
#define UP_BUTTON_BOTTOM_Y ( UP_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
#define DOWN_BUTTON_TOP_X ( 21 * 8 )
|
||||||
|
#define DOWN_BUTTON_TOP_Y ( 13 * 8 )
|
||||||
|
#define DOWN_BUTTON_BOTTOM_X ( DOWN_BUTTON_TOP_X + (2 * 8) )
|
||||||
|
#define DOWN_BUTTON_BOTTOM_Y ( DOWN_BUTTON_TOP_Y + (2 * 8) )
|
||||||
|
|
||||||
|
|
||||||
|
// 項目の総数
|
||||||
|
#define MS_EULA_NUMOF_ELEMENTS 2
|
||||||
|
|
||||||
|
// ソフトウェアキーボードのパラメータ
|
||||||
|
#define CHAR_LIST_CHAR_NUM 120
|
||||||
|
#define CHAR_LIST_MODE_NUM 3
|
||||||
|
|
||||||
|
// 特殊キーコード
|
||||||
|
#define EOM_ (u16)0xe050
|
||||||
|
#define CODE_BUTTON_TOP_ (u16)0xe051
|
||||||
|
#define DEL_BUTTON_ (u16)0xe051
|
||||||
|
#define SPACE_BUTTON_ (u16)0xe052
|
||||||
|
#define VAR_BUTTON1_ (u16)0xe053
|
||||||
|
#define VAR_BUTTON2_ (u16)0xe054
|
||||||
|
#define OK_BUTTON_ (u16)0xe055
|
||||||
|
#define CANCEL_BUTTON_ (u16)0xe056
|
||||||
|
#define CODE_BUTTON_BOTTOM_ (u16)0xe057
|
||||||
|
|
||||||
|
#define CHAR_USCORE L'_'
|
||||||
|
#define KEY_PER_LINE 11
|
||||||
|
|
||||||
|
#define KEY_START 109 //ソフトウェアキーのカーソルデフォルト位置はキャンセルキー
|
||||||
|
|
||||||
|
#define KEY_OK 0xffff
|
||||||
|
#define KEY_CANCEL 0xfffe
|
||||||
|
#define KEY_PREVPAGE 0xfffd
|
||||||
|
#define KEY_SUCCPAGE 0xfffc
|
||||||
|
#define KEY_ON 0xfffb
|
||||||
|
#define KEY_OFF 0xfffa
|
||||||
|
#define KEY_UP 0xfff9
|
||||||
|
#define KEY_DOWN 0xfff8
|
||||||
|
#define MULTI_KEY_UP 0xffe0
|
||||||
|
#define MULTI_KEY_DOWN 0xffd0
|
||||||
|
#define MASK_MULTI_KEY 0xfff0
|
||||||
|
|
||||||
|
// extern data----------------------------------
|
||||||
|
|
||||||
|
extern u32 bg_char_data[8 * 6];
|
||||||
|
extern u16 bg_scr_data[32 * 32];
|
||||||
|
extern u16 bg_birth_scr_data[32 * 32];
|
||||||
|
|
||||||
|
// function's prototype-------------------------
|
||||||
|
|
||||||
|
static void SetAgreeEULAInit( void );
|
||||||
|
static int SetAgreeEULAMain( void );
|
||||||
|
static void SetAgreedVersionInit( void );
|
||||||
|
static int SetAgreedVersionMain( void );
|
||||||
|
|
||||||
|
// static variable------------------------------
|
||||||
|
// 一時的にしか使わない物をstaticにしているので
|
||||||
|
// 少しでもダイエットしたい時はWork扱いにしてAlloc→Freeしましょう
|
||||||
|
|
||||||
|
// メニューで使用
|
||||||
|
static u16 sCursorMenu = 0;
|
||||||
|
|
||||||
|
// 特定のモードでのみ使用
|
||||||
|
static BOOL sbAgreeEULA = FALSE;
|
||||||
|
static u8 sAgreedVersion;
|
||||||
|
|
||||||
|
// const data-----------------------------------
|
||||||
|
|
||||||
|
// ++ メインメニュー
|
||||||
|
|
||||||
|
static const u16 *s_pStrSetting[ MS_EULA_NUMOF_ELEMENTS ]; // メインメニュー用文字テーブルへのポインタリスト
|
||||||
|
|
||||||
|
static const u16 *const s_pStrSettingElemTbl[ MS_EULA_NUMOF_ELEMENTS ][ LCFG_TWL_LANG_CODE_MAX ] = {
|
||||||
|
|
||||||
|
{
|
||||||
|
(const u16 *)L"EULAへの同意",
|
||||||
|
(const u16 *)L"Agree to EULA",
|
||||||
|
(const u16 *)L"Agree to EULA(F)",
|
||||||
|
(const u16 *)L"Agree to EULA(G)",
|
||||||
|
(const u16 *)L"Agree to EULA(I)",
|
||||||
|
(const u16 *)L"Agree to EULA(S)",
|
||||||
|
(const u16 *)L"Agree to EULA(C)",
|
||||||
|
(const u16 *)L"Agree to EULA(K)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
(const u16 *)L"同意したバージョン",
|
||||||
|
(const u16 *)L"Agreed version",
|
||||||
|
(const u16 *)L"Agreed version(F)",
|
||||||
|
(const u16 *)L"Agreed version(G)",
|
||||||
|
(const u16 *)L"Agreed version(I)",
|
||||||
|
(const u16 *)L"Agreed version(S)",
|
||||||
|
(const u16 *)L"Agreed version(C)",
|
||||||
|
(const u16 *)L"Agreed version(K)",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表示位置
|
||||||
|
static MenuPos s_settingPos[] = {
|
||||||
|
|
||||||
|
{ TRUE, 2 * 8, 6 * 8 },
|
||||||
|
{ TRUE, 2 * 8, 10 * 8 },
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表示パラメータ
|
||||||
|
static const MenuParam s_settingParam =
|
||||||
|
{
|
||||||
|
MS_EULA_NUMOF_ELEMENTS,
|
||||||
|
TXT_COLOR_BLACK,
|
||||||
|
TXT_COLOR_GREEN,
|
||||||
|
TXT_COLOR_RED,
|
||||||
|
&s_settingPos[0],
|
||||||
|
(const u16 **)&s_pStrSetting,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//=========================================================
|
||||||
|
//
|
||||||
|
// ボタンのタッチ処理
|
||||||
|
//
|
||||||
|
//=========================================================
|
||||||
|
|
||||||
|
// キャンセルボタン専用SelectSomethingFuncの実装
|
||||||
|
static BOOL SelectCancelFunc( u16 *csr, TPData *tgt )
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
ret = WithinRangeTP( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y,
|
||||||
|
CANCEL_BUTTON_BOTTOM_X, CANCEL_BUTTON_BOTTOM_Y, tgt );
|
||||||
|
if(ret) *csr = KEY_CANCEL;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OKボタン専用SelectSomethingFuncの実装
|
||||||
|
static BOOL SelectOKFunc( u16 *csr, TPData *tgt )
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
ret = WithinRangeTP( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y,
|
||||||
|
OK_BUTTON_BOTTOM_X, OK_BUTTON_BOTTOM_Y, tgt );
|
||||||
|
if(ret) *csr = KEY_OK;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ON/OFFボタン専用SelectSomethingFuncの実装
|
||||||
|
static BOOL SelectONFunc( u16 *csr, TPData *tgt )
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
ret = WithinRangeTP( ON_BUTTON_TOP_X, ON_BUTTON_TOP_Y,
|
||||||
|
ON_BUTTON_BOTTOM_X, ON_BUTTON_BOTTOM_Y, tgt );
|
||||||
|
if(ret) *csr = KEY_ON;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
static BOOL SelectOFFFunc( u16 *csr, TPData *tgt )
|
||||||
|
{
|
||||||
|
BOOL ret;
|
||||||
|
ret = WithinRangeTP( OFF_BUTTON_TOP_X, OFF_BUTTON_TOP_Y,
|
||||||
|
OFF_BUTTON_BOTTOM_X, OFF_BUTTON_BOTTOM_Y, tgt );
|
||||||
|
if(ret) *csr = KEY_OFF;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// UP/DOWNボタンの長押しとトリガを検出する
|
||||||
|
static BOOL DetectTouchUD( u16 *csr )
|
||||||
|
{
|
||||||
|
BOOL curr[2] = {FALSE, FALSE}; // 0:UP/1:DOWN
|
||||||
|
static BOOL prev[2] = {FALSE, FALSE}; // トリガ検出のために前の状態を記憶させる
|
||||||
|
BOOL trg[2] = {FALSE, FALSE};
|
||||||
|
BOOL rep[2] = {FALSE, FALSE}; // 長押し
|
||||||
|
static u8 count[2] = {0, 0}; // 何フレーム連続で押されているか
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
u16 i;
|
||||||
|
|
||||||
|
for( i=0; i < 2; i++ )
|
||||||
|
{
|
||||||
|
switch(i)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
curr[i] = WithinRangeTP( UP_BUTTON_TOP_X, UP_BUTTON_TOP_Y,
|
||||||
|
UP_BUTTON_BOTTOM_X, UP_BUTTON_BOTTOM_Y, &tpd.disp );
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
curr[i] = WithinRangeTP( DOWN_BUTTON_TOP_X, DOWN_BUTTON_TOP_Y,
|
||||||
|
DOWN_BUTTON_BOTTOM_X, DOWN_BUTTON_BOTTOM_Y, &tpd.disp );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// はじめて押されたかどうか
|
||||||
|
if( !prev[i] && curr[i] )
|
||||||
|
{
|
||||||
|
trg[i] = TRUE;
|
||||||
|
}
|
||||||
|
// 長押しカウント
|
||||||
|
if( curr[i] )
|
||||||
|
{
|
||||||
|
if( trg[i] )
|
||||||
|
{
|
||||||
|
count[i] = 1;
|
||||||
|
}
|
||||||
|
else if( count[i] > 25 )
|
||||||
|
{
|
||||||
|
count[i] = 25 - 10;
|
||||||
|
rep[i] = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
(count[i])++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // 押されていないとき
|
||||||
|
{
|
||||||
|
count[i] = 0;
|
||||||
|
}
|
||||||
|
prev[i] = curr[i]; // 状態を記憶
|
||||||
|
}
|
||||||
|
|
||||||
|
if(trg[0] || rep[0])
|
||||||
|
{
|
||||||
|
*csr = KEY_UP;
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
else if(trg[1] || rep[1])
|
||||||
|
{
|
||||||
|
*csr = KEY_DOWN;
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// パッドのキーの長押しを検出(ReadPad()を呼び出しているループ内で呼ばれる必要がある)
|
||||||
|
static u16 DetectPadRepeat( void )
|
||||||
|
{
|
||||||
|
static u8 repcount[12]; // 各キーが長押しされているフレーム数
|
||||||
|
u16 rep = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for( i=0; i < 12; i++ ) // 全部のキーについて
|
||||||
|
{
|
||||||
|
if( pad.trg & ((u16)(0x0001 << i)) ) // 押されたらカウントし始める
|
||||||
|
{
|
||||||
|
repcount[i] = 1;
|
||||||
|
}
|
||||||
|
else if( pad.cont & ((u16)(0x0001 << i)) )
|
||||||
|
{
|
||||||
|
if( repcount[i] > 25 ) // ある一定以上のフレーム数押されていたら長押しされていたと判定
|
||||||
|
{
|
||||||
|
rep = (u16)(rep | (u16)(0x0001 << i));
|
||||||
|
repcount[i] = 25 - 10;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
repcount[i]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
repcount[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rep;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=========================================================
|
||||||
|
//
|
||||||
|
// メインメニュー
|
||||||
|
//
|
||||||
|
//=========================================================
|
||||||
|
|
||||||
|
// 描画
|
||||||
|
static void DrawEULAMenuScene( void )
|
||||||
|
{
|
||||||
|
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
|
||||||
|
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"Set EULA" );
|
||||||
|
// PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<22>RETURN" );
|
||||||
|
// メニュー項目
|
||||||
|
DrawMenu( sCursorMenu, &s_settingParam );
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// あらかじめTWL設定データファイルから読み込み済みの設定を取得して表示
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
PutStringUTF16( 21*8, s_settingPos[0].y, TXT_UCOLOR_G0,
|
||||||
|
LCFG_TSD_IsAgreeEULA() ? (const u16*)L"Agree":(const u16*)L"Not agree" );
|
||||||
|
PrintfSJIS( 21*8, s_settingPos[1].y, TXT_UCOLOR_G0, "%d",
|
||||||
|
LCFG_TSD_GetAgreedEULAVersion() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初期化
|
||||||
|
void SetEULAInit( void )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// NITRO設定データのlanguageに応じたメインメニュー構成言語の切り替え
|
||||||
|
for( i=0; i < MS_EULA_NUMOF_ELEMENTS; i++ )
|
||||||
|
{
|
||||||
|
s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ LCFG_TSD_GetLanguage() ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// BGデータのロード処理
|
||||||
|
GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data));
|
||||||
|
GX_LoadBG1Scr(bg_scr_data, 0, sizeof(bg_scr_data));
|
||||||
|
|
||||||
|
DrawEULAMenuScene();
|
||||||
|
|
||||||
|
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
|
||||||
|
|
||||||
|
GX_SetVisiblePlane ( GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1);
|
||||||
|
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// メニューから呼ばれるメイン
|
||||||
|
int SetEULAMain( void )
|
||||||
|
{
|
||||||
|
SelectSomethingFunc func[1]={SelectCancelFunc};
|
||||||
|
BOOL tp_select;
|
||||||
|
BOOL tpCommit = FALSE;
|
||||||
|
u16 padrep;
|
||||||
|
static u16 commit;
|
||||||
|
|
||||||
|
ReadTP();
|
||||||
|
|
||||||
|
padrep = DetectPadRepeat(); // 長押し検出
|
||||||
|
|
||||||
|
// メニューからの項目選択
|
||||||
|
if( (pad.trg & PAD_KEY_DOWN) || (padrep & PAD_KEY_DOWN) ){ // カーソルの移動
|
||||||
|
if( ++sCursorMenu >= MS_EULA_NUMOF_ELEMENTS ) {
|
||||||
|
sCursorMenu = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( (pad.trg & PAD_KEY_UP) || (padrep & PAD_KEY_UP) ){
|
||||||
|
if( --sCursorMenu & 0x80 ) {
|
||||||
|
sCursorMenu = (u16)(MS_EULA_NUMOF_ELEMENTS - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tp_select = SelectMenuByTP( &sCursorMenu, &s_settingParam );
|
||||||
|
|
||||||
|
// 特殊ボタンタッチ
|
||||||
|
tpCommit = SelectSomethingByTP( &commit, func, 1 );
|
||||||
|
|
||||||
|
// メニューへの分岐
|
||||||
|
if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐
|
||||||
|
if( (s_settingParam.pos[sCursorMenu]).enable ) {
|
||||||
|
switch( sCursorMenu )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
SetAgreeEULAInit();
|
||||||
|
g_pNowProcess = SetAgreeEULAMain;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
SetAgreedVersionInit();
|
||||||
|
g_pNowProcess = SetAgreedVersionMain;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} // if( (s_settingParam.pos[sCursorMenu]).enable )
|
||||||
|
} // if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) )
|
||||||
|
/*
|
||||||
|
else if( (pad.trg & PAD_BUTTON_B) || (tpCommit && (commit == KEY_CANCEL)) )
|
||||||
|
{
|
||||||
|
MachineSettingInit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// 再描画
|
||||||
|
DrawEULAMenuScene();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=========================================================
|
||||||
|
//
|
||||||
|
// EULA同意/非同意のセット
|
||||||
|
//
|
||||||
|
//=========================================================
|
||||||
|
|
||||||
|
// 描画処理
|
||||||
|
static void DrawSetAgreeEULAScene( void )
|
||||||
|
{
|
||||||
|
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
|
||||||
|
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"Agree EULA" );
|
||||||
|
|
||||||
|
if( !sbAgreeEULA )
|
||||||
|
{
|
||||||
|
PutStringUTF16( ON_BUTTON_TOP_X, ON_BUTTON_TOP_Y, TXT_COLOR_GREEN, (const u16*)L"Not agree" );
|
||||||
|
PutStringUTF16( OFF_BUTTON_TOP_X, OFF_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16*)L"Agree" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PutStringUTF16( ON_BUTTON_TOP_X, ON_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16*)L"Not agree" );
|
||||||
|
PutStringUTF16( OFF_BUTTON_TOP_X, OFF_BUTTON_TOP_Y, TXT_COLOR_GREEN, (const u16*)L"Agree" );
|
||||||
|
}
|
||||||
|
PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>CANCEL" );
|
||||||
|
PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>OK" );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初期化
|
||||||
|
static void SetAgreeEULAInit( void )
|
||||||
|
{
|
||||||
|
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
|
||||||
|
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// あらかじめTWL設定データファイルから読み込み済みの設定を取得
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
sbAgreeEULA = LCFG_TSD_IsAgreeEULA();
|
||||||
|
|
||||||
|
DrawSetAgreeEULAScene();
|
||||||
|
|
||||||
|
GX_SetVisiblePlane ( GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1);
|
||||||
|
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表示プロセスとして呼び出されるメイン
|
||||||
|
static int SetAgreeEULAMain( void )
|
||||||
|
{
|
||||||
|
SelectSomethingFunc func[4]={SelectCancelFunc, SelectOKFunc, SelectONFunc, SelectOFFFunc };
|
||||||
|
u16 commit;
|
||||||
|
BOOL tp_touch = FALSE;
|
||||||
|
|
||||||
|
ReadTP();
|
||||||
|
|
||||||
|
// キーによる選択
|
||||||
|
if( (pad.trg & PAD_KEY_LEFT) || (pad.trg & PAD_KEY_RIGHT) )
|
||||||
|
{
|
||||||
|
sbAgreeEULA = !sbAgreeEULA;
|
||||||
|
}
|
||||||
|
|
||||||
|
// タッチによる選択
|
||||||
|
tp_touch = SelectSomethingByTP( &commit, func, 4 );
|
||||||
|
if( tp_touch && (commit == KEY_ON) )
|
||||||
|
{
|
||||||
|
sbAgreeEULA = TRUE;
|
||||||
|
}
|
||||||
|
else if( tp_touch && (commit == KEY_OFF) )
|
||||||
|
{
|
||||||
|
sbAgreeEULA = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 決定
|
||||||
|
if( (pad.trg & PAD_BUTTON_A) || (tp_touch && (commit == KEY_OK)) )
|
||||||
|
{
|
||||||
|
LCFG_TSD_SetFlagAgreeEULA( sbAgreeEULA );
|
||||||
|
if( !sbAgreeEULA ) {
|
||||||
|
LCFG_TSD_SetAgreedEULAVersion( 1 );
|
||||||
|
}
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// TWL設定データファイルへの書き込み
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
if( !MY_WriteTWLSettings() )
|
||||||
|
{
|
||||||
|
OS_TPrintf( "TWL settings write failed.\n" );
|
||||||
|
}
|
||||||
|
OS_TPrintf( "AgreeEULA : %s\n", OS_IsAgreeEULA() ? "Agree" : "Not agree" );
|
||||||
|
SetEULAInit();
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if( (pad.trg & PAD_BUTTON_B) || (tp_touch && (commit == KEY_CANCEL)) )
|
||||||
|
{
|
||||||
|
SetEULAInit(); // キャンセルのときセットしない
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawSetAgreeEULAScene();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=========================================================
|
||||||
|
//
|
||||||
|
// 同意EULAバージョンのセット
|
||||||
|
//
|
||||||
|
//=========================================================
|
||||||
|
|
||||||
|
// 描画処理
|
||||||
|
static void DrawSetAgreedVersionScene( void )
|
||||||
|
{
|
||||||
|
u16 iconUp[2] = {0xE01B, 0};
|
||||||
|
u16 iconDown[2] = {0xE01C, 0};
|
||||||
|
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
|
||||||
|
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"AGREED EULA VERSION" );
|
||||||
|
PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>CANCEL" );
|
||||||
|
PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>OK" );
|
||||||
|
PutStringUTF16( UP_BUTTON_TOP_X, UP_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)iconUp );
|
||||||
|
PutStringUTF16( DOWN_BUTTON_TOP_X, DOWN_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)iconDown );
|
||||||
|
PutStringUTF16( 4*8, 10*8, TXT_UCOLOR_G0, (const u16 *)L"Agreed EULA ver." );
|
||||||
|
PrintfSJIS( 20*8, 10*8, TXT_COLOR_GREEN, "%3d", sAgreedVersion );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初期化
|
||||||
|
static void SetAgreedVersionInit( void )
|
||||||
|
{
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// あらかじめTWL設定データファイルから読み込み済みの設定を取得
|
||||||
|
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
sAgreedVersion = LCFG_TSD_GetAgreedEULAVersion();
|
||||||
|
|
||||||
|
DrawSetAgreedVersionScene();
|
||||||
|
|
||||||
|
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
|
||||||
|
|
||||||
|
GX_SetVisiblePlane ( GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1);
|
||||||
|
GXS_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表示プロセスとして呼び出されるメイン
|
||||||
|
static int SetAgreedVersionMain( void )
|
||||||
|
{
|
||||||
|
SelectSomethingFunc func[2]={SelectCancelFunc, SelectOKFunc};
|
||||||
|
BOOL tpCommit = FALSE;
|
||||||
|
BOOL tpUD = FALSE;
|
||||||
|
u16 csrCommit;
|
||||||
|
u16 csrUD;
|
||||||
|
u16 padrep;
|
||||||
|
|
||||||
|
ReadTP();
|
||||||
|
|
||||||
|
// TPチェック
|
||||||
|
tpCommit = SelectSomethingByTP( &csrCommit, func, 2 );
|
||||||
|
tpUD = DetectTouchUD( &csrUD );
|
||||||
|
|
||||||
|
padrep = DetectPadRepeat(); // キーの長押し検出
|
||||||
|
|
||||||
|
// 変更
|
||||||
|
if( (pad.trg & PAD_KEY_UP) || (padrep & PAD_KEY_UP) || (tpUD && (csrUD == KEY_UP)) )
|
||||||
|
{
|
||||||
|
--sAgreedVersion;
|
||||||
|
if( sAgreedVersion == 0 ) {
|
||||||
|
sAgreedVersion = 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( (pad.trg & PAD_KEY_DOWN) || (padrep & PAD_KEY_DOWN) || (tpUD && (csrUD == KEY_DOWN)) )
|
||||||
|
{
|
||||||
|
++sAgreedVersion;
|
||||||
|
if( sAgreedVersion == 0 ) {
|
||||||
|
sAgreedVersion = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(pad.trg & PAD_BUTTON_START)
|
||||||
|
{
|
||||||
|
sAgreedVersion = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 決定
|
||||||
|
if( pad.trg & PAD_BUTTON_A || (tpCommit && (csrCommit == KEY_OK)) )
|
||||||
|
{
|
||||||
|
LCFG_TSD_SetAgreedEULAVersion( sAgreedVersion );
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
// TWL設定データファイルへの書き込み
|
||||||
|
// ::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
if( !MY_WriteTWLSettings() )
|
||||||
|
{
|
||||||
|
OS_TPrintf( "TWL settings write failed.\n" );
|
||||||
|
}
|
||||||
|
OS_TPrintf( "Agreed EULA version : %d\n", OS_GetAgreedEULAVersion() );
|
||||||
|
SetEULAInit();
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if( ( pad.trg & PAD_BUTTON_B ) || (tpCommit && (csrCommit == KEY_CANCEL)) )
|
||||||
|
{
|
||||||
|
SetEULAInit();
|
||||||
|
g_pNowProcess = SetEULAMain;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 再描画
|
||||||
|
DrawSetAgreedVersionScene();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
30
build/systemMenu_tools/setEULA/Makefile
Normal file
30
build/systemMenu_tools/setEULA/Makefile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: TwlIPL
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2007 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SUBDIRS = banner ARM9
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
|
||||||
|
#===== End of Makefile =====
|
||||||
47
build/systemMenu_tools/setEULA/banner/Makefile
Normal file
47
build/systemMenu_tools/setEULA/banner/Makefile
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#! make -f
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Project: TwlIPL
|
||||||
|
# File: Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2007 Nintendo. All rights reserved.
|
||||||
|
#
|
||||||
|
# These coded instructions, statements, and computer programs contain
|
||||||
|
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
# Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
# not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
# in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
#
|
||||||
|
# $Date:: $
|
||||||
|
# $Rev$
|
||||||
|
# $Author$
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
ICON_DIR = ./icon
|
||||||
|
|
||||||
|
BANNER_ICON = $(ICON_DIR)/gameIcon.bmp
|
||||||
|
BANNER_SPEC = banner_v3.bsf
|
||||||
|
|
||||||
|
TARGETS = banner.bnr
|
||||||
|
INSTALL_DIR = ./
|
||||||
|
INSTALL_TARGETS = $(TARGETS)
|
||||||
|
|
||||||
|
BANNER_ICON_NAME = $(basename $(BANNER_ICON))
|
||||||
|
BANNER_ICON_MIDDLE = $(addprefix $(BANNER_ICON_NAME), .nbfs .nbfc .nbfp)
|
||||||
|
|
||||||
|
LDIRT_CLEAN = $(TARGETS) \
|
||||||
|
$(BANNER_ICON_MIDDLE) \
|
||||||
|
$(TARGETS:.bnr=.srl)
|
||||||
|
|
||||||
|
include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# build
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
do-build: $(TARGETS)
|
||||||
|
|
||||||
|
$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE)
|
||||||
|
$(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS)
|
||||||
|
|
||||||
|
#
|
||||||
BIN
build/systemMenu_tools/setEULA/banner/banner_v3.bsf
Normal file
BIN
build/systemMenu_tools/setEULA/banner/banner_v3.bsf
Normal file
Binary file not shown.
BIN
build/systemMenu_tools/setEULA/banner/icon/gameIcon.bmp
Normal file
BIN
build/systemMenu_tools/setEULA/banner/icon/gameIcon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
Loading…
Reference in New Issue
Block a user