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@101 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
4c9d4d1584
commit
0e2213f11d
247
trunk/CardSaveDataMover/ImpRun/HwCheckProgram.desc
Normal file
247
trunk/CardSaveDataMover/ImpRun/HwCheckProgram.desc
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
AccessControlDescriptor:
|
||||||
|
AffinityMask: 1
|
||||||
|
AutoGen: true
|
||||||
|
CoreVersion: 2
|
||||||
|
DescVersion: 2
|
||||||
|
Descriptor: |
|
||||||
|
AP///wAABAACAAAAAAAFGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAik8AAAAAAABBUFQ6VQAAAGFj
|
||||||
|
OmkAAAAAYWM6dQAAAABhbTp1AAAAAGNhbTpjAAAAY2RjOkNISwBjZmc6aQAA
|
||||||
|
AGNmZzpub3IAY3NuZDpTTkRkc3A6OkRTUGZzOkxEUgAAZnM6VVNFUgBnc3A6
|
||||||
|
OkdwdWdzcDo6TGNkaGlkOlNQVlJoaWQ6VVNFUmkyYzo6RUVQaXI6dQAAAABt
|
||||||
|
Y3U6OkhXQ21pYzp1AAAAbXA6dQAAAABuZG06dQAAAG5zOnMAAAAAbndtOjpF
|
||||||
|
WFRud206OlVEU3BzOnBzAAAAcHRtOnN5c21wdG06dQAAAHB4aTpkZXYAc29j
|
||||||
|
OlUAAABzc2w6QwAAAHkycjp1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAD+//vw/7//8ec/APIA8JH/APaR/1D/gf9Y/4H/cP+B/3j/gf9G
|
||||||
|
7OH/AQEA/wACAP7/////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////AAAAAAAAAAAAAAAAAAAA
|
||||||
|
AFcAAAAAAAAAAAAAAAAAAAI=
|
||||||
|
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:
|
||||||
|
- CategoryHardwareCheck
|
||||||
|
- Core
|
||||||
|
- DirectSdmc
|
||||||
|
- Debug
|
||||||
|
- CtrNandRw
|
||||||
|
- CtrNandRo
|
||||||
|
- CtrNandRoWrite
|
||||||
|
- ExportImportIvs
|
||||||
|
HandleTableSize: 512
|
||||||
|
IORegisterMapping:
|
||||||
|
- 1ff50000-1ff57fff
|
||||||
|
- 1ff70000-1ff77fff
|
||||||
|
- 1ec46000-1ec46fff
|
||||||
|
IdealProcessor: 1
|
||||||
|
IoAccessControl:
|
||||||
|
- FsMountNand
|
||||||
|
- FsMountNandRoWrite
|
||||||
|
- FsMountCardSpi
|
||||||
|
- FsMountTwln
|
||||||
|
- CreateSeed
|
||||||
|
MemoryMapping:
|
||||||
|
- 1f000000-1f5fffff:r
|
||||||
|
MemoryType: Application
|
||||||
|
Priority: 24
|
||||||
|
ProgramId: 0x00040000ffffff00L
|
||||||
|
ServiceAccessControl:
|
||||||
|
- APT:U
|
||||||
|
- ac:i
|
||||||
|
- ac:u
|
||||||
|
- am:u
|
||||||
|
- cam:c
|
||||||
|
- cdc:CHK
|
||||||
|
- cfg:i
|
||||||
|
- cfg:nor
|
||||||
|
- csnd:SND
|
||||||
|
- dsp::DSP
|
||||||
|
- fs:LDR
|
||||||
|
- fs:USER
|
||||||
|
- gsp::Gpu
|
||||||
|
- gsp::Lcd
|
||||||
|
- hid:SPVR
|
||||||
|
- hid:USER
|
||||||
|
- i2c::EEP
|
||||||
|
- ir:u
|
||||||
|
- mcu::HWC
|
||||||
|
- mic:u
|
||||||
|
- mp:u
|
||||||
|
- ndm:u
|
||||||
|
- ns:s
|
||||||
|
- nwm::EXT
|
||||||
|
- nwm::UDS
|
||||||
|
- ps:ps
|
||||||
|
- ptm:sysm
|
||||||
|
- ptm:u
|
||||||
|
- pxi:dev
|
||||||
|
- soc:U
|
||||||
|
- ssl:C
|
||||||
|
- y2r:u
|
||||||
|
Signature: |
|
||||||
|
e0CSCrqD3wPFl2u8hu451WhejFQAZDOZsOkUWq7YOgMSZOxV97TpVvSJtS2Y
|
||||||
|
bFRBowRLK2rYEiEEyl0cUmlKKS8ZuaHmy5FEunsKFqksp9SFq4yjG95RKjK/
|
||||||
|
q9Msu1hvmHo1/YnQbtRZSd9MPlxNB0ed0Ue2HZxL1JMipSz0OAaNT+MNQ2yU
|
||||||
|
JhIpVcKoV6ZbDGuw68CFy51vvERHpr5pXN8QcBkEoR9li1rWf/ZOx4mQuEKv
|
||||||
|
acb3N/c2eLs2x9xY6W07PJ8+XZnO6yM9NLv1kE2Z2+4p1JG6jLNqyP5cwO7k
|
||||||
|
jxzVx4PzDQSHwfegM3kBvZjzA//o4OikZQhdmRQPsQ==
|
||||||
|
StorageId:
|
||||||
|
- 0
|
||||||
|
CommonHeaderKey:
|
||||||
|
D: |
|
||||||
|
2GXY4PQJVuIf0Eq0/ptFqXSsUAoKTEjsvzXEjuq2FeOksquwh1RQ2SWS8Wa/
|
||||||
|
7ddQitmIlC6gQza4FMIvSE+mfNXheE3MQlvBaLLfsf659NE33IeAQpEaZLq7
|
||||||
|
Rv2FUxO+L4DxwtSK/Q7i0Ixl35XOKklhWfks3AUPCeSET17gyd8PpVlKbcZh
|
||||||
|
jK9v5TqzMrooQji65HkXXMp1jf4Xv24Me+1VFRDxPzO0Mo/c+QCrI3NiwwoC
|
||||||
|
gSnjXC3d1mJxkEovOZ8NOxE0YKSY2+7edhoRZSWSIhNWp9a+jMoeTiQaJbqK
|
||||||
|
mZXxIG9akIUMeMCORaTfEukYWk+6DlcCZ/e7yfURQQ==
|
||||||
|
DP: |
|
||||||
|
kSu2W+RJCEsDBXMwxv7C5i0vSGXzw2AuR6wzwD64H2olm8gFPBsCnLoyAdHE
|
||||||
|
DJaMtssBpD7piDBDMlFqZ67ai4oGJFyUgjOAdzvEfsc30HMbfEgUdE9zST8h
|
||||||
|
5qep/HxGtLnJ0699D4MTArkkuxGRgbYh7DRCSp+8xE2N0A2Jd/k=
|
||||||
|
DQ: |
|
||||||
|
ZU1KBdyU4QhHEu+wrIIzf27/6xI1tu5nov0rRVBEsyj7FRr0X+BkF8KcBvT7
|
||||||
|
l9vkiWgPcF3GyjWMwmuAnu8equh3YeVlfbmyseaeGtVzFStCXUWb6uGOOhPU
|
||||||
|
eKDix+LFcPu+s/lpUMgvNWNBvlOczHsBZ/T1TYYK4gqml80qxUU=
|
||||||
|
Exponent: |
|
||||||
|
AQAB
|
||||||
|
InverseQ: |
|
||||||
|
UE3F4n7dFZv4UC/y0/sZ/Gq4fh3bztdKMCWJwQMzXgo7vwFMoLKikx1HsqIN
|
||||||
|
6ufBvEqfzTRqtv43fR+oONOfI1gH5HDtNSpWCcM+heVQ9YjdBqWU2FkFVH+V
|
||||||
|
feByXnjkJG+ojvPjEQd6N0PWc35VYn/Ak/jQVgNmbVrMNGST2vI=
|
||||||
|
Modulus: |
|
||||||
|
5C7+erLWS6NNWNj5akUEmYfRGLTyOCmfONoFwLrr3n7XQ9lDInRJVutjpBr1
|
||||||
|
tIFLgDCVp/u8D8eRVJAUmt4Whjq2aXETRvo/vxptv5s3vEw8bHk/ifkzENv7
|
||||||
|
683VKmFHJ9WyDWd92ShuUbdmwlR6crPD6QsRH4rev2WU/VgUd0qFozV8/Q+i
|
||||||
|
GQaR4otY7d+YI0QECkCcIxst+3LGxrqqA6ooO7v3f6F+NHs50GbmTQyt2sYJ
|
||||||
|
h8MshKb0bMnUjEeN+2CMRCREjlpDesN93YFP57vVHiVHPWmjYMm+dFRfHjhU
|
||||||
|
uXAUOauI26P6U+7u5oHzQQQ2n1VkazElql9X03fYdw==
|
||||||
|
P: |
|
||||||
|
/nfZRR6EX1btIewMjxL+QOlHDng1hrIzYTf6Y2/iaF2X6N4upLdGW/LYSW1K
|
||||||
|
83JNDY4tL5Pa6Ox+xYCfBmPfpKnR6+pee1uT8Z9mJiZxmubbYJ+gAY98RCi4
|
||||||
|
h0FFZ0UfeejRx0KWIwDdxtdhEPEax+7vOhQXw/p2nqZfPZ6d9as=
|
||||||
|
Q: |
|
||||||
|
5Y6jn//0FQq4aMsN9fzUxh+GJev8AlaA+0oHcJAfnPtoejT2xmik/zxyRYe6
|
||||||
|
XL5ZtvF/4mARoejRLt8/wz1Y/IN8V9DVLTLNukcmZxU8B2Kl5zuS2F3EWp/L
|
||||||
|
tU29P0/vCbiHUoH42XtZLVVriR2wkM/j16g82dEbd7KJGWAtxGU=
|
||||||
|
DefaultSpec:
|
||||||
|
AccessControlInfo:
|
||||||
|
AffinityMask: 1
|
||||||
|
FirmwareVersion: 2
|
||||||
|
HandleTableSize: 512
|
||||||
|
IORegisterMapping:
|
||||||
|
- 1ff50000-1ff57fff
|
||||||
|
- 1ff70000-1ff77fff
|
||||||
|
IdealProcessor: 0
|
||||||
|
MemoryMapping:
|
||||||
|
- 1f000000-1f5fffff:r
|
||||||
|
Priority: 16
|
||||||
|
BasicInfo:
|
||||||
|
CompanyCode: "00"
|
||||||
|
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
|
||||||
|
ir: 0x0004013000003302L
|
||||||
|
mcu: 0x0004013000001f02L
|
||||||
|
mic: 0x0004013000002002L
|
||||||
|
mp: 0x0004013000002a02L
|
||||||
|
ndm: 0x0004013000002b02L
|
||||||
|
nim: 0x0004013000002c02L
|
||||||
|
nwm: 0x0004013000002d02L
|
||||||
|
pdn: 0x0004013000002102L
|
||||||
|
ptm: 0x0004013000002202L
|
||||||
|
socket: 0x0004013000002e02L
|
||||||
|
spi: 0x0004013000002302L
|
||||||
|
ssl: 0x0004013000002f02L
|
||||||
|
StackSize: 16384
|
||||||
|
TitleInfo:
|
||||||
|
Use: Evaluation
|
||||||
16
trunk/CardSaveDataMover/ImpRun/ImportAndRun.rsf
Normal file
16
trunk/CardSaveDataMover/ImpRun/ImportAndRun.rsf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
BasicInfo:
|
||||||
|
Title : $(TITLE)
|
||||||
|
BackupMemoryType: None
|
||||||
|
Logo : Nintendo
|
||||||
|
# Companycode: "00"
|
||||||
|
ProductCode : "CTR-N-22MA"
|
||||||
|
# MediaSize: 2GB
|
||||||
|
|
||||||
|
Rom:
|
||||||
|
HostRoot : $(ROMFS_ROOT)
|
||||||
|
|
||||||
|
|
||||||
|
TitleInfo:
|
||||||
|
# UniqueId: 0xffff6
|
||||||
|
UniqueId: 0xf8015
|
||||||
|
Version: 0
|
||||||
63
trunk/CardSaveDataMover/ImpRun/OMakefile
Normal file
63
trunk/CardSaveDataMover/ImpRun/OMakefile
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/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[] =
|
||||||
|
main.cpp
|
||||||
|
sleep.cpp
|
||||||
|
test_data.cpp
|
||||||
|
|
||||||
|
TARGET_PROGRAM = CtrSaveDataMover_imp
|
||||||
|
|
||||||
|
TITLE = Importer
|
||||||
|
|
||||||
|
LIBS += libnn_am lib_demo
|
||||||
|
|
||||||
|
IMPORTEE_CIA = importee.cia
|
||||||
|
|
||||||
|
SRC_IMPORTEE_PATH = ../SaveDataTool/images/$(BUILD_TARGET_DIR)/$(BUILD_TYPE_DIR)/CtrSaveDataMover.cia
|
||||||
|
#とりあえず、マスタリング時は直おき
|
||||||
|
#SRC_IMPORTEE_PATH = CtrSaveDataMover_master.cia
|
||||||
|
|
||||||
|
# ビルドタイプ別に romfs を作る
|
||||||
|
ROMFS_ROOT = $`(TARGET.getObjectDirectory)/romfsroot
|
||||||
|
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 = ImportAndRun.rsf
|
||||||
|
#DESCRIPTOR = HwCheckProgram.desc
|
||||||
|
DESCRIPTOR = $(CTRSDK_ROOT)/resources/specfiles/repairtool.desc
|
||||||
|
|
||||||
|
# バナー、アイコン
|
||||||
|
CTR_BANNER_SPEC = banner.bsf
|
||||||
|
|
||||||
|
include $(ROOT_OMAKE)/modulerules
|
||||||
|
|
||||||
|
build: $(DEFAULT_TARGETS)
|
||||||
|
|
||||||
73
trunk/CardSaveDataMover/ImpRun/OMakeroot
Normal file
73
trunk/CardSaveDataMover/ImpRun/OMakeroot
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
#!/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: .
|
||||||
|
|
||||||
BIN
trunk/CardSaveDataMover/ImpRun/banner.bsf
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner.bsf
Normal file
Binary file not shown.
@ -0,0 +1,274 @@
|
|||||||
|
<?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
BIN
trunk/CardSaveDataMover/ImpRun/banner/banner_dummy.bcwav
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner/banner_dummy.bcwav
Normal file
Binary file not shown.
BIN
trunk/CardSaveDataMover/ImpRun/banner/banner_imp.cbmd
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner/banner_imp.cbmd
Normal file
Binary file not shown.
BIN
trunk/CardSaveDataMover/ImpRun/banner/demo1.cbmd
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner/demo1.cbmd
Normal file
Binary file not shown.
BIN
trunk/CardSaveDataMover/ImpRun/banner/icon2_24.ctpk
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner/icon2_24.ctpk
Normal file
Binary file not shown.
BIN
trunk/CardSaveDataMover/ImpRun/banner/icon2_48.ctpk
Normal file
BIN
trunk/CardSaveDataMover/ImpRun/banner/icon2_48.ctpk
Normal file
Binary file not shown.
294
trunk/CardSaveDataMover/ImpRun/main.cpp
Normal file
294
trunk/CardSaveDataMover/ImpRun/main.cpp
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
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/srv.h>
|
||||||
|
#include <nn/fs.h>
|
||||||
|
//#include <nn/ns/CTR/ns_ApiShell.h>
|
||||||
|
//#include <nn/ns/CTR/ns_Shell.h>
|
||||||
|
#include <nn/am/am_ApiLocalImporter.h>
|
||||||
|
#include <nn/am/am_ApiSystemMenu.h>
|
||||||
|
#include <nn/applet.h>
|
||||||
|
#include <nn/ndm.h>
|
||||||
|
#include "demo.h"
|
||||||
|
#include "../SaveDataTool/ver.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "sleep.h"
|
||||||
|
#include "test_data.h"
|
||||||
|
|
||||||
|
demo::RenderSystemDrawing s_RenderSystem;
|
||||||
|
nn::fnd::ExpHeap appHeap;
|
||||||
|
uptr heapForGx;
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
bit8 readBuf[64 * 1024];
|
||||||
|
}
|
||||||
|
|
||||||
|
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, sizeof(readBuf)))
|
||||||
|
{
|
||||||
|
stream->Write(readBuf, read);
|
||||||
|
}
|
||||||
|
result = nn::am::EndImportProgram(stream);
|
||||||
|
}
|
||||||
|
return result.IsSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//終了処理
|
||||||
|
void finish(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
SleepHandler::Finalize();//SLEEP
|
||||||
|
|
||||||
|
nn::hid::Finalize();
|
||||||
|
|
||||||
|
// nngxFinalize 関数呼び出しと VSync 割り込みが同時に発生すると
|
||||||
|
// 画面が暗転したまま止まる不具合を回避するために VSync 待ちを行う
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY_BOTH);
|
||||||
|
s_RenderSystem.Finalize();
|
||||||
|
|
||||||
|
nn::fs::Finalize();
|
||||||
|
|
||||||
|
appHeap.Free(reinterpret_cast<void*>(heapForGx));
|
||||||
|
appHeap.Finalize();
|
||||||
|
|
||||||
|
nn::os::SetDeviceMemorySize(0);
|
||||||
|
nn::os::SetHeapSize(0);
|
||||||
|
|
||||||
|
NN_LOG("End\n");
|
||||||
|
nn::applet::PrepareToCloseApplication();
|
||||||
|
nn::applet::CloseApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
nn::hid::PadReader *hpr;
|
||||||
|
//---------------------------------------------------------------- 入力待ち
|
||||||
|
nn::hid::PadStatus padStatus;
|
||||||
|
u32 WaitKey(u32 mask)
|
||||||
|
{
|
||||||
|
|
||||||
|
while(1){
|
||||||
|
hpr->ReadLatest(&padStatus);
|
||||||
|
if(padStatus.trigger & mask)return padStatus.trigger;
|
||||||
|
|
||||||
|
// 終了要求をチェック
|
||||||
|
if ( nn::applet::IsExpectedToCloseApplication() )
|
||||||
|
{
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
// アプリケーションの遷移処理を行う
|
||||||
|
|
||||||
|
// HOMEボタン処理(グラフィックスライブラリが初期化済みでなければならない)
|
||||||
|
if ( nn::applet::IsExpectedToProcessHomeButton() )
|
||||||
|
{
|
||||||
|
// スリープ要求を REJECT するように
|
||||||
|
nn::applet::DisableSleep();
|
||||||
|
|
||||||
|
nn::applet::ProcessHomeButton();
|
||||||
|
nn::applet::AppletWakeupState wState = nn::applet::WaitForStarting();
|
||||||
|
NN_UNUSED_VAR(wState);
|
||||||
|
|
||||||
|
|
||||||
|
// HOME メニューからの中断やバッテリー不足の要因により
|
||||||
|
// アプリ終了と判断された場合、アプリのメインループを抜けて終了処理へ
|
||||||
|
if ( nn::applet::IsExpectedToCloseApplication() )
|
||||||
|
{
|
||||||
|
// 描画権は渡されていない
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
//nn::applet::EnableSleep(true);
|
||||||
|
|
||||||
|
// グラフィックの設定を戻す
|
||||||
|
nngxUpdateState(NN_GX_STATE_ALL);
|
||||||
|
nngxValidateState(NN_GX_STATE_ALL,GL_TRUE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 電源ボタン処理(グラフィックスライブラリが初期化済みでなければならない)
|
||||||
|
if ( nn::applet::IsExpectedToProcessPowerButton() )
|
||||||
|
{
|
||||||
|
nn::applet::DisableSleep();
|
||||||
|
nn::applet::ProcessPowerButton();
|
||||||
|
nn::applet::AppletWakeupState wState = nn::applet::WaitForStarting();
|
||||||
|
NN_UNUSED_VAR(wState);
|
||||||
|
|
||||||
|
|
||||||
|
// アプリ終了と判断された場合、アプリのメインループを抜けて終了処理へ
|
||||||
|
if ( nn::applet::IsExpectedToCloseApplication() )
|
||||||
|
{
|
||||||
|
// 描画権は渡されていない
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
// nn::applet::EnableSleep(true);
|
||||||
|
|
||||||
|
// グラフィックの設定を戻す
|
||||||
|
nngxUpdateState(NN_GX_STATE_ALL);
|
||||||
|
nngxValidateState(NN_GX_STATE_ALL,GL_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char ver[16];
|
||||||
|
void nnMain( void )
|
||||||
|
{
|
||||||
|
nn::Result result;
|
||||||
|
|
||||||
|
nn::os::Initialize();
|
||||||
|
nn::fs::Initialize();
|
||||||
|
|
||||||
|
//DEA-SUPにて推奨のフリーズ暫定対策:無線デーモンを停止 (2011.3.1 現在)
|
||||||
|
//ただし、スリープ時の"いつのまに通信"は止まらない
|
||||||
|
//無線は使わないが念の為、本体スイッチで切っとくのが確実
|
||||||
|
nn::ndm::SuspendScheduler();
|
||||||
|
|
||||||
|
SleepHandler::Initialize();
|
||||||
|
|
||||||
|
// アプレットライブラリに関する機能を有効にする
|
||||||
|
nn::applet::Enable(false);
|
||||||
|
// gx, snd, dsp 各ライブラリの Initialize 関数は applet::Enable() の後に呼ばれなければならない
|
||||||
|
// 特に、gx の初期化である nngxInitialize 関数は、Enable() 直後の終了判定の後に行われるべき
|
||||||
|
|
||||||
|
// ロゴ表示時に電源ボタンが押されたなど、既に終了条件が立っていた場合、ここでアプリを終了させる
|
||||||
|
if ( nn::applet::IsExpectedToCloseApplication() )
|
||||||
|
{
|
||||||
|
SleepHandler::Finalize();
|
||||||
|
result = nn::applet::PrepareToCloseApplication();
|
||||||
|
NN_UTIL_PANIC_IF_FAILED( result );
|
||||||
|
nn::applet::CloseApplication();
|
||||||
|
}
|
||||||
|
// グラフィックスライブラリの初期化は、以降で行わなければならない
|
||||||
|
// 他、アプリケーションの初期化処理
|
||||||
|
|
||||||
|
nn::hid::Initialize();
|
||||||
|
nn::hid::PadReader padReader;
|
||||||
|
hpr = &padReader;
|
||||||
|
|
||||||
|
//result = nn::ns::CTR::InitializeForShell();
|
||||||
|
//if (result.IsSuccess())
|
||||||
|
result = nn::am::InitializeForLocalImporter();
|
||||||
|
|
||||||
|
nn::applet::DisableSleep();//スリープ非対応
|
||||||
|
|
||||||
|
const size_t ROMFS_BUFFER_SIZE = 1024 * 64;
|
||||||
|
static char buffer[ROMFS_BUFFER_SIZE];
|
||||||
|
|
||||||
|
// ヒープの確保
|
||||||
|
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);
|
||||||
|
s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.SetFontSize(12);
|
||||||
|
s_RenderSystem.SetColor(1.0, 1.0, 1.0,1.0);
|
||||||
|
s_RenderSystem.DrawText(10,20,"CTR Card Savedata Mover Setup");
|
||||||
|
sprintf(ver,"version %.2f",VERSION);
|
||||||
|
s_RenderSystem.DrawText(10,40,ver);
|
||||||
|
|
||||||
|
if (result.IsFailure()){//初期化に失敗
|
||||||
|
s_RenderSystem.SetColor(1.0, 0.0, 0.0,1.0);
|
||||||
|
s_RenderSystem.DrawText(10,70,"Initialize Error");
|
||||||
|
s_RenderSystem.DrawText(10,90,"check *.desc file");
|
||||||
|
s_RenderSystem.DrawText(10,110,"Push B : Quit");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
while(1){
|
||||||
|
padReader.ReadLatest(&padStatus);
|
||||||
|
if(padStatus.trigger & nn::hid::BUTTON_B)break;
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
nn::fs::MountRom(16, 16, buffer, ROMFS_BUFFER_SIZE);
|
||||||
|
|
||||||
|
s_RenderSystem.SetColor(1.0, 1.0, 1.0,1.0);
|
||||||
|
s_RenderSystem.DrawText(10,20,"CTR Card Savedata Mover Setup");
|
||||||
|
sprintf(ver,"version %.2f",VERSION);
|
||||||
|
s_RenderSystem.DrawText(10,40,ver);
|
||||||
|
s_RenderSystem.DrawText(80,100,"Push X : Inport");
|
||||||
|
s_RenderSystem.DrawText(80,140,"Push Y : Delete");
|
||||||
|
s_RenderSystem.DrawText(80,160,"Push R : Test Data");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
u32 trg = WaitKey(nn::hid::BUTTON_X | nn::hid::BUTTON_Y | nn::hid::BUTTON_R);
|
||||||
|
if (trg & nn::hid::BUTTON_R)TestMain();//テストデータへ
|
||||||
|
// CIA のプログラム ID を取得する。
|
||||||
|
nn::am::ProgramInfo programInfo;
|
||||||
|
if (nn::am::GetProgramInfoFromCia(&programInfo, ROMFS_IMPORTEE_PATH).IsFailure())
|
||||||
|
{
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.SetColor(1.0, 0.0, 0.0,1.0);
|
||||||
|
s_RenderSystem.DrawText(10,50,"cia infomation Error");
|
||||||
|
s_RenderSystem.DrawText(10,70,"Push B : Quit");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
while(1){
|
||||||
|
padReader.ReadLatest(&padStatus);
|
||||||
|
if(padStatus.trigger & nn::hid::BUTTON_B)break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
if(padStatus.trigger & nn::hid::BUTTON_X)
|
||||||
|
s_RenderSystem.DrawText(50,70,"Inporting");
|
||||||
|
else s_RenderSystem.DrawText(50,70,"Delete");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
// 既に存在するものをインポートするとエラーが返ってくるので、あらかじめ消しておく。
|
||||||
|
nn::am::DeleteProgram(nn::fs::MEDIA_TYPE_NAND, programInfo.id);
|
||||||
|
// タイトル鍵が違うケースに対応するために、チケットも消しておく。
|
||||||
|
nn::am::DeleteTicket(programInfo.id);
|
||||||
|
|
||||||
|
if(padStatus.trigger & nn::hid::BUTTON_X)
|
||||||
|
{
|
||||||
|
// CIA をインポート
|
||||||
|
if (ImportFile(nn::fs::MEDIA_TYPE_NAND, ROMFS_IMPORTEE_PATH)==false)
|
||||||
|
{
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.SetColor(1.0, 0.0, 0.0,1.0);
|
||||||
|
s_RenderSystem.DrawText(50,50,"Impoprt fail");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(50,50,"Complate");
|
||||||
|
}
|
||||||
|
|
||||||
|
s_RenderSystem.DrawText(10,80,"Push Power Button & Power Off");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
WaitKey(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
110
trunk/CardSaveDataMover/ImpRun/sleep.cpp
Normal file
110
trunk/CardSaveDataMover/ImpRun/sleep.cpp
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: Horizon
|
||||||
|
File: sleep.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.
|
||||||
|
|
||||||
|
$Rev$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <nn/applet.h>
|
||||||
|
|
||||||
|
#include "sleep.h"
|
||||||
|
|
||||||
|
//extern nn::os::CriticalSection g_SleepCS;
|
||||||
|
//extern nn::os::LightEvent g_TransitionEvent;
|
||||||
|
//extern nn::os::LightEvent g_AwakeEvent;
|
||||||
|
|
||||||
|
volatile bool SleepHandler::s_IsAfterWakeUp = false;
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
void SleepHandler::Initialize( void )
|
||||||
|
{
|
||||||
|
nn::applet::SetSleepQueryCallback(SleepQueryCallback, 0);
|
||||||
|
nn::applet::SetAwakeCallback(AwakeCallback, 0);
|
||||||
|
// nn::applet::SetSleepCancelCallback(NULL, 0); // CancelCallback は使わないことを推奨します
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
void SleepHandler::Finalize( void )
|
||||||
|
{
|
||||||
|
nn::applet::SetSleepQueryCallback(NULL, 0);
|
||||||
|
nn::applet::SetAwakeCallback(NULL, 0);
|
||||||
|
|
||||||
|
nn::applet::DisableSleep();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*
|
||||||
|
システムスリープの指示が来ているかどうかを返します。
|
||||||
|
*------------------------------------------------------------------------*/
|
||||||
|
bool SleepHandler::IsSleepRequested( void )
|
||||||
|
{
|
||||||
|
if ( nn::applet::IsExpectedToReplySleepQuery() )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*
|
||||||
|
本体スリープ状態に移行させるための処理を行います。
|
||||||
|
グラフィックスなどの処理がスリープに入っても問題ない
|
||||||
|
適切なタイミングで呼び出す必要があります。
|
||||||
|
*------------------------------------------------------------------------*/
|
||||||
|
void SleepHandler::SleepSystem( void )
|
||||||
|
{
|
||||||
|
// SleepHandler::IsSleepRequested() == true における呼び出しが前提
|
||||||
|
|
||||||
|
// 何らかの理由で SleepQuery に対して REJECT を返す場合は、ここで判定して
|
||||||
|
// REJECT を返し、この関数を抜ける
|
||||||
|
|
||||||
|
// ファイルシステム処理中はスリープをしない
|
||||||
|
//if ( g_SleepCS.TryEnter() )
|
||||||
|
{
|
||||||
|
// スリープ前処理
|
||||||
|
|
||||||
|
nn::applet::ReplySleepQuery(nn::applet::REPLY_ACCEPT);
|
||||||
|
|
||||||
|
//g_AwakeEvent.Wait();
|
||||||
|
|
||||||
|
// スリープ復帰時の処理
|
||||||
|
|
||||||
|
// g_SleepCS.Leave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*
|
||||||
|
スリープ問い合わせ時に呼ばれるコールバック
|
||||||
|
*------------------------------------------------------------------------*/
|
||||||
|
AppletQueryReply SleepHandler::SleepQueryCallback( uptr arg )
|
||||||
|
{
|
||||||
|
NN_UNUSED_VAR(arg);
|
||||||
|
//g_AwakeEvent.ClearSignal();
|
||||||
|
|
||||||
|
if ( !nn::applet::IsActive() )
|
||||||
|
{
|
||||||
|
// Inactive なとき、メインスレッドは applet::WaitForStarting() で停止状態であり、
|
||||||
|
// 他のスレッドも停止状態になっているはず(アプリケーション側の実装依存)
|
||||||
|
return nn::applet::REPLY_ACCEPT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nn::applet::REPLY_LATER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*
|
||||||
|
スリープ復帰時に呼ばれるコールバック
|
||||||
|
*------------------------------------------------------------------------*/
|
||||||
|
void SleepHandler::AwakeCallback( uptr arg )
|
||||||
|
{
|
||||||
|
NN_UNUSED_VAR(arg);
|
||||||
|
//g_AwakeEvent.Signal();
|
||||||
|
|
||||||
|
s_IsAfterWakeUp = true;
|
||||||
|
}
|
||||||
46
trunk/CardSaveDataMover/ImpRun/sleep.h
Normal file
46
trunk/CardSaveDataMover/ImpRun/sleep.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: Horizon
|
||||||
|
File: sleep.h
|
||||||
|
|
||||||
|
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$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef NN_SAMPLE_DEMOS_DEMO2_SLEEP_H_
|
||||||
|
#define NN_SAMPLE_DEMOS_DEMO2_SLEEP_H_
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*
|
||||||
|
本体スリープに関連する処理
|
||||||
|
*------------------------------------------------------------------------*/
|
||||||
|
class SleepHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SleepHandler() {}
|
||||||
|
~SleepHandler() {}
|
||||||
|
|
||||||
|
static void Initialize( void );
|
||||||
|
static void Finalize( void );
|
||||||
|
static bool IsSleepRequested( void );
|
||||||
|
static void SleepSystem( void );
|
||||||
|
|
||||||
|
static AppletQueryReply SleepQueryCallback( uptr arg );
|
||||||
|
static void AwakeCallback( uptr arg );
|
||||||
|
static void CancelCallback( uptr arg );
|
||||||
|
|
||||||
|
// スリープからの復帰後、1フレーム分描画を待ってから LCD を有効にするためのフラグ
|
||||||
|
static volatile bool s_IsAfterWakeUp;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static nn::os::LightEvent s_AwakeEvent;
|
||||||
|
static bool s_IsInitialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NN_SAMPLE_DEMOS_DEMO2_SLEEP_H_
|
||||||
664
trunk/CardSaveDataMover/ImpRun/test_data.cpp
Normal file
664
trunk/CardSaveDataMover/ImpRun/test_data.cpp
Normal file
@ -0,0 +1,664 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
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/hid.h>
|
||||||
|
#include "demo.h"
|
||||||
|
|
||||||
|
nn::Result res;
|
||||||
|
|
||||||
|
nn::fs::FileOutputStream fout;
|
||||||
|
nn::fs::FileInputStream fin;
|
||||||
|
|
||||||
|
nn::fs::Directory dc[256];
|
||||||
|
|
||||||
|
wchar_t file_pathw[1024];
|
||||||
|
char file_path[1024];
|
||||||
|
char file_path2[1024];
|
||||||
|
char src_buff[1024*1024];
|
||||||
|
char get_buff[1024*1024];
|
||||||
|
char str[512];
|
||||||
|
|
||||||
|
|
||||||
|
extern demo::RenderSystemDrawing s_RenderSystem;
|
||||||
|
|
||||||
|
//終了処理
|
||||||
|
extern void finish(void);
|
||||||
|
extern u32 WaitKey(u32 mask);
|
||||||
|
|
||||||
|
//---------------------------------------- テストパターン
|
||||||
|
void make_pattern()
|
||||||
|
{
|
||||||
|
int i,j;
|
||||||
|
j=0;
|
||||||
|
for (i=0;i<1024*1024;i++){
|
||||||
|
src_buff[i] = j+i;
|
||||||
|
if (i & 0x100)j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//TEST ライト
|
||||||
|
s32 size;
|
||||||
|
#define SIZE_TEST1 421888
|
||||||
|
//#define SIZE_TEST1 20000
|
||||||
|
bool Test1_W()
|
||||||
|
{
|
||||||
|
int total,size2;
|
||||||
|
|
||||||
|
res = nn::fs::FormatSaveData(1,0,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"format Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = nn::fs::TryCreateFile(L"data:/test1.bin",SIZE_TEST1);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Create Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fout.TryInitialize(L"data:/test1.bin",true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
total =0;
|
||||||
|
size2 = 512;
|
||||||
|
//size2 = 4096;
|
||||||
|
//size2 = SIZE_TEST1;
|
||||||
|
while(1){
|
||||||
|
res = fout.TryWrite( &size,&src_buff[total],size2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"write Fail");
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
total += size;
|
||||||
|
sprintf(str,"size %d",total);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
//if (size<512)break;
|
||||||
|
if (total >= SIZE_TEST1)break;
|
||||||
|
if ((SIZE_TEST1 - total) < 512)size2 = SIZE_TEST1 - total ;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::CommitSaveData();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
NN_LOG("total %d",total);
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ベリファイ
|
||||||
|
bool Test1_V()
|
||||||
|
{
|
||||||
|
int i,total;
|
||||||
|
|
||||||
|
res = fin.TryInitialize(L"data:/test1.bin");
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
total =0;
|
||||||
|
while(1){
|
||||||
|
res = fin.TryRead( &size,&get_buff[total],512);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"read Fail");
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//if (size == 0)break;
|
||||||
|
for (i=0;i<size;i++) if (src_buff[total+i] != get_buff[total+i])
|
||||||
|
{
|
||||||
|
s_RenderSystem.DrawText(8,100,"verifi Fail at %d",total+i);
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (total >= SIZE_TEST1)break;
|
||||||
|
|
||||||
|
total += size;
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
sprintf(str,"now %d",total);
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
if (size<512)break;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//ファイル数
|
||||||
|
bool Test2_W(int n)
|
||||||
|
{
|
||||||
|
int total,size2;
|
||||||
|
|
||||||
|
res = nn::fs::FormatSaveData(700,1,false);//dupなしファイル680
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"format Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
total =0;
|
||||||
|
int num = 0;
|
||||||
|
size2 = 512;
|
||||||
|
while(1){
|
||||||
|
sprintf(file_path,"data:/test%d.bin",num);
|
||||||
|
// res = nn::fs::TryCreateFile(L"data:/test2.bin",SIZE_TEST1);
|
||||||
|
// if (res.IsFailure()){
|
||||||
|
// s_RenderSystem.DrawText(8,100,"Create Fail");
|
||||||
|
// nn::fs::Unmount("data:");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
res = fout.TryInitialize(file_path,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fout.TryWrite( &size,&src_buff[total],size2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"write Fail");
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
total += size;
|
||||||
|
num++;
|
||||||
|
sprintf(str,"size %d , num %d",total,num);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
//if (size<512)break;
|
||||||
|
if (num == n)break;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::CommitSaveData();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
NN_LOG("total %d",total);
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Test2_V(int n)
|
||||||
|
{
|
||||||
|
int total,size2,i;
|
||||||
|
|
||||||
|
total =0;
|
||||||
|
int num = 0;
|
||||||
|
size2 = 512;
|
||||||
|
while(1){
|
||||||
|
sprintf(file_path,"data:/test%d.bin",num);
|
||||||
|
res = fin.TryInitialize(file_path);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fin.TryRead( &size,&get_buff[total],size2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"read Fail");
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (i=0;i<size;i++) if (src_buff[total+i] != get_buff[total+i])
|
||||||
|
{
|
||||||
|
s_RenderSystem.DrawText(8,100,"verifi Fail at %d",total+i);
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
fin.Finalize();
|
||||||
|
|
||||||
|
total += size;
|
||||||
|
num++;
|
||||||
|
sprintf(str,"size %d , num %d",total,num);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
//if (size<512)break;
|
||||||
|
if (num == n)break;
|
||||||
|
}
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
NN_LOG("total %d",total);
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DirDepth 80
|
||||||
|
|
||||||
|
//ディレクトリ深度
|
||||||
|
bool Test3_W()
|
||||||
|
{
|
||||||
|
int total,size2;
|
||||||
|
|
||||||
|
res = nn::fs::FormatSaveData(200,200,false);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"format Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int num = 0;
|
||||||
|
total =0;
|
||||||
|
size2 = 512;
|
||||||
|
strcpy(file_path,"data:");
|
||||||
|
while(1){
|
||||||
|
sprintf(str,"/%d",num);
|
||||||
|
strcat(file_path,str);
|
||||||
|
res = nn::fs::TryCreateDirectory(file_path);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
sprintf(str,"length = %d",(int)strlen(file_path));
|
||||||
|
s_RenderSystem.DrawText(8,110,str);
|
||||||
|
s_RenderSystem.DrawText(8,100,"Dir create Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
strcpy(file_path2,file_path);
|
||||||
|
sprintf(str,"/t%d.bin",num);
|
||||||
|
strcat(file_path2,str);
|
||||||
|
res = fout.TryInitialize(file_path2,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fout.TryWrite( &size,&src_buff[total],size2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"write Fail");
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
|
||||||
|
num++;
|
||||||
|
total+=size;
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
sprintf(str,"num %d",num);
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
if (num == DirDepth)break;
|
||||||
|
}
|
||||||
|
|
||||||
|
nn::fs::CommitSaveData();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
sprintf(str,"length = %d",(int)strlen(file_path2));
|
||||||
|
s_RenderSystem.DrawText(8,110,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Test3_V()
|
||||||
|
{
|
||||||
|
int i,total,size2;
|
||||||
|
|
||||||
|
int num = 0;
|
||||||
|
total =0;
|
||||||
|
size2 = 512;
|
||||||
|
strcpy(file_path,"data:");
|
||||||
|
while(1){
|
||||||
|
sprintf(str,"/%d",num);
|
||||||
|
strcat(file_path,str);
|
||||||
|
strcpy(file_path2,file_path);
|
||||||
|
sprintf(str,"/t%d.bin",num);
|
||||||
|
strcat(file_path2,str);
|
||||||
|
res = fin.TryInitialize(file_path2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fin.TryRead( &size,&get_buff[total],size2);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"read Fail");
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (i=0;i<size;i++) if (src_buff[total+i] != get_buff[total+i])
|
||||||
|
{
|
||||||
|
s_RenderSystem.DrawText(8,100,"verifi Fail at %d",total+i);
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
fin.Finalize();
|
||||||
|
|
||||||
|
num++;
|
||||||
|
total+=size;
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
sprintf(str,"num %d",num);
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
if (num == DirDepth) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
sprintf(str,"length = %d",(int)strlen(file_path2));
|
||||||
|
s_RenderSystem.DrawText(8,110,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//max size of name
|
||||||
|
#define max_len 16
|
||||||
|
bool Test4_W()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
res = nn::fs::FormatSaveData(1,0,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"format Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(str,"data:/");
|
||||||
|
for (i =6;i<max_len+6;i++)str[i] = '-';
|
||||||
|
str[i] = 0;
|
||||||
|
res = fout.TryInitialize(str,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fout.TryWrite( &size,&src_buff[0],512);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Write Fail");
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::CommitSaveData();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return (size == 512);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Test4_V()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
strcpy(str,"data:/");
|
||||||
|
for (i =6;i<max_len+6;i++)str[i] = '-';
|
||||||
|
str[i] = 0;
|
||||||
|
res = fin.TryInitialize(str);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fin.TryRead( &size,&get_buff[0],512);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Read Fail");
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
if (size != 512)return false;
|
||||||
|
|
||||||
|
for (i=0;i<size;i++) if (src_buff[i] != get_buff[i])
|
||||||
|
{
|
||||||
|
s_RenderSystem.DrawText(8,100,"verifi Fail at %d",i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SIZE_TEST5 (512*100)
|
||||||
|
//生成サイズに満たないデータ
|
||||||
|
bool Test5_W()
|
||||||
|
{
|
||||||
|
int pos;
|
||||||
|
|
||||||
|
res = nn::fs::FormatSaveData(1,0,true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"format Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = nn::fs::TryCreateFile(L"data:/test5.bin",SIZE_TEST5);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Create Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
res = fout.TryInitialize(L"data:/test5.bin",true);
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pos =0;
|
||||||
|
while(1){
|
||||||
|
fout.SetPosition(pos);
|
||||||
|
res = fout.TryWrite( &size,&src_buff[pos],512);
|
||||||
|
if (res.IsFailure() || (size!=512)){
|
||||||
|
s_RenderSystem.DrawText(8,100,"write Fail");
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sprintf(str,"position %d",pos);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
pos += 1024;//512飛ばす
|
||||||
|
if (pos >= SIZE_TEST5)break;
|
||||||
|
}
|
||||||
|
fout.Finalize();
|
||||||
|
nn::fs::CommitSaveData();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Test5_V()
|
||||||
|
{
|
||||||
|
int i,pos;
|
||||||
|
|
||||||
|
res = fin.TryInitialize(L"data:/test5.bin");
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"open Fail");
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pos =0;
|
||||||
|
while(1){
|
||||||
|
fin.SetPosition(pos);
|
||||||
|
res = fin.TryRead( &size,&get_buff[pos],512);
|
||||||
|
if (res.IsFailure() || (size!=512)){
|
||||||
|
s_RenderSystem.DrawText(8,100,"read Fail");
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sprintf(str,"position %d",pos);
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,80,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
for (i=0;i<512;i++) if (src_buff[pos+i] != get_buff[pos+i])
|
||||||
|
{
|
||||||
|
s_RenderSystem.DrawText(8,100,"verifi Fail at %d",i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pos += 1024;//512飛ばす
|
||||||
|
if (pos >= SIZE_TEST5)break;
|
||||||
|
}
|
||||||
|
fin.Finalize();
|
||||||
|
nn::fs::Unmount("data:");
|
||||||
|
s_RenderSystem.DrawText(10,100,"end");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define menu_ct 6
|
||||||
|
#define menu_max (menu_ct-1)
|
||||||
|
char* menu_str[menu_ct] = {"Casual check","Large size","many files","Deep directry","max size name","data < create size"};
|
||||||
|
|
||||||
|
#define menu_top_Y 80
|
||||||
|
#define menu_top_X 60
|
||||||
|
#define menu_spc 14
|
||||||
|
|
||||||
|
//---------------------------------------------------------------- main
|
||||||
|
void TestMain()
|
||||||
|
{
|
||||||
|
u32 value;
|
||||||
|
int curs = 0;
|
||||||
|
int i;
|
||||||
|
bool sccs;
|
||||||
|
|
||||||
|
//Render
|
||||||
|
s_RenderSystem.SetColor(1.0f,1.0f,1.0f,1.0f);
|
||||||
|
|
||||||
|
//TEST PATTERN
|
||||||
|
make_pattern();
|
||||||
|
|
||||||
|
while(1){
|
||||||
|
|
||||||
|
//menu 表示
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(8,20," Backup Verifi for SaveDataMover Test ");
|
||||||
|
s_RenderSystem.DrawText(8,40," for 512KB Backup");
|
||||||
|
for (i=0;i<menu_ct;i++)s_RenderSystem.DrawText(menu_top_X,menu_top_Y+menu_spc*i,menu_str[i]);
|
||||||
|
s_RenderSystem.DrawText(menu_top_X-30,menu_top_Y+menu_spc*curs,"->");
|
||||||
|
s_RenderSystem.DrawText(menu_top_X,menu_top_Y+menu_spc*(menu_max+2),"push A:Write ,X:Verifi");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
|
||||||
|
//ボタン待ち
|
||||||
|
value = WaitKey(nn::hid::BUTTON_A | nn::hid::BUTTON_X |nn::hid::BUTTON_UP |nn::hid::BUTTON_DOWN);
|
||||||
|
if (value & nn::hid::BUTTON_A){//ライト
|
||||||
|
sccs = false;
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,70,"writing");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
switch(curs){
|
||||||
|
case 0:sccs = Test2_W(10);break;
|
||||||
|
case 1:sccs = Test1_W();break;
|
||||||
|
case 2:sccs = Test2_W(680);break;
|
||||||
|
case 3:sccs = Test3_W();break;
|
||||||
|
case 4:sccs = Test4_W();break;
|
||||||
|
case 5:sccs = Test5_W();break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
}else if (value & nn::hid::BUTTON_X)
|
||||||
|
{//ベリファイ
|
||||||
|
sccs = false;
|
||||||
|
s_RenderSystem.Clear();
|
||||||
|
s_RenderSystem.DrawText(10,70,"verifi");
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
nngxWaitVSync(NN_GX_DISPLAY0);
|
||||||
|
res =nn::fs::MountSaveData();
|
||||||
|
if (res.IsFailure()){
|
||||||
|
s_RenderSystem.DrawText(8,100,"Mount Fail");
|
||||||
|
}else
|
||||||
|
switch(curs){
|
||||||
|
case 0:sccs = Test2_V(10);break;
|
||||||
|
case 1:sccs = Test1_V();break;
|
||||||
|
case 2:sccs = Test2_V(680);break;
|
||||||
|
case 3:sccs = Test3_V();break;
|
||||||
|
case 4:sccs = Test4_V();break;
|
||||||
|
case 5:sccs = Test5_V();break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
}else if (value & nn::hid::BUTTON_UP){
|
||||||
|
if(curs > 0)curs--;
|
||||||
|
}else if(curs < menu_max)curs++;
|
||||||
|
|
||||||
|
if (value & (nn::hid::BUTTON_A | nn::hid::BUTTON_X)){
|
||||||
|
if (sccs == false)s_RenderSystem.DrawText(8,120,"Failed");
|
||||||
|
sprintf(str,"desc %d",res.GetDescription());
|
||||||
|
s_RenderSystem.DrawText(10,140,str);
|
||||||
|
s_RenderSystem.SwapBuffers();
|
||||||
|
NN_LOG("desc %d",res.GetDescription());
|
||||||
|
WaitKey(nn::hid::BUTTON_B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
End of file
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
6
trunk/CardSaveDataMover/ImpRun/test_data.h
Normal file
6
trunk/CardSaveDataMover/ImpRun/test_data.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef TEST_DATA_H_
|
||||||
|
#define TEST_DATA_H_
|
||||||
|
|
||||||
|
void TestMain();
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user