mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
ブランチ元を間違えたので削除
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@450 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
d725e929a9
commit
977817c7ed
Binary file not shown.
@ -1,37 +0,0 @@
|
||||
BasicInfo:
|
||||
Title : BoxyardEraser
|
||||
ProductCode: CTR-P-237A
|
||||
BackupMemoryType: None
|
||||
|
||||
TitleInfo:
|
||||
Use: Evaluation
|
||||
Category: Application
|
||||
UniqueId: 0xf802D
|
||||
Version: 0
|
||||
|
||||
SystemControlInfo:
|
||||
AppType : Application
|
||||
StackSize : 0x4000
|
||||
Dependency :
|
||||
- gpio
|
||||
- pdn
|
||||
- spi
|
||||
- i2c
|
||||
- mcu
|
||||
- ptm
|
||||
- codec
|
||||
- cfg
|
||||
- hid
|
||||
- gsp
|
||||
|
||||
AccessControlInfo:
|
||||
Priority : 16
|
||||
DisableDebug : true
|
||||
|
||||
Option:
|
||||
FreeProductCode: true
|
||||
|
||||
|
||||
Rom:
|
||||
# ROM に含めるファイルシステムのルートパスを指定します。
|
||||
HostRoot: "$(ROMFS_ROOT)"
|
||||
@ -1,232 +0,0 @@
|
||||
AccessControlDescriptor:
|
||||
AffinityMask: 1
|
||||
AutoGen: true
|
||||
CoreVersion: 2
|
||||
DescVersion: 2
|
||||
Descriptor: |
|
||||
AP///wAABAACAAAAAAAFGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiIAAAAAAAABBUFQ6VQAAACRo
|
||||
aW9GSU8AJGhvc3RpbzAkaG9zdGlvMWFjOnUAAAAAYm9zczpVAABjYW06dQAA
|
||||
AGNlY2Q6dQAAY2ZnOnUAAABkbHA6RktDTGRscDpTUlZSZHNwOjpEU1BmcmQ6
|
||||
dQAAAGZzOlVTRVIAZ3NwOjpHcHVoaWQ6VVNFUmh0dHA6QwAAbWljOnUAAABu
|
||||
ZG06dQAAAG5ld3M6dQAAbndtOjpVRFNwdG06dQAAAHB4aTpkZXYAc29jOlUA
|
||||
AABzc2w6QwAAAHkycjp1AAAAaXI6VVNFUgBsZHI6cm8AAGFtOnUAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAD+//vw/7//8ec/APIA8JH/APaR/1D/gf9Y/4H/cP+B/3j/gf8B
|
||||
AQD/AAIA/v//////////////////////////////////////////////////
|
||||
////////////////////////////////////////AAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAI=
|
||||
DisableDebug: false
|
||||
EnableInterruptNumbers: []
|
||||
EnableSystemCalls:
|
||||
ArbitrateAddress: 34
|
||||
Break: 60
|
||||
CancelTimer: 28
|
||||
ClearEvent: 25
|
||||
ClearTimer: 29
|
||||
CloseHandle: 35
|
||||
ConnectToPort: 45
|
||||
ControlMemory: 1
|
||||
CreateAddressArbiter: 33
|
||||
CreateEvent: 23
|
||||
CreateMemoryBlock: 30
|
||||
CreateMutex: 19
|
||||
CreateSemaphore: 21
|
||||
CreateThread: 8
|
||||
CreateTimer: 26
|
||||
DuplicateHandle: 39
|
||||
ExitProcess: 3
|
||||
ExitThread: 9
|
||||
GetCurrentProcessorNumber: 17
|
||||
GetHandleInfo: 41
|
||||
GetProcessAffinityMask: 4
|
||||
GetProcessId: 53
|
||||
GetProcessIdOfThread: 54
|
||||
GetProcessIdealProcessor: 6
|
||||
GetProcessInfo: 43
|
||||
GetResourceLimit: 56
|
||||
GetResourceLimitCurrentValues: 58
|
||||
GetResourceLimitLimitValues: 57
|
||||
GetSystemInfo: 42
|
||||
GetSystemTick: 40
|
||||
GetThreadAffinityMask: 13
|
||||
GetThreadContext: 59
|
||||
GetThreadId: 55
|
||||
GetThreadIdealProcessor: 15
|
||||
GetThreadInfo: 44
|
||||
GetThreadPriority: 11
|
||||
MapMemoryBlock: 31
|
||||
OutputDebugString: 61
|
||||
QueryMemory: 2
|
||||
ReleaseMutex: 20
|
||||
ReleaseSemaphore: 22
|
||||
SendSyncRequest1: 46
|
||||
SendSyncRequest2: 47
|
||||
SendSyncRequest3: 48
|
||||
SendSyncRequest4: 49
|
||||
SendSyncRequest: 50
|
||||
SetProcessAffinityMask: 5
|
||||
SetProcessIdealProcessor: 7
|
||||
SetThreadAffinityMask: 14
|
||||
SetThreadIdealProcessor: 16
|
||||
SetThreadPriority: 12
|
||||
SetTimer: 27
|
||||
SignalEvent: 24
|
||||
SleepThread: 10
|
||||
UnmapMemoryBlock: 32
|
||||
WaitSynchronization1: 36
|
||||
WaitSynchronizationN: 37
|
||||
FileSystemAccess:
|
||||
- Debug
|
||||
- DirectSdmc
|
||||
- DirectSdmcWrite
|
||||
HandleTableSize: 512
|
||||
IORegisterMapping:
|
||||
- 1ff50000-1ff57fff
|
||||
- 1ff70000-1ff77fff
|
||||
IdealProcessor: 1
|
||||
MemoryMapping:
|
||||
- 1f000000-1f5fffff:r
|
||||
MemoryType: Application
|
||||
Priority: 24
|
||||
ProgramId: 0x00040000ffffff00L
|
||||
ServiceAccessControl:
|
||||
- APT:U
|
||||
- $hioFIO
|
||||
- $hostio0
|
||||
- $hostio1
|
||||
- ac:u
|
||||
- boss:U
|
||||
- cam:u
|
||||
- cecd:u
|
||||
- cfg:u
|
||||
- dlp:FKCL
|
||||
- dlp:SRVR
|
||||
- dsp::DSP
|
||||
- frd:u
|
||||
- fs:USER
|
||||
- gsp::Gpu
|
||||
- hid:USER
|
||||
- http:C
|
||||
- mic:u
|
||||
- ndm:u
|
||||
- news:u
|
||||
- nwm::UDS
|
||||
- ptm:u
|
||||
- pxi:dev
|
||||
- soc:U
|
||||
- ssl:C
|
||||
- y2r:u
|
||||
- ir:USER
|
||||
- ldr:ro
|
||||
- am:u
|
||||
Signature: |
|
||||
hiQzwen590fW0thDfToCcvkG0S+Uw+X9LKyUJarMsCJ5T14SlKlhKgT9Kkmd
|
||||
yt1cCDqoEQguN5pQny5iS6usQ51/ORdfO0Qf/ZSYvXNqEZyP2zG54sGd1Uie
|
||||
/TftK28EhpufbgOCFaPbv3Tnbp5EUZaG0OAwNs0ez4605+e1AzGUrEspzCYK
|
||||
sqYfTDFDmBz2dul/gvU2kRjGUUYyrw1Eg5ZJPt53LX/DePKXZnvb3eeel/sq
|
||||
ZOgYLnc2n2upzkpO/dr6Wer2D4o3lpPk1parE6orOyRDB0TTFu6u5aqRldf8
|
||||
t8D2fz7keTdyYlhjEgAGUkcEU7ZU1SrvpwD5ktNyaA==
|
||||
StorageId:
|
||||
- 0
|
||||
CommonHeaderKey:
|
||||
D: |
|
||||
xsiNQCpJR94/2XdRoz1v6+OKN8UF+Ev/J5/u4e+EOY1Jjpc7BMg3KRZkrNym
|
||||
+LYe8vqMT7I/5d3rgasgrX3FAEoIPL9VvL4IqfjZcyo/75o+NE6TOWUp3K3Z
|
||||
UbDwgMscl9nLPnOFiGFbZsMV/Aa0ro1w7+hXt3+diJaCHzimI0NNy5a8Beqi
|
||||
Tm1Od3e5lCepBcypiniam9AyMwd3tGHKuMPg3WV6KPyE8lefPkrMkiYHVITY
|
||||
wvcDvra83T4vprQySXAKuzUDZdrlzCtPe+Bz1eJkWQUuY3MuGNb9OmjQvKzc
|
||||
w+GF9oNWvV729IH4pwcsgZYMyT+0ok81VeqMHm2HLQ==
|
||||
DP: |
|
||||
YdqZEbc18syS7xGY/emuqX+bQPcxgnXpCQVFA8Yh43ztQKPWTxCe9aUE1sY6
|
||||
sraf/MT3x3hTlATlOqxJxQZeXxPlQm6Vcpq5iCn78GThugKS5yEkbNaSdQ8T
|
||||
atWoGbDlQfWgcRovbhd71vzguIP028yGIDuzNnlz5IDZthMfiNU=
|
||||
DQ: |
|
||||
ixmQMZXKCcoocsnule/XIpYFQcX3W61Jl6xQs0J4kZCFxUQOb9rjoalVsdRA
|
||||
9J11fi5GJ0OTsVc7GuN6dRful9IXDscM3BiJUA8aMmTCxuZpc5xjpXQZ1O1e
|
||||
wk8IwtamgurCUqW2gsRDMtGjh4gyYT1ybxiyKDI235aBCpTiGws=
|
||||
Exponent: |
|
||||
AQAB
|
||||
InverseQ: |
|
||||
EMZs1VAoSlb/lK8k5JK+8jJqnZdkikQBZglABYxOdnUy0k//ZQv7bvPsWJFi
|
||||
fC/KK4U5Cs1ecNIEv6yHqUmpLYVro+7pAcUckvCiknBLJZ1zYNq02cObUhjr
|
||||
AnHhuKZmS7E+jRyEKH5Sh8wQf1LNG1lR6fH6Q86Adr7ltkKzwbI=
|
||||
Modulus: |
|
||||
6zhbyBHBgjpggDJ9GPgrtqvMTV84dPgPqIHIwUYrkt4qg6vddoqxc6/NzLDJ
|
||||
7Avi/wgZc267X/g9tq0vkd+vFY7cR1idP0zCCiEs55a9RM1YMtRGyxdx52Y8
|
||||
+6k0ld48l5T24a1mwWWEIpXh8UImxHsKU9yXoCazpaCLukE09x3OxTkZYhYK
|
||||
HJlRfsVAPWr2BbW4/chR061pzskxjEp9Iw9LEu9Msor/lCd6jASF9rdBbDoH
|
||||
beY4+67JPDtVnJYyU55vUoLglXXAK73YksTWjFVG2fNp9OQLDZYSuhyInlry
|
||||
mInm7uKcgQMdXxwe8DIYo4SGIlHg/TfRwcxaB1vd9Q==
|
||||
P: |
|
||||
9o+b9xrx8fhM9rvVFRvR+BHXfpPHKrDDk7eenDWtTPmwQLvwhFmBuZtveP4v
|
||||
DkjSG+ILlDUZnP2NO9Y7vIWnRoNrKrvoyKDnhVv837SWxjBazYJUCLDXOrH+
|
||||
e7+y/KTKTvbUs2SnPocYfhFwFDQFReoC67kXEn2SknY1fhbFehM=
|
||||
Q: |
|
||||
9Dma3JAhr2OJRobNddJfR0zOGrp1KjQePO22IhSBUgoo0bZMcSvQbz+UNYkc
|
||||
GryMnsgrN8bZdKxIoVo+dKYUHt333ztUJwUF6LnLE+4REynUyvawLNL76aLu
|
||||
PdxKDhxAc461k5IHNFrRRJ+DS+0qntnUz2Ojo3FeR5+2tLO/SNc=
|
||||
DefaultSpec:
|
||||
AccessControlInfo:
|
||||
AffinityMask: 1
|
||||
FirmwareVersion: 2
|
||||
HandleTableSize: 512
|
||||
IORegisterMapping:
|
||||
- 1ff50000-1ff57fff
|
||||
- 1ff70000-1ff77fff
|
||||
IdealProcessor: 0
|
||||
MemoryMapping:
|
||||
- 1f000000-1f5fffff:r
|
||||
Priority: 16
|
||||
BasicInfo:
|
||||
CompanyCode: "00"
|
||||
Logo: Nintendo
|
||||
Title: default
|
||||
ExeFs:
|
||||
ReadOnly:
|
||||
- RO
|
||||
ReadWrite:
|
||||
- RW
|
||||
Text:
|
||||
- STUP_ENTRY
|
||||
Media:
|
||||
MediaType: Card
|
||||
PlainRegion:
|
||||
- .module_id
|
||||
Rom:
|
||||
DefaultReject:
|
||||
- .*
|
||||
File:
|
||||
- "*"
|
||||
SystemControlInfo:
|
||||
Dependency:
|
||||
ac: 0x0004013000002402L
|
||||
am: 0x0004013000001502L
|
||||
boss: 0x0004013000003402L
|
||||
camera: 0x0004013000001602L
|
||||
cecd: 0x0004013000002602L
|
||||
cfg: 0x0004013000001702L
|
||||
codec: 0x0004013000001802L
|
||||
csnd: 0x0004013000002702L
|
||||
dlp: 0x0004013000002802L
|
||||
dsp: 0x0004013000001a02L
|
||||
friends: 0x0004013000003202L
|
||||
gpio: 0x0004013000001b02L
|
||||
gsp: 0x0004013000001c02L
|
||||
hid: 0x0004013000001d02L
|
||||
http: 0x0004013000002902L
|
||||
i2c: 0x0004013000001e02L
|
||||
mcu: 0x0004013000001f02L
|
||||
mic: 0x0004013000002002L
|
||||
ndm: 0x0004013000002b02L
|
||||
news: 0x0004013000003502L
|
||||
nim: 0x0004013000002c02L
|
||||
nwm: 0x0004013000002d02L
|
||||
pdn: 0x0004013000002102L
|
||||
ps: 0x0004013000003102L
|
||||
ptm: 0x0004013000002202L
|
||||
ro: 0x0004013000003702L
|
||||
socket: 0x0004013000002e02L
|
||||
spi: 0x0004013000002302L
|
||||
ssl: 0x0004013000002f02L
|
||||
StackSize: 16384
|
||||
@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: HeapManager.cpp
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "HeapManager.h"
|
||||
|
||||
namespace common
|
||||
{
|
||||
|
||||
nn::fnd::ThreadSafeExpHeap HeapManager::s_AppHeap;
|
||||
|
||||
HeapManager::HeapManager()
|
||||
{
|
||||
// TODO 自動生成されたコンストラクター・スタブ
|
||||
|
||||
}
|
||||
|
||||
HeapManager::~HeapManager()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
nn::fnd::ThreadSafeExpHeap* HeapManager::GetHeap()
|
||||
{
|
||||
return &s_AppHeap;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: HeapManager.h
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef HEAPMANAGER_H_
|
||||
#define HEAPMANAGER_H_
|
||||
|
||||
#include <nn.h>
|
||||
|
||||
namespace common
|
||||
{
|
||||
|
||||
class HeapManager
|
||||
{
|
||||
public:
|
||||
HeapManager();
|
||||
virtual ~HeapManager();
|
||||
|
||||
static nn::fnd::ThreadSafeExpHeap* GetHeap();
|
||||
|
||||
private:
|
||||
// デバイスメモリ管理用拡張ヒープ
|
||||
static nn::fnd::ThreadSafeExpHeap s_AppHeap;
|
||||
|
||||
};
|
||||
|
||||
} // namespace common
|
||||
|
||||
#endif /* HEAPMANAGER_H_ */
|
||||
@ -1,68 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev$
|
||||
#----------------------------------------------------------------------------
|
||||
SUPPORTED_TARGETS = CTR-T*.Process.MPCore.*
|
||||
CTR_APPTYPE = BOTH
|
||||
CTR_MAKE_DEVELOPMENT_IMAGE = true
|
||||
|
||||
TARGET_PROGRAM = BoxyardEraser
|
||||
|
||||
SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include)
|
||||
INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \
|
||||
|
||||
SOURCES[] =
|
||||
main.cpp
|
||||
ResFont.cpp
|
||||
HeapManager.cpp
|
||||
|
||||
CTR_BANNER_SPEC = $(TARGET_PROGRAM).bsf
|
||||
|
||||
ROMFS_ROOT = romfiles
|
||||
|
||||
SHADER_BIN = nnfont_RectDrawerShader.shbin
|
||||
SHADER_PATH = $(ROMFS_ROOT)/$(SHADER_BIN)
|
||||
|
||||
ROMFS_DEPENDENCIES = $(SHADER_PATH)
|
||||
|
||||
LIBS += libnn_cfg \
|
||||
libnn_driversEeprom \
|
||||
libnn_driversi2c \
|
||||
libnn_driversCal \
|
||||
libnn_crypto \
|
||||
libnn_driversCodec \
|
||||
libnn_spi \
|
||||
libnn_gpio \
|
||||
libnn_pdn \
|
||||
libnn_mcu \
|
||||
libnn_i2c \
|
||||
libnn_driversCamera \
|
||||
libnn_ps \
|
||||
libnn_driversRsa \
|
||||
lib_demo \
|
||||
libnn_nwm \
|
||||
libnn_friends \
|
||||
libnn_ns \
|
||||
libnn_am \
|
||||
|
||||
INSTALL_SDK_TOOL = true
|
||||
|
||||
ROM_SPEC_FILE = $(TARGET_PROGRAM).rsf
|
||||
DESCRIPTOR = BoxyardRemover.desc
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
VERSION_H = $(file version.h)
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakeroot
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev:$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# ディレクトリレイアウトについての説明
|
||||
#
|
||||
# a) ソースコードがルートディレクトリ直下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# OMakefile と同じディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /foo/bar/objects/...
|
||||
# /foo/bar/images/..
|
||||
#
|
||||
#
|
||||
# b) ソースコードが sources 以下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /sources/foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# ルートディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /objects/foo/bar/...
|
||||
# /images/foo/bar/...
|
||||
#
|
||||
#
|
||||
|
||||
# ルート環境変数の取得
|
||||
public.HORIZON_ROOT =
|
||||
if $(defined-env HORIZON_ROOT)
|
||||
HORIZON_ROOT = $(absname $(getenv HORIZON_ROOT))
|
||||
export
|
||||
|
||||
if $(defined-env CTRSDK_ROOT)
|
||||
CTRSDK_ROOT = $(absname $(getenv CTRSDK_ROOT))
|
||||
if $(and $(defined-env HORIZON_ROOT), $(not $(equal $(HORIZON_ROOT), $(CTRSDK_ROOT))))
|
||||
eprintln(HORIZON_ROOT と CTRSDK_ROOT が一致しません。同じパスを設定するか、どちらか一方だけを定義して下さい。)
|
||||
exit(1)
|
||||
HORIZON_ROOT = $(CTRSDK_ROOT)
|
||||
export
|
||||
|
||||
if $(not $(HORIZON_ROOT))
|
||||
eprintln($"$$CTRSDK_ROOT が定義されていません")
|
||||
exit(1)
|
||||
|
||||
include $(HORIZON_ROOT)/build/omake/commondefs
|
||||
|
||||
DefineCommandVars()
|
||||
|
||||
.PHONY: all build clean clobber
|
||||
.PHONY: run run-scripts run-emumem
|
||||
|
||||
#
|
||||
# OMakefile の読み込み
|
||||
#
|
||||
.SUBDIRS: .
|
||||
|
||||
@ -1,232 +0,0 @@
|
||||
AccessControlDescriptor:
|
||||
AffinityMask: 1
|
||||
AutoGen: true
|
||||
CoreVersion: 2
|
||||
DescVersion: 2
|
||||
Descriptor: |
|
||||
AP///wAABAACAAAAAAAFGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjIEAAAAAAABBUFQ6VQAAACRo
|
||||
aW9GSU8AJGhvc3RpbzAkaG9zdGlvMWFjOnUAAAAAYm9zczpVAABkc3A6OkRT
|
||||
UGZyZDp1AAAAZnM6VVNFUgBnc3A6OkdwdWhpZDpVU0VSaHR0cDpDAABuZG06
|
||||
dQAAAG53bTo6VURTcHRtOnUAAABweGk6ZGV2AHNvYzpVAAAAc3NsOkMAAABs
|
||||
ZHI6cm8AAHBzOnBzAAAAY2ZnOm5vcgBtY3U6OkhXQ2FtOnUAAAAAY2ZnOmkA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAD+//vw/7//8ec/APIA8JH/APaR/1D/gf9Y/4H/cP+B/3j/gf8B
|
||||
AQD/AAIA/v//////////////////////////////////////////////////
|
||||
////////////////////////////////////////AAAAAAAAAAAAAAAAAAAA
|
||||
ABUAAAAAAAAAAAAAAAAAAAI=
|
||||
DisableDebug: false
|
||||
EnableInterruptNumbers: []
|
||||
EnableSystemCalls:
|
||||
ArbitrateAddress: 34
|
||||
Break: 60
|
||||
CancelTimer: 28
|
||||
ClearEvent: 25
|
||||
ClearTimer: 29
|
||||
CloseHandle: 35
|
||||
ConnectToPort: 45
|
||||
ControlMemory: 1
|
||||
CreateAddressArbiter: 33
|
||||
CreateEvent: 23
|
||||
CreateMemoryBlock: 30
|
||||
CreateMutex: 19
|
||||
CreateSemaphore: 21
|
||||
CreateThread: 8
|
||||
CreateTimer: 26
|
||||
DuplicateHandle: 39
|
||||
ExitProcess: 3
|
||||
ExitThread: 9
|
||||
GetCurrentProcessorNumber: 17
|
||||
GetHandleInfo: 41
|
||||
GetProcessAffinityMask: 4
|
||||
GetProcessId: 53
|
||||
GetProcessIdOfThread: 54
|
||||
GetProcessIdealProcessor: 6
|
||||
GetProcessInfo: 43
|
||||
GetResourceLimit: 56
|
||||
GetResourceLimitCurrentValues: 58
|
||||
GetResourceLimitLimitValues: 57
|
||||
GetSystemInfo: 42
|
||||
GetSystemTick: 40
|
||||
GetThreadAffinityMask: 13
|
||||
GetThreadContext: 59
|
||||
GetThreadId: 55
|
||||
GetThreadIdealProcessor: 15
|
||||
GetThreadInfo: 44
|
||||
GetThreadPriority: 11
|
||||
MapMemoryBlock: 31
|
||||
OutputDebugString: 61
|
||||
QueryMemory: 2
|
||||
ReleaseMutex: 20
|
||||
ReleaseSemaphore: 22
|
||||
SendSyncRequest1: 46
|
||||
SendSyncRequest2: 47
|
||||
SendSyncRequest3: 48
|
||||
SendSyncRequest4: 49
|
||||
SendSyncRequest: 50
|
||||
SetProcessAffinityMask: 5
|
||||
SetProcessIdealProcessor: 7
|
||||
SetThreadAffinityMask: 14
|
||||
SetThreadIdealProcessor: 16
|
||||
SetThreadPriority: 12
|
||||
SetTimer: 27
|
||||
SignalEvent: 24
|
||||
SleepThread: 10
|
||||
UnmapMemoryBlock: 32
|
||||
WaitSynchronization1: 36
|
||||
WaitSynchronizationN: 37
|
||||
FileSystemAccess:
|
||||
- Debug
|
||||
- DirectSdmc
|
||||
- DirectSdmcWrite
|
||||
- Core
|
||||
- CategoryFileSystemTool
|
||||
HandleTableSize: 512
|
||||
IORegisterMapping:
|
||||
- 1ff50000-1ff57fff
|
||||
- 1ff70000-1ff77fff
|
||||
IdealProcessor: 1
|
||||
IoAccessControl:
|
||||
- FsMountCardSpi
|
||||
- FsMountNand
|
||||
- FsMountTwln
|
||||
MemoryMapping:
|
||||
- 1f000000-1f5fffff:r
|
||||
MemoryType: Application
|
||||
Priority: 24
|
||||
ProgramId: 0x00040000ffffff00L
|
||||
ServiceAccessControl:
|
||||
- APT:U
|
||||
- $hioFIO
|
||||
- $hostio0
|
||||
- $hostio1
|
||||
- ac:u
|
||||
- boss:U
|
||||
- dsp::DSP
|
||||
- frd:u
|
||||
- fs:USER
|
||||
- gsp::Gpu
|
||||
- hid:USER
|
||||
- http:C
|
||||
- ndm:u
|
||||
- nwm::UDS
|
||||
- ptm:u
|
||||
- pxi:dev
|
||||
- soc:U
|
||||
- ssl:C
|
||||
- ldr:ro
|
||||
- ps:ps
|
||||
- cfg:nor
|
||||
- mcu::HWC
|
||||
- am:u
|
||||
- cfg:i
|
||||
Signature: |
|
||||
aktZ4eHHc/0DJOO0+J0yS+OCTUDkOocI441pzjNa56jmsr3CsVoD5IGi9K+R
|
||||
m+3gVcMc6DJHlflrsjGaEAg7a2s2b/yQ9kZAx8mwHgqihlD33eU73kOo0xV1
|
||||
hVLn2kWDDpweFKxPfjyfalqtwZLFAAnaz8HS852tokldYDVU6bchxCvF28aJ
|
||||
vrVN0hHAvaJ2rVv/OMjgYIGwARPS7z5yDs2DxGbcJH55Q8KetUG0QFuXJZIC
|
||||
g4eOXC2soHSnve1jKKvPfcaIJyBH+3fUVt1FQX88b8t8H51j5uSMbzTmskJY
|
||||
rsMv6W6bler0T0zs8tHOS9aXCd75QTvpijFFgLQ14Q==
|
||||
StorageId:
|
||||
- 0
|
||||
CommonHeaderKey:
|
||||
D: |
|
||||
kVlG6tIpWOE416smaUI8k/v3soWJXEmzahOtNDHwHUyIKG/U7TWu2RsPHT+q
|
||||
PvXaLZ6Rt34GqvZzVTpS0595/hqdkQEvFNQZyWTgi1XZJclnNFztAp4cje+l
|
||||
c9rYm27XiqN01c4z/mJFf9EOFGDKuVTxS9YgOywWHCiOzsLMLc3bV09LGhGX
|
||||
pMMtWk8CkubDU03onDLvIXT60Z0wJL2D65+cEtf2bt2CqBtIqBqwf7SYToNq
|
||||
RnlPTohUQp0pXslnMllZ++PoWMOZhENAY6eA/ddwX43e3oHKDsAQPUtf8aX2
|
||||
nPf5fMKohI0SjqpFhsSh8mbBm+Bah02Xtd1OiF0XgQ==
|
||||
DP: |
|
||||
KRRQMwUuh9j3rsFqFXmkVfci7cnOObNolT5mISNLjOVyb5oBZSnjQGtwAGy3
|
||||
F3uUcdykCQi4ZZq1k+mzfuRr+tkKMfQbt9TJ2hHCUfmH5m7CSVr6uTlHaHmX
|
||||
qXYgsknFDMEOHbwNFrI+89mAlyXwg0M2J9y5hHD3TYp3OfViHZE=
|
||||
DQ: |
|
||||
DsFfTFpoPFZYh5Hkb5apEE2WeS29NBt5wxhbqQ838TYeATtnFRKZJzbrVQ4G
|
||||
TrNy8/pmaoZIUbK+xVCbO/FTid28jGVBOWQVig1KNrdk5nFjlvw3OHCwLIL7
|
||||
FyugGwkS7CTM0z+oNorMF71FRapRX0REE9FaCwmi4SNzi9UK2FM=
|
||||
Exponent: |
|
||||
AQAB
|
||||
InverseQ: |
|
||||
VhhJpDTD3EGpkm8BsN/SCBYOh9ozOVeMig81EjfFctH0u7TLwlMLVEJ96Z8h
|
||||
7oVh2c9ZQqWSBO8t/xhrQKdNjKo781rySHWDBjAewzULhUutV0QKUx1IG0wx
|
||||
WeR3KdKWEURIsArdxT6dacyqOyb7xWdO40N/awZ+9Jv5G+RjCN4=
|
||||
Modulus: |
|
||||
0DQPmbjwh2wztNIEgD/0To/vEjP93JCVQt71+OwxrsfxQYh3xPjcUSqGsZzv
|
||||
vknSF68QjS5otNOhWMCGubCqn4+1wiFky5mp84xjSSJE0ji+JBomOaCmaC/q
|
||||
WrEQGuZHIwWAvuMA68Hj/XC/FEV3nmol37j72CPoO3Aac39pgowuMiY4eshZ
|
||||
TYmJL9K9mUMOXsJq++KoZl1mXEQmQIHfSQalG93yJwybdQs+TUJZy9LEEdGS
|
||||
CL7Ei7i0bXb7HzS39AOC+g4OHhdCSGyRzutGkm7HoiiZdlK6ShpmBRUerAIl
|
||||
ED9SuU+SQi9sjnsq3qTVNKbRF/Gzlr+7WrjWBCaxDw==
|
||||
P: |
|
||||
/UQWt9VELddu6yu01cCPt3MvdyGSXP+3xHFd3RDsNWQ3amiLFQf1EuXCiZQA
|
||||
SzPfYOMZInTiVnvctanE9psQ43ZeMAdD3SPsg3uN11g8fr1O2YvTmKMB67K+
|
||||
59DZhpX4vVdkr1/3NCW0ht/iWH4vhSvREH5rb/LL5aXaP5feKZk=
|
||||
Q: |
|
||||
0nNwlIODzVV0tqZbySDZ4/UDG13lse24DQshAVSSb9/dpQs3POBP4bJBZ8HJ
|
||||
/8N6CODEYhfkXYuWJi8p3vAXzNC5FcXQkZg0CxPK9jp6HPyadN/dfqFEUJ/8
|
||||
G8jqXVQt+aIfUDKOorzKRGE4J6UF8ChMqlZ1WkrfkAkszw+xaOc=
|
||||
DefaultSpec:
|
||||
AccessControlInfo:
|
||||
AffinityMask: 1
|
||||
FirmwareVersion: 2
|
||||
HandleTableSize: 512
|
||||
IORegisterMapping:
|
||||
- 1ff50000-1ff57fff
|
||||
- 1ff70000-1ff77fff
|
||||
IdealProcessor: 0
|
||||
MemoryMapping:
|
||||
- 1f000000-1f5fffff:r
|
||||
Priority: 16
|
||||
BasicInfo:
|
||||
CompanyCode: "00"
|
||||
Logo: Nintendo
|
||||
Title: default
|
||||
ExeFs:
|
||||
ReadOnly:
|
||||
- RO
|
||||
ReadWrite:
|
||||
- RW
|
||||
Text:
|
||||
- STUP_ENTRY
|
||||
Media:
|
||||
MediaType: Card
|
||||
PlainRegion:
|
||||
- .module_id
|
||||
Rom:
|
||||
DefaultReject:
|
||||
- .*
|
||||
File:
|
||||
- "*"
|
||||
SystemControlInfo:
|
||||
Dependency:
|
||||
ac: 0x0004013000002402L
|
||||
am: 0x0004013000001502L
|
||||
boss: 0x0004013000003402L
|
||||
camera: 0x0004013000001602L
|
||||
cecd: 0x0004013000002602L
|
||||
cfg: 0x0004013000001702L
|
||||
codec: 0x0004013000001802L
|
||||
csnd: 0x0004013000002702L
|
||||
dlp: 0x0004013000002802L
|
||||
dsp: 0x0004013000001a02L
|
||||
friends: 0x0004013000003202L
|
||||
gpio: 0x0004013000001b02L
|
||||
gsp: 0x0004013000001c02L
|
||||
hid: 0x0004013000001d02L
|
||||
http: 0x0004013000002902L
|
||||
i2c: 0x0004013000001e02L
|
||||
mcu: 0x0004013000001f02L
|
||||
mic: 0x0004013000002002L
|
||||
ndm: 0x0004013000002b02L
|
||||
news: 0x0004013000003502L
|
||||
nim: 0x0004013000002c02L
|
||||
nwm: 0x0004013000002d02L
|
||||
pdn: 0x0004013000002102L
|
||||
ps: 0x0004013000003102L
|
||||
ptm: 0x0004013000002202L
|
||||
socket: 0x0004013000002e02L
|
||||
spi: 0x0004013000002302L
|
||||
ssl: 0x0004013000002f02L
|
||||
StackSize: 16384
|
||||
@ -1,417 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: ResFont.cpp
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// デモ: ResFont
|
||||
//
|
||||
// 概要
|
||||
// nn::font::ResFont の構築と破棄のサンプルです。
|
||||
//
|
||||
// 操作
|
||||
// なし。
|
||||
//
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/fs.h>
|
||||
#include <nn/font.h>
|
||||
#include <nn/math.h>
|
||||
#include <nn/util.h>
|
||||
|
||||
#include "ResFont.h"
|
||||
#include "demo.h"
|
||||
#include "HeapManager.h"
|
||||
|
||||
namespace common
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
const char s_ShaderBinaryFilePath[] = "rom:/nnfont_RectDrawerShader.shbin";
|
||||
const char s_FontFilePath[] = "rom:/lc.bcfnt";
|
||||
|
||||
const u8 s_Color = 255;
|
||||
|
||||
nn::font::RectDrawer s_Drawer;
|
||||
void* s_DrawerBuf;
|
||||
nn::font::ResFont s_Font;
|
||||
nn::font::DispStringBuffer *s_pDrawStringBuf0;
|
||||
nn::font::TextWriter s_TextWriter;
|
||||
void (*s_DrawTextFunc)() = NULL;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief シェーダの初期化を行います。
|
||||
//!
|
||||
//! @param[in,out] pResource 描画用リソースを管理するオブジェクトへのポインタ。
|
||||
//---------------------------------------------------------------------------
|
||||
void*
|
||||
InitShaders(nn::font::RectDrawer* pDrawer)
|
||||
{
|
||||
nn::fs::FileReader shaderReader(s_ShaderBinaryFilePath);
|
||||
|
||||
const u32 fileSize = (u32)shaderReader.GetSize();
|
||||
|
||||
void* shaderBinary = HeapManager::GetHeap()->Allocate(fileSize);
|
||||
NN_NULL_ASSERT(shaderBinary);
|
||||
|
||||
#ifndef NN_BUILD_RELEASE
|
||||
s32 read =
|
||||
#endif // NN_BUILD_RELEASE
|
||||
shaderReader.Read(shaderBinary, fileSize);
|
||||
NN_ASSERT(read == fileSize);
|
||||
|
||||
const u32 vtxBufCmdBufSize =
|
||||
nn::font::RectDrawer::GetVertexBufferCommandBufferSize(shaderBinary, fileSize);
|
||||
void *const vtxBufCmdBuf = HeapManager::GetHeap()->Allocate(vtxBufCmdBufSize);
|
||||
NN_NULL_ASSERT(vtxBufCmdBuf);
|
||||
pDrawer->Initialize(vtxBufCmdBuf, shaderBinary, fileSize);
|
||||
|
||||
HeapManager::GetHeap()->Free(shaderBinary);
|
||||
|
||||
return vtxBufCmdBuf;
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief 描画の初期設定を行います。
|
||||
//!
|
||||
//! @param[in] width 画面の幅。
|
||||
//! @param[in] height 画面の高さ。
|
||||
//---------------------------------------------------------------------------
|
||||
void
|
||||
InitDraw(
|
||||
s32 width,
|
||||
s32 height
|
||||
)
|
||||
{
|
||||
// カラーバッファ情報
|
||||
// LCDの向きに合わせて、幅と高さを入れ替えています。
|
||||
const nn::font::ColorBufferInfo colBufInfo = { width, height, PICA_DATA_DEPTH24_STENCIL8_EXT };
|
||||
|
||||
const u32 screenSettingCommands[] =
|
||||
{
|
||||
|
||||
// ビューポートの設定
|
||||
NN_FONT_CMD_SET_VIEWPORT( 0, 0, colBufInfo.width, colBufInfo.height ),
|
||||
|
||||
// シザー処理を無効
|
||||
NN_FONT_CMD_SET_DISABLE_SCISSOR( colBufInfo ),
|
||||
|
||||
// wバッファの無効化
|
||||
// デプスレンジの設定
|
||||
// ポリゴンオフセットの無効化
|
||||
NN_FONT_CMD_SET_WBUFFER_DEPTHRANGE_POLYGONOFFSET(
|
||||
0.0f, // wScale : 0.0 でWバッファが無効
|
||||
0.0f, // depth range near
|
||||
1.0f, // depth range far
|
||||
0, // polygon offset units : 0.0 で ポリゴンオフセットが無効
|
||||
colBufInfo),
|
||||
};
|
||||
|
||||
nngxAdd3DCommand(screenSettingCommands, sizeof(screenSettingCommands), true);
|
||||
|
||||
static const u32 s_InitCommands[] =
|
||||
{
|
||||
// カリングを無効
|
||||
NN_FONT_CMD_SET_CULL_FACE( NN_FONT_CMD_CULL_FACE_DISABLE ),
|
||||
|
||||
// ステンシルテストを無効
|
||||
NN_FONT_CMD_SET_DISABLE_STENCIL_TEST(),
|
||||
|
||||
// デプステストを無効
|
||||
// カラーバッファの全ての成分を書き込み可
|
||||
NN_FONT_CMD_SET_DEPTH_FUNC_COLOR_MASK(
|
||||
false, // isDepthTestEnabled
|
||||
0, // depthFunc
|
||||
true, // depthMask
|
||||
true, // red
|
||||
true, // green
|
||||
true, // blue
|
||||
true), // alpha
|
||||
|
||||
// アーリーデプステストを無効
|
||||
NN_FONT_CMD_SET_ENABLE_EARLY_DEPTH_TEST( false ),
|
||||
|
||||
// フレームバッファアクセス制御
|
||||
NN_FONT_CMD_SET_FBACCESS(
|
||||
true, // colorRead
|
||||
true, // colorWrite
|
||||
false, // depthRead
|
||||
false, // depthWrite
|
||||
false, // stencilRead
|
||||
false), // stencilWrite
|
||||
};
|
||||
|
||||
nngxAdd3DCommand(s_InitCommands, sizeof(s_InitCommands), true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief ResFontを構築します。
|
||||
//!
|
||||
//! @param[out] pFont 構築するフォントへのポインタ。
|
||||
//! @param[in] filePath ロードするフォントリソースファイル名。
|
||||
//!
|
||||
//! @return ResFont構築の成否を返します。
|
||||
//---------------------------------------------------------------------------
|
||||
bool
|
||||
InitFont(
|
||||
nn::font::ResFont* pFont,
|
||||
const char* filePath
|
||||
)
|
||||
{
|
||||
// フォントリソースをロードします
|
||||
nn::fs::FileReader fontReader(filePath);
|
||||
|
||||
s32 fileSize = (s32)fontReader.GetSize();
|
||||
if ( fileSize <= 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void* buffer = HeapManager::GetHeap()->Allocate(fileSize, nn::font::GlyphDataAlignment);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 readSize = fontReader.Read(buffer, fileSize);
|
||||
if (readSize != fileSize)
|
||||
{
|
||||
HeapManager::GetHeap()->Free(buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
// フォントリソースをセットします
|
||||
bool bSuccess = pFont->SetResource(buffer);
|
||||
NN_ASSERT(bSuccess);
|
||||
|
||||
//--- 既にリソースをセット済みであるか,ロード済みであるか、リソースが不正な場合に失敗します。
|
||||
if (! bSuccess)
|
||||
{
|
||||
HeapManager::GetHeap()->Free(buffer);
|
||||
}
|
||||
|
||||
// 描画用バッファを設定します。
|
||||
const u32 drawBufferSize = nn::font::ResFont::GetDrawBufferSize(buffer);
|
||||
void* drawBuffer = HeapManager::GetHeap()->Allocate(drawBufferSize, 4);
|
||||
NN_NULL_ASSERT(drawBuffer);
|
||||
pFont->SetDrawBuffer(drawBuffer);
|
||||
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief ResFontを破棄します。
|
||||
//!
|
||||
//! @param[in] pFont 破棄するフォントへのポインタ。
|
||||
//---------------------------------------------------------------------------
|
||||
void
|
||||
CleanupFont(nn::font::ResFont* pFont)
|
||||
{
|
||||
// 描画用バッファの無効化
|
||||
// 描画用バッファがセットされているなら 構築時に SetDrawBuffer に渡したバッファへの
|
||||
// ポインタが返ってきます。
|
||||
void *const drawBuffer = pFont->SetDrawBuffer(NULL);
|
||||
if (drawBuffer != NULL)
|
||||
{
|
||||
HeapManager::GetHeap()->Free(drawBuffer);
|
||||
}
|
||||
|
||||
// フォントがセットされているなら SetResource 時に渡したリソースへの
|
||||
// ポインタが返ってきます。
|
||||
void *const resource = pFont->RemoveResource();
|
||||
if (resource != NULL)
|
||||
{
|
||||
HeapManager::GetHeap()->Free(resource);
|
||||
}
|
||||
|
||||
// RemoveResource 後は再度 SetResource するまでフォントとして使用できません。
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief 表示文字列用バッファを確保します。
|
||||
//!
|
||||
//! @param[in] charMax 表示する文字列の最大文字数。
|
||||
//!
|
||||
//! @return 確保した表示文字列用バッファへのポインタを返します。
|
||||
//---------------------------------------------------------------------------
|
||||
nn::font::DispStringBuffer*
|
||||
AllocDispStringBuffer(s32 charMax)
|
||||
{
|
||||
const u32 DrawBufferSize = nn::font::CharWriter::GetDispStringBufferSize(charMax);
|
||||
void *const bufMem = HeapManager::GetHeap()->Allocate(DrawBufferSize);
|
||||
NN_NULL_ASSERT(bufMem);
|
||||
|
||||
return nn::font::CharWriter::InitDispStringBuffer(bufMem, charMax);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief 文字列表示用にモデルビュー行列と射影行列を設定します。
|
||||
//!
|
||||
//! @param[in] pDrawer RectDrawerオブジェクトへのポインタ。
|
||||
//! @param[in] width 画面の幅。
|
||||
//! @param[in] height 画面の高さ。
|
||||
//---------------------------------------------------------------------------
|
||||
void
|
||||
SetupTextCamera(
|
||||
nn::font::RectDrawer* pDrawer,
|
||||
s32 width,
|
||||
s32 height
|
||||
)
|
||||
{
|
||||
// 射影行列を正射影に設定
|
||||
{
|
||||
// 左上原点とし、Y軸とZ軸の向きが逆になるように設定します。
|
||||
nn::math::MTX44 proj;
|
||||
f32 znear = 0.0f;
|
||||
f32 zfar = -1.0f;
|
||||
f32 t = 0;
|
||||
f32 b = static_cast<f32>(width);
|
||||
f32 l = 0;
|
||||
f32 r = static_cast<f32>(height);
|
||||
nn::math::MTX44OrthoPivot(&proj, l, r, b, t, znear, zfar, nn::math::PIVOT_UPSIDE_TO_TOP);
|
||||
pDrawer->SetProjectionMtx(proj);
|
||||
}
|
||||
|
||||
// モデルビュー行列を単位行列に設定
|
||||
{
|
||||
nn::math::MTX34 mv;
|
||||
nn::math::MTX34Identity(&mv);
|
||||
pDrawer->SetViewMtxForText(mv);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief ASCII文字列を描画します。
|
||||
//!
|
||||
//! @param[in] pDrawer RectDrawerオブジェクトへのポインタ。
|
||||
//! @param[in] pDrawStringBuf DispStringBufferオブジェクトへのポインタ。
|
||||
//! @param[in] pFont フォントへのポインタ。
|
||||
//! @param[in] width 画面の幅。
|
||||
//! @param[in] height 画面の高さ。
|
||||
//---------------------------------------------------------------------------
|
||||
void
|
||||
DrawAscii(
|
||||
nn::font::RectDrawer* pDrawer,
|
||||
nn::font::DispStringBuffer* pDrawStringBuf,
|
||||
nn::font::ResFont* pFont,
|
||||
s32 width,
|
||||
s32 height
|
||||
)
|
||||
{
|
||||
s_TextWriter.SetDispStringBuffer(pDrawStringBuf);
|
||||
s_TextWriter.SetFont(pFont);
|
||||
|
||||
s_TextWriter.SetCursor(0, 0, 1.f);
|
||||
|
||||
s_TextWriter.StartPrint();
|
||||
if(s_DrawTextFunc != NULL)
|
||||
{
|
||||
s_DrawTextFunc();
|
||||
}
|
||||
|
||||
s_TextWriter.EndPrint();
|
||||
pDrawer->BuildTextCommand(&s_TextWriter);
|
||||
|
||||
|
||||
// 文字の色は、文字列の描画コマンドを再作成しなくても変更できます。
|
||||
s_TextWriter.SetTextColor(nn::util::Color8(s_Color, s_Color, s_Color, s_Color));
|
||||
|
||||
pDrawer->DrawBegin();
|
||||
|
||||
SetupTextCamera(pDrawer, width, height);
|
||||
s_TextWriter.UseCommandBuffer();
|
||||
|
||||
pDrawer->DrawEnd();
|
||||
}
|
||||
|
||||
} // namespace <unnnamed>
|
||||
|
||||
void SetDrawTextHandler(void (*func)())
|
||||
{
|
||||
s_DrawTextFunc = func;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//! @brief サンプルのメイン関数です。
|
||||
//---------------------------------------------------------------------------
|
||||
void
|
||||
InitializeResFont()
|
||||
{
|
||||
const size_t ROMFS_BUFFER_SIZE = 1024 * 64;
|
||||
static char buffer[ROMFS_BUFFER_SIZE];
|
||||
NN_UTIL_PANIC_IF_FAILED(
|
||||
nn::fs::MountRom(16, 16, buffer, ROMFS_BUFFER_SIZE));
|
||||
|
||||
// フォントの構築
|
||||
{
|
||||
#ifndef NN_BUILD_RELEASE
|
||||
bool bSuccess =
|
||||
#endif // NN_BUILD_RELEASE
|
||||
InitFont(&s_Font, s_FontFilePath);
|
||||
NN_ASSERTMSG(bSuccess, "Fail to load ResFont.");
|
||||
}
|
||||
|
||||
// 描画リソースの構築
|
||||
s_DrawerBuf = InitShaders(&s_Drawer);
|
||||
|
||||
// 描画文字列用バッファの確保
|
||||
s_pDrawStringBuf0 = AllocDispStringBuffer(512);
|
||||
|
||||
nn::fs::Unmount("rom:");
|
||||
|
||||
}
|
||||
|
||||
void DrawResFont(s32 display)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
if(display == NN_GX_DISPLAY0)
|
||||
{
|
||||
InitDraw(NN_GX_DISPLAY0_WIDTH, NN_GX_DISPLAY0_HEIGHT);
|
||||
|
||||
DrawAscii(&s_Drawer, s_pDrawStringBuf0, &s_Font, NN_GX_DISPLAY0_WIDTH, NN_GX_DISPLAY0_HEIGHT);
|
||||
}
|
||||
else if(display == NN_GX_DISPLAY1)
|
||||
{
|
||||
InitDraw(NN_GX_DISPLAY1_WIDTH, NN_GX_DISPLAY1_HEIGHT);
|
||||
|
||||
DrawAscii(&s_Drawer, s_pDrawStringBuf0, &s_Font, NN_GX_DISPLAY1_WIDTH, NN_GX_DISPLAY1_HEIGHT);
|
||||
}
|
||||
|
||||
nngxUpdateState(NN_GX_STATE_ALL);
|
||||
}
|
||||
|
||||
void FinalizeResFont()
|
||||
{
|
||||
s_Drawer.Finalize();
|
||||
|
||||
// 描画リソースの破棄
|
||||
HeapManager::GetHeap()->Free(s_DrawerBuf);
|
||||
|
||||
// フォントの破棄
|
||||
CleanupFont(&s_Font);
|
||||
|
||||
// 描画文字列用バッファの解放
|
||||
HeapManager::GetHeap()->Free(s_pDrawStringBuf0);
|
||||
}
|
||||
|
||||
nn::font::TextWriter* GetTextWriter()
|
||||
{
|
||||
return &s_TextWriter;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: ResFont.h
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef RESFONT_H_
|
||||
#define RESFONT_H_
|
||||
|
||||
#include <nn/font.h>
|
||||
|
||||
namespace common
|
||||
{
|
||||
|
||||
void InitializeResFont();
|
||||
void DrawResFont(s32 display);
|
||||
void SetDrawTextHandler(void (*func)());
|
||||
nn::font::TextWriter* GetTextWriter();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif /* RESFONT_H_ */
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ф8ф8фШчГГГГГГВ╫В╫8фВ╫В╫В╫В╫В╫ГГГГшчфГШФВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫yнВ╫yнВ╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГШчyнYнВ╫шчшчВ╫В╫фВ╫В╫шчyнШчВ╫yнГГГГyнШФГГГГГшчВ╫В╫В╫В╫YнГyнГВ╫В╫В╫В╫В╫yнфшчГШФГYнyнВ╫В╫В╫yнВ╫╨жВ╫В╫В╫В╫В╫yнВ╫yнВ╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫yнГYнГВ╫В╫В╫В╫В╫фВ╫В╫ГyнГ8фВ╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫
|
||||
@ -1 +0,0 @@
|
||||
В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫8ф8фВ╫В╫В╫╨ж8ф╨жГГшчГГГГГГГГГГГГГГГГГГГГГГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8ф8фВ╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГГШФГГГГГГГГГГ жфГГВ╫В╫ жВ╫ГГГГГ жГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчВ╫шчВ╫В╫В╫В╫В╫ГВ╫ШчВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫╨жВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГГГГГГГГГГГГГГГШФ8фШчшчВ╫В╫ жВ╫YнВ╫В╫В╫В╫В╫ГГYнyнГГyнфВ╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчшчГшчШФВ╫В╫ГГYнГВ╫В╫В╫В╫В╫шчВ╫шчГГГГГГГГГГГГГГГГВ╫В╫YнШч жГГГГГГГГГГГГГГГГГГГГГГГГшч╨жВ╫ жВ╫шчВ╫В╫В╫В╫В╫ШФВ╫ШФВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчВ╫yнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫YнВ╫ жГГГГВ╫шчВ╫шчГГГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫╨жшчВ╫В╫В╫В╫В╫YнфyнГГГГГГГГГ жГГГГ╨жВ╫YнВ╫ШФYнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шч жВ╫В╫В╫В╫В╫В╫yнВ╫ГШФВ╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ШФВ╫ГГГГГВ╫ШчВ╫YнГГШФГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГ жВ╫шчВ╫ГГГшч жВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫
|
||||
@ -1,314 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: main.cpp
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/am/am_ApiLocalImporter.h>
|
||||
#include <nn/am/am_ApiSystemMenu.h>
|
||||
#include <nn/am/am_Result.h>
|
||||
#include <nn/cfg/CTR/cfg_Api.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiInit.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiSys.h>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "demo.h"
|
||||
#include "ResFont.h"
|
||||
#include "HeapManager.h"
|
||||
|
||||
#define UTIL_RETURN_IF_NOT_AM_NOT_FOUND(result) \
|
||||
if(result.IsFailure()) \
|
||||
{ \
|
||||
if(result != nn::am::ResultNotFound()) \
|
||||
{ \
|
||||
return result; \
|
||||
} \
|
||||
nn::dbg::PrintResult(result); \
|
||||
} \
|
||||
|
||||
// リリースする際には↓をコメントアウトしてReleaseビルドすること
|
||||
//#define USE_PROD_CIA
|
||||
|
||||
namespace {
|
||||
|
||||
nn::Result DeleteBoxyard(nn::ProgramId programId);
|
||||
nn::Result DownGradeNupVersion(nn::cfg::CTR::CfgRegionCode region);
|
||||
void FatalDrawing(nn::Result result);
|
||||
|
||||
const size_t ERASE_THREAD_STACK_SIZE = 0x1000;
|
||||
nn::os::Thread s_EraseThread;
|
||||
nn::os::StackBuffer<ERASE_THREAD_STACK_SIZE> s_EraseThreadStack;
|
||||
|
||||
demo::RenderSystemDrawing s_RenderSystem;
|
||||
|
||||
// グラフィックスに割り当てるメモリ
|
||||
const size_t s_GxHeapSize = 0x800000;
|
||||
|
||||
::std::vector<std::string>* s_pOperationMessage;
|
||||
|
||||
// インポートする
|
||||
bit8 s_ReadBuf[64 * 1024];
|
||||
|
||||
const nn::ProgramId BOXYARD_PROGRAM_ID[] =
|
||||
{
|
||||
0x0004001000023000ULL, // JP
|
||||
0x0004001000024000ULL, // US
|
||||
0x0004001000025000ULL // EU
|
||||
};
|
||||
|
||||
const nn::ProgramId NUP_VERSION_PROGRAM_ID[] =
|
||||
{
|
||||
0x000400DB00016202ULL, // JP
|
||||
0x000400DB00016302ULL, // US
|
||||
0x000400DB00016102ULL // EU
|
||||
};
|
||||
|
||||
const wchar_t* ROM_NUP_VERSION_PATH[] =
|
||||
{
|
||||
#ifndef USE_PROD_CIA
|
||||
L"rom:/000400DB00016202-0_0_0-nup.version.JP-UnfixedKey.cia", // JP
|
||||
L"rom:/000400DB00016302-0_0_0-nup.version.US-UnfixedKey.cia", // US
|
||||
L"rom:/000400DB00016102-0_0_0-nup.version.EU-UnfixedKey.cia" // EU
|
||||
#ifdef NN_BUILD_RELEASE
|
||||
#warning !! Using Development Nup Version cia on Release Build !!
|
||||
#endif
|
||||
#else
|
||||
#ifndef NN_BUILD_RELEASE
|
||||
#warning !! Using Product Nup Version cia on Development Build !!
|
||||
#endif
|
||||
|
||||
L"rom:/000400DB00016202-0_0_0-nup.version.JP.master.ols.cia", // JP
|
||||
L"rom:/000400DB00016302-0_0_0-nup.version.US.master.ols.cia", // US
|
||||
L"rom:/000400DB00016102-0_0_0-nup.version.EU.master.ols.cia" // EU
|
||||
#endif
|
||||
};
|
||||
|
||||
void EraseThreadFunc(nn::cfg::CTR::CfgRegionCode region)
|
||||
{
|
||||
nn::Result result;
|
||||
|
||||
s_pOperationMessage->push_back(std::string(""));
|
||||
s_pOperationMessage->push_back(std::string("Deleting..."));
|
||||
// BOXYARDを消去する
|
||||
result = DeleteBoxyard(BOXYARD_PROGRAM_ID[region]);
|
||||
if(result.IsFailure())
|
||||
{
|
||||
nn::dbg::PrintResult(result);
|
||||
s_pOperationMessage->push_back(std::string("Failed Delete Program"));
|
||||
FatalDrawing(result);
|
||||
}
|
||||
s_pOperationMessage->push_back(std::string("Done."));
|
||||
s_pOperationMessage->push_back(std::string(""));
|
||||
|
||||
s_pOperationMessage->push_back(std::string("Updating System..."));
|
||||
// NUPバージョンを更新する
|
||||
result = DownGradeNupVersion(region);
|
||||
if (result.IsFailure())
|
||||
{
|
||||
nn::dbg::PrintResult(result);
|
||||
s_pOperationMessage->push_back(std::string("Failed DownGrade NUP Version"));
|
||||
FatalDrawing(result);
|
||||
}
|
||||
|
||||
|
||||
s_pOperationMessage->push_back(std::string("Done."));
|
||||
s_pOperationMessage->push_back(std::string(""));
|
||||
|
||||
s_pOperationMessage->push_back(std::string("Finished."));
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY0, 0, 1, 0, 0);
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY1, 0, 1, 0, 0);
|
||||
}
|
||||
|
||||
nn::Result DownGradeNupVersion(nn::cfg::CTR::CfgRegionCode region)
|
||||
{
|
||||
nn::Result result = nn::ResultSuccess();
|
||||
|
||||
if(region > sizeof(NUP_VERSION_PROGRAM_ID) / sizeof(NUP_VERSION_PROGRAM_ID[0]) - 1)
|
||||
{
|
||||
return nn::Result(nn::Result::LEVEL_STATUS, nn::Result::SUMMARY_INVALID_ARGUMENT, nn::Result::MODULE_COMMON,
|
||||
nn::Result::DESCRIPTION_INVALID_ENUM_VALUE);
|
||||
}
|
||||
nn::ProgramID programId = NUP_VERSION_PROGRAM_ID[region];
|
||||
|
||||
// リージョンに合わせて削除する
|
||||
result = nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, programId);
|
||||
UTIL_RETURN_IF_NOT_AM_NOT_FOUND(result);
|
||||
|
||||
nn::fs::FileOutputStream* stream;
|
||||
result = nn::am::BeginImportProgram(&stream, nn::fs::MEDIA_TYPE_NAND);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
|
||||
NN_LOG("Importing: %ls...", ROM_NUP_VERSION_PATH[region]);
|
||||
nn::fs::FileInputStream in;
|
||||
|
||||
const size_t ROMFS_BUFFER_SIZE = 1024 * 64;
|
||||
static char buffer[ROMFS_BUFFER_SIZE];
|
||||
NN_UTIL_PANIC_IF_FAILED(
|
||||
nn::fs::MountRom(16, 16, buffer, ROMFS_BUFFER_SIZE));
|
||||
|
||||
result = in.TryInitialize(ROM_NUP_VERSION_PATH[region]);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
|
||||
s64 fileSize = in.GetSize();
|
||||
s32 totalRead = 0;
|
||||
s32 readSize = 0;
|
||||
do
|
||||
{
|
||||
result = in.TryRead(&readSize, s_ReadBuf, sizeof(s_ReadBuf));
|
||||
stream->Write(s_ReadBuf, readSize);
|
||||
totalRead += readSize;
|
||||
} while (totalRead < fileSize);
|
||||
|
||||
in.Finalize();
|
||||
nn::fs::Unmount("rom:");
|
||||
|
||||
result = nn::am::EndImportProgram(stream);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
NN_LOG(" done.\n");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nn::Result DeleteBoxyard(nn::ProgramId programId)
|
||||
{
|
||||
nn::Result result;
|
||||
|
||||
NN_LOG("Deleting Boxyard Program...");
|
||||
// リージョンに合わせて削除する
|
||||
result = nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, programId);
|
||||
UTIL_RETURN_IF_NOT_AM_NOT_FOUND(result);
|
||||
NN_LOG("Done\n");
|
||||
|
||||
NN_LOG("Deleting Boxyard eTicket...");
|
||||
// チケットを削除する
|
||||
result = nn::am::DeleteTicket(programId);
|
||||
UTIL_RETURN_IF_NOT_AM_NOT_FOUND(result);
|
||||
NN_LOG("Done\n");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void SetTextWriterCore()
|
||||
{
|
||||
using namespace common;
|
||||
|
||||
GetTextWriter()->Print("3DMovie Eraser\n\n");
|
||||
::std::vector<std::string>::iterator it;
|
||||
for (it = s_pOperationMessage->begin(); it != s_pOperationMessage->end(); it++)
|
||||
{
|
||||
GetTextWriter()->Printf("%s\n", it->c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FatalDrawing(nn::Result result)
|
||||
{
|
||||
char resultStr[32];
|
||||
std::snprintf(resultStr, sizeof(resultStr), "%X", result.GetPrintableBits());
|
||||
s_pOperationMessage->push_back(resultStr);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY0, 1.f, 0, 0, 0);
|
||||
s_RenderSystem.Clear();
|
||||
|
||||
common::SetDrawTextHandler(SetTextWriterCore);
|
||||
common::DrawResFont(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY1);
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY1, 1.f, 0, 0, 0);
|
||||
s_RenderSystem.Clear();
|
||||
|
||||
s_RenderSystem.SwapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern "C" void nnMain(void)
|
||||
{
|
||||
// os の初期化
|
||||
nn::os::Initialize();
|
||||
|
||||
// fs の初期化
|
||||
nn::fs::Initialize();
|
||||
|
||||
// appletの初期化
|
||||
nn::applet::Enable( false );
|
||||
|
||||
// hid の初期化
|
||||
nn::Result result = nn::hid::Initialize();
|
||||
NN_UTIL_PANIC_IF_FAILED(result);
|
||||
|
||||
// cfg の初期化
|
||||
nn::cfg::CTR::Initialize();
|
||||
|
||||
// リージョンの取得
|
||||
nn::cfg::CTR::CfgRegionCode region;
|
||||
region = nn::cfg::CTR::GetRegion();
|
||||
|
||||
// am の初期化
|
||||
nn::am::InitializeForLocalImporter();
|
||||
|
||||
// ヒープの確保
|
||||
common::HeapManager::GetHeap()->Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR);
|
||||
|
||||
// RenderSystem の準備
|
||||
uptr heapForGx = reinterpret_cast<uptr>(common::HeapManager::GetHeap()->Allocate(s_GxHeapSize));
|
||||
s_RenderSystem.Initialize(heapForGx, s_GxHeapSize);
|
||||
|
||||
// ResFontの初期化
|
||||
common::InitializeResFont();
|
||||
|
||||
std::vector<std::string> operationMessage;
|
||||
s_pOperationMessage = &operationMessage;
|
||||
|
||||
operationMessage.push_back(std::string("Region: ") + std::string(nn::cfg::CTR::GetRegionCodeA3(region)));
|
||||
|
||||
s_EraseThread.Start(EraseThreadFunc, region, s_EraseThreadStack);
|
||||
|
||||
// ボタン入力
|
||||
nn::hid::PadReader padReader;
|
||||
nn::hid::PadStatus padStatus;
|
||||
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY0, 0, 0, 0, 0);
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY1, 0, 0, 0, 0);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
padReader.ReadLatest(&padStatus);
|
||||
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.Clear();
|
||||
|
||||
common::SetDrawTextHandler(SetTextWriterCore);
|
||||
common::DrawResFont(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY1);
|
||||
s_RenderSystem.Clear();
|
||||
s_RenderSystem.SwapBuffers();
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(10));
|
||||
|
||||
if ( nn::applet::IsExpectedToCloseApplication() )
|
||||
{
|
||||
nn::applet::PrepareToCloseApplication();
|
||||
nn::applet::CloseApplication();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,59 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: HeapManager.cpp
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "HeapManager.h"
|
||||
|
||||
nn::fnd::ThreadSafeExpHeap s_AppHeap;
|
||||
|
||||
|
||||
HeapManager::HeapManager(size_t byteSize, s32 alignment, bit8 groupId, nn::fnd::ExpHeapBase::AllocationMode mode, bool reuse)
|
||||
{
|
||||
m_Ptr = s_AppHeap.Allocate(byteSize, alignment, groupId, mode, reuse);
|
||||
}
|
||||
|
||||
HeapManager::~HeapManager()
|
||||
{
|
||||
if(m_Ptr != NULL)
|
||||
{
|
||||
s_AppHeap.Free(m_Ptr);
|
||||
}
|
||||
}
|
||||
void* HeapManager::GetAddr()
|
||||
{
|
||||
return m_Ptr;
|
||||
}
|
||||
|
||||
void InitializeHeap()
|
||||
{
|
||||
s_AppHeap.Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR);
|
||||
}
|
||||
|
||||
size_t GetAllocatableSize(s32 alignment)
|
||||
{
|
||||
return s_AppHeap.GetAllocatableSize(alignment);
|
||||
}
|
||||
|
||||
void* ForceAllocate(size_t byteSize, s32 alignment, bit8 groupId, nn::fnd::ExpHeapBase::AllocationMode mode, bool reuse)
|
||||
{
|
||||
return s_AppHeap.Allocate(byteSize, alignment, groupId, mode, reuse);
|
||||
}
|
||||
|
||||
void ForceFree(void* ptr)
|
||||
{
|
||||
if(ptr != NULL)
|
||||
{
|
||||
s_AppHeap.Free(ptr);
|
||||
}
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: HeapManager.h
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef HEAPMANAGER_H_
|
||||
#define HEAPMANAGER_H_
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/fnd.h>
|
||||
|
||||
class HeapManager
|
||||
{
|
||||
public:
|
||||
explicit HeapManager(size_t byteSize, s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT, bit8 groupId = 0,
|
||||
nn::fnd::ExpHeapBase::AllocationMode mode = nn::fnd::ExpHeapBase::ALLOCATION_MODE_FIRST_FIT, bool reuse = false);
|
||||
virtual ~HeapManager();
|
||||
|
||||
void* GetAddr();
|
||||
|
||||
private:
|
||||
void* m_Ptr;
|
||||
|
||||
};
|
||||
|
||||
void InitializeHeap();
|
||||
size_t GetAllocatableSize(s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT);
|
||||
|
||||
// HeapManagerを使わず確保する場合のみ
|
||||
void* ForceAllocate(size_t byteSize, s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT, bit8 groupId = 0,
|
||||
nn::fnd::ExpHeapBase::AllocationMode mode = nn::fnd::ExpHeapBase::ALLOCATION_MODE_FIRST_FIT, bool reuse = false);
|
||||
|
||||
// HeapManagerを使わず解放する場合のみ
|
||||
void ForceFree(void* ptr);
|
||||
|
||||
#endif /* HEAPMANAGER_H_ */
|
||||
@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev$
|
||||
#----------------------------------------------------------------------------
|
||||
CTR_APPTYPE=CARD
|
||||
|
||||
SUPPORTED_TARGETS = CTR-T*.Process.MPCore.*
|
||||
|
||||
SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include)
|
||||
INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
SOURCES[] =
|
||||
main.cpp
|
||||
scrollBuffer.cpp
|
||||
VersionDetect.cpp
|
||||
HeapManager.cpp
|
||||
|
||||
LIBS += lib_demo \
|
||||
libnn_am \
|
||||
libnn_cup \
|
||||
libnn_ns \
|
||||
|
||||
ROMFS_ROOT = romfiles
|
||||
|
||||
DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/SelfCup.desc
|
||||
|
||||
TARGET_PROGRAM = SelfCupTool
|
||||
|
||||
TITLE = SelfCupTool
|
||||
ROM_SPEC_FILE = SelfCupTool.rsf
|
||||
|
||||
CTR_BANNER_SPEC = $(TARGET_PROGRAM).bsf
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakeroot
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev:$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# ディレクトリレイアウトについての説明
|
||||
#
|
||||
# a) ソースコードがルートディレクトリ直下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# OMakefile と同じディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /foo/bar/objects/...
|
||||
# /foo/bar/images/..
|
||||
#
|
||||
#
|
||||
# b) ソースコードが sources 以下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /sources/foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# ルートディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /objects/foo/bar/...
|
||||
# /images/foo/bar/...
|
||||
#
|
||||
#
|
||||
|
||||
# ルート環境変数の取得
|
||||
public.HORIZON_ROOT =
|
||||
if $(defined-env HORIZON_ROOT)
|
||||
HORIZON_ROOT = $(absname $(getenv HORIZON_ROOT))
|
||||
export
|
||||
|
||||
if $(defined-env CTRSDK_ROOT)
|
||||
CTRSDK_ROOT = $(absname $(getenv CTRSDK_ROOT))
|
||||
if $(and $(defined-env HORIZON_ROOT), $(not $(equal $(HORIZON_ROOT), $(CTRSDK_ROOT))))
|
||||
eprintln(HORIZON_ROOT と CTRSDK_ROOT が一致しません。同じパスを設定するか、どちらか一方だけを定義して下さい。)
|
||||
exit(1)
|
||||
HORIZON_ROOT = $(CTRSDK_ROOT)
|
||||
export
|
||||
|
||||
if $(not $(HORIZON_ROOT))
|
||||
eprintln($"$$CTRSDK_ROOT が定義されていません")
|
||||
exit(1)
|
||||
|
||||
include $(HORIZON_ROOT)/build/omake/commondefs
|
||||
|
||||
DefineCommandVars()
|
||||
|
||||
.PHONY: all build clean clobber
|
||||
.PHONY: run run-scripts run-emumem
|
||||
|
||||
#
|
||||
# OMakefile の読み込み
|
||||
#
|
||||
.SUBDIRS: .
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
ビルド環境
|
||||
・SDK
|
||||
Horizon 2.3 branch r38025 + r38091 SelfCup.desc
|
||||
+ trunk r38944 pl_SharedDataTitleId.h
|
||||
Binary file not shown.
@ -1,26 +0,0 @@
|
||||
BasicInfo:
|
||||
Title: SelfCupTool
|
||||
ProductCode: CTR-P-234A
|
||||
BackupMemoryType: None
|
||||
Logo: Nintendo
|
||||
|
||||
CardInfo:
|
||||
CardDevice: None
|
||||
|
||||
TitleInfo:
|
||||
Use: Evaluation
|
||||
UniqueId: 0xf802a
|
||||
Version: 0
|
||||
|
||||
SystemControlInfo:
|
||||
AppType : Application
|
||||
StackSize : 65536
|
||||
Dependency:
|
||||
- nwm
|
||||
- socket
|
||||
- ssl
|
||||
- friends
|
||||
- ac
|
||||
- cecd
|
||||
- boss
|
||||
- ndm
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: VersionDetect.cpp
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/fs.h>
|
||||
#include <nn/fs/CTR/MPCore/fs_FileSystemBasePrivate.h>
|
||||
|
||||
#include "VersionDetect.h"
|
||||
#include "HeapManager.h"
|
||||
|
||||
void GetNupVersion(nn::pl::CTR::NetworkUpdateVersion* nup, nn::cfg::CTR::CfgRegionCode region)
|
||||
{
|
||||
nn::Result result;
|
||||
const size_t BUF_SIZE = 1024;
|
||||
u8 buf[BUF_SIZE];
|
||||
|
||||
// NUPバージョン
|
||||
{
|
||||
result = nn::fs::MountContent("nver:", nn::fs::MEDIA_TYPE_NAND, cNupVerId[region], 0, 1, 1, buf,
|
||||
BUF_SIZE);
|
||||
|
||||
nn::fs::FileInputStream fis;
|
||||
|
||||
result = fis.TryInitialize(L"nver:/version.bin");
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
s64 fileSize = fis.GetSize();
|
||||
NN_LOG("version.bin size = %lld\n", fileSize);
|
||||
s32 ret;
|
||||
void* addr = NULL;
|
||||
HeapManager heap(fileSize);
|
||||
addr = heap.GetAddr();
|
||||
if (addr != NULL)
|
||||
{
|
||||
result = fis.TryRead(&ret, addr, fileSize);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
nn::pl::CTR::NetworkUpdateVersion* ver_buf =
|
||||
reinterpret_cast<nn::pl::CTR::NetworkUpdateVersion*> (addr);
|
||||
|
||||
std::memcpy(nup, ver_buf, sizeof(nn::pl::CTR::NetworkUpdateVersion));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fis.Finalize();
|
||||
nn::fs::Unmount("nver:");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GetSystemVersion(VerDef* mVerData, nn::cfg::CTR::CfgRegionCode region)
|
||||
{
|
||||
GetNupVersion(&mVerData->nup, region);
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: VersionDetect.h
|
||||
|
||||
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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VERSIONDETECT_H_
|
||||
#define VERSIONDETECT_H_
|
||||
|
||||
#include <nn/cfg/CTR/cfg_RegionCode.h>
|
||||
#include <nn/pl/CTR/pl_SharedDataTitleId.h>
|
||||
#include <nn/pl/CTR/pl_Version.h>
|
||||
|
||||
struct VerDef
|
||||
{
|
||||
nn::pl::CTR::CardUpdateVersion cup;
|
||||
nn::pl::CTR::NetworkUpdateVersion nup;
|
||||
};
|
||||
|
||||
// TODO:リージョン追加時に範囲外アクセスにならないよう注意
|
||||
const nn::ProgramId cCupVerId[] =
|
||||
{
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_JP,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_US,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_EU,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_EU,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_CN,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_KR,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_CUP_VERSION_TW,
|
||||
};
|
||||
|
||||
const nn::ProgramId cNupVerId[] =
|
||||
{
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_JP,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_US,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_EU,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_EU,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_CN,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_KR,
|
||||
nn::pl::CTR::SHAREDDATA_TITLEID_NUP_VERSION_TW,
|
||||
};
|
||||
|
||||
// リージョンコードに基づいてバージョン情報を取得する
|
||||
void GetSystemVersion(VerDef* mVerData, nn::cfg::CTR::CfgRegionCode region);
|
||||
|
||||
#endif /* VERSIONDETECT_H_ */
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ф8ф8фШчГГГГГГВ╫В╫8фВ╫В╫В╫В╫В╫ГГГГшчфГШФВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫yнВ╫yнВ╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГШчyнYнВ╫шчшчВ╫В╫фВ╫В╫шчyнШчВ╫yнГГГГyнШФГГГГГшчВ╫В╫В╫В╫YнГyнГВ╫В╫В╫В╫В╫yнфшчГШФГYнyнВ╫В╫В╫yнВ╫╨жВ╫В╫В╫В╫В╫yнВ╫yнВ╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫yнГYнГВ╫В╫В╫В╫В╫фВ╫В╫ГyнГ8фВ╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫
|
||||
@ -1 +0,0 @@
|
||||
В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫YнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫8ф8фВ╫В╫В╫╨ж8ф╨жГГшчГГГГГГГГГГГГГГГГГГГГГГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8ф8фВ╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГГШФГГГГГГГГГГ жфГГВ╫В╫ жВ╫ГГГГГ жГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчВ╫шчВ╫В╫В╫В╫В╫ГВ╫ШчВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫╨жВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГГГГГГГГГГГГГГГШФ8фШчшчВ╫В╫ жВ╫YнВ╫В╫В╫В╫В╫ГГYнyнГГyнфВ╫В╫В╫В╫В╫В╫В╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчшчГшчШФВ╫В╫ГГYнГВ╫В╫В╫В╫В╫шчВ╫шчГГГГГГГГГГГГГГГГВ╫В╫YнШч жГГГГГГГГГГГГГГГГГГГГГГГГшч╨жВ╫ жВ╫шчВ╫В╫В╫В╫В╫ШФВ╫ШФВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шчВ╫yнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫YнВ╫ жГГГГВ╫шчВ╫шчГГГГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫╨жшчВ╫В╫В╫В╫В╫YнфyнГГГГГГГГГ жГГГГ╨жВ╫YнВ╫ШФYнВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫шч жВ╫В╫В╫В╫В╫В╫yнВ╫ГШФВ╫В╫фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ШФВ╫ГГГГГВ╫ШчВ╫YнГГШФГВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫ГГГГ жВ╫шчВ╫ГГГшч жВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫8фВ╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫В╫
|
||||
@ -1,358 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: main.cpp
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/os.h>
|
||||
#include <nn/dbg.h>
|
||||
#include <nn/CTR.h>
|
||||
#include <nn/ns.h>
|
||||
#include <nn/ns/CTR/ns_ApiShell.h>
|
||||
#include <nn/ns/CTR/ns_Shell.h>
|
||||
#include <nn/fs/fs_FileSystemBase.h>
|
||||
#include <nn/fs/CTR/MPCore/fs_FileSystemBasePrivate.h>
|
||||
#include <nn/applet/CTR/applet_APIForSystem.h>
|
||||
#include <nn/am.h>
|
||||
#include <nn/ndm.h>
|
||||
#include <nn/cfg.h>
|
||||
#include <nn/ptm_Private.h>
|
||||
|
||||
#include <nn/cup.h>
|
||||
|
||||
#include "demo.h"
|
||||
#include "scrollBuffer.h"
|
||||
#include "VersionDetect.h"
|
||||
#include "HeapManager.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
const s32 s_GxHeapSize = 0x800000;
|
||||
uptr s_GxHeap;
|
||||
|
||||
demo::RenderSystemDrawing s_RenderSystem;
|
||||
ScrollBuffer s_scrollBufferInstance;
|
||||
ScrollBuffer *s_scrollBuffer;
|
||||
|
||||
char s_updaterBuffer[1 << 20] NN_ATTRIBUTE_ALIGN(4096);
|
||||
|
||||
// デモの初期化
|
||||
void Initialize()
|
||||
{
|
||||
// NuiShellの初期化 (CUPに必須)
|
||||
NN_UTIL_PANIC_IF_FAILED(nn::ns::CTR::InitializeForShell());
|
||||
|
||||
// ndmの初期化
|
||||
nn::ndm::Initialize();
|
||||
|
||||
// 全デーモンの自律動作をacの自動接続も含めて止める
|
||||
nn::ndm::SuspendScheduler();
|
||||
|
||||
// amの初期化
|
||||
nn::am::InitializeForSystemMenu();
|
||||
|
||||
// fsの初期化 (カード確認用)
|
||||
nn::fs::Initialize();
|
||||
|
||||
// appletの初期化
|
||||
//nn::applet::InitializeForSystem( nn::applet::PHOME_MENU_APPLET_ID, nn::applet::TYPE_SYS );
|
||||
//nn::applet::Initialize( nn::applet::TEST2_APPLET_ID);
|
||||
//nn::applet::SetAppletMode();
|
||||
nn::applet::Enable();
|
||||
|
||||
nn::cfg::Initialize();
|
||||
|
||||
// デバイスメモリの設定
|
||||
const s32 DEVICE_MEMORY_SIZE = 32 * 1024 * 1024;
|
||||
NN_UTIL_PANIC_IF_FAILED(nn::os::SetDeviceMemorySize(DEVICE_MEMORY_SIZE));
|
||||
|
||||
// ヒープの初期化
|
||||
InitializeHeap();
|
||||
|
||||
// 描画インスタンスの初期化
|
||||
s_GxHeap = reinterpret_cast<uptr>(ForceAllocate(s_GxHeapSize));s_RenderSystem
|
||||
.Initialize(s_GxHeap, s_GxHeapSize);
|
||||
|
||||
// 描画インスタンスの初期化
|
||||
s_scrollBufferInstance.Initialize(&s_RenderSystem);
|
||||
s_scrollBuffer = &s_scrollBufferInstance;
|
||||
|
||||
// GPU利用宣言
|
||||
nn::applet::AssignGpuRight();
|
||||
}
|
||||
|
||||
// 消費時間取得用関数群
|
||||
s64 s_StartTick;
|
||||
void SetTick()
|
||||
{
|
||||
s_StartTick = nn::os::Tick::GetSystemCurrent();
|
||||
}
|
||||
s64 GetConsumedMillisec()
|
||||
{
|
||||
s64 endTick = nn::os::Tick::GetSystemCurrent();
|
||||
nn::os::Tick consumed(endTick - s_StartTick);
|
||||
return ((nn::fnd::TimeSpan) consumed).GetMilliSeconds();
|
||||
}
|
||||
|
||||
// 動いていることを知らせるための、くるくる画面表示取得用メソッド
|
||||
const char s_progress[] = "-\\|/";
|
||||
s32 s_progressIndex = 0;
|
||||
char GetProgressChar()
|
||||
{
|
||||
s_progressIndex = (s_progressIndex + 1) % (sizeof(s_progress) - 1);
|
||||
return s_progress[s_progressIndex];
|
||||
}
|
||||
|
||||
nn::Result UpdateCore()
|
||||
{
|
||||
nn::Result result;
|
||||
nn::cup::ProgressInfo info;
|
||||
|
||||
/********************** アップデート*******************/
|
||||
SetTick();
|
||||
s_scrollBuffer->AppendText("Start Card Update")->Render();
|
||||
NN_UTIL_RETURN_IF_FAILED(nn::cup::CTR::DoUpdate());
|
||||
|
||||
// ステータスがStartedになるまで、プログレスは取得できない
|
||||
s_scrollBuffer->AppendText("");
|
||||
do
|
||||
{
|
||||
s_scrollBuffer->ReplaceText(" %c Initializing", GetProgressChar())->Render();
|
||||
result = nn::cup::CTR::GetProgressInfo(&info);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(40));
|
||||
} while (info.state == nn::cup::CTR::UPDATE_STATE_INITIALIZING);
|
||||
|
||||
// 抜けた際のstateがFAILEDかどうか確認
|
||||
if (info.state == nn::cup::CTR::UPDATE_STATE_FAILED)
|
||||
{
|
||||
NN_UTIL_RETURN_IF_FAILED(info.lastResult);
|
||||
}
|
||||
s_scrollBuffer->ReplaceText(" - Initialized (%lldmsec)", GetConsumedMillisec());
|
||||
|
||||
/********************* アップデート中 ******************/
|
||||
SetTick();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
do
|
||||
{
|
||||
result = nn::cup::CTR::GetProgressInfo(&info);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
s_scrollBuffer->ReplaceText(" %c Title %d/%d, size %lld/%lld", GetProgressChar(), info.numImportedTitles,
|
||||
info.numTotalTitles, info.importedSize, info.totalSize)->Render();
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(40));
|
||||
|
||||
} while (info.state == nn::cup::CTR::UPDATE_STATE_STARTED);
|
||||
// 抜けた際のstateがFAILEDかどうか確認
|
||||
if (info.state == nn::cup::CTR::UPDATE_STATE_FAILED)
|
||||
{
|
||||
NN_UTIL_RETURN_IF_FAILED(info.lastResult);
|
||||
}
|
||||
s_scrollBuffer->AppendText(" - Imported (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
|
||||
/***************** アップデート終了中 ******************/
|
||||
SetTick();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
do
|
||||
{
|
||||
result = nn::cup::CTR::GetProgressInfo(&info);
|
||||
NN_UTIL_RETURN_IF_FAILED(result);
|
||||
s_scrollBuffer->ReplaceText(" %c Update Finalizing", GetProgressChar())->Render();
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(40));
|
||||
} while (info.state == nn::cup::CTR::UPDATE_STATE_FINALIZING);
|
||||
// 抜けた際のstateがFAILEDかどうか確認
|
||||
if (info.state == nn::cup::CTR::UPDATE_STATE_FAILED)
|
||||
{
|
||||
NN_UTIL_RETURN_IF_FAILED(info.lastResult);
|
||||
}
|
||||
|
||||
/******************* アップデート終了 *******************/
|
||||
s_scrollBuffer->AppendText(" - Finalized (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("");
|
||||
|
||||
return nn::ResultSuccess();
|
||||
}
|
||||
|
||||
nn::Result UpdateSequence(bool *isHandledError)
|
||||
{
|
||||
nn::Result result;
|
||||
nn::Result lastResult = nn::ResultSuccess();
|
||||
|
||||
/********************* CUPの初期化 *******************/
|
||||
s_scrollBuffer->AppendText("Initializing Cup Library")->Render();
|
||||
SetTick(); // 初期化開始前の時間をセット
|
||||
result = nn::cup::CTR::Initialize(s_updaterBuffer, sizeof(s_updaterBuffer));
|
||||
if (result == nn::cup::CTR::ResultUpdatePartitionNotFound())
|
||||
{
|
||||
s_scrollBuffer->AppendText(" - Update Partition Not Found (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
*isHandledError = true;
|
||||
return result;
|
||||
}
|
||||
if (result == nn::cup::CTR::ResultUpdateNotRequired())
|
||||
{
|
||||
s_scrollBuffer->AppendText(" - Already Updated (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
*isHandledError = true;
|
||||
return result;
|
||||
}
|
||||
if (result == nn::cup::CTR::ResultInvalidUpdatePartitionFormat())
|
||||
{
|
||||
s_scrollBuffer->AppendText(" - Invalid Update Partition (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
*isHandledError = true;
|
||||
return result;
|
||||
}NN_UTIL_RETURN_IF_FAILED(result);
|
||||
|
||||
s_scrollBuffer->AppendText(" - Need Update (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
|
||||
lastResult = UpdateCore();
|
||||
|
||||
// Initializeに成功した場合のみ、再びInitializeするためにFinalizeが必要
|
||||
SetTick();
|
||||
s_scrollBuffer->AppendText("Finalizing Cup Library")->Render();
|
||||
NN_UTIL_RETURN_IF_FAILED(nn::cup::CTR::Finalize());
|
||||
s_scrollBuffer->AppendText(" - Complete (%lldmsec)", GetConsumedMillisec())->Render();
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
|
||||
return lastResult;
|
||||
}
|
||||
}
|
||||
|
||||
nn::Result ExecuteCup(ScrollBuffer* scrollBuf)
|
||||
{
|
||||
nn::Result result;
|
||||
bool isHandledError = false;
|
||||
result = UpdateSequence(&isHandledError);
|
||||
if (isHandledError == false && result.IsFailure())
|
||||
{
|
||||
{
|
||||
// それ以外の場合は、Resultを表示
|
||||
scrollBuf->AppendText(" - Unhandled Error: 0x%08x", result.GetPrintableBits());
|
||||
scrollBuf->AppendText("")->Render();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" void nnMain()
|
||||
{
|
||||
NN_LOG("Start cup demo\n");
|
||||
nn::Result result;
|
||||
Initialize();
|
||||
|
||||
nn::ProgramId MMEN_PROGRAM_ID = 0x0004003000008202;
|
||||
|
||||
nn::cfg::CfgRegionCode region = nn::cfg::GetRegion();
|
||||
switch (region)
|
||||
{
|
||||
case nn::cfg::CFG_REGION_AMERICA:
|
||||
{
|
||||
MMEN_PROGRAM_ID = 0x0004003000008f02;
|
||||
}
|
||||
break;
|
||||
|
||||
case nn::cfg::CFG_REGION_EUROPE:
|
||||
case nn::cfg::CFG_REGION_AUSTRALIA:
|
||||
{
|
||||
MMEN_PROGRAM_ID = 0x0004003000009802;
|
||||
}
|
||||
break;
|
||||
|
||||
case nn::cfg::CFG_REGION_JAPAN:
|
||||
{
|
||||
MMEN_PROGRAM_ID = 0x0004003000008202;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
nn::am::ProgramInfo outInfos;
|
||||
result = nn::am::GetProgramInfos(&outInfos, nn::fs::MEDIA_TYPE_NAND, &MMEN_PROGRAM_ID, 1);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
result = ExecuteCup(s_scrollBuffer);
|
||||
// CUP不要だがNUPバージョンのほうが新しかったら強制的に実行
|
||||
if (result == nn::cup::CTR::ResultUpdateNotRequired())
|
||||
{
|
||||
// バージョンの取得
|
||||
VerDef versionData;
|
||||
GetSystemVersion(&versionData, region);
|
||||
|
||||
const size_t ROMFS_BUFFER_SIZE = 1024 * 32;
|
||||
u8 buffer[ROMFS_BUFFER_SIZE];
|
||||
result = nn::fs::MountRom(16, 16, buffer, ROMFS_BUFFER_SIZE);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
nn::fs::FileReader fileReader;
|
||||
result = fileReader.TryInitialize("rom:/nup_version.bin");
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
u8 buf[1024];
|
||||
s32 readSize;
|
||||
result = fileReader.TryRead(&readSize, buf, sizeof(buf));
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
if (versionData.nup.majorVersion < *reinterpret_cast<u8*>(buf))
|
||||
{
|
||||
// CUPバージョンを削除
|
||||
result = nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, cCupVerId[region]);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
result = ExecuteCup(s_scrollBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (result == nn::am::ResultNotFound())
|
||||
{
|
||||
s_scrollBuffer->AppendText("Cannot find Home Menu");
|
||||
}
|
||||
|
||||
s_scrollBuffer->AppendText("")->Render();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||
if (result.IsSuccess() || result == nn::cup::CTR::ResultUpdateNotRequired())
|
||||
{
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY0, 0, 1, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY0, 1, 0, 0, 1);
|
||||
}
|
||||
s_RenderSystem.Clear();
|
||||
s_RenderSystem.SwapBuffers();
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY1);
|
||||
if (result.IsSuccess() || result == nn::cup::CTR::ResultUpdateNotRequired())
|
||||
{
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY1, 0, 1, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_RenderSystem.SetClearColor(NN_GX_DISPLAY1, 1, 0, 0, 1);
|
||||
}
|
||||
s_scrollBuffer->ReplaceText("%c Finished", GetProgressChar())->Render();
|
||||
|
||||
if (nn::applet::IsExpectedToCloseApplication())
|
||||
{
|
||||
nn::applet::PrepareToCloseApplication();
|
||||
nn::applet::CloseApplication();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: scrollBuffer.cpp
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <cstdio>
|
||||
#include "scrollBuffer.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
char ScrollBuffer::s_buffers[MAX_BUFFER_LINE][MAX_BUFFER_CHARS];
|
||||
|
||||
char *ScrollBuffer::GetFormattedString(const char *fmt, va_list arg)
|
||||
{
|
||||
static char formattedBuffer[MAX_BUFFER_CHARS];
|
||||
vsnprintf(formattedBuffer, MAX_BUFFER_CHARS, fmt, arg);
|
||||
return formattedBuffer;
|
||||
}
|
||||
|
||||
ScrollBuffer *ScrollBuffer::Update()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
ScrollBuffer *ScrollBuffer::AppendText(const char *fmt, ...)
|
||||
{
|
||||
va_list vlist;
|
||||
va_start(vlist, fmt);
|
||||
|
||||
int nextPosition=(m_tail+1)%MAX_BUFFER_LINE;
|
||||
if(nextPosition==m_head){
|
||||
// ヘッドとビューの移動
|
||||
if(m_head==m_currentView){
|
||||
m_currentView=(m_head+1)%MAX_BUFFER_LINE;
|
||||
}
|
||||
m_head=(m_head+1)%MAX_BUFFER_LINE;
|
||||
|
||||
}
|
||||
strlcpy(s_buffers[m_tail], GetFormattedString(fmt, vlist), MAX_BUFFER_CHARS);
|
||||
m_tail=nextPosition;
|
||||
NN_LOG("cup: %s\n", GetFormattedString(fmt, vlist));
|
||||
|
||||
// ビューの移動
|
||||
if((m_currentView+MAX_DISPLAY_LINES)%MAX_BUFFER_LINE==m_tail){
|
||||
m_currentView=(m_currentView+1)%MAX_BUFFER_LINE;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
ScrollBuffer *ScrollBuffer::ReplaceText(const char *fmt, ...)
|
||||
{
|
||||
va_list vlist;
|
||||
va_start(vlist, fmt);
|
||||
|
||||
NN_ASSERT(m_tail!=m_head);
|
||||
strlcpy(s_buffers[(m_tail-1)%MAX_BUFFER_LINE], GetFormattedString(fmt, vlist), MAX_BUFFER_CHARS);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
void ScrollBuffer::Render()
|
||||
{
|
||||
// 描画前処理
|
||||
m_render->SetRenderTarget(NN_GX_DISPLAY1);
|
||||
m_render->Clear();
|
||||
m_render->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
// リングバッファなので、終端条件を調整
|
||||
int tail=(m_tail<m_head) ? m_tail+ScrollBuffer::MAX_BUFFER_LINE : m_tail;
|
||||
|
||||
for(int i=m_currentView; i<tail; i++){
|
||||
if(i<m_currentView+MAX_DISPLAY_LINES-1){
|
||||
m_render->DrawText(0, (i-m_currentView)*FONT_SIZE, s_buffers[i%MAX_BUFFER_LINE]);
|
||||
}
|
||||
}
|
||||
|
||||
// 描画転送
|
||||
m_render->SwapBuffers();
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: scrollBuffer.h
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SCROLL_BUFFER_H_
|
||||
#define SCROLL_BUFFER_H_
|
||||
|
||||
#include "demo.h"
|
||||
class ScrollBuffer
|
||||
{
|
||||
private:
|
||||
enum
|
||||
{
|
||||
MAX_BUFFER_LINE=128,
|
||||
MAX_BUFFER_CHARS=80,
|
||||
MAX_DISPLAY_LINES=20,
|
||||
FONT_SIZE=12
|
||||
};
|
||||
// 表示文字のバッファ (リングバッファ)
|
||||
static char s_buffers[MAX_BUFFER_LINE][MAX_BUFFER_CHARS];
|
||||
int m_head;
|
||||
int m_tail;
|
||||
int m_currentView;
|
||||
|
||||
demo::RenderSystemDrawing *m_render;
|
||||
|
||||
char *GetFormattedString(const char *fmt, va_list arg);
|
||||
|
||||
public:
|
||||
ScrollBuffer() :
|
||||
m_head(0), m_tail(0), m_currentView(0)
|
||||
{}
|
||||
void Initialize(demo::RenderSystemDrawing *render)
|
||||
{
|
||||
m_render=render;
|
||||
}
|
||||
|
||||
ScrollBuffer *Update(); // キー入力を参照して、スクロールする
|
||||
ScrollBuffer *AppendText(const char *fmt, ...); // 文字列を追加する
|
||||
ScrollBuffer *ReplaceText(const char *fmt, ...); // 最新の文字列を置換する
|
||||
void Render(); // レンダリング
|
||||
};
|
||||
|
||||
#endif // SCROLL_BUFFER_H
|
||||
@ -1,18 +0,0 @@
|
||||
BasicInfo:
|
||||
Title : $(TITLE)
|
||||
BackupMemoryType: None
|
||||
Logo : Nintendo
|
||||
# Companycode: "00"
|
||||
ProductCode : "CTR-P-22MA"
|
||||
# MediaSize: 2GB
|
||||
|
||||
AccessControlInfo:
|
||||
FileSystemAccess:
|
||||
- Debug
|
||||
|
||||
Rom:
|
||||
HostRoot : $(ROMFS_ROOT)
|
||||
|
||||
TitleInfo:
|
||||
UniqueId: 0xf8015
|
||||
Version: 0
|
||||
@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 31765 $
|
||||
#----------------------------------------------------------------------------
|
||||
SUPPORTED_TARGETS = CTR-*.Process.MPCore.*
|
||||
|
||||
#demoライブラリ位置指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../CTR_SDK/sampledemos/common/include)
|
||||
#INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
|
||||
SOURCES[] =
|
||||
./source/main.cpp
|
||||
../../common/test_data.cpp
|
||||
../../common/shfnt.cpp
|
||||
../../common/sleep.cpp
|
||||
../../common/common.cpp
|
||||
|
||||
OBJECTS[] =
|
||||
$`(ObjectFromBinary $(TARGET), ./Imp_list/key/Public_Key.der)
|
||||
|
||||
TARGET_PROGRAM = CtrSaveDataMover_imp
|
||||
|
||||
TITLE = CSM_imp
|
||||
|
||||
LIBS += libnn_ps
|
||||
|
||||
IMPORTEE_CIA = importee.cia
|
||||
|
||||
SRC_IMPORTEE_PATH = ../body/images/$(BUILD_TARGET_DIR)/$(BUILD_TYPE_DIR)/CtrSaveDataMover.cia
|
||||
#とりあえず、マスタリング時は直おき、配置時に改名
|
||||
#SRC_IMPORTEE_PATH = CtrSaveDataMover_master.cia
|
||||
|
||||
# ビルドタイプ別に romfs を作る
|
||||
#ROMFS_ROOT = $`(TARGET.getObjectDirectory)/romfsroot
|
||||
ROMFS_ROOT = ./romfiles
|
||||
DEST_IMPORTEE_PATH = $(ROMFS_ROOT)/$(IMPORTEE_CIA)
|
||||
foreach(TARGET, $(BUILDER.getTargets $(SUPPORTED_TARGETS)))
|
||||
$(DEST_IMPORTEE_PATH): $(SRC_IMPORTEE_PATH) $(makeDirectory $(ROMFS_ROOT))
|
||||
cp $< $@
|
||||
ROMFS_DEPENDENCIES = $(DEST_IMPORTEE_PATH)
|
||||
|
||||
# プログラムから参照するためのROMFSのパスとプログラムIDを定義する
|
||||
ROMFS_IMPORTEE_PATH = L\"rom:/$(IMPORTEE_CIA)\"
|
||||
CCFLAGS += -DROMFS_IMPORTEE_PATH=$(ROMFS_IMPORTEE_PATH)
|
||||
|
||||
ROM_SPEC_FILE = Imp.rsf
|
||||
DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/repairtool.desc
|
||||
|
||||
# バナー、アイコン
|
||||
#CTR_BANNER_SPEC = banner.bsf
|
||||
CTR_BANNER_SPEC = banner_null_icon.bsf
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
|
||||
Binary file not shown.
@ -1,274 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<NintendoWareIntermediateFile>
|
||||
<GraphicsContentCtr Version="1.3.0" Namespace="">
|
||||
<EditData>
|
||||
<MetaData>
|
||||
<Key>MetaData</Key>
|
||||
<Create Author="" Date="2010-12-02T15:21:10" Source="COMMON.mb">
|
||||
<ToolDescriptions Name="NW4C_Export for Maya 2009 Service Pack 1" Version="1.2.0" />
|
||||
</Create>
|
||||
<Modify Date="2011-02-28T13:27:46">
|
||||
<ToolDescriptions Name="NintendoWare Creative Studio For Banner." Version="1.3.0.30235" />
|
||||
</Modify>
|
||||
</MetaData>
|
||||
<ContentSummaryMetaData>
|
||||
<Key>ContentSummaries</Key>
|
||||
<Values>
|
||||
<ContentSummary ContentTypeName="GraphicsContent">
|
||||
<ObjectSummaries>
|
||||
<ObjectSummary TypeName="SkeletalModel" Name="">
|
||||
<Notes>
|
||||
<Note Name="MaterialCount" Value="1" />
|
||||
<Note Name="ShapeCount" Value="1" />
|
||||
<Note Name="MeshCount" Value="1" />
|
||||
<Note Name="BoneCount" Value="1" />
|
||||
<Note Name="TotalPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalNoneSkinningPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalRigidSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalSmoothSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalIndexStreamCount" Value="1" />
|
||||
<Note Name="TotalPolygonCount" Value="2" />
|
||||
<Note Name="TotalVertexCount" Value="4" />
|
||||
</Notes>
|
||||
</ObjectSummary>
|
||||
</ObjectSummaries>
|
||||
</ContentSummary>
|
||||
</Values>
|
||||
</ContentSummaryMetaData>
|
||||
</EditData>
|
||||
<Models>
|
||||
<SkeletalModel Name="" IsBranchVisible="true" IsVisible="true" CullingMode="Dynamic" IsNonuniformScalable="false" LayerId="0" NeededBoneCapacity="20">
|
||||
<EditData>
|
||||
<ModelDccToolExportOption ExportStartFrame="0" Magnify="1" AdjustSkinning="None" MeshVisibilityMode="BindByIndex">
|
||||
<Key>ModelDccToolInfo</Key>
|
||||
</ModelDccToolExportOption>
|
||||
<OptimizationLogArrayMetaData Size="1">
|
||||
<Key>OptimizationLogs</Key>
|
||||
<Values>
|
||||
<OptimizationLog Date="2010-12-02T15:21" EditorVersion="1.2.0.27817">
|
||||
<Options NodeCompressionMode="None" IsMergeMeshOwnerBoneEnabled="false" IsCombineMeshEnabled="false" IsCompressMaterialEnabled="false" IsOptimizePlygonPrimitiveEnabled="false" IsConvertOneBoneSkeletalModelToModel="true" IsDeleteUnusedVertexEnabled="false" PositionQuantizeMode="Float" NormalQuantizeMode="Float" TextureQuantizeMode="Float" GroupByIndexStream="false" />
|
||||
</OptimizationLog>
|
||||
</Values>
|
||||
</OptimizationLogArrayMetaData>
|
||||
</EditData>
|
||||
<AnimationGroupDescriptions>
|
||||
<GraphicsAnimationGroupDescription Name="SkeletalAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="CalculatedTransform" IsBinarized="true">
|
||||
<Path>Skeleton.Bones["*"].AnimatedTransform</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="VisibilityAnimation" EvaluationTiming="BeforeWorldUpdate">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>Meshes["*"].IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsBranchVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="MaterialAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Emission</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Ambient</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Diffuse</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant2</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant3</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant4</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant5</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Sampler.BorderColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Int" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Texture</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].FragmentOperation.BlendOperation.BlendColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Scale</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Float" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Rotate</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Translate</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
</AnimationGroupDescriptions>
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
<Shapes>
|
||||
<SeparateDataShapeCtr>
|
||||
<OrientedBoundingBox>
|
||||
<CenterPosition X="0" Y="0" Z="6.5" />
|
||||
<OrientationMatrix M00="1" M01="0" M02="0" M10="0" M11="1" M12="0" M20="0" M21="0" M22="1" />
|
||||
<Size X="24" Y="12" Z="0" />
|
||||
</OrientedBoundingBox>
|
||||
<PositionOffset X="0" Y="0" Z="0" />
|
||||
<PrimitiveSets>
|
||||
<PrimitiveSetCtr SkinningMode="None">
|
||||
<BoneIndexTable>0</BoneIndexTable>
|
||||
<Primitives>
|
||||
<PrimitiveCtr>
|
||||
<IndexStreams>
|
||||
<UbyteIndexStreamCtr PrimitiveMode="Triangles" Size="6">0 1 2 1 3 2</UbyteIndexStreamCtr>
|
||||
</IndexStreams>
|
||||
</PrimitiveCtr>
|
||||
</Primitives>
|
||||
</PrimitiveSetCtr>
|
||||
</PrimitiveSets>
|
||||
<VertexAttributes>
|
||||
<Vector3VertexStreamCtr Usage="Position" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
-12 -6 6.5
|
||||
12 -6 6.5
|
||||
-12 6 6.5
|
||||
12 6 6.5
|
||||
</Vector3VertexStreamCtr>
|
||||
<Vector3VertexAttributeCtr Usage="Normal">0 0 1</Vector3VertexAttributeCtr>
|
||||
<Vector2VertexStreamCtr Usage="TextureCoordinate0" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
0 0
|
||||
1 0
|
||||
0 1
|
||||
1 1
|
||||
</Vector2VertexStreamCtr>
|
||||
</VertexAttributes>
|
||||
</SeparateDataShapeCtr>
|
||||
</Shapes>
|
||||
<Materials>
|
||||
<MaterialCtr Name="MT_00" IsCompressible="true" LightSetIndex="0" FogIndex="0" IsFragmentLightEnabled="false" IsVertexLightEnabled="false" IsHemiSphereLightEnabled="false" IsHemiSphereOcclusionEnabled="false" IsFogEnabled="false" TextureCoordinateConfig="Config0120" TranslucencyKind="Layer1" ShaderProgramDescriptionIndex="-1" ShaderBinaryKind="Default">
|
||||
<ShaderReference />
|
||||
<MaterialColor VertexColorScale="1">
|
||||
<Emission R="0" G="0" B="0" A="0" />
|
||||
<Ambient R="1" G="1" B="1" A="0" />
|
||||
<Diffuse R="1" G="1" B="1" A="1" />
|
||||
<Specular0 R="1" G="1" B="1" A="0" />
|
||||
<Specular1 R="0" G="0" B="0" A="0" />
|
||||
<Constant0 R="0" G="0" B="0" A="1" />
|
||||
<Constant1 R="0" G="0" B="0" A="1" />
|
||||
<Constant2 R="0" G="0" B="0" A="1" />
|
||||
<Constant3 R="0" G="0" B="0" A="1" />
|
||||
<Constant4 R="0" G="0" B="0" A="1" />
|
||||
<Constant5 R="0" G="0" B="0" A="1" />
|
||||
</MaterialColor>
|
||||
<Rasterization CullingMode="BackFace" IsPolygonOffsetEnabled="false" PolygonOffsetUnit="0" />
|
||||
<TextureCoordinators>
|
||||
<TextureCoordinatorCtr SourceCoordinate="0" MappingMethod="UvCoordinateMap" ReferenceCamera="0" MatrixMode="DccMaya" ScaleS="1" ScaleT="1" Rotate="0" TranslateS="0" TranslateT="0" />
|
||||
</TextureCoordinators>
|
||||
<TextureMappers>
|
||||
<PixelBasedTextureMapperCtr>
|
||||
<TextureReference>Textures["banner_imp"]@file:Textures/banner_imp.ctex</TextureReference>
|
||||
<StandardTextureSamplerCtr MinFilter="Linear" MagFilter="Linear" WrapS="ClampToEdge" WrapT="ClampToEdge" MinLod="0" LodBias="0">
|
||||
<BorderColor R="0" G="0" B="0" A="1" />
|
||||
</StandardTextureSamplerCtr>
|
||||
</PixelBasedTextureMapperCtr>
|
||||
</TextureMappers>
|
||||
<FragmentShader LayerConfig="ConfigurationType0">
|
||||
<BufferColor R="0" G="0" B="0" A="1" />
|
||||
<FragmentBump BumpTextureIndex="Texture0" BumpMode="NotUsed" IsBumpRenormalize="false" />
|
||||
<FragmentLighting FresnelConfig="No" IsClampHighLight="false" IsDistribution0Enabled="false" IsDistribution1Enabled="false" IsGeometricFactor0Enabled="false" IsGeometricFactor1Enabled="false" IsReflectionEnabled="false" />
|
||||
<FragmentLightingTable>
|
||||
<ReflectanceRSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceRSampler>
|
||||
<ReflectanceGSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceGSampler>
|
||||
<ReflectanceBSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceBSampler>
|
||||
<Distribution0Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution0Sampler>
|
||||
<Distribution1Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution1Sampler>
|
||||
<FresnelSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</FresnelSampler>
|
||||
</FragmentLightingTable>
|
||||
<TextureCombiners>
|
||||
<TextureCombinerCtr CombineRgb="Replace" CombineAlpha="Replace" ScaleRgb="One" ScaleAlpha="One" Constant="Constant0" BufferInputRgb="PreviousBuffer" BufferInputAlpha="PreviousBuffer">
|
||||
<SourceRgb Source0="Texture0" Source1="FragmentPrimaryColor" Source2="FragmentSecondaryColor" />
|
||||
<OperandRgb Operand0="Color" Operand1="Color" Operand2="Color" />
|
||||
<SourceAlpha Source0="Texture0" Source1="Constant" Source2="Constant" />
|
||||
<OperandAlpha Operand0="Alpha" Operand1="Alpha" Operand2="Alpha" />
|
||||
</TextureCombinerCtr>
|
||||
</TextureCombiners>
|
||||
<AlphaTest IsTestEnabled="false" TestFunction="Always" TestReference="0" />
|
||||
</FragmentShader>
|
||||
<FragmentOperation>
|
||||
<DepthOperation IsTestEnabled="true" TestFunction="Less" IsMaskEnabled="false" />
|
||||
<BlendOperation Mode="Blend" LogicOperation="Copy">
|
||||
<RgbParameter BlendFunctionSource="SourceAlpha" BlendFunctionDestination="OneMinusSourceAlpha" BlendEquation="FuncAdd" />
|
||||
<AlphaParameter BlendFunctionSource="One" BlendFunctionDestination="Zero" BlendEquation="FuncAdd" />
|
||||
<BlendColor R="0" G="0" B="0" A="1" />
|
||||
</BlendOperation>
|
||||
<StencilOperation IsTestEnabled="false" TestFunction="Never" TestReference="0" TestMask="255" FailOperation="Keep" ZFailOperation="Keep" PassOperation="Keep" />
|
||||
</FragmentOperation>
|
||||
</MaterialCtr>
|
||||
</Materials>
|
||||
<Meshes>
|
||||
<Mesh IsVisible="true" RenderPriority="0" MeshNodeName="BONE_00">
|
||||
<EditData>
|
||||
<DccToolSourceNodeMetaData>
|
||||
<Key>DccToolSourceNode</Key>
|
||||
<Values>
|
||||
<NodeName>BONE_00</NodeName>
|
||||
</Values>
|
||||
</DccToolSourceNodeMetaData>
|
||||
</EditData>
|
||||
<SeparateShapeReference>Shapes[0]</SeparateShapeReference>
|
||||
<MaterialReference>Materials["MT_00"]</MaterialReference>
|
||||
</Mesh>
|
||||
</Meshes>
|
||||
<Skeleton RootBoneName="BONE_00" ScalingRule="Standard" IsTranslateAnimationEnabled="true">
|
||||
<Bones>
|
||||
<Bone Name="BONE_00" ParentBoneName="" IsSegmentScaleCompensate="false" IsCompressible="true" IsNeededRendering="true" HasSkinningMatrix="false" BillboardMode="YAxial">
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
</Bone>
|
||||
</Bones>
|
||||
</Skeleton>
|
||||
</SkeletalModel>
|
||||
</Models>
|
||||
</GraphicsContentCtr>
|
||||
</NintendoWareIntermediateFile>
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
#
|
||||
EJF10000237
|
||||
EJF10000308
|
||||
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
openssl genrsa -out private_key.pem 2048
|
||||
openssl enc -d -base64 -in private_key.pem -out private_key.der
|
||||
openssl rsa -pubout -inform DER -outform DER -in private_key.der -out public_key.der
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
rem ver1.0.0—p
|
||||
openssl genpkey -out private_key.der -outform DER -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537
|
||||
openssl rsa -pubout -inform DER -outform DER -in private_key.der -out public_key.der
|
||||
@ -1,7 +0,0 @@
|
||||
@echo off
|
||||
if "%1"=="" goto 1
|
||||
openssl dgst -sha256 -binary -keyform DER -sign ../key/private_key.der -out csm_sign.dat %1
|
||||
goto end
|
||||
:1
|
||||
openssl dgst -sha256 -binary -keyform DER -sign ../key/private_key.der -out csm_sign.dat csm_list.txt
|
||||
:end
|
||||
@ -1,5 +0,0 @@
|
||||
秘密鍵の扱いは注意
|
||||
署名作成する必要の無い所には出さない
|
||||
|
||||
署名作成時は、配布先で使用するバージョンに入っている
|
||||
鍵とペアの秘密鍵を使うこと
|
||||
@ -1,45 +0,0 @@
|
||||
|
||||
本体印刷のシリアル最後尾の四角い枠に入った数字は
|
||||
digitというものらしい
|
||||
リスト作成時に入力違いをチェックするのに使えそう
|
||||
コマンドラインでファイル指定する簡単なチェッカーとか
|
||||
|
||||
|
||||
以下、長谷川さんメール抜粋
|
||||
----------------
|
||||
チェックデジットの計算方法は一般的なものらしく、
|
||||
"モジュラス10 ウェイト3・1(M10W31)"というものらしいです。
|
||||
|
||||
|
||||
// NULL終端されたシリアルナンバーを受け取る
|
||||
// NULL文字の場所にチェックデジットを付加して新たにNULL終端する
|
||||
void AddCheckDigit(char* serial)
|
||||
{
|
||||
size_t len = std::strlen(serial);
|
||||
|
||||
u8 digit = 0;
|
||||
bool odd = true;
|
||||
for(u8 i = len - 1; i > 0 && std::isdigit(serial[i]); i--)
|
||||
{
|
||||
if(odd)
|
||||
{
|
||||
digit += (serial[i] - '0') * 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
digit += (serial[i] - '0');
|
||||
}
|
||||
odd = !odd;
|
||||
}
|
||||
|
||||
if(digit % 10 != 0)
|
||||
{
|
||||
serial[len] = 10 - (digit % 10) + '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
serial[len] = '0';
|
||||
}
|
||||
|
||||
serial[len + 1] = '\0';
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
|
||||
目的:許可した本体のみインポート
|
||||
|
||||
公開鍵はROMから読み込む
|
||||
|
||||
SC) ツール用本体のシリアルをメールなどでREDへ連絡
|
||||
RED) リスト(csm_list)と署名(csm_sign)を作成し送る
|
||||
|
||||
|
||||
インポート手順
|
||||
・ リスト、署名を書き込んだSDをCTRに差す
|
||||
・ インポート用アプリをカード起動
|
||||
・ 有効な本体ならインポートメニューが表示される
|
||||
|
||||
|
||||
署名はOpeneelで作成
|
||||
特に手を加えずSDルートに置く
|
||||
|
||||
リストの書き方
|
||||
インポート許可シリアルをテキストで羅列
|
||||
---
|
||||
aaaaaaaa
|
||||
bbbbbbbb
|
||||
----
|
||||
本体裏シリアル終端のdigit(四角い枠の数字)は省く
|
||||
digit確認したい場合はリスト作成時にやっとく
|
||||
ファイルサイズは64Kまで(シリアルのみ記載で、およそ4000台)
|
||||
Binary file not shown.
Binary file not shown.
@ -1,490 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: main.cpp
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/fs.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiSys.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiInit.h>
|
||||
#include <nn/am/am_ApiLocalImporter.h>
|
||||
#include <nn/am/am_ApiSystemMenu.h>
|
||||
#include <nn/applet.h>
|
||||
#include <nn/ndm.h>
|
||||
#include <nn/ndm/ndm_DebugControl.h>
|
||||
#include <nn/crypto/crypto_RsaKey.h>
|
||||
#include <nn/ps/ctr/ps_Api.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "demo.h"
|
||||
#include "../../body/ver.h"
|
||||
#include "../../../common/sleep.h"
|
||||
#include "../../../common/common.h"
|
||||
#include "../../../common/shfnt.h"
|
||||
#include "../../../common/test_data.h"
|
||||
|
||||
#define INF_FILE "sdmc:/csm_inf.txt"
|
||||
|
||||
#define KEY_LENGTH 2048
|
||||
#define LIST_FILE "sdmc:/csm_list.txt"
|
||||
#define SIGN_FILE "sdmc:/csm_sign.dat"
|
||||
|
||||
|
||||
extern "C" {
|
||||
extern u8* PUBLIC_KEY_BEGIN[];
|
||||
extern u8* PUBLIC_KEY_END[];
|
||||
|
||||
const void* PUBLIC_KEY = PUBLIC_KEY_BEGIN;
|
||||
}
|
||||
|
||||
demo::RenderSystemDrawing s_RenderSystem;
|
||||
nn::fnd::ExpHeap appHeap;
|
||||
uptr heapForGx;
|
||||
void ErrorStop(char *s);
|
||||
void ErrorPOff(char *s);
|
||||
|
||||
const size_t ROMFS_BUFFER_SIZE = 64*1024;//ROMマウント用
|
||||
const size_t READ_BUFFER_SIZE = 64*1024;
|
||||
|
||||
#define SDK_SER_LEN nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN
|
||||
|
||||
namespace
|
||||
{
|
||||
u8* readBuf;
|
||||
u8* romfsBuf;
|
||||
|
||||
}
|
||||
nn::Result result;
|
||||
|
||||
|
||||
bool ImportFile(nn::fs::MediaType mediaType, wchar_t* filename)
|
||||
{
|
||||
//nn::Result result;
|
||||
|
||||
nn::fs::FileOutputStream* stream;
|
||||
result = nn::am::BeginImportProgram(&stream, mediaType);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
//NN_LOG("Importing: %ls...", filename);
|
||||
nn::fs::FileInputStream in(filename);
|
||||
|
||||
while(s32 read = in.Read(readBuf, READ_BUFFER_SIZE))
|
||||
{
|
||||
stream->Write(readBuf, read);
|
||||
}
|
||||
result = nn::am::EndImportProgram(stream);
|
||||
}
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
#define LIST_MAX 4000
|
||||
#define LIST_LENGTH (LIST_MAX * (nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1))
|
||||
u8 s_list[LIST_MAX][nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1];//シリアルリスト
|
||||
u8 sign[256];//署名
|
||||
u8 serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1];
|
||||
|
||||
//本体シリアル取得
|
||||
int GettedSerLen;
|
||||
bool GetSerial(){
|
||||
nn::cfg::CTR::init::Initialize();
|
||||
nn::cfg::CTR::system::Initialize();
|
||||
result = nn::cfg::CTR::system::GetSerialNo(serialNo);
|
||||
nn::cfg::CTR::system::Finalize();
|
||||
nn::cfg::CTR::init::Finalize();
|
||||
serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN] = 0;
|
||||
GettedSerLen = strlen((char*)serialNo);
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#define setColor(r,g,b,a) s_RenderSystem.SetColor(r,g,b,a)
|
||||
void setColor(f32 r,f32 g,f32 b,f32 a){ shf_SetColor(r,g,b,a);}
|
||||
//#define setText(x,y,s) s_RenderSystem.DrawText(x,y,s)
|
||||
void drawText(u16 x,u16 y,char *s){ shf_DrawText_0( x,y,s);}
|
||||
//上はASCIIのみ対応したTextWriterへのラッパ
|
||||
//日本語表示の場合、WideTextWriterを使う(要sft_側の関数追加)
|
||||
|
||||
|
||||
nn::hid::PadReader *hpr;
|
||||
//入力待ち
|
||||
nn::hid::PadStatus padStatus;
|
||||
u32 WaitKey(u32 mask)
|
||||
{
|
||||
|
||||
while(1){
|
||||
hpr->ReadLatest(&padStatus);
|
||||
if(padStatus.trigger & mask)return padStatus.trigger;
|
||||
CheckSysBreak();
|
||||
int i = nn::ndm::GetDaemonStatus( nn::ndm::DN_CEC );
|
||||
if (i !=3 )NN_LOG("DN_CEC %d\n",i);
|
||||
i = nn::ndm::GetDaemonStatus( nn::ndm::DN_BOSS );
|
||||
if (i !=3 )NN_LOG("DN_BOSS %d\n",i);
|
||||
i = nn::ndm::GetDaemonStatus( nn::ndm::DN_NIM );
|
||||
if (i !=3 )NN_LOG("DN_NIM %d\n",i);
|
||||
i = nn::ndm::GetDaemonStatus( nn::ndm::DN_FRIENDS );
|
||||
if (i !=3 )NN_LOG("DN_FRIENDS %d\n",i);
|
||||
}
|
||||
}
|
||||
|
||||
//終了
|
||||
void endfunc()
|
||||
{
|
||||
appHeap.Free(reinterpret_cast<void*>(readBuf));
|
||||
appHeap.Free(reinterpret_cast<void*>(romfsBuf));
|
||||
nn::hid::Finalize();
|
||||
SharedFontFinalize();
|
||||
nngxWaitVSync(NN_GX_DISPLAY_BOTH);//SDK2.0以降では不要?
|
||||
s_RenderSystem.Finalize();
|
||||
}
|
||||
|
||||
//署名検証
|
||||
bool VeriRsa(u8* src,size_t sz,u8* sig)
|
||||
{
|
||||
nn::crypto::RsaKey key;
|
||||
//nn::crypto::Initialize();
|
||||
nn::ps::CTR::Initialize();
|
||||
result = key.InitializePublicKey(PUBLIC_KEY_BEGIN,KEY_LENGTH);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
result = nn::ps::CTR::VerifyRsaSha256(src,sz,sig,key);
|
||||
}
|
||||
//nn::crypto::Finalize();
|
||||
nn::ps::CTR::Finalize();
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
//エラー
|
||||
void ErrorCommon(char *s,char *ss)
|
||||
{
|
||||
char str[128];
|
||||
nn::am::FinalizeForLocalImporter();
|
||||
nn::fs::Unmount("sdmc:");
|
||||
nn::fs::Unmount("rom:");
|
||||
NN_LOG(s);
|
||||
NN_LOG(" result = %d\n",result.GetDescription());
|
||||
shf_SetScale(0.7,0.7);
|
||||
setColor(1.0, 0.0, 0.0,1.0);
|
||||
strcpy(str,"Error: ");
|
||||
strcat(str,s);
|
||||
drawText(10,100,str);
|
||||
drawText(10,140,ss);
|
||||
}
|
||||
|
||||
|
||||
void ErrorStop(char *s)
|
||||
{
|
||||
ErrorCommon(s,"Push Home Button & end");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
}
|
||||
|
||||
void ErrorPoff(char *s)
|
||||
{
|
||||
ErrorCommon(s,"Push Power Button & Power Off");
|
||||
drawText(10,160,"Home Button is invalid");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
}
|
||||
|
||||
|
||||
//改行後の位置を返す、0=見つからなかった
|
||||
int CrLf(int n,int max)
|
||||
{
|
||||
u8 d;
|
||||
while(n < max)
|
||||
{
|
||||
d = readBuf[n];
|
||||
if (d==0x0a)return n+1;//LF
|
||||
if (d==0x0d)//CR
|
||||
{
|
||||
if (n == max-1)return 0;//終端
|
||||
n++;
|
||||
if (readBuf[n]==0x0a)return n+1;//CR+LF
|
||||
ErrorStop("list broken");//CRのみは異常、署名時にファイル壊れてた?
|
||||
}
|
||||
n++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
nn::fs::FileInputStream fi;
|
||||
//ファイルリード
|
||||
s32 FileRead(char* fname)
|
||||
{
|
||||
s32 size;
|
||||
result = fi.TryInitialize(fname);
|
||||
if (result.IsFailure()){//open error
|
||||
//NN_LOG("desc= %d\n",result.GetDescription());
|
||||
return 0;
|
||||
}
|
||||
result = fi.TryRead(&size,readBuf,READ_BUFFER_SIZE);
|
||||
fi.Finalize();
|
||||
if (result.IsFailure()){
|
||||
//NN_LOG("desc= %d\n",result.GetDescription());
|
||||
return 0;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
char ver[16];
|
||||
char seri[32];
|
||||
void nnMain( void )
|
||||
{
|
||||
//nn::Result result;
|
||||
bool flg_applove=false;
|
||||
bool flg_test=false;
|
||||
int i,j,n;
|
||||
s32 fsize;
|
||||
extern bool prohibitHome;// HOME ボタン禁止
|
||||
|
||||
nn::os::Initialize();
|
||||
nn::fs::Initialize();
|
||||
|
||||
//DEA-SUPにて推奨のフリーズ暫定対策:無線デーモンを停止 (2011.3.1 現在)
|
||||
//ただし、スリープ時の"いつのまに通信"は止まらない
|
||||
//無線は使わないので本体横スイッチ切っとくのが確実
|
||||
nn::ndm::Initialize();
|
||||
result = nn::ndm::SuspendScheduler();
|
||||
NN_LOG("%d",result.GetDescription());
|
||||
|
||||
//中断処理の準備
|
||||
InitSysBreak((uptr)endfunc);
|
||||
// グラフィックスライブラリの初期化は、以降で行わなければならない
|
||||
// 他、アプリケーションの初期化処理
|
||||
|
||||
nn::hid::Initialize();
|
||||
nn::hid::PadReader padReader;
|
||||
hpr = &padReader;
|
||||
|
||||
//result = nn::ns::CTR::InitializeForShell();
|
||||
//if (result.IsSuccess())
|
||||
result = nn::am::InitializeForLocalImporter();
|
||||
|
||||
nn::applet::DisableSleep();//スリープ非対応
|
||||
|
||||
// ヒープの確保
|
||||
appHeap.Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR);
|
||||
|
||||
const u32 s_GxHeapSize = 0x800000;
|
||||
// RenderSystem の準備
|
||||
heapForGx = reinterpret_cast<uptr>(appHeap.Allocate(s_GxHeapSize));
|
||||
s_RenderSystem.Initialize(heapForGx, s_GxHeapSize);
|
||||
SharedFontInit();
|
||||
|
||||
// 共有フォントの種類を取得
|
||||
//nn::pl::SharedFontType sftype = nn::pl::GetSharedFontType();
|
||||
|
||||
// スリープ要求に対する返答を有効にする
|
||||
// また、蓋の状態チェックを行い蓋が閉じられているならスリープ要求が発生する
|
||||
// nn::applet::EnableSleep(true);
|
||||
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.Clear();
|
||||
// s_RenderSystem.SetFontSize(12);
|
||||
shf_SetScale(0.8,0.6);
|
||||
setColor(1.0,1.0,1.0,1.0);
|
||||
drawText(20,20,"CTR Card Savedata Mover Setup");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
shf_SetScale(0.5,0.5);
|
||||
sprintf(ver,"version %.2f",VERSION);
|
||||
drawText(250,40,ver);
|
||||
|
||||
shf_SetScale(0.7,0.7);
|
||||
if (result.IsFailure())ErrorStop("Initialize");//初期化に失敗
|
||||
if (READ_BUFFER_SIZE < LIST_LENGTH)ErrorStop("buffer size");//バッファサイズのチェック
|
||||
|
||||
//ファイルバッファ
|
||||
//カゲマイ上のSDリード速度比較実験で32アラインが良かったので、おまじない
|
||||
//回数もサイズも少ないので気にする必要ないかも
|
||||
if (READ_BUFFER_SIZE > appHeap.GetTotalFreeSize())ErrorStop("memory alloc");
|
||||
readBuf = reinterpret_cast<u8*>(appHeap.Allocate(READ_BUFFER_SIZE,32));
|
||||
if (ROMFS_BUFFER_SIZE > appHeap.GetTotalFreeSize())ErrorStop("memory alloc");
|
||||
romfsBuf = reinterpret_cast<u8*>(appHeap.Allocate(ROMFS_BUFFER_SIZE,32));
|
||||
|
||||
|
||||
//シリアルチェック
|
||||
if( GetSerial() == false)ErrorStop("Get Serial");//本体シリの取得に失敗
|
||||
|
||||
result = nn::fs::MountSdmc();//ダイレクトでマウント..マスタリング時にワーニング
|
||||
if (result.IsFailure())ErrorStop("Mount SD");
|
||||
fsize = FileRead(INF_FILE);//設定ファイルがあるか
|
||||
if((fsize < 1024) && (fsize > 0))//サイズチェック,増えても1Kは超えない
|
||||
{//不具合調査時に状況にあわせて現場で作成&変更を想定したオプション
|
||||
//通常は不要なので無しでも動くようしとく
|
||||
n = 0;
|
||||
while(n < fsize)
|
||||
{
|
||||
if (readBuf[n] == '-'){
|
||||
if (n == fsize-1)break;//終端
|
||||
n++;
|
||||
switch (readBuf[n]){
|
||||
case 'p':// -p .. 本体シリアル表示
|
||||
strcpy(seri,"s/n: ");
|
||||
strcat(seri,(char *)serialNo);
|
||||
shf_SetScale(0.5,0.5);
|
||||
drawText(10,40,(char*)seri);
|
||||
shf_SetScale(0.7,0.7);
|
||||
break;
|
||||
case 't':// -t .. テストメニュー有効
|
||||
flg_test = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
//シリアル表示(オプション)後にチェック
|
||||
//デバッガ=15,実機=11
|
||||
if (GettedSerLen < 11)ErrorStop("invalid Serial");
|
||||
|
||||
fsize = FileRead(SIGN_FILE);//署名リード
|
||||
if(fsize != 256)ErrorStop("sign file");//鍵のbit長は2046固定
|
||||
memcpy(sign,readBuf,256);//readBuf -> sign
|
||||
fsize = FileRead(LIST_FILE);//リストリード
|
||||
if((fsize > LIST_LENGTH ) || (fsize == 0))ErrorStop("list file");
|
||||
|
||||
nn::fs::Unmount("sdmc:"); //検証後はSDから読まないでメモリバッファ上のデータを使う: 差替え対策
|
||||
if (VeriRsa(readBuf,fsize,sign) == false)ErrorStop("sign verify");
|
||||
|
||||
//署名検証OK
|
||||
int list_ct = 0;
|
||||
n=0;
|
||||
while(n < fsize)//リスト作成
|
||||
{
|
||||
if (readBuf[n] == '#')//コメント行を無視、ワイド文字非対応
|
||||
{
|
||||
i = CrLf(n,fsize);//コメントの次行
|
||||
if (i == 0)break;//ファイル終わりまで改行が見つからない
|
||||
}else
|
||||
{
|
||||
//改行さがし
|
||||
if ((fsize-n) > (SDK_SER_LEN+2))
|
||||
{//シリアルは改行つける
|
||||
i = CrLf(n,n+SDK_SER_LEN+2);
|
||||
if (i == 0)ErrorStop("list broken");//改行が見つからない
|
||||
}else{
|
||||
i = CrLf(n,fsize);
|
||||
if (i ==0)i = fsize;//改行以外でファイル終
|
||||
}
|
||||
if ((i-n) > GettedSerLen)//シリアルをリスト化
|
||||
{
|
||||
j = 0;
|
||||
while(n<i)
|
||||
{
|
||||
if ((readBuf[n] == 0x0d) || (readBuf[n] == 0x0a))break;
|
||||
s_list[list_ct][j] = readBuf[n];
|
||||
j++;n++;
|
||||
}
|
||||
s_list[list_ct][j] = 0;//終端
|
||||
list_ct++;
|
||||
if (list_ct>=LIST_MAX)ErrorStop("List too Long");
|
||||
}
|
||||
}
|
||||
if ((fsize-i) < GettedSerLen)break;//ファイル終
|
||||
n=i;//ポインタを改行の次へ
|
||||
}
|
||||
|
||||
//プログラムミス、コードバグ対策
|
||||
//値が小さいと判定が緩くなるが、動作確認時にスルーしそうなので
|
||||
//念の為チェック
|
||||
if (GettedSerLen < 11)ErrorStop("invalid Serial");
|
||||
|
||||
//本体シリアルがリストにあるかチェック
|
||||
n =0;
|
||||
while(n<list_ct)
|
||||
{
|
||||
if (GettedSerLen == strlen((char*)s_list[n]))
|
||||
{
|
||||
for(i=0;i<GettedSerLen;i++)
|
||||
{
|
||||
if (serialNo[i] != s_list[n][i])break;
|
||||
}
|
||||
if (i == GettedSerLen)
|
||||
{
|
||||
flg_applove = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
u32 mask = 0;
|
||||
|
||||
//メニュー表示
|
||||
if (flg_applove){//インポート許可本体
|
||||
drawText(80,100,"Push X : Import");
|
||||
drawText(80,140,"Push Y : Delete");
|
||||
mask |= nn::hid::BUTTON_X | nn::hid::BUTTON_Y;
|
||||
}
|
||||
|
||||
//本体機能で消せるようなったら、そっち使うべき
|
||||
//将来的にdeleteは省いていいかも
|
||||
|
||||
|
||||
if (flg_test)//テストメニュー
|
||||
{
|
||||
drawText(80,160,"Push R : Test Data");
|
||||
mask |= nn::hid::BUTTON_R;
|
||||
}
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
if (mask == 0)ErrorStop("Serial Check");//実行できるメニューないときトラップ
|
||||
|
||||
u32 trg = WaitKey(mask);
|
||||
if (trg & nn::hid::BUTTON_R){
|
||||
shf_SetScale(0.6,0.6);
|
||||
TestMain();//テストデータへ
|
||||
}
|
||||
|
||||
nn::fs::MountRom(16, 16, romfsBuf, ROMFS_BUFFER_SIZE);
|
||||
|
||||
shf_SetScale(0.8,0.8);
|
||||
// CIA のプログラム ID を取得する。
|
||||
nn::am::ProgramInfo programInfo;
|
||||
if (nn::am::GetProgramInfoFromCia(&programInfo, ROMFS_IMPORTEE_PATH).IsFailure())ErrorStop("cia infomation");
|
||||
|
||||
// Imprting/Delete 表示
|
||||
s_RenderSystem.Clear();
|
||||
if(trg & nn::hid::BUTTON_X) drawText(10,120,"Importing");
|
||||
else drawText(10,120,"Delete");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
// HOME ボタン禁止
|
||||
//Homeで中断するとアイコンが更新されない、電源OFF画面からHomeは問題なし
|
||||
prohibitHome = true;
|
||||
|
||||
// 既に存在するものをインポートするとエラーが返ってくるので、あらかじめ消しておく。
|
||||
nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, programInfo.id);
|
||||
// タイトル鍵が違うケースに対応するために、チケットも消しておく。
|
||||
nn::am::DeleteTicket(programInfo.id);
|
||||
|
||||
if(trg & nn::hid::BUTTON_X)
|
||||
{
|
||||
// CIA をインポート
|
||||
if (ImportFile(nn::fs::MEDIA_TYPE_NAND, ROMFS_IMPORTEE_PATH)==false)ErrorPoff("Import");
|
||||
}
|
||||
nn::fs::Unmount("rom:");
|
||||
|
||||
s_RenderSystem.Clear();
|
||||
drawText(10,50,"Complate");
|
||||
drawText(10,120,"Push Power Button & Power Off");
|
||||
drawText(10,140,"Home Button is invalid");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 34658 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#表示にDemoライブラリを使用します
|
||||
#PC環境に合わせてサンプルデモのディレクトリを指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/sampledemos/common/include)
|
||||
INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
LIBS += lib_demo libnn_am
|
||||
|
||||
.SUBDIRS: $(exist-dirs \
|
||||
body \
|
||||
Imp \
|
||||
)
|
||||
|
||||
DefineDefaultRules()
|
||||
@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: Omakefile
|
||||
#
|
||||
# Copyright (C)2010 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 25650 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUPPORTED_TARGETS = CTR-T*.Process.MPCore.*
|
||||
CTR_APPTYPE = BOTH
|
||||
#CTR_APPTYPE = CARD
|
||||
#CTR_APPTYPE = NAND
|
||||
|
||||
#demoライブラリ位置指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../CTR_SDK/sampledemos/common/include)
|
||||
#INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
# ビルドするソースコードを指定します。
|
||||
#SDにセーブする場合はmembak -> exsave 変更
|
||||
SOURCES[] =
|
||||
./source/main.cpp
|
||||
./source/screen/screen.cpp
|
||||
../../common/savefile/savedata.cpp
|
||||
../../common/savefile/membak.cpp
|
||||
../../common/savefile/savefile.cpp
|
||||
../../common/gui/gui.cpp
|
||||
../../common/shfnt.cpp
|
||||
../../common/sleep.cpp
|
||||
../../common/common.cpp
|
||||
|
||||
#LIBS += lib_demo libnn_am
|
||||
#LIBS += libnn_ps
|
||||
|
||||
TARGET_PROGRAM = CtrSaveDataMover
|
||||
|
||||
TITLE = CSM_body
|
||||
|
||||
# ROMFS のルートパスを指定します。
|
||||
#ROMFS_ROOT =
|
||||
|
||||
# 独自の RSF ファイルを指定する場合
|
||||
ROM_SPEC_FILE = body.rsf
|
||||
DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/repairtool.desc
|
||||
|
||||
# バナー、アイコン
|
||||
CTR_BANNER_SPEC = banner_null_icon.bsf
|
||||
|
||||
|
||||
#Cia バージョン:マスタリング毎に更新すること
|
||||
#メジャーはrsfで指定(Remasterversion)
|
||||
MAKECIAFLAGS = -minor 0 -micro 12
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
Binary file not shown.
@ -1,274 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<NintendoWareIntermediateFile>
|
||||
<GraphicsContentCtr Version="1.3.0" Namespace="">
|
||||
<EditData>
|
||||
<MetaData>
|
||||
<Key>MetaData</Key>
|
||||
<Create Author="" Date="2010-12-02T15:21:10" Source="COMMON.mb">
|
||||
<ToolDescriptions Name="NW4C_Export for Maya 2009 Service Pack 1" Version="1.2.0" />
|
||||
</Create>
|
||||
<Modify Date="2011-02-28T13:21:02">
|
||||
<ToolDescriptions Name="NintendoWare Creative Studio For Banner." Version="1.3.0.30235" />
|
||||
</Modify>
|
||||
</MetaData>
|
||||
<ContentSummaryMetaData>
|
||||
<Key>ContentSummaries</Key>
|
||||
<Values>
|
||||
<ContentSummary ContentTypeName="GraphicsContent">
|
||||
<ObjectSummaries>
|
||||
<ObjectSummary TypeName="SkeletalModel" Name="">
|
||||
<Notes>
|
||||
<Note Name="MaterialCount" Value="1" />
|
||||
<Note Name="ShapeCount" Value="1" />
|
||||
<Note Name="MeshCount" Value="1" />
|
||||
<Note Name="BoneCount" Value="1" />
|
||||
<Note Name="TotalPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalNoneSkinningPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalRigidSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalSmoothSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalIndexStreamCount" Value="1" />
|
||||
<Note Name="TotalPolygonCount" Value="2" />
|
||||
<Note Name="TotalVertexCount" Value="4" />
|
||||
</Notes>
|
||||
</ObjectSummary>
|
||||
</ObjectSummaries>
|
||||
</ContentSummary>
|
||||
</Values>
|
||||
</ContentSummaryMetaData>
|
||||
</EditData>
|
||||
<Models>
|
||||
<SkeletalModel Name="" IsBranchVisible="true" IsVisible="true" CullingMode="Dynamic" IsNonuniformScalable="false" LayerId="0" NeededBoneCapacity="20">
|
||||
<EditData>
|
||||
<ModelDccToolExportOption ExportStartFrame="0" Magnify="1" AdjustSkinning="None" MeshVisibilityMode="BindByIndex">
|
||||
<Key>ModelDccToolInfo</Key>
|
||||
</ModelDccToolExportOption>
|
||||
<OptimizationLogArrayMetaData Size="1">
|
||||
<Key>OptimizationLogs</Key>
|
||||
<Values>
|
||||
<OptimizationLog Date="2010-12-02T15:21" EditorVersion="1.2.0.27817">
|
||||
<Options NodeCompressionMode="None" IsMergeMeshOwnerBoneEnabled="false" IsCombineMeshEnabled="false" IsCompressMaterialEnabled="false" IsOptimizePlygonPrimitiveEnabled="false" IsConvertOneBoneSkeletalModelToModel="true" IsDeleteUnusedVertexEnabled="false" PositionQuantizeMode="Float" NormalQuantizeMode="Float" TextureQuantizeMode="Float" GroupByIndexStream="false" />
|
||||
</OptimizationLog>
|
||||
</Values>
|
||||
</OptimizationLogArrayMetaData>
|
||||
</EditData>
|
||||
<AnimationGroupDescriptions>
|
||||
<GraphicsAnimationGroupDescription Name="SkeletalAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="CalculatedTransform" IsBinarized="true">
|
||||
<Path>Skeleton.Bones["*"].AnimatedTransform</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="VisibilityAnimation" EvaluationTiming="BeforeWorldUpdate">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>Meshes["*"].IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsBranchVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="MaterialAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Emission</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Ambient</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Diffuse</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant2</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant3</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant4</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant5</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Sampler.BorderColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Int" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Texture</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].FragmentOperation.BlendOperation.BlendColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Scale</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Float" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Rotate</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Translate</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
</AnimationGroupDescriptions>
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
<Shapes>
|
||||
<SeparateDataShapeCtr>
|
||||
<OrientedBoundingBox>
|
||||
<CenterPosition X="0" Y="0" Z="6.5" />
|
||||
<OrientationMatrix M00="1" M01="0" M02="0" M10="0" M11="1" M12="0" M20="0" M21="0" M22="1" />
|
||||
<Size X="24" Y="12" Z="0" />
|
||||
</OrientedBoundingBox>
|
||||
<PositionOffset X="0" Y="0" Z="0" />
|
||||
<PrimitiveSets>
|
||||
<PrimitiveSetCtr SkinningMode="None">
|
||||
<BoneIndexTable>0</BoneIndexTable>
|
||||
<Primitives>
|
||||
<PrimitiveCtr>
|
||||
<IndexStreams>
|
||||
<UbyteIndexStreamCtr PrimitiveMode="Triangles" Size="6">0 1 2 1 3 2</UbyteIndexStreamCtr>
|
||||
</IndexStreams>
|
||||
</PrimitiveCtr>
|
||||
</Primitives>
|
||||
</PrimitiveSetCtr>
|
||||
</PrimitiveSets>
|
||||
<VertexAttributes>
|
||||
<Vector3VertexStreamCtr Usage="Position" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
-12 -6 6.5
|
||||
12 -6 6.5
|
||||
-12 6 6.5
|
||||
12 6 6.5
|
||||
</Vector3VertexStreamCtr>
|
||||
<Vector3VertexAttributeCtr Usage="Normal">0 0 1</Vector3VertexAttributeCtr>
|
||||
<Vector2VertexStreamCtr Usage="TextureCoordinate0" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
0 0
|
||||
1 0
|
||||
0 1
|
||||
1 1
|
||||
</Vector2VertexStreamCtr>
|
||||
</VertexAttributes>
|
||||
</SeparateDataShapeCtr>
|
||||
</Shapes>
|
||||
<Materials>
|
||||
<MaterialCtr Name="MT_00" IsCompressible="true" LightSetIndex="0" FogIndex="0" IsFragmentLightEnabled="false" IsVertexLightEnabled="false" IsHemiSphereLightEnabled="false" IsHemiSphereOcclusionEnabled="false" IsFogEnabled="false" TextureCoordinateConfig="Config0120" TranslucencyKind="Layer1" ShaderProgramDescriptionIndex="-1" ShaderBinaryKind="Default">
|
||||
<ShaderReference />
|
||||
<MaterialColor VertexColorScale="1">
|
||||
<Emission R="0" G="0" B="0" A="0" />
|
||||
<Ambient R="1" G="1" B="1" A="0" />
|
||||
<Diffuse R="1" G="1" B="1" A="1" />
|
||||
<Specular0 R="1" G="1" B="1" A="0" />
|
||||
<Specular1 R="0" G="0" B="0" A="0" />
|
||||
<Constant0 R="0" G="0" B="0" A="1" />
|
||||
<Constant1 R="0" G="0" B="0" A="1" />
|
||||
<Constant2 R="0" G="0" B="0" A="1" />
|
||||
<Constant3 R="0" G="0" B="0" A="1" />
|
||||
<Constant4 R="0" G="0" B="0" A="1" />
|
||||
<Constant5 R="0" G="0" B="0" A="1" />
|
||||
</MaterialColor>
|
||||
<Rasterization CullingMode="BackFace" IsPolygonOffsetEnabled="false" PolygonOffsetUnit="0" />
|
||||
<TextureCoordinators>
|
||||
<TextureCoordinatorCtr SourceCoordinate="0" MappingMethod="UvCoordinateMap" ReferenceCamera="0" MatrixMode="DccMaya" ScaleS="1" ScaleT="1" Rotate="0" TranslateS="0" TranslateT="0" />
|
||||
</TextureCoordinators>
|
||||
<TextureMappers>
|
||||
<PixelBasedTextureMapperCtr>
|
||||
<TextureReference>Textures["banner"]@file:Textures/banner.ctex</TextureReference>
|
||||
<StandardTextureSamplerCtr MinFilter="Linear" MagFilter="Linear" WrapS="ClampToEdge" WrapT="ClampToEdge" MinLod="0" LodBias="0">
|
||||
<BorderColor R="0" G="0" B="0" A="1" />
|
||||
</StandardTextureSamplerCtr>
|
||||
</PixelBasedTextureMapperCtr>
|
||||
</TextureMappers>
|
||||
<FragmentShader LayerConfig="ConfigurationType0">
|
||||
<BufferColor R="0" G="0" B="0" A="1" />
|
||||
<FragmentBump BumpTextureIndex="Texture0" BumpMode="NotUsed" IsBumpRenormalize="false" />
|
||||
<FragmentLighting FresnelConfig="No" IsClampHighLight="false" IsDistribution0Enabled="false" IsDistribution1Enabled="false" IsGeometricFactor0Enabled="false" IsGeometricFactor1Enabled="false" IsReflectionEnabled="false" />
|
||||
<FragmentLightingTable>
|
||||
<ReflectanceRSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceRSampler>
|
||||
<ReflectanceGSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceGSampler>
|
||||
<ReflectanceBSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceBSampler>
|
||||
<Distribution0Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution0Sampler>
|
||||
<Distribution1Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution1Sampler>
|
||||
<FresnelSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</FresnelSampler>
|
||||
</FragmentLightingTable>
|
||||
<TextureCombiners>
|
||||
<TextureCombinerCtr CombineRgb="Replace" CombineAlpha="Replace" ScaleRgb="One" ScaleAlpha="One" Constant="Constant0" BufferInputRgb="PreviousBuffer" BufferInputAlpha="PreviousBuffer">
|
||||
<SourceRgb Source0="Texture0" Source1="FragmentPrimaryColor" Source2="FragmentSecondaryColor" />
|
||||
<OperandRgb Operand0="Color" Operand1="Color" Operand2="Color" />
|
||||
<SourceAlpha Source0="Texture0" Source1="Constant" Source2="Constant" />
|
||||
<OperandAlpha Operand0="Alpha" Operand1="Alpha" Operand2="Alpha" />
|
||||
</TextureCombinerCtr>
|
||||
</TextureCombiners>
|
||||
<AlphaTest IsTestEnabled="false" TestFunction="Always" TestReference="0" />
|
||||
</FragmentShader>
|
||||
<FragmentOperation>
|
||||
<DepthOperation IsTestEnabled="true" TestFunction="Less" IsMaskEnabled="false" />
|
||||
<BlendOperation Mode="Blend" LogicOperation="Copy">
|
||||
<RgbParameter BlendFunctionSource="SourceAlpha" BlendFunctionDestination="OneMinusSourceAlpha" BlendEquation="FuncAdd" />
|
||||
<AlphaParameter BlendFunctionSource="One" BlendFunctionDestination="Zero" BlendEquation="FuncAdd" />
|
||||
<BlendColor R="0" G="0" B="0" A="1" />
|
||||
</BlendOperation>
|
||||
<StencilOperation IsTestEnabled="false" TestFunction="Never" TestReference="0" TestMask="255" FailOperation="Keep" ZFailOperation="Keep" PassOperation="Keep" />
|
||||
</FragmentOperation>
|
||||
</MaterialCtr>
|
||||
</Materials>
|
||||
<Meshes>
|
||||
<Mesh IsVisible="true" RenderPriority="0" MeshNodeName="BONE_00">
|
||||
<EditData>
|
||||
<DccToolSourceNodeMetaData>
|
||||
<Key>DccToolSourceNode</Key>
|
||||
<Values>
|
||||
<NodeName>BONE_00</NodeName>
|
||||
</Values>
|
||||
</DccToolSourceNodeMetaData>
|
||||
</EditData>
|
||||
<SeparateShapeReference>Shapes[0]</SeparateShapeReference>
|
||||
<MaterialReference>Materials["MT_00"]</MaterialReference>
|
||||
</Mesh>
|
||||
</Meshes>
|
||||
<Skeleton RootBoneName="BONE_00" ScalingRule="Standard" IsTranslateAnimationEnabled="true">
|
||||
<Bones>
|
||||
<Bone Name="BONE_00" ParentBoneName="" IsSegmentScaleCompensate="false" IsCompressible="true" IsNeededRendering="true" HasSkinningMatrix="false" BillboardMode="YAxial">
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
</Bone>
|
||||
</Bones>
|
||||
</Skeleton>
|
||||
</SkeletalModel>
|
||||
</Models>
|
||||
</GraphicsContentCtr>
|
||||
</NintendoWareIntermediateFile>
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M‡M§U§U†M†M†M†M†M†M†M†M†M†M†M†M†M§U§U§U†M‡U§U§U§U¨]¨]Č]§U¨]Č]É]É]Éeéeęm†M†M‡M§U§U§U¨UČ]§U¨U¨]Č]Č]ÉeÉeęeČ]É]É]ęeéeęmęmnęeęmëmvv,v,v-~Č]ÉeÉeęeęeëmëmvęennvv,~-~M†v,~,~-~-~N†N†oŽM~N†N†oŽoŽp–<70>–‘žn,v,v-~-~N†N†oŽ-~N†N†oŽoŽp–p–‘–nŽoŽpŽ<70>–<EFBFBD>–±ž±ž˛¦‘–˛ž˛žÓ¦Ň¦Ó®Ó®ő¶oŽp–<70>–‘ž‘–˛ž˛žÓ¦‘ž˛¦˛¦Ó¦Ó¦Ô®ô®ő¶Ó¦Ô®ô®ő¶ő¶żż7Çő¶żż7Ç7Ç8ĎXĎYφM‡U§U§U§U¨]Č]É]¨UČ]Č]ÉeÉ]éeęeęmÉ]éeéej]ęmkeK*ë!ęmË2vk+;-~LmN†Éeęeęeęmęmvv,vëmvv,~,v-~-~N†v«!-~ŚK
moŽK*.uN††oŽ<6F>–íS¬:‘ž˛žv-~«!ÍdM†®}K*«!N†nuoŽpŽkđ…Ndl2oŽ<6F>–L2±ž±ž˛¦kĐt±ž˛¦ržŇŤk.Kl2kp–‘–O}°…˛žnK°td
CđtÓ¦Ô®
KÍBő¶żÍ:’Ťkł•ÍB.KÍB…ń|¦7Ç7Çđc÷ĆXĎy×Ó¦ô®ô®ń|ő¶żk7Ç·m:žË!kXĎkY×7ÇXĎXĎY×YĎz×z×zßY×z×zכߛߛç›çĽďm:<3A>[kV¶Ť:W¶îJ®OSzßzß›ßtxľĽçĽď›ß›çśçĽďĽď˝ďÝďŢ÷ĽďÝďÝďŢ÷Ţ÷ţ÷ţ÷˙˙,~-~M~N†N†oŽoŽ<6F>–N†oŽoŽ<6F>–<EFBFBD>–‘ž±ž˛¦<CB9B>–‘ž±ž˛¦˛žÓ¦Ó¦ô®˛¦Ó®Ó®ô¶ô®ő¶·ż<>–±ž±žŇ¦˛¦Ó®Ó®ô¶˛¦Ó®Ô®ô¶ô¶żżżô¶··żż7Ç7ÇXĎż7Ç7ÇXĎXĎY×y×zßÔ®ő¶ő¶żż7Ç7ÇXĎż7Ç7ÇXĎXĎYĎY×z×8ĎYĎYĎy×y×zßzß›çzךߚߛç›çĽçĽç˝ďXĎY×y×z×zכߛߛçzߛߛߜçśçĽďĽďÝď›çĽçĽď˝ď˝ďÝ÷Ý÷Ţ÷ÝďŢ÷Ţ÷ţ÷Ţ÷˙˙˙˙˙˙›ßśçĽç˝ďĽďÝďÝďŢ÷˝ďÝ÷Ý÷Ţ÷Ţ÷ţ˙ţ˙˙˙Ţ÷Ţ÷ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙Ţ÷˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙
|
||||
@ -1,2 +0,0 @@
|
||||
†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M‡M‡U§U†M‡U§U§U§U§U§U§U†M†M†M†M†M†M†M§U†M‡U‡U§U‡U§U§U§U§U§U§U§U§U§U¨U¨]§U¨U¨UČ]Č]Č]Č]É]§U§U§U§U§U¨U¨]¨]§U¨]¨]¨]Č]Č]Č]É]¨]Č]Č]É]É]ÉeÉeÉeÉ]ÉeÉeÉeéeęeęeęm¨]Č]Č]Č]É]É]ÉeÉeÉ]É]ÉeéeÉeęeęeęmÉeéeęeęeęeęmęmnęmęmęmnnnvvÉeęeęeęmęmęmęmnęmëmëmnnvvvnvvvv,v,v,~v,v,v-~-~-~-~M†ëmnnvvv,v,~v,vv,~,~-~-~M~,~-~-~-~M~N†N†N†-~N†N†N†N†oŽoŽoŽ,~-~-~M~M~N†N†N†M†N†N†N†N†oŽoŽoŽN†oŽoŽoŽoŽpŽp–<70>–oŽp–<70>–<EFBFBD>–<EFBFBD>–‘–‘–‘žN†N†oŽoŽoŽoŽoŽp–oŽpŽpŽ<70>–<EFBFBD>–<EFBFBD>–<EFBFBD>–‘ž<E28098>–<EFBFBD>–<EFBFBD>–‘ž‘ž±ž±ž˛ž‘ž±ž±ž˛¦˛ž˛¦˛¦Ó¦<C393>–‘–‘–‘ž‘ž±ž˛ž˛¦‘ž˛ž˛ž˛¦˛¦Ó¦Ó¦Ó®˛¦˛¦ł¦Ó¦Ó¦Ó®Ó®ô®Ó®Ô®Ô®ô®ô®ô¶ô¶ő¶†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M‡U†M†M†M†M†M†M†M†M†M†M†M†M†M†M†M‡U†M†M†M‡U‡U‡U§U§U‡U‡U§U§U§U§U§U¨U†M†M†M†M†M‡U‡U§U‡M‡U§U§U§U§U§U¨U§U§U§U¨U¨U¨]¨]Č]¨U¨]¨]Č]Č]Č]Č]É]§U§U§U¨U¨U¨]¨]Č]¨U¨]¨]Č]Č]É]É]ÉeČ]É]É]ÉeÉeÉeÉeęeÉeÉeÉeęeęeęmęmęmČ]Č]Č]É]É]ÉeÉeéeÉ]ÉeÉeęeéeęeęeęméeęeęeęmęmëmnnęmëmëmnnvv,vęeęeęmęmęmëmnvęmnnvvvv,vnvv,v,v,~,~-~v,~,~-~-~M~M†N†nvvvv,v,v-~v,~,~-~-~-~-~N†-~-~-~N†M†N†N†o†N†N†N†OŽNŽoŽoŽpŽ-~M~M~N†N†N†N†oŽN†N†N†oŽoŽoŽoŽp–OŽoŽoŽpŽpŽ<70>–<EFBFBD>–‘–pŽ<70>–<EFBFBD>–‘–‘–‘ž‘ž˛žn†oŽoŽoŽoŽp–<70>–<EFBFBD>–oŽ<6F>–p–<70>–<EFBFBD>–‘ž‘ž±ž<C2B1>–‘–‘ž±ž‘ž˛ž˛ž˛¦±ž˛ž˛ž˛¦˛¦Ó¦Ó¦Ó®‘–‘ž‘ž±ž±ž˛ž˛¦Ň¦˛ž˛¦˛¦ł¦Ň¦Ó¦Ó®Ó®Ň¦Ó¦Ó¦Ó®Ó®ô®ô®ô¶Ó®ô®ô®ô¶ô¶ő¶ő¶ż˛¦Ó¦Ó¦Ó®Ó®Ô®Ô®ô®Ó®Ô®ô®ô¶ô®ő¶ő¶·ô®ő¶ő¶ő¶·żżż·żżżż7Ç7Ç7Çô¶ő¶ő¶··żżżżżżżż7Ç7Ç7Çż7Ç7Ç7Ç7Ç7Ç8ĎXĎ7Ç8ĎXĎXĎXĎYĎYĎy׆M†M†M§U‡U§U§U§U§U§U§U§U§U¨U§U¨]§U§U§U¨]¨]¨]Č]Č]¨]Č]Č]Č]Č]É]É]Ée§U¨U¨U¨]¨]Č]Č]É]¨]Č]Č]É]É]ÉeÉeéeČ]É]É]éeÉeéeęeęeéeęeęeęmęeęmęmëmČ]É]É]ÉeÉeÉeéeęeÉeéeęeęeęeęmęm‹Tęeęmęmëm
|
||||
nnn+e+]Ë2kkkk‹2ËKęeęmęmn«e«!LknnvvË2k‹2kkKT+;,~,~-~-~-~ěd-~íu-~-~N†N†N†vvŚm,v,v-~-~-~kk+;K*l\N†
e~-~M†M†N†N†N††numm*«!kkkŤKK-~N†N†N†N†Ť\OŽŤdN†oŽoŽoŽoŽ/ŽpŽ<70>–kKkěBp–<70>–<EFBFBD>–‘ž«!kŹ}*¬:P}kkoŽoŽoŽp–p–<70>–<EFBFBD>–‘žkíS*Nd‘–±ž±ž˛ž‘–±ž±ž˛ž˛ž˛¦˛¦Ó¦l2kkkĐtÓ®
Cô®‘ž±ž±ž˛ž˛ž˛¦˛¦Ó¦˛ž˛¦:ržÓ¦2žÓ®’Ťkkk«!k”¦kŃ|knSk0dk.Km:kÓ¦Ó¦Ó®Ô®Ó®ô®ô®ô¶Ô®ô®ô®ő¶ő¶<C591>t·*ô¶ő¶ő¶żżżżżkÍBkÎBÇ7Ç7Ç7Çő¶·ő¶żóťkđckżżŐ¶SŤ*2kđck2Ë!k7ÇXĎXĎXĎÎBkÎBkXĎY×Y×y׿7Ç7Ç7Ç7ÇXĎXĎXĎ7ÇXĎXĎXĎXĎYĎYĎy×XĎYĎYĎy×Y×y×z×zßy×z×z×zßzßšßzß›ßXĎY×Y×y×y×z×z×zßy×z×z×zßzߚߛߛçzßzߚߛߛߛç›çśç›ß›ç›çśçśçĽçĽďĽďÉ]ÉeÉeÉeÉeęeęeęméeęeęeęmęmęmnnęeęmęmnnvvvnvvvv,v,v-~ęmëmëmnnvvvnvvvv,~,~-~v,v,~-~-~-~-~M†-~-~-~N†N†N†N†o†v,v,v,~‹2kŚCk-~-~-~M†
ekN†ě:
eN†m\N†N†oŽoŽoŽ*†k*oŽp–Žd/uN†N†N†NŽN††oŽoŽnŽoŽoŽpŽoŽp–<70>–<EFBFBD>–LCkp–đ…kkNd\<5C>–‘ž‘ž±ž±ž˛ž˛ž˛¦oŽpŽp–<70>–<EFBFBD>–‘–‘–‘ž<E28098>–‘–ďt\‘ž˛žŽu‘ž˛ž˛ž˛¦Żl*ł¦rž˛¦ł¦
ColÓ¦Ô®q…/dkk\p…\®SÓ¦Ó®˛¦Ó¦Ó¦Ó®Ó®Ô®Ô®ô¶kkŇ•plkk0d2…ô¶ő¶ő¶··żżżkÍ:*kô®’Ťô¶’Ťl2kk*ő¶0lż0lk0lk‘t‘tku®kkł•k´ť7Çm:7Dz|Ë!óťµ®żżPl7Çu®ż6Ç7Ç7Ç7Ç7Ç7ÇXĎkÔťÔť÷ľXĎ—¶XĎY×XĎXĎXĎY×Y×y×y×z×…Ź[.SË!k6®,2YĎkkkk˛„y×·ľz×<7A>[krtk¸ľz×öšßr|kr|kö›ß®›çkŤ:öĄ¸ľz×zßzßšßz×zßzߚߚߛߛߛçr|k:×¶U•ĽçÚÎĽç›çĽçĽçĽçĽçĽďĽď˝ďzߛߛߛç›ç›ç›çĽç›çśç›çĽçĽçĽďĽď˝ďĽçĽçĽď˝ď˝ďÝď˝ďÝ÷˝ď˝ď˝ďÝ÷Ý÷Ţ÷Ţ÷Ţ÷ĽçĽďĽď˝ď˝ďÝďÝďÝ÷˝ďÝďÝďÝ÷Ý÷Ţ÷Ţ÷Ţ÷Ý÷Ţ÷Ţ÷Ţ÷Ţ÷ţ÷ţ÷ţ˙Ţ÷ţ÷Ţ÷˙˙˙˙˙˙˙˙˙˙,v,~,~-~-~M~M~N†-~M~M~N†N†N†N†oŽN†N†N†oŽOŽoŽoŽpŽoŽoŽoŽp–pŽ<70>–<EFBFBD>–‘–N†N†N†oŽoŽoŽoŽp–oŽoŽoŽp–<70>–<EFBFBD>–<EFBFBD>–‘–p–<70>–<EFBFBD>–‘–‘–‘ž±ž˛ž‘–±ž±ž˛ž˛ž˛¦˛¦Ó¦pŽ<70>–<EFBFBD>–‘–<E28098>–‘ž‘ž±ž‘–‘ž±ž˛ž˛ž˛¦˛¦˛¦±ž˛¦˛¦˛¦˛¦Ó¦Ó¦Ó®˛¦Ó¦Ó¦Ó®Ó®ô®ô®ô¶˛ž˛¦˛¦Ó¦Ó¦Ó®Ó®Ô®Ó¦Ó®Ó®Ô®Ô®ô®ô¶ő¶Ô®ô®ô®ő¶ô¶ő¶ő¶żő¶ő¶·żżżżżÓ®Ô®ô®ô¶ô¶ő¶ő¶żô¶ő¶ő¶żżżżż·żżżż7Ç7Ç7Çż7Ç7Ç7Ç7Ç8Ď8ĎXĎżżżżż7Ç7Ç7Çż7Ç7Ç7Ç7Ç8ĎXĎXĎ7ÇXĎXĎXĎXĎYĎYĎy×XĎYĎY×y×y×z×z×zß7Ç8Ç8ÇXĎXĎXĎXĎY×XĎYĎYĎY×Y×y×y×z×Y×y×y×z×z×zßzß›ßzßzßzߛߛߛç›ç›çY×y×z×zßzßšßšß›ßzߚߚߛߛߛç›çĽç›ß›ç›çśç›çĽçĽçĽď›çĽçĽçĽďĽď˝ď˝ďÝď›ß›ç›ß›ç›çśçśçĽď›çĽçĽçĽďĽď˝ď˝ď˝ďĽďĽďĽď˝ď˝ďÝďÝďÝ÷˝ďÝďÝďŢ÷Ý÷Ţ÷Ţ÷Ţ÷Ľď˝ď˝ďÝď˝ďÝ÷ÝďŢ÷ÝďÝ÷Ý÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷ţ˙ţ˙˙˙Ţ÷ţ˙˙˙˙˙˙˙˙˙˙˙˙˙Ý÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷˙˙Ţ÷ţ˙ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙p–<70>–<EFBFBD>–‘ž‘ž±ž±ž˛ž‘ž±ž˛ž˛ž˛žŇ¦Ň¦Ó¦˛ž˛¦˛¦Ó¦Ó¦Ó®Ó®Ô®Ó¦Ó®Ó®Ô®Ô®ô¶ô¶ő¶˛¦ł¦˛¦Ó¦Ó¦Ó®Ó®ô®Ó®Ô®Ô®ô®ô®ô¶ô¶·ô®ô¶ô¶ő¶ő¶żżżő¶żżżżż6ż7ÇÔ®ô®ô¶ő¶ő¶··żő¶··żżżż7Çżżż7Ç7Ç7Ç7Ç8Ç7Ç7Ç7Ç8Ď8ÇXĎXĎXĎżżż7Ç7Ç7Ç7ÇXĎ7Ç7Ç7ÇXĎXĎXĎXĎYĎ8ĎXĎXĎYĎYĎY×y×y×YĎY×y×y×y×z×zßšß7ÇXĎXĎXĎXĎY×Y×y×XĎY×y×y×y×z×z×zßy×z×z×zßzߚߛߛßzߛߛߛߛߛç›çĽçy×z×zßzßzߛߛߛçzߛߛߛç›ç›çśçĽç›ç›ç›çĽçĽçĽďĽďĽďĽçĽďĽď˝ď˝ďÝď˝ďÝ÷›ß›ç›çĽçĽçĽçĽçĽďśçĽçĽďĽďĽď˝ď˝ďÝďĽď˝ď˝ďÝď˝ďÝ÷Ý÷Ţ÷ÝďÝ÷Ý÷Ţ÷Ţ÷Ţ÷Ţ÷ţ÷Ľď˝ď˝ďÝďÝďÝ÷Ý÷Ţ÷Ý÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷ţ˙Ţ÷Ţ÷Ţ÷ţ˙ţ˙˙˙˙˙˙˙Ţ÷˙˙˙˙˙˙˙˙˙˙˙˙˙˙Ţ÷Ţ÷Ţ÷Ţ÷Ţ÷˙˙˙˙˙˙Ţ÷˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙
|
||||
Binary file not shown.
@ -1,29 +0,0 @@
|
||||
# アプリケーションのデフォルト値
|
||||
BasicInfo:
|
||||
# プログラムのタイトル名を指定します。
|
||||
Title : $(TITLE)
|
||||
# BackupMemoryType: 128KB
|
||||
BackupMemoryType: None
|
||||
Logo : Nintendo
|
||||
# CompanyCode: "00"
|
||||
ProductCode : "CTR-N-22NA"
|
||||
|
||||
TitleInfo:
|
||||
# Category: 0x0010
|
||||
# Category: SystemApplication
|
||||
UniqueId: 0xf8014
|
||||
Version: 0
|
||||
|
||||
Rom:
|
||||
HostRoot : romfiles
|
||||
# SaveDataSize: 512K
|
||||
|
||||
AccessControlInfo:
|
||||
UseExtSaveData : false
|
||||
|
||||
FileSystemAccess:
|
||||
- CategoryFileSystemTool
|
||||
|
||||
SystemControlInfo:
|
||||
RemasterVersion: 2
|
||||
|
||||
Binary file not shown.
@ -1,966 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: main.cpp
|
||||
|
||||
Copyright (C)2010 Nintendo Co., Ltd. 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 <wchar.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <nn.h>
|
||||
//#include <nn/os.h>
|
||||
#include <nn/applet.h>
|
||||
#include <nn/ndm.h>
|
||||
#include <nn/ndm/ndm_DebugControl.h>
|
||||
#include <nn/fs/ctr/mpcore/fs_FileSystemBasePrivate.h>
|
||||
#include <nn/fs/fs_Parameters.h>
|
||||
//#include <nn/fs/fs_ApiProcessInfo.h>
|
||||
#include "../../../common/savefile/savefile.h"
|
||||
#include "../../../common/savefile/savedata.h"
|
||||
#include "../../../common/savefile/membak.h"
|
||||
#include "./screen/screen.h"
|
||||
#include "../../../common/common.h"
|
||||
|
||||
nn::fnd::ExpHeap appHeap;
|
||||
uptr heapForGx;
|
||||
//Gui gui;
|
||||
myResult errRes;
|
||||
|
||||
|
||||
//char strBuff[128];
|
||||
//bool exist;
|
||||
|
||||
SaveData savedata;
|
||||
nn::os::LightEvent ejectEvnt(false);
|
||||
nn::os::LightEvent insEvnt(false);
|
||||
MemBak exsave;
|
||||
|
||||
//バックアップの状態
|
||||
bool Active,Formatted;
|
||||
bool exActive,exFormatted;
|
||||
tArcInfo arcInfo,arcInfo_ex;//アーカイブ情報
|
||||
|
||||
//プロダクトコードの一致
|
||||
bool isAgreePCode;
|
||||
//ベリファイ結果
|
||||
//bool failveri;
|
||||
|
||||
//Top画面エラー表示
|
||||
int tmerr;
|
||||
|
||||
//結果
|
||||
typedef enum {
|
||||
SUCCESS
|
||||
,ERROR
|
||||
,CANCEL
|
||||
,INSEXIT
|
||||
}RetCode;
|
||||
|
||||
//挿抜イベント時に設定
|
||||
typedef enum {
|
||||
InEx_None
|
||||
,InEx_InsCard
|
||||
,InEx_EjcCard
|
||||
}tIsInsEject;
|
||||
|
||||
tIsInsEject isInsEject;
|
||||
|
||||
extern u8 scr_evnt;
|
||||
void WaitUI();
|
||||
void PutError(ErcDev dev,int cd=0);
|
||||
|
||||
|
||||
//終了処理
|
||||
void endfunc()
|
||||
{
|
||||
|
||||
nn::fs::UnregisterCardEjectedEvent();
|
||||
nn::fs::UnregisterCardInsertedEvent();
|
||||
ejectEvnt.Finalize();
|
||||
insEvnt.Finalize();
|
||||
|
||||
savedata.Finalize();
|
||||
exsave.Finalize();
|
||||
|
||||
ScrFinalize();
|
||||
|
||||
}
|
||||
|
||||
//エラー停止
|
||||
void failstop()
|
||||
{
|
||||
NN_LOG("fail %d,stop\n",errRes);
|
||||
finish();
|
||||
}
|
||||
|
||||
char sts[64];
|
||||
void PutError(ErcDev dev,int cd)
|
||||
{
|
||||
nn::Result res;
|
||||
switch (dev)
|
||||
{
|
||||
case ERC_DEV_CARD: res = savedata.LastNnResult;break;
|
||||
case ERC_DEV_OUT: res = exsave.LastNnResult;break;
|
||||
}
|
||||
GetErrorStr(dev,res,cd,sts);
|
||||
scr_Status(sts,COLOR_RED);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------- Verifi
|
||||
wchar_t file_pathw[MAX_PATH_LENGTH];
|
||||
char file_path[MAX_PATH_LENGTH];
|
||||
//ドライバの仕様で速度的に4バイトアラインした方がいい(SDK 0.14.23 時点)
|
||||
char fileBuffer[512] NN_ATTRIBUTE_ALIGN(4);//検証が512単位なので
|
||||
char fileBuffer_ex[512] NN_ATTRIBUTE_ALIGN(4);
|
||||
#define FILEBUFF_SIZE sizeof(fileBuffer)
|
||||
|
||||
bool Verifi()
|
||||
{
|
||||
myResult res;
|
||||
int ct,i,msize,rsize;
|
||||
s64 total=0;
|
||||
|
||||
//セーブデータのマウント
|
||||
res = savedata.Mount();
|
||||
if(res != RESULT_OK){
|
||||
PutError(ERC_DEV_CARD);
|
||||
return false;
|
||||
}
|
||||
|
||||
//ファイル数の再取得..ファイル多いと時間かかる
|
||||
//arcInfoの保持があやしい or 出来ない場合に有効にする
|
||||
/*
|
||||
scr_Status("Ready to Verifi",COLOR_YELLO);
|
||||
//情報ファイル
|
||||
LogAdd("Directry Info");
|
||||
if(savedata.GetInfo(&arcInfo)==false)
|
||||
{
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_CARD);
|
||||
return ERROR;
|
||||
}
|
||||
*/
|
||||
|
||||
//出力デバイスのマウント
|
||||
res = exsave.Mount();
|
||||
if(res != RESULT_OK){
|
||||
PutError(ERC_DEV_OUT);
|
||||
return false;
|
||||
}
|
||||
|
||||
//情報ファイル
|
||||
if (exsave.GetInfo(&arcInfo_ex) == false)
|
||||
{
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
return false;
|
||||
}//todo:将来、構造体を変更したらバージョンチェック入れる
|
||||
|
||||
//フォーマット情報の比較
|
||||
if ((arcInfo.DirEntry != arcInfo_ex.DirEntry) ||
|
||||
(arcInfo.FileEntry != arcInfo_ex.FileEntry) ||
|
||||
(arcInfo.Dup != arcInfo_ex.Dup))
|
||||
{
|
||||
PutError(ERC_DEV_OUT,ERC_VERIFI);
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
return false;
|
||||
}
|
||||
|
||||
ct =0;
|
||||
if (arcInfo.FileCount == 0)//ファイルが無い
|
||||
{
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
return true;//フォーマット一致のみ
|
||||
}else{
|
||||
scr_Status("file compairing",COLOR_YELLO);
|
||||
savedata.ResetPath();
|
||||
exsave.ResetPath();
|
||||
s64 fsize;
|
||||
res = RESULT_OK;
|
||||
while(res==RESULT_OK){
|
||||
res = savedata.GetPath(file_pathw);
|
||||
if (res != RESULT_OK)
|
||||
{
|
||||
if (res == RESULT_DIR_LEVEL_OVER){
|
||||
break;
|
||||
}
|
||||
if (res == RESULT_PATH_LENGTH_OVER){
|
||||
break;
|
||||
}
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
if (file_pathw[0] == 0)break;//root then end
|
||||
if (ct>=arcInfo.FileCount)
|
||||
{//カウンタ壊れ、メモリフローの可能性
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
if (savedata.Open(file_pathw)==false)
|
||||
{
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
fsize = savedata.FileSize;
|
||||
total += fsize;
|
||||
if (exsave.Open(file_pathw)==false)
|
||||
{
|
||||
res = RESULT_FAIL_OPENW;
|
||||
//savedata.Close();
|
||||
break;
|
||||
}
|
||||
if (fsize != exsave.FileSize)//file size
|
||||
{
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
msize=fsize;
|
||||
if(msize <= FILEBUFF_SIZE ){//一回で読めるサイズならゲージは出さない
|
||||
scr_CountPerMax2(0,0,-1);
|
||||
}
|
||||
while(fsize)
|
||||
{
|
||||
if(msize > FILEBUFF_SIZE ){
|
||||
scr_CountPerMax2(msize-fsize,msize,0);
|
||||
}
|
||||
if (fsize > FILEBUFF_SIZE)
|
||||
{
|
||||
rsize = FILEBUFF_SIZE;
|
||||
fsize -= FILEBUFF_SIZE;
|
||||
}else{
|
||||
rsize = fsize;
|
||||
fsize = 0;
|
||||
}
|
||||
if(savedata.Read(fileBuffer,rsize) != rsize )
|
||||
{
|
||||
//中身のデータが作成サイズに満たない場合に検証エラーとなる対策
|
||||
//読めないブロックは置き換える
|
||||
//検証は512単位でされるので読めてるとこまで置き換えないよう
|
||||
//リードサイズは512にしておく
|
||||
if(nn::fs::ResultVerificationFailed::Includes(savedata.LastNnResult))
|
||||
{
|
||||
for (i = 0; i < rsize; i++)
|
||||
{
|
||||
fileBuffer[i] = 0;//0埋め
|
||||
}
|
||||
}else{
|
||||
res = RESULT_FAIL_READ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(exsave.Read(fileBuffer_ex,rsize) != rsize )
|
||||
{
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
savedata.Close();
|
||||
exsave.Close();
|
||||
if (res != RESULT_OK)break;
|
||||
//verifi
|
||||
for (i = 0;i<rsize;i++)if (fileBuffer[i] != fileBuffer_ex[i])
|
||||
{
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
ct++;
|
||||
}
|
||||
savedata.Close();
|
||||
exsave.Close();
|
||||
}
|
||||
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
scr_CountPerMax2(0,0,total);
|
||||
|
||||
if (res != RESULT_OK){
|
||||
PutError(ERC_DEV_OTHER,ERC_VERIFI);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------- from CARD
|
||||
RetCode Card2Sd()
|
||||
{
|
||||
myResult res;
|
||||
int ct=0,msize,rsize;
|
||||
s64 total=0;
|
||||
|
||||
scr_BackupYesNo();//実行確認
|
||||
WaitUI();//入力待ち
|
||||
if(isInsEject != InEx_None )
|
||||
{//挿抜?
|
||||
//isInsEject = InEx_None;
|
||||
return INSEXIT;//挿抜による中断
|
||||
}
|
||||
if (scr_evnt != EVNT_YES)return CANCEL;//キャンセル
|
||||
scr_Backup();//画面表示
|
||||
scr_Status("Check CARD",COLOR_YELLO);
|
||||
//セーブデータのマウント
|
||||
res = savedata.Mount();
|
||||
if(res != RESULT_OK){
|
||||
PutError(ERC_DEV_CARD);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if(savedata.GetInfo(&arcInfo)==false)
|
||||
{
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_CARD);
|
||||
return ERROR;
|
||||
}
|
||||
//strcpy(arcInfo.Pcode,savedata.PrdCode);
|
||||
|
||||
//サイズチェック
|
||||
if (arcInfo.total > MEM_BKUP_SIZE)
|
||||
{
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_OUT,ERC_WRITE_NS);//容量オーバ
|
||||
return ERROR;
|
||||
}
|
||||
//カウント異常なら実行エラー
|
||||
if (arcInfo.FileCount > arcInfo.FileEntry)
|
||||
{
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_OTHER,ERC_EXEC);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
scr_Status("BackUp Check",COLOR_YELLO);
|
||||
if(exsave.IsExist()){
|
||||
if(exsave.Delete()==false)
|
||||
{
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_OUT);
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
scr_Status("Create Backup",COLOR_YELLO);
|
||||
res = exsave.Create(arcInfo.DirEntry+1,arcInfo.FileEntry+1);
|
||||
if (res != RESULT_OK){
|
||||
savedata.Unmount();
|
||||
PutError(ERC_DEV_OUT);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (arcInfo.FileCount == 0)//ファイルが無い
|
||||
{
|
||||
scr_Status("no files",COLOR_YELLO);
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
return SUCCESS;//フォーマットのみ
|
||||
}else{
|
||||
scr_Status("file reading",COLOR_SKY);
|
||||
savedata.ResetPath();
|
||||
s64 fsize;
|
||||
res = RESULT_OK;
|
||||
while(res==RESULT_OK){
|
||||
res = savedata.GetPath(file_pathw);
|
||||
if (res != RESULT_OK)
|
||||
{
|
||||
if (res == RESULT_DIR_LEVEL_OVER){
|
||||
PutError(ERC_DEV_CARD,ERC_DIRDEPTH);
|
||||
break;
|
||||
}
|
||||
if (res == RESULT_PATH_LENGTH_OVER){
|
||||
PutError(ERC_DEV_CARD,ERC_PATH);
|
||||
break;
|
||||
}
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
if (file_pathw[0] == 0)break;//root then end
|
||||
if (ct>=arcInfo.FileCount)
|
||||
{//カウンタ壊れ、メモリフローの可能性
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
if (savedata.Open(file_pathw)==false)
|
||||
{
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
fsize = savedata.FileSize;
|
||||
total += fsize;
|
||||
if (exsave.OpenW(file_pathw,fsize)==false)
|
||||
{
|
||||
res = RESULT_FAIL_OPENW;
|
||||
//savedata.Close();
|
||||
break;
|
||||
}
|
||||
|
||||
msize=fsize;
|
||||
while(fsize)
|
||||
{
|
||||
if(msize > FILEBUFF_SIZE * 2){
|
||||
scr_CountPerMax2(msize-fsize,msize,0);
|
||||
}
|
||||
if (fsize>FILEBUFF_SIZE)
|
||||
{
|
||||
rsize = FILEBUFF_SIZE;
|
||||
fsize -= FILEBUFF_SIZE;
|
||||
}else{
|
||||
rsize = fsize;
|
||||
fsize = 0;
|
||||
}
|
||||
if(savedata.Read(fileBuffer,rsize) != rsize )
|
||||
{
|
||||
//中身のデータが作成サイズに満たない場合に検証エラーとなる対策
|
||||
//読めないブロックは置き換える
|
||||
//検証は512単位でされるので読めてるとこまで置き換えないよう
|
||||
//リードサイズは512にしておく
|
||||
if(nn::fs::ResultVerificationFailed::Includes(savedata.LastNnResult))
|
||||
{
|
||||
for (int i = 0; i < rsize; i++)
|
||||
{
|
||||
fileBuffer[i] = 0;//0埋め
|
||||
}
|
||||
}else{
|
||||
res = RESULT_FAIL_READ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(exsave.Write(fileBuffer,rsize) != rsize )
|
||||
{
|
||||
res = RESULT_FAIL_WRITE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
savedata.Close();
|
||||
exsave.CloseW();
|
||||
//todo: ゲージ表示
|
||||
ct++;
|
||||
}
|
||||
savedata.Close();
|
||||
exsave.CloseW();
|
||||
}
|
||||
|
||||
if (res == RESULT_OK){
|
||||
if (ct != arcInfo.FileCount)//ファイル数に満たないパス検索終了
|
||||
{//ディレクトリ情報かパス取得で失敗してると思われる
|
||||
PutError(ERC_DEV_OTHER,ERC_EXEC);
|
||||
return ERROR;
|
||||
}
|
||||
//フォーマット情報を記録
|
||||
//Exsaveに2重化が無いので情報取得APIでは不足 - 2011.1 現在
|
||||
//プロダクトコードを追加(2011.1.26)
|
||||
//バージョンを追加(2011.1.27)
|
||||
if (exsave.OpenSysW())
|
||||
{
|
||||
strcpy(arcInfo.Pcode,savedata.PrdCode);
|
||||
if(exsave.WriteSys(&arcInfo) ==false)
|
||||
{
|
||||
res = RESULT_FAIL_WRITE;
|
||||
}
|
||||
}else{
|
||||
res = RESULT_FAIL_OPENW;
|
||||
}
|
||||
exsave.CloseSysW();
|
||||
}
|
||||
savedata.Unmount();
|
||||
//exsave.Commit(); Nand,SDはコミット入れる
|
||||
exsave.Unmount();
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
if(total>0)scr_CountPerMax2(0,0,total);
|
||||
|
||||
//結果
|
||||
switch(res)
|
||||
{
|
||||
case RESULT_OK:
|
||||
if (Verifi())
|
||||
{
|
||||
scr_Status("Complate",COLOR_WHITE);
|
||||
return SUCCESS;
|
||||
}
|
||||
//PutError(ERC_DEV_OTHER,ERC_VERIFI);
|
||||
break;
|
||||
case RESULT_FAIL_WRITE:
|
||||
case RESULT_FAIL_OPENW:
|
||||
//本体メモリなので容量以外でエラーはない
|
||||
PutError(ERC_DEV_OUT,ERC_WRITE_NS);//容量オーバ
|
||||
break;
|
||||
case RESULT_FAIL_READ:
|
||||
case RESULT_FAIL_OPEN:
|
||||
PutError(ERC_DEV_CARD);
|
||||
break;
|
||||
}
|
||||
exsave.Delete();//バックアップを削除
|
||||
return ERROR;
|
||||
}
|
||||
bool mkdir;
|
||||
//---------------------------------------------------------------- SD->CARD
|
||||
RetCode Sd2Card()
|
||||
{
|
||||
myResult res;
|
||||
int ct=0,msize,rsize;
|
||||
s64 total = 0;
|
||||
|
||||
|
||||
scr_RestoreYesNo();//実行確認
|
||||
WaitUI();//入力待ち
|
||||
if(isInsEject != InEx_None ){//挿抜?
|
||||
//isInsEject = InEx_None;
|
||||
return INSEXIT;//挿抜による中断
|
||||
}
|
||||
|
||||
if (scr_evnt != EVNT_YES)return CANCEL;//キャンセル
|
||||
scr_Restore();//画面表示
|
||||
scr_Status("Check Backup",COLOR_YELLO);
|
||||
//保存先のマウント
|
||||
res = exsave.Mount();
|
||||
if(res != RESULT_OK){
|
||||
PutError(ERC_DEV_OUT);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
//セーブデータのフォーマット&マウント
|
||||
scr_Status("Card savedata format",COLOR_YELLO);
|
||||
res = savedata.Format(&arcInfo);//_exの方がいいかも
|
||||
if(res != RESULT_OK){
|
||||
exsave.Unmount();
|
||||
PutError(ERC_DEV_CARD);
|
||||
return ERROR;
|
||||
}
|
||||
//パラメータはバックアップ時
|
||||
//Top画面開始時、挿入イベントで取得
|
||||
if (arcInfo.FileCount == 0)//ファイルが無い
|
||||
{
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
return SUCCESS;//フォーマットのみ
|
||||
}else{
|
||||
scr_Status("file writing",COLOR_PARPL);
|
||||
exsave.ResetPath();
|
||||
s64 fsize;
|
||||
res = RESULT_OK;
|
||||
while(res==RESULT_OK){
|
||||
res = exsave.GetPath(file_pathw);
|
||||
if (res != RESULT_OK)
|
||||
{
|
||||
if (res == RESULT_DIR_LEVEL_OVER)break;
|
||||
if (res == RESULT_PATH_LENGTH_OVER)break;
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
if (file_pathw[0] == 0)break;//root then end
|
||||
if (ct>=arcInfo.FileCount)
|
||||
{//カウンタ壊れ、メモリフローの可能性
|
||||
res = RESULT_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
if (exsave.Open(file_pathw)==false)
|
||||
{
|
||||
res = RESULT_FAIL_OPEN;
|
||||
break;
|
||||
}
|
||||
fsize = exsave.FileSize;
|
||||
total += fsize;
|
||||
|
||||
int rev = 0;
|
||||
while(1){
|
||||
if (savedata.OpenC(file_pathw,fsize,&mkdir)==false)
|
||||
{
|
||||
if(mkdir)//ディレクトリのみ作成
|
||||
{//深い場合に作成が多いと画面が止まるので
|
||||
rev++;
|
||||
if (rev & 1)scr_MessOnCount2("Create Directry -");
|
||||
else scr_MessOnCount2("Create Directry |");
|
||||
|
||||
}else{
|
||||
res = RESULT_FAIL_OPENW;
|
||||
//exsave.Close();
|
||||
break;
|
||||
}
|
||||
}else break;
|
||||
}
|
||||
if (res != RESULT_OK)break;
|
||||
|
||||
msize = fsize;
|
||||
int itvl = 0;
|
||||
while(fsize)
|
||||
{
|
||||
if(msize > FILEBUFF_SIZE * 2){
|
||||
scr_CountPerMax2(msize-fsize,msize,0);
|
||||
if (++itvl & 1)scr_Status("file copying |",COLOR_PARPL);
|
||||
else scr_Status("file copying -",COLOR_PARPL);
|
||||
}else scr_MessOnCount2("");
|
||||
|
||||
if (fsize>FILEBUFF_SIZE)
|
||||
{
|
||||
rsize = FILEBUFF_SIZE;
|
||||
fsize -= FILEBUFF_SIZE;
|
||||
}else{
|
||||
rsize = fsize;
|
||||
fsize = 0;
|
||||
}
|
||||
if(exsave.Read(fileBuffer,rsize) != rsize )
|
||||
{
|
||||
res = RESULT_FAIL_READ;
|
||||
break;
|
||||
}
|
||||
if(savedata.Write(fileBuffer,rsize) != rsize )
|
||||
{
|
||||
res = RESULT_FAIL_WRITE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
savedata.CloseW();
|
||||
exsave.Close();
|
||||
ct++;
|
||||
}
|
||||
savedata.Close();
|
||||
exsave.CloseW();
|
||||
}
|
||||
savedata.Commit();
|
||||
savedata.Unmount();
|
||||
exsave.Unmount();
|
||||
scr_CountPerMax(ct,arcInfo.FileCount);
|
||||
scr_CountPerMax2(0,0,total);
|
||||
|
||||
//結果
|
||||
switch(res){
|
||||
case RESULT_OK:
|
||||
if (Verifi()==false)return ERROR;
|
||||
if(exsave.Delete()){//バックアップを削除
|
||||
scr_Status("Complate",COLOR_WHITE);
|
||||
return SUCCESS;
|
||||
}
|
||||
case RESULT_FAIL_WRITE:
|
||||
case RESULT_FAIL_OPENW:
|
||||
PutError(ERC_DEV_CARD);
|
||||
return ERROR;
|
||||
case RESULT_FAIL_READ:
|
||||
case RESULT_FAIL_OPEN:
|
||||
PutError(ERC_DEV_OUT);
|
||||
return ERROR;
|
||||
}
|
||||
//その他、実行時エラー
|
||||
PutError(ERC_DEV_OTHER);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------- セーブデータの情報取得
|
||||
//呼ぶ前に tmerr のクリアを忘れない事
|
||||
void CheckSaveDataState()
|
||||
{
|
||||
myResult myres;
|
||||
|
||||
Formatted = false;
|
||||
Active = false;
|
||||
|
||||
if (savedata.GetPrdCode())
|
||||
{
|
||||
Active = true;//カード
|
||||
myres = savedata.IsExist();//セーブマウント
|
||||
//NN_LOG("%d",savedata.LastNnResult.GetDescription());
|
||||
if (myres == RESULT_OK)
|
||||
{
|
||||
Formatted=true;
|
||||
}else{
|
||||
tmerr |= SDATA_ERRPUT_MEDIA;
|
||||
}
|
||||
}
|
||||
scr_PrdCode(savedata.PrdCode);
|
||||
//プロダクトコードのチェック
|
||||
isAgreePCode = strcmp(savedata.PrdCode,arcInfo.Pcode)==0;
|
||||
}
|
||||
|
||||
void CheckExSaveState()
|
||||
{
|
||||
exActive = true;//メモリなので常にtrue
|
||||
//if (exActive){
|
||||
exFormatted = exsave.IsExist() && exsave.GetInfo(&arcInfo);
|
||||
//todo:変更時はバージョンチェック入れる
|
||||
exsave.Unmount();
|
||||
//}else{
|
||||
////arcInfo.Pcode[0] = 0;
|
||||
// exFormatted = false;
|
||||
//}
|
||||
if (exFormatted==false) arcInfo.Pcode[0] = 0;
|
||||
scr_PrdCodeEx(arcInfo.Pcode);
|
||||
//プロダクトコードのチェック
|
||||
isAgreePCode = strcmp(savedata.PrdCode,arcInfo.Pcode)==0;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------- 入力待ち
|
||||
void WaitUI()
|
||||
{
|
||||
tmerr = 0;
|
||||
scr_Draw();//画面更新
|
||||
scr_evnt = EVNT_NONE;
|
||||
while(scr_evnt == EVNT_NONE)
|
||||
{
|
||||
nn::os::Thread::Yield();//スレッド実行
|
||||
//scr_GetEvnt();//入力イベント
|
||||
|
||||
CheckSysBreak();//中断処理
|
||||
|
||||
//挿抜を検知したら中断して抜ける
|
||||
//トップ以外ではトップメニューへ戻るようする
|
||||
if (ejectEvnt.TryWait()){
|
||||
CheckSaveDataState();
|
||||
isInsEject = InEx_EjcCard;
|
||||
return;
|
||||
}
|
||||
if (insEvnt.TryWait()){
|
||||
CheckSaveDataState();
|
||||
isInsEject = InEx_InsCard;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ScrClr();//画面消去
|
||||
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(500));//チャタ対策
|
||||
}
|
||||
|
||||
tColStr mess_ReadError = {"[Read] is failed",COLOR_RED};
|
||||
tColStr mess_WriteError = {"[Write] is failed",COLOR_RED};
|
||||
tColStr mess_ReadOk = {"[Read] is Success",COLOR_GREEN};
|
||||
tColStr mess_WriteOk = {"[Write] is Success",COLOR_GREEN};
|
||||
tColStr mess_PullOut = {"Pull Out",COLOR_RED};
|
||||
tColStr mess_ChkDev = {"check device",COLOR_RED};
|
||||
tColStr mess_Insexit = {"Detect Insert or pull out",COLOR_RED};
|
||||
tColStr mess_WhenExc = {"When you exchange device",COLOR_WHITE};
|
||||
tColStr mess_PoffSys = {"PowerOff or return Top Menu",COLOR_WHITE};
|
||||
|
||||
//---------------------- main loop --------------------------
|
||||
void nnMain()
|
||||
{
|
||||
int i;
|
||||
myResult mres;
|
||||
RetCode retc;
|
||||
//tColStr *colstr[4];
|
||||
//colstr[2] = &mess_WhenExc;
|
||||
//colstr[3] = &mess_PoffSys;
|
||||
isInsEject = InEx_None;
|
||||
|
||||
//NN_LOG("Start\n");
|
||||
nn::os::Initialize();
|
||||
nn::fs::Initialize();
|
||||
|
||||
//DEA-SUPにて推奨のフリーズ暫定対策:無線デーモンを停止 (2011.3.1 現在)
|
||||
//ただし、スリープ時は止まらない
|
||||
//心配なら本体スイッチで切っとく
|
||||
nn::ndm::Initialize();
|
||||
nn::ndm::SuspendScheduler();
|
||||
|
||||
//中断処理の準備
|
||||
InitSysBreak((uptr)endfunc);
|
||||
// グラフィックスライブラリの初期化は、以降で行わなければならない
|
||||
// 他、アプリケーションの初期化処理
|
||||
|
||||
nn::applet::DisableSleep();//スリープ非対応
|
||||
|
||||
//Heap
|
||||
appHeap.Initialize(nn::os::GetDeviceMemoryAddress(),
|
||||
nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR);
|
||||
const u32 GxHeapSize = 0x800000;
|
||||
heapForGx = reinterpret_cast<uptr>(appHeap.Allocate(GxHeapSize));
|
||||
//画面初期化
|
||||
if (ScrInitialize(heapForGx,GxHeapSize) == false)failstop();
|
||||
ejectEvnt.ClearSignal();
|
||||
insEvnt.ClearSignal();
|
||||
nn::fs::RegisterCardEjectedEvent(&ejectEvnt);
|
||||
nn::fs::RegisterCardInsertedEvent(&insEvnt);
|
||||
|
||||
// スリープ要求に対する返答を有効にする
|
||||
// また、蓋の状態チェックを行い蓋が閉じられているならスリープ要求が発生する
|
||||
//nn::applet::EnableSleep(true);
|
||||
|
||||
extern u8 scr_evnt;
|
||||
while(1)
|
||||
{
|
||||
tmerr = 0;
|
||||
CheckSaveDataState(); //セーブデータの状態取得
|
||||
CheckExSaveState(); //同バックアップ
|
||||
if (isAgreePCode==false) tmerr |= SDATA_ERRPUT_PCODE;
|
||||
// scr_TopMenu(Formatted,Active,exFormatted,exActive,isAgreePCode,failveri);
|
||||
scr_TopMenu(Formatted,Active,exFormatted,exActive,tmerr);
|
||||
|
||||
|
||||
WaitUI();//入力待ち
|
||||
if (isInsEject != InEx_None){
|
||||
ScrClr();//画面消去
|
||||
isInsEject= InEx_None;
|
||||
}else
|
||||
switch(scr_evnt)
|
||||
{
|
||||
case EVNT_PUSH_B:
|
||||
case EVNT_NONE:
|
||||
break;
|
||||
case EVNT_PUSH_Y:
|
||||
break;
|
||||
case EVNT_SEL_READ://リード
|
||||
NN_LOG("select read\n");
|
||||
retc = Card2Sd();
|
||||
switch (retc){
|
||||
case SUCCESS:
|
||||
//CheckExSaveState(); //状態の更新
|
||||
scr_ResultQuit("Success",COLOR_GREEN);//成功とQuitボタン
|
||||
break;
|
||||
case INSEXIT:
|
||||
//scr_InsExitQuit();//挿抜検知表示 & Quit
|
||||
ScrClr();//画面消去
|
||||
scr_Backup();
|
||||
{
|
||||
if (isInsEject == InEx_EjcCard)PutError(ERC_DEV_CARD,ERC_DEVICE);
|
||||
else PutError(ERC_DEV_OTHER);
|
||||
scr_ResultQuit("Break",COLOR_RED);//エラーとQuitボタン
|
||||
}
|
||||
break;
|
||||
case CANCEL:
|
||||
//scr_ResultQuit("Canseled",COLOR_YELLO);//キャンセル
|
||||
break;
|
||||
default://errors
|
||||
scr_ResultQuit("Failed",COLOR_RED);//エラーとQuitボタン
|
||||
break;
|
||||
}
|
||||
if (retc == CANCEL)break;
|
||||
//isInsEject = InEx_None;
|
||||
while(1){
|
||||
WaitUI();
|
||||
if (isInsEject != InEx_None){
|
||||
isInsEject = InEx_None;
|
||||
}
|
||||
if(scr_evnt==EVNT_QUIT)break;
|
||||
if(scr_evnt==EVNT_PUSH_B)break;
|
||||
}
|
||||
break;
|
||||
case EVNT_SEL_WRITE://リストア
|
||||
NN_LOG("select write\n");
|
||||
retc = Sd2Card();
|
||||
switch (retc){
|
||||
case SUCCESS:
|
||||
//CheckSaveDataState(); //状態の更新
|
||||
//CheckExSaveState();
|
||||
scr_ResultQuit("Success",COLOR_GREEN);//成功とQuitボタン
|
||||
break;
|
||||
case INSEXIT:
|
||||
//scr_InsExitQuit();//挿抜検知表示 & Quit
|
||||
ScrClr();//画面消去
|
||||
scr_Backup();
|
||||
{
|
||||
if (isInsEject == InEx_EjcCard)PutError(ERC_DEV_CARD,ERC_DEVICE);
|
||||
else PutError(ERC_DEV_OTHER);
|
||||
scr_ResultQuit("Break",COLOR_RED);//エラーとQuitボタン
|
||||
}
|
||||
break;
|
||||
case CANCEL:
|
||||
//scr_ResultQuit("Canseled",COLOR_YELLO);//キャンセル
|
||||
break;
|
||||
default://errors
|
||||
scr_ResultQuit("Failed",COLOR_RED);//エラーとQuitボタン
|
||||
break;
|
||||
}
|
||||
if (retc == CANCEL)break;
|
||||
while(1){
|
||||
WaitUI();
|
||||
if (isInsEject != InEx_None){
|
||||
isInsEject= InEx_None;
|
||||
}
|
||||
if(scr_evnt==EVNT_QUIT)break;
|
||||
if(scr_evnt==EVNT_PUSH_B)break;
|
||||
}
|
||||
break;
|
||||
/* case EVNT_SEL_END:
|
||||
NN_LOG("select end\n");
|
||||
finish();
|
||||
break;
|
||||
case EVNT_NO:
|
||||
NN_LOG("select NO\n");
|
||||
break;
|
||||
case EVNT_YES:
|
||||
NN_LOG("select YES\n");
|
||||
break;
|
||||
*/
|
||||
//old debug key
|
||||
case EVNT_PUSH_L:// ------------------------------- 表示の切り替え
|
||||
case EVNT_PUSH_DOWN_Y:// ---------------------------------- 表示の切り替え
|
||||
break;
|
||||
|
||||
case EVNT_PUSH_LEFT_X:// ------------------------------------- LEFT + X
|
||||
//バックアップ削除
|
||||
scr_DelConf();//実行確認
|
||||
WaitUI();
|
||||
if (scr_evnt != EVNT_YES)break;
|
||||
exsave.Delete();
|
||||
//CheckExSaveState(); //状態更新
|
||||
break;
|
||||
|
||||
case EVNT_PUSH_R:// ------------------------------------------- R
|
||||
//CARD(NAND)へテストファイル書き込み
|
||||
//デバグモード時のみ
|
||||
bool flg;
|
||||
scr_ConfirmDbg("dummy savedata write OK?");//実行確認
|
||||
WaitUI();
|
||||
if (scr_evnt != EVNT_YES)break;
|
||||
for ( i =0;i<FILEBUFF_SIZE;i++)fileBuffer[i] = (char)i;
|
||||
|
||||
//セーブデータのフォーマット&マウント
|
||||
arcInfo.FileEntry = 10;
|
||||
arcInfo.DirEntry = 10;
|
||||
arcInfo.Dup = false;
|
||||
mres = savedata.Format(&arcInfo);
|
||||
if(mres != RESULT_OK)break;
|
||||
|
||||
i= 2;
|
||||
while(i){
|
||||
sprintf(file_path,"dir%d/file%d",i,i);
|
||||
mbstowcs(file_pathw,file_path,510);
|
||||
if (savedata.OpenC(file_pathw,FILEBUFF_SIZE,&flg)==false)break;
|
||||
if(savedata.Write(fileBuffer,FILEBUFF_SIZE)!=FILEBUFF_SIZE)break;
|
||||
savedata.CloseW();
|
||||
i--;
|
||||
}
|
||||
i=2;
|
||||
while(i){
|
||||
sprintf(file_path,"dir%d/dir%d/file%d",i,i,i);
|
||||
mbstowcs(file_pathw,file_path,510);
|
||||
if (savedata.OpenC(file_pathw,FILEBUFF_SIZE,&flg)==false)break;
|
||||
if(savedata.Write(fileBuffer,FILEBUFF_SIZE)!=FILEBUFF_SIZE)break;
|
||||
savedata.CloseW();
|
||||
|
||||
sprintf(file_path,"dir%d/dir%d/file%d",i,i,i+2);
|
||||
mbstowcs(file_pathw,file_path,510);
|
||||
if (savedata.OpenC(file_pathw,FILEBUFF_SIZE,&flg)==false)break;
|
||||
if(savedata.Write(fileBuffer,FILEBUFF_SIZE)!=FILEBUFF_SIZE)break;
|
||||
savedata.CloseW();
|
||||
i--;
|
||||
}
|
||||
savedata.CloseW();
|
||||
savedata.Commit();
|
||||
savedata.Unmount();
|
||||
//CheckSaveDataState(); //カード状態更新
|
||||
break;
|
||||
default:
|
||||
failstop();
|
||||
break;
|
||||
}
|
||||
}//while()
|
||||
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
End of file
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,749 +0,0 @@
|
||||
#include <nn.h>
|
||||
#include <stdio.h>
|
||||
#include "screen.h"
|
||||
#include "../../../../common/my_defs.h"
|
||||
#include "../../ver.h"
|
||||
|
||||
|
||||
Gui gui;
|
||||
u8 scr_evnt;
|
||||
|
||||
enum{
|
||||
//PANEL_END,
|
||||
PANEL_ERROR,
|
||||
PANEL_SUCCESS,
|
||||
PANEL_TOPMENU,
|
||||
PANEL_TITLE,
|
||||
PANEL_QUIT,
|
||||
PANEL_READ,
|
||||
PANEL_WRITE,
|
||||
PANEL_YES,
|
||||
PANEL_NO,
|
||||
PANEL_CONFIRM,
|
||||
PANEL_DELCONF,
|
||||
PANEL_MENU,
|
||||
PANEL_BKUP,
|
||||
PANEL_INSEXIT,
|
||||
PANEL_DBGLOG
|
||||
};
|
||||
|
||||
enum{
|
||||
MESSAGE_VERSION,
|
||||
MESSAGE_PRODUCT,
|
||||
MESSAGE_PRODUCT2,
|
||||
MESSAGE_ERROR_TITLE,
|
||||
MESSAGE_ERROR_INFO,
|
||||
MESSAGE_ERROR_INFO2,
|
||||
MESSAGE_ERROR_INFO3,
|
||||
MESSAGE_SUCCESS_TITLE,
|
||||
MESSAGE_SUCCESS_INFO,
|
||||
MESSAGE_SUCCESS_INFO2,
|
||||
MESSAGE_CONFIRM_TITLE,
|
||||
MESSAGE_CONFIRM_MSG,
|
||||
MESSAGE_DELCONF_TITLE,
|
||||
MESSAGE_DELCONF_MSG,
|
||||
MESSAGE_DELCONF_MSG2,
|
||||
MESSAGE_DELCONF_MSG3,
|
||||
//MESSAGE_TOPMENU_HELP_TITLE,
|
||||
MESSAGE_TOPMENU_HELP_READ,
|
||||
MESSAGE_TOPMENU_HELP_WRITE,
|
||||
MESSAGE_TOPMENU_HELP_END,
|
||||
MESSAGE_TOPMENU_HELP_OPERATE,
|
||||
MESSAGE_TITLE,
|
||||
MESSAGE_MENU_READ,
|
||||
MESSAGE_MENU_WRITE,
|
||||
//MESSAGE_MENU_END,
|
||||
MESSAGE_MENU_OPERATE,
|
||||
MESSAGE_MENU_CAUTION,
|
||||
MESSAGE_MENU_ERROR,
|
||||
MESSAGE_MENU_DEBUG,
|
||||
MESSAGE_INSEXT_1,
|
||||
MESSAGE_INSEXT_2,
|
||||
MESSAGE_INSEXT_3,
|
||||
MESSAGE_OPERATE,
|
||||
MESSAGE_RESULT,
|
||||
MESSAGE_QUIT_OPERATE,
|
||||
MESSAGE_CONF,
|
||||
MESSAGE_COUNT,
|
||||
MESSAGE_COUNT2,
|
||||
MESSAGE_STATUS
|
||||
};
|
||||
|
||||
enum{
|
||||
MEMO_DBGLOG
|
||||
};
|
||||
|
||||
|
||||
//画面消去、コンポーネントをディセーブル
|
||||
void ScrClr()
|
||||
{
|
||||
gui.ButtonMask(0);
|
||||
gui.DisableAll();
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
nn::os::Tick holdTck;
|
||||
u32 holdVal;
|
||||
//---------------------------------イベントコールバック
|
||||
//----------------PADボタン
|
||||
void pushButton(u32 sts)
|
||||
{
|
||||
//NN_LOG("button > %4x\n",button);
|
||||
u32 trg = sts & 0x0ffff;
|
||||
u32 hld = sts >> 16;
|
||||
|
||||
if( holdVal )//押し続け判定
|
||||
{
|
||||
if (hld != holdVal)
|
||||
{
|
||||
holdVal = 0;
|
||||
}else
|
||||
if (nn::fnd::TimeSpan::FromMilliSeconds(4000) < (nn::os::Tick::GetSystemCurrent()-holdTck))
|
||||
{
|
||||
holdVal = 0;
|
||||
scr_evnt = EVNT_PUSH_LEFT_X;
|
||||
}
|
||||
}else if (hld == ( nn::hid::BUTTON_LEFT | nn::hid::BUTTON_X ))
|
||||
{
|
||||
holdVal = hld;
|
||||
holdTck = nn::os::Tick::GetSystemCurrent();
|
||||
}
|
||||
else if (trg & nn::hid::BUTTON_B)scr_evnt = EVNT_PUSH_B;
|
||||
}
|
||||
|
||||
//-----------------パネルをタッチ
|
||||
// ---- Top Menu :READ
|
||||
void touchRead(u32 pos NN_IS_UNUSED_VAR)
|
||||
{
|
||||
scr_evnt = EVNT_SEL_READ;
|
||||
}
|
||||
// ---- Top Menu :WRITE
|
||||
void touchWrite(u32 pos NN_IS_UNUSED_VAR)
|
||||
{
|
||||
scr_evnt = EVNT_SEL_WRITE;
|
||||
}
|
||||
|
||||
//---- Top Menu :END
|
||||
//void touchEnd(u32 pos NN_IS_UNUSED_VAR)
|
||||
//{
|
||||
// scr_evnt = EVNT_SEL_END;
|
||||
//}
|
||||
|
||||
//---- YES
|
||||
void touchYes(u32 pos NN_IS_UNUSED_VAR)
|
||||
{
|
||||
scr_evnt = EVNT_YES;
|
||||
}
|
||||
|
||||
//---- NO
|
||||
void touchNo(u32 pos NN_IS_UNUSED_VAR)
|
||||
{
|
||||
scr_evnt = EVNT_NO;
|
||||
}
|
||||
|
||||
void touchQuit(u32 pos NN_IS_UNUSED_VAR)
|
||||
{
|
||||
scr_evnt = EVNT_QUIT;
|
||||
}
|
||||
|
||||
#define NULL_PTR 0
|
||||
#define NULL_STR 0
|
||||
#define SCREEN_UPPER 0
|
||||
#define SCREEN_LOWER 1
|
||||
#define LOC_CONF_X 60
|
||||
#define LOC_CONF_Y 20
|
||||
#define LOC_CONF_W (400 - LOC_CONF_X*2)
|
||||
#define LOC_CONF_H 70
|
||||
#define LOC_LOG_X 50
|
||||
#define LOC_LOG_W (400 - LOC_LOG_X*2)
|
||||
#define LOC_LOG_Y (LOC_CONF_Y + LOC_CONF_H + 10)
|
||||
#define LOC_LOG_H (240 - LOC_LOG_Y - 10)
|
||||
#define LOG_MAX 10
|
||||
|
||||
// -------------------------------------------------- コンポーネント設計
|
||||
//下画面
|
||||
|
||||
//Top Menu
|
||||
const tPanel panel_Read = {(uptr)touchRead,"Backup",80+20,30,160,80,PANEL_READ,SCREEN_LOWER};
|
||||
const tPanel panel_Write = {(uptr)touchWrite,"Restore",80+20,130,160,80,PANEL_WRITE,SCREEN_LOWER};
|
||||
//const tPanel panel_End = {(uptr)touchEnd,"End",80,180,160,30,PANEL_END,SCREEN_LOWER};
|
||||
|
||||
//Yes No
|
||||
const tPanel panel_Yes = {(uptr)touchYes,"YES",40+10,60,80,120,PANEL_YES,SCREEN_LOWER};
|
||||
const tPanel panel_No = {(uptr)touchNo,"NO",200+30,60,80,120,PANEL_NO,SCREEN_LOWER};
|
||||
|
||||
//Quit
|
||||
const tPanel panel_Quit = {(uptr)touchQuit,"Quit",80+20,60,160,120,PANEL_QUIT,SCREEN_LOWER};
|
||||
|
||||
//上画面
|
||||
//デバグ用
|
||||
//エラー表示
|
||||
const tPanel panel_Error = {NULL_PTR,NULL_STR,LOC_CONF_X,LOC_CONF_Y,LOC_CONF_W,LOC_CONF_H,PANEL_ERROR,SCREEN_UPPER};
|
||||
const tMessage mess_Title_Err = {"title",10,10,COLOR_RED,8,MESSAGE_ERROR_TITLE,PANEL_ERROR};
|
||||
const tMessage mess_Info_Err = {"info",10,22,COLOR_RED,8,MESSAGE_ERROR_INFO,PANEL_ERROR};
|
||||
const tMessage mess_Info2_Err = {"info2",10,40,COLOR_RED,8,MESSAGE_ERROR_INFO2,PANEL_ERROR};
|
||||
const tMessage mess_Info3_Err = {"info3",10,50,COLOR_RED,8,MESSAGE_ERROR_INFO3,PANEL_ERROR};
|
||||
|
||||
//成功
|
||||
const tPanel panel_Success = {NULL_PTR,NULL_STR,LOC_CONF_X,LOC_CONF_Y,LOC_CONF_W,LOC_CONF_H,PANEL_SUCCESS,SCREEN_UPPER};
|
||||
const tMessage mess_Title_Suc = {"title",10,10,COLOR_GREEN,8,MESSAGE_SUCCESS_TITLE,PANEL_SUCCESS};
|
||||
const tMessage mess_Info_Suc = {"info",10,40,COLOR_WHITE,8,MESSAGE_SUCCESS_INFO,PANEL_SUCCESS};
|
||||
const tMessage mess_Info2_Suc = {"info2",10,50,COLOR_WHITE,8,MESSAGE_SUCCESS_INFO2,PANEL_SUCCESS};
|
||||
|
||||
//実行確認
|
||||
const tPanel panel_Confirm = {NULL_PTR,NULL_STR,LOC_CONF_X,LOC_CONF_Y,LOC_CONF_W,LOC_CONF_H,PANEL_CONFIRM,SCREEN_UPPER};
|
||||
const tMessage mess_conf_Title = {"title",10,10,COLOR_YELLO,8,MESSAGE_CONFIRM_TITLE,PANEL_CONFIRM};
|
||||
const tMessage mess_conf_Msg = {"Do you execute?",10,40,COLOR_WHITE,8,MESSAGE_CONFIRM_MSG,PANEL_CONFIRM};
|
||||
|
||||
//トップメニュー
|
||||
const tPanel panel_topmenu_help = {NULL_PTR,NULL_STR,LOC_CONF_X,LOC_CONF_Y,LOC_CONF_W,LOC_CONF_H,PANEL_TOPMENU,SCREEN_UPPER};
|
||||
const tMessage mess_topmenu_help_read = {"[Backup] Card -> bkup",10,4,COLOR_WHITE,8,MESSAGE_TOPMENU_HELP_READ,PANEL_TOPMENU};
|
||||
const tMessage mess_topmenu_help_notread = {"[Backup] is Invalid",10,4,COLOR_RED,8,MESSAGE_TOPMENU_HELP_READ,PANEL_TOPMENU};
|
||||
const tMessage mess_topmenu_help_write = {"[Restore] bkup -> Card",10,16,COLOR_WHITE,8,MESSAGE_TOPMENU_HELP_WRITE,PANEL_TOPMENU};
|
||||
const tMessage mess_topmenu_help_notwrite = {"[Restore] is Invalid",10,16,COLOR_RED,8,MESSAGE_TOPMENU_HELP_WRITE,PANEL_TOPMENU};
|
||||
const tMessage mess_topmenu_help_end = {"[End] return to SystemMenu",10,28,COLOR_WHITE,8,MESSAGE_TOPMENU_HELP_END,PANEL_TOPMENU};
|
||||
const tMessage mess_topmenu_help_operate = {"touch below",10,48,COLOR_GREEN,8,MESSAGE_TOPMENU_HELP_OPERATE,PANEL_TOPMENU};
|
||||
|
||||
//ログ表示
|
||||
const tPanel panel_dbglog = {NULL_PTR,NULL_STR,LOC_LOG_X,LOC_LOG_Y,LOC_LOG_W,LOC_LOG_H,PANEL_DBGLOG,SCREEN_UPPER};
|
||||
const tMemo memo_dbglog = {LOG_MAX,10,10,COLOR_WHITE,8,MEMO_DBGLOG,PANEL_DBGLOG};
|
||||
|
||||
|
||||
//通常時
|
||||
//タイトル
|
||||
#define FONT_SIZE_TITLE 12
|
||||
#define LOC_TITL_X (40-FONT_SIZE_TITLE*2)
|
||||
#define LOC_TITL_Y 20
|
||||
#define LOC_TITL_W (400 - LOC_CONF_X*2)
|
||||
#define LOC_TITL_H 50
|
||||
#define FONT_SIZE_PRODUCT 10
|
||||
const tPanel panel_title = {NULL_PTR,NULL_STR,LOC_TITL_X,LOC_TITL_Y,LOC_TITL_W,LOC_TITL_H,PANEL_TITLE,SCREEN_UPPER};
|
||||
const tMessage mess_title = {"title",0,0,COLOR_WHITE,FONT_SIZE_TITLE,MESSAGE_TITLE,PANEL_TITLE};
|
||||
const tMessage mess_product = {"product",0,LOC_TITL_H - 22,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_PRODUCT,PANEL_TITLE};
|
||||
const tMessage mess_product2 = {"product2",0,LOC_TITL_H - 10,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_PRODUCT2,PANEL_TITLE};
|
||||
const tMessage mess_version = {"version",LOC_TITL_W-FONT_SIZE_PRODUCT*6,FONT_SIZE_TITLE+2,COLOR_WHITE,FONT_SIZE_PRODUCT,MESSAGE_VERSION,PANEL_TITLE};
|
||||
|
||||
#define LOC_MESS_X 20
|
||||
#define LOC_MESS_W (400 - LOC_MESS_X*2)
|
||||
#define LOC_MESS_Y (LOC_TITL_Y + LOC_TITL_H + 10)
|
||||
#define LOC_MESS_H (240 - LOC_MESS_Y - 10)
|
||||
//TOPメニュー
|
||||
//情報表示はログと排他
|
||||
#define FONT_SIZE 10
|
||||
#define STR_LINE(ln) (FONT_SIZE + 2)*ln
|
||||
const tPanel panel_menu = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_MENU,SCREEN_UPPER};
|
||||
const tMessage mess_menu_read = {"[Backup] Card savedata Backup",10,STR_LINE(1),COLOR_WHITE,FONT_SIZE,MESSAGE_MENU_READ,PANEL_MENU};
|
||||
const tMessage mess_menu_write = {"[Restore] restore to Card",10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_MENU_WRITE,PANEL_MENU};
|
||||
//const tMessage mess_menu_end = {"[End] close this apprication",10,STR_LINE(3),COLOR_WHITE,FONT_SIZE,MESSAGE_MENU_END,PANEL_MENU};
|
||||
const tMessage mess_menu_operate = {"touch below",10,STR_LINE(4),COLOR_GREEN,FONT_SIZE,MESSAGE_MENU_OPERATE,PANEL_MENU};
|
||||
const tMessage mess_bkuperr = {"Backup error",10,STR_LINE(6),COLOR_RED,FONT_SIZE,MESSAGE_MENU_ERROR,PANEL_MENU};
|
||||
const tMessage mess_carderr = {"CARD error",10,STR_LINE(7),COLOR_YELLO,FONT_SIZE,MESSAGE_MENU_CAUTION,PANEL_MENU};
|
||||
const tMessage mess_debug = {"Crush Mode",10,STR_LINE(3),COLOR_YELLO,FONT_SIZE,MESSAGE_MENU_DEBUG,PANEL_MENU};
|
||||
|
||||
//Backup
|
||||
//const tPanel panel_bkup = {NULL_PTR,NULL_STR,LOC_LOG_X,LOC_LOG_Y,LOC_LOG_W,LOC_LOG_H,PANEL_BKUP,SCREEN_UPPER};
|
||||
const tPanel panel_bkup = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_BKUP,SCREEN_UPPER};
|
||||
const tMessage mess_quit_operate = {"touch [Quit],or Push B",10,STR_LINE(4),COLOR_SKY,FONT_SIZE,MESSAGE_QUIT_OPERATE,PANEL_BKUP};
|
||||
const tMessage mess_conf = {"Do you execute?",10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_CONF,PANEL_BKUP};
|
||||
const tMessage mess_result = {"result",10,STR_LINE(2),COLOR_WHITE,FONT_SIZE,MESSAGE_RESULT,PANEL_BKUP};
|
||||
const tMessage mess_operate = {"touch below",10,STR_LINE(4),COLOR_GREEN,FONT_SIZE,MESSAGE_OPERATE,PANEL_BKUP};
|
||||
const tMessage mess_status = {"status",10,STR_LINE(7),COLOR_WHITE,FONT_SIZE,MESSAGE_STATUS,PANEL_BKUP};
|
||||
const tMessage mess_count = {"count",10,STR_LINE(8),COLOR_WHITE,FONT_SIZE,MESSAGE_COUNT,PANEL_BKUP};
|
||||
const tMessage mess_count2 = {"count2",10,STR_LINE(9),COLOR_GREEN,FONT_SIZE,MESSAGE_COUNT2,PANEL_BKUP};
|
||||
|
||||
|
||||
//挿抜発生時
|
||||
//const tPanel panel_insexit = {NULL_PTR,NULL_STR,LOC_LOG_X,LOC_LOG_Y,LOC_LOG_W,LOC_LOG_H,PANEL_INSEXIT,SCREEN_UPPER};
|
||||
const tPanel panel_insexit = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y,LOC_MESS_W,LOC_MESS_H,PANEL_INSEXIT,SCREEN_UPPER};
|
||||
const tMessage mess_insexit = {"device insert or pull out is detected",10,STR_LINE(3),COLOR_RED,8,MESSAGE_INSEXT_1,PANEL_INSEXIT};
|
||||
const tMessage mess_insexit2 = {"return to top menu",10,STR_LINE(5),COLOR_WHITE,8,MESSAGE_INSEXT_2,PANEL_INSEXIT};
|
||||
const tMessage mess_insexit3 = {"please touch or push B",10,STR_LINE(6),COLOR_WHITE,8,MESSAGE_INSEXT_3,PANEL_INSEXIT};
|
||||
|
||||
//削除確認
|
||||
//const tPanel panel_delconf = {NULL_PTR,NULL_STR,LOC_CONF_X-10,LOC_CONF_Y,LOC_CONF_W+10,LOC_CONF_H*2,PANEL_DELCONF,SCREEN_UPPER};
|
||||
const tPanel panel_delconf = {NULL_PTR,NULL_STR,LOC_MESS_X,LOC_MESS_Y-36,LOC_MESS_W,LOC_MESS_H,PANEL_DELCONF,SCREEN_UPPER};
|
||||
const tMessage mess_delconf_Title = {" *** DELETE *** ",10,10,COLOR_YELLO,16,MESSAGE_DELCONF_TITLE,PANEL_DELCONF};
|
||||
const tMessage mess_delconf_Msg = {" caution!",10,50,COLOR_YELLO,12,MESSAGE_DELCONF_MSG,PANEL_DELCONF};
|
||||
const tMessage mess_delconf_Msg2 = {"this is delete backup",10,70,COLOR_YELLO,12,MESSAGE_DELCONF_MSG2,PANEL_DELCONF};
|
||||
const tMessage mess_delconf_Msg3 = {"Do you execute?",10,90,COLOR_YELLO,12,MESSAGE_DELCONF_MSG3,PANEL_DELCONF};
|
||||
|
||||
|
||||
|
||||
nn::os::LightEvent stopEvnt(true);
|
||||
|
||||
char scr_ver[16];
|
||||
char scr_err[32];
|
||||
char scr_debug[32];
|
||||
//menu
|
||||
bool ScrInitialize(uptr heap,u32 size)
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
holdVal = 0;
|
||||
holdTck = nn::fnd::TimeSpan(0);
|
||||
|
||||
if (gui.Initialize(heap,size,&stopEvnt)==false)return false;
|
||||
|
||||
gui.ButtonCallback((uptr)pushButton);
|
||||
//コンポーネント登録
|
||||
gui.PanelSet(&panel_Read);
|
||||
gui.PanelSet(&panel_Write);
|
||||
// gui.PanelSet(&panel_End);
|
||||
gui.PanelSet(&panel_Yes);
|
||||
gui.PanelSet(&panel_No);
|
||||
gui.PanelSet(&panel_Quit);
|
||||
gui.PanelSet(&panel_Error);
|
||||
gui.PanelSet(&panel_Success);
|
||||
gui.PanelSet(&panel_Confirm);
|
||||
gui.PanelSet(&panel_delconf);
|
||||
gui.PanelSet(&panel_topmenu_help);
|
||||
gui.PanelSet(&panel_title);
|
||||
gui.PanelSet(&panel_menu);
|
||||
gui.PanelSet(&panel_bkup);
|
||||
gui.PanelSet(&panel_dbglog);
|
||||
gui.PanelSet(&panel_insexit);
|
||||
|
||||
gui.PanelLineStyle(PANEL_TITLE,COLOR_BLACK);
|
||||
|
||||
|
||||
gui.MessSet(&mess_Title_Err);
|
||||
gui.MessSet(&mess_Info_Err);
|
||||
gui.MessSet(&mess_Info2_Err);
|
||||
gui.MessSet(&mess_Info3_Err);
|
||||
gui.MessSet(&mess_Title_Suc);
|
||||
gui.MessSet(&mess_Info_Suc);
|
||||
gui.MessSet(&mess_Info2_Suc);
|
||||
gui.MessSet(&mess_conf_Title);
|
||||
gui.MessSet(&mess_conf_Msg);
|
||||
gui.MessSet(&mess_delconf_Title);
|
||||
gui.MessSet(&mess_delconf_Msg);
|
||||
gui.MessSet(&mess_delconf_Msg2);
|
||||
gui.MessSet(&mess_delconf_Msg3);
|
||||
|
||||
gui.MessSet(&mess_topmenu_help_read);
|
||||
gui.MessSet(&mess_topmenu_help_write);
|
||||
gui.MessSet(&mess_topmenu_help_end);
|
||||
gui.MessSet(&mess_topmenu_help_operate);
|
||||
|
||||
gui.MessSet(&mess_title);
|
||||
gui.MessSet(&mess_version);
|
||||
gui.MessSet(&mess_product);
|
||||
gui.MessSet(&mess_product2);
|
||||
gui.MessSet(&mess_menu_read);
|
||||
gui.MessSet(&mess_menu_write);
|
||||
// gui.MessSet(&mess_menu_end);
|
||||
gui.MessSet(&mess_menu_operate);
|
||||
gui.MessSet(&mess_quit_operate);
|
||||
gui.MessSet(&mess_conf);
|
||||
gui.MessSet(&mess_operate);
|
||||
gui.MessSet(&mess_bkuperr);
|
||||
gui.MessSet(&mess_carderr);
|
||||
gui.MessSet(&mess_debug);
|
||||
gui.MessSet(&mess_result);
|
||||
gui.MessSet(&mess_status);
|
||||
gui.MessSet(&mess_count);
|
||||
gui.MessSet(&mess_count2);
|
||||
|
||||
gui.MessSet(&mess_insexit);
|
||||
gui.MessSet(&mess_insexit2);
|
||||
gui.MessSet(&mess_insexit3);
|
||||
|
||||
gui.MemoSet(&memo_dbglog);
|
||||
|
||||
gui.MemoEffective(MESSAGE_PRODUCT);
|
||||
gui.MessEffective(MESSAGE_ERROR_TITLE);
|
||||
gui.MessEffective(MESSAGE_ERROR_INFO);
|
||||
gui.MessEffective(MESSAGE_ERROR_INFO2);
|
||||
gui.MessEffective(MESSAGE_ERROR_INFO3);
|
||||
gui.MessEffective(MESSAGE_SUCCESS_TITLE);
|
||||
gui.MessEffective(MESSAGE_SUCCESS_INFO);
|
||||
gui.MessEffective(MESSAGE_SUCCESS_INFO2);
|
||||
gui.MessEffective(MESSAGE_CONFIRM_TITLE);
|
||||
gui.MessEffective(MESSAGE_CONFIRM_MSG);
|
||||
gui.MessEffective(MESSAGE_DELCONF_TITLE);
|
||||
gui.MessEffective(MESSAGE_DELCONF_MSG);
|
||||
gui.MessEffective(MESSAGE_DELCONF_MSG2);
|
||||
gui.MessEffective(MESSAGE_DELCONF_MSG3);
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_READ);
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_WRITE);
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_END);
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_OPERATE);
|
||||
gui.MessEffective(MESSAGE_MENU_READ);
|
||||
gui.MessEffective(MESSAGE_MENU_WRITE);
|
||||
// gui.MessEffective(MESSAGE_MENU_END);
|
||||
gui.MessEffective(MESSAGE_MENU_OPERATE);
|
||||
gui.MessEffective(MESSAGE_INSEXT_1);
|
||||
gui.MessEffective(MESSAGE_INSEXT_2);
|
||||
gui.MessEffective(MESSAGE_INSEXT_3);
|
||||
gui.MessEffective(MESSAGE_TITLE);
|
||||
gui.MessEffective(MESSAGE_VERSION);
|
||||
gui.MemoEffective(MEMO_DBGLOG);
|
||||
|
||||
gui.PanelLineStyle(PANEL_DELCONF,COLOR_YELLO);
|
||||
|
||||
sprintf(scr_ver,"ver %.2f",VERSION);
|
||||
gui.MessStr(MESSAGE_VERSION,scr_ver);
|
||||
gui.MessStr(MESSAGE_MENU_CAUTION,scr_err);
|
||||
gui.MessStr(MESSAGE_MENU_ERROR,scr_err);
|
||||
gui.MessStr(MESSAGE_MENU_DEBUG,scr_debug);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
void ScrFinalize()
|
||||
{
|
||||
stopEvnt.Signal();
|
||||
while(stopEvnt.TryWait()){
|
||||
nn::os::Thread::Yield();
|
||||
|
||||
};
|
||||
gui.Finalize();
|
||||
}
|
||||
|
||||
//YES-NO ボタン
|
||||
void YesNo()
|
||||
{
|
||||
gui.ButtonMask(nn::hid::BUTTON_A | nn::hid::BUTTON_B);
|
||||
gui.PanelEffective(PANEL_YES);
|
||||
gui.PanelEffective(PANEL_NO);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
void Quit()
|
||||
{
|
||||
gui.ButtonMask(nn::hid::BUTTON_A | nn::hid::BUTTON_B);
|
||||
gui.PanelEffective(PANEL_QUIT);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
|
||||
//トップメニュー画面
|
||||
//引数:カード状態
|
||||
void scr_TopMenuDbg(bool formatted,bool insertted)//デバッグ用
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.ButtonMask(nn::hid::BUTTON_A | nn::hid::BUTTON_R | nn::hid::BUTTON_L);
|
||||
|
||||
if (formatted)
|
||||
{//リード可能
|
||||
gui.MessSet(&mess_topmenu_help_read);
|
||||
gui.PanelEffective(PANEL_READ);
|
||||
}else{//リード不可
|
||||
gui.MessSet(&mess_topmenu_help_notread);
|
||||
gui.PanelEffective(PANEL_READ,false);
|
||||
}
|
||||
if (insertted)
|
||||
{//書き込み可
|
||||
gui.MessSet(&mess_topmenu_help_write);
|
||||
gui.PanelEffective(PANEL_WRITE);
|
||||
}else{//書き込み不可
|
||||
gui.MessSet(&mess_topmenu_help_notwrite);
|
||||
gui.PanelEffective(PANEL_WRITE,false);
|
||||
}
|
||||
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_READ);
|
||||
gui.MessEffective(MESSAGE_TOPMENU_HELP_WRITE);
|
||||
// gui.PanelEffective(PANEL_END);
|
||||
gui.PanelEffective(PANEL_TOPMENU);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
//通常時
|
||||
|
||||
//プロダクトコード
|
||||
//引数:カード、拡張セーブに記録されたもの
|
||||
char scr_pcode[32];
|
||||
void scr_PrdCode(char *s)
|
||||
{
|
||||
strcpy(scr_pcode,"CARD : ");
|
||||
if (s[0]==0) strcat(scr_pcode,"----");
|
||||
else strcat(scr_pcode,s);
|
||||
gui.MessStr(MESSAGE_PRODUCT,scr_pcode);
|
||||
}
|
||||
|
||||
char scr_pcode2[64];
|
||||
void scr_PrdCodeEx(char *s)
|
||||
{
|
||||
strcpy(scr_pcode2,"BKUP : ");
|
||||
if (s[0]==0) strcat(scr_pcode2,"----");
|
||||
else strcat(scr_pcode2,s);
|
||||
gui.MessStr(MESSAGE_PRODUCT2,scr_pcode2);
|
||||
}
|
||||
|
||||
//削除の実行確認
|
||||
void scr_DelConf()
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.PanelEffective(PANEL_DELCONF);
|
||||
YesNo();
|
||||
}
|
||||
|
||||
|
||||
//Top menu
|
||||
//引数:デバイス状態
|
||||
//arg : プロダクトコード一致
|
||||
void scr_TopMenu(bool formatted,bool inserted,bool exfm,bool bkupins,int err)
|
||||
{
|
||||
|
||||
int i;
|
||||
scr_evnt = EVNT_NONE;
|
||||
|
||||
u32 mask = 0;
|
||||
mask |= (nn::hid::BUTTON_LEFT | nn::hid::BUTTON_X);//LEFT+X = Delete 有効
|
||||
|
||||
gui.MessStr(MESSAGE_TITLE," < CTR Card Savedata Mover >");
|
||||
|
||||
gui.MessEffective(MESSAGE_MENU_ERROR,false,false);
|
||||
gui.MessEffective(MESSAGE_MENU_CAUTION,false,false);
|
||||
gui.MessEffective(MESSAGE_MENU_OPERATE,false,false);
|
||||
//片方のみ有効
|
||||
if (formatted && bkupins && (exfm == false))
|
||||
{//バックアップ
|
||||
gui.MessEffective(MESSAGE_MENU_OPERATE);
|
||||
gui.PanelEffective(PANEL_READ);
|
||||
gui.PanelEffective(PANEL_WRITE,false,false);
|
||||
}else if (exfm && inserted)
|
||||
{//リストア
|
||||
mask |= (nn::hid::BUTTON_LEFT | nn::hid::BUTTON_X);//LEFT+X = Delete 有効
|
||||
gui.PanelEffective(PANEL_READ,false,false);
|
||||
i =0;
|
||||
if (err & SDATA_ERRPUT_PCODE) i = ERC_DEV_OTHER + ERC_PRODCODE;//プロダクトコード不一致
|
||||
//else
|
||||
//if (err & SDATA_ERRPUT_MEDIA) i = ERC_MEDIA + ERC_DEV_CARD;//バックアップなし
|
||||
if (i !=0 )
|
||||
{
|
||||
gui.PanelEffective(PANEL_WRITE,false,false);
|
||||
sprintf(scr_err,"ERROR %d",i);
|
||||
gui.MessEffective(MESSAGE_MENU_ERROR);
|
||||
}
|
||||
else{
|
||||
gui.MessEffective(MESSAGE_MENU_OPERATE);
|
||||
gui.PanelEffective(PANEL_WRITE);
|
||||
}
|
||||
}else{//なし
|
||||
gui.PanelEffective(PANEL_WRITE,false,false);
|
||||
gui.PanelEffective(PANEL_READ,false,false);
|
||||
|
||||
if (inserted == false)
|
||||
{
|
||||
strcpy(scr_err,"Please Insert Card");
|
||||
gui.MessEffective(MESSAGE_MENU_CAUTION);
|
||||
|
||||
}else{
|
||||
if (err & SDATA_ERRPUT_MEDIA) i = ERC_MEDIA + ERC_DEV_CARD;//セーブデータがマウントできない
|
||||
else if (bkupins == false) i = ERC_DEVICE + ERC_DEV_OUT;//書出し先デバイスが無い
|
||||
else i = ERC_DEV_OTHER;//不明
|
||||
sprintf(scr_err,"ERROR %d",i);
|
||||
gui.MessEffective(MESSAGE_MENU_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
gui.ButtonMask(mask);
|
||||
|
||||
gui.MessEffective(MESSAGE_PRODUCT);
|
||||
gui.MessEffective(MESSAGE_PRODUCT2);
|
||||
|
||||
gui.PanelEffective(PANEL_TITLE);
|
||||
gui.PanelEffective(PANEL_MENU);
|
||||
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
//デバッグ用、ボタン待ち
|
||||
void ScrStep()
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.ButtonMask(nn::hid::BUTTON_B);
|
||||
}
|
||||
|
||||
|
||||
void ClearBkupMess()
|
||||
{
|
||||
gui.MessEffective(MESSAGE_CONF,false,false);
|
||||
gui.MessEffective(MESSAGE_RESULT,false,false);
|
||||
gui.MessEffective(MESSAGE_OPERATE,false,false);
|
||||
gui.MessEffective(MESSAGE_QUIT_OPERATE,false,false);
|
||||
gui.MessEffective(MESSAGE_STATUS,false,false);
|
||||
gui.MessEffective(MESSAGE_COUNT,false,false);
|
||||
gui.MessEffective(MESSAGE_COUNT2,false,false);
|
||||
gui.PanelEffective(PANEL_BKUP);
|
||||
}
|
||||
|
||||
//Backup
|
||||
void scr_Backup()
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.PanelLineStyle(PANEL_BKUP,COLOR_SKY);
|
||||
gui.MessStr(MESSAGE_TITLE," --- Backup Card Savedata ---");
|
||||
gui.PanelEffective(PANEL_TITLE);
|
||||
ClearBkupMess();
|
||||
gui.Draw();
|
||||
|
||||
}
|
||||
void scr_BackupYesNo()
|
||||
{
|
||||
scr_Backup();
|
||||
gui.MessEffective(MESSAGE_CONF);
|
||||
gui.MessEffective(MESSAGE_OPERATE);
|
||||
YesNo();
|
||||
}
|
||||
|
||||
//restore
|
||||
void scr_Restore()
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.PanelLineStyle(PANEL_BKUP,COLOR_PARPL);
|
||||
gui.MessStr(MESSAGE_TITLE,"--- Restore Card Savedata ---");
|
||||
gui.PanelEffective(PANEL_TITLE);
|
||||
ClearBkupMess();//backupと同じパネルを使う
|
||||
gui.Draw();
|
||||
|
||||
}
|
||||
void scr_RestoreYesNo()
|
||||
{
|
||||
scr_Restore();
|
||||
gui.MessEffective(MESSAGE_CONF);
|
||||
gui.MessEffective(MESSAGE_OPERATE);
|
||||
YesNo();
|
||||
}
|
||||
|
||||
|
||||
void scr_Status(char *s,eColor col)
|
||||
{
|
||||
gui.MessCol(MESSAGE_STATUS,col);
|
||||
gui.MessStr(MESSAGE_STATUS,s);
|
||||
gui.MessEffective(MESSAGE_STATUS);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
void scr_ResultQuit(char *s,eColor col)
|
||||
{
|
||||
gui.MessCol(MESSAGE_RESULT,col);
|
||||
gui.MessStr(MESSAGE_RESULT,s);
|
||||
gui.MessEffective(MESSAGE_RESULT);
|
||||
gui.MessEffective(MESSAGE_QUIT_OPERATE);
|
||||
Quit();
|
||||
}
|
||||
|
||||
|
||||
void scr_InsExitQuit()
|
||||
{
|
||||
ClearBkupMess();
|
||||
gui.PanelLineStyle(PANEL_INSEXIT,COLOR_RED);
|
||||
gui.PanelEffective(PANEL_INSEXIT);
|
||||
Quit();
|
||||
}
|
||||
|
||||
// カウント/MAX 表示
|
||||
char str_Counter[128];
|
||||
char str_Counter2[128];
|
||||
void scr_CountPerMax(int ct,int max)
|
||||
{
|
||||
sprintf(str_Counter,"%d / %d",ct,max);
|
||||
gui.MessStr(MESSAGE_COUNT,str_Counter);
|
||||
gui.MessEffective(MESSAGE_COUNT);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
//ゲージ&total
|
||||
void scr_CountPerMax2(int ct,int max,int total)
|
||||
{
|
||||
if (total == -1) str_Counter2[0]=0;
|
||||
else if (total != 0){
|
||||
// gui.MessCol(MESSAGE_COUNT2,COLOR_WHITE);
|
||||
sprintf(str_Counter2,"total size %d",total);
|
||||
}else{
|
||||
// gui.MessCol(MESSAGE_COUNT2,COLOR_YELLO);
|
||||
int i;
|
||||
int lv = ct/(max/25);
|
||||
for (i =0;i<lv;i++)str_Counter2[i] = '>';
|
||||
while ( i < 25 )str_Counter2[i++] = '|';
|
||||
str_Counter2[i] = 0;
|
||||
}
|
||||
//sprintf(str_Counter2,"%d / %d",ct,max);
|
||||
gui.MessStr(MESSAGE_COUNT2,str_Counter2);
|
||||
gui.MessEffective(MESSAGE_COUNT2);
|
||||
gui.Draw();
|
||||
|
||||
}
|
||||
|
||||
void scr_MessOnCount2(char *str)
|
||||
{
|
||||
// gui.MessCol(MESSAGE_COUNT2,COLOR_YELLO);
|
||||
gui.MessStr(MESSAGE_COUNT2,str);
|
||||
gui.MessEffective(MESSAGE_COUNT2);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
|
||||
//実行確認
|
||||
void scr_ConfirmDbg(char *str)
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.MessStr(MESSAGE_CONFIRM_TITLE,str);
|
||||
gui.PanelEffective(PANEL_CONFIRM);
|
||||
YesNo();
|
||||
}
|
||||
|
||||
|
||||
//エラー表示とQuitボタン
|
||||
void scr_ErrorQuitDbg(tColStr **s)
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.MessStr(MESSAGE_ERROR_TITLE,s[0]->str);
|
||||
gui.MessCol(MESSAGE_ERROR_TITLE,s[0]->color);
|
||||
gui.MessStr(MESSAGE_ERROR_INFO,s[1]->str);
|
||||
gui.MessCol(MESSAGE_ERROR_INFO,s[1]->color);
|
||||
gui.MessStr(MESSAGE_ERROR_INFO2,s[2]->str);
|
||||
gui.MessCol(MESSAGE_ERROR_INFO2,s[2]->color);
|
||||
gui.MessStr(MESSAGE_ERROR_INFO3,s[3]->str);
|
||||
gui.MessCol(MESSAGE_ERROR_INFO3,s[3]->color);
|
||||
gui.PanelEffective(PANEL_ERROR);
|
||||
Quit();
|
||||
}
|
||||
|
||||
//成功表示とQuitボタン
|
||||
void scr_SuccessQuitDbg(tColStr **s)
|
||||
{
|
||||
scr_evnt = EVNT_NONE;
|
||||
gui.MessStr(MESSAGE_SUCCESS_TITLE,s[0]->str);
|
||||
gui.MessCol(MESSAGE_SUCCESS_TITLE,s[0]->color);
|
||||
gui.MessStr(MESSAGE_SUCCESS_INFO,s[1]->str);
|
||||
gui.MessCol(MESSAGE_SUCCESS_INFO,s[1]->color);
|
||||
gui.MessStr(MESSAGE_SUCCESS_INFO2,s[2]->str);
|
||||
gui.MessCol(MESSAGE_SUCCESS_INFO2,s[2]->color);
|
||||
gui.PanelEffective(PANEL_SUCCESS);
|
||||
Quit();
|
||||
}
|
||||
|
||||
|
||||
//デバッグログ
|
||||
void scr_DgbLog(cStrLst *p)
|
||||
{
|
||||
gui.PanelLineStyle(PANEL_DBGLOG,COLOR_BLUE);
|
||||
|
||||
for (int i=0;i<p->getpos()+1;i++)gui.MemoStr(MEMO_DBGLOG,p->line(i),i);
|
||||
|
||||
gui.PanelEffective(PANEL_DBGLOG);
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ScrDbgLogGetMax()
|
||||
{
|
||||
return LOG_MAX;
|
||||
}
|
||||
|
||||
|
||||
void scr_Draw()
|
||||
{
|
||||
gui.Draw();
|
||||
}
|
||||
|
||||
void scr_GetEvnt()
|
||||
{
|
||||
// gui.thUpdate();
|
||||
}
|
||||
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
#ifndef SCREEN_H_
|
||||
#define SCREEN_H_
|
||||
|
||||
#include <string.h>
|
||||
#include <nn/types.h>
|
||||
#include "../../../../common/gui/gui.h"
|
||||
|
||||
//パネルのID
|
||||
enum {
|
||||
EVNT_NONE,
|
||||
EVNT_YES,
|
||||
EVNT_NO,
|
||||
EVNT_QUIT,
|
||||
EVNT_PUSH_A,
|
||||
EVNT_PUSH_B,
|
||||
EVNT_PUSH_R,
|
||||
EVNT_PUSH_L,
|
||||
EVNT_PUSH_X,
|
||||
EVNT_PUSH_Y,
|
||||
EVNT_PUSH_LEFT_X,
|
||||
EVNT_PUSH_DOWN_Y,
|
||||
EVNT_SEL_READ,
|
||||
EVNT_SEL_WRITE,
|
||||
EVNT_SEL_END,
|
||||
EVNT_ERROR,
|
||||
EVNT_FATAL
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
char *str;
|
||||
eColor color;
|
||||
u8 pad[3];
|
||||
}tColStr;
|
||||
|
||||
|
||||
#define LST_MAX 30
|
||||
#define LST_LENGTH 128
|
||||
class cStrLst {
|
||||
private:
|
||||
int pos;
|
||||
int buttom;
|
||||
char str[LST_MAX][LST_LENGTH];
|
||||
public:
|
||||
cStrLst():pos(0){};
|
||||
void add(char *p){
|
||||
if (pos>=LST_MAX)return;
|
||||
//char *s = &str[pos][0];
|
||||
int i;
|
||||
if (pos == buttom)
|
||||
{
|
||||
i =0;
|
||||
while(i < buttom){ strcpy(str[i],str[i+1]);i++;}
|
||||
}else pos++;
|
||||
i=0;
|
||||
while(i < (LST_LENGTH-1)){ //オーバーロード対策
|
||||
if (p[i]!=0){
|
||||
str[pos][i] = p[i];
|
||||
i++;
|
||||
}else break;
|
||||
}
|
||||
str[pos][i] = 0;
|
||||
//strcpy(str[pos],p);
|
||||
//for (i =0;i<LST_LENGTH;i++){
|
||||
// s[i]=p[i];
|
||||
// if (p[i] ==0) return;
|
||||
//}
|
||||
};
|
||||
void clr(){pos = 0;for (int i =0;i<LST_MAX;i++)str[i][0]=0;};
|
||||
u16 getpos(){return pos;};
|
||||
char* line(u16 ln){return &str[ln][0];};
|
||||
bool setbuttom(int btm)
|
||||
{
|
||||
if ((btm<0)||(btm>=LST_MAX))return false;
|
||||
buttom = btm;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//Topメニューでのエラー表示用のフラグ
|
||||
//bitチェック
|
||||
#define SDATA_ERRPUT_PCODE 1
|
||||
#define SDATA_ERRPUT_MEDIA 2
|
||||
#define SDATA_ERRPUT_VERIFI 4
|
||||
|
||||
|
||||
bool ScrInitialize(uptr heap,u32 size);
|
||||
void ScrFinalize();
|
||||
void ScrClr();
|
||||
int ScrDbgLogGetMax();
|
||||
void ScrStep();
|
||||
void scr_TopMenuDbg(bool formatted,bool insertted);
|
||||
void scr_TopMenu(bool formatted,bool inserted,bool exfm,bool sdins,int err);
|
||||
void scr_ErrorQuitDbg(tColStr **s);
|
||||
void scr_SuccessQuitDbg(tColStr **s);
|
||||
void scr_ConfirmDbg(char *str);
|
||||
void scr_DgbLog(cStrLst *p);
|
||||
void scr_BackupYesNo();
|
||||
void scr_Backup();
|
||||
void scr_RestoreYesNo();
|
||||
void scr_Restore();
|
||||
void scr_InsExitQuit();
|
||||
void scr_Status(char *s,eColor col);
|
||||
void scr_ResultQuit(char *s,eColor col);
|
||||
void scr_CountPerMax(int ct,int max);
|
||||
void scr_CountPerMax2(int ct,int max,int total);
|
||||
void scr_PrdCode(char *s);
|
||||
void scr_PrdCodeEx(char *s);
|
||||
void scr_DelConf();
|
||||
void scr_MessOnCount2(char *str);
|
||||
void scr_Draw();
|
||||
void scr_GetEvnt();
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: irp.h
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VER_H_
|
||||
#define VER_H_
|
||||
|
||||
#define VERSION 1.10
|
||||
|
||||
|
||||
#endif
|
||||
@ -1,46 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
本ツールは 「Nintendo for 3DS」および専用カード用です
|
||||
カード上のセーブデータをバックアップ及びリストアします
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
NANDインポートしてから、内臓アプリ同様の手順で起動
|
||||
本体システム2.0以降にしておく
|
||||
CUP版(v1.02以降)は本体システムが古い場合自動更新メニュー起動
|
||||
ただし、UPP(?)はHomeメニュー起動でないと使えない
|
||||
|
||||
(インポート手順)
|
||||
・デバッガもしくはライタで"cci"をカードに書き込む
|
||||
・本体シリアル含んだリストと署名が入ったSDを差す
|
||||
・Homeメニューよりカード起動しメニューからInport実行
|
||||
・メニューのImportを選ぶ
|
||||
・終了したら電源ボタンを短押し ->"電源を切る"をタッチ
|
||||
電源を入れなおさないとアイコンがメニューに現れません
|
||||
|
||||
|
||||
(NANDから削除)
|
||||
起動まではインポートと同様
|
||||
・メニューからDelete実行
|
||||
終了後はメニューに戻ります
|
||||
|
||||
|
||||
ツール本体の操作は操作マニュアル参照
|
||||
|
||||
|
||||
[Histry]
|
||||
#表示ver マスタリング時のver
|
||||
# 変更内容
|
||||
v1.10 - Remaster 2.0.12
|
||||
body:ルート下ディレクトリの最初しか検索しない不具合を修正(ロンチゲー影響なし)
|
||||
ファイルがメモリ上の確保サイズを超えた時にエラー表示
|
||||
フォーマット系エラー表示を統合(エラー番号106)
|
||||
|
||||
v1.04 - Remaster 2.0.10 - svnリビジョン 190
|
||||
body,imp: アイコンを?に変更:メニューのバグで拒否フラグ設定しても初期ファームでは履歴に見えてしまう
|
||||
動作中の無線停止
|
||||
|
||||
v1.03 - Remaster 2.0.8 - svnリビジョン 181
|
||||
body: "LEFT+X"同時押を4秒押し続けに変更
|
||||
タッチ判定の調整
|
||||
imp: インポート先を本体シリアル番号で制限
|
||||
設定ファイルでオプション有効化するようした
|
||||
SDK2.0+ロンチメニューで動作確認
|
||||
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 34658 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#表示にDemoライブラリを使用します
|
||||
#PC環境に合わせてサンプルデモのディレクトリを指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/sampledemos/common/include)
|
||||
INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
LIBS += lib_demo libnn_am
|
||||
|
||||
.SUBDIRS: $(exist-dirs \
|
||||
Mover \
|
||||
ToSD \
|
||||
)
|
||||
|
||||
DefineDefaultRules()
|
||||
@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakeroot
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev:$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# ディレクトリレイアウトについての説明
|
||||
#
|
||||
# a) ソースコードがルートディレクトリ直下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# OMakefile と同じディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /foo/bar/objects/...
|
||||
# /foo/bar/images/..
|
||||
#
|
||||
#
|
||||
# b) ソースコードが sources 以下に配置される場合
|
||||
# 例:
|
||||
# /OMakeroot
|
||||
# /sources/foo/bar/OMakefile
|
||||
#
|
||||
# 結果:
|
||||
# ルートディレクトリ以下に objects や images が生成されます。
|
||||
#
|
||||
# /objects/foo/bar/...
|
||||
# /images/foo/bar/...
|
||||
#
|
||||
#
|
||||
|
||||
# ルート環境変数の取得
|
||||
public.HORIZON_ROOT =
|
||||
if $(defined-env HORIZON_ROOT)
|
||||
HORIZON_ROOT = $(absname $(getenv HORIZON_ROOT))
|
||||
export
|
||||
|
||||
if $(defined-env CTRSDK_ROOT)
|
||||
CTRSDK_ROOT = $(absname $(getenv CTRSDK_ROOT))
|
||||
if $(and $(defined-env HORIZON_ROOT), $(not $(equal $(HORIZON_ROOT), $(CTRSDK_ROOT))))
|
||||
eprintln(HORIZON_ROOT と CTRSDK_ROOT が一致しません。同じパスを設定するか、どちらか一方だけを定義して下さい。)
|
||||
exit(1)
|
||||
HORIZON_ROOT = $(CTRSDK_ROOT)
|
||||
export
|
||||
|
||||
if $(not $(HORIZON_ROOT))
|
||||
eprintln($"$$CTRSDK_ROOT が定義されていません")
|
||||
exit(1)
|
||||
|
||||
include $(HORIZON_ROOT)/build/omake/commondefs
|
||||
|
||||
DefineCommandVars()
|
||||
|
||||
.PHONY: all build clean clobber
|
||||
.PHONY: run run-scripts
|
||||
|
||||
#
|
||||
# OMakefile の読み込み
|
||||
#
|
||||
.SUBDIRS: .
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
BasicInfo:
|
||||
Title : $(TITLE)
|
||||
BackupMemoryType: None
|
||||
Logo : Nintendo
|
||||
# Companycode: "00"
|
||||
ProductCode : "CTR-P-23BA"
|
||||
# MediaSize: 2GB
|
||||
|
||||
AccessControlInfo:
|
||||
FileSystemAccess:
|
||||
- Debug
|
||||
|
||||
Rom:
|
||||
HostRoot : $(ROMFS_ROOT)
|
||||
|
||||
TitleInfo:
|
||||
# UniqueId: 0xffff6
|
||||
UniqueId: 0xf8031
|
||||
Version: 0
|
||||
@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 31765 $
|
||||
#----------------------------------------------------------------------------
|
||||
SUPPORTED_TARGETS = CTR-*.Process.MPCore.*
|
||||
|
||||
#demoライブラリ位置指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../CTR_SDK/sampledemos/common/include)
|
||||
#INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
|
||||
SOURCES[] =
|
||||
./source/main.cpp
|
||||
../../common/test_data.cpp
|
||||
../../common/shfnt.cpp
|
||||
../../common/sleep.cpp
|
||||
../../common/common.cpp
|
||||
|
||||
OBJECTS[] =
|
||||
$`(ObjectFromBinary $(TARGET), ./Imp_list/key/Public_Key.der)
|
||||
|
||||
TARGET_PROGRAM = CtrSaveToSd_imp
|
||||
|
||||
TITLE = imp
|
||||
|
||||
LIBS += lib_demo libnn_am
|
||||
LIBS += libnn_ps
|
||||
|
||||
|
||||
IMPORTEE_CIA = importee.cia
|
||||
|
||||
SRC_IMPORTEE_PATH = ../body/images/$(BUILD_TARGET_DIR)/$(BUILD_TYPE_DIR)/CtrSaveToSd.cia
|
||||
#とりあえず、マスタリング時は直おき、配置時に改名
|
||||
#SRC_IMPORTEE_PATH = CtrSaveToSd_master.cia
|
||||
|
||||
# ビルドタイプ別に romfs を作る
|
||||
#ROMFS_ROOT = $`(TARGET.getObjectDirectory)/romfsroot
|
||||
ROMFS_ROOT = ./romfiles
|
||||
DEST_IMPORTEE_PATH = $(ROMFS_ROOT)/$(IMPORTEE_CIA)
|
||||
foreach(TARGET, $(BUILDER.getTargets $(SUPPORTED_TARGETS)))
|
||||
$(DEST_IMPORTEE_PATH): $(SRC_IMPORTEE_PATH) $(makeDirectory $(ROMFS_ROOT))
|
||||
cp $< $@
|
||||
ROMFS_DEPENDENCIES = $(DEST_IMPORTEE_PATH)
|
||||
|
||||
# プログラムから参照するためのROMFSのパスとプログラムIDを定義する
|
||||
ROMFS_IMPORTEE_PATH = L\"rom:/$(IMPORTEE_CIA)\"
|
||||
CCFLAGS += -DROMFS_IMPORTEE_PATH=$(ROMFS_IMPORTEE_PATH)
|
||||
|
||||
ROM_SPEC_FILE = Imp.rsf
|
||||
DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/repairtool.desc
|
||||
|
||||
# バナー、アイコン
|
||||
CTR_BANNER_SPEC = banner.bsf
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
|
||||
Binary file not shown.
@ -1,274 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<NintendoWareIntermediateFile>
|
||||
<GraphicsContentCtr Version="1.3.0" Namespace="">
|
||||
<EditData>
|
||||
<MetaData>
|
||||
<Key>MetaData</Key>
|
||||
<Create Author="" Date="2010-12-02T15:21:10" Source="COMMON.mb">
|
||||
<ToolDescriptions Name="NW4C_Export for Maya 2009 Service Pack 1" Version="1.2.0" />
|
||||
</Create>
|
||||
<Modify Date="2011-05-16T15:30:33">
|
||||
<ToolDescriptions Name="NintendoWare Creative Studio For Banner." Version="1.3.0.30235" />
|
||||
</Modify>
|
||||
</MetaData>
|
||||
<ContentSummaryMetaData>
|
||||
<Key>ContentSummaries</Key>
|
||||
<Values>
|
||||
<ContentSummary ContentTypeName="GraphicsContent">
|
||||
<ObjectSummaries>
|
||||
<ObjectSummary TypeName="SkeletalModel" Name="">
|
||||
<Notes>
|
||||
<Note Name="MaterialCount" Value="1" />
|
||||
<Note Name="ShapeCount" Value="1" />
|
||||
<Note Name="MeshCount" Value="1" />
|
||||
<Note Name="BoneCount" Value="1" />
|
||||
<Note Name="TotalPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalNoneSkinningPrimitiveSetCount" Value="1" />
|
||||
<Note Name="TotalRigidSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalSmoothSkinningPrimitiveSetCount" Value="0" />
|
||||
<Note Name="TotalIndexStreamCount" Value="1" />
|
||||
<Note Name="TotalPolygonCount" Value="2" />
|
||||
<Note Name="TotalVertexCount" Value="4" />
|
||||
</Notes>
|
||||
</ObjectSummary>
|
||||
</ObjectSummaries>
|
||||
</ContentSummary>
|
||||
</Values>
|
||||
</ContentSummaryMetaData>
|
||||
</EditData>
|
||||
<Models>
|
||||
<SkeletalModel Name="" IsBranchVisible="true" IsVisible="true" CullingMode="Dynamic" IsNonuniformScalable="false" LayerId="0" NeededBoneCapacity="20">
|
||||
<EditData>
|
||||
<ModelDccToolExportOption ExportStartFrame="0" Magnify="1" AdjustSkinning="None" MeshVisibilityMode="BindByIndex">
|
||||
<Key>ModelDccToolInfo</Key>
|
||||
</ModelDccToolExportOption>
|
||||
<OptimizationLogArrayMetaData Size="1">
|
||||
<Key>OptimizationLogs</Key>
|
||||
<Values>
|
||||
<OptimizationLog Date="2010-12-02T15:21" EditorVersion="1.2.0.27817">
|
||||
<Options NodeCompressionMode="None" IsMergeMeshOwnerBoneEnabled="false" IsCombineMeshEnabled="false" IsCompressMaterialEnabled="false" IsOptimizePlygonPrimitiveEnabled="false" IsConvertOneBoneSkeletalModelToModel="true" IsDeleteUnusedVertexEnabled="false" PositionQuantizeMode="Float" NormalQuantizeMode="Float" TextureQuantizeMode="Float" GroupByIndexStream="false" />
|
||||
</OptimizationLog>
|
||||
</Values>
|
||||
</OptimizationLogArrayMetaData>
|
||||
</EditData>
|
||||
<AnimationGroupDescriptions>
|
||||
<GraphicsAnimationGroupDescription Name="SkeletalAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="CalculatedTransform" IsBinarized="true">
|
||||
<Path>Skeleton.Bones["*"].AnimatedTransform</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="VisibilityAnimation" EvaluationTiming="BeforeWorldUpdate">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>Meshes["*"].IsVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Bool" IsBinarized="true">
|
||||
<Path>IsBranchVisible</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
<GraphicsAnimationGroupDescription Name="MaterialAnimation" EvaluationTiming="AfterSceneCulling">
|
||||
<MemberInformationSet>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Emission</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Ambient</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Diffuse</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Specular1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant0</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant1</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant2</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant3</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant4</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].MaterialColor.Constant5</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Sampler.BorderColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Int" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureMappers["*"].Texture</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="RgbaColor" IsBinarized="true">
|
||||
<Path>Materials["*"].FragmentOperation.BlendOperation.BlendColor</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Scale</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Float" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Rotate</Path>
|
||||
</AnimationMemberDescription>
|
||||
<AnimationMemberDescription BlendOperationName="Vector2" IsBinarized="true">
|
||||
<Path>Materials["*"].TextureCoordinators["*"].Translate</Path>
|
||||
</AnimationMemberDescription>
|
||||
</MemberInformationSet>
|
||||
</GraphicsAnimationGroupDescription>
|
||||
</AnimationGroupDescriptions>
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
<Shapes>
|
||||
<SeparateDataShapeCtr>
|
||||
<OrientedBoundingBox>
|
||||
<CenterPosition X="0" Y="0" Z="6.5" />
|
||||
<OrientationMatrix M00="1" M01="0" M02="0" M10="0" M11="1" M12="0" M20="0" M21="0" M22="1" />
|
||||
<Size X="24" Y="12" Z="0" />
|
||||
</OrientedBoundingBox>
|
||||
<PositionOffset X="0" Y="0" Z="0" />
|
||||
<PrimitiveSets>
|
||||
<PrimitiveSetCtr SkinningMode="None">
|
||||
<BoneIndexTable>0</BoneIndexTable>
|
||||
<Primitives>
|
||||
<PrimitiveCtr>
|
||||
<IndexStreams>
|
||||
<UbyteIndexStreamCtr PrimitiveMode="Triangles" Size="6">0 1 2 1 3 2</UbyteIndexStreamCtr>
|
||||
</IndexStreams>
|
||||
</PrimitiveCtr>
|
||||
</Primitives>
|
||||
</PrimitiveSetCtr>
|
||||
</PrimitiveSets>
|
||||
<VertexAttributes>
|
||||
<Vector3VertexStreamCtr Usage="Position" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
-12 -6 6.5
|
||||
12 -6 6.5
|
||||
-12 6 6.5
|
||||
12 6 6.5
|
||||
</Vector3VertexStreamCtr>
|
||||
<Vector3VertexAttributeCtr Usage="Normal">0 0 1</Vector3VertexAttributeCtr>
|
||||
<Vector2VertexStreamCtr Usage="TextureCoordinate0" VertexSize="4" Scale="1" QuantizedMode="Float">
|
||||
0 0
|
||||
1 0
|
||||
0 1
|
||||
1 1
|
||||
</Vector2VertexStreamCtr>
|
||||
</VertexAttributes>
|
||||
</SeparateDataShapeCtr>
|
||||
</Shapes>
|
||||
<Materials>
|
||||
<MaterialCtr Name="MT_00" IsCompressible="true" LightSetIndex="0" FogIndex="0" IsFragmentLightEnabled="false" IsVertexLightEnabled="false" IsHemiSphereLightEnabled="false" IsHemiSphereOcclusionEnabled="false" IsFogEnabled="false" TextureCoordinateConfig="Config0120" TranslucencyKind="Layer1" ShaderProgramDescriptionIndex="-1" ShaderBinaryKind="Default">
|
||||
<ShaderReference />
|
||||
<MaterialColor VertexColorScale="1">
|
||||
<Emission R="0" G="0" B="0" A="0" />
|
||||
<Ambient R="1" G="1" B="1" A="0" />
|
||||
<Diffuse R="1" G="1" B="1" A="1" />
|
||||
<Specular0 R="1" G="1" B="1" A="0" />
|
||||
<Specular1 R="0" G="0" B="0" A="0" />
|
||||
<Constant0 R="0" G="0" B="0" A="1" />
|
||||
<Constant1 R="0" G="0" B="0" A="1" />
|
||||
<Constant2 R="0" G="0" B="0" A="1" />
|
||||
<Constant3 R="0" G="0" B="0" A="1" />
|
||||
<Constant4 R="0" G="0" B="0" A="1" />
|
||||
<Constant5 R="0" G="0" B="0" A="1" />
|
||||
</MaterialColor>
|
||||
<Rasterization CullingMode="BackFace" IsPolygonOffsetEnabled="false" PolygonOffsetUnit="0" />
|
||||
<TextureCoordinators>
|
||||
<TextureCoordinatorCtr SourceCoordinate="0" MappingMethod="UvCoordinateMap" ReferenceCamera="0" MatrixMode="DccMaya" ScaleS="1" ScaleT="1" Rotate="0" TranslateS="0" TranslateT="0" />
|
||||
</TextureCoordinators>
|
||||
<TextureMappers>
|
||||
<PixelBasedTextureMapperCtr>
|
||||
<TextureReference>Textures["tosdimp"]@file:Textures/tosdimp.ctex</TextureReference>
|
||||
<StandardTextureSamplerCtr MinFilter="Linear" MagFilter="Linear" WrapS="ClampToEdge" WrapT="ClampToEdge" MinLod="0" LodBias="0">
|
||||
<BorderColor R="0" G="0" B="0" A="1" />
|
||||
</StandardTextureSamplerCtr>
|
||||
</PixelBasedTextureMapperCtr>
|
||||
</TextureMappers>
|
||||
<FragmentShader LayerConfig="ConfigurationType0">
|
||||
<BufferColor R="0" G="0" B="0" A="1" />
|
||||
<FragmentBump BumpTextureIndex="Texture0" BumpMode="NotUsed" IsBumpRenormalize="false" />
|
||||
<FragmentLighting FresnelConfig="No" IsClampHighLight="false" IsDistribution0Enabled="false" IsDistribution1Enabled="false" IsGeometricFactor0Enabled="false" IsGeometricFactor1Enabled="false" IsReflectionEnabled="false" />
|
||||
<FragmentLightingTable>
|
||||
<ReflectanceRSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceRSampler>
|
||||
<ReflectanceGSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceGSampler>
|
||||
<ReflectanceBSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</ReflectanceBSampler>
|
||||
<Distribution0Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution0Sampler>
|
||||
<Distribution1Sampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</Distribution1Sampler>
|
||||
<FresnelSampler IsAbs="true" Input="CosNormalHalf" Scale="One">
|
||||
<NullLookupTableCtr />
|
||||
</FresnelSampler>
|
||||
</FragmentLightingTable>
|
||||
<TextureCombiners>
|
||||
<TextureCombinerCtr CombineRgb="Replace" CombineAlpha="Replace" ScaleRgb="One" ScaleAlpha="One" Constant="Constant0" BufferInputRgb="PreviousBuffer" BufferInputAlpha="PreviousBuffer">
|
||||
<SourceRgb Source0="Texture0" Source1="FragmentPrimaryColor" Source2="FragmentSecondaryColor" />
|
||||
<OperandRgb Operand0="Color" Operand1="Color" Operand2="Color" />
|
||||
<SourceAlpha Source0="Texture0" Source1="Constant" Source2="Constant" />
|
||||
<OperandAlpha Operand0="Alpha" Operand1="Alpha" Operand2="Alpha" />
|
||||
</TextureCombinerCtr>
|
||||
</TextureCombiners>
|
||||
<AlphaTest IsTestEnabled="false" TestFunction="Always" TestReference="0" />
|
||||
</FragmentShader>
|
||||
<FragmentOperation>
|
||||
<DepthOperation IsTestEnabled="true" TestFunction="Less" IsMaskEnabled="false" />
|
||||
<BlendOperation Mode="Blend" LogicOperation="Copy">
|
||||
<RgbParameter BlendFunctionSource="SourceAlpha" BlendFunctionDestination="OneMinusSourceAlpha" BlendEquation="FuncAdd" />
|
||||
<AlphaParameter BlendFunctionSource="One" BlendFunctionDestination="Zero" BlendEquation="FuncAdd" />
|
||||
<BlendColor R="0" G="0" B="0" A="1" />
|
||||
</BlendOperation>
|
||||
<StencilOperation IsTestEnabled="false" TestFunction="Never" TestReference="0" TestMask="255" FailOperation="Keep" ZFailOperation="Keep" PassOperation="Keep" />
|
||||
</FragmentOperation>
|
||||
</MaterialCtr>
|
||||
</Materials>
|
||||
<Meshes>
|
||||
<Mesh IsVisible="true" RenderPriority="0" MeshNodeName="BONE_00">
|
||||
<EditData>
|
||||
<DccToolSourceNodeMetaData>
|
||||
<Key>DccToolSourceNode</Key>
|
||||
<Values>
|
||||
<NodeName>BONE_00</NodeName>
|
||||
</Values>
|
||||
</DccToolSourceNodeMetaData>
|
||||
</EditData>
|
||||
<SeparateShapeReference>Shapes[0]</SeparateShapeReference>
|
||||
<MaterialReference>Materials["MT_00"]</MaterialReference>
|
||||
</Mesh>
|
||||
</Meshes>
|
||||
<Skeleton RootBoneName="BONE_00" ScalingRule="Standard" IsTranslateAnimationEnabled="true">
|
||||
<Bones>
|
||||
<Bone Name="BONE_00" ParentBoneName="" IsSegmentScaleCompensate="false" IsCompressible="true" IsNeededRendering="true" HasSkinningMatrix="false" BillboardMode="YAxial">
|
||||
<Transform>
|
||||
<Scale X="1" Y="1" Z="1" />
|
||||
<Rotate X="0" Y="0" Z="0" />
|
||||
<Translate X="0" Y="0" Z="0" />
|
||||
</Transform>
|
||||
</Bone>
|
||||
</Bones>
|
||||
</Skeleton>
|
||||
</SkeletalModel>
|
||||
</Models>
|
||||
</GraphicsContentCtr>
|
||||
</NintendoWareIntermediateFile>
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
EJF10000237
|
||||
@ -1,2 +0,0 @@
|
||||
<EFBFBD>c°Ŕć;q’i|xŰ$^D˙Q¨lڎË_ňůO?·OQwř]i…łľÄdžÁUÄĘ›P<E280BA>ŕíđŤŕL8ŞýQLĘîQ’j€ô)°~SVO>( $6çůi(—H?ä8?0Ű„U
‹zO¤Wó<>ł˝$<24>‘}葯šŔPĐ“Ž<ö]ϨúÖď[¤ŘÝ)3„Öčv}2^Fˇođż{5íÔTzdNA*-‰—Í\Â$4ŚĐ]Î9éěKmČT¬F0ÍúăL—3’9<>őÖi=ĺčŽô’'[4<>>ł÷ż´•Q,/µ†łGČ—]<5D>žźß03‡
|
||||
ţ“›Đâ×Ű=
|
||||
@ -1,4 +0,0 @@
|
||||
openssl genrsa -out private_key.pem 2048
|
||||
openssl enc -d -base64 -in private_key.pem -out private_key.der
|
||||
openssl rsa -pubout -inform DER -outform DER -in private_key.der -out public_key.der
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
rem ver1.0.0—p
|
||||
openssl genpkey -out private_key.der -outform DER -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537
|
||||
openssl rsa -pubout -inform DER -outform DER -in private_key.der -out public_key.der
|
||||
@ -1,7 +0,0 @@
|
||||
@echo off
|
||||
if "%1"=="" goto 1
|
||||
openssl dgst -sha256 -binary -keyform DER -sign ../key/private_key.der -out cts_sign.dat %1
|
||||
goto end
|
||||
:1
|
||||
openssl dgst -sha256 -binary -keyform DER -sign ../key/private_key.der -out cts_sign.dat cts_list.txt
|
||||
:end
|
||||
@ -1,5 +0,0 @@
|
||||
秘密鍵の扱いは注意
|
||||
署名作成する必要の無い所には出さない
|
||||
|
||||
署名作成時は、配布先で使用するバージョンに入っている
|
||||
鍵とペアの秘密鍵を使うこと
|
||||
@ -1,45 +0,0 @@
|
||||
|
||||
本体印刷のシリアル最後尾の四角い枠に入った数字は
|
||||
digitというものらしい
|
||||
リスト作成時に入力違いをチェックするのに使えそう
|
||||
コマンドラインでファイル指定する簡単なチェッカーとか
|
||||
|
||||
|
||||
以下、長谷川さんメール抜粋
|
||||
----------------
|
||||
チェックデジットの計算方法は一般的なものらしく、
|
||||
"モジュラス10 ウェイト3・1(M10W31)"というものらしいです。
|
||||
|
||||
|
||||
// NULL終端されたシリアルナンバーを受け取る
|
||||
// NULL文字の場所にチェックデジットを付加して新たにNULL終端する
|
||||
void AddCheckDigit(char* serial)
|
||||
{
|
||||
size_t len = std::strlen(serial);
|
||||
|
||||
u8 digit = 0;
|
||||
bool odd = true;
|
||||
for(u8 i = len - 1; i > 0 && std::isdigit(serial[i]); i--)
|
||||
{
|
||||
if(odd)
|
||||
{
|
||||
digit += (serial[i] - '0') * 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
digit += (serial[i] - '0');
|
||||
}
|
||||
odd = !odd;
|
||||
}
|
||||
|
||||
if(digit % 10 != 0)
|
||||
{
|
||||
serial[len] = 10 - (digit % 10) + '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
serial[len] = '0';
|
||||
}
|
||||
|
||||
serial[len + 1] = '\0';
|
||||
}
|
||||
Binary file not shown.
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAsOicKm/hXrlKcKyJd+jBeg1yEa5j8tT9UINkCP/UWFyLQ9xs
|
||||
/EYImuQlGhzqk+TWTU9sdLnOqbQFxzCPSDu/ictKayv8ZZwW53N1YodMITEPLo2i
|
||||
ZVuknNkl/XQcLGjl9SymFXShry0g433QO2SxuyLcREkV9ZSRanS8Ei/NftyK7OEZ
|
||||
zbcf5D8MSwhmF5gwU5h9xt0UvEkSwYUjQXBsvwJzVb5c5pDhiGX2+4KWo3+ZQlbS
|
||||
OCL86HA31SzMNyKvI5zrLPpEJNLLOp8s7wX1S2YPrVbwYtxciHsQCNfhFnZKK4iI
|
||||
78Sx6L6km8NARte3Q7fmi+lQHNFLKJyOcyKuwwIDAQABAoIBAE9vMufvMp/ozR8I
|
||||
qfU4gt99+BEuX9yifFfRl3JfBQbkDvhammkwPR7ngC1YfJAJuZwfJJDI+Z3DorCN
|
||||
Alkp0thZesHij0NEshgdBMFIBQwGTk3V9OxUGPcAnglPQHNEarUK5kxOAWd5+QGM
|
||||
9ZolnZRsk8DpnD2YBy9o2SXFZx0lxOb3UoMDcm46mMfFf+dJFX3iF8LurLllkzHr
|
||||
IMiqWkU2q2B2+M93LMDr4Sh4JTta9mMMYnBGE2Yuy1SqxBivByHfnIXFJAooAwuz
|
||||
0B9uJTxvdyUtNvmGyWKrY0nFdzaDAY64hfpRF0I5D9QTQXso3gKyWxytiDTUWF8S
|
||||
H7nTZuECgYEA2YH0wVTdIhnpEO3tQZ4wI7r2AM7tUgEsmca4wo4vahScxt/fuXE/
|
||||
WZ0qmjBUaky9liRy8GwkRz4SSd6cYRDf5ht5OdFh/0ksFwcZscCDbowx8d0qVRMR
|
||||
BPIGSjJZg8gBuLzcrdx6XfbUVUzFVIm9l8NTd6DHaDNqxUSrUrCWGlECgYEA0DdX
|
||||
i5iYqbrgarbJYzDV2yy4mvkL2rTCC34Eya//yDwhsNFVR6GdzmJJoz04Ka5i2/67
|
||||
BmPQZXioBMckcUdYDqDsEtCdV6nqbX6HmL/Hxvhe3FgKMK8rPwH3adkYzoWZerza
|
||||
W3AR4W5KBWwtje/ncDXlNqrR956vNtfausgdntMCgYBXSgUstV8NeXKEXcfShqZx
|
||||
IG3rgx/QwjHhANRTF/bFTsJgOaYyaNVwpFddi7nE80k+gSAzhmLEyI9UX+dIORpx
|
||||
4WK0Jmh6qCXuk+Xm5QiaC99bXlPH0qAI6QxHKI+uCE1Qk1LI32uoXA94sBedRq30
|
||||
wumzX63HDqNxyY4r4DxNEQKBgDQOcgvLpfdhanQjqOvsrLr0Tl8ofsc6Q/1dj1Lh
|
||||
dsCYEBBF9d1H0c1kk2aFisIZAExiPl4VnGeSJ+ex5jGQFbrqjrsRfxUIvTyM0tfk
|
||||
sszTEdxjAoEzektxcWr8RRB1JG8kQi90MHQ8/7KlXipLXYCXaOwm/wG6obHDe8MQ
|
||||
/x7TAoGAZ+092oEfNVyZaniPn4B7C3FMmCz555THhUHTzlmAITkFeXH006hbqHYX
|
||||
romWUfA4qexKWKoSb5crBPm9h/3OlwcWgkldDDYDm1SKTrEDKmpmkDOKMXrDivsV
|
||||
mJULZt10BA0tTb35ToxPy3ChtI2Qy2G+m9nCMu9AdvEos/oRL68=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
Binary file not shown.
Binary file not shown.
@ -1,482 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: Horizon
|
||||
File: main.cpp
|
||||
|
||||
Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
|
||||
$Rev$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nn.h>
|
||||
#include <nn/fs.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiSys.h>
|
||||
#include <nn/cfg/CTR/cfg_ApiInit.h>
|
||||
#include <nn/am/am_ApiLocalImporter.h>
|
||||
#include <nn/am/am_ApiSystemMenu.h>
|
||||
#include <nn/applet.h>
|
||||
#include <nn/ndm.h>
|
||||
#include <nn/ndm/ndm_DebugControl.h>
|
||||
#include <nn/crypto/crypto_RsaKey.h>
|
||||
#include <nn/ps/ctr/ps_Api.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "demo.h"
|
||||
#include "../../body/ver.h"
|
||||
#include "../common/sleep.h"
|
||||
#include "../common/common.h"
|
||||
#include "../common/shfnt.h"
|
||||
#include "../common/test_data.h"
|
||||
|
||||
#define INF_FILE "sdmc:/cts_inf.txt"
|
||||
|
||||
#define KEY_LENGTH 2048
|
||||
#define LIST_FILE "sdmc:/cts_list.txt"
|
||||
#define SIGN_FILE "sdmc:/cts_sign.dat"
|
||||
|
||||
|
||||
extern "C" {
|
||||
extern u8* PUBLIC_KEY_BEGIN[];
|
||||
extern u8* PUBLIC_KEY_END[];
|
||||
|
||||
const void* PUBLIC_KEY = PUBLIC_KEY_BEGIN;
|
||||
}
|
||||
|
||||
demo::RenderSystemDrawing s_RenderSystem;
|
||||
nn::fnd::ExpHeap appHeap;
|
||||
uptr heapForGx;
|
||||
void ErrorStop(char *s);
|
||||
void ErrorPOff(char *s);
|
||||
|
||||
const size_t ROMFS_BUFFER_SIZE = 64*1024;//ROMマウント用
|
||||
const size_t READ_BUFFER_SIZE = 64*1024;
|
||||
|
||||
#define SDK_SER_LEN nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN
|
||||
|
||||
namespace
|
||||
{
|
||||
u8* readBuf;
|
||||
u8* romfsBuf;
|
||||
|
||||
}
|
||||
nn::Result result;
|
||||
|
||||
|
||||
bool ImportFile(nn::fs::MediaType mediaType, wchar_t* filename)
|
||||
{
|
||||
//nn::Result result;
|
||||
|
||||
nn::fs::FileOutputStream* stream;
|
||||
result = nn::am::BeginImportProgram(&stream, mediaType);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
//NN_LOG("Importing: %ls...", filename);
|
||||
nn::fs::FileInputStream in(filename);
|
||||
|
||||
while(s32 read = in.Read(readBuf, READ_BUFFER_SIZE))
|
||||
{
|
||||
stream->Write(readBuf, read);
|
||||
}
|
||||
result = nn::am::EndImportProgram(stream);
|
||||
}
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
#define LIST_MAX 4000
|
||||
#define LIST_LENGTH (LIST_MAX * (nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1))
|
||||
u8 s_list[LIST_MAX][nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1];//シリアルリスト
|
||||
u8 sign[256];//署名
|
||||
u8 serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN+1];
|
||||
|
||||
//本体シリアル取得
|
||||
int GettedSerLen;
|
||||
bool GetSerial(){
|
||||
nn::cfg::CTR::init::Initialize();
|
||||
nn::cfg::CTR::system::Initialize();
|
||||
result = nn::cfg::CTR::system::GetSerialNo(serialNo);
|
||||
nn::cfg::CTR::system::Finalize();
|
||||
nn::cfg::CTR::init::Finalize();
|
||||
serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN] = 0;
|
||||
GettedSerLen = strlen((char*)serialNo);
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#define setColor(r,g,b,a) s_RenderSystem.SetColor(r,g,b,a)
|
||||
void setColor(f32 r,f32 g,f32 b,f32 a){ shf_SetColor(r,g,b,a);}
|
||||
//#define setText(x,y,s) s_RenderSystem.DrawText(x,y,s)
|
||||
void drawText(u16 x,u16 y,char *s){ shf_DrawText_0( x,y,s);}
|
||||
//上はASCIIのみ対応したTextWriterへのラッパ
|
||||
//日本語表示の場合、WideTextWriterを使う(要sft_側の関数追加)
|
||||
|
||||
|
||||
nn::hid::PadReader *hpr;
|
||||
//入力待ち
|
||||
nn::hid::PadStatus padStatus;
|
||||
u32 WaitKey(u32 mask)
|
||||
{
|
||||
|
||||
while(1){
|
||||
hpr->ReadLatest(&padStatus);
|
||||
if(padStatus.trigger & mask)return padStatus.trigger;
|
||||
CheckSysBreak();
|
||||
}
|
||||
}
|
||||
|
||||
//終了
|
||||
void endfunc()
|
||||
{
|
||||
appHeap.Free(reinterpret_cast<void*>(readBuf));
|
||||
appHeap.Free(reinterpret_cast<void*>(romfsBuf));
|
||||
nn::hid::Finalize();
|
||||
SharedFontFinalize();
|
||||
nngxWaitVSync(NN_GX_DISPLAY_BOTH);//SDK2.0以降では不要?
|
||||
s_RenderSystem.Finalize();
|
||||
}
|
||||
|
||||
//署名検証
|
||||
bool VeriRsa(u8* src,size_t sz,u8* sig)
|
||||
{
|
||||
nn::crypto::RsaKey key;
|
||||
//nn::crypto::Initialize();
|
||||
nn::ps::CTR::Initialize();
|
||||
result = key.InitializePublicKey(PUBLIC_KEY_BEGIN,KEY_LENGTH);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
result = nn::ps::CTR::VerifyRsaSha256(src,sz,sig,key);
|
||||
}
|
||||
//nn::crypto::Finalize();
|
||||
nn::ps::CTR::Finalize();
|
||||
return result.IsSuccess();
|
||||
}
|
||||
|
||||
//エラー
|
||||
void ErrorCommon(char *s,char *ss)
|
||||
{
|
||||
char str[128];
|
||||
nn::am::FinalizeForLocalImporter();
|
||||
nn::fs::Unmount("sdmc:");
|
||||
nn::fs::Unmount("rom:");
|
||||
NN_LOG(s);
|
||||
NN_LOG(" result = %d\n",result.GetDescription());
|
||||
shf_SetScale(0.7,0.7);
|
||||
setColor(1.0, 0.0, 0.0,1.0);
|
||||
strcpy(str,"Error: ");
|
||||
strcat(str,s);
|
||||
drawText(10,100,str);
|
||||
drawText(10,140,ss);
|
||||
}
|
||||
|
||||
|
||||
void ErrorStop(char *s)
|
||||
{
|
||||
ErrorCommon(s,"Push Home Button & end");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
}
|
||||
|
||||
void ErrorPoff(char *s)
|
||||
{
|
||||
ErrorCommon(s,"Push Power Button & Power Off");
|
||||
drawText(10,160,"Home Button is invalid");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
}
|
||||
|
||||
|
||||
//改行後の位置を返す、0=見つからなかった
|
||||
int CrLf(int n,int max)
|
||||
{
|
||||
u8 d;
|
||||
while(n < max)
|
||||
{
|
||||
d = readBuf[n];
|
||||
if (d==0x0a)return n+1;//LF
|
||||
if (d==0x0d)//CR
|
||||
{
|
||||
if (n == max-1)return 0;//終端
|
||||
n++;
|
||||
if (readBuf[n]==0x0a)return n+1;//CR+LF
|
||||
ErrorStop("list broken");//CRのみは異常、署名時にファイル壊れてた?
|
||||
}
|
||||
n++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
nn::fs::FileInputStream fi;
|
||||
//ファイルリード
|
||||
s32 FileRead(char* fname)
|
||||
{
|
||||
s32 size;
|
||||
result = fi.TryInitialize(fname);
|
||||
if (result.IsFailure()){//open error
|
||||
//NN_LOG("desc= %d\n",result.GetDescription());
|
||||
return 0;
|
||||
}
|
||||
result = fi.TryRead(&size,readBuf,READ_BUFFER_SIZE);
|
||||
fi.Finalize();
|
||||
if (result.IsFailure()){
|
||||
//NN_LOG("desc= %d\n",result.GetDescription());
|
||||
return 0;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
char ver[16];
|
||||
char seri[32];
|
||||
void nnMain( void )
|
||||
{
|
||||
//nn::Result result;
|
||||
bool flg_applove=false;
|
||||
bool flg_test=false;
|
||||
extern bool prohibitHome;// HOME ボタン禁止
|
||||
|
||||
nn::os::Initialize();
|
||||
nn::fs::Initialize();
|
||||
|
||||
//DEA-SUPにて推奨のフリーズ暫定対策:無線デーモンを停止 (2011.3.1 現在)
|
||||
//ただし、スリープに入ると再開
|
||||
//無線は使わないので本体横スイッチ切っとくのが確実
|
||||
nn::ndm::Initialize();
|
||||
nn::ndm::SuspendScheduler();
|
||||
|
||||
//中断処理の準備
|
||||
InitSysBreak((uptr)endfunc);
|
||||
// グラフィックスライブラリの初期化は、以降で行わなければならない
|
||||
// 他、アプリケーションの初期化処理
|
||||
|
||||
nn::hid::Initialize();
|
||||
nn::hid::PadReader padReader;
|
||||
hpr = &padReader;
|
||||
|
||||
//result = nn::ns::CTR::InitializeForShell();
|
||||
//if (result.IsSuccess())
|
||||
result = nn::am::InitializeForLocalImporter();
|
||||
|
||||
nn::applet::DisableSleep();//スリープ非対応 .. 無線対策
|
||||
|
||||
// ヒープの確保
|
||||
appHeap.Initialize(nn::os::GetDeviceMemoryAddress(), nn::os::GetDeviceMemorySize(), nn::os::ALLOCATE_OPTION_LINEAR);
|
||||
|
||||
const u32 s_GxHeapSize = 0x800000;
|
||||
// RenderSystem の準備
|
||||
heapForGx = reinterpret_cast<uptr>(appHeap.Allocate(s_GxHeapSize));
|
||||
s_RenderSystem.Initialize(heapForGx, s_GxHeapSize);
|
||||
SharedFontInit();
|
||||
|
||||
// 共有フォントの種類を取得
|
||||
//nn::pl::SharedFontType sftype = nn::pl::GetSharedFontType();
|
||||
|
||||
// スリープ要求に対する返答を有効にする
|
||||
// また、蓋の状態チェックを行い蓋が閉じられているならスリープ要求が発生する
|
||||
// nn::applet::EnableSleep(true);
|
||||
|
||||
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||
s_RenderSystem.Clear();
|
||||
// s_RenderSystem.SetFontSize(12);
|
||||
shf_SetScale(0.8,0.6);
|
||||
setColor(1.0,1.0,1.0,1.0);
|
||||
drawText(20,20,"CTR Card Savedata Exporter Setup");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
shf_SetScale(0.5,0.5);
|
||||
sprintf(ver,"version %.2f",VERSION);
|
||||
drawText(250,40,ver);
|
||||
|
||||
shf_SetScale(0.7,0.7);
|
||||
if (result.IsFailure())ErrorStop("Initialize");//初期化に失敗
|
||||
if (READ_BUFFER_SIZE < LIST_LENGTH)ErrorStop("buffer size");//バッファサイズのチェック
|
||||
|
||||
//ファイルバッファ
|
||||
//SDKで4倍数サイズ、4アライン推奨
|
||||
if (READ_BUFFER_SIZE > appHeap.GetTotalFreeSize())ErrorStop("memory alloc");
|
||||
readBuf = reinterpret_cast<u8*>(appHeap.Allocate(READ_BUFFER_SIZE,32));
|
||||
if (ROMFS_BUFFER_SIZE > appHeap.GetTotalFreeSize())ErrorStop("memory alloc");
|
||||
romfsBuf = reinterpret_cast<u8*>(appHeap.Allocate(ROMFS_BUFFER_SIZE,32));
|
||||
|
||||
if (nn::os::CTR::GetRunningTargetHardware() != nn::os::TARGET_HARDWARE_PRODUCT)
|
||||
{//デバッガ
|
||||
flg_test=true;
|
||||
flg_applove=true;
|
||||
}else{//実機ならシリアルチェック
|
||||
int i,j,n;
|
||||
s32 fsize;
|
||||
if( GetSerial() == false)ErrorStop("Get Serial");//本体シリの取得に失敗
|
||||
|
||||
result = nn::fs::MountSdmc();//ダイレクトでマウント..マスタリング時にワーニング
|
||||
if (result.IsFailure())ErrorStop("Mount SD");
|
||||
fsize = FileRead(INF_FILE);//設定ファイルがあるか
|
||||
if((fsize < 1024) && (fsize > 0))//サイズチェック,増えても1Kは超えない
|
||||
{//不具合調査時に状況にあわせて現場で作成&変更を想定したオプション
|
||||
//通常は不要なので無しでも動くようしとく
|
||||
n = 0;
|
||||
while(n < fsize)
|
||||
{
|
||||
if (readBuf[n] == '-'){
|
||||
if (n == fsize-1)break;//終端
|
||||
n++;
|
||||
switch (readBuf[n]){
|
||||
case 'p':// -p .. 本体シリアル表示
|
||||
strcpy(seri,"s/n: ");
|
||||
strcat(seri,(char *)serialNo);
|
||||
shf_SetScale(0.5,0.5);
|
||||
drawText(10,40,(char*)seri);
|
||||
shf_SetScale(0.7,0.7);
|
||||
break;
|
||||
case 't':// -t .. テストメニュー有効
|
||||
flg_test = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
//シリアル表示(オプション)後にチェック
|
||||
//デバッガ=15,実機=11
|
||||
if (GettedSerLen < 11)ErrorStop("invalid Serial");
|
||||
|
||||
fsize = FileRead(SIGN_FILE);//署名リード
|
||||
if(fsize != 256)ErrorStop("sign file");//鍵のbit長は2046固定
|
||||
memcpy(sign,readBuf,256);//readBuf -> sign
|
||||
fsize = FileRead(LIST_FILE);//リストリード
|
||||
if((fsize > LIST_LENGTH ) || (fsize == 0))ErrorStop("list file");
|
||||
|
||||
nn::fs::Unmount("sdmc:"); //検証後はSDから読まないでメモリバッファ上のデータを使う: 差替え対策
|
||||
if (VeriRsa(readBuf,fsize,sign) == false)ErrorStop("sign verify");
|
||||
|
||||
//署名検証OK
|
||||
int list_ct = 0;
|
||||
n=0;
|
||||
while(n < fsize)//リスト作成
|
||||
{
|
||||
if (readBuf[n] == '#')//コメント行を無視、ワイド文字非対応
|
||||
{
|
||||
i = CrLf(n,fsize);//コメントの次行
|
||||
if (i == 0)break;//ファイル終わりまで改行が見つからない
|
||||
}else
|
||||
{
|
||||
//改行さがし
|
||||
if ((fsize-n) > (SDK_SER_LEN+2))
|
||||
{//シリアルは改行つける
|
||||
i = CrLf(n,n+SDK_SER_LEN+2);
|
||||
if (i == 0)ErrorStop("list broken");//改行が見つからない
|
||||
}else{
|
||||
i = CrLf(n,fsize);
|
||||
if (i ==0)i = fsize;//改行以外でファイル終
|
||||
}
|
||||
if ((i-n) > GettedSerLen)//シリアルをリスト化
|
||||
{
|
||||
j = 0;
|
||||
while(n<i)
|
||||
{
|
||||
if ((readBuf[n] == 0x0d) || (readBuf[n] == 0x0a))break;
|
||||
s_list[list_ct][j] = readBuf[n];
|
||||
j++;n++;
|
||||
}
|
||||
s_list[list_ct][j] = 0;//終端
|
||||
list_ct++;
|
||||
if (list_ct>=LIST_MAX)ErrorStop("List too Long");
|
||||
}
|
||||
}
|
||||
if ((fsize-i) < GettedSerLen)break;//ファイル終
|
||||
n=i;//ポインタを改行の次へ
|
||||
}
|
||||
|
||||
//文字数チェック
|
||||
//開発初期のファームアップで空ID本体が発生してたので念の為
|
||||
//2011.5現在、製品で報告はない
|
||||
if (GettedSerLen < 11)ErrorStop("invalid Serial");
|
||||
|
||||
//本体シリアルがリストにあるかチェック
|
||||
n =0;
|
||||
while(n<list_ct)
|
||||
{
|
||||
if (GettedSerLen == strlen((char*)s_list[n]))
|
||||
{
|
||||
for(i=0;i<GettedSerLen;i++)
|
||||
{
|
||||
if (serialNo[i] != s_list[n][i])break;
|
||||
}
|
||||
if (i == GettedSerLen)
|
||||
{
|
||||
flg_applove = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
u32 mask = 0;
|
||||
|
||||
//メニュー表示
|
||||
if (flg_applove)//インポート許可本体
|
||||
{
|
||||
drawText(80,100,"Push X : Import");
|
||||
drawText(80,140,"Push Y : Delete"); //本体機能で消せるようなったら、そっち使う
|
||||
mask |= nn::hid::BUTTON_X | nn::hid::BUTTON_Y;
|
||||
}
|
||||
|
||||
|
||||
if (flg_test)//テストメニュー
|
||||
{
|
||||
drawText(80,160,"Push R : Test Data");
|
||||
mask |= nn::hid::BUTTON_R;
|
||||
}
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
if (mask == 0)ErrorStop("Serial Check");//実行できるメニューないときトラップ
|
||||
|
||||
u32 trg = WaitKey(mask);
|
||||
if (trg & nn::hid::BUTTON_R){
|
||||
shf_SetScale(0.6,0.6);
|
||||
TestMain();//テストデータへ
|
||||
}
|
||||
|
||||
nn::fs::MountRom(16, 16, romfsBuf, ROMFS_BUFFER_SIZE);
|
||||
|
||||
shf_SetScale(0.8,0.8);
|
||||
// CIA のプログラム ID を取得する。
|
||||
nn::am::ProgramInfo programInfo;
|
||||
if (nn::am::GetProgramInfoFromCia(&programInfo, ROMFS_IMPORTEE_PATH).IsFailure())ErrorStop("cia infomation");
|
||||
|
||||
// Imprting/Delete 表示
|
||||
s_RenderSystem.Clear();
|
||||
if(trg & nn::hid::BUTTON_X) drawText(10,120,"Importing");
|
||||
else drawText(10,120,"Delete");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
|
||||
// HOME ボタン禁止
|
||||
//Homeで中断するとアイコンが更新されない、電源OFF画面からHomeは問題なし
|
||||
prohibitHome = true;
|
||||
|
||||
// 既に存在するものをインポートするとエラーが返ってくるので、あらかじめ消しておく。
|
||||
nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, programInfo.id);
|
||||
// タイトル鍵が違うケースに対応するために、チケットも消しておく。
|
||||
nn::am::DeleteTicket(programInfo.id);
|
||||
|
||||
if(trg & nn::hid::BUTTON_X)
|
||||
{
|
||||
// CIA をインポート
|
||||
if (ImportFile(nn::fs::MEDIA_TYPE_NAND, ROMFS_IMPORTEE_PATH)==false)ErrorPoff("Import");
|
||||
}
|
||||
nn::fs::Unmount("rom:");
|
||||
|
||||
s_RenderSystem.Clear();
|
||||
drawText(10,50,"Complate");
|
||||
drawText(10,120,"Push Power Button & Power Off");
|
||||
drawText(10,140,"Home Button is invalid");
|
||||
s_RenderSystem.SwapBuffers();
|
||||
WaitKey(0);
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: OMakefile
|
||||
#
|
||||
# Copyright (C)2009 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 34658 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#表示にDemoライブラリを使用します
|
||||
#PC環境に合わせてサンプルデモのディレクトリを指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/sampledemos/common/include)
|
||||
INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
#LIBS += lib_demo libnn_am
|
||||
|
||||
.SUBDIRS: $(exist-dirs \
|
||||
body \
|
||||
Imp \
|
||||
)
|
||||
|
||||
DefineDefaultRules()
|
||||
@ -1,62 +0,0 @@
|
||||
#!/usr/bin/env omake
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: Horizon
|
||||
# File: Omakefile
|
||||
#
|
||||
# Copyright (C)2010 Nintendo Co., Ltd. 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.
|
||||
#
|
||||
# $Rev: 25650 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUPPORTED_TARGETS = CTR-T*.Process.MPCore.*
|
||||
CTR_APPTYPE = BOTH
|
||||
#CTR_APPTYPE = CARD
|
||||
#CTR_APPTYPE = NAND
|
||||
|
||||
#demoライブラリ位置指定
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../common/include)
|
||||
#SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir ../CTR_SDK/sampledemos/common/include)
|
||||
#INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR)
|
||||
|
||||
# ビルドするソースコードを指定します。
|
||||
SOURCES[] =
|
||||
./source/main.cpp
|
||||
./source/screen/screen.cpp
|
||||
../../common/savefile/savedata.cpp
|
||||
../../common/savefile/sdmcwo.cpp
|
||||
../../common/savefile/savefile.cpp
|
||||
../../common/gui/gui.cpp
|
||||
../../common/shfnt.cpp
|
||||
../../common/sleep.cpp
|
||||
../../common/common.cpp
|
||||
|
||||
#LIBS += lib_demo libnn_am
|
||||
|
||||
TARGET_PROGRAM = CtrSaveToSd
|
||||
|
||||
TITLE = body
|
||||
|
||||
# ROMFS のルートパスを指定します。
|
||||
#ROMFS_ROOT =
|
||||
|
||||
# 独自の RSF ファイルを指定する場合
|
||||
ROM_SPEC_FILE = body.rsf
|
||||
DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/repairtool.desc
|
||||
|
||||
# バナー、アイコン
|
||||
CTR_BANNER_SPEC = banner.bsf
|
||||
|
||||
|
||||
#Cia バージョン:マスタリング毎に更新すること
|
||||
#メジャーはrsfで指定(Remasterversion)
|
||||
MAKECIAFLAGS = -minor 0 -micro 0
|
||||
|
||||
include $(ROOT_OMAKE)/modulerules
|
||||
|
||||
build: $(DEFAULT_TARGETS)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user