mirror of
https://github.com/rvtr/TwlIPL_commit-99.git
synced 2025-06-18 13:35:33 -04:00
Add TwlSystem + fix naming of files for rsf
This commit is contained in:
parent
0ca1d3e0ee
commit
c250db2bee
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.DS_Store
|
||||
._*
|
||||
/add-ins/TwlSDK/
|
31
add-ins/TwlSystem/Makefile
Executable file
31
add-ins/TwlSystem/Makefile
Executable file
@ -0,0 +1,31 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = \
|
||||
build
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
Binary file not shown.
150
add-ins/TwlSystem/Readme-patch.txt
Normal file
150
add-ins/TwlSystem/Readme-patch.txt
Normal file
@ -0,0 +1,150 @@
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
■ Readme-NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp.txt ■
|
||||
■ ■
|
||||
■ NITRO-System for TWL 080408 ( TWL-SDK5.0 FC plus5 対応版 ) ■
|
||||
■ ■
|
||||
■ Jul. 1, 2008 ■
|
||||
■ ■
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
|
||||
|
||||
目次
|
||||
==============================================================================
|
||||
1. はじめに
|
||||
2. ファイルリスト
|
||||
|
||||
|
||||
1. はじめに
|
||||
==============================================================================
|
||||
このパッチは、NITRO-System for TWL 2008/04/08版をTWL-SDK5.0 FC plus5に
|
||||
対応させるためのものです。NITRO-System for TWLのライブラリをTWL-SDK5.0 FC plus5
|
||||
を用いてビルドしたものに差し替えます。
|
||||
|
||||
このパッチをインストールするためには、同梱されているファイルをNITRO-System
|
||||
for TWL 2008/04/08版がインストールされているディレクトリに上書きコ
|
||||
ピーしてください。
|
||||
|
||||
|
||||
2. 修正内容
|
||||
===============================================================================
|
||||
(1) snd: driverInfoサンプルデモの不具合修正
|
||||
|
||||
・sndライブラリのdriverInfoサンプルデモに問題があり、
|
||||
TWL-SDK5.0 FC plus5では動作しませんでしたが、これを修正しました。
|
||||
|
||||
3. ファイルリスト
|
||||
===============================================================================
|
||||
|
||||
■ライブラリ
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsfnd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg2d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsg3d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsgfd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnsmcs.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Debug/libnnssnd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsfnd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg2d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsg3d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsgfd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnsmcs.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Release/libnnssnd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsfnd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg2d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsg3d.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsgfd.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnsmcs.TWL.LTD.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.TWL.HYB.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.TWL.HYB.thumb.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.TWL.LTD.a
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/lib/ARM9-TS/Rom/libnnssnd.TWL.LTD.thumb.a
|
||||
|
||||
■サンプルデモ
|
||||
NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp/NitroSystem/build/demos/snd/driverInfo/src/main.c
|
||||
|
20
add-ins/TwlSystem/Readme.txt
Normal file
20
add-ins/TwlSystem/Readme.txt
Normal file
@ -0,0 +1,20 @@
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
■ ■
|
||||
■ NITRO-System for TWL 080408 ( TWL-SDK5.0 FC plus5 対応版 ) ■
|
||||
■ ■
|
||||
■ Jul. 1, 2008 ■
|
||||
■ ■
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
|
||||
|
||||
このパッチは、NITRO-System for TWL 2008/04/08版をTWL-SDK5.0 FC plus5に
|
||||
対応させるためのものです。NITRO-System for TWLのライブラリをTWL-SDK5.0 FC plus5
|
||||
を用いてビルドしたものに差し替えます。
|
||||
|
||||
このパッチをインストールするためには、同梱されているファイルをNITRO-System
|
||||
for TWL 2008/04/08版がインストールされているディレクトリに上書きコ
|
||||
ピーしてください。
|
||||
|
||||
詳しくは、NitroSystemディレクトリの
|
||||
Readme-NitroSystem_forTWL-080408-SDK5_0FCplus5-patch-jp.txt をご覧下さい。
|
||||
|
115
add-ins/TwlSystem/SourceTreeMap.txt
Executable file
115
add-ins/TwlSystem/SourceTreeMap.txt
Executable file
@ -0,0 +1,115 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Project: NITRO-System
|
||||
File: SourceTreeMap.txt
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 661 $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
■NITRO-Systemパッケージのディレクトリ構成図(2008-04-08)
|
||||
|
||||
|
||||
NitroSystem NITRO-Systemのトップ
|
||||
│
|
||||
├─docs ドキュメント
|
||||
│ │
|
||||
│ ├─ReleaseNotes.html - NITRO-System リリースに関するドキュメント
|
||||
│ ├─QuickStart.pdf - NITRO-System クイックスタートドキュメント
|
||||
│ │
|
||||
│ ├─Changelog - 各ライブラリとツールの更新履歴
|
||||
│ ├─Overview - 各開発環境の概要説明書
|
||||
│ ├─TechnicalNotes - 技術説明書
|
||||
│ ├─Xerces-C++ - Xerces-C++のライセンス書類
|
||||
│ ├─Foundation - NITRO-Foundationライブラリのドキュメント
|
||||
│ ├─GraphicsFoundation - NITRO-GraphicsFoundationライブラリのドキュメント
|
||||
│ ├─G2D - NITRO-2DGraphicsライブラリのドキュメント
|
||||
│ ├─G3D - NITRO-3DGraphicsライブラリのドキュメント
|
||||
│ ├─NitroComposer - NITRO-Composerのドキュメント
|
||||
│ ├─mcs - Multiple Channel Streamライブラリのドキュメント
|
||||
│ ├─3DFileFormat - 3Dファイルフォーマットのドキュメント
|
||||
│ ├─3DMaterialEditor - 3D MaterialEditorのドキュメント
|
||||
│ ├─NitroSoundMaker - NITRO-SoundMakerのドキュメント
|
||||
│ ├─NitroPlayer - NITRO-Playerのドキュメント
|
||||
│ ├─NitroViewer - NITRO-Viewerのドキュメント
|
||||
│ └─3DPlugins - プラグインのドキュメント
|
||||
│ │
|
||||
│ ├─Maya - - MAYAプラグインのドキュメント
|
||||
│ ├─3dsmax - - 3dsmaxプラグインのドキュメント
|
||||
│ ├─SoftimageXSI - - Softimage|XSIプラグインのドキュメント
|
||||
│ └─Photoshop - - Photoshopプラグインのドキュメント
|
||||
│
|
||||
│
|
||||
├─build ビルドディレクトリ
|
||||
│ │
|
||||
│ ├─buildtools - ビルドに必要なファイル
|
||||
│ │
|
||||
│ ├─demos - デモアプリケーション
|
||||
│ │ │
|
||||
│ │ ├─fnd - - NITRO-Foundationライブラリのデモ
|
||||
│ │ ├─gfd - - NITRO-GraphicsFoundationライブラリのデモ
|
||||
│ │ ├─g2d - - NITRO-2DGraphicsライブラリのデモ
|
||||
│ │ ├─g3d - - NITRO-3DGraphicsライブラリのデモ
|
||||
│ │ ├─snd - - NITRO-Composerライブラリのデモ
|
||||
│ │ ├─mcs - - Muitiple Channel Streamライブラリのデモ
|
||||
│ │ └─IDE - - CodeWarrior IDE プロジェクトサンプル
|
||||
│ │
|
||||
│ └─libraries - ライブラリのソース
|
||||
│ │
|
||||
│ ├─fnd - - NITRO-Foundationライブラリのソース
|
||||
│ ├─gfd - - NITRO-GraphincsFoundationライブラリのソース
|
||||
│ ├─g2d - - NITRO-2DGraphicsライブラリのソース
|
||||
│ ├─g3d - - NITRO-3DGraphicsライブラリのソース
|
||||
│ ├─snd - - NITRO-Composerライブラリのソース
|
||||
│ └─mcs - - Muitiple Channel Streamライブラリのソース
|
||||
│
|
||||
│
|
||||
├─include インクルードファイル
|
||||
│ │
|
||||
│ └─nnsys - NITRO-System用ヘッダファイル
|
||||
│ │
|
||||
│ ├─fnd - - NITRO-Foundationヘッダファイル
|
||||
│ ├─gfd - - NITRO-GraphincsFoundationヘッダファイル
|
||||
│ ├─g2d - - NITRO-2DGraphicsヘッダファイル
|
||||
│ ├─g3d - - NITRO-3DGraphicsヘッダファイル
|
||||
│ ├─snd - - NITRO-Composerヘッダファイル
|
||||
│ └─mcs - - Muitiple Channel Streamヘッダファイル
|
||||
│
|
||||
│
|
||||
├─man リファレンスマニュアル(HTML)
|
||||
│ │
|
||||
│ └─ja_JP - 日本語
|
||||
│
|
||||
│
|
||||
├─lib ライブラリの作成先
|
||||
│ │
|
||||
│ └─ARM9-TS - メインプロセッサ TS以降用ライブラリ
|
||||
│ │
|
||||
│ ├─Debug - - Debug 版
|
||||
│ ├─Release - - Release 版
|
||||
│ └─Rom - - 最終ROM 版
|
||||
│
|
||||
│
|
||||
└─tools NITRO-Systemツール
|
||||
│
|
||||
├─bin - コンバータ等の実行ファイル
|
||||
├─fontcvtr - フォントコンバータ
|
||||
├─mcsserver - mcsサーバ
|
||||
├─NNS_3DMaterialEditor - 3D MaterialEditor
|
||||
├─NitroSoundMaker - NITRO-SoundMaker
|
||||
├─SoundPlayer - サウンドプレイヤ
|
||||
├─NitroPlayer - NITRO-Player
|
||||
├─NitroViewer - NITRO-Viewer
|
||||
└─3DPlugins - 3Dプラグイン
|
||||
│
|
||||
├─Maya - - MAYAプラグイン
|
||||
├─3dsmax - - 3dsmaxプラグイン
|
||||
├─SoftimageXSI - - Softimage|XSIプラグイン
|
||||
└─Photoshop - - Photoshopプラグイン
|
||||
|
49
add-ins/TwlSystem/build/Makefile
Executable file
49
add-ins/TwlSystem/build/Makefile
Executable file
@ -0,0 +1,49 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - build
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
ifndef NITRO_WITHOUT_DEMOS
|
||||
SUBDIRS.DEMOS = $(wildcard demos)
|
||||
|
||||
ifdef NITROSYSTEM_PRIVATE
|
||||
SUBDIRS.BUILDSETUP = $(wildcard buildsetup)
|
||||
SUBDIRS.TESTS = $(wildcard tests)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifdef NITROSYSTEM_PRIVATE
|
||||
SUBDIRS.TOOLS = $(wildcard tools)
|
||||
endif
|
||||
|
||||
SUBDIRS.LIBRARIES = $(wildcard libraries)
|
||||
|
||||
SUBDIRS = \
|
||||
$(SUBDIRS.BUILDSETUP) \
|
||||
$(SUBDIRS.LIBRARIES) \
|
||||
$(SUBDIRS.TOOLS) \
|
||||
$(SUBDIRS.DEMOS) \
|
||||
$(SUBDIRS.TESTS)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
93
add-ins/TwlSystem/build/buildtools/commondefs
Executable file
93
add-ins/TwlSystem/build/buildtools/commondefs
Executable file
@ -0,0 +1,93 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - buildtools
|
||||
# File: commondefs
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 518 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
ifndef NITROSYSTEM_COMMONDEFS_
|
||||
NITROSYSTEM_COMMONDEFS_ := TRUE
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# NITRO-System Root directory
|
||||
#
|
||||
|
||||
NITROSYSTEM_ROOT ?= C:/NitroSystem
|
||||
TWLSYSTEM_ROOT ?= $(NITROSYSTEM_ROOT)
|
||||
|
||||
NNS_ALLLIBS := fnd mcs gfd g2d g3d snd
|
||||
|
||||
NNS_LIB_MODULES = LibFnd LibMcs LibGfd LibG2d LibG3d LibSnd
|
||||
|
||||
ROOT_MODULES := FND MCS GFD G2D G3D SND
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# import TWL-SDK commondefs
|
||||
#
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
NITRO_BUILDTYPE ?= $(TWL_BUILDTYPE)
|
||||
NITRO_LIBTYPE ?= $(TWL_LIBTYPE)
|
||||
NITRO_CCTYPE ?= $(TWL_CCTYPE)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# NITRO-System Path settings
|
||||
#
|
||||
|
||||
NNS_ROOT := $(call eupath,$(NITROSYSTEM_ROOT))
|
||||
|
||||
NITROSYSTEM_BUILDTOOLSDIR := $(NNS_ROOT)/build/buildtools
|
||||
NITROSYSTEM_TOOLSDIR := $(NNS_ROOT)/tools
|
||||
|
||||
# $(foreach module,$(ROOT_MODULES),$(eval NITROSYSTEM_$(module)_ROOT = $$(NNS_ROOT)))
|
||||
|
||||
NITROSYSTEM_FND_ROOT = $(NNS_ROOT)
|
||||
NITROSYSTEM_MCS_ROOT = $(NNS_ROOT)
|
||||
NITROSYSTEM_GFD_ROOT = $(NNS_ROOT)
|
||||
NITROSYSTEM_G2D_ROOT = $(NNS_ROOT)
|
||||
NITROSYSTEM_G3D_ROOT = $(NNS_ROOT)
|
||||
NITROSYSTEM_SND_ROOT = $(NNS_ROOT)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# PRIVATE FLAGS
|
||||
#
|
||||
-include $(NITROSYSTEM_BUILDTOOLSDIR)/private/commondefs
|
||||
-include $(NITROSYSTEM_BUILDTOOLSDIR)/internal/commondefs
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# NITROSYSTEM_INSTALL_ROOT
|
||||
#
|
||||
|
||||
ifdef NITROSYSTEM_INSTALL_ROOT
|
||||
override NITROSYSTEM_INSTALL_ROOT := $(call eupath,$(NITROSYSTEM_INSTALL_ROOT))
|
||||
endif
|
||||
NITROSYSTEM_INSTALL_ROOT ?= $(NNS_ROOT)
|
||||
|
||||
NITROSYSTEM_INSTALL_INCDIR := $(NITROSYSTEM_INSTALL_ROOT)/include
|
||||
NITROSYSTEM_INSTALL_TOOLSDIR := $(NITROSYSTEM_INSTALL_ROOT)/tools
|
||||
NITROSYSTEM_INSTALL_LIBDIR := $(NITROSYSTEM_INSTALL_ROOT)/lib/$(NITRO_LIBTYPE)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
### Compiler settings
|
||||
|
||||
-include $(NITROSYSTEM_BUILDTOOLSDIR)/commondefs.cctype.$(NITRO_CCTYPE)
|
||||
|
||||
|
||||
# NITROSYSTEM_COMMONDEFS_
|
||||
endif
|
||||
|
||||
#----- End of commondefs -----
|
51
add-ins/TwlSystem/build/buildtools/commondefs.cctype.CW
Executable file
51
add-ins/TwlSystem/build/buildtools/commondefs.cctype.CW
Executable file
@ -0,0 +1,51 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - buildtools
|
||||
# File: commondefs.cctype.CW
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# switch by codegen platform TEG/TS
|
||||
|
||||
MACRO_FLAGS += -DNNS_$(TARGET_PLATFORM)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# switch by codegen processor ARM7/ARM9
|
||||
|
||||
MACRO_FLAGS += -DNNS_$(CODEGEN_PROC)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# switch by DEBUG/RELEASE/FINALROM
|
||||
#
|
||||
|
||||
MACRO_FLAGS += -DNNS_$(TWL_BUILD_TYPE)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# switch by C Compiler CW/ADS/GCC
|
||||
#
|
||||
|
||||
MACRO_FLAGS += -DNNS_$(TWL_CCTYPE)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# switch by codegen target ARM/THUMB
|
||||
|
||||
MACRO_FLAGS_CC += -DNNS_CODE_$(CODEGEN_CC)
|
||||
MACRO_FLAGS_AS += -DNNS_CODE_$(CODEGEN_AS)
|
||||
|
||||
|
||||
#----- End of commondefs.cctype.CW -----
|
24
add-ins/TwlSystem/build/buildtools/modulerules
Executable file
24
add-ins/TwlSystem/build/buildtools/modulerules
Executable file
@ -0,0 +1,24 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - buildtools
|
||||
# File: modulerules
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 268 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# PRIVATE FLAGS
|
||||
#
|
||||
-include $(NITROSYSTEM_BUILDTOOLSDIR)/private/modulerules
|
||||
|
||||
#----- End of modulerules -----
|
72
add-ins/TwlSystem/build/buildtools/nnslibdefs
Executable file
72
add-ins/TwlSystem/build/buildtools/nnslibdefs
Executable file
@ -0,0 +1,72 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - buildtools
|
||||
# File: nnslibdefs
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# このファイル(nnslibdefs)は、SDKのcommondefsからincludeされます
|
||||
#
|
||||
# このファイル中で設定した以下のMAKE変数が、SDKのcommondefsから参照されます。
|
||||
# ・NITROSYSTEM_INCDIR
|
||||
# ・NITROSYSTEM_LIBDIR
|
||||
# ・NITROSYSTEM_LIBS
|
||||
#
|
||||
|
||||
NITRO_LIBTYPE ?= $(TWL_LIBTYPE)
|
||||
NITRO_LIBSUFFIX ?= $(TWL_LIBSUFFIX)
|
||||
|
||||
|
||||
ifdef NITROSYSTEM_ROOT
|
||||
|
||||
NITROSYSTEM_ROOT_ := $(subst $(SPACE),\ ,$(subst \,/,$(NITROSYSTEM_ROOT)))
|
||||
|
||||
-include $(NITROSYSTEM_ROOT_)/build/buildtools/private/nnslibdefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# NITRO-System Library settings
|
||||
#
|
||||
# NITRO-Systemのcommondefsが使用されている場合は、NITRO-Systemライブラリを使
|
||||
# 用するための設定をします。
|
||||
#
|
||||
|
||||
ifdef NITROSYSTEM_COMMONDEFS_
|
||||
|
||||
NITROSYSTEM_INCDIR ?= $(NITROSYSTEM_ROOT_)/include
|
||||
NITROSYSTEM_LIBDIR ?= $(NITROSYSTEM_ROOT_)/lib/$(NITRO_LIBTYPE)
|
||||
|
||||
NNS_USELIBS ?= $(NNS_ALLLIBS)
|
||||
|
||||
ifeq ($(CODEGEN_PROC),ARM9)
|
||||
NITROSYSTEM_LIBS := $(foreach lib,$(NNS_USELIBS),libnns$(lib)$(NITRO_LIBSUFFIX).a)
|
||||
else # ($(CODEGEN_PROC),ARM7)
|
||||
NITROSYSTEM_LIBS :=
|
||||
endif
|
||||
|
||||
|
||||
TWLSYSTEM_INCDIR = $(NITROSYSTEM_INCDIR)
|
||||
TWLSYSTEM_LIBDIR = $(NITROSYSTEM_LIBDIR)
|
||||
TWLSYSTEM_LIBS = $(NITROSYSTEM_LIBS)
|
||||
|
||||
|
||||
# NITROSYSTEM_COMMONDEFS_
|
||||
endif
|
||||
|
||||
# NITROSYSTEM_ROOT
|
||||
endif
|
||||
|
||||
|
||||
#----- End of nnslibdefs -----
|
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/IDE_Archive_NITRO.mcp
Executable file
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/IDE_Archive_NITRO.mcp
Executable file
Binary file not shown.
395
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro.lcf
Executable file
395
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro.lcf
Executable file
@ -0,0 +1,395 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
# File: Nitro.lcf
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
MEMORY
|
||||
{
|
||||
main (RWX) : ORIGIN = 0x02000000, LENGTH = 0x0 > main.sbin
|
||||
ITCM (RWX) : ORIGIN = 0x01ff8000, LENGTH = 0x0 >> main.sbin
|
||||
DTCM (RWX) : ORIGIN = 0x027e0000, LENGTH = 0x0 >> main.sbin
|
||||
binary.AUTOLOAD_INFO (RWX) : ORIGIN = 0, LENGTH = 0x0 >> main.sbin
|
||||
binary.STATIC_FOOTER (RWX) : ORIGIN = 0, LENGTH = 0x0 >> main.sbin
|
||||
|
||||
main_defs (RW) : ORIGIN = AFTER(main), LENGTH = 0x0 > main_defs.sbin
|
||||
main_table (RW) : ORIGIN = AFTER(main), LENGTH = 0x0 > main_table.sbin
|
||||
dummy.MAIN_EX (RW) : ORIGIN = 0x023e0000, LENGTH = 0x0
|
||||
arena.MAIN (RW) : ORIGIN = AFTER(main), LENGTH = 0x0
|
||||
arena.MAIN_EX (RW) : ORIGIN = AFTER(dummy.MAIN_EX), LENGTH = 0x0
|
||||
arena.ITCM (RW) : ORIGIN = AFTER(ITCM), LENGTH = 0x0
|
||||
arena.DTCM (RW) : ORIGIN = AFTER(DTCM), LENGTH = 0x0
|
||||
binary.MODULE_FILES (RW) : ORIGIN = 0x0, LENGTH = 0x0 > component.files
|
||||
check.ITCM (RWX) : ORIGIN = 0x0, LENGTH = 0x08000 > itcm.check
|
||||
check.DTCM (RW) : ORIGIN = 0x0, LENGTH = 0x04000 > dtcm.check
|
||||
}
|
||||
|
||||
FORCE_ACTIVE
|
||||
{
|
||||
SVC_SoftReset
|
||||
}
|
||||
|
||||
KEEP_SECTION
|
||||
{
|
||||
.sinit
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
############################ STATIC #################################
|
||||
.main:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32); # Fit to cache line
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_STATIC_START =.;
|
||||
SDK_STATIC_TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
libsyscall.a (.text)
|
||||
crt0.o (.text)
|
||||
crt0.o (.rodata)
|
||||
#
|
||||
# .version セクションを追加しています。
|
||||
# このセクションに含まれる情報はロットチェックの際に
|
||||
# 必要となりますので、必ずこの位置に残すようにして下さい。
|
||||
#
|
||||
* (.version)
|
||||
OBJECT(NitroMain,*)
|
||||
GROUP(ROOT) (.text)
|
||||
. = ALIGN(4);
|
||||
* (.exception)
|
||||
. = ALIGN(4);
|
||||
SDK_STATIC_ETABLE_START =.;
|
||||
EXCEPTION
|
||||
SDK_STATIC_ETABLE_END =.;
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.init)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.rodata)
|
||||
. = ALIGN(4);
|
||||
|
||||
SDK_STATIC_SINIT_START =.;
|
||||
#:::::::::: ctor
|
||||
GROUP(ROOT) (.ctor)
|
||||
GROUP(ROOT) (.sinit)
|
||||
WRITEW 0;
|
||||
#:::::::::: ctor
|
||||
SDK_STATIC_SINIT_END =.;
|
||||
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE
|
||||
#
|
||||
SDK_STATIC_DATA_START =.;
|
||||
#:::::::::: data
|
||||
GROUP(ROOT) (.sdata)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.data)
|
||||
. = ALIGN(4);
|
||||
SDK_OVERLAY_DIGEST =.;
|
||||
# NO DIGEST
|
||||
SDK_OVERLAY_DIGEST_END =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_DATA_END =.;
|
||||
SDK_STATIC_END =.;
|
||||
|
||||
SDK_STATIC_TEXT_SIZE = SDK_STATIC_TEXT_END - SDK_STATIC_TEXT_START;
|
||||
SDK_STATIC_DATA_SIZE = SDK_STATIC_DATA_END - SDK_STATIC_DATA_START;
|
||||
SDK_STATIC_SIZE = SDK_STATIC_END - SDK_STATIC_START;
|
||||
__sinit__ = SDK_STATIC_SINIT_START; # for static initializer
|
||||
__exception_table_start__ = SDK_STATIC_ETABLE_START; # for exception table
|
||||
__exception_table_end__ = SDK_STATIC_ETABLE_END; # for exception table
|
||||
} > main
|
||||
|
||||
.main.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_STATIC_BSS_START =.;
|
||||
#:::::::::: bss
|
||||
GROUP(ROOT) (.sbss)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.bss)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_BSS_END = .;
|
||||
SDK_STATIC_BSS_SIZE = SDK_STATIC_BSS_END - SDK_STATIC_BSS_START;
|
||||
|
||||
} >> main
|
||||
|
||||
|
||||
############################ AUTOLOADS ##############################
|
||||
SDK_AUTOLOAD.ITCM.START = 0x01ff8000;
|
||||
SDK_AUTOLOAD.ITCM.END = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD.ITCM.BSS_END = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD.ITCM.SIZE = 0;
|
||||
SDK_AUTOLOAD.ITCM.BSS_SIZE = 0;
|
||||
SDK_AUTOLOAD.DTCM.START = 0x027e0000;
|
||||
SDK_AUTOLOAD.DTCM.END = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD.DTCM.BSS_END = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD.DTCM.SIZE = 0;
|
||||
SDK_AUTOLOAD.DTCM.BSS_SIZE = 0;
|
||||
SDK_AUTOLOAD_START = SDK_STATIC_END;
|
||||
SDK_AUTOLOAD_SIZE = 0;
|
||||
SDK_AUTOLOAD_NUMBER = 2;
|
||||
|
||||
.ITCM:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_AUTOLOAD_ITCM_ID =0;
|
||||
SDK_AUTOLOAD.ITCM.ID =0;
|
||||
SDK_AUTOLOAD.ITCM.START =.;
|
||||
SDK_AUTOLOAD.ITCM.TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(4);
|
||||
* (.itcm)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: text/rodata
|
||||
SDK_AUTOLOAD.ITCM.TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.ITCM.DATA_START =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.ITCM.DATA_END =.;
|
||||
SDK_AUTOLOAD.ITCM.END =.;
|
||||
|
||||
SDK_AUTOLOAD.ITCM.TEXT_SIZE = SDK_AUTOLOAD.ITCM.TEXT_END - SDK_AUTOLOAD.ITCM.TEXT_START;
|
||||
SDK_AUTOLOAD.ITCM.DATA_SIZE = SDK_AUTOLOAD.ITCM.DATA_END - SDK_AUTOLOAD.ITCM.DATA_START;
|
||||
SDK_AUTOLOAD.ITCM.SIZE = SDK_AUTOLOAD.ITCM.END - SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD.ITCM.SIZE;
|
||||
|
||||
} > ITCM
|
||||
|
||||
.ITCM.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.ITCM.BSS_START = .;
|
||||
#:::::::::: bss
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.itcm.bss)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.ITCM.BSS_END = .;
|
||||
|
||||
SDK_AUTOLOAD.ITCM.BSS_SIZE = SDK_AUTOLOAD.ITCM.BSS_END - SDK_AUTOLOAD.ITCM.BSS_START;
|
||||
|
||||
} >> ITCM
|
||||
|
||||
.DTCM:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_AUTOLOAD_DTCM_ID =1;
|
||||
SDK_AUTOLOAD.DTCM.ID =1;
|
||||
SDK_AUTOLOAD.DTCM.START =.;
|
||||
SDK_AUTOLOAD.DTCM.TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: text/rodata
|
||||
SDK_AUTOLOAD.DTCM.TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.DTCM.DATA_START =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.dtcm)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.DTCM.DATA_END =.;
|
||||
SDK_AUTOLOAD.DTCM.END =.;
|
||||
|
||||
SDK_AUTOLOAD.DTCM.TEXT_SIZE = SDK_AUTOLOAD.DTCM.TEXT_END - SDK_AUTOLOAD.DTCM.TEXT_START;
|
||||
SDK_AUTOLOAD.DTCM.DATA_SIZE = SDK_AUTOLOAD.DTCM.DATA_END - SDK_AUTOLOAD.DTCM.DATA_START;
|
||||
SDK_AUTOLOAD.DTCM.SIZE = SDK_AUTOLOAD.DTCM.END - SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD.DTCM.SIZE;
|
||||
|
||||
} > DTCM
|
||||
|
||||
.DTCM.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.DTCM.BSS_START = .;
|
||||
#:::::::::: bss
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.dtcm.bss)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.DTCM.BSS_END = .;
|
||||
|
||||
SDK_AUTOLOAD.DTCM.BSS_SIZE = SDK_AUTOLOAD.DTCM.BSS_END - SDK_AUTOLOAD.DTCM.BSS_START;
|
||||
|
||||
} >> DTCM
|
||||
|
||||
|
||||
SDK_AUTOLOAD_ITCM_START = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD_ITCM_END = SDK_AUTOLOAD.ITCM.END;
|
||||
SDK_AUTOLOAD_ITCM_BSS_END = SDK_AUTOLOAD.ITCM.BSS_END;
|
||||
SDK_AUTOLOAD_ITCM_SIZE = SDK_AUTOLOAD.ITCM.SIZE;
|
||||
SDK_AUTOLOAD_ITCM_BSS_SIZE = SDK_AUTOLOAD.ITCM.BSS_SIZE;
|
||||
SDK_AUTOLOAD_DTCM_START = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD_DTCM_END = SDK_AUTOLOAD.DTCM.END;
|
||||
SDK_AUTOLOAD_DTCM_BSS_END = SDK_AUTOLOAD.DTCM.BSS_END;
|
||||
SDK_AUTOLOAD_DTCM_SIZE = SDK_AUTOLOAD.DTCM.SIZE;
|
||||
SDK_AUTOLOAD_DTCM_BSS_SIZE = SDK_AUTOLOAD.DTCM.BSS_SIZE;
|
||||
|
||||
############################ AUTOLOAD_INFO ##########################
|
||||
.binary.AUTOLOAD_INFO:
|
||||
{
|
||||
WRITEW ADDR(.ITCM);
|
||||
WRITEW SDK_AUTOLOAD.ITCM.SIZE;
|
||||
WRITEW SDK_AUTOLOAD.ITCM.BSS_SIZE;
|
||||
WRITEW ADDR(.DTCM);
|
||||
WRITEW SDK_AUTOLOAD.DTCM.SIZE;
|
||||
WRITEW SDK_AUTOLOAD.DTCM.BSS_SIZE;
|
||||
} > binary.AUTOLOAD_INFO
|
||||
|
||||
SDK_AUTOLOAD_LIST = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE;
|
||||
SDK_AUTOLOAD_LIST_END = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO);
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO);
|
||||
|
||||
############################ STATIC_FOOTER ##########################
|
||||
.binary.STATIC_FOOTER:
|
||||
{
|
||||
WRITEW 0xdec00621; # LE(0x2106C0DE) = NITRO CODE
|
||||
WRITEW _start_ModuleParams - ADDR(.main);
|
||||
WRITEW 0; # NO DIGEST
|
||||
} > binary.STATIC_FOOTER
|
||||
|
||||
############################ OVERLAYS ###############################
|
||||
SDK_OVERLAY_NUMBER = 0;
|
||||
|
||||
|
||||
############################ MAIN EX ##################################
|
||||
# MAIN EX Area
|
||||
.dummy.MAIN_EX:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > dummy.MAIN_EX
|
||||
|
||||
############################ ARENA ##################################
|
||||
.arena.MAIN:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_START =.;
|
||||
} > arena.MAIN
|
||||
|
||||
.arena.MAIN_EX:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_EX_START =.;
|
||||
} > arena.MAIN_EX
|
||||
|
||||
.arena.ITCM:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_ITCM_START =.;
|
||||
} > arena.ITCM
|
||||
|
||||
.arena.DTCM:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_DTCM_START =.;
|
||||
} > arena.DTCM
|
||||
|
||||
############################ OVERLAYDEFS ############################
|
||||
.main_defs:
|
||||
{
|
||||
### main module information
|
||||
WRITEW ADDR(.main); # load address
|
||||
WRITEW _start; # entry address
|
||||
WRITEW SDK_STATIC_SIZE + SDK_AUTOLOAD_SIZE; # size of module
|
||||
WRITEW _start_AutoloadDoneCallback; # callback autoload done
|
||||
|
||||
### overlay filename
|
||||
|
||||
} > main_defs
|
||||
|
||||
|
||||
############################ OVERLAYTABLE ###########################
|
||||
.main_table:
|
||||
{
|
||||
|
||||
} > main_table
|
||||
|
||||
|
||||
############################ OTHERS #################################
|
||||
SDK_MAIN_ARENA_LO = SDK_SECTION_ARENA_START;
|
||||
SDK_IRQ_STACKSIZE = 1024; # allocated in DTCM
|
||||
SDK_SYS_STACKSIZE = 0; # when 0 means all remains of DTCM
|
||||
|
||||
# Module filelist
|
||||
.binary.MODULE_FILES:
|
||||
{
|
||||
WRITES ("main.sbin");
|
||||
WRITES ("main_defs.sbin");
|
||||
WRITES ("main_table.sbin");
|
||||
} > binary.MODULE_FILES
|
||||
|
||||
# ITCM/DTCM size checker => check AUTOLOAD_ITCM/DTCM
|
||||
.check.ITCM:
|
||||
{
|
||||
. = . + SDK_AUTOLOAD_ITCM_SIZE + SDK_AUTOLOAD_ITCM_BSS_SIZE;
|
||||
} > check.ITCM
|
||||
|
||||
SDK_SYS_STACKSIZE_SIGN = (SDK_SYS_STACKSIZE < 0x80000000) * 2 - 1;
|
||||
.check.DTCM:
|
||||
{
|
||||
. = . + SDK_AUTOLOAD_DTCM_SIZE + SDK_AUTOLOAD_DTCM_BSS_SIZE;
|
||||
. = . + SDK_IRQ_STACKSIZE + SDK_SYS_STACKSIZE * SDK_SYS_STACKSIZE_SIGN;
|
||||
} > check.DTCM
|
||||
|
||||
}
|
45
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.h
Executable file
45
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.h
Executable file
@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: Nitro_TS.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
header file to include NITRO precompile header file
|
||||
*/
|
||||
|
||||
#if !__option (precompile)
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* include precompiled header for C++ source */
|
||||
#ifdef SDK_DEBUG
|
||||
#include "Nitro_TS_Debug.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#elif SDK_RELEASE
|
||||
#include "Nitro_TS_Release.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#elif SDK_FINALROM
|
||||
#include "Nitro_TS_ROM.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
#else
|
||||
/* include precompiled header for C source */
|
||||
#ifdef SDK_DEBUG
|
||||
#include "Nitro_TS_Debug.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#elif SDK_RELEASE
|
||||
#include "Nitro_TS_Release.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#elif SDK_FINALROM
|
||||
#include "Nitro_TS_ROM.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
22
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.pch
Executable file
22
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.pch
Executable file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
precompiled header for NITRO C target
|
||||
*/
|
||||
/* include precompiled header for C source */
|
||||
|
||||
#ifdef SDK_DEBUG
|
||||
#pragma precompile_target "Nitro_TS_Debug.mch"
|
||||
#elif SDK_RELEASE
|
||||
#pragma precompile_target "Nitro_TS_Release.mch"
|
||||
#elif SDK_FINALROM
|
||||
#pragma precompile_target "Nitro_TS_ROM.mch"
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
|
||||
/* include header for NITRO */
|
||||
#include <nitro_TS_prefix.h>
|
||||
#include <nitro.h>
|
||||
|
||||
/* include header for NITRO-System */
|
||||
#include <nnsys_prefix.h>
|
||||
#include <nnsys.h>
|
21
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.pch++
Executable file
21
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/Nitro_TS.pch++
Executable file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
precompiled header for NITRO C++ target
|
||||
*/
|
||||
/* include precompiled header for C++ source */
|
||||
#ifdef SDK_DEBUG
|
||||
#pragma precompile_target "Nitro_TS_Debug.mch++"
|
||||
#elif SDK_RELEASE
|
||||
#pragma precompile_target "Nitro_TS_Release.mch++"
|
||||
#elif SDK_FINALROM
|
||||
#pragma precompile_target "Nitro_TS_ROM.mch++"
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
|
||||
/* include header for NITRO */
|
||||
#include <nitro_TS_prefix.h>
|
||||
#include <nitro.h>
|
||||
|
||||
/* include header for NITRO-System */
|
||||
#include <nnsys_prefix.h>
|
||||
#include <nnsys.h>
|
98
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/ROM-TS.rsf
Executable file
98
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/ROM-TS.rsf
Executable file
@ -0,0 +1,98 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
# File: ROM-TS.rsf
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Nitro ROM SPEC FILE
|
||||
#
|
||||
|
||||
Arm9
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)"
|
||||
Elf "$(MAKEROM_ARM9:r).nef"
|
||||
}
|
||||
|
||||
Arm7
|
||||
{
|
||||
Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)"
|
||||
Elf "$(MAKEROM_ARM7:r).nef"
|
||||
}
|
||||
|
||||
Property
|
||||
{
|
||||
###
|
||||
### Settings for FinalROM
|
||||
###
|
||||
#### BEGIN
|
||||
#
|
||||
# TITLE NAME: Your product name within 12bytes
|
||||
#
|
||||
#TitleName "YourAppName"
|
||||
|
||||
#
|
||||
# MAKER CODE: Your company ID# in 2 ascii words
|
||||
# issued by NINTENDO
|
||||
#
|
||||
#MakerCode "00"
|
||||
|
||||
#
|
||||
# REMASTER VERSION: Mastering version
|
||||
#
|
||||
#RomVersion 0
|
||||
|
||||
#
|
||||
# ROM SPEED TYPE: [MROM/1TROM/UNDEFINED]
|
||||
#
|
||||
RomSpeedType $(MAKEROM_ROMSPEED)
|
||||
|
||||
#
|
||||
# ROM SIZE: in bit [64M/128M/256M/512M/1G/2G]
|
||||
#
|
||||
#RomSize 128M
|
||||
#RomSize 256M
|
||||
|
||||
#
|
||||
# ROM PADDING: TRUE if finalrom
|
||||
#
|
||||
#RomFootPadding TRUE
|
||||
|
||||
#
|
||||
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
|
||||
#
|
||||
#RomHeaderTemplate ./etc/rom_header.template.sbin
|
||||
|
||||
#
|
||||
# BANNER FILE: generated from Banner Spec File
|
||||
#
|
||||
#BannerFile ./etc/myGameBanner.bnr
|
||||
BannerFile $(NITROSDK_ROOT)/include/nitro/specfiles/default.bnr
|
||||
|
||||
###
|
||||
###
|
||||
###
|
||||
#### END
|
||||
}
|
||||
|
||||
RomSpec
|
||||
{
|
||||
Offset 0x00000000
|
||||
Segment ALL
|
||||
HostRoot $(MAKEROM_ROMROOT)
|
||||
Root /
|
||||
File $(MAKEROM_ROMFILES)
|
||||
}
|
145
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/ReadMe.txt
Executable file
145
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/ReadMe.txt
Executable file
@ -0,0 +1,145 @@
|
||||
===========================================================================
|
||||
Stationery for Nitro SDK 3.0
|
||||
Japanese description is available at the second half of this file.
|
||||
===========================================================================
|
||||
|
||||
This stationery uses precompiled headers.
|
||||
|
||||
1. The files and settings relating to the use of the precompiled header.
|
||||
|
||||
- Nitro_TS.pch
|
||||
This is the pch file to generate a mch file which is used by the C source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.pch++
|
||||
This is the pch file to generate a mch file which is used by the C++ source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.h
|
||||
This is the header file for each C and C++ source file to include
|
||||
the proper precompiled header.
|
||||
This header file is included from the Prefix Text field in the C/C++
|
||||
Preprocessor panel thus making it automatically included in each
|
||||
C/C++ source file.
|
||||
|
||||
- The settings in the C/C++ Preprocessor panel
|
||||
The settings in the C/C++ Preprocessor panel ("Target Settings"
|
||||
-> "Language Settings" -> "C/C++ Preprocessor") is the following.
|
||||
1) "Nitro_TS.h" is included by the Prefix Text.
|
||||
2) "nitro_TS_prefix.h" is not included by the Prefix Text.
|
||||
3) "Use prefix text in precompiled header" is checked.
|
||||
|
||||
|
||||
2. The behavior when building is as follows.
|
||||
|
||||
1) Nitro_TS.pch (or Nitro_TS.pch++) is precompiled.
|
||||
The mch file with the proper file name is generated.
|
||||
2) Each C source and each C++ source is compiled.
|
||||
Nitro_TS.h is included by the Prefix Text in the C/C++
|
||||
Preprocessor panel.
|
||||
The proper mch file is included.
|
||||
|
||||
|
||||
3. If you don't want to use precompiled headers, please follow the steps below.
|
||||
|
||||
1) Remove Nitro_TS.pch from Project.
|
||||
2) Remove Nitro_TS.pch++ from Project.
|
||||
3) Remove Nitro_TS.h from Project.
|
||||
4) Change the contents of Prefix Text field on C/C++ Preprocessor panel.
|
||||
- Remove the line " #include "Nitro_TS.h" ".
|
||||
- Remove the comment out of the line "#include <nitro_TS_prefix.h>" to
|
||||
make this #include effective.
|
||||
|
||||
|
||||
4. You may be able to remove Nitro_TS.pch or Nitro_TS.pch++.
|
||||
|
||||
Both of Nitro_TS.pch and Nitro_TS.pch++ are used in both the stationery
|
||||
for C and C++ Project because both C and C++ source may be used
|
||||
in one Project.
|
||||
|
||||
- If the precompiled header for C++ is unnecessary in your C Project,
|
||||
you can remove the Nitro_TS.pch++ from your Project.
|
||||
- If the precompiled header for C is unnecessary in your C++ Project,
|
||||
you can remove the Nitro_TS.pch from your Project.
|
||||
|
||||
|
||||
/*--- The lines below are written in Japanese character set ---*/
|
||||
===========================================================================
|
||||
Nitro SDK 3.0 用ステーショナリ
|
||||
プリコンパイルヘッダの使用について
|
||||
===========================================================================
|
||||
|
||||
このステーショナリではプリコンパイルヘッダを使用しています。
|
||||
|
||||
1.プリコンパイルヘッダの使用に関連した設定、ファイル
|
||||
|
||||
・ Nitro_TS.pch
|
||||
Cソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.pch++
|
||||
C++ソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.h
|
||||
各Cソース又はC++ソースが適切なプリコンパイルヘッダをインクルードする
|
||||
為のヘッダファイルです。
|
||||
各Cソース又はC++ソースのコンパイル時に必ずこのヘッダファイルが使用
|
||||
されるように、ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の
|
||||
Prefix Text でインクルードされています。
|
||||
|
||||
・ C/C++ Preprocessor パネル内の設定
|
||||
ターゲット設定パネル - 言語設定 - C/C++ Preprocessor において次の設定
|
||||
がされています。
|
||||
1) Nitro_TS.h を Prefix Text でインクルードする
|
||||
2) nitro_TS_prefix.h は Prefix Text ではインクルードしない
|
||||
3) Use prefix text in precompiled header チェックボックスがオン
|
||||
|
||||
|
||||
2.ビルド時の動きは下記のようになります。
|
||||
|
||||
1) Nitro_TS.pch (またはNitro_TS.pch++)がプリコンパイルされ、ビルド
|
||||
ターゲットに応じた適切なファイル名のmchファイルが生成される。
|
||||
2) 各Cソース又はC++ソースがコンパイルされる。
|
||||
この時、C/C++ Preprocessorパネルの Prefix Textの指定により、Nitro_TS.h
|
||||
が暗黙的にインクルードされ、適切なファイル名のmchファイルがインクルード
|
||||
される。
|
||||
|
||||
|
||||
3.プリコンパイルヘッダを使用しない構成に変更するには、下記の手順を行って
|
||||
下さい。
|
||||
|
||||
1) プロジェクトから Nitro_TS.pch を削除する
|
||||
2) プロジェクトから Nitro_TS.pch++ を削除する
|
||||
3) プロジェクトから Nitro_TS.h を削除する
|
||||
4) ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の Prefix Text の
|
||||
内容について、下記の変更を行う
|
||||
・「#include "Nitro_TS.h"」の行を削除する。
|
||||
・「#include <nitro_TS_prefix.h>」の行のコメントアウトを解除し、
|
||||
このインクルードを有効にする。
|
||||
|
||||
|
||||
4.不要な Nitro_TS.pch 又は Nitro_TS.pch++ について。
|
||||
|
||||
Cのプロジェクト用のステーショナリ及びC++プロジェクト用のステーショナリ
|
||||
の両方において、Cソース及びC++ソースが混在可能とする為に、Nitro_TS.pch と
|
||||
Nitro_TS.pch++ の両方が組み込まれています。
|
||||
|
||||
もし、CのプロジェクトでC++用のプリコンパイルヘッダが全く不要であるな
|
||||
らば、プロジェクトから Nitro_TS.pch++ を削除して頂いてかまいません。
|
||||
同様に、C++のプロジェクトでC用のプリコンパイルヘッダが全く不要である
|
||||
ならば、プロジェクトから Nitro_TS.pch を削除して頂いてかまいません。
|
||||
|
||||
|
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/data/picture.narc
Executable file
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/data/picture.narc
Executable file
Binary file not shown.
64
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/nns_util.h
Executable file
64
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/nns_util.h
Executable file
@ -0,0 +1,64 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: nns_util.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef NNS_UTIL_H_
|
||||
#define NNS_UTIL_H_
|
||||
|
||||
// プリコンパイルヘッダを使用する。
|
||||
// #include <nitro.h>
|
||||
// #include <nnsys/fnd.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 trigger;
|
||||
u16 release;
|
||||
u16 button;
|
||||
}
|
||||
GamePad;
|
||||
|
||||
extern GamePad gGamePad;
|
||||
extern NNSFndHeapHandle gSysHeap; // システムヒープ
|
||||
extern NNSFndHeapHandle gAppHeap; // アプリケーションヒープ
|
||||
|
||||
|
||||
#define IS_TRIGGER(key) (gGamePad.trigger & key)
|
||||
#define IS_RELEASE(key) (gGamePad.release & key)
|
||||
#define IS_PRESS(key) (gGamePad.button & key)
|
||||
|
||||
|
||||
#define ROUND_UP(value, alignment) \
|
||||
(((u32)(value) + (alignment-1)) & ~(alignment-1))
|
||||
|
||||
#define ROUND_DOWN(value, alignment) \
|
||||
((u32)(value) & ~(alignment-1))
|
||||
|
||||
|
||||
void ReadGamePad(void);
|
||||
void InitMemory(void);
|
||||
NNSFndArchive* LoadArchive(const char* name, const char* path);
|
||||
void RemoveArchive(NNSFndArchive* archive);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// NNS_UTIL_H_
|
||||
#endif
|
20
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/picture.naix
Executable file
20
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/picture.naix
Executable file
@ -0,0 +1,20 @@
|
||||
/*****************************************************************************
|
||||
Archive file index definition.
|
||||
File: picture.naix
|
||||
|
||||
This file was created by NINTENDO NITRO-System Archiver.
|
||||
|
||||
Update:2004-05-26T17:45:19
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef NARC_PICTURE_NAIX_
|
||||
#define NARC_PICTURE_NAIX_
|
||||
|
||||
enum {
|
||||
NARC_picture_dog256_chr = 0,
|
||||
NARC_picture_dog256_pal = 1,
|
||||
NARC_picture_dog256_scn = 2
|
||||
};
|
||||
|
||||
/* NARC_PICTURE_NAIX_ */
|
||||
#endif
|
39
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/sdk_init.h
Executable file
39
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/include/sdk_init.h
Executable file
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: sdk_init.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SDK_INIT_H_
|
||||
#define SDK_INIT_H_
|
||||
|
||||
// プリコンパイルヘッダを使用する。
|
||||
// #include <nitro.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void VBlankIntr(void);
|
||||
|
||||
void InitSystem(void);
|
||||
void InitVRAM(void);
|
||||
void InitDisplay(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// SDK_INIT_H_
|
||||
#endif
|
92
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/main.c
Executable file
92
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/main.c
Executable file
@ -0,0 +1,92 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
#include "nns_util.h"
|
||||
|
||||
// アーカイブのインデックス定義ファイル
|
||||
#include "picture.naix"
|
||||
|
||||
|
||||
static void LoadPicture(void);
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Name: NitroMain
|
||||
|
||||
Description: アーカイブからBGデータを読み込み、画面を表示するサンプル
|
||||
プログラムです。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
NitroMain(void)
|
||||
{
|
||||
InitSystem();
|
||||
InitMemory();
|
||||
InitVRAM();
|
||||
|
||||
InitDisplay();
|
||||
LoadPicture();
|
||||
G2_SetBG0Offset(0,20);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
SVC_WaitVBlankIntr();
|
||||
ReadGamePad();
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadPicture
|
||||
|
||||
Description: アーカイブを1つロードし、その中に格納されているキャラクタ、
|
||||
カラーパレット、スクリーンの各データをVRAMに転送します。
|
||||
|
||||
各データをVRAMに転送した後、アーカイブを削除します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
LoadPicture(void)
|
||||
{
|
||||
NNSFndArchive* archive;
|
||||
|
||||
// アーカイブをメインメモリに読み込み、ファイルシステムにマウントします。
|
||||
// LoadArchive()内でDC_FlushRange()の呼び出しが行われています。
|
||||
// LoadArchive()は、nns_util.c内にあります。
|
||||
if ((archive = LoadArchive("PCT", "/data/picture.narc")) != NULL)
|
||||
{
|
||||
// パス名を指定してデータを取得。
|
||||
void* chrData = NNS_FndGetArchiveFileByName("PCT:/picture/dog/dog256.chr");
|
||||
void* scnData = NNS_FndGetArchiveFileByName("PCT:/picture/dog/dog256.scn");
|
||||
|
||||
// インデックスを指定してデータを取得。
|
||||
void* palData = NNS_FndGetArchiveFileByIndex(archive, NARC_picture_dog256_pal);
|
||||
|
||||
// データをVRAMのロード。
|
||||
GX_LoadBG0Char(chrData, 0, 0x10000);
|
||||
GX_LoadBG0Scr (scnData, 0, 0x00800);
|
||||
GX_LoadBGPltt (palData, 0, 0x00200);
|
||||
|
||||
// VRAMにデータをロードした後は、メインメモリ上のデータは不要な為、
|
||||
// アーカイブを削除します。
|
||||
// RemoveArchive()は、nns_util.c内にあります。
|
||||
RemoveArchive(archive);
|
||||
}
|
||||
}
|
147
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/nns_util.c
Executable file
147
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/nns_util.c
Executable file
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: nns_util.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nns_util.h"
|
||||
|
||||
#define SYSTEM_HEAP_SIZE 64*1024
|
||||
|
||||
GamePad gGamePad; // ゲームパッド
|
||||
NNSFndHeapHandle gSysHeap; // システムヒープ (拡張ヒープを使用)
|
||||
NNSFndHeapHandle gAppHeap; // アプリケーションヒープ(拡張ヒープを使用)
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitMemory
|
||||
|
||||
Description: システムヒープとアプリケーションヒープを作成します。両ヒープ
|
||||
にはNITRO-Systemの拡張ヒープを使用しています。
|
||||
|
||||
システムヒープ用のメモリとして、SYSTEM_HEAP_SIZE分をメインア
|
||||
リーナから確保し、メインアリーナの残りを全てアプリケーション
|
||||
ヒープ用のメモリに確保しています。
|
||||
|
||||
システムヒープは、ゲームシステム等のシステムプログラムで使用
|
||||
することを想定しています。アプリケーションヒープには、ゲーム
|
||||
で使用するデータをロードする為に使用します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitMemory(void)
|
||||
{
|
||||
void* sysHeapMemory = OS_AllocFromMainArenaLo(SYSTEM_HEAP_SIZE, 16);
|
||||
|
||||
u32 arenaLow = ROUND_UP (OS_GetMainArenaLo(), 16);
|
||||
u32 arenaHigh = ROUND_DOWN(OS_GetMainArenaHi(), 16);
|
||||
u32 appHeapSize = arenaHigh - arenaLow;
|
||||
void* appHeapMemory = OS_AllocFromMainArenaLo(appHeapSize, 16);
|
||||
|
||||
gSysHeap = NNS_FndCreateExpHeap(sysHeapMemory, SYSTEM_HEAP_SIZE);
|
||||
gAppHeap = NNS_FndCreateExpHeap(appHeapMemory, appHeapSize );
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadArchive
|
||||
|
||||
Description: パス名で指定されたアーカイブをメモリに読み込み、ファイルシス
|
||||
テムにマウントします。この関数の実装では、DC_FlushRange 関数
|
||||
を呼び出す事により、読み込まれたアーカイブがメインメモリ上に
|
||||
存在する事が保証されます。
|
||||
|
||||
アーカイブを読み込む為のメモリと、アーカイブをマウントする為
|
||||
に必要なNNSFndArchive 構造体用のメモリは、アプリケーションヒ
|
||||
ープから確保します。
|
||||
|
||||
Arguments: name: アーカイブをファイルシステム上で識別する為の名前。
|
||||
path: アーカイブのパス名。
|
||||
|
||||
Returns: アーカイブのロードに成功すれば、NNSFndArchive 構造体へのポイ
|
||||
ンタを返します。失敗した場合には、NULLを返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSFndArchive*
|
||||
LoadArchive(const char* name, const char* path)
|
||||
{
|
||||
FSFile file;
|
||||
NNSFndArchive* archive = NULL;
|
||||
|
||||
FS_InitFile(&file);
|
||||
if (FS_OpenFile(&file, path))
|
||||
{
|
||||
u32 binarySize = FS_GetLength(&file);
|
||||
u32 memorySize = ROUND_UP(sizeof(NNSFndArchive), 16) + ROUND_UP(binarySize, 16);
|
||||
|
||||
u8* memory = (u8*)NNS_FndAllocFromExpHeapEx(gAppHeap, memorySize, 16);
|
||||
|
||||
if (memory != NULL)
|
||||
{
|
||||
u8* binary = memory + ROUND_UP(sizeof(NNSFndArchive), 16);
|
||||
|
||||
if (FS_ReadFile(&file, binary, (s32)binarySize) == binarySize)
|
||||
{
|
||||
DC_FlushRange(binary, binarySize);
|
||||
|
||||
if (NNS_FndMountArchive((NNSFndArchive*)memory, name, binary))
|
||||
{
|
||||
archive = (NNSFndArchive*)memory;
|
||||
}
|
||||
else
|
||||
{
|
||||
NNS_FndFreeToExpHeap(gAppHeap, memory);
|
||||
}
|
||||
}
|
||||
}
|
||||
(void)FS_CloseFile(&file);
|
||||
}
|
||||
return archive;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: RemoveArchive
|
||||
|
||||
Description: 指定されたアーカイブをメモリから削除します。
|
||||
|
||||
指定されたアーカイブをファイルシステムからアンマウントし、ア
|
||||
ーカイブが読み込まれていたメモリを解放します。
|
||||
|
||||
Arguments: archive: NNSアーカイブ構造体へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
RemoveArchive(NNSFndArchive* archive)
|
||||
{
|
||||
(void)NNS_FndUnmountArchive(archive);
|
||||
NNS_FndFreeToExpHeap(gAppHeap, archive);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ReadGamePad
|
||||
|
||||
Description: キーを読み込み、トリガとリリーストリガを求めます。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void ReadGamePad(void)
|
||||
{
|
||||
u16 status = PAD_Read();
|
||||
|
||||
gGamePad.trigger = (u16)(status & (status ^ gGamePad.button));
|
||||
gGamePad.release = (u16)(gGamePad.button & (status ^ gGamePad.button));
|
||||
gGamePad.button = status;
|
||||
}
|
125
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/sdk_init.c
Executable file
125
add-ins/TwlSystem/build/demos/IDE/IDE_Archive/src/sdk_init.c
Executable file
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_Archive
|
||||
File: sdk_init.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
|
||||
#define DEFAULT_DMA_NUMBER MI_DMA_MAX_NUM
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
V-blank callback
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
VBlankIntr(void)
|
||||
{
|
||||
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitSystem
|
||||
|
||||
Description: NITROの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitSystem(void)
|
||||
{
|
||||
OS_Init();
|
||||
FX_Init();
|
||||
GX_SetPower(GX_POWER_ALL);
|
||||
GX_Init();
|
||||
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
|
||||
(void)OS_EnableIrq();
|
||||
|
||||
FS_Init(DEFAULT_DMA_NUMBER);
|
||||
|
||||
(void)GX_VBlankIntr(TRUE); // to generate VBlank interrupt request
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitVRAM
|
||||
|
||||
Description: VRAMの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitVRAM(void)
|
||||
{
|
||||
// 全てのバンクをLCDCに割り当てる
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
|
||||
// LCDC空間全てをクリア
|
||||
MI_CpuClearFast( (void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE );
|
||||
|
||||
// LCDCに割り当てられたバンクをDisable
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
MI_CpuFillFast ((void*)HW_OAM , 192, HW_OAM_SIZE ); // OAM クリア
|
||||
MI_CpuFillFast ((void*)HW_DB_OAM , 192, HW_DB_OAM_SIZE); // clear OAM
|
||||
|
||||
MI_CpuClearFast((void*)HW_PLTT , HW_PLTT_SIZE ); // パレット クリア
|
||||
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitDisplay
|
||||
|
||||
Description: BG0のみを表示します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitDisplay(void)
|
||||
{
|
||||
GX_SetBankForBG (GX_VRAM_BG_128_A ); // バンクAをBGに割り当てる
|
||||
|
||||
GX_SetBGCharOffset(GX_BGCHAROFFSET_0x00000);
|
||||
GX_SetBGScrOffset ( GX_BGSCROFFSET_0x10000);
|
||||
|
||||
GX_SetGraphicsMode(
|
||||
GX_DISPMODE_GRAPHICS, // グラフィックス表示モードにする
|
||||
GX_BGMODE_0, // BGMODEを0に設定
|
||||
GX_BG0_AS_2D); // BG0を2D表示に設定
|
||||
|
||||
GX_SetVisiblePlane(
|
||||
GX_PLANEMASK_BG0 // BG0を表示。
|
||||
);
|
||||
|
||||
G2_SetBG0Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // 256×256ドット
|
||||
GX_BG_COLORMODE_256, // 256色モード。
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース。
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース。
|
||||
GX_BG_EXTPLTT_01 // BGExtPlttスロット。
|
||||
);
|
||||
|
||||
GX_DispOn();
|
||||
}
|
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/IDE_G2dDemoLib.mcp
Executable file
BIN
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/IDE_G2dDemoLib.mcp
Executable file
Binary file not shown.
145
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/ReadMe.txt
Executable file
145
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/ReadMe.txt
Executable file
@ -0,0 +1,145 @@
|
||||
===========================================================================
|
||||
Stationery for Nitro SDK 3.0
|
||||
Japanese description is available at the second half of this file.
|
||||
===========================================================================
|
||||
|
||||
This stationery uses precompiled headers.
|
||||
|
||||
1. The files and settings relating to the use of the precompiled header.
|
||||
|
||||
- Nitro_TS.pch
|
||||
This is the pch file to generate a mch file which is used by the C source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.pch++
|
||||
This is the pch file to generate a mch file which is used by the C++ source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.h
|
||||
This is the header file for each C and C++ source file to include
|
||||
the proper precompiled header.
|
||||
This header file is included from the Prefix Text field in the C/C++
|
||||
Preprocessor panel thus making it automatically included in each
|
||||
C/C++ source file.
|
||||
|
||||
- The settings in the C/C++ Preprocessor panel
|
||||
The settings in the C/C++ Preprocessor panel ("Target Settings"
|
||||
-> "Language Settings" -> "C/C++ Preprocessor") is the following.
|
||||
1) "Nitro_TS.h" is included by the Prefix Text.
|
||||
2) "nitro_TS_prefix.h" is not included by the Prefix Text.
|
||||
3) "Use prefix text in precompiled header" is checked.
|
||||
|
||||
|
||||
2. The behavior when building is as follows.
|
||||
|
||||
1) Nitro_TS.pch (or Nitro_TS.pch++) is precompiled.
|
||||
The mch file with the proper file name is generated.
|
||||
2) Each C source and each C++ source is compiled.
|
||||
Nitro_TS.h is included by the Prefix Text in the C/C++
|
||||
Preprocessor panel.
|
||||
The proper mch file is included.
|
||||
|
||||
|
||||
3. If you don't want to use precompiled headers, please follow the steps below.
|
||||
|
||||
1) Remove Nitro_TS.pch from Project.
|
||||
2) Remove Nitro_TS.pch++ from Project.
|
||||
3) Remove Nitro_TS.h from Project.
|
||||
4) Change the contents of Prefix Text field on C/C++ Preprocessor panel.
|
||||
- Remove the line " #include "Nitro_TS.h" ".
|
||||
- Remove the comment out of the line "#include <nitro_TS_prefix.h>" to
|
||||
make this #include effective.
|
||||
|
||||
|
||||
4. You may be able to remove Nitro_TS.pch or Nitro_TS.pch++.
|
||||
|
||||
Both of Nitro_TS.pch and Nitro_TS.pch++ are used in both the stationery
|
||||
for C and C++ Project because both C and C++ source may be used
|
||||
in one Project.
|
||||
|
||||
- If the precompiled header for C++ is unnecessary in your C Project,
|
||||
you can remove the Nitro_TS.pch++ from your Project.
|
||||
- If the precompiled header for C is unnecessary in your C++ Project,
|
||||
you can remove the Nitro_TS.pch from your Project.
|
||||
|
||||
|
||||
/*--- The lines below are written in Japanese character set ---*/
|
||||
===========================================================================
|
||||
Nitro SDK 3.0 用ステーショナリ
|
||||
プリコンパイルヘッダの使用について
|
||||
===========================================================================
|
||||
|
||||
このステーショナリではプリコンパイルヘッダを使用しています。
|
||||
|
||||
1.プリコンパイルヘッダの使用に関連した設定、ファイル
|
||||
|
||||
・ Nitro_TS.pch
|
||||
Cソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.pch++
|
||||
C++ソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.h
|
||||
各Cソース又はC++ソースが適切なプリコンパイルヘッダをインクルードする
|
||||
為のヘッダファイルです。
|
||||
各Cソース又はC++ソースのコンパイル時に必ずこのヘッダファイルが使用
|
||||
されるように、ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の
|
||||
Prefix Text でインクルードされています。
|
||||
|
||||
・ C/C++ Preprocessor パネル内の設定
|
||||
ターゲット設定パネル - 言語設定 - C/C++ Preprocessor において次の設定
|
||||
がされています。
|
||||
1) Nitro_TS.h を Prefix Text でインクルードする
|
||||
2) nitro_TS_prefix.h は Prefix Text ではインクルードしない
|
||||
3) Use prefix text in precompiled header チェックボックスがオン
|
||||
|
||||
|
||||
2.ビルド時の動きは下記のようになります。
|
||||
|
||||
1) Nitro_TS.pch (またはNitro_TS.pch++)がプリコンパイルされ、ビルド
|
||||
ターゲットに応じた適切なファイル名のmchファイルが生成される。
|
||||
2) 各Cソース又はC++ソースがコンパイルされる。
|
||||
この時、C/C++ Preprocessorパネルの Prefix Textの指定により、Nitro_TS.h
|
||||
が暗黙的にインクルードされ、適切なファイル名のmchファイルがインクルード
|
||||
される。
|
||||
|
||||
|
||||
3.プリコンパイルヘッダを使用しない構成に変更するには、下記の手順を行って
|
||||
下さい。
|
||||
|
||||
1) プロジェクトから Nitro_TS.pch を削除する
|
||||
2) プロジェクトから Nitro_TS.pch++ を削除する
|
||||
3) プロジェクトから Nitro_TS.h を削除する
|
||||
4) ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の Prefix Text の
|
||||
内容について、下記の変更を行う
|
||||
・「#include "Nitro_TS.h"」の行を削除する。
|
||||
・「#include <nitro_TS_prefix.h>」の行のコメントアウトを解除し、
|
||||
このインクルードを有効にする。
|
||||
|
||||
|
||||
4.不要な Nitro_TS.pch 又は Nitro_TS.pch++ について。
|
||||
|
||||
Cのプロジェクト用のステーショナリ及びC++プロジェクト用のステーショナリ
|
||||
の両方において、Cソース及びC++ソースが混在可能とする為に、Nitro_TS.pch と
|
||||
Nitro_TS.pch++ の両方が組み込まれています。
|
||||
|
||||
もし、CのプロジェクトでC++用のプリコンパイルヘッダが全く不要であるな
|
||||
らば、プロジェクトから Nitro_TS.pch++ を削除して頂いてかまいません。
|
||||
同様に、C++のプロジェクトでC用のプリコンパイルヘッダが全く不要である
|
||||
ならば、プロジェクトから Nitro_TS.pch を削除して頂いてかまいません。
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
NITRO-System/build/demos/IDE/IDE_G2dDemoLib/bin/ARM9-TS/Debug
|
@ -0,0 +1 @@
|
||||
NITRO-System/build/demos/IDE/IDE_G2dDemoLib/bin/ARM9-TS/Release
|
@ -0,0 +1 @@
|
||||
NITRO-System/build/demos/IDE/IDE_G2dDemoLib/bin/ARM9-TS/Rom
|
34
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib.h
Executable file
34
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib.h
Executable file
@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib
|
||||
File: g2d_demolib.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef G2D_DEMOLIB_H_
|
||||
#define G2D_DEMOLIB_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <nitro.h>
|
||||
#include <nnsys/fnd.h>
|
||||
#include <nnsys/g2d.h>
|
||||
|
||||
#include "g2d_demolib/system.h"
|
||||
#include "g2d_demolib/loader.h"
|
||||
#include "g2d_demolib/print.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// G2D_DEMOLIB_H_
|
||||
#endif
|
@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib - include - g2d_demolib
|
||||
File: fontData.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef G2D_DEMOLIB_FONTDATA_H_
|
||||
#define G2D_DEMOLIB_FONTDATA_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
extern const u32 fontCharData[16 * 256];
|
||||
extern const u16 fontPlttData[16][256];
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// G2D_DEMOLIB_FONTDATA_H_
|
||||
#endif
|
@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib - include - g2d_demolib
|
||||
File: loader.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef G2D_DEMOLIB_LOADER_H_
|
||||
#define G2D_DEMOLIB_LOADER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void* G2DDemo_LoadNCER( NNSG2dCellDataBank** ppCellBank, const char* pFname );
|
||||
void* G2DDemo_LoadNANR( NNSG2dAnimBankData** ppAnimBank, const char* pFname );
|
||||
void* G2DDemo_LoadNMCR( NNSG2dMultiCellDataBank** ppMCBank, const char* pFname );
|
||||
void* G2DDemo_LoadNMAR( NNSG2dMultiCellAnimBankData** ppMCABank, const char* pFname );
|
||||
void* G2DDemo_LoadNCGR( NNSG2dCharacterData** ppCharData, const char* pFname );
|
||||
void* G2DDemo_LoadNCLR( NNSG2dPaletteData** ppPltData, const char* pFname );
|
||||
void* G2DDemo_LoadNENR( NNSG2dEntityDataBank** ppEntityBank, const char* pFname );
|
||||
void* G2DDemo_LoadNCBR( NNSG2dCharacterData** ppCharData, const char* pFname );
|
||||
void* G2DDemo_LoadNSCR( NNSG2dScreenData** ppScreenData, const char* pFname );
|
||||
|
||||
void* G2DDemo_LoadNCGREx( NNSG2dCharacterData** ppCharData, NNSG2dCharacterPosInfo** ppCharPosInfo, const char* pFname );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// G2D_DEMOLIB_LOADER_H_
|
||||
#endif
|
36
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib/print.h
Executable file
36
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib/print.h
Executable file
@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib - include - g2d_demolib
|
||||
File: print.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef G2D_DEMOLIB_PRINT_H_
|
||||
#define G2D_DEMOLIB_PRINT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void G2DDemo_PrintInit(void);
|
||||
void G2DDemo_PrintClear(void);
|
||||
void G2DDemo_PrintOut(int x, int y, const char* string);
|
||||
void G2DDemo_PrintOutf(int x, int y, const char* format, ...);
|
||||
void G2DDemo_PrintApplyToHW(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// G2D_DEMOLIB_PRINT_H_
|
||||
#endif
|
111
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib/system.h
Executable file
111
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/include/g2d_demolib/system.h
Executable file
@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib - include - g2d_demolib
|
||||
File: system.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#ifndef G2D_DEMO_SYSTEM_H_
|
||||
#define G2D_DEMO_SYSTEM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
初期化関係。
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void G2DDemo_CommonInit(void);
|
||||
void G2DDemo_CameraSetup(void);
|
||||
void G2DDemo_MaterialSetup(void);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
ゲームパッド関係。
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ゲームパッド構造体
|
||||
typedef struct
|
||||
{
|
||||
u16 trigger;
|
||||
u16 release;
|
||||
u16 button;
|
||||
}
|
||||
G2DDemoGamePad;
|
||||
|
||||
// ゲームパッドワーク。
|
||||
extern G2DDemoGamePad gGamePad;
|
||||
|
||||
#define G2DDEMO_IS_TRIGGER(key) (gGamePad.trigger & key)
|
||||
#define G2DDEMO_IS_RELEASE(key) (gGamePad.release & key)
|
||||
#define G2DDEMO_IS_PRESS(key) (gGamePad.button & key)
|
||||
|
||||
void G2DDemo_ReadGamePad(void);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
その他
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
extern NNSFndHeapHandle gHeapHandle; // ヒープハンドル
|
||||
|
||||
NNSG2dCellAnimation* G2DDemo_GetNewCellAnimation( u16 num );
|
||||
NNSG2dNode* G2DDemo_GetNewNode( u16 num );
|
||||
|
||||
/*
|
||||
NNSG2dMultiCellAnimation* G2DDemo_GetNewMultiCellAnimation
|
||||
(
|
||||
u16 numNode,
|
||||
const NNSG2dCellAnimBankData* pAnimBank,
|
||||
const NNSG2dCellDataBank* pCellDataBank ,
|
||||
const NNSG2dMultiCellDataBank* pMultiCellDataBank
|
||||
);
|
||||
*/
|
||||
|
||||
NNSG2dMultiCellAnimation* G2DDemo_GetNewMultiCellAnimation
|
||||
(
|
||||
const NNSG2dCellAnimBankData* pAnimBank,
|
||||
const NNSG2dCellDataBank* pCellDataBank ,
|
||||
const NNSG2dMultiCellDataBank* pMultiCellDataBank,
|
||||
NNSG2dMCType mcType
|
||||
);
|
||||
|
||||
static inline void G2DDemo_MTX_Rot22( MtxFx22* m, fx32 sinVal, fx32 cosVal )
|
||||
{
|
||||
SDK_NULL_ASSERT( m );
|
||||
m->_00 = cosVal;
|
||||
m->_01 = sinVal;
|
||||
m->_10 = -sinVal;
|
||||
m->_11 = cosVal;
|
||||
}
|
||||
|
||||
inline void* G2DDemo_Alloc(u32 size)
|
||||
{
|
||||
SDK_ASSERT( size > 0 );
|
||||
return NNS_FndAllocFromExpHeap(gHeapHandle, size);
|
||||
}
|
||||
|
||||
inline void G2DDemo_Free(void* memBlock)
|
||||
{
|
||||
SDK_ASSERT( NNS_FndFindContainHeap(memBlock) == gHeapHandle );
|
||||
NNS_FndFreeToExpHeap(gHeapHandle, memBlock);
|
||||
}
|
||||
|
||||
extern void VBlankIntr( void );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// G2D_DEMO_SYSTEM_H_
|
||||
#endif
|
548
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/fontData.c
Executable file
548
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/fontData.c
Executable file
@ -0,0 +1,548 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib
|
||||
File: fontData.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "g2d_demolib/fontData.h"
|
||||
|
||||
/*---------------------- パレットデータ ---------------------------*/
|
||||
#define RGB555(r,g,b) (b<<10|g<<5|r)
|
||||
|
||||
const u16 fontPlttData[16][256] = {
|
||||
{RGB555(0,0,0), RGB555(0, 0, 0 ), RGB555(0, 0, 0 ), RGB555(0, 0, 0 ),}, // Black
|
||||
{RGB555(0,0,0), RGB555(31,0, 0 ), RGB555(31,0, 0 ), RGB555(31,0, 0 ),}, // Red
|
||||
{RGB555(0,0,0), RGB555(0, 31,0 ), RGB555(0, 31,0 ), RGB555(0, 31,0 ),}, // Green
|
||||
{RGB555(0,0,0), RGB555(0, 0, 31), RGB555(0, 0, 31), RGB555(0, 0, 31),}, // Blue
|
||||
{RGB555(0,0,0), RGB555(31,31,0 ), RGB555(31,31,0 ), RGB555(31,31,0 ),}, // Yellow
|
||||
{RGB555(0,0,0), RGB555(0, 31,31), RGB555(0, 31,31), RGB555(0, 31,31),}, // Cyan
|
||||
{RGB555(0,0,0), RGB555(31,0, 31), RGB555(31,0, 31), RGB555(31,0, 31),}, // Purple
|
||||
{RGB555(0,0,0), RGB555(31,31, 31), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // White
|
||||
};
|
||||
|
||||
|
||||
/*---------------------- キャラクタデータ -------------------------*/
|
||||
|
||||
const u32 fontCharData[16 * 256] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x00000100,0x00010001,0x00010100,0x00000000,
|
||||
0x01000100,0x00000001,0x00000100,0x00010100,0x00000100,0x00000000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x01000100,0x00010001,0x00000100,0x00010001,0x00000100,0x00000001,
|
||||
0x00000100,0x00000100,0x00000100,0x00000100,0x00000001,0x00000100,0x00000001,0x00000100,
|
||||
0x00000000,0x00000000,0x00000001,0x00010001,0x00000001,0x00010001,0x01010101,0x00010101,
|
||||
0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010101,0x00010101,0x00000000,0x00000100,
|
||||
0x00000000,0x00000100,0x00000000,0x00000001,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x00010000,0x00010001,0x01000100,0x00000000,
|
||||
0x00000001,0x00000001,0x00000001,0x00000100,0x00000000,0x00010000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00010001,0x01000000,0x00010001,0x01010101,0x00010101,
|
||||
0x01000000,0x00000000,0x01000100,0x00000100,0x01000100,0x00010000,0x01000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x01010101,0x00010100,0x00000100,0x00010001,
|
||||
0x00000100,0x00000001,0x00000100,0x00000001,0x00000100,0x00000001,0x01000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x01010101,0x00010001,0x00010000,0x00000000,
|
||||
0x01010101,0x00000001,0x01000000,0x00000000,0x00000001,0x00000000,0x01010100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01000000,0x00010001,0x00010100,0x00000000,
|
||||
0x00000001,0x00000000,0x00010100,0x00000000,0x01000000,0x00000001,0x00000000,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010001,0x00010101,0x00000001,0x00000001,
|
||||
0x00000001,0x00000001,0x00000001,0x00000001,0x00000001,0x00000001,0x01000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010100,0x00010001,0x00000000,0x00000100,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x01010101,0x00010001,0x01000000,0x00000000,
|
||||
0x00000000,0x00000001,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000001,0x00010001,0x00000001,0x00010001,0x00000001,0x00000000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010101,0x00010101,0x01000000,0x00000001,
|
||||
0x00010000,0x00000001,0x00010000,0x00000001,0x01000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x01010101,0x00010101,0x00000100,0x00000001,
|
||||
0x00000100,0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x01010100,0x00000000,0x00010000,0x00010001,0x00000100,0x00010001,
|
||||
0x01010101,0x00000101,0x00010000,0x00000000,0x00010000,0x00000000,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x01010101,0x00010001,0x00010000,0x00000000,
|
||||
0x00010000,0x00010101,0x00000100,0x00000000,0x01000100,0x00000000,0x00000100,0x00010101,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x01010101,0x00010001,0x00000100,0x00000000,
|
||||
0x01010100,0x00000001,0x00000001,0x00000100,0x00000000,0x00000100,0x01010100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010000,0x00010001,0x00000101,0x00000100,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010101,0x00010101,0x00000000,0x00000001,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x00000000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x00000100,0x00010001,0x01010000,0x00000000,
|
||||
0x00000100,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00010001,0x01010001,0x00010101,0x00000001,0x00000001,
|
||||
0x00000001,0x00000001,0x01000001,0x00000101,0x00010001,0x00010001,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x00000101,0x00010001,0x00000100,0x00010101,
|
||||
0x00000001,0x00000001,0x00000001,0x00000001,0x01000100,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010001,0x01000000,0x00010001,0x00010000,0x00000000,
|
||||
0x01000001,0x00000100,0x00000001,0x00010001,0x00000001,0x00010001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010000,0x00010001,0x00000100,0x00000001,
|
||||
0x00000100,0x00000001,0x00000001,0x00000100,0x00000000,0x00010000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010001,0x00010001,0x00000001,0x00010001,0x01010001,0x00000101,
|
||||
0x00000001,0x00000001,0x01000001,0x00000001,0x00010001,0x00000101,0x01000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010101,0x01010001,0x00010001,0x00000001,0x00000101,
|
||||
0x00000001,0x00000001,0x01000001,0x00000101,0x00010001,0x00010001,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00010101,0x00000101,0x00010001,0x00000100,0x00000101,
|
||||
0x00000001,0x00000001,0x00000001,0x00000001,0x01000100,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010100,0x01000000,0x00010001,0x00010000,0x00000100,
|
||||
0x01000001,0x00000100,0x00000001,0x00010001,0x00000001,0x00010001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010101,0x01010000,0x00010001,0x00000100,0x00000101,
|
||||
0x00000100,0x00000001,0x00000001,0x00000100,0x00000000,0x00010000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010001,0x00010101,0x00000001,0x00010001,0x01010001,0x00000101,
|
||||
0x00000001,0x00000001,0x01000001,0x00000001,0x00010001,0x00000101,0x01000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00010100,0x01000000,0x00010000,0x00010000,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00010000,0x00000100,0x01010101,0x00010101,0x00010000,0x00000100,
|
||||
0x00010000,0x00000100,0x01010101,0x00010101,0x00000100,0x00000001,0x00000100,0x00000001,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010100,0x00010101,0x01000001,0x00000000,
|
||||
0x01010100,0x00000101,0x01000000,0x00010000,0x01010101,0x00000101,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010000,0x00010001,0x00000100,0x00000100,0x00000001,
|
||||
0x01000000,0x00000000,0x00010000,0x00000100,0x00000100,0x00010001,0x00000001,0x00000100,
|
||||
0x00000000,0x00000000,0x01010100,0x00000000,0x00000001,0x00000001,0x01000001,0x00000000,
|
||||
0x00010100,0x00010000,0x01000001,0x00000100,0x00000001,0x00000101,0x01010100,0x00010000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000001,0x00000000,0x00000001,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010101,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x00010000,0x00000000,0x00010000,0x00000000,0x01000000,0x00000000,0x00000000,0x00010101,
|
||||
0x00000000,0x00000000,0x00010101,0x00000000,0x01000000,0x00000000,0x00000000,0x00000001,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x01000000,0x00000000,0x00010101,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000001,0x00010000,0x01000100,0x00000100,
|
||||
0x01010000,0x00000001,0x01000100,0x00000100,0x01000001,0x00010000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01010101,0x00010101,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x01010101,0x00010101,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x00000001,
|
||||
0x01000000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000000,0x00010000,
|
||||
0x01010100,0x00000101,0x00000001,0x00000000,0x00000001,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000000,0x00010000,
|
||||
0x01010100,0x00000101,0x00000000,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000100,0x00000000,0x00000101,0x01000000,0x00000100,
|
||||
0x00010000,0x00000100,0x00000100,0x00000100,0x01010101,0x00010101,0x00000000,0x00000100,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00000000,0x01010101,0x00000101,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00000000,0x01010101,0x00000101,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000100,0x00000000,0x00000100,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x01010100,0x00010101,0x00000000,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010100,0x01000000,0x00000001,0x00010100,0x00000000,
|
||||
0x00000001,0x00000000,0x00010100,0x00000000,0x01000000,0x00000001,0x00000000,0x00010100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000101,0x00000000,0x01010000,0x00000000,0x00000000,0x00000101,
|
||||
0x00000000,0x00010000,0x00000000,0x00000101,0x01010000,0x00000000,0x00000101,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000101,0x01000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x00000100,0x00000100,0x01000001,0x00010000,
|
||||
0x00010001,0x00010001,0x00010001,0x00010001,0x00010001,0x00010001,0x01000100,0x00000101,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000001,0x00010000,0x00000001,
|
||||
0x00000100,0x00000100,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,0x01010101,0x00000101,
|
||||
0x00000000,0x00000000,0x01010000,0x00000101,0x00000100,0x00010000,0x00000001,0x00000000,
|
||||
0x00000001,0x00000000,0x00000001,0x00000000,0x00000100,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x01010101,0x00000001,0x00000001,0x00000100,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00000100,0x01010101,0x00000001,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x01010101,0x00010101,0x00000001,0x00000000,0x00000001,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x01010101,0x00000101,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000101,0x00000100,0x00010000,0x00000001,0x00000000,
|
||||
0x01000001,0x00010101,0x00000001,0x00010000,0x00000100,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01010101,0x00010101,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000001,0x00010100,0x01000001,0x00000001,0x00010001,0x00000000,
|
||||
0x00000101,0x00000000,0x00010001,0x00000000,0x01000001,0x00000001,0x00000001,0x00010100,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000101,0x00010100,0x00010001,0x00010001,
|
||||
0x01000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000101,0x00010000,0x00010001,0x00010000,
|
||||
0x01000001,0x00010000,0x00000001,0x00010001,0x00000001,0x00010100,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x00000100,0x00000100,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01010101,0x00000101,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x00000100,0x00000100,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x01000001,0x00010001,0x00000100,0x00000100,0x01010000,0x00010001,
|
||||
0x00000000,0x00000000,0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,0x00000001,0x00000000,
|
||||
0x01010100,0x00000101,0x00000000,0x00010000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,
|
||||
0x00000100,0x00000100,0x00010000,0x00000001,0x00010000,0x00000001,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01000001,0x00010000,0x00010001,0x00010001,0x00000101,0x00010100,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000100,0x00000100,0x00010000,0x00000001,
|
||||
0x01000000,0x00000000,0x00010000,0x00000001,0x00000100,0x00000100,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000100,0x00000100,0x00010000,0x00000001,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000100,0x00000000,0x00000001,
|
||||
0x01000000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010000,0x00010101,0x00010000,0x00000000,0x00010000,0x00000000,
|
||||
0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x01010000,0x00010101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x00010000,0x00000001,0x01010100,0x00000101,
|
||||
0x01000000,0x00000000,0x01010100,0x00000101,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x01010101,0x00000001,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000001,0x00000100,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x01000000,0x00000000,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000001,0x00000001,0x00000100,
|
||||
0x01010100,0x00000101,0x00000001,0x00000100,0x00000001,0x00000100,0x01010100,0x00010001,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010101,0x00000101,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010101,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000101,0x00000100,0x00010000,
|
||||
0x00000001,0x00000000,0x00000001,0x00000000,0x00000100,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x01010100,0x00010101,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,
|
||||
0x01010101,0x00010101,0x00000001,0x00000000,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000101,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01010101,0x00010101,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00010101,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x01010100,0x00010101,0x00000000,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x01010101,0x00000101,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000100,0x00000000,0x00000000,0x00000000,0x00000100,
|
||||
0x00000000,0x00000100,0x00000001,0x00000100,0x00000001,0x00000100,0x01010100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00010100,
|
||||
0x01000001,0x00000001,0x00010101,0x00000000,0x01000001,0x00000001,0x00000001,0x00010100,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00010101,0x00000101,0x01000001,0x00010000,
|
||||
0x01000001,0x00010000,0x01000001,0x00010000,0x01000001,0x00010000,0x01000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00000101,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000001,0x00000100,0x00000100,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010001,0x00000101,0x00000101,0x00010000,
|
||||
0x00000001,0x00010000,0x00000101,0x00010000,0x01010001,0x00000101,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00010001,0x00000001,0x00010100,
|
||||
0x00000001,0x00010000,0x00000001,0x00010100,0x01010100,0x00010001,0x00000000,0x00010000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000101,0x01010001,0x00000000,
|
||||
0x00000101,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x00000001,0x00010000,
|
||||
0x01010100,0x00000000,0x00000000,0x00000101,0x00000001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x01010101,0x00010101,
|
||||
0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x01000000,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000100,0x00000100,0x00000100,0x00000100,0x00010000,0x00000001,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x01000001,0x00010000,0x01000100,0x00000100,0x01000100,0x00000100,0x00010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000100,0x00000100,0x00000001,
|
||||
0x01010000,0x00000000,0x01010000,0x00000000,0x00000100,0x00000001,0x00000001,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000100,0x00000100,0x01010000,0x00000001,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00000101,0x00000000,0x00000001,
|
||||
0x01000000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x01010101,0x00000101,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010100,0x00000001,0x00010000,0x00010100,
|
||||
0x01000000,0x00000001,0x00010000,0x00000100,0x00010000,0x00000000,0x01000000,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000001,0x00010000,0x00000000,
|
||||
0x01010100,0x00000001,0x00010001,0x00000101,0x01010001,0x00000100,0x00000100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000001,
|
||||
0x00000001,0x00000100,0x00000001,0x00000100,0x00000001,0x00000000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000001,0x00000000,0x00000000,
|
||||
0x01010100,0x00000001,0x00000000,0x00000100,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000001,0x00000000,0x00000000,
|
||||
0x01010100,0x00000101,0x00000000,0x00000001,0x01010000,0x00000000,0x00000100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000100,
|
||||
0x00010000,0x00010000,0x01010100,0x00000001,0x00010001,0x00000100,0x00010100,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01000100,0x00000000,0x01010100,0x00000001,
|
||||
0x01000101,0x00000100,0x00000100,0x00000100,0x00010000,0x00000001,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000000,0x01010001,0x00000001,
|
||||
0x01000101,0x00000100,0x01000001,0x00000100,0x01000001,0x00000001,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000101,
|
||||
0x01000000,0x00000000,0x01010100,0x00000001,0x01000001,0x00000100,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000001,
|
||||
0x00000101,0x00000100,0x00000000,0x00000100,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00010100,0x00000000,0x01000001,0x00010000,0x00000000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000101,0x00010000,0x00000000,
|
||||
0x01010100,0x00000101,0x00010001,0x00010001,0x01010001,0x00010000,0x00010100,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000100,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00000000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x01010000,0x00000101,0x00000000,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x00000000,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000001,0x01000000,0x00000000,0x00010000,0x00000001,0x00000100,0x00010100,
|
||||
0x00000000,0x00000000,0x00010000,0x00000100,0x01010101,0x00010001,0x00010000,0x00000000,
|
||||
0x01010100,0x00000101,0x00010001,0x00010000,0x00010001,0x00010000,0x00000100,0x00000100,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x01010101,0x00010000,0x00000100,0x00010001,
|
||||
0x00000100,0x00010001,0x00000100,0x00000001,0x00000100,0x00000001,0x01000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010100,0x00000101,0x01000000,0x00000000,
|
||||
0x01010100,0x00000101,0x00000000,0x00000001,0x00000100,0x00000000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000100,0x01000000,0x00000001,0x00010100,0x00000000,
|
||||
0x00000001,0x00000000,0x00010100,0x00000000,0x01000000,0x00000001,0x00000000,0x00000100,
|
||||
0x00000000,0x00000000,0x00000000,0x00000100,0x01010001,0x00010101,0x00000001,0x00000100,
|
||||
0x00000001,0x00000100,0x00000001,0x00000100,0x00000001,0x00000100,0x00000100,0x00000001,
|
||||
0x00000000,0x00000000,0x01010100,0x00000001,0x00000000,0x00000100,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000001,
|
||||
0x00000000,0x00000100,0x00000100,0x00000000,0x00000100,0x00000000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000100,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x01010101,0x00010101,0x01000000,0x00000001,
|
||||
0x00010000,0x00000001,0x00010000,0x00000001,0x01000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x01010101,0x00010101,0x00000100,0x00000100,
|
||||
0x00000100,0x00000100,0x00000100,0x00000000,0x00000100,0x00000000,0x01010000,0x00010101,
|
||||
0x00000000,0x00000000,0x01010000,0x00000101,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x01010101,0x00010101,0x01000000,0x00000000,0x01000000,0x00000000,0x00000000,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000001,0x00010000,0x00000000,
|
||||
0x00010000,0x00010101,0x00000100,0x00000000,0x01000100,0x00000000,0x00000100,0x00010101,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,0x00010000,0x00000000,
|
||||
0x01010000,0x00000101,0x00000100,0x00010000,0x00000000,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000001,0x00000101,0x00000100,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000001,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x00000000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x00000100,0x00000101,0x01010000,0x00000000,
|
||||
0x00000100,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00000100,0x01010101,0x00010000,0x00000100,0x00010000,
|
||||
0x00000001,0x00000001,0x01010000,0x00000101,0x00000100,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x01000100,0x00010101,0x00000100,0x00010000,
|
||||
0x00000100,0x00000000,0x00000100,0x00000000,0x01000100,0x00000000,0x00000100,0x00010101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x01010100,0x00000101,0x00000100,0x00010001,
|
||||
0x01000101,0x00010000,0x01010001,0x00010100,0x00010001,0x00010001,0x00000100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000101,0x01000101,0x00010000,0x00010100,0x00010000,
|
||||
0x00010100,0x00010000,0x00000100,0x00010101,0x01000101,0x00010000,0x00000100,0x00000101,
|
||||
0x00000000,0x00000000,0x01010000,0x00000001,0x01000100,0x00000100,0x01000001,0x00010000,
|
||||
0x01000001,0x00010000,0x00010001,0x00010000,0x00010001,0x00010000,0x00000100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00000100,0x01010001,0x00010101,0x00000001,0x00000100,
|
||||
0x00000001,0x00000100,0x01000001,0x00000101,0x00010001,0x00010100,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x00000101,0x00000100,0x00000100,0x00010100,
|
||||
0x00000001,0x00000100,0x00000001,0x00000100,0x00000100,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01000100,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010101,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01000000,0x00000001,
|
||||
0x01000000,0x00000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00010000,0x01010101,0x00010101,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00000101,0x00000000,0x00000100,
|
||||
0x00010000,0x00000001,0x01010000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000100,0x00000000,0x00000100,
|
||||
0x00000000,0x00000001,0x01010101,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000101,
|
||||
0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x01010101,0x00000101,
|
||||
0x01000000,0x00000001,0x00010000,0x00000001,0x00000100,0x00000001,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000100,0x00000000,0x01010101,0x00000101,
|
||||
0x00000100,0x00000100,0x00000100,0x00000001,0x00010000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000100,0x00000000,0x00000100,0x00000000,0x00000100,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000100,
|
||||
0x01010100,0x00000101,0x00000000,0x00000100,0x00000000,0x00000100,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00010001,0x00000100,0x01000100,0x00000100,
|
||||
0x01000100,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x01010101,0x00010101,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00010000,0x01000000,0x00000100,
|
||||
0x01000000,0x00000001,0x01000000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00010101,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00000100,0x01010101,0x00010101,0x00000000,0x00000101,
|
||||
0x01000000,0x00000100,0x00010000,0x00000100,0x00000100,0x00000100,0x00000001,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00010101,0x00010000,0x00010000,
|
||||
0x00010000,0x00010000,0x00010000,0x00010000,0x00000100,0x00010000,0x00000001,0x00000100,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000101,0x01000000,0x00000000,
|
||||
0x01010101,0x00010101,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010000,0x00010101,0x00010000,0x00010000,0x00010000,0x00010000,
|
||||
0x00000100,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x01010100,0x00010101,0x00000100,0x00000100,
|
||||
0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010101,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x01010101,0x00010101,0x00000100,0x00000100,
|
||||
0x00000100,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000101,0x00000000,0x00010000,0x00000000,0x00000101,0x00010000,
|
||||
0x00010000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,0x00010101,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00010000,0x00000000,0x00000100,
|
||||
0x00000000,0x00000001,0x01000000,0x00000001,0x00010000,0x00000100,0x00000101,0x00010000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x01010101,0x00010101,0x00000100,0x00010000,
|
||||
0x00000100,0x00000100,0x00000100,0x00000000,0x00000100,0x00000000,0x01010000,0x00010101,
|
||||
0x00000000,0x00000000,0x00000001,0x00010000,0x00000100,0x00010000,0x00000000,0x00010000,
|
||||
0x00000000,0x00000100,0x00000000,0x00000100,0x01000000,0x00000001,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010101,0x00000100,0x00010000,0x01010100,0x00010000,
|
||||
0x00000001,0x00010101,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00010100,0x01010100,0x00000001,0x00000000,0x00000001,
|
||||
0x01010101,0x00010101,0x00000000,0x00000001,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00010001,0x00010000,0x01000100,0x00010000,0x01000100,0x00010000,
|
||||
0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x00000001,0x01010100,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x00000100,0x00000000,0x00010100,0x00000000,
|
||||
0x01000100,0x00000001,0x00000100,0x00010100,0x00000100,0x00000000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x01010101,0x00010101,
|
||||
0x00000000,0x00000001,0x00000000,0x00000001,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010100,0x00010101,0x00000000,0x00010000,0x00010000,0x00010000,
|
||||
0x01000000,0x00000100,0x00000000,0x00000001,0x01000000,0x00000100,0x00010100,0x00010000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00000100,
|
||||
0x00000000,0x00000001,0x01010000,0x00000001,0x01000101,0x00010100,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000000,0x00000100,0x00000000,0x00000100,0x01000000,0x00000001,0x00010101,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00000001,0x00000100,0x00000100,0x00000100,0x00000100,
|
||||
0x00000100,0x00010000,0x00000100,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010101,0x00010101,
|
||||
0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x00000000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x00000001,0x01010100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x01000100,0x00000000,
|
||||
0x00000001,0x00000001,0x00000001,0x00000100,0x00000000,0x00010000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x01010101,0x00010101,
|
||||
0x01000000,0x00000000,0x01000100,0x00000100,0x01000100,0x00010000,0x01000001,0x00010000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000100,0x00000100,0x00010000,0x00000001,0x01000000,0x00000000,0x00000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010100,0x00000000,0x00000000,0x00010101,0x01010100,0x00000000,
|
||||
0x00000000,0x00010101,0x00010100,0x00000000,0x01000000,0x00000001,0x00000000,0x00010100,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x00010000,0x00000000,0x00000100,0x00000100,0x00000100,0x00010000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x00010000,0x00000100,
|
||||
0x01000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000100,0x00000101,0x00010000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00010000,0x00000000,0x01010101,0x00010101,
|
||||
0x00010000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x01000000,0x00010101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x01010101,0x00010101,0x00000100,0x00010000,
|
||||
0x00000100,0x00000100,0x00010000,0x00000001,0x00010000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000100,
|
||||
0x00000000,0x00000100,0x00000000,0x00000100,0x00000000,0x00000100,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010100,0x00010101,0x00000000,0x00010000,0x00000000,0x00010000,
|
||||
0x01010100,0x00010101,0x00000000,0x00010000,0x00000000,0x00010000,0x01010100,0x00010101,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000000,0x01010101,0x00010101,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000100,0x00010000,0x00000100,0x00010000,0x00000100,0x00010000,
|
||||
0x00000100,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01000100,0x00000000,0x01000100,0x00000000,0x01000100,0x00000000,
|
||||
0x01000100,0x00010000,0x01000100,0x00010000,0x01000100,0x00000100,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x00000100,0x00000000,0x00000100,0x00010000,
|
||||
0x00000100,0x00010000,0x00000100,0x00000100,0x00000100,0x00000001,0x01010100,0x00000000,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000001,0x00010000,0x00000001,0x00010000,0x00000001,0x00010000,0x01010101,0x00010101,
|
||||
0x00000000,0x00000000,0x01010101,0x00010101,0x00000001,0x00010000,0x00000001,0x00010000,
|
||||
0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01010000,0x00000001,
|
||||
0x00000000,0x00000000,0x00000101,0x00010000,0x00010000,0x00010000,0x00000000,0x00010000,
|
||||
0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,0x00000001,0x01010101,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000001,0x01000000,0x00000000,0x00010000,0x00000000,
|
||||
0x01000001,0x00000100,0x00000001,0x00010001,0x00000001,0x00010001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x01010000,0x00000000,0x00000100,0x00000001,
|
||||
0x00000100,0x00000001,0x00000001,0x00000100,0x00000000,0x00010000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010001,0x00010101,0x00000001,0x00000100,0x01010001,0x00010101,
|
||||
0x00000001,0x00000100,0x01000001,0x00000101,0x00010001,0x00010100,0x01000001,0x00000001,
|
||||
0x00000000,0x00000000,0x01010000,0x00000101,0x00000000,0x00000001,0x01010000,0x00000101,
|
||||
0x00000000,0x00000001,0x01010000,0x00000001,0x00000100,0x00000101,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000000,0x01000000,0x00000100,0x01000000,0x00000100,
|
||||
0x01010100,0x00000101,0x00010001,0x00010100,0x00010001,0x00000100,0x00000100,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000100,0x00010000,0x00010000,
|
||||
0x00010100,0x00000000,0x00010001,0x00010000,0x00010001,0x00010000,0x01010100,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x00000100,0x00000100,0x01010100,0x00000101,
|
||||
0x00000100,0x00010001,0x00010001,0x00010001,0x01010001,0x00010000,0x00010100,0x00000100,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x01010101,0x00000001,0x00000100,0x00000000,
|
||||
0x01010101,0x00000001,0x00000100,0x00010000,0x00000100,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000001,0x01010100,0x00000101,0x00000101,0x00010001,
|
||||
0x00000100,0x00010000,0x00010000,0x00000100,0x00010000,0x00000000,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01010001,0x00000101,0x01000101,0x00010000,
|
||||
0x01000001,0x00010000,0x01000001,0x00010000,0x01000000,0x00000101,0x00010000,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000101,0x01000000,0x00000000,
|
||||
0x01000000,0x00000000,0x01010100,0x00000001,0x01000001,0x00000100,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x01000000,0x00000001,0x00000000,0x00000100,0x00010000,0x00000000,
|
||||
0x01000100,0x00000101,0x00010100,0x00010000,0x00000000,0x00010000,0x01000000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00010000,0x00000100,0x00010000,0x00000100,0x00010000,
|
||||
0x00010100,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x01000000,0x00000001,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000001,0x01010000,0x00000101,
|
||||
0x00000101,0x00010000,0x01010000,0x00010000,0x00000100,0x00010001,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000100,0x00000101,0x00000101,0x01000100,0x00000100,
|
||||
0x00010100,0x00000100,0x00000100,0x00000100,0x00000101,0x00000100,0x00000100,0x00010000,
|
||||
0x00000000,0x00000000,0x01010100,0x00000101,0x00000000,0x00000001,0x01010000,0x00000101,
|
||||
0x00000101,0x00010000,0x00000000,0x00010000,0x00000100,0x00010000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00000000,0x01000101,0x00000101,0x00010100,0x00010000,
|
||||
0x00000100,0x00010000,0x00000101,0x00010000,0x00000100,0x00010000,0x00000100,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00000000,0x00010000,0x00000000,0x00000100,0x00000000,
|
||||
0x00010100,0x00010000,0x00010001,0x00010000,0x00010001,0x00010000,0x01000001,0x00000101,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x01010101,0x00010101,0x00010000,0x00000100,
|
||||
0x00010000,0x00000100,0x00010000,0x00000100,0x00000100,0x00000100,0x00000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00010000,0x00010001,0x01010101,0x00010001,0x00010000,0x00000000,
|
||||
0x01010101,0x00000101,0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010001,0x00000100,0x00010100,0x00000100,0x00000100,
|
||||
0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x01010100,0x00010101,0x00000100,0x00000100,
|
||||
0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010101,0x00010101,0x00000000,0x00000100,
|
||||
0x00000000,0x00000100,0x00000000,0x00000100,0x00000000,0x00000100,0x01010101,0x00000101,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x00000100,0x00010001,0x01010101,0x00000101,
|
||||
0x00000100,0x00000001,0x00000000,0x00000001,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000101,0x00010001,0x00010000,0x00010001,0x00000101,0x00000100,
|
||||
0x00010000,0x00000100,0x00000000,0x00000001,0x01000000,0x00000000,0x00010101,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010101,0x00010001,0x00000000,0x00000001,
|
||||
0x01000000,0x00000000,0x01010000,0x00000000,0x00000100,0x00000001,0x00000001,0x00000100,
|
||||
0x00000000,0x00000000,0x00000100,0x00010001,0x01010101,0x00010101,0x00000100,0x00000100,
|
||||
0x00000100,0x00000001,0x00000100,0x00000000,0x00000100,0x00000000,0x01010000,0x00000101,
|
||||
0x00000000,0x00000000,0x00000001,0x00010001,0x00000100,0x00010001,0x00000000,0x00000100,
|
||||
0x00000000,0x00000100,0x00000000,0x00000001,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010001,0x00000100,0x00010001,0x00010100,0x00000100,
|
||||
0x01000001,0x00000101,0x00000000,0x00000100,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00010001,0x01010100,0x00010001,0x00000000,0x00000001,
|
||||
0x01010101,0x00010101,0x00000000,0x00000001,0x00000000,0x00000001,0x01010000,0x00000000,
|
||||
0x00000000,0x00000000,0x00010001,0x00000100,0x01000100,0x00010000,0x01000100,0x00000100,
|
||||
0x00000000,0x00000100,0x00000000,0x00000001,0x01000000,0x00000000,0x00010101,0x00000000,
|
||||
0x00000000,0x00000000,0x01010100,0x00010001,0x00000000,0x00010001,0x01010101,0x00000101,
|
||||
0x01000000,0x00000000,0x01000000,0x00000000,0x01000000,0x00000000,0x00010100,0x00000000,
|
||||
};
|
459
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/loader.c
Executable file
459
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/loader.c
Executable file
@ -0,0 +1,459 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib
|
||||
File: loader.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#include "g2d_demolib.h"
|
||||
#include <nnsys/g2d/g2d_Softsprite.h>
|
||||
#include <nnsys/g2d/g2d_Load.h>
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadFileToMainMem_
|
||||
|
||||
Description: バッファを確保してファイルを読み込みます。
|
||||
|
||||
Arguments: pFname: 読み込むファイル名
|
||||
|
||||
Returns: 読み込みに成功するとファイルの内容を格納しているバッファへの
|
||||
ポインタを返します。このバッファは不必要になったときに
|
||||
G2DDemo_Free で開放しなければなりません。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void* LoadFileToMainMem_( const char* pFname )
|
||||
{
|
||||
FSFile file;
|
||||
void* pFile = NULL;
|
||||
BOOL bSuccess;
|
||||
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
FS_InitFile( &file );
|
||||
bSuccess = FS_OpenFile( &file, pFname );
|
||||
|
||||
if( bSuccess )
|
||||
{
|
||||
const u32 szFile = FS_GetLength( &file );
|
||||
|
||||
|
||||
pFile = G2DDemo_Alloc( szFile );
|
||||
SDK_NULL_ASSERT( pFile );
|
||||
|
||||
if( szFile != (u32)FS_ReadFile( &file, pFile, (s32)szFile ) )
|
||||
{
|
||||
G2DDemo_Free( pFile );
|
||||
pFile = NULL;
|
||||
}
|
||||
|
||||
bSuccess = FS_CloseFile( &file );
|
||||
SDK_ASSERT( bSuccess );
|
||||
}else{
|
||||
OS_Warning(" Can't find the file : %s ", pFname );
|
||||
}
|
||||
|
||||
return pFile;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNCER
|
||||
|
||||
Description: 内部でバッファを確保して NCER ファイルからセルデータバンクを
|
||||
読み込みます。
|
||||
関数成功後、セルデータバンクが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppCellBank: セルデータバンクを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
pFname: セルデータバンクが格納されているNCERファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNCER( NNSG2dCellDataBank** ppCellBank, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppCellBank );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedCellBank( pFile, ppCellBank ) )
|
||||
{
|
||||
NNS_G2dPrintCellBank( *ppCellBank );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNANR
|
||||
|
||||
Description: 内部でバッファを確保して NANR ファイルからアニメーション
|
||||
データバンクを読み込みます。
|
||||
関数成功後、アニメーションデータバンクが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppAnimBank: アニメーションデータバンクを格納したバッファへの
|
||||
ポインタを受け取るポインタ。
|
||||
pFname: アニメーションデータバンクが格納されている
|
||||
NANR ファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNANR( NNSG2dAnimBankData** ppAnimBank, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppAnimBank );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedAnimBank( pFile, ppAnimBank ) )
|
||||
{
|
||||
NNS_G2dPrintAnimBank( *ppAnimBank );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNMCR
|
||||
|
||||
Description: 内部でバッファを確保して NMCR ファイルからマルチセルデータ
|
||||
バンクを読み込みます。
|
||||
関数成功後、マルチセルデータバンクが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppMCBank: マルチセルデータバンクを格納したバッファへの
|
||||
ポインタを受け取るポインタ。
|
||||
pFname: マルチセルデータバンクが格納されている
|
||||
NMCR ファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNMCR( NNSG2dMultiCellDataBank** ppMCBank, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppMCBank );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedMultiCellBank( pFile, ppMCBank ) )
|
||||
{
|
||||
NNS_G2dPrintMultiCellBank ( *ppMCBank );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNMAR
|
||||
|
||||
Description: 内部でバッファを確保して NMAR ファイルからマルチセル
|
||||
アニメーションデータバンクを読み込みます。
|
||||
関数成功後、マルチアニメーションデータバンクが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppMCABank: マルチセルアニメーションデータバンクを格納した
|
||||
バッファへのポインタを受け取るポインタ。
|
||||
pFname: マルチセルアニメーションデータバンクが
|
||||
格納されている NMAR ファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNMAR( NNSG2dMultiCellAnimBankData** ppMCABank, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppMCABank );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedMCAnimBank( pFile, ppMCABank ) )
|
||||
{
|
||||
NNS_G2dPrintAnimBank( *ppMCABank );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNCGR
|
||||
|
||||
Description: 内部でバッファを確保して NCGR ファイルからキャラクタ形式の
|
||||
キャラクタデータを読み込みます。
|
||||
関数成功後、キャラクタデータが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppCharData: キャラクタデータを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
pFname: キャラクタデータが格納されているNCGRファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNCGR( NNSG2dCharacterData** ppCharData, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppCharData );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedCharacterData( pFile, ppCharData ) )
|
||||
{
|
||||
NNS_G2dPrintCharacterData( *ppCharData );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNCGR
|
||||
|
||||
Description: 内部でバッファを確保して NCGR ファイルからキャラクタ形式の
|
||||
キャラクタデータを読み込みます。
|
||||
関数成功後、キャラクタデータが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppCharData: キャラクタデータを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
ppCharPosInfo: キャラクタ読み込み位置データを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
|
||||
pFname: キャラクタデータが格納されているNCGRファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNCGREx
|
||||
(
|
||||
NNSG2dCharacterData** ppCharData,
|
||||
NNSG2dCharacterPosInfo** ppCharPosInfo,
|
||||
const char* pFname
|
||||
)
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppCharData );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedCharacterData( pFile, ppCharData ) )
|
||||
{
|
||||
NNS_G2dPrintCharacterData( *ppCharData );
|
||||
|
||||
if( NNS_G2dGetUnpackedCharacterPosInfo( pFile, ppCharPosInfo ) )
|
||||
{
|
||||
NNS_G2dPrintCharacterPosInfo( *ppCharPosInfo );
|
||||
return pFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNCLR
|
||||
|
||||
Description: 内部でバッファを確保して NCLR ファイルからパレットデータを
|
||||
読み込みます。
|
||||
関数成功後、パレットデータが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppPltData: パレットデータを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
pFname: パレットデータが格納されているNCLRファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNCLR( NNSG2dPaletteData** ppPltData, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppPltData );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedPaletteData( pFile, ppPltData ) )
|
||||
{
|
||||
NNS_G2dPrintPaletteData( *ppPltData );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNENR
|
||||
|
||||
Description: 内部でバッファを確保して NENR ファイルからエンティティデータ
|
||||
バンクを読み込みます。
|
||||
関数成功後、エンティティデータバンクが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppEntityBank: エンティティデータバンクを格納したバッファへの
|
||||
ポインタを受け取るポインタ。
|
||||
pFname: エンティティデータバンクが格納されている
|
||||
NENR ファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNENR( NNSG2dEntityDataBank** ppEntityBank, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppEntityBank );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedEntityBank( pFile, ppEntityBank ) )
|
||||
{
|
||||
NNS_G2dPrintEntityDataBank( *ppEntityBank );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNCBR
|
||||
|
||||
Description: 内部でバッファを確保して NCBR ファイルからビットマップ形式の
|
||||
キャラクタデータを読み込みます。
|
||||
関数成功後、キャラクタデータが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppCharData: キャラクタデータを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
pFname: キャラクタデータが格納されているNCBRファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNCBR( NNSG2dCharacterData** ppCharData, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppCharData );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedCharacterData( pFile, ppCharData ) )
|
||||
{
|
||||
NNS_G2dPrintCharacterData( *ppCharData );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_LoadNSCR
|
||||
|
||||
Description: 内部でバッファを確保して NCBR ファイルからビットマップ形式の
|
||||
キャラクタデータを読み込みます。
|
||||
関数成功後、キャラクタデータが不要になった時に
|
||||
G2DDemo_Free( 返り値 ) でバッファを開放する必要があります。
|
||||
|
||||
Arguments: ppCharData: キャラクタデータを格納したバッファへのポインタを
|
||||
受け取るポインタ。
|
||||
pFname: キャラクタデータが格納されているNCBRファイル名。
|
||||
|
||||
Returns: 読み込みに成功するとファイルデータが格納されている
|
||||
内部で確保したバッファへのポインタを返します。
|
||||
読み込みに失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void* G2DDemo_LoadNSCR( NNSG2dScreenData** ppScreenData, const char* pFname )
|
||||
{
|
||||
void* pFile = NULL;
|
||||
|
||||
SDK_NULL_ASSERT( ppScreenData );
|
||||
SDK_NULL_ASSERT( pFname );
|
||||
|
||||
pFile = LoadFileToMainMem_( pFname );
|
||||
if( pFile != NULL )
|
||||
{
|
||||
if( NNS_G2dGetUnpackedScreenData( pFile, ppScreenData ) )
|
||||
{
|
||||
NNS_G2dPrintScreenData( *ppScreenData );
|
||||
return pFile;
|
||||
}
|
||||
|
||||
G2DDemo_Free( pFile );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
156
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/print.c
Executable file
156
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/print.c
Executable file
@ -0,0 +1,156 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib
|
||||
File: print.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "g2d_demolib.h"
|
||||
#include "g2d_demolib/print.h"
|
||||
#include "g2d_demolib/fontData.h"
|
||||
|
||||
#define SCREEN_HEIGHT 192 // 画面高さ
|
||||
#define SCREEN_WIDTH 256 // 画面幅
|
||||
|
||||
#define SCREEN_CHARA_SIZE 8 // BGキャラクタサイズ
|
||||
|
||||
#define SCR_PLTT_SHIFT 12 // スクリーンデータ内のパレットNo用シフト幅
|
||||
#define FONT_COLOR 3 // 文字色=青
|
||||
|
||||
// キャラクタ単位の画面サイズ
|
||||
#define SCREEN_HEIGHT_CHARA (SCREEN_HEIGHT / SCREEN_CHARA_SIZE)
|
||||
#define SCREEN_WIDTH_CHARA (SCREEN_WIDTH / SCREEN_CHARA_SIZE)
|
||||
|
||||
// スクリーンバッファ
|
||||
static u16 sScreenBuf[SCREEN_HEIGHT_CHARA][SCREEN_WIDTH_CHARA];
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_PrintInit
|
||||
|
||||
Description: メイン画面のBG1を文字表示用にセットアップします。
|
||||
system.c の Init3DStuff_ の処理に依存しています。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_PrintInit(void)
|
||||
{
|
||||
// BG1 のセットアップ
|
||||
GX_SetBankForBGExtPltt(GX_VRAM_BGEXTPLTT_01_F);
|
||||
GX_SetVisiblePlane( GX_PLANEMASK_BG0 | GX_PLANEMASK_BG1 | GX_PLANEMASK_OBJ );
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256,
|
||||
GX_BG_COLORMODE_256,
|
||||
GX_BG_SCRBASE_0x0000,
|
||||
GX_BG_CHARBASE_0x04000,
|
||||
GX_BG_EXTPLTT_01);
|
||||
G2_SetBG1Priority(3);
|
||||
|
||||
// リソースのロード
|
||||
GX_LoadBG1Char(fontCharData, 0, sizeof(fontCharData));
|
||||
|
||||
GX_BeginLoadBGExtPltt();
|
||||
GX_LoadBGExtPltt(fontPlttData, 0x2000, sizeof(fontPlttData));
|
||||
GX_EndLoadBGExtPltt();
|
||||
|
||||
// 内部バッファのクリア
|
||||
G2DDemo_PrintClear();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_PrintClear
|
||||
|
||||
Description: 内部スクリーンバッファをクリアします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_PrintClear(void)
|
||||
{
|
||||
MI_CpuClearFast( sScreenBuf, sizeof(sScreenBuf) );
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_PrintOut
|
||||
|
||||
Description: メイン画面のBG1を利用して文字列を表示します。
|
||||
1行32文字 24行の表示ができます。
|
||||
|
||||
Arguments: x: 1文字目を表示する列を指定します。0から始まります。
|
||||
y: 表示する行を指定します。0から始まります。
|
||||
string: 出力する文字列です。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_PrintOut(int x, int y, const char* string)
|
||||
{
|
||||
const char* pos;
|
||||
SDK_NULL_ASSERT( string );
|
||||
SDK_ASSERT( 0 <= x && x < SCREEN_WIDTH_CHARA );
|
||||
SDK_ASSERT( 0 <= y && y < SCREEN_HEIGHT_CHARA );
|
||||
|
||||
for( pos = string; *pos != '\0'; ++pos )
|
||||
{
|
||||
sScreenBuf[y][x] = (u16)((u16)(FONT_COLOR << SCR_PLTT_SHIFT) | (u16)(*pos));
|
||||
x++;
|
||||
|
||||
if( x >= SCREEN_WIDTH )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_PrintOutf
|
||||
|
||||
Description: メイン画面のBG1を利用して文字列を表示します。
|
||||
1行32文字 24行の表示ができます。
|
||||
|
||||
Arguments: x: 1文字目を表示する列を指定します。0から始まります。
|
||||
y: 表示する行を指定します。0から始まります。
|
||||
format: printf形式のフォーマット文字列です。
|
||||
...: フォーマットに対応するパラメータです。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_PrintOutf(int x, int y, const char* format, ...)
|
||||
{
|
||||
va_list vlist;
|
||||
char buf[SCREEN_WIDTH_CHARA + 1];
|
||||
SDK_NULL_ASSERT( format );
|
||||
|
||||
va_start( vlist, format );
|
||||
(void)vsnprintf( buf, sizeof(buf), format, vlist );
|
||||
va_end( vlist );
|
||||
|
||||
G2DDemo_PrintOut(x, y, buf);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_PrintApplyToHW
|
||||
|
||||
Description: 内部スクリーンバッファをハードウェアに転送します。
|
||||
通常は V ブランクごとに呼び出します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_PrintApplyToHW(void)
|
||||
{
|
||||
DC_FlushRange( sScreenBuf, sizeof(sScreenBuf) );
|
||||
GX_LoadBG1Scr( sScreenBuf, 0, sizeof(sScreenBuf) );
|
||||
}
|
||||
|
423
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/system.c
Executable file
423
add-ins/TwlSystem/build/demos/IDE/IDE_G2dDemoLib/src/system.c
Executable file
@ -0,0 +1,423 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_G2dDemoLib
|
||||
File: system.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
#include "g2d_demolib.h"
|
||||
#include <nnsys/g2d/g2d_Softsprite.h>
|
||||
#include <nnsys/g2d/g2d_Load.h>
|
||||
|
||||
// リソースプールのサイズ
|
||||
#define SIZE_OF_RES_POOL 1000
|
||||
|
||||
// アライメントにあわせて切り上げ
|
||||
#define ROUND_UP(value, alignment) \
|
||||
(((u32)(value) + (alignment-1)) & ~(alignment-1))
|
||||
|
||||
// アライメントにあわせて切り下げ
|
||||
#define ROUND_DOWN(value, alignment) \
|
||||
((u32)(value) & ~(alignment-1))
|
||||
|
||||
G2DDemoGamePad gGamePad; // ゲームパッド
|
||||
NNSFndHeapHandle gHeapHandle; // ヒープハンドル
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
初期化関係。
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: Init3DStuff_
|
||||
|
||||
Description: ソフトウェアスプライトのためのグラフィックスエンジンの
|
||||
初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void Init3DStuff_(void)
|
||||
{
|
||||
G3X_Init(); // initialize the 3D graphics states
|
||||
G3X_InitMtxStack(); // initialize the matrix stack
|
||||
|
||||
// メイン画面
|
||||
{
|
||||
GX_SetBankForTex(GX_VRAM_TEX_0_A); // VRAM-A for texture images
|
||||
GX_SetBankForOBJ(GX_VRAM_OBJ_128_B); // VRAM-B for OBJ
|
||||
GX_SetBankForBG(GX_VRAM_BG_128_C); // VRAM-C for BGs
|
||||
GX_SetBankForTexPltt(GX_VRAM_TEXPLTT_0123_E); // VRAM-E for texture palettes
|
||||
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, // graphics mode
|
||||
GX_BGMODE_4, // BGMODE is 4
|
||||
GX_BG0_AS_3D); // BG #0 is for 3D
|
||||
GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_2D ); // 2D mapping mode
|
||||
GX_SetVisiblePlane( GX_PLANEMASK_BG0 | GX_PLANEMASK_OBJ ); // display BG0 & OBJ
|
||||
}
|
||||
|
||||
// サブ画面
|
||||
{
|
||||
GX_SetBankForSubOBJ(GX_VRAM_SUB_OBJ_128_D); // VRAM-D for OBJ
|
||||
GXS_SetGraphicsMode(GX_BGMODE_0); // BGMODE is 0
|
||||
GXS_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_2D); // 2D mapping mode
|
||||
GXS_SetVisiblePlane(GX_PLANEMASK_OBJ); // display only OBJ
|
||||
}
|
||||
|
||||
|
||||
G2_SetBG0Priority(1);
|
||||
|
||||
G3X_SetShading(GX_SHADING_TOON);
|
||||
G3X_AntiAlias(TRUE);
|
||||
G3X_AlphaBlend(TRUE);
|
||||
|
||||
// 3D 面は特殊効果OFFでも他のBG面とαブレンディングが行われますが、
|
||||
// そのためにはαブレンディング対象面の指定を行う必要があります。
|
||||
// SDK には対象面のみを設定する API が存在しないので、代わりに G2_SetBlendAlpha を使います。
|
||||
// この場合 G2_SetBlendAlpha の後ろ2つの引数は無視されます。
|
||||
G2_SetBlendAlpha(GX_BLEND_PLANEMASK_BG0, GX_BLEND_PLANEMASK_BD, 0, 0);
|
||||
|
||||
// clear color
|
||||
G3X_SetClearColor(GX_RGB(0, 0, 0), 0, 0x7fff, 0, FALSE );
|
||||
|
||||
G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_CommonInit
|
||||
|
||||
Description: OS、グラフィックスエンジン、ヒープ、ファイルシステムの
|
||||
初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_CommonInit(void)
|
||||
{
|
||||
// Common initialization.
|
||||
{
|
||||
OS_Init();
|
||||
|
||||
FX_Init();
|
||||
|
||||
GX_Init();
|
||||
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
(void)OS_EnableIrqMask( OS_IE_V_BLANK );
|
||||
(void)OS_EnableIrq();
|
||||
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
}
|
||||
|
||||
// Clear VRAM
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
// All VRAM banks to LCDC
|
||||
//---------------------------------------------------------------------------
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Clear all LCDC space
|
||||
//---------------------------------------------------------------------------
|
||||
MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Disable the banks on LCDC
|
||||
//---------------------------------------------------------------------------
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); // clear OAM
|
||||
MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); // clear the standard palette
|
||||
|
||||
MI_CpuFillFast((void*)HW_DB_OAM, 192, HW_DB_OAM_SIZE); // clear OAM
|
||||
MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Initializing the 3D Sprite Engine.
|
||||
//------------------------------------------------------------------------------
|
||||
Init3DStuff_();
|
||||
NNS_G2dSetupSoftwareSpriteCamera();
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// misc.
|
||||
{
|
||||
*(GXRgb*)(HW_BG_PLTT) = GX_RGB(15, 15, 15);
|
||||
*(GXRgb*)(HW_DB_BG_PLTT) = GX_RGB(15, 15, 15);
|
||||
OS_InitTick();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// Heap 確保
|
||||
{
|
||||
u32 arenaLow = ROUND_UP (OS_GetMainArenaLo(), 16);
|
||||
u32 arenaHigh = ROUND_DOWN(OS_GetMainArenaHi(), 16);
|
||||
u32 heapSize = arenaHigh - arenaLow;
|
||||
void* heapMemory = OS_AllocFromMainArenaLo(heapSize, 16);
|
||||
|
||||
gHeapHandle = NNS_FndCreateExpHeap(heapMemory, heapSize);
|
||||
SDK_ASSERT( gHeapHandle != NNS_FND_HEAP_INVALID_HANDLE );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// File System
|
||||
{
|
||||
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
|
||||
|
||||
/* initialize file-system */
|
||||
FS_Init( FS_DMA_NOT_USE );
|
||||
|
||||
/* always preload FS table for faster directory access. */
|
||||
{
|
||||
const u32 need_size = FS_GetTableSize();
|
||||
void *p_table = G2DDemo_Alloc(need_size);
|
||||
SDK_ASSERT(p_table != NULL);
|
||||
(void)FS_LoadTable(p_table, need_size);
|
||||
}
|
||||
}
|
||||
|
||||
// ゲームパッドを空読みします。
|
||||
G2DDemo_ReadGamePad();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_CameraSetup
|
||||
|
||||
Description: カメラの共通設定を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_CameraSetup(void)
|
||||
{
|
||||
{
|
||||
// 単位行列と等価
|
||||
VecFx32 Eye = { 0, 0, 0 }; // Eye position
|
||||
VecFx32 vUp = { 0, FX32_ONE, 0 }; // Up
|
||||
VecFx32 at = { 0, 0, -FX32_ONE }; // Viewpoint
|
||||
|
||||
// Matrix mode is changed to GX_MTXMODE_POSITION_VECTOR internally,
|
||||
// and the camera matrix is loaded to the current matrix.
|
||||
G3_LookAt(&Eye, &vUp, &at, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_MaterialSetup
|
||||
|
||||
Description: マテリアルの共通設定を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_MaterialSetup(void)
|
||||
{
|
||||
// for software sprite-setting
|
||||
{
|
||||
G3_MaterialColorDiffAmb(GX_RGB(31, 31, 31), // diffuse
|
||||
GX_RGB(16, 16, 16), // ambient
|
||||
TRUE // use diffuse as vtx color if TRUE
|
||||
);
|
||||
|
||||
G3_MaterialColorSpecEmi(GX_RGB(16, 16, 16), // specular
|
||||
GX_RGB(0, 0, 0), // emission
|
||||
FALSE // use shininess table if TRUE
|
||||
);
|
||||
|
||||
G3_PolygonAttr(GX_LIGHTMASK_NONE, // no lights
|
||||
GX_POLYGONMODE_MODULATE, // modulation mode
|
||||
GX_CULL_NONE, // cull back
|
||||
0, // polygon ID(0 - 63)
|
||||
31, // alpha(0 - 31)
|
||||
0 // OR of GXPolygonAttrMisc's value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
その他
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_GetNewCellAnimation
|
||||
|
||||
Description: プールから NNSG2dCellAnimation を取得します。
|
||||
|
||||
Arguments: num: 取得する NNSG2dCellAnimation の数。
|
||||
|
||||
Returns: 取得した NNSG2dCellAnimation へのポインタ。
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSG2dCellAnimation* G2DDemo_GetNewCellAnimation( u16 num )
|
||||
{
|
||||
static NNSG2dCellAnimation sPoolAnimatedObj[SIZE_OF_RES_POOL];
|
||||
static u16 sNumAnimatedObj = 0;
|
||||
|
||||
const u16 retIdx = sNumAnimatedObj;
|
||||
|
||||
sNumAnimatedObj += num;
|
||||
SDK_ASSERT( sNumAnimatedObj <= SIZE_OF_RES_POOL );
|
||||
|
||||
return &sPoolAnimatedObj[ retIdx ];
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_GetNewNode
|
||||
|
||||
Description: プールから NNSG2dNode を取得します。
|
||||
|
||||
Arguments: num: 取得する NNSG2dNode の数。
|
||||
|
||||
Returns: 取得した NNSG2dNode へのポインタ。
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSG2dNode* G2DDemo_GetNewNode( u16 num )
|
||||
{
|
||||
static NNSG2dNode sPoolObjNode[SIZE_OF_RES_POOL];
|
||||
static u16 sNumUsedPoolObjNode = 0;
|
||||
|
||||
const u16 retIdx = sNumUsedPoolObjNode;
|
||||
|
||||
sNumUsedPoolObjNode += num;
|
||||
SDK_ASSERT( sNumUsedPoolObjNode <= SIZE_OF_RES_POOL );
|
||||
|
||||
return &sPoolObjNode[ retIdx ];
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: getNewMultiCellAnim_
|
||||
|
||||
Description: プールから NNSG2dMultiCellAnimation を取得します。
|
||||
|
||||
Arguments: num: 取得する NNSG2dMultiCellAnimation の数。
|
||||
|
||||
Returns: 取得した NNSG2dMultiCellAnimation へのポインタ。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static NNSG2dMultiCellAnimation* GetNewMultiCellAnim_( u16 num )
|
||||
{
|
||||
static NNSG2dMultiCellAnimation sMcAnimPool_[SIZE_OF_RES_POOL];
|
||||
static u16 sNumUsedMcAnimPool = 0;
|
||||
|
||||
const u16 retIdx = sNumUsedMcAnimPool;
|
||||
|
||||
sNumUsedMcAnimPool += num;
|
||||
SDK_ASSERT( sNumUsedMcAnimPool <= SIZE_OF_RES_POOL );
|
||||
|
||||
return &sMcAnimPool_[retIdx];
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_GetNewMultiCellAnimation
|
||||
|
||||
Description: 新しい NNSG2dMultiCellAnimation を取得して初期化します。
|
||||
|
||||
Arguments: numNode: ノード数
|
||||
pAnimBank: アニメーションデータバンク
|
||||
pCellDataBank: セルデータバンク
|
||||
pMultiCellDataBank: マルチセルデータバンク
|
||||
|
||||
Returns: プールから取得した初期化済みの NNSG2dMultiCellAnimation へ
|
||||
のポインタ
|
||||
*---------------------------------------------------------------------------*/
|
||||
/* 古いAPIを使用する以前のバージョン
|
||||
NNSG2dMultiCellAnimation* G2DDemo_GetNewMultiCellAnimation
|
||||
(
|
||||
u16 numNode,
|
||||
const NNSG2dCellAnimBankData* pAnimBank,
|
||||
const NNSG2dCellDataBank* pCellDataBank ,
|
||||
const NNSG2dMultiCellDataBank* pMultiCellDataBank
|
||||
)
|
||||
{
|
||||
// プールから NNSG2dMultiCellAnimation を取得
|
||||
NNSG2dMultiCellAnimation* pMCAnim = GetNewMultiCellAnim_( 1 );
|
||||
|
||||
// プールから numNode ぶんの NNSG2dNode と NNSG2dCellAnimation を取得
|
||||
NNSG2dNode* pNodeArray = G2DDemo_GetNewNode( numNode );
|
||||
NNSG2dCellAnimation* pCellAnimArray = G2DDemo_GetNewCellAnimation( numNode );
|
||||
|
||||
NNS_G2dInitMCAnimation( pMCAnim, // マルチセルアニメーション
|
||||
pNodeArray, // ノード配列
|
||||
pCellAnimArray, // セルアニメーション配列
|
||||
numNode, // ノード数
|
||||
pAnimBank, // アニメーションデータバンク
|
||||
pCellDataBank, // セルデータバンク
|
||||
pMultiCellDataBank ); // マルチセルデータバンク
|
||||
return pMCAnim;
|
||||
}
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_GetNewMultiCellAnimation
|
||||
|
||||
Description: 新しい NNSG2dMultiCellAnimation を取得して初期化します。
|
||||
|
||||
Arguments: pAnimBank: アニメーションデータバンク
|
||||
pCellDataBank: セルデータバンク
|
||||
pMultiCellDataBank: マルチセルデータバンク
|
||||
mcType: マルチセル実体の種類
|
||||
|
||||
Returns: プールから取得した初期化済みの NNSG2dMultiCellAnimation へ
|
||||
のポインタ
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSG2dMultiCellAnimation* G2DDemo_GetNewMultiCellAnimation
|
||||
(
|
||||
const NNSG2dCellAnimBankData* pAnimBank,
|
||||
const NNSG2dCellDataBank* pCellDataBank ,
|
||||
const NNSG2dMultiCellDataBank* pMultiCellDataBank,
|
||||
NNSG2dMCType mcType
|
||||
)
|
||||
{
|
||||
const u32 szWork = NNS_G2dGetMCWorkAreaSize( pMultiCellDataBank, mcType );
|
||||
void* pWorkMem = NNS_FndAllocFromExpHeap( gHeapHandle, szWork );
|
||||
|
||||
|
||||
// プールから NNSG2dMultiCellAnimation を取得
|
||||
NNSG2dMultiCellAnimation* pMCAnim = GetNewMultiCellAnim_( 1 );
|
||||
|
||||
// 初期化
|
||||
NNS_G2dInitMCAnimationInstance( pMCAnim,
|
||||
pWorkMem,
|
||||
pAnimBank,
|
||||
pCellDataBank,
|
||||
pMultiCellDataBank,
|
||||
mcType );
|
||||
return pMCAnim;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
ゲームパッド関係。
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: G2DDemo_ReadGamePad
|
||||
|
||||
Description: キーを読み込み、トリガとリリーストリガを求めます。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void G2DDemo_ReadGamePad(void)
|
||||
{
|
||||
u16 status = PAD_Read();
|
||||
|
||||
gGamePad.trigger = (u16)(status & (status ^ gGamePad.button));
|
||||
gGamePad.release = (u16)(gGamePad.button & (status ^ gGamePad.button));
|
||||
gGamePad.button = status;
|
||||
}
|
||||
|
Binary file not shown.
395
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro.lcf
Executable file
395
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro.lcf
Executable file
@ -0,0 +1,395 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - IDE - IDE_MultiCellAnimation
|
||||
# File: Nitro.lcf
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
MEMORY
|
||||
{
|
||||
main (RWX) : ORIGIN = 0x02000000, LENGTH = 0x0 > main.sbin
|
||||
ITCM (RWX) : ORIGIN = 0x01ff8000, LENGTH = 0x0 >> main.sbin
|
||||
DTCM (RWX) : ORIGIN = 0x027e0000, LENGTH = 0x0 >> main.sbin
|
||||
binary.AUTOLOAD_INFO (RWX) : ORIGIN = 0, LENGTH = 0x0 >> main.sbin
|
||||
binary.STATIC_FOOTER (RWX) : ORIGIN = 0, LENGTH = 0x0 >> main.sbin
|
||||
|
||||
main_defs (RW) : ORIGIN = AFTER(main), LENGTH = 0x0 > main_defs.sbin
|
||||
main_table (RW) : ORIGIN = AFTER(main), LENGTH = 0x0 > main_table.sbin
|
||||
dummy.MAIN_EX (RW) : ORIGIN = 0x023e0000, LENGTH = 0x0
|
||||
arena.MAIN (RW) : ORIGIN = AFTER(main), LENGTH = 0x0
|
||||
arena.MAIN_EX (RW) : ORIGIN = AFTER(dummy.MAIN_EX), LENGTH = 0x0
|
||||
arena.ITCM (RW) : ORIGIN = AFTER(ITCM), LENGTH = 0x0
|
||||
arena.DTCM (RW) : ORIGIN = AFTER(DTCM), LENGTH = 0x0
|
||||
binary.MODULE_FILES (RW) : ORIGIN = 0x0, LENGTH = 0x0 > component.files
|
||||
check.ITCM (RWX) : ORIGIN = 0x0, LENGTH = 0x08000 > itcm.check
|
||||
check.DTCM (RW) : ORIGIN = 0x0, LENGTH = 0x04000 > dtcm.check
|
||||
}
|
||||
|
||||
FORCE_ACTIVE
|
||||
{
|
||||
SVC_SoftReset
|
||||
}
|
||||
|
||||
KEEP_SECTION
|
||||
{
|
||||
.sinit
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
############################ STATIC #################################
|
||||
.main:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32); # Fit to cache line
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_STATIC_START =.;
|
||||
SDK_STATIC_TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
libsyscall.a (.text)
|
||||
crt0.o (.text)
|
||||
crt0.o (.rodata)
|
||||
#
|
||||
# .version セクションを追加しています。
|
||||
# このセクションに含まれる情報はロットチェックの際に
|
||||
# 必要となりますので、必ずこの位置に残すようにして下さい。
|
||||
#
|
||||
* (.version)
|
||||
OBJECT(NitroMain,*)
|
||||
GROUP(ROOT) (.text)
|
||||
. = ALIGN(4);
|
||||
* (.exception)
|
||||
. = ALIGN(4);
|
||||
SDK_STATIC_ETABLE_START =.;
|
||||
EXCEPTION
|
||||
SDK_STATIC_ETABLE_END =.;
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.init)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.rodata)
|
||||
. = ALIGN(4);
|
||||
|
||||
SDK_STATIC_SINIT_START =.;
|
||||
#:::::::::: ctor
|
||||
GROUP(ROOT) (.ctor)
|
||||
GROUP(ROOT) (.sinit)
|
||||
WRITEW 0;
|
||||
#:::::::::: ctor
|
||||
SDK_STATIC_SINIT_END =.;
|
||||
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE
|
||||
#
|
||||
SDK_STATIC_DATA_START =.;
|
||||
#:::::::::: data
|
||||
GROUP(ROOT) (.sdata)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.data)
|
||||
. = ALIGN(4);
|
||||
SDK_OVERLAY_DIGEST =.;
|
||||
# NO DIGEST
|
||||
SDK_OVERLAY_DIGEST_END =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_DATA_END =.;
|
||||
SDK_STATIC_END =.;
|
||||
|
||||
SDK_STATIC_TEXT_SIZE = SDK_STATIC_TEXT_END - SDK_STATIC_TEXT_START;
|
||||
SDK_STATIC_DATA_SIZE = SDK_STATIC_DATA_END - SDK_STATIC_DATA_START;
|
||||
SDK_STATIC_SIZE = SDK_STATIC_END - SDK_STATIC_START;
|
||||
__sinit__ = SDK_STATIC_SINIT_START; # for static initializer
|
||||
__exception_table_start__ = SDK_STATIC_ETABLE_START; # for exception table
|
||||
__exception_table_end__ = SDK_STATIC_ETABLE_END; # for exception table
|
||||
} > main
|
||||
|
||||
.main.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_STATIC_BSS_START =.;
|
||||
#:::::::::: bss
|
||||
GROUP(ROOT) (.sbss)
|
||||
. = ALIGN(4);
|
||||
GROUP(ROOT) (.bss)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_STATIC_BSS_END = .;
|
||||
SDK_STATIC_BSS_SIZE = SDK_STATIC_BSS_END - SDK_STATIC_BSS_START;
|
||||
|
||||
} >> main
|
||||
|
||||
|
||||
############################ AUTOLOADS ##############################
|
||||
SDK_AUTOLOAD.ITCM.START = 0x01ff8000;
|
||||
SDK_AUTOLOAD.ITCM.END = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD.ITCM.BSS_END = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD.ITCM.SIZE = 0;
|
||||
SDK_AUTOLOAD.ITCM.BSS_SIZE = 0;
|
||||
SDK_AUTOLOAD.DTCM.START = 0x027e0000;
|
||||
SDK_AUTOLOAD.DTCM.END = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD.DTCM.BSS_END = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD.DTCM.SIZE = 0;
|
||||
SDK_AUTOLOAD.DTCM.BSS_SIZE = 0;
|
||||
SDK_AUTOLOAD_START = SDK_STATIC_END;
|
||||
SDK_AUTOLOAD_SIZE = 0;
|
||||
SDK_AUTOLOAD_NUMBER = 2;
|
||||
|
||||
.ITCM:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_AUTOLOAD_ITCM_ID =0;
|
||||
SDK_AUTOLOAD.ITCM.ID =0;
|
||||
SDK_AUTOLOAD.ITCM.START =.;
|
||||
SDK_AUTOLOAD.ITCM.TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(4);
|
||||
* (.itcm)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: text/rodata
|
||||
SDK_AUTOLOAD.ITCM.TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.ITCM.DATA_START =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.ITCM.DATA_END =.;
|
||||
SDK_AUTOLOAD.ITCM.END =.;
|
||||
|
||||
SDK_AUTOLOAD.ITCM.TEXT_SIZE = SDK_AUTOLOAD.ITCM.TEXT_END - SDK_AUTOLOAD.ITCM.TEXT_START;
|
||||
SDK_AUTOLOAD.ITCM.DATA_SIZE = SDK_AUTOLOAD.ITCM.DATA_END - SDK_AUTOLOAD.ITCM.DATA_START;
|
||||
SDK_AUTOLOAD.ITCM.SIZE = SDK_AUTOLOAD.ITCM.END - SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD.ITCM.SIZE;
|
||||
|
||||
} > ITCM
|
||||
|
||||
.ITCM.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.ITCM.BSS_START = .;
|
||||
#:::::::::: bss
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.itcm.bss)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.ITCM.BSS_END = .;
|
||||
|
||||
SDK_AUTOLOAD.ITCM.BSS_SIZE = SDK_AUTOLOAD.ITCM.BSS_END - SDK_AUTOLOAD.ITCM.BSS_START;
|
||||
|
||||
} >> ITCM
|
||||
|
||||
.DTCM:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# TEXT BLOCK: READ ONLY
|
||||
#
|
||||
SDK_AUTOLOAD_DTCM_ID =1;
|
||||
SDK_AUTOLOAD.DTCM.ID =1;
|
||||
SDK_AUTOLOAD.DTCM.START =.;
|
||||
SDK_AUTOLOAD.DTCM.TEXT_START =.;
|
||||
#:::::::::: text/rodata
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: text/rodata
|
||||
SDK_AUTOLOAD.DTCM.TEXT_END =.;
|
||||
|
||||
#
|
||||
# DATA BLOCK: READ WRITE BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.DTCM.DATA_START =.;
|
||||
#:::::::::: data
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.dtcm)
|
||||
. = ALIGN(4);
|
||||
#:::::::::: data
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.DTCM.DATA_END =.;
|
||||
SDK_AUTOLOAD.DTCM.END =.;
|
||||
|
||||
SDK_AUTOLOAD.DTCM.TEXT_SIZE = SDK_AUTOLOAD.DTCM.TEXT_END - SDK_AUTOLOAD.DTCM.TEXT_START;
|
||||
SDK_AUTOLOAD.DTCM.DATA_SIZE = SDK_AUTOLOAD.DTCM.DATA_END - SDK_AUTOLOAD.DTCM.DATA_START;
|
||||
SDK_AUTOLOAD.DTCM.SIZE = SDK_AUTOLOAD.DTCM.END - SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD.DTCM.SIZE;
|
||||
|
||||
} > DTCM
|
||||
|
||||
.DTCM.bss:
|
||||
{
|
||||
ALIGNALL(4); . = ALIGN(32);
|
||||
|
||||
#
|
||||
# BSS BLOCK
|
||||
#
|
||||
SDK_AUTOLOAD.DTCM.BSS_START = .;
|
||||
#:::::::::: bss
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
* (.dtcm.bss)
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
#:::::::::: bss
|
||||
. = ALIGN(32);
|
||||
SDK_AUTOLOAD.DTCM.BSS_END = .;
|
||||
|
||||
SDK_AUTOLOAD.DTCM.BSS_SIZE = SDK_AUTOLOAD.DTCM.BSS_END - SDK_AUTOLOAD.DTCM.BSS_START;
|
||||
|
||||
} >> DTCM
|
||||
|
||||
|
||||
SDK_AUTOLOAD_ITCM_START = SDK_AUTOLOAD.ITCM.START;
|
||||
SDK_AUTOLOAD_ITCM_END = SDK_AUTOLOAD.ITCM.END;
|
||||
SDK_AUTOLOAD_ITCM_BSS_END = SDK_AUTOLOAD.ITCM.BSS_END;
|
||||
SDK_AUTOLOAD_ITCM_SIZE = SDK_AUTOLOAD.ITCM.SIZE;
|
||||
SDK_AUTOLOAD_ITCM_BSS_SIZE = SDK_AUTOLOAD.ITCM.BSS_SIZE;
|
||||
SDK_AUTOLOAD_DTCM_START = SDK_AUTOLOAD.DTCM.START;
|
||||
SDK_AUTOLOAD_DTCM_END = SDK_AUTOLOAD.DTCM.END;
|
||||
SDK_AUTOLOAD_DTCM_BSS_END = SDK_AUTOLOAD.DTCM.BSS_END;
|
||||
SDK_AUTOLOAD_DTCM_SIZE = SDK_AUTOLOAD.DTCM.SIZE;
|
||||
SDK_AUTOLOAD_DTCM_BSS_SIZE = SDK_AUTOLOAD.DTCM.BSS_SIZE;
|
||||
|
||||
############################ AUTOLOAD_INFO ##########################
|
||||
.binary.AUTOLOAD_INFO:
|
||||
{
|
||||
WRITEW ADDR(.ITCM);
|
||||
WRITEW SDK_AUTOLOAD.ITCM.SIZE;
|
||||
WRITEW SDK_AUTOLOAD.ITCM.BSS_SIZE;
|
||||
WRITEW ADDR(.DTCM);
|
||||
WRITEW SDK_AUTOLOAD.DTCM.SIZE;
|
||||
WRITEW SDK_AUTOLOAD.DTCM.BSS_SIZE;
|
||||
} > binary.AUTOLOAD_INFO
|
||||
|
||||
SDK_AUTOLOAD_LIST = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE;
|
||||
SDK_AUTOLOAD_LIST_END = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO);
|
||||
SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO);
|
||||
|
||||
############################ STATIC_FOOTER ##########################
|
||||
.binary.STATIC_FOOTER:
|
||||
{
|
||||
WRITEW 0xdec00621; # LE(0x2106C0DE) = NITRO CODE
|
||||
WRITEW _start_ModuleParams - ADDR(.main);
|
||||
WRITEW 0; # NO DIGEST
|
||||
} > binary.STATIC_FOOTER
|
||||
|
||||
############################ OVERLAYS ###############################
|
||||
SDK_OVERLAY_NUMBER = 0;
|
||||
|
||||
|
||||
############################ MAIN EX ##################################
|
||||
# MAIN EX Area
|
||||
.dummy.MAIN_EX:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
} > dummy.MAIN_EX
|
||||
|
||||
############################ ARENA ##################################
|
||||
.arena.MAIN:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_START =.;
|
||||
} > arena.MAIN
|
||||
|
||||
.arena.MAIN_EX:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_EX_START =.;
|
||||
} > arena.MAIN_EX
|
||||
|
||||
.arena.ITCM:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_ITCM_START =.;
|
||||
} > arena.ITCM
|
||||
|
||||
.arena.DTCM:
|
||||
{
|
||||
. = ALIGN(32);
|
||||
SDK_SECTION_ARENA_DTCM_START =.;
|
||||
} > arena.DTCM
|
||||
|
||||
############################ OVERLAYDEFS ############################
|
||||
.main_defs:
|
||||
{
|
||||
### main module information
|
||||
WRITEW ADDR(.main); # load address
|
||||
WRITEW _start; # entry address
|
||||
WRITEW SDK_STATIC_SIZE + SDK_AUTOLOAD_SIZE; # size of module
|
||||
WRITEW _start_AutoloadDoneCallback; # callback autoload done
|
||||
|
||||
### overlay filename
|
||||
|
||||
} > main_defs
|
||||
|
||||
|
||||
############################ OVERLAYTABLE ###########################
|
||||
.main_table:
|
||||
{
|
||||
|
||||
} > main_table
|
||||
|
||||
|
||||
############################ OTHERS #################################
|
||||
SDK_MAIN_ARENA_LO = SDK_SECTION_ARENA_START;
|
||||
SDK_IRQ_STACKSIZE = 1024; # allocated in DTCM
|
||||
SDK_SYS_STACKSIZE = 0; # when 0 means all remains of DTCM
|
||||
|
||||
# Module filelist
|
||||
.binary.MODULE_FILES:
|
||||
{
|
||||
WRITES ("main.sbin");
|
||||
WRITES ("main_defs.sbin");
|
||||
WRITES ("main_table.sbin");
|
||||
} > binary.MODULE_FILES
|
||||
|
||||
# ITCM/DTCM size checker => check AUTOLOAD_ITCM/DTCM
|
||||
.check.ITCM:
|
||||
{
|
||||
. = . + SDK_AUTOLOAD_ITCM_SIZE + SDK_AUTOLOAD_ITCM_BSS_SIZE;
|
||||
} > check.ITCM
|
||||
|
||||
SDK_SYS_STACKSIZE_SIGN = (SDK_SYS_STACKSIZE < 0x80000000) * 2 - 1;
|
||||
.check.DTCM:
|
||||
{
|
||||
. = . + SDK_AUTOLOAD_DTCM_SIZE + SDK_AUTOLOAD_DTCM_BSS_SIZE;
|
||||
. = . + SDK_IRQ_STACKSIZE + SDK_SYS_STACKSIZE * SDK_SYS_STACKSIZE_SIGN;
|
||||
} > check.DTCM
|
||||
|
||||
}
|
45
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.h
Executable file
45
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.h
Executable file
@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_MultiCellAnimation
|
||||
File: Nitro_TS.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
header file to include NITRO precompile header file
|
||||
*/
|
||||
|
||||
#if !__option (precompile)
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* include precompiled header for C++ source */
|
||||
#ifdef SDK_DEBUG
|
||||
#include "Nitro_TS_Debug.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#elif SDK_RELEASE
|
||||
#include "Nitro_TS_Release.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#elif SDK_FINALROM
|
||||
#include "Nitro_TS_ROM.mch++" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch++" */
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
#else
|
||||
/* include precompiled header for C source */
|
||||
#ifdef SDK_DEBUG
|
||||
#include "Nitro_TS_Debug.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#elif SDK_RELEASE
|
||||
#include "Nitro_TS_Release.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#elif SDK_FINALROM
|
||||
#include "Nitro_TS_ROM.mch" /* If a compile error occurs in this line, please precompile "Nitro_TS.pch" */
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
22
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.pch
Executable file
22
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.pch
Executable file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
precompiled header for NITRO C target
|
||||
*/
|
||||
/* include precompiled header for C source */
|
||||
|
||||
#ifdef SDK_DEBUG
|
||||
#pragma precompile_target "Nitro_TS_Debug.mch"
|
||||
#elif SDK_RELEASE
|
||||
#pragma precompile_target "Nitro_TS_Release.mch"
|
||||
#elif SDK_FINALROM
|
||||
#pragma precompile_target "Nitro_TS_ROM.mch"
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
|
||||
/* include header for NITRO */
|
||||
#include <nitro_TS_prefix.h>
|
||||
#include <nitro.h>
|
||||
|
||||
/* include header for NITRO-System */
|
||||
#include <nnsys_prefix.h>
|
||||
#include <nnsys.h>
|
21
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.pch++
Executable file
21
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/Nitro_TS.pch++
Executable file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
precompiled header for NITRO C++ target
|
||||
*/
|
||||
/* include precompiled header for C++ source */
|
||||
#ifdef SDK_DEBUG
|
||||
#pragma precompile_target "Nitro_TS_Debug.mch++"
|
||||
#elif SDK_RELEASE
|
||||
#pragma precompile_target "Nitro_TS_Release.mch++"
|
||||
#elif SDK_FINALROM
|
||||
#pragma precompile_target "Nitro_TS_ROM.mch++"
|
||||
#else
|
||||
#error("no SDK_ define")
|
||||
#endif
|
||||
|
||||
/* include header for NITRO */
|
||||
#include <nitro_TS_prefix.h>
|
||||
#include <nitro.h>
|
||||
|
||||
/* include header for NITRO-System */
|
||||
#include <nnsys_prefix.h>
|
||||
#include <nnsys.h>
|
98
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/ROM-TS.rsf
Executable file
98
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/ROM-TS.rsf
Executable file
@ -0,0 +1,98 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - IDE - IDE_MultiCellAnimation
|
||||
# File: ROM-TS.rsf
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Nitro ROM SPEC FILE
|
||||
#
|
||||
|
||||
Arm9
|
||||
{
|
||||
Static "$(MAKEROM_ARM9:r).sbin$(COMPSUFFIX9)"
|
||||
OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin$(COMPSUFFIX9)"
|
||||
OverlayTable "$(MAKEROM_ARM9:r)_table.sbin$(COMPSUFFIX9)"
|
||||
Elf "$(MAKEROM_ARM9:r).nef"
|
||||
}
|
||||
|
||||
Arm7
|
||||
{
|
||||
Static "$(MAKEROM_ARM7:r).sbin$(COMPSUFFIX7)"
|
||||
OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin$(COMPSUFFIX7)"
|
||||
OverlayTable "$(MAKEROM_ARM7:r)_table.sbin$(COMPSUFFIX7)"
|
||||
Elf "$(MAKEROM_ARM7:r).nef"
|
||||
}
|
||||
|
||||
Property
|
||||
{
|
||||
###
|
||||
### Settings for FinalROM
|
||||
###
|
||||
#### BEGIN
|
||||
#
|
||||
# TITLE NAME: Your product name within 12bytes
|
||||
#
|
||||
#TitleName "YourAppName"
|
||||
|
||||
#
|
||||
# MAKER CODE: Your company ID# in 2 ascii words
|
||||
# issued by NINTENDO
|
||||
#
|
||||
#MakerCode "00"
|
||||
|
||||
#
|
||||
# REMASTER VERSION: Mastering version
|
||||
#
|
||||
#RomVersion 0
|
||||
|
||||
#
|
||||
# ROM SPEED TYPE: [MROM/1TROM/UNDEFINED]
|
||||
#
|
||||
RomSpeedType $(MAKEROM_ROMSPEED)
|
||||
|
||||
#
|
||||
# ROM SIZE: in bit [64M/128M/256M/512M/1G/2G]
|
||||
#
|
||||
#RomSize 128M
|
||||
#RomSize 256M
|
||||
|
||||
#
|
||||
# ROM PADDING: TRUE if finalrom
|
||||
#
|
||||
#RomFootPadding TRUE
|
||||
|
||||
#
|
||||
# ROM HEADER TEMPLATE: Provided to every product by NINTENDO
|
||||
#
|
||||
#RomHeaderTemplate ./etc/rom_header.template.sbin
|
||||
|
||||
#
|
||||
# BANNER FILE: generated from Banner Spec File
|
||||
#
|
||||
#BannerFile ./etc/myGameBanner.bnr
|
||||
BannerFile $(NITROSDK_ROOT)/include/nitro/specfiles/default.bnr
|
||||
|
||||
###
|
||||
###
|
||||
###
|
||||
#### END
|
||||
}
|
||||
|
||||
RomSpec
|
||||
{
|
||||
Offset 0x00000000
|
||||
Segment ALL
|
||||
HostRoot $(MAKEROM_ROMROOT)
|
||||
Root /
|
||||
File $(MAKEROM_ROMFILES)
|
||||
}
|
145
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/ReadMe.txt
Executable file
145
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/ReadMe.txt
Executable file
@ -0,0 +1,145 @@
|
||||
===========================================================================
|
||||
Stationery for Nitro SDK 3.0
|
||||
Japanese description is available at the second half of this file.
|
||||
===========================================================================
|
||||
|
||||
This stationery uses precompiled headers.
|
||||
|
||||
1. The files and settings relating to the use of the precompiled header.
|
||||
|
||||
- Nitro_TS.pch
|
||||
This is the pch file to generate a mch file which is used by the C source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.pch++
|
||||
This is the pch file to generate a mch file which is used by the C++ source.
|
||||
The actual mch file name depends on the build target you chose.
|
||||
"nitro_TS_prefix.h" and "nitro.h" are included in the precompiled header.
|
||||
If you want to include other header files in the precompiled header, please
|
||||
add the files to the bottom of this pch file.
|
||||
|
||||
- Nitro_TS.h
|
||||
This is the header file for each C and C++ source file to include
|
||||
the proper precompiled header.
|
||||
This header file is included from the Prefix Text field in the C/C++
|
||||
Preprocessor panel thus making it automatically included in each
|
||||
C/C++ source file.
|
||||
|
||||
- The settings in the C/C++ Preprocessor panel
|
||||
The settings in the C/C++ Preprocessor panel ("Target Settings"
|
||||
-> "Language Settings" -> "C/C++ Preprocessor") is the following.
|
||||
1) "Nitro_TS.h" is included by the Prefix Text.
|
||||
2) "nitro_TS_prefix.h" is not included by the Prefix Text.
|
||||
3) "Use prefix text in precompiled header" is checked.
|
||||
|
||||
|
||||
2. The behavior when building is as follows.
|
||||
|
||||
1) Nitro_TS.pch (or Nitro_TS.pch++) is precompiled.
|
||||
The mch file with the proper file name is generated.
|
||||
2) Each C source and each C++ source is compiled.
|
||||
Nitro_TS.h is included by the Prefix Text in the C/C++
|
||||
Preprocessor panel.
|
||||
The proper mch file is included.
|
||||
|
||||
|
||||
3. If you don't want to use precompiled headers, please follow the steps below.
|
||||
|
||||
1) Remove Nitro_TS.pch from Project.
|
||||
2) Remove Nitro_TS.pch++ from Project.
|
||||
3) Remove Nitro_TS.h from Project.
|
||||
4) Change the contents of Prefix Text field on C/C++ Preprocessor panel.
|
||||
- Remove the line " #include "Nitro_TS.h" ".
|
||||
- Remove the comment out of the line "#include <nitro_TS_prefix.h>" to
|
||||
make this #include effective.
|
||||
|
||||
|
||||
4. You may be able to remove Nitro_TS.pch or Nitro_TS.pch++.
|
||||
|
||||
Both of Nitro_TS.pch and Nitro_TS.pch++ are used in both the stationery
|
||||
for C and C++ Project because both C and C++ source may be used
|
||||
in one Project.
|
||||
|
||||
- If the precompiled header for C++ is unnecessary in your C Project,
|
||||
you can remove the Nitro_TS.pch++ from your Project.
|
||||
- If the precompiled header for C is unnecessary in your C++ Project,
|
||||
you can remove the Nitro_TS.pch from your Project.
|
||||
|
||||
|
||||
/*--- The lines below are written in Japanese character set ---*/
|
||||
===========================================================================
|
||||
Nitro SDK 3.0 用ステーショナリ
|
||||
プリコンパイルヘッダの使用について
|
||||
===========================================================================
|
||||
|
||||
このステーショナリではプリコンパイルヘッダを使用しています。
|
||||
|
||||
1.プリコンパイルヘッダの使用に関連した設定、ファイル
|
||||
|
||||
・ Nitro_TS.pch
|
||||
Cソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.pch++
|
||||
C++ソースが使うmchファイルを生成する為のpchファイルです。
|
||||
生成されるmchファイルのファイル名はビルドターゲットによって異なります。
|
||||
プリコンパイルヘッダには nitro_TS_prefix.h と nitro.h を含めています。
|
||||
ユーザーが用意したヘッダファイルも含める場合は、このファイルの末尾に
|
||||
追記して下さい。
|
||||
|
||||
・ Nitro_TS.h
|
||||
各Cソース又はC++ソースが適切なプリコンパイルヘッダをインクルードする
|
||||
為のヘッダファイルです。
|
||||
各Cソース又はC++ソースのコンパイル時に必ずこのヘッダファイルが使用
|
||||
されるように、ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の
|
||||
Prefix Text でインクルードされています。
|
||||
|
||||
・ C/C++ Preprocessor パネル内の設定
|
||||
ターゲット設定パネル - 言語設定 - C/C++ Preprocessor において次の設定
|
||||
がされています。
|
||||
1) Nitro_TS.h を Prefix Text でインクルードする
|
||||
2) nitro_TS_prefix.h は Prefix Text ではインクルードしない
|
||||
3) Use prefix text in precompiled header チェックボックスがオン
|
||||
|
||||
|
||||
2.ビルド時の動きは下記のようになります。
|
||||
|
||||
1) Nitro_TS.pch (またはNitro_TS.pch++)がプリコンパイルされ、ビルド
|
||||
ターゲットに応じた適切なファイル名のmchファイルが生成される。
|
||||
2) 各Cソース又はC++ソースがコンパイルされる。
|
||||
この時、C/C++ Preprocessorパネルの Prefix Textの指定により、Nitro_TS.h
|
||||
が暗黙的にインクルードされ、適切なファイル名のmchファイルがインクルード
|
||||
される。
|
||||
|
||||
|
||||
3.プリコンパイルヘッダを使用しない構成に変更するには、下記の手順を行って
|
||||
下さい。
|
||||
|
||||
1) プロジェクトから Nitro_TS.pch を削除する
|
||||
2) プロジェクトから Nitro_TS.pch++ を削除する
|
||||
3) プロジェクトから Nitro_TS.h を削除する
|
||||
4) ターゲット設定パネル - 言語設定 - C/C++ Preprocessor の Prefix Text の
|
||||
内容について、下記の変更を行う
|
||||
・「#include "Nitro_TS.h"」の行を削除する。
|
||||
・「#include <nitro_TS_prefix.h>」の行のコメントアウトを解除し、
|
||||
このインクルードを有効にする。
|
||||
|
||||
|
||||
4.不要な Nitro_TS.pch 又は Nitro_TS.pch++ について。
|
||||
|
||||
Cのプロジェクト用のステーショナリ及びC++プロジェクト用のステーショナリ
|
||||
の両方において、Cソース及びC++ソースが混在可能とする為に、Nitro_TS.pch と
|
||||
Nitro_TS.pch++ の両方が組み込まれています。
|
||||
|
||||
もし、CのプロジェクトでC++用のプリコンパイルヘッダが全く不要であるな
|
||||
らば、プロジェクトから Nitro_TS.pch++ を削除して頂いてかまいません。
|
||||
同様に、C++のプロジェクトでC用のプリコンパイルヘッダが全く不要である
|
||||
ならば、プロジェクトから Nitro_TS.pch を削除して頂いてかまいません。
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
484
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/src/main.c
Executable file
484
add-ins/TwlSystem/build/demos/IDE/IDE_MultiCellAnimation/src/main.c
Executable file
@ -0,0 +1,484 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - IDE - IDE_MultiCellAnimation
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// マルチセルアニメーションを描画、更新するサンプル
|
||||
// 異なる方式で実体を初期化し、パフォーマンスを比較することができます。
|
||||
//
|
||||
// 操作方法
|
||||
// 十字キー上下 再生速度変更
|
||||
// A 再生<=>停止切り替え
|
||||
// B 順方向<=>逆方向再生切り替え
|
||||
// X マルチセルアニメーションの実体の種類を変更する
|
||||
// Y マルチセルアニメーションのリセット
|
||||
// ============================================================================
|
||||
|
||||
// プリコンパイルヘッダを使用する。
|
||||
// #include <nitro.h>
|
||||
// #include <nnsys/g2d.h>
|
||||
|
||||
#include "g2d_demolib.h"
|
||||
|
||||
|
||||
#define NUM_OF_OAM 128 // OAMマネージャ管理対象のOAM数
|
||||
#define NUM_OF_AFFINE (NUM_OF_OAM/4) // OAMマネージャ管理対象のAffineパラメータ数
|
||||
|
||||
#define ANIM_SPEED_UNIT (FX32_ONE >> 3) // アニメーション速度の変化差分
|
||||
|
||||
//
|
||||
// マルチセル実体の種類
|
||||
// pMCAnim_ 配列にアクセスする際に使用されます
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
MCANIM_SHARE_CELLANIM = 0x0,
|
||||
MCANIM_DONOT_SHARE_CELLANIM = 0x1
|
||||
|
||||
}MyMCAnimType;
|
||||
|
||||
static const char* mcAnimTypeStr [] =
|
||||
{
|
||||
" ShareCellAnim",
|
||||
"DoNotShareCellAnim"
|
||||
};
|
||||
|
||||
static const int CvtTblToNNSG2dMCType [] =
|
||||
{
|
||||
NNS_G2D_MCTYPE_SHARE_CELLANIM,
|
||||
NNS_G2D_MCTYPE_DONOT_SHARE_CELLANIM
|
||||
};
|
||||
|
||||
|
||||
// Cell 表示位置
|
||||
static const NNSG2dFVec2 CELL_POSITION = {120 << FX32_SHIFT, 150 << FX32_SHIFT};
|
||||
//
|
||||
// MultiCellAnimation 実体
|
||||
// 異なる2つの方式で実体を初期化します。
|
||||
//
|
||||
static NNSG2dMultiCellAnimation mcAnim[2];
|
||||
|
||||
|
||||
// OAMアトリビュート一時バッファ
|
||||
static GXOamAttr tempOamBuffer[NUM_OF_OAM];
|
||||
|
||||
//
|
||||
// マルチセルバンク
|
||||
//
|
||||
static NNSG2dMultiCellDataBank* pMCBank = NULL; // マルチセルデータ
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// プロトタイプ宣言
|
||||
|
||||
static void InitOamManager(NNSG2dOamManagerInstance* pOamManager);
|
||||
static void LoadResources();
|
||||
static void ProcessInput(fx32* pAnimSpeed, NNSG2dAnimController* pAnimCtrl);
|
||||
void VBlankIntr(void);
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitOamManager
|
||||
|
||||
Description: OAMマネージャシステムとOAMマネージャの初期化を行います。
|
||||
|
||||
Arguments: pOamManager: 初期化するOAMマネージャへのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitOamManager(NNSG2dOamManagerInstance* pOamManager)
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
// Oam Manager システムの初期化
|
||||
NNS_G2dInitOamManagerModule();
|
||||
|
||||
result = NNS_G2dGetNewManagerInstance(
|
||||
pOamManager,
|
||||
0,
|
||||
NUM_OF_OAM - 1,
|
||||
NNS_G2D_OAMTYPE_MAIN );
|
||||
SDK_ASSERT( result );
|
||||
|
||||
result = NNS_G2dInitManagerInstanceAffine( pOamManager, 0, NUM_OF_AFFINE - 1 );
|
||||
SDK_ASSERT( result );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitMultiCellInstance_
|
||||
|
||||
Description: マルチセル実体を初期化します。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitMultiCellInstance_
|
||||
(
|
||||
NNSG2dMultiCellAnimation* pMCAnim,
|
||||
NNSG2dCellAnimBankData* pAnimBank,
|
||||
NNSG2dCellDataBank* pCellBank,
|
||||
NNSG2dMultiCellDataBank* pMCBank,
|
||||
NNSG2dMultiCellAnimBankData* pMCABank,
|
||||
NNSG2dMCType mcType
|
||||
)
|
||||
{
|
||||
// 初期化に必要なワークメモリのサイズを取得します
|
||||
const u32 szWork = NNS_G2dGetMCWorkAreaSize( pMCBank, mcType );
|
||||
void* pWorkMem = G2DDemo_Alloc( szWork );
|
||||
|
||||
// 初期化
|
||||
NNS_G2dInitMCAnimationInstance( pMCAnim,
|
||||
pWorkMem,
|
||||
pAnimBank,
|
||||
pCellBank,
|
||||
pMCBank,
|
||||
mcType );
|
||||
|
||||
SDK_NULL_ASSERT( pMCAnim );
|
||||
|
||||
// マルチセルアニメーションに再生するシーケンスをセット
|
||||
{
|
||||
const NNSG2dMultiCellAnimSequence* pSequence = NULL;
|
||||
// 再生するシーケンスを取得
|
||||
pSequence = NNS_G2dGetAnimSequenceByIdx( pMCABank, 0 );
|
||||
SDK_ASSERT( pSequence );
|
||||
|
||||
NNS_G2dSetAnimSequenceToMCAnimation( pMCAnim, pSequence);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadResources
|
||||
|
||||
Description: マルチセルアニメーションの構築とキャラクタデータ、
|
||||
パレットデータの読み込みを行います。
|
||||
|
||||
Arguments: ppMCAnim: 構築したマルチセルアニメーションへのポインタを
|
||||
受け取るポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void LoadResources()
|
||||
{
|
||||
void* pBuf;
|
||||
|
||||
//
|
||||
// MultiCell 関連初期化
|
||||
//
|
||||
{
|
||||
NNSG2dCellDataBank* pCellBank = NULL; // セルデータ
|
||||
NNSG2dCellAnimBankData* pAnimBank = NULL; // セルアニメーション
|
||||
NNSG2dMultiCellAnimBankData* pMCABank = NULL; // マルチセルアニメーション
|
||||
|
||||
// セルデータ、セルアニメーション、マルチセルデータ、
|
||||
// マルチセルアニメーションをロード。
|
||||
// これらは最後までメインメモリ上で使用するので pBuf を解放しません。
|
||||
pBuf = G2DDemo_LoadNCER( &pCellBank, "data/MultiCellAnimation.NCER" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
pBuf = G2DDemo_LoadNANR( &pAnimBank, "data/MultiCellAnimation.NANR" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
pBuf = G2DDemo_LoadNMCR( &pMCBank, "data/MultiCellAnimation.NMCR" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
pBuf = G2DDemo_LoadNMAR( &pMCABank, "data/MultiCellAnimation.NMAR" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
|
||||
|
||||
|
||||
//
|
||||
// マルチセルアニメーションの実体を初期化します
|
||||
// 異なる方式で2つの実体を初期化します。
|
||||
//
|
||||
InitMultiCellInstance_( &mcAnim[MCANIM_SHARE_CELLANIM],
|
||||
pAnimBank,
|
||||
pCellBank,
|
||||
pMCBank,
|
||||
pMCABank,
|
||||
NNS_G2D_MCTYPE_SHARE_CELLANIM );
|
||||
|
||||
|
||||
InitMultiCellInstance_( &mcAnim[MCANIM_DONOT_SHARE_CELLANIM],
|
||||
pAnimBank,
|
||||
pCellBank,
|
||||
pMCBank,
|
||||
pMCABank,
|
||||
NNS_G2D_MCTYPE_DONOT_SHARE_CELLANIM );
|
||||
}
|
||||
|
||||
//
|
||||
// VRAM 関連の初期化
|
||||
//
|
||||
{
|
||||
// Loading NCG (Character Data)
|
||||
{
|
||||
NNSG2dCharacterData* pCharData = NULL;
|
||||
|
||||
pBuf = G2DDemo_LoadNCGR( &pCharData, "data/MultiCellAnimation.NCGR" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
|
||||
// Loading For 2D Graphics Engine.
|
||||
DC_FlushRange( pCharData->pRawData, pCharData->szByte );
|
||||
GX_LoadOBJ( (void*)pCharData->pRawData, 0, pCharData->szByte );
|
||||
|
||||
// キャラクタデータを VRAM にコピーしたので
|
||||
// この pBuf は開放します。以下同じ。
|
||||
G2DDemo_Free( pBuf );
|
||||
}
|
||||
|
||||
// Loading NCL (Palette Data)
|
||||
{
|
||||
NNSG2dPaletteData* pPltData = NULL;
|
||||
|
||||
pBuf = G2DDemo_LoadNCLR( &pPltData, "data/MultiCellAnimation.NCLR" );
|
||||
SDK_NULL_ASSERT( pBuf );
|
||||
|
||||
// Loading For 2D Graphics Engine.
|
||||
DC_FlushRange( pPltData->pRawData, pPltData->szByte );
|
||||
GX_LoadOBJPltt( (void*)pPltData->pRawData, 0, pPltData->szByte );
|
||||
|
||||
G2DDemo_Free( pBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ProcessInput
|
||||
|
||||
Description: パッド入力を読み込み、入力に応じてアニメーション
|
||||
パラメータを変更します。
|
||||
|
||||
Arguments: pAnimSpeed: アニメーションスピードへのポインタ。
|
||||
上下キーによりスピードを変更します。
|
||||
pAnimCtrl: アニメーションコントローラへのポインタ。
|
||||
A / B ボタンにより 停止 / 反転 を操作します。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void ProcessInput(fx32* pAnimSpeed, NNSG2dAnimController* pAnimCtrl)
|
||||
{
|
||||
G2DDemo_ReadGamePad();
|
||||
|
||||
// change animation speed.
|
||||
{
|
||||
if (G2DDEMO_IS_TRIGGER(PAD_KEY_UP))
|
||||
{
|
||||
*pAnimSpeed +=ANIM_SPEED_UNIT;
|
||||
}
|
||||
|
||||
if (G2DDEMO_IS_TRIGGER(PAD_KEY_DOWN))
|
||||
{
|
||||
*pAnimSpeed -= ANIM_SPEED_UNIT;
|
||||
|
||||
if( *pAnimSpeed < 0 )
|
||||
{
|
||||
*pAnimSpeed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 再生制御
|
||||
{
|
||||
if (G2DDEMO_IS_TRIGGER(PAD_BUTTON_B ))
|
||||
{
|
||||
pAnimCtrl->bReverse = ! pAnimCtrl->bReverse;
|
||||
}
|
||||
|
||||
if (G2DDEMO_IS_TRIGGER(PAD_BUTTON_A ))
|
||||
{
|
||||
pAnimCtrl->bActive = ! pAnimCtrl->bActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
//マルチセルの描画
|
||||
static void AppDraw
|
||||
(
|
||||
const NNSG2dMultiCellAnimation* pMcAnim,
|
||||
NNSG2dOamManagerInstance* pOamMgr
|
||||
)
|
||||
{
|
||||
// 描画
|
||||
//
|
||||
// 低レベルな描画方法で MultiCell を描画します。
|
||||
// 上位モジュールの G2dRenderer を 利用する描画方法もあります。
|
||||
//
|
||||
//
|
||||
{
|
||||
u16 numOamDrawn = 0; // 残り OAM 数
|
||||
|
||||
const NNSG2dMultiCellInstance* pMultiCell = &(pMcAnim->multiCellInstance); // 表示する MultiCell
|
||||
SDK_NULL_ASSERT( pMultiCell );
|
||||
|
||||
//
|
||||
// MultiCell と等価な OBJリストをテンポラリに書き出します
|
||||
//
|
||||
numOamDrawn = NNS_G2dMakeSimpleMultiCellToOams(
|
||||
tempOamBuffer, // 出力先Oamバッファ
|
||||
NUM_OF_OAM, // 出力先バッファ長
|
||||
pMultiCell, // 出力対象 MultiCell
|
||||
NULL, // Affine 変換
|
||||
&CELL_POSITION, // オフセット位置
|
||||
NULL, // Affine Index
|
||||
FALSE ); // 倍角Affineか?
|
||||
|
||||
SDK_ASSERT( numOamDrawn < NUM_OF_OAM );
|
||||
|
||||
// OAMマネージャへOBJリストを登録します
|
||||
(void)NNS_G2dEntryOamManagerOam( pOamMgr, tempOamBuffer, numOamDrawn );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain()
|
||||
{
|
||||
NNSG2dOamManagerInstance oamManager; // Oam マネージャ実体
|
||||
MyMCAnimType mcAnimType = MCANIM_SHARE_CELLANIM;
|
||||
|
||||
// Initialize App.
|
||||
{
|
||||
G2DDemo_CommonInit();
|
||||
G2DDemo_PrintInit();
|
||||
InitOamManager( &oamManager );
|
||||
LoadResources();
|
||||
|
||||
// start display
|
||||
{
|
||||
SVC_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
static fx32 animSpeed = FX32_ONE; // アニメーションスピード
|
||||
static OSTick time = 0;
|
||||
NNSG2dMultiCellAnimation* pMcAnim = &mcAnim[mcAnimType];
|
||||
|
||||
//
|
||||
// ------ Pad handling.
|
||||
//
|
||||
{
|
||||
ProcessInput(&animSpeed, NNS_G2dGetMCAnimAnimCtrl(pMcAnim));
|
||||
|
||||
// ---- マルチセルアニメーション実体の種類を切り替えます。
|
||||
if (G2DDEMO_IS_TRIGGER(PAD_BUTTON_X ))
|
||||
{
|
||||
if( mcAnimType == MCANIM_SHARE_CELLANIM )
|
||||
{
|
||||
mcAnimType = MCANIM_DONOT_SHARE_CELLANIM;
|
||||
}else{
|
||||
mcAnimType = MCANIM_SHARE_CELLANIM;
|
||||
}
|
||||
}
|
||||
|
||||
// ---- リセット
|
||||
if (G2DDEMO_IS_PRESS(PAD_BUTTON_Y ))
|
||||
{
|
||||
NNS_G2dRestartMCAnimation( pMcAnim );
|
||||
}
|
||||
}
|
||||
|
||||
// ------ 描画
|
||||
//
|
||||
// 下位レベルの描画APIを利用して MultiCell を描画します。
|
||||
// 上位モジュールの G2dRenderer を 利用する描画方法もあります。
|
||||
//
|
||||
//
|
||||
AppDraw( pMcAnim, &oamManager );
|
||||
|
||||
|
||||
// ------ アニメーションの更新
|
||||
// 描画されている方の更新にかかった時間を計測します
|
||||
{
|
||||
u32 i;
|
||||
for( i = 0; i < 2; i++ )
|
||||
{
|
||||
if( i == mcAnimType )
|
||||
{
|
||||
time = OS_GetTick();
|
||||
NNS_G2dTickMCAnimation( &mcAnim[i], animSpeed );
|
||||
time = OS_GetTick()- time;
|
||||
}else{
|
||||
NNS_G2dTickMCAnimation( &mcAnim[i], animSpeed );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------ デバック文字列を描画します
|
||||
{
|
||||
const NNSG2dAnimController* pAnimCtrl = NNS_G2dGetMCAnimAnimCtrl(pMcAnim);
|
||||
|
||||
G2DDemo_PrintOutf(0, 0, "speed: %7.3f", (float)animSpeed / FX32_ONE );
|
||||
G2DDemo_PrintOutf(0, 1, "frame: %3d / %3d",
|
||||
pAnimCtrl->pCurrent - pAnimCtrl->pAnimSequence->pAnmFrameArray,
|
||||
pAnimCtrl->pAnimSequence->numFrames );
|
||||
|
||||
G2DDemo_PrintOutf( 0, 2, "TIMEForUpdate :%06ld usec", OS_TicksToMicroSeconds(time) );
|
||||
|
||||
// 現在の実体の初期化に必要なワークメモリのサイズ
|
||||
G2DDemo_PrintOutf( 0, 3, "szWorkMem:%06ld byte",
|
||||
NNS_G2dGetMCWorkAreaSize( pMCBank,
|
||||
(NNSG2dMCType)CvtTblToNNSG2dMCType[ mcAnimType ] ) );
|
||||
|
||||
// 現在の実体の種類
|
||||
G2DDemo_PrintOutf( 0, 4, "Type :%s", mcAnimTypeStr[mcAnimType] );
|
||||
|
||||
G2DDemo_PrintOut(19, 0, "Active:");
|
||||
G2DDemo_PrintOut(28, 0, NNS_G2dIsAnimCtrlActive(pAnimCtrl) ? "yes": " no");
|
||||
G2DDemo_PrintOut(19, 1, "Reverse:");
|
||||
G2DDemo_PrintOut(28, 1, pAnimCtrl->bReverse ? "yes": " no");
|
||||
}
|
||||
|
||||
// ------ V Blank 待ち
|
||||
SVC_WaitVBlankIntr();
|
||||
G2DDemo_PrintApplyToHW(); // アニメーション情報をHWに書き出します
|
||||
|
||||
// ------ マネージャの内容をHWに書き出します
|
||||
{
|
||||
NNS_G2dApplyOamManagerToHW ( &oamManager );
|
||||
NNS_G2dResetOamManagerBuffer ( &oamManager );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: VBlankIntr
|
||||
|
||||
Description: Vブランク割り込みを処理します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void VBlankIntr(void)
|
||||
{
|
||||
OS_SetIrqCheckFlag( OS_IE_V_BLANK ); // checking VBlank interrupt
|
||||
}
|
||||
|
60
add-ins/TwlSystem/build/demos/IDE/Readme-IDE_Project.txt
Executable file
60
add-ins/TwlSystem/build/demos/IDE/Readme-IDE_Project.txt
Executable file
@ -0,0 +1,60 @@
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
CodeWarrior IDE プロジェクトサンプル
|
||||
|
||||
[ 2007.08.01 ]
|
||||
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
||||
|
||||
|
||||
目次
|
||||
==============================================================================
|
||||
|
||||
1. はじめに
|
||||
2. プロジェクトサンプルについて
|
||||
3. プロジェクトの注意事項
|
||||
|
||||
|
||||
1. はじめに
|
||||
==============================================================================
|
||||
|
||||
このディレクトリには、CodeWarrior IDE のプロジェクトのサンプルが格納されて
|
||||
います。これらのサンプルは、NITRO-System/docs/IDE_BuildGuide.pdfで説明して
|
||||
いますIDE プロジェクトの作成手順に従って作成したものとなります。(若干、プ
|
||||
ロジェクト内容を整理しています。)
|
||||
|
||||
|
||||
2. プロジェクトサンプルについて
|
||||
==============================================================================
|
||||
|
||||
IDE プロジェクトサンプルの内容は、下記の通りです。
|
||||
|
||||
・IDE_Archive
|
||||
fnd ライブラリのArchive サンプルをCodeWarrior IDE を使ってビルドを行う
|
||||
ためのプロジェクトです。プリコンパイルヘッダを利用する設定になっていま
|
||||
す。
|
||||
|
||||
|
||||
・IDE_MultiCellAnimation
|
||||
g2d ライブラリのMultiCellAnimationサンプルをCodeWarrior IDE を使ってビ
|
||||
ルドを行うためのプロジェクトです。
|
||||
|
||||
プライベートなライブラリ(g2d デモライブラリ)を使用する場合のプロジェ
|
||||
クトの例となっています。プリコンパイルヘッダを利用する設定になっていま
|
||||
す。
|
||||
|
||||
|
||||
・IDE_G2dDemoLib
|
||||
g2d サンプル専用のプライベートなデモライブラリをCodeWarrior IDE を使っ
|
||||
てビルドするためのプロジェクトです。プリコンパイルヘッダを利用しない設
|
||||
定になっています。
|
||||
|
||||
|
||||
3. プロジェクトの注意事項
|
||||
==============================================================================
|
||||
|
||||
デモライブラリ(libg2d_demo.a) が格納されるディレクトリが存在しない状態で、
|
||||
IDE_MultiCellAnimationプロジェクトを開きますと、プロジェクトウィンドウ内に
|
||||
新しくlibg2d_demo.aが追加されてしまうようです。
|
||||
|
||||
これを防ぐために、IDE_G2dDemoLibプロジェクトには予めデモライブラリを格納す
|
||||
るためのディレクトリを作成しています。
|
||||
|
28
add-ins/TwlSystem/build/demos/Makefile
Executable file
28
add-ins/TwlSystem/build/demos/Makefile
Executable file
@ -0,0 +1,28 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 344 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBMAKES := $(wildcard $(addsuffix /Makefile,$(NNS_ALLLIBS)))
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
33
add-ins/TwlSystem/build/demos/fnd/Makefile
Executable file
33
add-ins/TwlSystem/build/demos/fnd/Makefile
Executable file
@ -0,0 +1,33 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - fnd
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = \
|
||||
heap \
|
||||
archive \
|
||||
archive2
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
40
add-ins/TwlSystem/build/demos/fnd/archive/Makefile
Executable file
40
add-ins/TwlSystem/build/demos/fnd/archive/Makefile
Executable file
@ -0,0 +1,40 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - fnd - archive
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = fnd
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c sdk_init.c nns_util.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ./
|
||||
MAKEROM_ROMFILES = data/*.*
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
BIN
add-ins/TwlSystem/build/demos/fnd/archive/data/picture.narc
Executable file
BIN
add-ins/TwlSystem/build/demos/fnd/archive/data/picture.narc
Executable file
Binary file not shown.
63
add-ins/TwlSystem/build/demos/fnd/archive/include/nns_util.h
Executable file
63
add-ins/TwlSystem/build/demos/fnd/archive/include/nns_util.h
Executable file
@ -0,0 +1,63 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive
|
||||
File: nns_util.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef NNS_UTIL_H_
|
||||
#define NNS_UTIL_H_
|
||||
|
||||
#include <nitro.h>
|
||||
#include <nnsys/fnd.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 trigger;
|
||||
u16 release;
|
||||
u16 button;
|
||||
}
|
||||
GamePad;
|
||||
|
||||
extern GamePad gGamePad;
|
||||
extern NNSFndHeapHandle gSysHeap; // システムヒープ
|
||||
extern NNSFndHeapHandle gAppHeap; // アプリケーションヒープ
|
||||
|
||||
|
||||
#define IS_TRIGGER(key) (gGamePad.trigger & key)
|
||||
#define IS_RELEASE(key) (gGamePad.release & key)
|
||||
#define IS_PRESS(key) (gGamePad.button & key)
|
||||
|
||||
|
||||
#define ROUND_UP(value, alignment) \
|
||||
(((u32)(value) + (alignment-1)) & ~(alignment-1))
|
||||
|
||||
#define ROUND_DOWN(value, alignment) \
|
||||
((u32)(value) & ~(alignment-1))
|
||||
|
||||
|
||||
void ReadGamePad(void);
|
||||
void InitMemory(void);
|
||||
NNSFndArchive* LoadArchive(const char* name, const char* path);
|
||||
void RemoveArchive(NNSFndArchive* archive);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// NNS_UTIL_H_
|
||||
#endif
|
20
add-ins/TwlSystem/build/demos/fnd/archive/include/picture.naix
Executable file
20
add-ins/TwlSystem/build/demos/fnd/archive/include/picture.naix
Executable file
@ -0,0 +1,20 @@
|
||||
/*****************************************************************************
|
||||
Archive file index definition.
|
||||
File: picture.naix
|
||||
|
||||
This file was created by NINTENDO NITRO-System Archiver.
|
||||
|
||||
Update:2004-05-26T17:45:19
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef NARC_PICTURE_NAIX_
|
||||
#define NARC_PICTURE_NAIX_
|
||||
|
||||
enum {
|
||||
NARC_picture_dog256_chr = 0,
|
||||
NARC_picture_dog256_pal = 1,
|
||||
NARC_picture_dog256_scn = 2
|
||||
};
|
||||
|
||||
/* NARC_PICTURE_NAIX_ */
|
||||
#endif
|
38
add-ins/TwlSystem/build/demos/fnd/archive/include/sdk_init.h
Executable file
38
add-ins/TwlSystem/build/demos/fnd/archive/include/sdk_init.h
Executable file
@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive
|
||||
File: sdk_init.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SDK_INIT_H_
|
||||
#define SDK_INIT_H_
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void VBlankIntr(void);
|
||||
|
||||
void InitSystem(void);
|
||||
void InitVRAM(void);
|
||||
void InitDisplay(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// SDK_INIT_H_
|
||||
#endif
|
92
add-ins/TwlSystem/build/demos/fnd/archive/src/main.c
Executable file
92
add-ins/TwlSystem/build/demos/fnd/archive/src/main.c
Executable file
@ -0,0 +1,92 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
#include "nns_util.h"
|
||||
|
||||
// アーカイブのインデックス定義ファイル
|
||||
#include "picture.naix"
|
||||
|
||||
|
||||
static void LoadPicture(void);
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Name: NitroMain
|
||||
|
||||
Description: アーカイブからBGデータを読み込み、画面を表示するサンプル
|
||||
プログラムです。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
NitroMain(void)
|
||||
{
|
||||
InitSystem();
|
||||
InitMemory();
|
||||
InitVRAM();
|
||||
|
||||
InitDisplay();
|
||||
LoadPicture();
|
||||
G2_SetBG0Offset(0,20);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
SVC_WaitVBlankIntr();
|
||||
ReadGamePad();
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadPicture
|
||||
|
||||
Description: アーカイブを1つロードし、その中に格納されているキャラクタ、
|
||||
カラーパレット、スクリーンの各データをVRAMに転送します。
|
||||
|
||||
各データをVRAMに転送した後、アーカイブを削除します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
LoadPicture(void)
|
||||
{
|
||||
NNSFndArchive* archive;
|
||||
|
||||
// アーカイブをメインメモリに読み込み、ファイルシステムにマウントします。
|
||||
// LoadArchive()内でDC_FlushRange()の呼び出しが行われています。
|
||||
// LoadArchive()は、nns_util.c内にあります。
|
||||
if ((archive = LoadArchive("PCT", "/data/picture.narc")) != NULL)
|
||||
{
|
||||
// パス名を指定してデータを取得。
|
||||
void* chrData = NNS_FndGetArchiveFileByName("PCT:/picture/dog/dog256.chr");
|
||||
void* scnData = NNS_FndGetArchiveFileByName("PCT:/picture/dog/dog256.scn");
|
||||
|
||||
// インデックスを指定してデータを取得。
|
||||
void* palData = NNS_FndGetArchiveFileByIndex(archive, NARC_picture_dog256_pal);
|
||||
|
||||
// データをVRAMのロード。
|
||||
GX_LoadBG0Char(chrData, 0, 0x10000);
|
||||
GX_LoadBG0Scr (scnData, 0, 0x00800);
|
||||
GX_LoadBGPltt (palData, 0, 0x00200);
|
||||
|
||||
// VRAMにデータをロードした後は、メインメモリ上のデータは不要な為、
|
||||
// アーカイブを削除します。
|
||||
// RemoveArchive()は、nns_util.c内にあります。
|
||||
RemoveArchive(archive);
|
||||
}
|
||||
}
|
147
add-ins/TwlSystem/build/demos/fnd/archive/src/nns_util.c
Executable file
147
add-ins/TwlSystem/build/demos/fnd/archive/src/nns_util.c
Executable file
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive
|
||||
File: nns_util.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nns_util.h"
|
||||
|
||||
#define SYSTEM_HEAP_SIZE 64*1024
|
||||
|
||||
GamePad gGamePad; // ゲームパッド
|
||||
NNSFndHeapHandle gSysHeap; // システムヒープ (拡張ヒープを使用)
|
||||
NNSFndHeapHandle gAppHeap; // アプリケーションヒープ(拡張ヒープを使用)
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitMemory
|
||||
|
||||
Description: システムヒープとアプリケーションヒープを作成します。両ヒープ
|
||||
にはNITRO-Systemの拡張ヒープを使用しています。
|
||||
|
||||
システムヒープ用のメモリとして、SYSTEM_HEAP_SIZE分をメインア
|
||||
リーナから確保し、メインアリーナの残りを全てアプリケーション
|
||||
ヒープ用のメモリに確保しています。
|
||||
|
||||
システムヒープは、ゲームシステム等のシステムプログラムで使用
|
||||
することを想定しています。アプリケーションヒープには、ゲーム
|
||||
で使用するデータをロードする為に使用します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitMemory(void)
|
||||
{
|
||||
void* sysHeapMemory = OS_AllocFromMainArenaLo(SYSTEM_HEAP_SIZE, 16);
|
||||
|
||||
u32 arenaLow = ROUND_UP (OS_GetMainArenaLo(), 16);
|
||||
u32 arenaHigh = ROUND_DOWN(OS_GetMainArenaHi(), 16);
|
||||
u32 appHeapSize = arenaHigh - arenaLow;
|
||||
void* appHeapMemory = OS_AllocFromMainArenaLo(appHeapSize, 16);
|
||||
|
||||
gSysHeap = NNS_FndCreateExpHeap(sysHeapMemory, SYSTEM_HEAP_SIZE);
|
||||
gAppHeap = NNS_FndCreateExpHeap(appHeapMemory, appHeapSize );
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadArchive
|
||||
|
||||
Description: パス名で指定されたアーカイブをメモリに読み込み、ファイルシス
|
||||
テムにマウントします。この関数の実装では、DC_FlushRange 関数
|
||||
を呼び出す事により、読み込まれたアーカイブがメインメモリ上に
|
||||
存在する事が保証されます。
|
||||
|
||||
アーカイブを読み込む為のメモリと、アーカイブをマウントする為
|
||||
に必要なNNSFndArchive 構造体用のメモリは、アプリケーションヒ
|
||||
ープから確保します。
|
||||
|
||||
Arguments: name: アーカイブをファイルシステム上で識別する為の名前。
|
||||
path: アーカイブのパス名。
|
||||
|
||||
Returns: アーカイブのロードに成功すれば、NNSFndArchive 構造体へのポイ
|
||||
ンタを返します。失敗した場合には、NULLを返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSFndArchive*
|
||||
LoadArchive(const char* name, const char* path)
|
||||
{
|
||||
FSFile file;
|
||||
NNSFndArchive* archive = NULL;
|
||||
|
||||
FS_InitFile(&file);
|
||||
if (FS_OpenFile(&file, path))
|
||||
{
|
||||
u32 binarySize = FS_GetLength(&file);
|
||||
u32 memorySize = ROUND_UP(sizeof(NNSFndArchive), 16) + ROUND_UP(binarySize, 16);
|
||||
|
||||
u8* memory = (u8*)NNS_FndAllocFromExpHeapEx(gAppHeap, memorySize, 16);
|
||||
|
||||
if (memory != NULL)
|
||||
{
|
||||
u8* binary = memory + ROUND_UP(sizeof(NNSFndArchive), 16);
|
||||
|
||||
if (FS_ReadFile(&file, binary, (s32)binarySize) == binarySize)
|
||||
{
|
||||
DC_FlushRange(binary, binarySize);
|
||||
|
||||
if (NNS_FndMountArchive((NNSFndArchive*)memory, name, binary))
|
||||
{
|
||||
archive = (NNSFndArchive*)memory;
|
||||
}
|
||||
else
|
||||
{
|
||||
NNS_FndFreeToExpHeap(gAppHeap, memory);
|
||||
}
|
||||
}
|
||||
}
|
||||
(void)FS_CloseFile(&file);
|
||||
}
|
||||
return archive;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: RemoveArchive
|
||||
|
||||
Description: 指定されたアーカイブをメモリから削除します。
|
||||
|
||||
指定されたアーカイブをファイルシステムからアンマウントし、ア
|
||||
ーカイブが読み込まれていたメモリを解放します。
|
||||
|
||||
Arguments: archive: NNSアーカイブ構造体へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
RemoveArchive(NNSFndArchive* archive)
|
||||
{
|
||||
(void)NNS_FndUnmountArchive(archive);
|
||||
NNS_FndFreeToExpHeap(gAppHeap, archive);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ReadGamePad
|
||||
|
||||
Description: キーを読み込み、トリガとリリーストリガを求めます。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void ReadGamePad(void)
|
||||
{
|
||||
u16 status = PAD_Read();
|
||||
|
||||
gGamePad.trigger = (u16)(status & (status ^ gGamePad.button));
|
||||
gGamePad.release = (u16)(gGamePad.button & (status ^ gGamePad.button));
|
||||
gGamePad.button = status;
|
||||
}
|
125
add-ins/TwlSystem/build/demos/fnd/archive/src/sdk_init.c
Executable file
125
add-ins/TwlSystem/build/demos/fnd/archive/src/sdk_init.c
Executable file
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive
|
||||
File: sdk_init.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
|
||||
#define DEFAULT_DMA_NUMBER MI_DMA_MAX_NUM
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
V-blank callback
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
VBlankIntr(void)
|
||||
{
|
||||
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitSystem
|
||||
|
||||
Description: NITROの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitSystem(void)
|
||||
{
|
||||
OS_Init();
|
||||
FX_Init();
|
||||
GX_SetPower(GX_POWER_ALL);
|
||||
GX_Init();
|
||||
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
|
||||
(void)OS_EnableIrq();
|
||||
|
||||
FS_Init(DEFAULT_DMA_NUMBER);
|
||||
|
||||
(void)GX_VBlankIntr(TRUE); // to generate VBlank interrupt request
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitVRAM
|
||||
|
||||
Description: VRAMの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitVRAM(void)
|
||||
{
|
||||
// 全てのバンクをLCDCに割り当てる
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
|
||||
// LCDC空間全てをクリア
|
||||
MI_CpuClearFast( (void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE );
|
||||
|
||||
// LCDCに割り当てられたバンクをDisable
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
MI_CpuFillFast ((void*)HW_OAM , 192, HW_OAM_SIZE ); // OAM クリア
|
||||
MI_CpuFillFast ((void*)HW_DB_OAM , 192, HW_DB_OAM_SIZE); // clear OAM
|
||||
|
||||
MI_CpuClearFast((void*)HW_PLTT , HW_PLTT_SIZE ); // パレット クリア
|
||||
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitDisplay
|
||||
|
||||
Description: BG0のみを表示します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitDisplay(void)
|
||||
{
|
||||
GX_SetBankForBG (GX_VRAM_BG_128_A ); // バンクAをBGに割り当てる
|
||||
|
||||
GX_SetBGCharOffset(GX_BGCHAROFFSET_0x00000);
|
||||
GX_SetBGScrOffset ( GX_BGSCROFFSET_0x10000);
|
||||
|
||||
GX_SetGraphicsMode(
|
||||
GX_DISPMODE_GRAPHICS, // グラフィックス表示モードにする
|
||||
GX_BGMODE_0, // BGMODEを0に設定
|
||||
GX_BG0_AS_2D); // BG0を2D表示に設定
|
||||
|
||||
GX_SetVisiblePlane(
|
||||
GX_PLANEMASK_BG0 // BG0を表示。
|
||||
);
|
||||
|
||||
G2_SetBG0Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // 256×256ドット
|
||||
GX_BG_COLORMODE_256, // 256色モード。
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース。
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース。
|
||||
GX_BG_EXTPLTT_01 // BGExtPlttスロット。
|
||||
);
|
||||
|
||||
GX_DispOn();
|
||||
}
|
40
add-ins/TwlSystem/build/demos/fnd/archive2/Makefile
Executable file
40
add-ins/TwlSystem/build/demos/fnd/archive2/Makefile
Executable file
@ -0,0 +1,40 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - fnd - archive2
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = fnd
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c sdk_init.c nns_util.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ./
|
||||
MAKEROM_ROMFILES = data/*.*
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
BIN
add-ins/TwlSystem/build/demos/fnd/archive2/data/picture_LZ.bin
Executable file
BIN
add-ins/TwlSystem/build/demos/fnd/archive2/data/picture_LZ.bin
Executable file
Binary file not shown.
63
add-ins/TwlSystem/build/demos/fnd/archive2/include/nns_util.h
Executable file
63
add-ins/TwlSystem/build/demos/fnd/archive2/include/nns_util.h
Executable file
@ -0,0 +1,63 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive2
|
||||
File: nns_util.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef NNS_UTIL_H_
|
||||
#define NNS_UTIL_H_
|
||||
|
||||
#include <nitro.h>
|
||||
#include <nnsys/fnd.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 trigger;
|
||||
u16 release;
|
||||
u16 button;
|
||||
}
|
||||
GamePad;
|
||||
|
||||
extern GamePad gGamePad;
|
||||
extern NNSFndHeapHandle gSysHeap; // システムヒープ
|
||||
extern NNSFndHeapHandle gAppHeap; // アプリケーションヒープ
|
||||
|
||||
|
||||
#define IS_TRIGGER(key) (gGamePad.trigger & key)
|
||||
#define IS_RELEASE(key) (gGamePad.release & key)
|
||||
#define IS_PRESS(key) (gGamePad.button & key)
|
||||
|
||||
|
||||
#define ROUND_UP(value, alignment) \
|
||||
(((u32)(value) + (alignment-1)) & ~(alignment-1))
|
||||
|
||||
#define ROUND_DOWN(value, alignment) \
|
||||
((u32)(value) & ~(alignment-1))
|
||||
|
||||
|
||||
void ReadGamePad(void);
|
||||
void InitMemory(void);
|
||||
NNSFndArchive* LoadCompressedArchive(const char* name, const char* path);
|
||||
void RemoveArchive(NNSFndArchive* archive);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// NNS_UTIL_H_
|
||||
#endif
|
20
add-ins/TwlSystem/build/demos/fnd/archive2/include/picture.naix
Executable file
20
add-ins/TwlSystem/build/demos/fnd/archive2/include/picture.naix
Executable file
@ -0,0 +1,20 @@
|
||||
/*****************************************************************************
|
||||
Archive file index definition.
|
||||
File: picture.naix
|
||||
|
||||
This file was created by NINTENDO NITRO-System Archiver.
|
||||
|
||||
Update:2004-07-23T13:33:46
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef NARC_PICTURE_NAIX_
|
||||
#define NARC_PICTURE_NAIX_
|
||||
|
||||
enum {
|
||||
NARC_picture_flower256_chr = 0,
|
||||
NARC_picture_flower256_pal = 1,
|
||||
NARC_picture_flower256_scn = 2
|
||||
};
|
||||
|
||||
/* NARC_PICTURE_NAIX_ */
|
||||
#endif
|
38
add-ins/TwlSystem/build/demos/fnd/archive2/include/sdk_init.h
Executable file
38
add-ins/TwlSystem/build/demos/fnd/archive2/include/sdk_init.h
Executable file
@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive2
|
||||
File: sdk_init.h
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SDK_INIT_H_
|
||||
#define SDK_INIT_H_
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void VBlankIntr(void);
|
||||
|
||||
void InitSystem(void);
|
||||
void InitVRAM(void);
|
||||
void InitDisplay(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
// SDK_INIT_H_
|
||||
#endif
|
93
add-ins/TwlSystem/build/demos/fnd/archive2/src/main.c
Executable file
93
add-ins/TwlSystem/build/demos/fnd/archive2/src/main.c
Executable file
@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive2
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
#include "nns_util.h"
|
||||
|
||||
// アーカイブのインデックス定義ファイル
|
||||
#include "picture.naix"
|
||||
|
||||
|
||||
static void LoadPicture(void);
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Name: NitroMain
|
||||
|
||||
Description: 圧縮されたアーカイブからBGデータを読み込み、画面を表示す
|
||||
るサンプルプログラムです。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
NitroMain(void)
|
||||
{
|
||||
InitSystem();
|
||||
InitMemory();
|
||||
InitVRAM();
|
||||
|
||||
InitDisplay();
|
||||
LoadPicture();
|
||||
G2_SetBG0Offset(0,20);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
SVC_WaitVBlankIntr();
|
||||
ReadGamePad();
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadPicture
|
||||
|
||||
Description: 圧縮されたアーカイブを1つロードし、その中に格納されている
|
||||
キャラクタ、カラーパレット、スクリーンの各データをVRAMに転送
|
||||
します。
|
||||
|
||||
各データをVRAMに転送した後、アーカイブを削除します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
LoadPicture(void)
|
||||
{
|
||||
NNSFndArchive* archive;
|
||||
|
||||
// 圧縮されたアーカイブをメインメモリに展開し、ファイルシステムにマウントします。
|
||||
// LoadCompressedArchive()内でDC_FlushRange()の呼び出しが行われています。
|
||||
// LoadCompressedArchive()は、nns_util.c内にあります。
|
||||
if ((archive = LoadCompressedArchive("PCT", "/data/picture_LZ.bin")) != NULL)
|
||||
{
|
||||
// ファイル名を指定してデータを取得。
|
||||
void* chrData = NNS_FndGetArchiveFileByName("PCT:/picture/flower/flower256.chr");
|
||||
void* scnData = NNS_FndGetArchiveFileByName("PCT:/picture/flower/flower256.scn");
|
||||
|
||||
// インデックスを指定してデータを取得。
|
||||
void* palData = NNS_FndGetArchiveFileByIndex(archive, NARC_picture_flower256_pal);
|
||||
|
||||
// データをVRAMのロード。
|
||||
GX_LoadBG0Char(chrData, 0, 0x10000);
|
||||
GX_LoadBG0Scr (scnData, 0, 0x00800);
|
||||
GX_LoadBGPltt (palData, 0, 0x00200);
|
||||
|
||||
// VRAMにデータをロードした後は、メインメモリ上のデータは不要な為、
|
||||
// アーカイブを削除します。
|
||||
// RemoveArchive()は、nns_util.c内にあります。
|
||||
RemoveArchive(archive);
|
||||
}
|
||||
}
|
182
add-ins/TwlSystem/build/demos/fnd/archive2/src/nns_util.c
Executable file
182
add-ins/TwlSystem/build/demos/fnd/archive2/src/nns_util.c
Executable file
@ -0,0 +1,182 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive2
|
||||
File: nns_util.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nns_util.h"
|
||||
|
||||
#define SYSTEM_HEAP_SIZE 64*1024
|
||||
|
||||
GamePad gGamePad; // ゲームパッド
|
||||
NNSFndHeapHandle gSysHeap; // システムヒープ (拡張ヒープを使用)
|
||||
NNSFndHeapHandle gAppHeap; // アプリケーションヒープ(拡張ヒープを使用)
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitMemory
|
||||
|
||||
Description: システムヒープとアプリケーションヒープを作成します。両ヒープ
|
||||
にはNITRO-Systemの拡張ヒープを使用しています。
|
||||
|
||||
システムヒープ用のメモリとして、SYSTEM_HEAP_SIZE分をメインア
|
||||
リーナから確保し、メインアリーナの残りを全てアプリケーション
|
||||
ヒープ用のメモリに確保しています。
|
||||
|
||||
システムヒープは、ゲームシステム等のシステムプログラムで使用
|
||||
することを想定しています。アプリケーションヒープには、ゲーム
|
||||
で使用するデータをロードする為に使用します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitMemory(void)
|
||||
{
|
||||
void* sysHeapMemory = OS_AllocFromMainArenaLo(SYSTEM_HEAP_SIZE, 16);
|
||||
|
||||
u32 arenaLow = ROUND_UP (OS_GetMainArenaLo(), 16);
|
||||
u32 arenaHigh = ROUND_DOWN(OS_GetMainArenaHi(), 16);
|
||||
u32 appHeapSize = arenaHigh - arenaLow;
|
||||
void* appHeapMemory = OS_AllocFromMainArenaLo(appHeapSize, 16);
|
||||
|
||||
gSysHeap = NNS_FndCreateExpHeap(sysHeapMemory, SYSTEM_HEAP_SIZE);
|
||||
gAppHeap = NNS_FndCreateExpHeap(appHeapMemory, appHeapSize );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: LoadCompressedArchive
|
||||
|
||||
Description: パス名で指定された圧縮されたアーカイブをメモリに展開し、
|
||||
ファイルシステムにマウントします。圧縮には、ntrcomp.exeを
|
||||
使用しています。
|
||||
|
||||
アーカイブを読み込む為のメモリと、アーカイブをマウントする為
|
||||
に必要なNNSFndArchive 構造体用のメモリは、アプリケーションヒ
|
||||
ープから確保します。
|
||||
|
||||
圧縮データは、拡張ヒープの後ろ側から確保しています。展開後
|
||||
のデータは、拡張ヒープの前側から確保しますので、圧縮データ
|
||||
解放後にフラグメンテーションが発生しません。
|
||||
|
||||
Arguments: name: アーカイブをファイルシステム上で識別する為の名前。
|
||||
path: アーカイブのパス名。
|
||||
|
||||
Returns: アーカイブのロードに成功すれば、NNSFndArchive 構造体へのポイ
|
||||
ンタを返します。失敗した場合には、NULLを返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
NNSFndArchive*
|
||||
LoadCompressedArchive(const char* name, const char* path)
|
||||
{
|
||||
FSFile file;
|
||||
u8* compData;
|
||||
NNSFndArchive* archive = NULL;
|
||||
|
||||
FS_InitFile(&file);
|
||||
if (FS_OpenFile(&file, path))
|
||||
{
|
||||
u32 fileSize = FS_GetLength(&file);
|
||||
|
||||
// 圧縮データを格納する為のメモリは、拡張ヒープの後ろから確保します。
|
||||
// (アライメントに負数を指定すると、後ろから確保します。)
|
||||
compData = NNS_FndAllocFromExpHeapEx(gAppHeap, fileSize, -16);
|
||||
|
||||
if (compData == NULL)
|
||||
{
|
||||
(void)FS_CloseFile(&file);
|
||||
return NULL;
|
||||
}
|
||||
if (FS_ReadFile(&file, compData, (s32)fileSize) != fileSize)
|
||||
{
|
||||
NNS_FndFreeToExpHeap(gAppHeap, compData);
|
||||
(void)FS_CloseFile(&file);
|
||||
return NULL;
|
||||
}
|
||||
(void)FS_CloseFile(&file);
|
||||
}
|
||||
|
||||
{
|
||||
// NNSFndArchive構造体とアーカイブデータを、一つのメモリブロックに格納します。
|
||||
u32 memorySize = ROUND_UP(sizeof(NNSFndArchive), 16) + ROUND_UP(MI_GetUncompressedSize(compData), 16);
|
||||
|
||||
// 展開後のアーカイブデータは、ヒープの前から確保します。
|
||||
u8* memory = NNS_FndAllocFromExpHeapEx(gAppHeap, memorySize, 16);
|
||||
|
||||
if (memory != NULL)
|
||||
{
|
||||
u8* binary = memory + ROUND_UP(sizeof(NNSFndArchive), 16);
|
||||
|
||||
// アーカイブを展開します
|
||||
switch (MI_GetCompressionType(compData))
|
||||
{
|
||||
case MI_COMPRESSION_LZ : MI_UncompressLZ16 (compData, binary); break;
|
||||
case MI_COMPRESSION_HUFFMAN : MI_UncompressHuffman(compData, binary); break;
|
||||
case MI_COMPRESSION_RL : MI_UncompressRL16 (compData, binary); break;
|
||||
default : SDK_ASSERT(FALSE); break;
|
||||
}
|
||||
DC_FlushRange(binary, MI_GetUncompressedSize(compData));
|
||||
|
||||
if (NNS_FndMountArchive((NNSFndArchive*)memory, name, binary))
|
||||
{
|
||||
archive = (NNSFndArchive*)memory;
|
||||
}
|
||||
else
|
||||
{
|
||||
NNS_FndFreeToExpHeap(gAppHeap, memory);
|
||||
}
|
||||
}
|
||||
// 圧縮データを解放します。
|
||||
NNS_FndFreeToExpHeap(gAppHeap, compData);
|
||||
}
|
||||
return archive;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: RemoveArchive
|
||||
|
||||
Description: 指定されたアーカイブをメモリから削除します。
|
||||
|
||||
指定されたアーカイブをファイルシステムからアンマウントし、ア
|
||||
ーカイブが読み込まれていたメモリを解放します。
|
||||
|
||||
Arguments: archive: NNSアーカイブ構造体へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
RemoveArchive(NNSFndArchive* archive)
|
||||
{
|
||||
(void)NNS_FndUnmountArchive(archive);
|
||||
NNS_FndFreeToExpHeap(gAppHeap, archive);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ReadGamePad
|
||||
|
||||
Description: キーを読み込み、トリガとリリーストリガを求めます。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void ReadGamePad(void)
|
||||
{
|
||||
u16 status = PAD_Read();
|
||||
|
||||
gGamePad.trigger = (u16)(status & (status ^ gGamePad.button));
|
||||
gGamePad.release = (u16)(gGamePad.button & (status ^ gGamePad.button));
|
||||
gGamePad.button = status;
|
||||
}
|
125
add-ins/TwlSystem/build/demos/fnd/archive2/src/sdk_init.c
Executable file
125
add-ins/TwlSystem/build/demos/fnd/archive2/src/sdk_init.c
Executable file
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - archive2
|
||||
File: sdk_init.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sdk_init.h"
|
||||
|
||||
#define DEFAULT_DMA_NUMBER MI_DMA_MAX_NUM
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
V-blank callback
|
||||
------------------------------------------------------------------------- */
|
||||
void
|
||||
VBlankIntr(void)
|
||||
{
|
||||
OS_SetIrqCheckFlag(OS_IE_V_BLANK);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitSystem
|
||||
|
||||
Description: NITROの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitSystem(void)
|
||||
{
|
||||
OS_Init();
|
||||
FX_Init();
|
||||
GX_SetPower(GX_POWER_ALL);
|
||||
GX_Init();
|
||||
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr);
|
||||
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)OS_EnableIrqMask(OS_IE_FIFO_RECV);
|
||||
(void)OS_EnableIrq();
|
||||
|
||||
FS_Init(DEFAULT_DMA_NUMBER);
|
||||
|
||||
(void)GX_VBlankIntr(TRUE); // to generate VBlank interrupt request
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitVRAM
|
||||
|
||||
Description: VRAMの初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitVRAM(void)
|
||||
{
|
||||
// 全てのバンクをLCDCに割り当てる
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
|
||||
// LCDC空間全てをクリア
|
||||
MI_CpuClearFast( (void*)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE );
|
||||
|
||||
// LCDCに割り当てられたバンクをDisable
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
MI_CpuFillFast ((void*)HW_OAM , 192, HW_OAM_SIZE ); // OAM クリア
|
||||
MI_CpuFillFast ((void*)HW_DB_OAM , 192, HW_DB_OAM_SIZE); // clear OAM
|
||||
|
||||
MI_CpuClearFast((void*)HW_PLTT , HW_PLTT_SIZE ); // パレット クリア
|
||||
MI_CpuClearFast((void*)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitDisplay
|
||||
|
||||
Description: BG0のみを表示します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
InitDisplay(void)
|
||||
{
|
||||
GX_SetBankForBG (GX_VRAM_BG_128_A ); // バンクAをBGに割り当てる
|
||||
|
||||
GX_SetBGCharOffset(GX_BGCHAROFFSET_0x00000);
|
||||
GX_SetBGScrOffset ( GX_BGSCROFFSET_0x10000);
|
||||
|
||||
GX_SetGraphicsMode(
|
||||
GX_DISPMODE_GRAPHICS, // グラフィックス表示モードにする
|
||||
GX_BGMODE_0, // BGMODEを0に設定
|
||||
GX_BG0_AS_2D); // BG0を2D表示に設定
|
||||
|
||||
GX_SetVisiblePlane(
|
||||
GX_PLANEMASK_BG0 // BG0を表示。
|
||||
);
|
||||
|
||||
G2_SetBG0Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // 256×256ドット
|
||||
GX_BG_COLORMODE_256, // 256色モード。
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース。
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース。
|
||||
GX_BG_EXTPLTT_01 // BGExtPlttスロット。
|
||||
);
|
||||
|
||||
GX_DispOn();
|
||||
}
|
42
add-ins/TwlSystem/build/demos/fnd/heap/Makefile
Executable file
42
add-ins/TwlSystem/build/demos/fnd/heap/Makefile
Executable file
@ -0,0 +1,42 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - fnd - heap
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = fnd
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
|
||||
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
#SRCDIR = # using default
|
||||
#LCFILE = # using default
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
371
add-ins/TwlSystem/build/demos/fnd/heap/src/main.c
Executable file
371
add-ins/TwlSystem/build/demos/fnd/heap/src/main.c
Executable file
@ -0,0 +1,371 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - fnd - heap
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <nitro.h>
|
||||
#include <nnsys/fnd.h>
|
||||
|
||||
#define HeapBufElementNum (4096/sizeof(u32))
|
||||
|
||||
static u32 sHeapBuf[HeapBufElementNum];
|
||||
|
||||
/*
|
||||
グループIDとサイズの合計を保持する構造体。
|
||||
|
||||
関数CalcGroupSizeForExpHeap()にて、同じグループIDのメモリブロックのサイズを
|
||||
カウントするのに使用します。
|
||||
*/
|
||||
typedef struct TGroupSize TGroupSize;
|
||||
|
||||
struct TGroupSize
|
||||
{
|
||||
u16 groupID;
|
||||
u16 padding;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CalcGroupSizeForMBlockExpHeap
|
||||
|
||||
Description: NNS_FndVisitAllocatedForExpHeap()から各メモリブロックに対して
|
||||
呼ばせる関数。
|
||||
メモリブロックのグループIDが指定されたものと一致する場合、
|
||||
メモリブロックのサイズを合計値に加えます。
|
||||
|
||||
Arguments: memBlock: メモリブロック。
|
||||
heap: 拡張ヒープへのハンドル。
|
||||
userParam: グループIDと合計値を持つ構造体へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
CalcGroupSizeForMBlockExpHeap(
|
||||
void* memBlock,
|
||||
NNSFndHeapHandle heap,
|
||||
u32 userParam
|
||||
)
|
||||
{
|
||||
#pragma unused(heap)
|
||||
|
||||
TGroupSize* pGrSize = (TGroupSize*)userParam;
|
||||
|
||||
if (NNS_FndGetGroupIDForMBlockExpHeap(memBlock) == pGrSize->groupID)
|
||||
{
|
||||
pGrSize->size += NNS_FndGetSizeForMBlockExpHeap(memBlock);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CalcGroupSizeForExpHeap
|
||||
|
||||
Description: 拡張ヒープのメモリブロックの中で、指定したグループIDを持つ
|
||||
メモリブロックのサイズを合計します。
|
||||
|
||||
Arguments: heap: 拡張ヒープのハンドル。
|
||||
|
||||
Returns: 指定したグループIDを持つメモリブロックのサイズの合計値が返ります。。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static u32
|
||||
CalcGroupSizeForExpHeap(
|
||||
NNSFndHeapHandle heap,
|
||||
u16 groupID
|
||||
)
|
||||
{
|
||||
TGroupSize groupSize;
|
||||
|
||||
groupSize.groupID = groupID;
|
||||
groupSize.size = 0;
|
||||
|
||||
NNS_FndVisitAllocatedForExpHeap(
|
||||
heap,
|
||||
CalcGroupSizeForMBlockExpHeap,
|
||||
(u32)&groupSize);
|
||||
|
||||
return groupSize.size;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: FreeDirForMBlockExpHeap
|
||||
|
||||
Description: NNS_FndVisitAllocatedForExpHeap()から各メモリブロックに対して
|
||||
呼ばせる関数。
|
||||
メモリブロックの確保された方向が、userParamで指定した値と同じなら
|
||||
解放します。
|
||||
|
||||
Arguments: memBlock: メモリブロック。
|
||||
heap: 拡張ヒープのハンドル。
|
||||
userParam: メモリブロックの確保方向。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
FreeDirForMBlockExpHeap(
|
||||
void* memBlock,
|
||||
NNSFndHeapHandle heap,
|
||||
u32 userParam
|
||||
)
|
||||
{
|
||||
if (NNS_FndGetAllocDirForMBlockExpHeap(memBlock) == userParam)
|
||||
{
|
||||
NNS_FndFreeToExpHeap(heap, memBlock);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: FreeTailForExpHeap
|
||||
|
||||
Description: 拡張ヒープ領域の後方から確保したメモリブロックを全て解放します。
|
||||
|
||||
Arguments: heap: 拡張ヒープのハンドル。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
FreeTailForExpHeap(NNSFndHeapHandle heap)
|
||||
{
|
||||
NNS_FndVisitAllocatedForExpHeap(
|
||||
heap,
|
||||
FreeDirForMBlockExpHeap,
|
||||
NNS_FND_EXPHEAP_ALLOC_DIR_REAR);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleExpHeap
|
||||
|
||||
Description: 拡張ヒープのサンプルです。
|
||||
|
||||
Arguments: heapAddress: ヒープに割り当てるメモリの先頭アドレス。
|
||||
heapSize: ヒープに割り当てるメモリのサイズ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
SampleExpHeap(
|
||||
void* heapAddress,
|
||||
u32 heapSize)
|
||||
{
|
||||
void* pMBlocks[4];
|
||||
|
||||
// 拡張ヒープの作成
|
||||
NNSFndHeapHandle hExpHeap = NNS_FndCreateExpHeap(heapAddress, heapSize);
|
||||
|
||||
// 通常のメモリブロック確保
|
||||
pMBlocks[0] = NNS_FndAllocFromExpHeap(hExpHeap, 100);
|
||||
|
||||
// ヒープ領域の後方から確保。アライメントはデフォルト値 4。
|
||||
pMBlocks[2] = NNS_FndAllocFromExpHeapEx(hExpHeap, 100, -NNS_FND_HEAP_DEFAULT_ALIGNMENT);
|
||||
|
||||
// グループID を 1 に変更
|
||||
(void)NNS_FndSetGroupIDForExpHeap(hExpHeap, 1);
|
||||
|
||||
// メモリブロック確保。アライメントは 16。
|
||||
pMBlocks[1] = NNS_FndAllocFromExpHeapEx(hExpHeap, 200, 16);
|
||||
|
||||
// ヒープ領域の後方から確保。アライメントは 16。
|
||||
pMBlocks[3] = NNS_FndAllocFromExpHeapEx(hExpHeap, 200, -16);
|
||||
|
||||
NNS_FndDumpHeap(hExpHeap);
|
||||
|
||||
// グループ 0 のメモリブロックのサイズの合計値を求める。
|
||||
OS_Printf("[demo exp heap] group 0 size %d\n", CalcGroupSizeForExpHeap(hExpHeap, 0));
|
||||
|
||||
// グループ 1 のメモリブロックのサイズの合計値を求める。
|
||||
OS_Printf("[demo exp heap] group 1 size %d\n", CalcGroupSizeForExpHeap(hExpHeap, 1));
|
||||
|
||||
OS_Printf("\n");
|
||||
|
||||
// メモリブロックの拡張 100 -> 300
|
||||
(void)NNS_FndResizeForMBlockExpHeap(hExpHeap, pMBlocks[1], 300);
|
||||
|
||||
// ヒープ領域の後方から確保したメモリブロックを解放
|
||||
FreeTailForExpHeap(hExpHeap);
|
||||
|
||||
NNS_FndDumpHeap(hExpHeap);
|
||||
|
||||
// 拡張ヒープの破棄
|
||||
NNS_FndDestroyExpHeap(hExpHeap);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleFrameHeap
|
||||
|
||||
Description: フレームヒープのサンプルです。
|
||||
|
||||
Arguments: heapAddress: ヒープに割り当てるメモリの先頭アドレス。
|
||||
heapSize: ヒープに割り当てるメモリのサイズ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
SampleFrameHeap(
|
||||
void* heapAddress,
|
||||
u32 heapSize)
|
||||
{
|
||||
void* pExpMBlock;
|
||||
void* pMBlocks[8];
|
||||
NNSFndHeapHandle hExpHeap;
|
||||
NNSFndHeapHandle hFrmHeap;
|
||||
u32 frmHeapSize;
|
||||
|
||||
/*
|
||||
一旦拡張ヒープを作り、その中にフレームヒープを作ります。
|
||||
*/
|
||||
// 拡張ヒープの作成
|
||||
hExpHeap = NNS_FndCreateExpHeap(heapAddress, heapSize);
|
||||
|
||||
// 確保可能サイズ全てを占有するメモリブロックを作る
|
||||
pExpMBlock = NNS_FndAllocFromExpHeap(
|
||||
hExpHeap,
|
||||
NNS_FndGetAllocatableSizeForExpHeap(hExpHeap));
|
||||
|
||||
// フレームヒープの作成
|
||||
hFrmHeap = NNS_FndCreateFrmHeap(
|
||||
pExpMBlock,
|
||||
NNS_FndGetSizeForMBlockExpHeap(pExpMBlock));
|
||||
|
||||
/*
|
||||
メモリブロックの確保、状態の保存、復帰を行います。
|
||||
*/
|
||||
// 通常のメモリブロック確保
|
||||
pMBlocks[0] = NNS_FndAllocFromFrmHeap(hFrmHeap, 100);
|
||||
|
||||
// ヒープ領域の後方から確保。アライメントはデフォルト値 4。
|
||||
pMBlocks[1] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 100, -NNS_FND_HEAP_DEFAULT_ALIGNMENT);
|
||||
|
||||
// メモリブロック確保状態の保存。タグは'FRST'。
|
||||
(void)NNS_FndRecordStateForFrmHeap(hFrmHeap, 'FRST');
|
||||
|
||||
// メモリブロックを前方と後方から確保。アライメントは 8。
|
||||
pMBlocks[2] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 200, 8);
|
||||
pMBlocks[3] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 200, -8);
|
||||
|
||||
// メモリブロック確保状態の保存。タグは'SCND'。
|
||||
(void)NNS_FndRecordStateForFrmHeap(hFrmHeap, 'SCND');
|
||||
|
||||
// メモリブロックを前方と後方から確保。アライメントは 16。
|
||||
pMBlocks[4] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 300, 16);
|
||||
pMBlocks[5] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 300, -16);
|
||||
|
||||
// メモリブロック確保状態の保存。タグは'THRD'。
|
||||
(void)NNS_FndRecordStateForFrmHeap(hFrmHeap, 'THRD');
|
||||
|
||||
// メモリブロックを前方と後方から確保。アライメントは 32。
|
||||
pMBlocks[6] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 300, 32);
|
||||
pMBlocks[7] = NNS_FndAllocFromFrmHeapEx(hFrmHeap, 300, -32);
|
||||
|
||||
NNS_FndDumpHeap(hFrmHeap);
|
||||
|
||||
// タグを指定して、状態復帰
|
||||
(void)NNS_FndFreeByStateToFrmHeap(hFrmHeap, 'SCND');
|
||||
|
||||
NNS_FndDumpHeap(hFrmHeap);
|
||||
|
||||
// タグを指定しないで、状態復帰('FRST'の状態へ復帰)
|
||||
(void)NNS_FndFreeByStateToFrmHeap(hFrmHeap, 0);
|
||||
|
||||
NNS_FndDumpHeap(hFrmHeap);
|
||||
|
||||
/*
|
||||
ヒープ領域の後方から確保したメモリブロックを解放し、フレームヒープ領域を縮小します。
|
||||
*/
|
||||
// ヒープの後方から確保したメモリブロックを解放
|
||||
(void)NNS_FndFreeToFrmHeap(hFrmHeap, NNS_FND_FRMHEAP_FREE_TAIL);
|
||||
|
||||
// フレームヒープを縮小
|
||||
frmHeapSize = NNS_FndAdjustFrmHeap(hFrmHeap);
|
||||
|
||||
// フレームヒープの縮小にあわせて、拡張ヒープのメモリブロックを縮小します。
|
||||
(void)NNS_FndResizeForMBlockExpHeap(hExpHeap, pExpMBlock, frmHeapSize);
|
||||
|
||||
// メモリブロックを保持するヒープを取得し、dumpします。
|
||||
// (フレームヒープ:hFrmHeapの内容が表示されます。)
|
||||
NNS_FndDumpHeap(NNS_FndFindContainHeap(pMBlocks[0]));
|
||||
|
||||
// 拡張ヒープをDumpします。
|
||||
NNS_FndDumpHeap(hExpHeap);
|
||||
|
||||
/*
|
||||
後始末
|
||||
*/
|
||||
// フレームヒープの破棄
|
||||
NNS_FndDestroyFrmHeap(hFrmHeap);
|
||||
|
||||
// 拡張ヒープの破棄
|
||||
NNS_FndDestroyExpHeap(hExpHeap);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleUnitHeap
|
||||
|
||||
Description: ユニットヒープのサンプルです。
|
||||
|
||||
Arguments: heapAddress: ヒープに割り当てるメモリの先頭アドレス。
|
||||
heapSize: ヒープに割り当てるメモリのサイズ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
SampleUnitHeap(
|
||||
void* heapAddress,
|
||||
u32 heapSize)
|
||||
{
|
||||
void* pMBlocks[4];
|
||||
|
||||
// ユニットヒープの作成
|
||||
NNSFndHeapHandle hUnitHeap = NNS_FndCreateUnitHeapEx(
|
||||
heapAddress,
|
||||
heapSize,
|
||||
64, // メモリブロックのサイズ
|
||||
16, // アライメント
|
||||
0); // オプション
|
||||
|
||||
// 確保可能なメモリブロックの個数を表示
|
||||
OS_Printf("[demo unit heap] free block num %d.\n", NNS_FndCountFreeBlockForUnitHeap(hUnitHeap));
|
||||
|
||||
// メモリブロック確保
|
||||
pMBlocks[0] = NNS_FndAllocFromUnitHeap(hUnitHeap);
|
||||
pMBlocks[1] = NNS_FndAllocFromUnitHeap(hUnitHeap);
|
||||
pMBlocks[2] = NNS_FndAllocFromUnitHeap(hUnitHeap);
|
||||
pMBlocks[3] = NNS_FndAllocFromUnitHeap(hUnitHeap);
|
||||
|
||||
// 3番目のメモリブロックを解放
|
||||
NNS_FndFreeToUnitHeap(hUnitHeap, pMBlocks[2]);
|
||||
|
||||
// 確保可能なメモリブロックの個数を表示
|
||||
OS_Printf("[demo unit heap] free block num %d.\n", NNS_FndCountFreeBlockForUnitHeap(hUnitHeap));
|
||||
|
||||
NNS_FndDumpHeap(hUnitHeap);
|
||||
|
||||
// ユニットヒープの破棄
|
||||
NNS_FndDestroyUnitHeap(hUnitHeap);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
NitroMain(void)
|
||||
{
|
||||
OS_Init();
|
||||
|
||||
SampleExpHeap(sHeapBuf, sizeof sHeapBuf);
|
||||
SampleFrameHeap(sHeapBuf, sizeof sHeapBuf);
|
||||
SampleUnitHeap(sHeapBuf, sizeof sHeapBuf);
|
||||
|
||||
while(1) {}
|
||||
}
|
34
add-ins/TwlSystem/build/demos/g2d/Makefile
Executable file
34
add-ins/TwlSystem/build/demos/g2d/Makefile
Executable file
@ -0,0 +1,34 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = \
|
||||
demolib \
|
||||
samples \
|
||||
bg \
|
||||
Text \
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
44
add-ins/TwlSystem/build/demos/g2d/Text/BGAffine/Makefile
Executable file
44
add-ins/TwlSystem/build/demos/g2d/Text/BGAffine/Makefile
Executable file
@ -0,0 +1,44 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - BGAffine
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
318
add-ins/TwlSystem/build/demos/g2d/Text/BGAffine/src/main.c
Executable file
318
add-ins/TwlSystem/build/demos/g2d/Text/BGAffine/src/main.c
Executable file
@ -0,0 +1,318 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - BGAffine
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// Affine BG での文字列表示サンプル(256色モード)
|
||||
// Affine BG では256キャラクタしか使用できないので、
|
||||
// このデモでは全ての文字を表示するのに十分なサイズの CharCanvas を
|
||||
// 作成できていません。
|
||||
//
|
||||
// 操作方法
|
||||
// 操作なし。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
// Affine BG では256キャラクタしか使えない事に注意しなければなりません
|
||||
// これは CANVAS*_WIDTH * CANVAS*_HEIGHT の和が 256以下でなければならない事を意味します。
|
||||
|
||||
#define CANVAS0_WIDTH 10 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS0_HEIGHT 5 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS0_LEFT 1 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS0_TOP 1 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define CANVAS1_WIDTH 20 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS1_HEIGHT 6 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS1_LEFT 3 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS1_TOP 15 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define CANVAS2_WIDTH 10 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS2_HEIGHT 6 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS2_LEFT 15 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS2_TOP 3 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE0 4 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE0 4 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define TEXT_HSPACE1 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE1 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas[3]; // CharCanvas x3
|
||||
NNSG2dTextCanvas gTextCanvas[3]; // TextCanvas x3
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 2 を設定
|
||||
G2_SetBG2ControlAffine(
|
||||
GX_BG_SCRSIZE_AFFINE_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_AREAOVER_XLU, // 外領域 透明
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000 // キャラクタベース
|
||||
);
|
||||
|
||||
// BG2 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG2 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
// BGキャラクタベースへのポインタ
|
||||
GXCharFmt256* pCharBase = (GXCharFmt256*)G2_GetBG2CharPtr();
|
||||
// BGスクリーンベースへのポインタ
|
||||
GXScrAffine32x32* pScr = (GXScrAffine32x32*)G2_GetBG1ScrPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
// CharCanvas の初期化と BG スクリーンの設定
|
||||
// CharCanvas 0
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[0], // CharCanvasへのポインタ
|
||||
pCharBase + cOffset, // 使用するキャラクタ列先頭へのポインタ
|
||||
CANVAS0_WIDTH, // CharCanvas幅
|
||||
CANVAS0_HEIGHT, // CharCanvas高さ
|
||||
NNS_G2D_CHARA_COLORMODE_256 // カラーモード
|
||||
);
|
||||
NNS_G2dMapScrToCharAffine(
|
||||
&( pScr->scr[CANVAS0_TOP][CANVAS0_LEFT] ), // CharCanvas表示位置のスクリーンへのポインタ
|
||||
CANVAS0_WIDTH, // CharCanvas幅
|
||||
CANVAS0_HEIGHT, // CharCanvas高さ
|
||||
NNS_G2D_AFFINE_BG_WIDTH_256, // スクリーン幅
|
||||
cOffset // 使用するキャラクタ列先頭のキャラクタ番号
|
||||
);
|
||||
|
||||
// CharCanvas 0 が使う分のキャラクタ数をオフセットに加算
|
||||
cOffset += CANVAS0_WIDTH * CANVAS0_HEIGHT;
|
||||
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[1],
|
||||
pCharBase + cOffset,
|
||||
CANVAS1_WIDTH,
|
||||
CANVAS1_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_256
|
||||
);
|
||||
NNS_G2dMapScrToCharAffine(
|
||||
&( pScr->scr[CANVAS1_TOP][CANVAS1_LEFT] ),
|
||||
CANVAS1_WIDTH,
|
||||
CANVAS1_HEIGHT,
|
||||
NNS_G2D_AFFINE_BG_WIDTH_256,
|
||||
cOffset
|
||||
);
|
||||
|
||||
// CharCanvas 1 が使う分のキャラクタ数をオフセットに加算
|
||||
cOffset += CANVAS1_WIDTH * CANVAS1_HEIGHT;
|
||||
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[2],
|
||||
pCharBase + cOffset,
|
||||
CANVAS2_WIDTH,
|
||||
CANVAS2_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_256
|
||||
);
|
||||
NNS_G2dMapScrToCharAffine(
|
||||
&( pScr->scr[CANVAS2_TOP][CANVAS2_LEFT] ),
|
||||
CANVAS2_WIDTH,
|
||||
CANVAS2_HEIGHT,
|
||||
NNS_G2D_AFFINE_BG_WIDTH_256,
|
||||
cOffset
|
||||
);
|
||||
|
||||
// TextCanvas の初期化
|
||||
// CharCanvas 毎に TextCanvas を用意することもできますし、
|
||||
// 複数の TextCanvas で1つの CharCanvas を共有する事もできます。
|
||||
// 複数の CharCanvas を1つの TextCanvas で使う場合は
|
||||
// TextCanvas の CharCanvas を置き換えながら使う事になります。
|
||||
|
||||
// 1) 複数の TextCanvas で1つの CharCanvas を共有
|
||||
// CharCanvas 1 を TextCanvas 0, 1 で共有
|
||||
{
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[0], // TextCanvasへのポインタ
|
||||
&gCanvas[1], // 描画先のCharCanvasへのポインタ
|
||||
&gFont, // 描画に用いるフォントへのポインタ
|
||||
TEXT_HSPACE0, // 文字間
|
||||
TEXT_VSPACE0 // 行間
|
||||
);
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[1],
|
||||
&gCanvas[1],
|
||||
&gFont,
|
||||
TEXT_HSPACE1,
|
||||
TEXT_VSPACE1
|
||||
);
|
||||
}
|
||||
|
||||
// 2) CharCanvas 毎に TextCanvas を用意
|
||||
// CharCanvas 2 を TextCanvas 2 単独で使用
|
||||
{
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[2],
|
||||
&gCanvas[2],
|
||||
&gFont,
|
||||
TEXT_HSPACE0,
|
||||
TEXT_VSPACE0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
// それぞれの CharCanvas を TXT_COLOR_WHITE で塗りつぶし
|
||||
NNS_G2dCharCanvasClear(&gCanvas[0], TXT_COLOR_WHITE);
|
||||
NNS_G2dCharCanvasClear(&gCanvas[1], TXT_COLOR_WHITE);
|
||||
NNS_G2dCharCanvasClear(&gCanvas[2], TXT_COLOR_WHITE);
|
||||
|
||||
// 文字列描画
|
||||
// TextCanvas 0 (->CharCanvas 1) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[0], 0, 0, TXT_COLOR_CYAN, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas0 CharCanvas1\n"
|
||||
"abcdefg"
|
||||
);
|
||||
|
||||
// TextCanvas 1 (->CharCanvas 1) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[1], 0, 30, TXT_COLOR_MAGENTA, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas1 CharCanvas1\n"
|
||||
"hijklmn"
|
||||
);
|
||||
|
||||
// TextCanvas 2 (->CharCanvas 2) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[2], 0, 0, TXT_COLOR_GREEN, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas2\n"
|
||||
"CharCanvas2\n"
|
||||
"opqrstu"
|
||||
);
|
||||
|
||||
|
||||
// 3) 複数の CharCanvas を1つの TextCanvas で使う
|
||||
{
|
||||
// TextCanvas 1 の CharCanvas を入れ替え
|
||||
NNS_G2dTextCanvasSetCharCanvas(&gTextCanvas[1], &gCanvas[0]);
|
||||
|
||||
// TextCanvas 1 (->CharCanvas 0) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[1], 0, 0, TXT_COLOR_BLUE, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas1\n"
|
||||
"CharCanvas0\n"
|
||||
"vwxyz"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/BGText/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/BGText/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - BGText
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
325
add-ins/TwlSystem/build/demos/g2d/Text/BGText/src/main.c
Executable file
325
add-ins/TwlSystem/build/demos/g2d/Text/BGText/src/main.c
Executable file
@ -0,0 +1,325 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - BGText
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// TEXT BG での文字列表示サンプル(16色モード)
|
||||
// アフィン拡張BGも TEXT BG と同様にして表示する事が出来ます。
|
||||
//
|
||||
// 操作方法
|
||||
// 操作なし。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
// TEXT BG 及びアフィン拡張BGでは 1024 キャラクタまで使用できます。
|
||||
|
||||
#define CANVAS0_WIDTH 10 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS0_HEIGHT 5 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS0_LEFT 1 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS0_TOP 1 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define CANVAS1_WIDTH 25 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS1_HEIGHT 8 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS1_LEFT 3 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS1_TOP 15 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define CANVAS2_WIDTH 15 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS2_HEIGHT 10 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS2_LEFT 15 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS2_TOP 3 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE0 4 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE0 4 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define TEXT_HSPACE1 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE1 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
static NNSG2dFont gFont; // フォント
|
||||
static NNSG2dCharCanvas gCanvas[3]; // CharCanvas x3
|
||||
static NNSG2dTextCanvas gTextCanvas[3]; // TextCanvas x3
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
// BGキャラクタベースへのポインタ
|
||||
GXCharFmt16* const pCharBase = (GXCharFmt16*)G2_GetBG1CharPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
// CharCanvas の初期化と BG スクリーンの設定
|
||||
// CharCanvas 0
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[0], // CharCanvasへのポインタ
|
||||
pCharBase + cOffset, // 使用するキャラクタ列先頭へのポインタ
|
||||
CANVAS0_WIDTH, // CharCanvas幅
|
||||
CANVAS0_HEIGHT, // CharCanvas高さ
|
||||
NNS_G2D_CHARA_COLORMODE_16 // カラーモード
|
||||
);
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(), // スクリーンベースへのポインタ
|
||||
CANVAS0_WIDTH, // CharCanvas幅
|
||||
CANVAS0_HEIGHT, // CharCanvas高さ
|
||||
CANVAS0_LEFT, // CharCanvas表示位置
|
||||
CANVAS0_TOP, // CharCanvas表示位置
|
||||
NNS_G2D_TEXT_BG_WIDTH_256, // スクリーン幅
|
||||
cOffset, // 使用するキャラクタ列先頭のキャラクタ番号
|
||||
TXT_CPALETTE_MAIN // カラーパレット番号
|
||||
);
|
||||
|
||||
// CharCanvas 0 が使う分のキャラクタ数をオフセットに加算
|
||||
cOffset += CANVAS0_WIDTH * CANVAS0_HEIGHT;
|
||||
|
||||
// CharCanvas 1
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[1],
|
||||
pCharBase + cOffset,
|
||||
CANVAS1_WIDTH,
|
||||
CANVAS1_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS1_WIDTH,
|
||||
CANVAS1_HEIGHT,
|
||||
CANVAS1_LEFT,
|
||||
CANVAS1_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
cOffset,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
|
||||
// CharCanvas 1 が使う分のキャラクタ数をオフセットに加算
|
||||
cOffset += CANVAS1_WIDTH * CANVAS1_HEIGHT;
|
||||
|
||||
// CharCanvas 2
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas[2],
|
||||
pCharBase + cOffset,
|
||||
CANVAS2_WIDTH,
|
||||
CANVAS2_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS2_WIDTH,
|
||||
CANVAS2_HEIGHT,
|
||||
CANVAS2_LEFT,
|
||||
CANVAS2_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
cOffset,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
|
||||
// TextCanvas の初期化
|
||||
// CharCanvas 毎に TextCanvas を用意することもできますし、
|
||||
// 複数の TextCanvas で1つの CharCanvas を共有する事もできます。
|
||||
// 複数の CharCanvas を1つの TextCanvas で使う場合は
|
||||
// TextCanvas の CharCanvas を置き換えながら使う事になります。
|
||||
|
||||
// 1) 複数の TextCanvas で1つの CharCanvas を共有
|
||||
// CharCanvas 1 を TextCanvas 0, 1 で共有
|
||||
{
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[0], // TextCanvasへのポインタ
|
||||
&gCanvas[1], // 描画先のCharCanvasへのポインタ
|
||||
&gFont, // 描画に用いるフォントへのポインタ
|
||||
TEXT_HSPACE0, // 文字間
|
||||
TEXT_VSPACE0 // 行間
|
||||
);
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[1],
|
||||
&gCanvas[1],
|
||||
&gFont,
|
||||
TEXT_HSPACE1,
|
||||
TEXT_VSPACE1
|
||||
);
|
||||
}
|
||||
|
||||
// 2) CharCanvas 毎に TextCanvas を用意
|
||||
// CharCanvas 2 を TextCanvas 2 単独で使用
|
||||
{
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas[2],
|
||||
&gCanvas[2],
|
||||
&gFont,
|
||||
TEXT_HSPACE0,
|
||||
TEXT_VSPACE0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
// それぞれの CharCanvas を TXT_COLOR_WHITE で塗りつぶし
|
||||
NNS_G2dCharCanvasClear(&gCanvas[0], TXT_COLOR_WHITE);
|
||||
NNS_G2dCharCanvasClear(&gCanvas[1], TXT_COLOR_WHITE);
|
||||
NNS_G2dCharCanvasClear(&gCanvas[2], TXT_COLOR_WHITE);
|
||||
|
||||
// 文字列描画
|
||||
// TextCanvas 0 (->CharCanvas 1) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[0], 0, 0, TXT_COLOR_CYAN, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas0 CharCanvas1\n"
|
||||
"abcdefg"
|
||||
);
|
||||
|
||||
// TextCanvas 1 (->CharCanvas 1) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[1], 0, 30, TXT_COLOR_MAGENTA, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas1 CharCanvas1\n"
|
||||
"hijklmn"
|
||||
);
|
||||
|
||||
// TextCanvas 2 (->CharCanvas 2) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[2], 0, 0, TXT_COLOR_GREEN, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas2\n"
|
||||
"CharCanvas2\n"
|
||||
"opqrstu"
|
||||
);
|
||||
|
||||
|
||||
// 3) 複数の CharCanvas を1つの TextCanvas で使う
|
||||
{
|
||||
// TextCanvas 1 の CharCanvas を入れ替え
|
||||
NNS_G2dTextCanvasSetCharCanvas(&gTextCanvas[1], &gCanvas[0]);
|
||||
|
||||
// TextCanvas 1 (->CharCanvas 0) に描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas[1], 0, 0, TXT_COLOR_BLUE, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"TextCanvas1\n"
|
||||
"CharCanvas0\n"
|
||||
"vwxyz"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/CP1252Text/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/CP1252Text/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - CP1252Text
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
219
add-ins/TwlSystem/build/demos/g2d/Text/CP1252Text/src/main.c
Executable file
219
add-ins/TwlSystem/build/demos/g2d/Text/CP1252Text/src/main.c
Executable file
@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - CP1252Text
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// CP1252 文字列の表示方法サンプル。
|
||||
//
|
||||
// 操作方法
|
||||
// なし。
|
||||
// ============================================================================
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 22 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 16 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 5 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 4 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
GXCharFmt16* pCharBase = (GXCharFmt16*)G2_GetBG1CharPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// フォントを読み込みます
|
||||
{
|
||||
// 他のデモと同じように TXT_LoadFont を使ってもフォントを読み込めます。
|
||||
// このデモでは NNS_G2dFontInitCP1252 を使う場合を示しています。
|
||||
// TXT_LoadFont( &gFont, TXT_CP1252_FONTRESOURCE_NAME );
|
||||
|
||||
void* pFontFile;
|
||||
u32 size;
|
||||
|
||||
size = TXT_LoadFile( &pFontFile, TXT_CP1252_FONTRESOURCE_NAME );
|
||||
NNS_G2D_ASSERT( size > 0 );
|
||||
|
||||
NNS_G2dFontInitCP1252(&gFont, pFontFile);
|
||||
NNS_G2dPrintFont(&gFont);
|
||||
}
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas,
|
||||
pCharBase + cOffset,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvasの初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
CHARACTER_OFFSET,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 0, 0,
|
||||
TXT_COLOR_BLACK, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"CP1252\n"
|
||||
"0123456789\n" // <- 数字
|
||||
"abcdefg ABCDEFG\n" // <- アルファベット
|
||||
"\xE0\xE1\xE2\xE3\xE4\xE5\n" // <- 欧州文字
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/CanvasCell/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/CanvasCell/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - CanvasCell
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
492
add-ins/TwlSystem/build/demos/g2d/Text/CanvasCell/src/main.c
Executable file
492
add-ins/TwlSystem/build/demos/g2d/Text/CanvasCell/src/main.c
Executable file
@ -0,0 +1,492 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - CanvasCell
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 1DマッピングOBJ用に構築されたCharCanvasをセルとして表示します
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include <nnsys/g2d/g2d_Renderer.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
#define SCREEN_WIDTH 256
|
||||
#define SCREEN_HEIGHT 192
|
||||
|
||||
#define CANVAS_WIDTH 6 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 4 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 13 // 文字描画域の位置X (ピクセル単位)
|
||||
#define CANVAS_TOP 17 // 文字描画域の位置Y (ピクセル単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の先頭キャラクタネーム
|
||||
//
|
||||
|
||||
#define MAX_OBJ_NUM 128
|
||||
#define REPEAT_THRESHOLD 22
|
||||
|
||||
#define CHARACTER_WIDTH 8
|
||||
#define CHARACTER_HEIGHT 8
|
||||
|
||||
#define NUM_OF_OAM 128 // OAM マネージャに割り当てる OAM の数
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
NNSG2dRendererInstance gRenderer;
|
||||
NNSG2dRenderSurface gSurface;
|
||||
NNSG2dImageProxy gImageProxy;
|
||||
NNSG2dImagePaletteProxy gPaletteProxy;
|
||||
NNSG2dOamManagerInstance gOamManager;
|
||||
|
||||
NNSG2dCellData* gpCanvasCell;
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// レンダラ関連の処理
|
||||
//****************************************************************************
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CallBackAddOam
|
||||
|
||||
Description: NNS_G2dDraw* 関数内部で OAM を追加するために呼ばれる関数です。
|
||||
|
||||
Arguments: pOam: 追加すべき OAM へのポインタ。
|
||||
affineIndex: この OAM が使用する Affine インデックス。
|
||||
32 以上の値である可能性があります。
|
||||
Affine を未使用の場合は
|
||||
NNS_G2D_OAM_AFFINE_IDX_NONE を指定します。
|
||||
bDoubleAffine: 倍角Affineモードかどうか。
|
||||
|
||||
Returns: 成功した場合は TRUE、そうでなければ FALSE を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL CallBackAddOam( const GXOamAttr* pOam, u16 affineIndex, BOOL bDoubleAffine )
|
||||
{
|
||||
#pragma unused( bDoubleAffine )
|
||||
SDK_NULL_ASSERT( pOam );
|
||||
|
||||
return NNS_G2dEntryOamManagerOamWithAffineIdx( &gOamManager, pOam, affineIndex );
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: CallBackAddAffine
|
||||
|
||||
Description: NNS_G2dDraw* 関数内部で Affine パラメータ を追加するために
|
||||
呼ばれる関数です。
|
||||
|
||||
Arguments: mtx: 追加すべき Affine 変換行列へのポインタ
|
||||
|
||||
Returns: 追加した Affine パラメータを参照するための AffineIndex を
|
||||
返します。。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static u16 CallBackAddAffine( const MtxFx22* mtx )
|
||||
{
|
||||
SDK_NULL_ASSERT( mtx );
|
||||
return NNS_G2dEntryOamManagerAffine( &gOamManager, mtx );
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitOamManager
|
||||
|
||||
Description: OAM マネージャシステムの初期化と、1つのOAMマネージャ
|
||||
実体の初期化を行います。
|
||||
|
||||
Arguments: pOamManager: 初期化する OAM マネージャへのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitOamManager(NNSG2dOamManagerInstance* pOamManager)
|
||||
{
|
||||
BOOL result;
|
||||
SDK_NULL_ASSERT( pOamManager );
|
||||
|
||||
NNS_G2dInitOamManagerModule();
|
||||
|
||||
result = NNS_G2dGetNewOamManagerInstance(
|
||||
pOamManager,
|
||||
0, NUM_OF_OAM,
|
||||
0, NUM_OF_OAM/4,
|
||||
NNS_G2D_OAMTYPE_MAIN
|
||||
);
|
||||
SDK_ASSERT( result );
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitRenderer
|
||||
|
||||
Description: Renderer と Surface を初期化します。
|
||||
|
||||
Arguments: pRenderer: 初期化する Renderer へのポインタ。
|
||||
pSurface: 初期化する Surface へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitRenderer(
|
||||
NNSG2dRendererInstance* pRenderer,
|
||||
NNSG2dRenderSurface* pSurface,
|
||||
NNSG2dImageProxy* pImageProxy,
|
||||
NNSG2dImagePaletteProxy* pPaletteProxy
|
||||
)
|
||||
{
|
||||
NNSG2dViewRect* pRect;
|
||||
|
||||
SDK_NULL_ASSERT( pImageProxy );
|
||||
SDK_NULL_ASSERT( pPaletteProxy );
|
||||
SDK_NULL_ASSERT( pRenderer );
|
||||
SDK_NULL_ASSERT( pSurface );
|
||||
|
||||
//---- ImageProxy をダミーアドレスで初期化
|
||||
NNS_G2dInitImageProxy( pImageProxy );
|
||||
NNS_G2dSetImageLocation( pImageProxy, NNS_G2D_VRAM_TYPE_2DMAIN, NULL );
|
||||
|
||||
//---- PaletteProxy ダミーアドレスで初期化
|
||||
NNS_G2dInitImagePaletteProxy( pPaletteProxy );
|
||||
NNS_G2dSetImagePaletteLocation( pPaletteProxy, NNS_G2D_VRAM_TYPE_2DMAIN, NULL );
|
||||
|
||||
//---- サーフェスを初期化
|
||||
NNS_G2dInitRenderSurface( pSurface );
|
||||
pRect = &(pSurface->viewRect);
|
||||
|
||||
pRect->posTopLeft.x = FX32_ONE * 0;
|
||||
pRect->posTopLeft.y = FX32_ONE * 0;
|
||||
pRect->sizeView.x = FX32_ONE * SCREEN_WIDTH;
|
||||
pRect->sizeView.y = FX32_ONE * SCREEN_HEIGHT;
|
||||
|
||||
pSurface->pFuncOamRegister = CallBackAddOam;
|
||||
pSurface->pFuncOamAffineRegister = CallBackAddAffine;
|
||||
pSurface->type = NNS_G2D_SURFACETYPE_MAIN2D;
|
||||
|
||||
//---- レンダラを初期化
|
||||
NNS_G2dInitRenderer( pRenderer );
|
||||
NNS_G2dAddRendererTargetSurface( pRenderer, pSurface );
|
||||
NNS_G2dSetRendererImageProxy( pRenderer, pImageProxy, pPaletteProxy );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: OBJ表示の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// マッピングモード設定 1D 256 KB
|
||||
GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_256K);
|
||||
|
||||
// OBJ を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_OBJ );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadOBJPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
GXCharFmt16* const pCharBase = (GXCharFmt16*)G2_GetOBJCharPtr();
|
||||
GXOamAttr* const pObjBase = (GXOamAttr*)HW_OAM;
|
||||
const int cOffset = CHARACTER_OFFSET;
|
||||
const NNSG2dOBJVramMode vramMode = NNS_G2D_OBJVRAMMODE_256K;
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForOBJ1D(
|
||||
&gCanvas,
|
||||
pCharBase + (cOffset << vramMode),
|
||||
// VRAM参照可能サイズによってキャラクタネーム境界が異なるため補正する
|
||||
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvasの初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// セルを構築
|
||||
{
|
||||
//---- 回転中心を CharCanvas の中心にする
|
||||
const int x = CANVAS_WIDTH * CHARACTER_WIDTH / 2;
|
||||
const int y = CANVAS_HEIGHT * CHARACTER_HEIGHT / 2;
|
||||
const int priority = 0;
|
||||
const GXOamMode mode = GX_OAM_MODE_NORMAL;
|
||||
const BOOL mosaic = FALSE;
|
||||
const GXOamEffect effect = GX_OAM_EFFECT_AFFINE_DOUBLE;
|
||||
const GXOamColorMode color = GX_OAM_COLORMODE_16;
|
||||
const int cParam = TXT_CPALETTE_MAIN;
|
||||
const BOOL makeBR = FALSE;
|
||||
|
||||
const size_t szByte = NNS_G2dCharCanvasCalcCellDataSize1D(&gCanvas, makeBR);
|
||||
|
||||
//---- セルデータ用メモリ確保
|
||||
gpCanvasCell = (NNSG2dCellData*)TXT_Alloc(szByte);
|
||||
SDK_NULL_ASSERT( gpCanvasCell );
|
||||
|
||||
NNS_G2dCharCanvasMakeCell1D(
|
||||
gpCanvasCell,
|
||||
&gCanvas,
|
||||
x,
|
||||
y,
|
||||
priority,
|
||||
mode,
|
||||
mosaic,
|
||||
effect,
|
||||
color,
|
||||
cOffset,
|
||||
cParam,
|
||||
vramMode,
|
||||
makeBR
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleDraw
|
||||
|
||||
Description: サンプルの描画処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleDraw(void)
|
||||
{
|
||||
// Canvasクリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_NULL);
|
||||
|
||||
// 文字描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 1, 1, TXT_COLOR_BLACK, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PrintSampleInfo
|
||||
|
||||
Description: サンプルの情報をした画面に出力します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void PrintSampleInfo(void)
|
||||
{
|
||||
DTX_PrintLine(
|
||||
"1D mapping OBJ CharCanvas Cell Sample\n"
|
||||
"operation\n"
|
||||
" (none)\n"
|
||||
);
|
||||
DTX_PrintLine("canvas size character: %3d x %3d", CANVAS_WIDTH, CANVAS_HEIGHT);
|
||||
DTX_PrintLine("canvas size pixel: %3d x %3d", CANVAS_WIDTH * 8, CANVAS_HEIGHT * 8);
|
||||
DTX_PrintLine("bounding sphere radius: %3d", NNS_G2dGetCellBoundingSphereR(gpCanvasCell));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: サンプルの初期化処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
InitOamManager( &gOamManager );
|
||||
InitRenderer( &gRenderer, &gSurface, &gImageProxy, &gPaletteProxy );
|
||||
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
SampleDraw();
|
||||
|
||||
PrintSampleInfo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
static fx32 x = SCREEN_WIDTH /2 * FX32_ONE;
|
||||
static fx32 y = SCREEN_HEIGHT/2 * FX32_ONE;
|
||||
static fx32 scale = FX32_ONE;
|
||||
static u16 rot = 0;
|
||||
static fx32 vx = FX32_ONE;
|
||||
static fx32 vy = FX32_ONE;
|
||||
static fx32 vs = FX32_ONE/120;
|
||||
static u16 vr = 0x10000/0xFF;
|
||||
|
||||
//---- セルの表示パラメータを更新します
|
||||
{
|
||||
const int bsr = NNS_G2dGetCellBoundingSphereR( gpCanvasCell );
|
||||
|
||||
x += vx;
|
||||
y += vy;
|
||||
// scale += vs;
|
||||
rot += vr;
|
||||
|
||||
//---- ディスプレイ端で反射する
|
||||
if( (x < bsr * scale) || (SCREEN_WIDTH * FX32_ONE - bsr * scale < x) )
|
||||
{
|
||||
vx *= -1;
|
||||
}
|
||||
if( (y < bsr * scale) || (SCREEN_HEIGHT * FX32_ONE - bsr * scale < y) )
|
||||
{
|
||||
vy *= -1;
|
||||
}
|
||||
if( (scale < FX32_ONE/2) || (FX32_ONE * 2 < scale) )
|
||||
{
|
||||
vs *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
//---- CharCanvas セルを描画します
|
||||
NNS_G2dBeginRendering( &gRenderer );
|
||||
{
|
||||
NNS_G2dPushMtx();
|
||||
{
|
||||
NNS_G2dTranslate( x, y, 0 );
|
||||
NNS_G2dRotZ( FX_SinIdx(rot), FX_CosIdx(rot) );
|
||||
NNS_G2dScale( scale, scale, FX32_ONE );
|
||||
|
||||
NNS_G2dDrawCell( gpCanvasCell );
|
||||
}
|
||||
NNS_G2dPopMtx();
|
||||
}
|
||||
NNS_G2dEndRendering();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルの初期化処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// セルデータの書き出し
|
||||
NNS_G2dApplyOamManagerToHW( &gOamManager );
|
||||
NNS_G2dResetOamManagerBuffer( &gOamManager );
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/DoubleBuffering/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/DoubleBuffering/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - DoubleBuffering
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
358
add-ins/TwlSystem/build/demos/g2d/Text/DoubleBuffering/src/main.c
Executable file
358
add-ins/TwlSystem/build/demos/g2d/Text/DoubleBuffering/src/main.c
Executable file
@ -0,0 +1,358 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - DoubleBuffering
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// ダブルバッファリングONまたはOFFで文字列を表示します。
|
||||
// 文字列の描画には非常に時間がかかるのでダブルバッファリングを行わないと
|
||||
// 表示がちらつきます。
|
||||
//
|
||||
// 操作方法
|
||||
// A : ダブルバッファリングのON/OFFを切り替えます。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 30 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 22 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 1 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 1 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
// オンスクリーン表示用
|
||||
NNSG2dCharCanvas gOnCanvas;
|
||||
NNSG2dTextCanvas gOnTextCanvas;
|
||||
|
||||
// オフスクリーン表示用
|
||||
#define TRANS_TASK_NUM 1
|
||||
NNSG2dCharCanvas gOffCanvas;
|
||||
NNSG2dTextCanvas gOffTextCanvas;
|
||||
|
||||
// オフスクリーンバッファ
|
||||
// CharCanvasと同サイズのキャラクタ配列
|
||||
GXCharFmt16 gOffBuffer[CANVAS_HEIGHT][CANVAS_WIDTH];
|
||||
NNSGfdVramTransferTask gTrasTask[TRANS_TASK_NUM];
|
||||
|
||||
// 共通
|
||||
NNSG2dFont gFont;
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvasShare
|
||||
|
||||
Description: オン/オフ共有リソースを初期化します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvasShare(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
|
||||
// フォントをロード
|
||||
TXT_LoadFont(&gFont, TXT_FONTRESOURCE_NAME);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
CHARACTER_OFFSET,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitOnScreenCanvas
|
||||
|
||||
Description: オンスクリーン表示のCanvasを初期化します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
// オンスクリーン表示時の初期化
|
||||
static void InitOnScreenCanvas(void)
|
||||
{
|
||||
GXCharFmt16* const charBase = (GXCharFmt16*)G2_GetBG1CharPtr();
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gOnCanvas,
|
||||
charBase + CHARACTER_OFFSET, // VRAM のアドレス
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvas の初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gOnTextCanvas,
|
||||
&gOnCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitOffScreenCanvas
|
||||
|
||||
Description: オフスクリーン表示のCanvasを初期化します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
// オフスクリーン表示時の初期化
|
||||
static void InitOffScreenCanvas(void)
|
||||
{
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gOffCanvas,
|
||||
gOffBuffer, // VRAMのアドレスではなくオフスクリーンバッファのアドレスを渡す
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvas の初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gOffTextCanvas,
|
||||
&gOffCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// オフスクリーンバッファの転送にVRAM転送マネージャを使います
|
||||
NNS_GfdInitVramTransferManager(gTrasTask, TRANS_TASK_NUM);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: サンプル描画の初期化を行います。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
// 共有利ソースの初期化
|
||||
InitCanvasShare();
|
||||
|
||||
// オンスクリーン表示用初期化
|
||||
InitOnScreenCanvas();
|
||||
|
||||
// オフスクリーン表示用初期化
|
||||
InitOffScreenCanvas();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleDraw
|
||||
|
||||
Description: サンプルの描画を行います。
|
||||
|
||||
Arguments: pTextCanvas: TextCanvas へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleDraw(NNSG2dTextCanvas *pTextCanvas)
|
||||
{
|
||||
static int y = 0;
|
||||
|
||||
// Canvas クリア
|
||||
NNS_G2dCharCanvasClear(NNS_G2dTextCanvasGetCharCanvas(pTextCanvas), TXT_COLOR_NULL);
|
||||
|
||||
// 描画
|
||||
NNS_G2dTextCanvasDrawText(
|
||||
pTextCanvas,
|
||||
0, y,
|
||||
TXT_COLOR_BLACK,
|
||||
TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
"abcdefghijklmnopqrstuvwxyz\n"
|
||||
);
|
||||
|
||||
// 少しずつ下へ。
|
||||
y ++;
|
||||
if( y > 100 )
|
||||
{
|
||||
y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
BOOL bDoubleBuffering = FALSE;
|
||||
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルの初期化処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
{
|
||||
// オンオフ描画を切り替えます。
|
||||
if( CMN_IsTrigger(PAD_BUTTON_A) )
|
||||
{
|
||||
bDoubleBuffering = ! bDoubleBuffering;
|
||||
}
|
||||
DTX_PrintLine(
|
||||
"Double Buffering Sample\n"
|
||||
"operation\n"
|
||||
" A on/off double buffering\n"
|
||||
);
|
||||
DTX_PrintLine(bDoubleBuffering ? "DoubleBuffering: ON": "DoubleBuffering: OFF");
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// LCD 表示期間中
|
||||
|
||||
if( bDoubleBuffering )
|
||||
{
|
||||
// オフスクリーン表示では転送中以外はいつでも描画できます。
|
||||
SampleDraw( &gOffTextCanvas );
|
||||
|
||||
// Vブランク期間中の転送タスクを登録します。
|
||||
(void)NNS_GfdRegisterNewVramTransferTask(
|
||||
NNS_GFD_DST_2D_BG1_CHAR_MAIN,
|
||||
sizeof(GXCharFmt16) * CHARACTER_OFFSET,
|
||||
gOffBuffer,
|
||||
sizeof(gOffBuffer)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// オンスクリーン表示では何もする事はありません
|
||||
}
|
||||
|
||||
//
|
||||
//----------------------------------
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
DTX_Reflect();
|
||||
|
||||
//----------------------------------
|
||||
// V ブランク期間中
|
||||
|
||||
if( bDoubleBuffering )
|
||||
{
|
||||
// オフスクリーン表示ではVブランク中に描画済みイメージをVRAMへ転送します。
|
||||
NNS_GfdDoVramTransfer();
|
||||
}
|
||||
else
|
||||
{
|
||||
// オンスクリーン表示ではVブランク中にVRAMに描画します。
|
||||
SampleDraw( &gOnTextCanvas );
|
||||
}
|
||||
|
||||
//
|
||||
//----------------------------------
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetter/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetter/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - DrawLetter
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
246
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetter/src/main.c
Executable file
246
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetter/src/main.c
Executable file
@ -0,0 +1,246 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - DrawLetter
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 文字描画関数の使用サンプルです。
|
||||
// 1文字ずつ色を変えながら階段状に文字を描画します。
|
||||
//
|
||||
// 操作方法
|
||||
// 操作なし。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 22 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 16 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 5 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 4 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
static NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
GXCharFmt16* pCharBase = (GXCharFmt16*)G2_GetBG1CharPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// フォントを読み込みます
|
||||
// 他のデモと違い、わかりやすいように左スペースを持つフォントを使用します
|
||||
TXT_LoadFont( &gFont, DEBUG_FONTRESOURCE_NAME );
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas,
|
||||
pCharBase + cOffset,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
cOffset,
|
||||
TXT_CPALETTE_USERCOLOR
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define NEXT_COLOR(c) ((u8)(((c) + 1) & 0xF))
|
||||
static void SampleMain(void)
|
||||
{
|
||||
// 表示する文字列
|
||||
const char* const str = "abcdefghijklmnopqrstuvwxyz";
|
||||
const char* pos;
|
||||
const u8 bgColor = TXT_UCOLOR_GRAY;
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
u8 clr = 0;
|
||||
NNSG2dGlyph glyph;
|
||||
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
// 背景クリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, bgColor);
|
||||
|
||||
// DrawChar で描画
|
||||
for( pos = str; *pos != '\0'; pos++ )
|
||||
{
|
||||
int width;
|
||||
|
||||
// NNS_G2dCharCanvasDrawChar の返り値は文字幅(=左スペース幅 + グリフ幅 + 右スペース幅) です
|
||||
width = NNS_G2dCharCanvasDrawChar(&gCanvas, &gFont, x, y, clr, *pos);
|
||||
|
||||
// 文字幅を加算します
|
||||
x += width;
|
||||
|
||||
x += TEXT_HSPACE;
|
||||
y += TEXT_VSPACE;
|
||||
|
||||
// 次のカラー
|
||||
clr = NEXT_COLOR(clr);
|
||||
if( clr == bgColor )
|
||||
{
|
||||
clr = NEXT_COLOR(clr);
|
||||
}
|
||||
}
|
||||
|
||||
// DrawGlyph で描画
|
||||
x = 0;
|
||||
for( pos = str; *pos != '\0'; pos++ )
|
||||
{
|
||||
NNS_G2dFontGetGlyph(&glyph, &gFont, *pos);
|
||||
NNS_G2dCharCanvasDrawGlyph(&gCanvas, &gFont, x, y, clr, &glyph);
|
||||
|
||||
// グリフ幅のみを加算します。
|
||||
x += glyph.pWidths->glyphWidth;
|
||||
|
||||
x += TEXT_HSPACE;
|
||||
y += TEXT_VSPACE;
|
||||
|
||||
// 次のカラー
|
||||
clr = NEXT_COLOR(clr);
|
||||
if( clr == bgColor )
|
||||
{
|
||||
clr = NEXT_COLOR(clr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetters/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetters/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - DrawLetters
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
497
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetters/src/main.c
Executable file
497
add-ins/TwlSystem/build/demos/g2d/Text/DrawLetters/src/main.c
Executable file
@ -0,0 +1,497 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - DrawLetters
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 文字列描画関数の利用サンプルです。
|
||||
// NNS_G2dTextCanvasDrawString
|
||||
// NNS_G2dTextCanvasDrawText
|
||||
// NNS_G2dTextCanvasDrawTextRect
|
||||
// の 3 関数においてフラグによる描画の違いを示します。
|
||||
//
|
||||
// 操作方法
|
||||
// デモ実行時の下画面参照
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
#define CHARACTER_WIDTH 8
|
||||
#define CHARACTER_HEIGHT 8
|
||||
|
||||
#define CANVAS_WIDTH 22 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 16 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 5 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 4 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
#define TRANS_TASK_NUM 1
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
// オフスクリーンバッファ
|
||||
GXCharFmt16 gOffBuffer[CANVAS_HEIGHT][CANVAS_WIDTH];
|
||||
NNSGfdVramTransferTask gTrasTask[TRANS_TASK_NUM];
|
||||
|
||||
// 表示するテキスト
|
||||
static const char sSampleText[] =
|
||||
"short string\n"
|
||||
"It's a long long long long string.\n"
|
||||
"\n"
|
||||
"after null line";
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas,
|
||||
&gOffBuffer,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvasの初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
CHARACTER_OFFSET,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: デモ処理の初期化。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
// オフスクリーンバッファの転送にVRAM転送マネージャを使います
|
||||
NNS_GfdInitVramTransferManager(gTrasTask, TRANS_TASK_NUM);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleString
|
||||
|
||||
Description: NNS_G2dTextCanvasDrawString() のサンプル
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleString(void)
|
||||
{
|
||||
const char* str = sSampleText;
|
||||
const int linefeed = NNS_G2dFontGetLineFeed(&gFont) + NNS_G2dTextCanvasGetVSpace(&gTextCanvas);
|
||||
const int baselinePos = NNS_G2dFontGetBaselinePos(&gFont);
|
||||
int x, y;
|
||||
|
||||
// 情報出力
|
||||
{
|
||||
DTX_PrintLine("NNS_G2dTextCanvasDrawString Sample");
|
||||
DTX_PrintLine(" operation:");
|
||||
DTX_PrintLine(" X: next mode");
|
||||
DTX_PrintLine("");
|
||||
}
|
||||
|
||||
// 描画位置初期値
|
||||
x = 0;
|
||||
y = baselinePos;
|
||||
|
||||
// 背景をクリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
|
||||
// 文字列描画
|
||||
while( str != NULL )
|
||||
{
|
||||
NNS_G2dTextCanvasDrawString(
|
||||
&gTextCanvas, // 描画するTextCanvasへのポインタ
|
||||
x, // 描画開始座標 x
|
||||
y - baselinePos, // 描画開始座標 y
|
||||
TXT_COLOR_CYAN, // 文字色
|
||||
str, // 描画する文字列
|
||||
&str // 描画終了位置を受け取るバッファへのポインタ
|
||||
);
|
||||
|
||||
y += linefeed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleText
|
||||
|
||||
Description: NNS_G2dTextCanvasDrawText() のサンプル。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleText(void)
|
||||
{
|
||||
u32 flag = 0;
|
||||
|
||||
// 背景をクリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
|
||||
// 基準点を通る水平/垂直線を表示
|
||||
{
|
||||
const int canvas_pw = CANVAS_WIDTH * CHARACTER_WIDTH;
|
||||
const int canvas_ph = CANVAS_HEIGHT * CHARACTER_HEIGHT;
|
||||
const int origin_x = canvas_pw / 2;
|
||||
const int origin_y = canvas_ph / 2;
|
||||
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED, 0, origin_y, canvas_pw, 1);
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED, origin_x, 0, 1, canvas_ph);
|
||||
}
|
||||
|
||||
// キー入力処理と情報出力
|
||||
{
|
||||
DTX_PrintLine("NNS_G2dTextCanvasDrawText Sample");
|
||||
DTX_PrintLine(" operation:");
|
||||
DTX_PrintLine(" up: origin bottom");
|
||||
DTX_PrintLine(" down: origin top");
|
||||
DTX_PrintLine(" left: origin right");
|
||||
DTX_PrintLine(" right: origin left");
|
||||
DTX_PrintLine(" Y: left align");
|
||||
DTX_PrintLine(" A: right align");
|
||||
DTX_PrintLine(" X: next mode");
|
||||
DTX_PrintLine("");
|
||||
|
||||
if( CMN_IsPress(PAD_KEY_UP) )
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALORIGIN_BOTTOM;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALORIGIN_BOTTOM");
|
||||
}
|
||||
else if( CMN_IsPress(PAD_KEY_DOWN) )
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALORIGIN_TOP;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALORIGIN_TOP");
|
||||
}
|
||||
else
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALORIGIN_MIDDLE;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALORIGIN_MIDDLE");
|
||||
}
|
||||
|
||||
if( CMN_IsPress(PAD_KEY_LEFT) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALORIGIN_RIGHT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALORIGIN_RIGHT");
|
||||
}
|
||||
else if( CMN_IsPress(PAD_KEY_RIGHT) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALORIGIN_LEFT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALORIGIN_LEFT");
|
||||
}
|
||||
else
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALORIGIN_CENTER;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALORIGIN_CENTER");
|
||||
}
|
||||
|
||||
if( CMN_IsPress(PAD_BUTTON_Y) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_LEFT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_LEFT");
|
||||
}
|
||||
else if( CMN_IsPress(PAD_BUTTON_A) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_RIGHT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_RIGHT");
|
||||
}
|
||||
else
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_CENTER;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_CENTER");
|
||||
}
|
||||
}
|
||||
|
||||
// 文字列描画
|
||||
NNS_G2dTextCanvasDrawText(
|
||||
&gTextCanvas, // 描画するTextCanvasへのポインタ
|
||||
CANVAS_WIDTH * CHARACTER_WIDTH / 2, // 基準点座標 CharCanvas中心
|
||||
CANVAS_HEIGHT * CHARACTER_HEIGHT / 2, // 基準点座標 CharCanvas中心
|
||||
TXT_COLOR_MAGENTA, // 文字色
|
||||
flag, // 描画位置フラグ
|
||||
sSampleText // 描画する文字列
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleTextRect
|
||||
|
||||
Description: NNS_G2dTextCanvasDrawTextRect() のサンプル。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleTextRect(void)
|
||||
{
|
||||
const int canvas_pw = CANVAS_WIDTH * CHARACTER_WIDTH;
|
||||
const int canvas_ph = CANVAS_HEIGHT * CHARACTER_HEIGHT;
|
||||
const int rect_x = canvas_pw * 1/6;
|
||||
const int rect_y = canvas_ph * 1/6;
|
||||
const int rect_w = canvas_pw * 2/3;
|
||||
const int rect_h = canvas_ph * 2/3;
|
||||
u32 flag = 0;
|
||||
|
||||
// 背景をクリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
|
||||
// 基準矩形を表示
|
||||
{
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED,
|
||||
rect_x - 1, rect_y - 1, rect_w + 2, 1);
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED,
|
||||
rect_x - 1, rect_y + rect_h, rect_w + 2, 1);
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED,
|
||||
rect_x - 1, rect_y, 1, rect_h);
|
||||
NNS_G2dCharCanvasClearArea(&gCanvas, TXT_COLOR_RED,
|
||||
rect_x + rect_w, rect_y, 1, rect_h);
|
||||
}
|
||||
|
||||
// キー入力処理と情報出力
|
||||
{
|
||||
DTX_PrintLine("NNS_G2dTextCanvasDrawTextRect Sample");
|
||||
DTX_PrintLine(" operation:");
|
||||
DTX_PrintLine(" up: top align");
|
||||
DTX_PrintLine(" down: bottom align");
|
||||
DTX_PrintLine(" left: left align");
|
||||
DTX_PrintLine(" right: right align");
|
||||
DTX_PrintLine(" X: next mode");
|
||||
DTX_PrintLine("");
|
||||
|
||||
if( CMN_IsPress(PAD_KEY_UP) )
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALALIGN_TOP;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALALIGN_TOP");
|
||||
}
|
||||
else if( CMN_IsPress(PAD_KEY_DOWN) )
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALALIGN_BOTTOM;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALALIGN_BOTTOM");
|
||||
}
|
||||
else
|
||||
{
|
||||
flag |= NNS_G2D_VERTICALALIGN_MIDDLE;
|
||||
DTX_PrintLine(" NNS_G2D_VERTICALALIGN_MIDDLE");
|
||||
}
|
||||
|
||||
if( CMN_IsPress(PAD_KEY_LEFT) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_LEFT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_LEFT");
|
||||
}
|
||||
else if( CMN_IsPress(PAD_KEY_RIGHT) )
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_RIGHT;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_RIGHT");
|
||||
}
|
||||
else
|
||||
{
|
||||
flag |= NNS_G2D_HORIZONTALALIGN_CENTER;
|
||||
DTX_PrintLine(" NNS_G2D_HORIZONTALALIGN_CENTER");
|
||||
}
|
||||
}
|
||||
|
||||
// 文字列の描画
|
||||
NNS_G2dTextCanvasDrawTextRect(
|
||||
&gTextCanvas, // 描画するTextCanvasへのポインタ
|
||||
rect_x, // 矩形位置座標
|
||||
rect_y, // 矩形位置座標
|
||||
rect_w, // 基準矩形幅
|
||||
rect_h, // 基準矩形高さ
|
||||
TXT_COLOR_GREEN, // 文字色
|
||||
flag, // 描画位置フラグ
|
||||
sSampleText // 描画する文字列
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// 表示モード
|
||||
enum
|
||||
{
|
||||
MODE_STRING, // NNS_G2dTextCanvasDrawString のデモ
|
||||
MODE_TEXT, // NNS_G2dTextCanvasDrawText のデモ
|
||||
MODE_TEXT_RECT, // NNS_G2dTextCanvasDrawTextRectのデモ
|
||||
NUM_OF_MODE
|
||||
}
|
||||
mode = MODE_TEXT_RECT;
|
||||
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// デモ用の前処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
// Xボタンでモード変更
|
||||
if( CMN_IsTrigger(PAD_BUTTON_X) )
|
||||
{
|
||||
mode ++;
|
||||
mode %= NUM_OF_MODE;
|
||||
}
|
||||
|
||||
// モードに応じて処理分岐
|
||||
switch( mode )
|
||||
{
|
||||
case MODE_STRING: SampleString(); break;
|
||||
case MODE_TEXT: SampleText(); break;
|
||||
case MODE_TEXT_RECT: SampleTextRect(); break;
|
||||
}
|
||||
|
||||
// 転送タスクの登録
|
||||
(void)NNS_GfdRegisterNewVramTransferTask(
|
||||
NNS_GFD_DST_2D_BG1_CHAR_MAIN,
|
||||
sizeof(GXCharFmt16) * CHARACTER_OFFSET,
|
||||
gOffBuffer,
|
||||
sizeof(gOffBuffer)
|
||||
);
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
|
||||
// オフスクリーンバッファの転送
|
||||
NNS_GfdDoVramTransfer();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawTaggedText/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/DrawTaggedText/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - DrawTaggedText
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
327
add-ins/TwlSystem/build/demos/g2d/Text/DrawTaggedText/src/main.c
Executable file
327
add-ins/TwlSystem/build/demos/g2d/Text/DrawTaggedText/src/main.c
Executable file
@ -0,0 +1,327 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - DrawTaggedText
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// NNS_G2dTextCanvasDrawTaggedText() の使用サンプル。
|
||||
//
|
||||
// 操作方法
|
||||
// 操作なし。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 22 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 16 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 5 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 4 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
// 文字列埋め込み用色番号
|
||||
#define WHITE "\x1"
|
||||
#define BLACK "\x2"
|
||||
#define RED "\x3"
|
||||
#define GREEN "\x4"
|
||||
#define BLUE "\x5"
|
||||
#define CYAN "\x6"
|
||||
#define MAGENTA "\x7"
|
||||
#define YELLOW "\x8"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SimpleTagCallback
|
||||
|
||||
Description: NNSG2dTagCallback のサンプル。
|
||||
|
||||
Arguments: c: コールバック発生要因の文字コード。
|
||||
pInfo: 描画情報構造体へのポインタ。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SimpleTagCallback(u16 c, NNSG2dTagCallbackInfo* pInfo)
|
||||
{
|
||||
if( c == 0x1B )
|
||||
{
|
||||
const char* pos = (const char*)pInfo->str;
|
||||
|
||||
switch( *pos++ )
|
||||
{
|
||||
// 0x1B C 0xXX
|
||||
case 'C': // Color
|
||||
{
|
||||
pInfo->clr = *(u8*)pos;
|
||||
pos++;
|
||||
}
|
||||
break;
|
||||
|
||||
// 0x1B B
|
||||
case 'B': // callBack
|
||||
{
|
||||
NNS_G2D_POINTER_ASSERT( pInfo->cbParam );
|
||||
|
||||
pos++; // alignment for NNS_G2D_UNICODE
|
||||
pInfo->str = (const NNSG2dChar*)pos;
|
||||
|
||||
((NNSG2dTagCallback)pInfo->cbParam)( c, pInfo );
|
||||
}
|
||||
return;
|
||||
|
||||
// 0x1B H 0xXX
|
||||
case 'H': // Horizontal
|
||||
{
|
||||
s8 hSpace;
|
||||
|
||||
hSpace = *(s8*)pos;
|
||||
pos++;
|
||||
|
||||
NNS_G2dTextCanvasSetHSpace(&(pInfo->txn), hSpace);
|
||||
}
|
||||
break;
|
||||
|
||||
// 0x1B V 0xXX
|
||||
case 'V': // Vertical
|
||||
{
|
||||
s8 vSpace;
|
||||
|
||||
vSpace = *(s8*)pos;
|
||||
pos++;
|
||||
|
||||
NNS_G2dTextCanvasSetVSpace(&(pInfo->txn), vSpace);
|
||||
}
|
||||
break;
|
||||
|
||||
// 0x1B X 0xXX
|
||||
case 'X': // X
|
||||
{
|
||||
pInfo->x += *(s8*)pos;
|
||||
pos++;
|
||||
}
|
||||
break;
|
||||
|
||||
// 0x1B Y 0xXX
|
||||
case 'Y': // Y
|
||||
{
|
||||
pInfo->y += *(s8*)pos;
|
||||
pos++;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
OS_Warning("NNS_G2dTextCanvasDrawTaggedText: Unknown Tag: %c (0x%02X)\n", *(u8*)(pos-1), *(u8*)(pos-1));
|
||||
pos++; // alignment for NNS_G2D_UNICODE
|
||||
break;
|
||||
}
|
||||
|
||||
pInfo->str = (const NNSG2dChar*)pos;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
GXCharFmt16* pCharBase = (GXCharFmt16*)G2_GetBG1CharPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas,
|
||||
pCharBase + cOffset,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvas の初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
G2_GetBG1ScrPtr(),
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
cOffset,
|
||||
TXT_CPALETTE_MAIN
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define TAG_BEGIN "\x1B"
|
||||
#define CHG_COLOR(clr) TAG_BEGIN "C" clr
|
||||
#define CHG_LFEED(h) TAG_BEGIN "L" #h
|
||||
#define CHG_HSP(h) TAG_BEGIN "H" #h
|
||||
#define CHG_VSP(v) TAG_BEGIN "V" #v
|
||||
#define ADD_X(x) TAG_BEGIN "X" #x
|
||||
#define ADD_Y(y) TAG_BEGIN "Y" #y
|
||||
|
||||
static void SampleMain(void)
|
||||
{
|
||||
const static char text[] =
|
||||
"change color to " CHG_COLOR(RED) "red " CHG_COLOR(GREEN) "green " CHG_COLOR(CYAN) "cyan" CHG_COLOR(BLACK) "\n"
|
||||
CHG_HSP(\x5) "change hspace to 5" CHG_HSP(\x1) "\n"
|
||||
ADD_X(\x32) ADD_Y(\x32) "jump x+50 y+50";
|
||||
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
|
||||
// 背景クリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
|
||||
// タグつき文字列描画
|
||||
NNS_G2dTextCanvasDrawTaggedText(
|
||||
&gTextCanvas, // 描画する TextCanvas
|
||||
0, // 描画開始座標
|
||||
0, // 描画開始座標
|
||||
TXT_COLOR_BLACK, // 文字色
|
||||
text, // 描画する文字列
|
||||
SimpleTagCallback, // タグ処理コールバック
|
||||
NULL // タグ処理コールバック用パラメータ
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
121
add-ins/TwlSystem/build/demos/g2d/Text/DrawVertical/Makefile
Executable file
121
add-ins/TwlSystem/build/demos/g2d/Text/DrawVertical/Makefile
Executable file
@ -0,0 +1,121 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - DrawVertical
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 299 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
FCNV_DIR = $(NITROSYSTEM_TOOLSDIR)/fontcvtr
|
||||
FONTCVTR = $(FCNV_DIR)/fontcvtrc.exe
|
||||
FONT_SRC = ../data/src
|
||||
FONT_OUT = ../data
|
||||
FONT_XLOR = $(FONT_SRC)/demofont2.xlor
|
||||
FONT_BPP = 4
|
||||
FONT_WIN_H = "MS Pゴシック"
|
||||
FONT_WIN_V = "@MS Pゴシック"
|
||||
FONT_SIZE = 12
|
||||
|
||||
FONT_H0 = h_0.NFTR
|
||||
FONT_H90 = h_90.NFTR
|
||||
FONT_H180 = h_180.NFTR
|
||||
FONT_H270 = h_270.NFTR
|
||||
|
||||
FONT_V0 = v_0.NFTR
|
||||
FONT_V90 = v_90.NFTR
|
||||
FONT_V180 = v_180.NFTR
|
||||
FONT_V270 = v_270.NFTR
|
||||
|
||||
FONT_BIN = $(FONT_H0) $(FONT_H90) $(FONT_H180) $(FONT_H270) \
|
||||
$(FONT_V0) $(FONT_V90) $(FONT_V180) $(FONT_V270)
|
||||
|
||||
FONT_TARGET = $(addprefix $(FONT_OUT)/,$(FONT_BIN))
|
||||
|
||||
LDEPENDS_NEF += $(FONT_TARGET)
|
||||
|
||||
|
||||
FONT_TTC = $(shell find `cygpath -W`/Fonts/ -iname msgothic.ttc)
|
||||
|
||||
ifeq ($(FONT_TTC),)
|
||||
ENV_CHK = env-error
|
||||
else
|
||||
ENV_CHK = $(FONT_TTC)
|
||||
endif
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
.PHONY: env-error
|
||||
.PRECIOUS: $(FONT_OUT)/%.bmp
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
$(TARGETS): $(FONT_TARGET)
|
||||
|
||||
env-error:
|
||||
-echo Sorry. This demo requires japanese Windows environment.
|
||||
false
|
||||
|
||||
# win -> bmp for h
|
||||
$(FONT_OUT)/h.bmp: $(FONT_XLOR) $(FONTCVTR) Makefile $(ENV_CHK)
|
||||
ifndef SILENT
|
||||
echo $(FONT_WIN_H) -\> $@
|
||||
endif
|
||||
$(FONTCVTR) -i win -in $(FONT_WIN_H) -is $(FONT_SIZE) -ib $(FONT_BPP) \
|
||||
-o bmp -of $@ -oo $(FONT_XLOR)
|
||||
|
||||
# win -> bmp for v
|
||||
$(FONT_OUT)/v.bmp: $(FONT_XLOR) $(FONTCVTR) Makefile $(ENV_CHK)
|
||||
ifndef SILENT
|
||||
echo $(FONT_WIN_V) -\> $@
|
||||
endif
|
||||
$(FONTCVTR) -i win -in $(FONT_WIN_V) -is $(FONT_SIZE) -ib $(FONT_BPP) \
|
||||
-o bmp -of $@ -oo $(FONT_XLOR)
|
||||
|
||||
# bmp -> nftr for h
|
||||
$(FONT_OUT)/h_%.NFTR: $(FONT_OUT)/h.bmp $(FONT_XLOR) $(FONTCVTR) Makefile $(ENV_CHK)
|
||||
ifndef SILENT
|
||||
echo $< -\> $@
|
||||
endif
|
||||
$(FONTCVTR) -i bmp -if $< -io $(FONT_XLOR) -ib $(FONT_BPP) \
|
||||
-o nitro -of $@ -oe sjis -oc $*
|
||||
|
||||
# bmp -> nftr for v
|
||||
$(FONT_OUT)/v_%.NFTR: $(FONT_OUT)/v.bmp $(FONT_XLOR) $(FONTCVTR) Makefile $(ENV_CHK)
|
||||
ifndef SILENT
|
||||
echo $< -\> $@
|
||||
endif
|
||||
$(FONTCVTR) -i bmp -if $< -io $(FONT_XLOR) -ib $(FONT_BPP) \
|
||||
-o nitro -of $@ -oe sjis -oc $*
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
439
add-ins/TwlSystem/build/demos/g2d/Text/DrawVertical/src/main.c
Executable file
439
add-ins/TwlSystem/build/demos/g2d/Text/DrawVertical/src/main.c
Executable file
@ -0,0 +1,439 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - DrawVertical
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 縦書き用に変換したフォントを使用して縦書き描画を行います。
|
||||
// このデモは日本語環境専用です。
|
||||
//
|
||||
// 操作方法
|
||||
// 十字ボタンの押した方向が画面上となるように
|
||||
// フォントと表示位置を切り替えます。
|
||||
// A ボタンを押すと縦書き/横書きを切り替えます。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define CHARACTER_WIDTH 8
|
||||
#define CHARACTER_HEIGHT 8
|
||||
|
||||
#define CANVAS_WIDTH 28 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 20 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 2 // 文字描画域の位置X (キャラクタ単位)
|
||||
#define CANVAS_TOP 2 // 文字描画域の位置Y (キャラクタ単位)
|
||||
|
||||
#define BG_WIDTH 32 // 文字列を描画する BG の幅 (キャラクタ単位)
|
||||
#define BG_HEIGHT 32 // 文字列を描画する BG の高さ (キャラクタ単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 型
|
||||
|
||||
typedef enum Direction
|
||||
{
|
||||
DIR_H_0, // 横書き 画面の左から右へ
|
||||
DIR_H_90, // 横書き 画面の上から下
|
||||
DIR_H_180, // 横書き 画面の右から左へ
|
||||
DIR_H_270, // 横書き 画面の下から上へ
|
||||
DIR_V_0, // 縦書き 画面の上から下へ
|
||||
DIR_V_90, // 縦書き 画面の右から左へ
|
||||
DIR_V_180, // 縦書き 画面の下から上へ
|
||||
DIR_V_270, // 縦書き 画面の左から右へ
|
||||
DIR_NULL
|
||||
}
|
||||
Direction;
|
||||
|
||||
typedef struct FontInfo
|
||||
{
|
||||
const char* name;
|
||||
Direction dir;
|
||||
NNSG2dFont res;
|
||||
}
|
||||
FontInfo;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
FontInfo gFonts[] =
|
||||
{
|
||||
{"/data/h_0.NFTR", DIR_H_0 },
|
||||
{"/data/h_90.NFTR", DIR_H_90 },
|
||||
{"/data/h_180.NFTR", DIR_H_180 },
|
||||
{"/data/h_270.NFTR", DIR_H_270 },
|
||||
|
||||
{"/data/v_0.NFTR", DIR_V_0 },
|
||||
{"/data/v_90.NFTR", DIR_V_90 },
|
||||
{"/data/v_180.NFTR", DIR_V_180 },
|
||||
{"/data/v_270.NFTR", DIR_V_270 },
|
||||
};
|
||||
|
||||
// 表示する文字列
|
||||
const char* const sSampleText = "いろはにほへと ちりぬるを わかよたれそ\n"
|
||||
"つねならむ うゐのおくやま けふこえて\n"
|
||||
"あさきゆめみし ゑひもせす\n"
|
||||
"The quick brown fox jumps over the lazy dog";
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: BG 面を設定します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// BG 1 を設定
|
||||
G2_SetBG1Control(
|
||||
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
|
||||
GX_BG_COLORMODE_16, // カラーモード 16色
|
||||
GX_BG_SCRBASE_0x0000, // スクリーンベース
|
||||
GX_BG_CHARBASE_0x00000, // キャラクタベース
|
||||
GX_BG_EXTPLTT_01 // 拡張パレットスロット
|
||||
);
|
||||
|
||||
// BG1 を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_BG1 );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadBGPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
GXCharFmt16* pChrBase = (GXCharFmt16*) G2_GetBG1CharPtr();
|
||||
GXScrFmtText* pScrBase = (GXScrFmtText*)G2_GetBG1ScrPtr();
|
||||
int cOffset = CHARACTER_OFFSET;
|
||||
|
||||
// スクリーンをクリア
|
||||
MI_CpuClear16(G2_GetBG1ScrPtr(), sizeof(GXScrFmtText) * BG_WIDTH * BG_HEIGHT);
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForBG(
|
||||
&gCanvas,
|
||||
pChrBase + cOffset,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
NNS_G2D_CHARA_COLORMODE_16
|
||||
);
|
||||
|
||||
// TextCanvasの初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFonts[0].res,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// スクリーンを設定
|
||||
NNS_G2dMapScrToCharText(
|
||||
pScrBase,
|
||||
CANVAS_WIDTH,
|
||||
CANVAS_HEIGHT,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_TOP,
|
||||
NNS_G2D_TEXT_BG_WIDTH_256,
|
||||
cOffset,
|
||||
TXT_CPALETTE_4BPP
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleDraw
|
||||
|
||||
Description: サンプル文字列を描画します。
|
||||
|
||||
Arguments: x: 描画する位置 x
|
||||
y: 描画する位置 y
|
||||
pFont: 描画に使用するフォント
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleDraw(int x, int y, const NNSG2dFont* pFont)
|
||||
{
|
||||
// 背景クリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_4BPP_BG);
|
||||
|
||||
// フォント変更
|
||||
NNS_G2dTextCanvasSetFont(&gTextCanvas, pFont);
|
||||
|
||||
// テキスト描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, x, y, TXT_COLOR_4BPP_TEXT,
|
||||
TXT_DRAWTEXT_FLAG_DEFAULT, sSampleText);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: サンプルの初期設定処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
// フォント読み込み
|
||||
for( i = 0; i < ARY_SIZEOF(gFonts); ++i )
|
||||
{
|
||||
TXT_LoadFont( &gFonts[i].res, gFonts[i].name );
|
||||
}
|
||||
|
||||
|
||||
// スクリーン設定
|
||||
InitScreen();
|
||||
|
||||
// キャンバス構築
|
||||
InitCanvas();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SearchFont
|
||||
|
||||
Description: 指定された方向用のフォントを探します。
|
||||
|
||||
Arguments: pfis: フォント情報の配列
|
||||
dir: 対象の方向
|
||||
|
||||
Returns: 見つかったフォントを返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static const NNSG2dFont* SearchFont(const FontInfo* pfis, Direction dir)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = 0; i < ARY_SIZEOF(gFonts); ++i )
|
||||
{
|
||||
if( pfis[i].dir == dir )
|
||||
{
|
||||
return &pfis[i].res;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: MakeDirection
|
||||
|
||||
Description: 描画方向と縦書き/横書きを組み合わせます。
|
||||
|
||||
Arguments: d: 描画方向
|
||||
bV: 縦書きなら TRUE、横書きなら FALSE
|
||||
|
||||
Returns: 描画方向と縦書き/横書きを組み合わせた値を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static Direction MakeDirection(Direction d, BOOL bV)
|
||||
{
|
||||
switch( d )
|
||||
{
|
||||
case DIR_H_0: return bV ? DIR_V_0: DIR_H_0;
|
||||
case DIR_H_90: return bV ? DIR_V_90: DIR_H_90;
|
||||
case DIR_H_180: return bV ? DIR_V_180: DIR_H_180;
|
||||
case DIR_H_270: return bV ? DIR_V_270: DIR_H_270;
|
||||
}
|
||||
|
||||
return DIR_H_0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
static Direction rotation = DIR_NULL;
|
||||
static BOOL bV = FALSE;
|
||||
BOOL bUpdated = FALSE;
|
||||
|
||||
//---- 入力に応じて表示の方向を変更します。
|
||||
if( CMN_IsTrigger(PAD_KEY_UP) || rotation == DIR_NULL )
|
||||
{
|
||||
rotation = DIR_H_0;
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_KEY_DOWN) )
|
||||
{
|
||||
rotation = DIR_H_180;
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_KEY_LEFT) )
|
||||
{
|
||||
rotation = DIR_H_270;
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_KEY_RIGHT) )
|
||||
{
|
||||
rotation = DIR_H_90;
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_BUTTON_A) )
|
||||
{
|
||||
bV = ! bV;
|
||||
bUpdated = TRUE;
|
||||
}
|
||||
|
||||
|
||||
//---- 方向が変更された場合に変更を反映します。
|
||||
if( bUpdated )
|
||||
{
|
||||
static const int canvas_width = CANVAS_WIDTH * CHARACTER_WIDTH;
|
||||
static const int canvas_height = CANVAS_HEIGHT * CHARACTER_HEIGHT;
|
||||
const Direction dir = MakeDirection(rotation, bV);
|
||||
const NNSG2dFont* pFont = SearchFont(gFonts, dir);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
NNS_G2D_POINTER_ASSERT( pFont );
|
||||
|
||||
//---- 方向に応じて始点を調整します。
|
||||
switch( dir )
|
||||
{
|
||||
case DIR_H_270:
|
||||
case DIR_V_180: y = canvas_height; break;
|
||||
case DIR_H_90:
|
||||
case DIR_V_0: x = canvas_width; break;
|
||||
case DIR_H_180:
|
||||
case DIR_V_90: x = canvas_width;
|
||||
y = canvas_height; break;
|
||||
}
|
||||
|
||||
//---- 方向別のフォントを用いてサンプル文字列を描画します。
|
||||
SampleDraw(x, y, pFont);
|
||||
|
||||
|
||||
//---- メッセージ表示
|
||||
DTX_PrintLine("DrawVertical demo");
|
||||
DTX_PrintLine(" operation:");
|
||||
DTX_PrintLine(" +: change direction");
|
||||
DTX_PrintLine(" A: toggle horizontal/vertical writing");
|
||||
DTX_PrintLine("");
|
||||
DTX_PrintLine("direction:");
|
||||
switch( dir )
|
||||
{
|
||||
case DIR_H_0:
|
||||
case DIR_V_270: DTX_PrintLine(" left to right"); break;
|
||||
case DIR_H_90:
|
||||
case DIR_V_0: DTX_PrintLine(" top to bottom"); break;
|
||||
case DIR_H_180:
|
||||
case DIR_V_90: DTX_PrintLine(" right to left"); break;
|
||||
case DIR_H_270:
|
||||
case DIR_V_180: DTX_PrintLine(" bottom to up"); break;
|
||||
}
|
||||
DTX_PrintLine("");
|
||||
DTX_PrintLine("writing mode:");
|
||||
DTX_PrintLine(bV ? " vertical": " horizontal");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// デモ用の前処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
SampleMain();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
57
add-ins/TwlSystem/build/demos/g2d/Text/Makefile
Executable file
57
add-ins/TwlSystem/build/demos/g2d/Text/Makefile
Executable file
@ -0,0 +1,57 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS = \
|
||||
textdemolib \
|
||||
\
|
||||
DoubleBuffering \
|
||||
BGText \
|
||||
BGAffine \
|
||||
\
|
||||
OBJ1D \
|
||||
OBJ2DRect \
|
||||
CanvasCell \
|
||||
\
|
||||
ShiftJISText \
|
||||
UTF16Text \
|
||||
UTF8Text \
|
||||
CP1252Text \
|
||||
\
|
||||
DrawLetter \
|
||||
DrawLetters \
|
||||
DrawTaggedText \
|
||||
\
|
||||
MinimumCanvas \
|
||||
SimpleFontView \
|
||||
\
|
||||
PortraitHW \
|
||||
PortraitSW \
|
||||
|
||||
ifneq ($(shell find `cygpath -W`/Fonts/ -iname msgothic.ttc),)
|
||||
SUBDIRS += DrawVertical
|
||||
endif
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
43
add-ins/TwlSystem/build/demos/g2d/Text/MinimumCanvas/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/MinimumCanvas/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - MinimumCanvas
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
630
add-ins/TwlSystem/build/demos/g2d/Text/MinimumCanvas/src/main.c
Executable file
630
add-ins/TwlSystem/build/demos/g2d/Text/MinimumCanvas/src/main.c
Executable file
@ -0,0 +1,630 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - MinimumCanvas
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 表示する文字列の大きさに応じて、その文字列を表示する事が出来る
|
||||
// 最小の CharCanvas を構築し、描画を行います。
|
||||
// NNS_G2dFontGetTextRect によって得られた文字列のサイズが
|
||||
// CharCanvas のサイズとして無効である場合は、それ以上かつ最小の
|
||||
// 有効サイズを計算して CharCanvas を構築します。
|
||||
//
|
||||
// 操作方法
|
||||
// A ボタン カラーモードを変更する。
|
||||
// B ボタン VRAMモードを変更する。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include <nnsys/misc.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define ROUNDUP(x, div) (((x) + (div) - 1) & ~((div) - 1))
|
||||
|
||||
#define CHARACTER_WIDTH 8 // キャラクタのピクセル単位での幅
|
||||
#define CHARACTER_HEIGHT 8 // キャラクタのピクセル単位での高さ
|
||||
#define SCREEN_WIDTH 256 // スクリーン幅
|
||||
#define SCREEN_HEIGHT 192 // スクリーン高さ
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の開始番号
|
||||
|
||||
#define MAX_OBJ_NUM 128 // OBJ の最大数
|
||||
#define MAX_CHARA_NAME 1024 // キャラクタネームの最大値
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
|
||||
GXOamColorMode gColorMode = GX_OAM_COLORMODE_16;
|
||||
NNSG2dOBJVramMode gVramMode = NNS_G2D_OBJVRAMMODE_32K;
|
||||
|
||||
int gUsingCharas = 0;
|
||||
int gUsingOam = 0;
|
||||
|
||||
const static NNSG2dChar* sampleText[] =
|
||||
{
|
||||
NNS_G2D_TRANSCODE("This sample program make temporary minimum\n"
|
||||
"CharCanvas to draw a text and draw the\n"
|
||||
"text to it."),
|
||||
NNS_G2D_TRANSCODE("sample text"),
|
||||
NNS_G2D_TRANSCODE("this text require\n11x3 size."),
|
||||
NNS_G2D_TRANSCODE("line 1\n" "line 2\n" "line 3\n" "line 4\n"),
|
||||
NNS_G2D_TRANSCODE("A"),
|
||||
};
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: GetMinValidCanvasSize
|
||||
|
||||
Description: 与えられたサイズ以上で CharCanvas のサイズとして有効な
|
||||
最小のサイズを取得します。
|
||||
|
||||
Arguments: areaWidth: CharCanvas の幅(キャラクタ単位)
|
||||
areaHeight: CharCanvas の高さ(キャラクタ単位)
|
||||
colorMode: CharCanvas のカラーモード
|
||||
vramMode: OBJ VRAM 容量
|
||||
|
||||
Returns: 与えられたサイズ以上で CharCanvas のサイズとして有効な
|
||||
最小のサイズを返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static NNSG2dTextRect GetMinValidCanvasSize(
|
||||
int areaWidth,
|
||||
int areaHeight,
|
||||
GXOamColorMode colorMode,
|
||||
NNSG2dOBJVramMode vramMode
|
||||
)
|
||||
{
|
||||
NNSG2dTextRect rect;
|
||||
NNS_G2D_MIN_ASSERT( areaWidth, 1 );
|
||||
NNS_G2D_MIN_ASSERT( areaHeight, 1 );
|
||||
NNS_G2D_ASSERT( (colorMode == GX_OAM_COLORMODE_16)
|
||||
|| (colorMode == GX_OAM_COLORMODE_256) );
|
||||
NNS_G2D_ASSERT( (vramMode == NNS_G2D_OBJVRAMMODE_32K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_64K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_128K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_256K) );
|
||||
|
||||
rect.width = areaWidth;
|
||||
rect.height = areaHeight;
|
||||
|
||||
if( (colorMode == GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_128K)
|
||||
|| (colorMode != GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_256K) )
|
||||
{
|
||||
// 「奇数と「4で割った余りが3の値」の組み合わせは不可」のケース。
|
||||
// 条件に当てはまる場合は適切などちらか片方を +1 すればよい
|
||||
if( (rect.width % 2) != 0 && (rect.height % 2) != 0 )
|
||||
{
|
||||
if( (rect.width % 4) != 1 )
|
||||
{
|
||||
// width % 4 == 3 && height % 4 == 1,3
|
||||
rect.width++;
|
||||
}
|
||||
else if( (rect.height % 4) != 1 )
|
||||
{
|
||||
// width % 4 == 1 && height % 4 == 3
|
||||
rect.height++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( colorMode == GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_256K )
|
||||
{
|
||||
// 共に偶数でなければならない。
|
||||
rect.width = ROUNDUP(rect.width, 2);
|
||||
rect.height = ROUNDUP(rect.height, 2);
|
||||
}
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: OffsetCharName
|
||||
|
||||
Description: 1D マッピングOBJでキャラクタネームが指し示すアドレスを取得します。
|
||||
|
||||
Arguments: pCharBase: OBJのキャラクタベース
|
||||
charName: 対象のキャラクタネーム
|
||||
vramMode: VRAM モード
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void* OffsetCharName(
|
||||
void* pCharBase,
|
||||
int charName,
|
||||
NNSG2dOBJVramMode vramMode )
|
||||
{
|
||||
u32 addr = (u32)pCharBase;
|
||||
addr += sizeof(GXCharFmt16) * (charName << vramMode);
|
||||
return (void*)addr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SDKToNNSColorMode
|
||||
|
||||
Description: NITRO-SDK のカラーモード列挙子から NITRO-System の
|
||||
カラーモード列挙子に変換します。
|
||||
|
||||
Arguments: sdk: NITRO-SDKのカラーモード列挙子
|
||||
|
||||
Returns: sdk に対応する NITRO-System のカラーモード列挙子を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static inline NNSG2dCharaColorMode SDKToNNSColorMode(GXOamColorMode sdk)
|
||||
{
|
||||
static const NNSG2dCharaColorMode nns[] =
|
||||
{ NNS_G2D_CHARA_COLORMODE_16, NNS_G2D_CHARA_COLORMODE_256 };
|
||||
|
||||
NNS_MINMAX_ASSERT(sdk, 0, 1);
|
||||
return nns[sdk];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ResetOAM
|
||||
|
||||
Description: OAMを全て解放しリセットします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void ResetOAM(void)
|
||||
{
|
||||
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE);
|
||||
gUsingOam = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ResetOBJChr
|
||||
|
||||
Description: OBJキャラクタを全て解放します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void ResetOBJChr(void)
|
||||
{
|
||||
gUsingCharas = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: AllocCharacters
|
||||
|
||||
Description: 簡易キャラクタマネージャ。
|
||||
指定した数のキャラクタを確保し、確保したキャラクタ列の
|
||||
先頭キャラクタネームを返します。
|
||||
|
||||
Arguments: num: 確保するキャラクタの数。
|
||||
|
||||
Returns: 確保に成功した場合は確保したキャラクタ列の
|
||||
先頭キャラクタネームを返します。
|
||||
失敗した場合は -1 を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static int AllocCharacters(
|
||||
int num,
|
||||
GXOamColorMode colorMode,
|
||||
NNSG2dOBJVramMode vramMode )
|
||||
{
|
||||
int ret;
|
||||
int realNum = ROUNDUP_DIV(num, (1 << vramMode));
|
||||
|
||||
if( colorMode == GX_OAM_COLORMODE_256 )
|
||||
{
|
||||
realNum *= 2;
|
||||
}
|
||||
|
||||
if( gUsingCharas + realNum > MAX_CHARA_NAME )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = gUsingCharas;
|
||||
gUsingCharas += realNum;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: AllocOAM
|
||||
|
||||
Description: 簡易 OAM マネージャ。
|
||||
指定した数の OAM を確保し、確保した OAM 列の
|
||||
先頭へのポインタを返します
|
||||
|
||||
Arguments: num: 確保する OAM の数。
|
||||
|
||||
Returns: 確保に成功した場合は確保したキャラクタ列の
|
||||
先頭へのポインタを返します。
|
||||
失敗した場合は NULL を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static GXOamAttr* AllocOAM(int num)
|
||||
{
|
||||
GXOamAttr* const pObjBase = (GXOamAttr*)HW_OAM;
|
||||
GXOamAttr* ret;
|
||||
|
||||
if( gUsingOam + num > MAX_OBJ_NUM )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = pObjBase + gUsingOam;
|
||||
gUsingOam += num;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: HandleInput
|
||||
|
||||
Description: 入力を読み取ります。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: 入力によって内部状態が変更されたらTRUE。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL HandleInput(void)
|
||||
{
|
||||
BOOL bChanged = FALSE;
|
||||
|
||||
if( CMN_IsTrigger(PAD_BUTTON_A) )
|
||||
{
|
||||
gColorMode = (gColorMode != GX_OAM_COLORMODE_16) ?
|
||||
GX_OAM_COLORMODE_16:
|
||||
GX_OAM_COLORMODE_256;
|
||||
bChanged = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_BUTTON_B) )
|
||||
{
|
||||
gVramMode++;
|
||||
if( gVramMode > NNS_G2D_OBJVRAMMODE_256K )
|
||||
{
|
||||
gVramMode = NNS_G2D_OBJVRAMMODE_32K;
|
||||
}
|
||||
bChanged = TRUE;
|
||||
}
|
||||
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: OBJ表示の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// OBJ を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_OBJ );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadOBJPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PutText
|
||||
|
||||
Description: 指定された場所に指定されたテキストを表示します。
|
||||
|
||||
Arguments: x: テキストを表示する位置
|
||||
y: テキストを表示する位置
|
||||
pFont: テキストを描画するためのフォント
|
||||
colorMode: メインOBJのカラーモードを指定します。
|
||||
vramMode: メインOBJのVRAMモードを指定します。
|
||||
color: テキストの色番号を指定します。
|
||||
txt: 表示するテキストを指定します。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void PutText(
|
||||
int x,
|
||||
int y,
|
||||
const NNSG2dFont* pFont,
|
||||
GXOamColorMode colorMode,
|
||||
NNSG2dOBJVramMode vramMode,
|
||||
u8 color,
|
||||
const NNSG2dChar* txt
|
||||
)
|
||||
{
|
||||
void* const pCharBase = G2_GetOBJCharPtr();
|
||||
NNSG2dCharCanvas cc;
|
||||
NNSG2dTextCanvas tc;
|
||||
NNSG2dTextRect textRect;
|
||||
NNSG2dTextRect canvasSize;
|
||||
int areaWidth, areaHeight;
|
||||
GXOamAttr* pOam;
|
||||
int numOBJ;
|
||||
int charNo;
|
||||
|
||||
// テキスト領域サイズを求めます
|
||||
textRect = NNS_G2dFontGetTextRect(pFont, TEXT_HSPACE, TEXT_VSPACE, txt);
|
||||
areaWidth = ROUNDUP_DIV(textRect.width, CHARACTER_WIDTH);
|
||||
areaHeight = ROUNDUP_DIV(textRect.height, CHARACTER_HEIGHT);
|
||||
canvasSize = GetMinValidCanvasSize(areaWidth, areaHeight, colorMode, vramMode);
|
||||
|
||||
// OAM と キャラクタを確保します
|
||||
numOBJ = NNS_G2dCalcRequiredOBJ1D( canvasSize.width, canvasSize.height );
|
||||
charNo = AllocCharacters( canvasSize.width * canvasSize.height, colorMode, vramMode );
|
||||
pOam = AllocOAM( numOBJ );
|
||||
NNS_G2D_ASSERT( charNo >= 0 );
|
||||
NNS_G2D_POINTER_ASSERT( pOam );
|
||||
|
||||
// CharCanvas を 1D OBJ 用に テキスト領域サイズで初期化
|
||||
NNS_G2dCharCanvasInitForOBJ1D(
|
||||
&cc,
|
||||
OffsetCharName(pCharBase, charNo, vramMode),
|
||||
canvasSize.width,
|
||||
canvasSize.height,
|
||||
SDKToNNSColorMode(colorMode)
|
||||
);
|
||||
|
||||
// CharCanvas 用に OBJ を配置
|
||||
(void)NNS_G2dArrangeOBJ1D(
|
||||
pOam,
|
||||
canvasSize.width,
|
||||
canvasSize.height,
|
||||
x, y,
|
||||
colorMode,
|
||||
charNo,
|
||||
vramMode
|
||||
);
|
||||
|
||||
// OBJを設定
|
||||
TXT_SetCharCanvasOBJAttrs(
|
||||
pOam, // OAM配列へのポインタ
|
||||
numOBJ, // 対象とするOAMの数
|
||||
0, // priority
|
||||
GX_OAM_MODE_NORMAL, // OBJモード
|
||||
FALSE, // モザイク
|
||||
GX_OAM_EFFECT_NONE, // OBJ効果
|
||||
TXT_CPALETTE_MAIN, // パレット番号
|
||||
0 // アフィンパラメータインデックス
|
||||
);
|
||||
|
||||
// TextCanvas を構築
|
||||
NNS_G2dTextCanvasInit(
|
||||
&tc,
|
||||
&cc,
|
||||
pFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// Canvas をクリアして文字列描画
|
||||
NNS_G2dCharCanvasClear(
|
||||
&cc,
|
||||
TXT_COLOR_WHITE
|
||||
);
|
||||
NNS_G2dTextCanvasDrawText(
|
||||
&tc,
|
||||
0, 0,
|
||||
color,
|
||||
TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
txt
|
||||
);
|
||||
|
||||
|
||||
DTX_PrintLine("%3dx%3d %2dx%2d %2dx%2d %4d %3d",
|
||||
textRect.width, textRect.height,
|
||||
areaWidth, areaHeight,
|
||||
canvasSize.width, canvasSize.height,
|
||||
canvasSize.width * canvasSize.height, numOBJ
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PrintSampleInfo
|
||||
|
||||
Description: サンプルの情報をした画面に出力します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void PrintSampleInfo(void)
|
||||
{
|
||||
static const char* colorModeString[] =
|
||||
{
|
||||
"GX_OAM_COLORMODE_16",
|
||||
"GX_OAM_COLORMODE_256"
|
||||
};
|
||||
static const char* vramModeString[] =
|
||||
{
|
||||
"NNS_G2D_OBJVRAMMODE_32K",
|
||||
"NNS_G2D_OBJVRAMMODE_64K",
|
||||
"NNS_G2D_OBJVRAMMODE_128K",
|
||||
"NNS_G2D_OBJVRAMMODE_256K"
|
||||
};
|
||||
|
||||
DTX_PrintLine(
|
||||
"Text size dependents Canvas Sample\n"
|
||||
"operation\n"
|
||||
" A change color mode\n"
|
||||
" B change vram mode\n"
|
||||
);
|
||||
DTX_PrintLine("color mode: %s", colorModeString[gColorMode]);
|
||||
DTX_PrintLine("vram mode: %s", vramModeString[gVramMode]);
|
||||
DTX_PrintLine(
|
||||
"\n"
|
||||
"Size Using\n"
|
||||
"text canvas adjust char OBJ"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleDraw
|
||||
|
||||
Description: サンプルの描画処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleDraw(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
PrintSampleInfo();
|
||||
|
||||
switch( gVramMode )
|
||||
{
|
||||
case NNS_G2D_OBJVRAMMODE_32K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_64K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_64K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_128K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_128K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_256K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_256K); break;
|
||||
default: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); break;
|
||||
}
|
||||
|
||||
ResetOAM();
|
||||
ResetOBJChr();
|
||||
|
||||
for( i = 0; i < ARY_SIZEOF(sampleText); ++i )
|
||||
{
|
||||
int x = (int)(SCREEN_WIDTH / ARY_SIZEOF(sampleText)) * i;
|
||||
int y = (int)(SCREEN_HEIGHT / ARY_SIZEOF(sampleText)) * i;
|
||||
u8 color = (u8)(TXT_COLOR_RED + i);
|
||||
|
||||
PutText(x, y, &gFont, gColorMode, gVramMode, color, sampleText[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: サンプルの初期化処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
InitScreen();
|
||||
SampleDraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
if( HandleInput() )
|
||||
{
|
||||
SampleDraw();
|
||||
DC_StoreAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルの初期化処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/OBJ1D/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/OBJ1D/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - OBJ1D
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
576
add-ins/TwlSystem/build/demos/g2d/Text/OBJ1D/src/main.c
Executable file
576
add-ins/TwlSystem/build/demos/g2d/Text/OBJ1D/src/main.c
Executable file
@ -0,0 +1,576 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: NITRO-System - demos - g2d - Text - OBJ1D
|
||||
File: main.c
|
||||
|
||||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Revision: 172 $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
// ============================================================================
|
||||
// デモの内容
|
||||
// 1DマッピングOBJ上での文字描画サンプル。
|
||||
// CharCanvasのサイズに応じて必要なOBJ数を表示します。
|
||||
// OBJ1D ではカラーモード、VRAMモードとキャンバスの辺の長さの
|
||||
// 組み合わせによっては正しく文字が表示されないことに注意してください。
|
||||
// 参照:NNS_G2dCharCanvasInitForOBJ1D() APIリファレンス
|
||||
//
|
||||
// 操作方法
|
||||
// A ボタン カラーモードを変更する。
|
||||
// B ボタン VRAMモードを変更する。
|
||||
// 十字ボタン CharCanvasのサイズを変更する。
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#include <nnsys/g2d/g2d_TextCanvas.h>
|
||||
#include <nnsys/g2d/g2d_CharCanvas.h>
|
||||
#include <nnsys/misc.h>
|
||||
#include "g2d_textdemolib.h"
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 28 // 文字描画域の幅 (キャラクタ単位)
|
||||
#define CANVAS_HEIGHT 10 // 文字描画域の高さ (キャラクタ単位)
|
||||
#define CANVAS_LEFT 13 // 文字描画域の位置X (ピクセル単位)
|
||||
#define CANVAS_TOP 17 // 文字描画域の位置Y (ピクセル単位)
|
||||
|
||||
#define TEXT_HSPACE 1 // 文字列描画時の文字間 (ピクセル単位)
|
||||
#define TEXT_VSPACE 1 // 文字列描画時の行間 (ピクセル単位)
|
||||
|
||||
#define CHARACTER_OFFSET 1 // 使用するキャラクタ列の先頭キャラクタネーム
|
||||
|
||||
#define MAX_OBJ_NUM 128
|
||||
#define REPEAT_THRESHOLD 22
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// グローバル変数
|
||||
|
||||
NNSG2dFont gFont; // フォント
|
||||
NNSG2dCharCanvas gCanvas; // CharCanvas
|
||||
NNSG2dTextCanvas gTextCanvas; // TextCanvas
|
||||
|
||||
const char* gErrMsg = NULL;
|
||||
int gCanvasWidth = CANVAS_WIDTH;
|
||||
int gCanvasHeight = CANVAS_HEIGHT;
|
||||
GXOamColorMode gColorMode = GX_OAM_COLORMODE_16;
|
||||
NNSG2dOBJVramMode gVramMode = NNS_G2D_OBJVRAMMODE_32K;
|
||||
|
||||
//****************************************************************************
|
||||
// Initialize etc.
|
||||
//****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: IsValidCharCanvasSize
|
||||
|
||||
Description: CharCanvas のサイズが正常に表示可能なものかどうか判定します。
|
||||
ただし、サイズ超過は判定しません。
|
||||
|
||||
Arguments: areaWidth: CharCanvas の幅(キャラクタ単位)
|
||||
areaHeight: CharCanvas の高さ(キャラクタ単位)
|
||||
colorMode: CharCanvas のカラーモード
|
||||
vramMode: OBJ VRAM 容量
|
||||
|
||||
Returns: 正常に表示可能なら TRUE を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL IsValidCharCanvasSize(
|
||||
int areaWidth,
|
||||
int areaHeight,
|
||||
GXOamColorMode colorMode,
|
||||
NNSG2dOBJVramMode vramMode
|
||||
)
|
||||
{
|
||||
NNS_G2D_ASSERT( (colorMode == GX_OAM_COLORMODE_16)
|
||||
|| (colorMode == GX_OAM_COLORMODE_256) );
|
||||
NNS_G2D_ASSERT( (vramMode == NNS_G2D_OBJVRAMMODE_32K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_64K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_128K)
|
||||
|| (vramMode == NNS_G2D_OBJVRAMMODE_256K) );
|
||||
|
||||
// サイズは正でなければならない
|
||||
if( areaWidth <= 0 || areaHeight <= 0 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( (colorMode == GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_128K)
|
||||
|| (colorMode != GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_256K) )
|
||||
{
|
||||
// 「奇数と「4で割った余りが3の値」の組み合わせは不可」のケース。
|
||||
// これは「どちらかが偶数または共に4で割ったあまりが3でないなら可」と同値なので
|
||||
// これで判定する。
|
||||
return ((areaWidth % 2) == 0)
|
||||
|| ((areaHeight % 2) == 0)
|
||||
|| ((areaWidth % 4) != 3 && (areaHeight % 4) != 3);
|
||||
}
|
||||
else if( colorMode == GX_OAM_COLORMODE_16 && vramMode == NNS_G2D_OBJVRAMMODE_256K )
|
||||
{
|
||||
// 共に偶数でなければならない。
|
||||
return (areaWidth % 2) == 0 && (areaHeight % 2) == 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: OffsetCharName
|
||||
|
||||
Description: 1D マッピングOBJでキャラクタネームが指し示すアドレスを取得します。
|
||||
|
||||
Arguments: pCharBase: OBJのキャラクタベース
|
||||
charName: 対象のキャラクタネーム
|
||||
vramMode: VRAM モード
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void* OffsetCharName(
|
||||
void* pCharBase,
|
||||
int charName,
|
||||
NNSG2dOBJVramMode vramMode )
|
||||
{
|
||||
u32 addr = (u32)pCharBase;
|
||||
addr += sizeof(GXCharFmt16) * (charName << vramMode);
|
||||
return (void*)addr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SDKToNNSColorMode
|
||||
|
||||
Description: NITRO-SDK のカラーモード列挙子から NITRO-System の
|
||||
カラーモード列挙子に変換します。
|
||||
|
||||
Arguments: sdk: NITRO-SDKのカラーモード列挙子
|
||||
|
||||
Returns: sdk に対応する NITRO-System のカラーモード列挙子を返します。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static inline NNSG2dCharaColorMode SDKToNNSColorMode(GXOamColorMode sdk)
|
||||
{
|
||||
static const NNSG2dCharaColorMode nns[] =
|
||||
{ NNS_G2D_CHARA_COLORMODE_16, NNS_G2D_CHARA_COLORMODE_256 };
|
||||
|
||||
NNS_MINMAX_ASSERT(sdk, 0, 1);
|
||||
return nns[sdk];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: ResetOAM
|
||||
|
||||
Description: OAMをリセットします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void ResetOAM(void)
|
||||
{
|
||||
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: HandleInput
|
||||
|
||||
Description: 入力を読み取ります。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: 入力によって内部状態が変更されたらTRUE。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static BOOL HandleInput(void)
|
||||
{
|
||||
BOOL bChanged = FALSE;
|
||||
|
||||
#define REPEAT(key) ((repeat_count >= REPEAT_THRESHOLD) ? CMN_IsPress(key): CMN_IsTrigger(key))
|
||||
{
|
||||
static int repeat_count = 0;
|
||||
int old_cw = gCanvasWidth;
|
||||
int old_ch = gCanvasHeight;
|
||||
|
||||
if( CMN_IsTrigger(PAD_BUTTON_A) )
|
||||
{
|
||||
gColorMode = (gColorMode != GX_OAM_COLORMODE_16) ?
|
||||
GX_OAM_COLORMODE_16:
|
||||
GX_OAM_COLORMODE_256;
|
||||
bChanged = TRUE;
|
||||
}
|
||||
if( CMN_IsTrigger(PAD_BUTTON_B) )
|
||||
{
|
||||
gVramMode++;
|
||||
if( gVramMode > NNS_G2D_OBJVRAMMODE_256K )
|
||||
{
|
||||
gVramMode = NNS_G2D_OBJVRAMMODE_32K;
|
||||
}
|
||||
bChanged = TRUE;
|
||||
}
|
||||
if( REPEAT(PAD_KEY_UP) )
|
||||
{
|
||||
gCanvasHeight--;
|
||||
}
|
||||
if( REPEAT(PAD_KEY_DOWN) )
|
||||
{
|
||||
gCanvasHeight++;
|
||||
}
|
||||
if( REPEAT(PAD_KEY_LEFT) )
|
||||
{
|
||||
gCanvasWidth--;
|
||||
}
|
||||
if( REPEAT(PAD_KEY_RIGHT) )
|
||||
{
|
||||
gCanvasWidth++;
|
||||
}
|
||||
if( gCanvasWidth < 1 )
|
||||
{
|
||||
gCanvasWidth = 1;
|
||||
}
|
||||
if( gCanvasHeight < 1 )
|
||||
{
|
||||
gCanvasHeight = 1;
|
||||
}
|
||||
if( MAX_OBJ_NUM < NNS_G2dCalcRequiredOBJ1D(gCanvasWidth, gCanvasHeight) )
|
||||
{
|
||||
// 使える OBJ の最大数を超えた
|
||||
gCanvasWidth = old_cw;
|
||||
gCanvasHeight = old_ch;
|
||||
gErrMsg = "OBJ OVERFLOW";
|
||||
bChanged = TRUE;
|
||||
}
|
||||
{
|
||||
const int maxChr = ((1024 << gVramMode) >> gColorMode) - CHARACTER_OFFSET;
|
||||
|
||||
//
|
||||
if( maxChr < (gCanvasWidth + 1) * (gCanvasHeight + 1) )
|
||||
{
|
||||
// 使えるキャラクタの最大数を超えた
|
||||
gCanvasWidth = old_cw;
|
||||
gCanvasHeight = old_ch;
|
||||
gErrMsg = "Character OVERFLOW";
|
||||
bChanged = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if( gCanvasWidth != old_cw || gCanvasHeight != old_ch )
|
||||
{
|
||||
bChanged = TRUE;
|
||||
}
|
||||
if( CMN_IsPress(PAD_PLUS_KEY_MASK) )
|
||||
{
|
||||
repeat_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
repeat_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitScreen
|
||||
|
||||
Description: OBJ表示の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitScreen(void)
|
||||
{
|
||||
// OBJ を可視に
|
||||
CMN_SetPlaneVisible( GX_PLANEMASK_OBJ );
|
||||
|
||||
// カラーパレットを設定
|
||||
GX_LoadOBJPltt(TXTColorPalette, 0, sizeof(TXTColorPalette));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: InitCanvas
|
||||
|
||||
Description: 文字列描画の初期化をします。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void InitCanvas(void)
|
||||
{
|
||||
void* const pCharBase = G2_GetOBJCharPtr();
|
||||
GXOamAttr* const pObjBase = (GXOamAttr*)HW_OAM;
|
||||
const int cOffset = CHARACTER_OFFSET;
|
||||
int nObjs;
|
||||
|
||||
|
||||
// マッピングモード設定
|
||||
switch( gVramMode )
|
||||
{
|
||||
case NNS_G2D_OBJVRAMMODE_32K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_64K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_64K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_128K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_128K); break;
|
||||
case NNS_G2D_OBJVRAMMODE_256K: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_256K); break;
|
||||
default: GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); break;
|
||||
}
|
||||
|
||||
|
||||
// CharCanvas の初期化
|
||||
NNS_G2dCharCanvasInitForOBJ1D(
|
||||
&gCanvas,
|
||||
OffsetCharName(pCharBase, cOffset, gVramMode),
|
||||
// VRAM参照可能サイズによってキャラクタネーム境界が異なるため補正する
|
||||
|
||||
gCanvasWidth,
|
||||
gCanvasHeight,
|
||||
SDKToNNSColorMode(gColorMode)
|
||||
);
|
||||
|
||||
// Canvasクリア
|
||||
NNS_G2dCharCanvasClear(&gCanvas, TXT_COLOR_WHITE);
|
||||
|
||||
// OBJを配置
|
||||
nObjs = NNS_G2dArrangeOBJ1D(
|
||||
pObjBase,
|
||||
gCanvasWidth,
|
||||
gCanvasHeight,
|
||||
CANVAS_LEFT,
|
||||
CANVAS_WIDTH,
|
||||
gColorMode,
|
||||
cOffset,
|
||||
gVramMode
|
||||
);
|
||||
|
||||
// OBJを設定
|
||||
TXT_SetCharCanvasOBJAttrs(
|
||||
pObjBase, // OAM配列へのポインタ
|
||||
nObjs, // 対象とするOAMの数
|
||||
0, // priority
|
||||
GX_OAM_MODE_NORMAL, // OBJモード
|
||||
FALSE, // モザイク
|
||||
GX_OAM_EFFECT_NONE, // OBJ効果
|
||||
TXT_CPALETTE_MAIN, // パレット番号
|
||||
0 // アフィンパラメータインデックス
|
||||
);
|
||||
|
||||
// TextCanvasの初期化
|
||||
NNS_G2dTextCanvasInit(
|
||||
&gTextCanvas,
|
||||
&gCanvas,
|
||||
&gFont,
|
||||
TEXT_HSPACE,
|
||||
TEXT_VSPACE
|
||||
);
|
||||
|
||||
// 使用中のOBJ数
|
||||
DTX_PrintLine("using OBJ: %3d", nObjs);
|
||||
|
||||
if( ! IsValidCharCanvasSize(gCanvasWidth, gCanvasHeight, gColorMode, gVramMode) )
|
||||
{
|
||||
gErrMsg = "INVALID CharCanvas size";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleDraw
|
||||
|
||||
Description: サンプルの描画処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleDraw(void)
|
||||
{
|
||||
// 文字描画
|
||||
NNS_G2dTextCanvasDrawText(&gTextCanvas, 1, 1, TXT_COLOR_BLACK, TXT_DRAWTEXT_FLAG_DEFAULT,
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n"
|
||||
"bcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789a\n"
|
||||
"cdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ab\n"
|
||||
"defghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abc\n"
|
||||
"efghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcd\n"
|
||||
"fghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcde\n"
|
||||
"ghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdef\n"
|
||||
"hijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefg\n"
|
||||
"ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefgh\n"
|
||||
"jklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghi\n"
|
||||
"klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghij\n"
|
||||
"lmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijk\n"
|
||||
"mnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijkl\n"
|
||||
"nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklm\n"
|
||||
"opqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmn\n"
|
||||
"pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmno\n"
|
||||
"qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnop\n"
|
||||
"rstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopq\n"
|
||||
"stuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqr\n"
|
||||
"tuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrs\n"
|
||||
"uvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrst\n"
|
||||
"vwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstu\n"
|
||||
"wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuv\n"
|
||||
"xyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvw\n"
|
||||
"yzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwx\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PrintSampleInfo
|
||||
|
||||
Description: サンプルの情報をした画面に出力します。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void PrintSampleInfo(void)
|
||||
{
|
||||
static const char* colorModeString[] =
|
||||
{
|
||||
"GX_OAM_COLORMODE_16",
|
||||
"GX_OAM_COLORMODE_256"
|
||||
};
|
||||
static const char* vramModeString[] =
|
||||
{
|
||||
"NNS_G2D_OBJVRAMMODE_32K",
|
||||
"NNS_G2D_OBJVRAMMODE_64K",
|
||||
"NNS_G2D_OBJVRAMMODE_128K",
|
||||
"NNS_G2D_OBJVRAMMODE_256K"
|
||||
};
|
||||
|
||||
DTX_PrintLine(
|
||||
"1D mapping OBJ CharCanvas Sample\n"
|
||||
"operation\n"
|
||||
" A change color mode\n"
|
||||
" B change vram mode\n"
|
||||
" + change canvas size\n"
|
||||
);
|
||||
DTX_PrintLine("color mode: %s", colorModeString[gColorMode]);
|
||||
DTX_PrintLine("vram mode: %s", vramModeString[gVramMode]);
|
||||
DTX_PrintLine("canvas size: %2d x %2d", gCanvasWidth, gCanvasHeight);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleInit
|
||||
|
||||
Description: サンプルの初期化処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleInit(void)
|
||||
{
|
||||
// フォントを読み込みます
|
||||
TXT_LoadFont( &gFont, TXT_FONTRESOURCE_NAME );
|
||||
|
||||
PrintSampleInfo();
|
||||
|
||||
InitScreen();
|
||||
InitCanvas();
|
||||
SampleDraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: SampleMain
|
||||
|
||||
Description: サンプルのメイン処理です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void SampleMain(void)
|
||||
{
|
||||
gErrMsg = NULL;
|
||||
|
||||
if( HandleInput() )
|
||||
{
|
||||
PrintSampleInfo();
|
||||
|
||||
ResetOAM();
|
||||
InitCanvas();
|
||||
|
||||
SampleDraw();
|
||||
DC_StoreAll();
|
||||
|
||||
if( gErrMsg != NULL )
|
||||
{
|
||||
DTX_PrintLine("\n\n\n\n !!! %s !!!", gErrMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// Main
|
||||
//****************************************************************************
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: NitroMain
|
||||
|
||||
Description: メイン関数です。
|
||||
|
||||
Arguments: なし。
|
||||
|
||||
Returns: なし。
|
||||
*---------------------------------------------------------------------------*/
|
||||
void NitroMain(void)
|
||||
{
|
||||
// Initilizing App.
|
||||
{
|
||||
// SDK とデモライブラリを初期化
|
||||
OS_Init();
|
||||
TXT_Init();
|
||||
|
||||
// 背景を設定
|
||||
TXT_SetupBackground();
|
||||
|
||||
// サンプルの初期化処理
|
||||
SampleInit();
|
||||
}
|
||||
|
||||
// start display
|
||||
{
|
||||
CMN_WaitVBlankIntr();
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while( TRUE )
|
||||
{
|
||||
CMN_ReadGamePad();
|
||||
|
||||
// サンプルのメイン処理
|
||||
SampleMain();
|
||||
|
||||
CMN_WaitVBlankIntr();
|
||||
|
||||
// 情報出力の表示
|
||||
DTX_Reflect();
|
||||
}
|
||||
}
|
||||
|
43
add-ins/TwlSystem/build/demos/g2d/Text/OBJ2DRect/Makefile
Executable file
43
add-ins/TwlSystem/build/demos/g2d/Text/OBJ2DRect/Makefile
Executable file
@ -0,0 +1,43 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: NITRO-System - demos - g2d - Text - OBJ2DRect
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2004-2008 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Revision: 172 $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
NNS_USELIBS = g2d gfd fnd
|
||||
|
||||
G2D_TEXTDEMOLIB = ../textdemolib
|
||||
|
||||
LINCLUDES = $(G2D_TEXTDEMOLIB)/include
|
||||
LLIBRARY_DIRS = $(G2D_TEXTDEMOLIB)/lib/$(NITRO_BUILDTYPE)
|
||||
LLIBRARIES = libg2d_textdemo.a
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SRCS = main.c
|
||||
TARGET_BIN = main.srl
|
||||
|
||||
MAKEROM_ROMROOT = ../
|
||||
MAKEROM_ROMFILES = ./data/*.*
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
|
||||
include $(NITROSYSTEM_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user