CW版のハングルフォントチェッカーを削除

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@148 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
akabane_jumpei 2009-01-28 02:18:33 +00:00
parent 7113896da7
commit 6183280d8c
75 changed files with 0 additions and 6198 deletions

View File

@ -1,532 +0,0 @@
#---------------------------------------------------------------------------
# Project: NitroSDK - tools - makelcf
# File: ARM9-TS.lcf.template
#
# Copyright 2003-2007 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Log: ARM9-TS.lcf.template,v $
# Revision 1.44 2007/07/09 12:49:10 yasu
# TARGET_NAME のサポート
#
# Revision 1.43 2007/07/09 07:12:55 yasu
# MAINEX セクションのサポート
#
# Revision 1.42 2007/06/21 00:16:01 yasu
# MAINEX セグメント定義をロールバック
#
# Revision 1.41 2007/06/20 10:32:39 yasu
# static initializer や C++ コンストラクタの Autoload 対応
#
# Revision 1.40 2007/06/19 11:55:13 yasu
# lcf.template 内に MAINEX の定義追加
#
# Revision 1.39 2007/04/12 00:11:41 yasu
# 著作年度修正
#
# Revision 1.38 2007/04/10 14:05:45 yasu
# 複数の SEARCH_SYMBOL 対応
#
# Revision 1.37 2006/07/20 07:29:12 kitase_hirotake
# .version セクションに関する説明コメントの追加
#
# Revision 1.36 2006/07/18 11:11:01 yasu
# check.xTCM による TCM 領域のオーバーフローチェックにおいて
# OVERLAY 領域のサイズの取得方法に誤りがあり、現状正確な計算方法が
# 不明であるため OVERLAY 領域の加算を取りやめた
#
# Revision 1.35 2006/05/10 03:19:47 yasu
# CodeWarrior 2.x のオーバーレイ拡張への対応
#
# Revision 1.34 2006/04/06 09:02:36 kitase_hirotake
# .itcm.bss .dtcm.bss に対応
#
# Revision 1.33 2006/03/30 23:59:22 yasu
# 著作年度の変更
#
# Revision 1.32 2006/03/29 13:14:22 yasu
# CWVER 2.x でのオーバーレイのサポート
#
# Revision 1.31 2005/11/24 01:16:47 yada
# change start address of mainEX arena from 0x2400000 to 0x23e0000
#
# Revision 1.30 2005/09/02 04:14:22 yasu
# SDK2.2 でも使用可能のように古いシンボルを再定義した
#
# Revision 1.29 2005/08/31 09:34:57 yasu
# section_BSS というようなセクション名を使ったときに正常に動作しない場合があるのを修正
#
# Revision 1.28 2005/08/26 11:22:16 yasu
# ITCM/DTCM への overlay の対応
#
# Revision 1.27 2005/06/20 12:29:20 yasu
# Surffix -> Suffix 修正
#
# Revision 1.26 2005/06/14 09:03:42 yada
# fix around minus value of SDK_STACKSIZE
#
# Revision 1.25 2005/04/13 12:51:00 terui
# Change SDK_AUTOLOAD.DTCM.START 0x027c0000 -> 0x027e0000
#
# Revision 1.24 2005/03/30 00:02:14 yosizaki
# fix copyright header.
#
# Revision 1.23 2005/03/25 12:54:59 yasu
# Include .version section
#
# Revision 1.22 2004/10/03 02:00:56 yasu
# Output component file list for compstatic tool
#
# Revision 1.21 2004/09/27 05:28:21 yasu
# Support .sinit
#
# Revision 1.20 2004/09/09 11:49:20 yasu
# Support compstatic in default
#
# Revision 1.19 2004/09/06 06:40:00 yasu
# Add labels for digest
#
# Revision 1.18 2004/08/20 06:19:59 yasu
# DTCM moves to 0x027c0000 at default
#
# Revision 1.17 2004/08/02 10:38:53 yasu
# Add autoload-done callback address in overlaydefs
#
# Revision 1.16 2004/07/26 02:22:32 yasu
# Change DTCM address to 0x023c0000
#
# Revision 1.15 2004/07/26 00:08:27 yasu
# Fix label of exception table
#
# Revision 1.14 2004/07/24 05:42:25 yasu
# Set default values for SDK_AUTOGEN_xTCM_START
#
# Revision 1.13 2004/07/23 11:32:14 yasu
# Define labels for __exception_table_start__ and _end__
#
# Revision 1.12 2004/07/12 12:21:08 yasu
# Check size of ITCM/DTCM
#
# Revision 1.11 2004/07/10 04:10:26 yasu
# Support command 'Library'
#
# Revision 1.10 2004/07/02 08:13:02 yasu
# Support OBJECT( )
#
# Revision 1.9 2004/07/01 12:54:38 yasu
# support ITCM/DTCM/WRAM autoload
#
# Revision 1.8 2004/07/01 10:41:46 yasu
# support autoload
#
# Revision 1.7 2004/06/02 07:35:37 yasu
# Set libsyscall.a in FORCE_ACTIVE
# Put NitroMain at the top of ROM image
#
# Revision 1.6 2004/06/02 04:56:28 yasu
# Change to fit to new ROM map of TS
#
# Revision 1.5 2004/06/01 06:12:00 miya
# add padding at top of ROM image.
#
# Revision 1.4 2004/04/26 12:16:48 yasu
# add KEEP_SECTIONS
#
# Revision 1.3 2004/04/20 07:41:32 yasu
# Set STATICINIT instead of .ctor temporarily
#
# Revision 1.2 2004/04/14 07:16:42 yasu
# add ALIGN(32) for convenience to handle cache line
#
# Revision 1.1 2004/04/06 01:59:54 yasu
# newly added
#
# $NoKeywords: $
#---------------------------------------------------------------------------
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);
. = 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);
. = 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
}

View File

@ -1 +0,0 @@
"%NITROSDK_ROOT%\tools\bin\makelcf.exe" "C:\home\HanglefontCheck_custom_forCW\Nitro.lcf.lsf" "C:\NitroSDK\include\nitro\specfiles\ARM9-TS.lcf.template" "C:\home\HanglefontCheck_custom_forCW\Nitro.lcf"

View File

@ -1,28 +0,0 @@
# Auto-Generated Linker Command Script Spec File
Static main
{
Address 0x02000000
Object GROUP(ROOT)
StackSize 0 1024
}
Autoload ITCM
{
Address 0x01ff8000
Object * (.itcm)
}
Autoload DTCM
{
Address 0x027e0000
Object * (.dtcm)
}
Property
{
OverlayDefs %_defs
OverlayTable %_table
Surffix .sbin
}

View File

@ -1,31 +0,0 @@
/*
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

View File

@ -1,18 +0,0 @@
/*
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>

View File

@ -1,17 +0,0 @@
/*
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>

View File

@ -1,118 +0,0 @@
#----------------------------------------------------------------------------
# Project: NitroSDK - include
# File: ROM-TS.lsf
#
# Copyright 2003-2005 Nintendo. All rights reserved.
#
# These coded insructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Log: ROM-TS.rsf,v $
# Revision 1.6 2005/04/05 23:52:58 yosizaki
# fix copyright date.
#
# Revision 1.5 2005/04/05 12:16:10 yosizaki
# support RomSpeedType parameter.
#
# Revision 1.4 2004/09/21 02:18:49 yasu
# Add default banner
#
# Revision 1.3 2004/09/09 11:39:09 yasu
# Unified ROM-TS and ROM-TS-C, also ROM-TEG and ROM-TEG-C
#
# Revision 1.2 2004/05/26 12:03:38 yasu
# add :r option to get basename for supporting IDE with makerom
#
# Revision 1.1 2004/04/06 01:59:59 yasu
# newly added
#
# $NoKeywords: $
#----------------------------------------------------------------------------
#
# 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
Align 512
Padding 0xFF
HostRoot ../../../data
Root /data/
File *.*
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

View File

@ -1,6 +0,0 @@
set path=%NITROSYSTEM_ROOT%/tools/win/bin
g2dcvtr.exe font_up3.nsc -o/..
g2dcvtr.exe font_dw.nsc -o/..
pause

View File

@ -1,15 +0,0 @@
perl -w fonttbl.pl -o ..\..\src\fontgrpdata.c -i %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_15x15.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_15x15.NFTR -ol 0 -ow 15 -or 0 >15x15.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_14x14.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_14x14.NFTR -ol 0 -ow 14 -or 0 >14x14.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_11x12.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_11x12.NFTR -ol 0 -ow 11 -or 0 >11x12.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_11x11.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_11x11.NFTR -ol 0 -ow 11 -or 0 >11x11.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_10x10.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_10x10.NFTR -ol 0 -ow 10 -or 0 >10x10.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_9x9.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\KS_X1001_X1003.xlor -o nitro -of ..\HANGUL_9x9.NFTR -ol 0 -ow 9 -or 0 >9x9.log

View File

@ -1,15 +0,0 @@
perl -w fonttbl.pl -o ..\..\src\fontgrpdata.c -i %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_15x15.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_15x15.NFTR -ol 0 -ow 15 -or 0 >15x15.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_14x14.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_14x14.NFTR -ol 0 -ow 14 -or 0 >14x14.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_11x12.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_11x12.NFTR -ol 0 -ow 11 -or 0 >11x12.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_11x11.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_11x11.NFTR -ol 0 -ow 11 -or 0 >11x11.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_10x10.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_10x10.NFTR -ol 0 -ow 10 -or 0 >10x10.log
%NITROSYSTEM_ROOT%\tools\win\fontcvtr\fontcvtrc -i bmp -if HANGUL_9x9.bmp -ib 2 -io %NITROSYSTEM_ROOT%\tools\win\fontcvtr\xlor\korean_software_keyboard.xlor -o nitro -of ..\HANGUL_9x9.NFTR -ol 0 -ow 9 -or 0 >9x9.log

View File

@ -1,144 +0,0 @@
#=============================================================================#
# @file fonttbl.pl
# @brief xlorファイルからNITROインデックステーブルを作成
# @author Kazumasa Hirata
# @note usage:
# perl tonttbl.pl [-o output-file] [-i imput-file]
#=============================================================================#
use strict;
use Getopt::Std;
use File::Basename;
use vars qw( $opt_o $opt_i );
#------------------------------------------------------------#
# メインプログラム
#------------------------------------------------------------#
{
getopt('oi');
#引数チェック
if( !$opt_o || !$opt_i ){
die <<EOF;
usage: perl tonttbl.pl [-o output-file] [-i imput-file]
EOF
}
my $jarfile = $ARGV[0];
print "output = $opt_o\n";
print "imput = $opt_i\n";
#入力ファイルを読み込み
open FH, "$opt_i" or die "can't open file $opt_i: $!";
my @imput = <FH>;
close FH;
#出力ファイルオープン
open FH, ">$opt_o" or die "can't open file $opt_o: $!";
#必要なデータをコンバートして出力する
my $startflag = 0;
my @namelist;
my @titlelist;
foreach my $line ( @imput ){
chomp $line;
$line = "//$line";
my $str;
#フォントグループ開始かどうか
if( $line =~ /<!-- ((\w|\s|\/|-)+) -->/ )
{
$str = $1;
$titlelist[ @titlelist ] = $str;
#アルファベットと数字以外の文字はアンダーバーに置換
$str =~ s/(\s|\/|-)+/_/g;
$namelist[ @namelist ] = $str;
#配列名前っぽく出力
$str = "const unsigned short $str\[\] = {";
#配列終端の挿入
if( $startflag == 1 ){ #既に配列宣言済みなら、それを
$str = "};\n$str"; #まずは終わらせる
}
$startflag = 1; #配列宣言が始まったらフラグを立てる
}
#スペースとヌル以外で、HTMLタグ開始文字<がある行は対象外
elsif( ($line =~ /</) && !($line =~ /<sp\/>/) && !($line =~ /<null\/>/) )
{
}
#対象文字列を詳しく調べる
else
{
$str = $line;
#コメントを殺す
$str =~ s/\/\///;
#スペースをスプリットとして文字列を分解する
my @array = split /\s+/, $str;
#分解した文字要素ごとに置換作業
foreach my $word ( @array ){
#spの整形
$word =~ s/<sp\/>/&#x0000;/;
#nullの整形
$word =~ s/<null\/>/&#x0000;/;
#特殊な代替文字の整形
$word =~ s/&quot;/&#x0022;/;
$word =~ s/&amp;/&#x0026;/;
$word =~ s/&apos;/&#x0027;/;
$word =~ s/&lt;/&#x003C;/;
$word =~ s/&gt;/&#x003E;/;
#16進数の整形
$word =~ s/&#x([0-9A-F]+);/0x$1/;
#ASCII文字の16進変換
if( length($word)==1 && 0x20<=ord($word) && ord($word)<=0x7E ){
$word = sprintf "0x%04x", ord($word);
}
}
#デミリタを設定して結合する
$str = join ',', @array;
$str =~ s/^,//; #先頭に付着するデリミタ削除(なんか頭いい方法あったはずだが・・・)
$str =~ s/$/,/;
$str =~ s/^,$//;
}
#変換前の行を出力
print FH "$line\n";
#変換後文字列があるなら出力
if( defined($str) ){
print FH "$str\n";
}
}
#最終の配列の終わりを出力
print FH "};\n";
#テーブルの要素数の計算
foreach ( @namelist ) {
print FH "const unsigned short Count_of_$_ = sizeof\($_\)/sizeof\($_\[0\]\);\n";
}
#テーブルの名前の出力
for( my $i=0; $i<@titlelist; $i++ ) {
print FH "const char * const Title_of_$namelist[$i] = \"$titlelist[$i]\";\n";
}
close FH;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 KiB

View File

@ -1,22 +0,0 @@
4桁の数字(上画面)
160.16
176
192
208
1行目
32.64
52.
72
92
112
132
152
172
192
212
2行目
y座標が104でお願いします。

View File

@ -1,30 +0,0 @@
4桁の番号
96.16
黒字に白文字
15*15→72.64
14*14→96.64
11*12→120.64
11*11→144.64
9*9→168.64
白地に黒文字
15*15→72.96
14*14→96.96
11*12→120.96
11*11→144.96
9*9→168.96
下の文字一覧
16.168
40
64
88
112
136
160
184
208
232

View File

@ -1,32 +0,0 @@
/*===============================================================*//**
@file main.cpp
@brief
@author Kazumasa Hirata
*//*================================================================*/
//****************************************************************************
// Include
//****************************************************************************
#include <nitro.h>
#include "FontView.h"
//****************************************************************************
// Code
//****************************************************************************
/*------------------------------------------------*//**
* @brief
*//*------------------------------------------------*/
void NitroMain()
{
OS_Printf("Welcome to CodeWarrior for NINTENDO DS\n");
FontView();
//本来ここにはこない
OS_Terminate();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +0,0 @@
/*===============================================================*//**
@file FontView.h
@brief NITRO-SYSTEM UTF16Text
@author Kazumasa Hirata
*//*================================================================*/
#ifndef FONTVIEW_H_
#define FONTVIEW_H_
#define USE_OLD_FONTS
void FontView();
#endif // FONTVIEW_H_

View File

@ -1,14 +0,0 @@
#ifndef TEXTTABLE_H_INCLUDE
#define TEXTTABLE_H_INCLUDE
#define NNS_G2D_UNICODE // 文字列描画関数が扱う文字をUnicodeにする
#include <nitro.h>
#include <nnsys/g2d/g2d_TextCanvas.h>
#include <nnsys/g2d/g2d_CharCanvas.h>
typedef const NNSG2dChar * Texts[3];
extern const Texts g_TextTypes;
extern const Texts g_TextTable[];
extern const int g_TextTable_Num;
#endif // TEXTTABLE_H_INCLUDE

View File

@ -1,244 +0,0 @@
/*===============================================================*//**
@file TextWnd.cpp
@brief nitro-systemを使ってのBGフォント表示機能を
使
nnsys_demo_lib/txt.hのLCDレジスタ設定に依存
@author Kazumasa Hirata
*//*================================================================*/
//****************************************************************************
// Include
//****************************************************************************
#include "TextWnd.h"
//****************************************************************************
// Define
//****************************************************************************
// 使用するキャラクタ列の開始番号
#define CHARACTER_OFFSET 1
//****************************************************************************
// コード
//****************************************************************************
//キャンバスのクリア
void BaseFontWnd::Clear(int color)
{
NNS_G2dCharCanvasClear(&gCanvas, color);
}
//しかくけい
void BaseFontWnd::Fill( int x, int y, int w, int h, int color )
{
if( w > 0 && h > 0 ){
NNS_G2dCharCanvasClearArea(&gCanvas, color, x, y, w, h );
}
}
//文字出力
void BaseFontWnd::PrintGlyphIndex(const NNSG2dFont *pFont, int x,int y, u16 index, int color )
{
NNSG2dGlyph g;
NNS_G2dFontGetGlyphFromIndex( &g, pFont, index );
NNS_G2dCharCanvasDrawGlyph( &gCanvas, pFont, x, y, color, &g );
}
//文字出力
void BaseFontWnd::PrintChar(const NNSG2dFont *pFont, int x,int y, u16 code, int color )
{
NNS_G2dCharCanvasDrawChar( &gCanvas, pFont, x, y, color, code );
}
//文字列出力
void BaseFontWnd::PrintUnicodeString(const NNSG2dFont *pFont, int x,int y, const NNSG2dChar* const str, int color )
{
//フォントを元に戻すために現在設定されているフォントを取得する
const NNSG2dFont* pBak = NNS_G2dTextCanvasGetFont( &gTextCanvas );
//フォント変更
NNS_G2dTextCanvasSetFont( &gTextCanvas, pFont );
//文字列出力
NNS_G2dTextCanvasDrawText(
&gTextCanvas,
x, y,
color,
TXT_DRAWTEXT_FLAG_DEFAULT,
str );
//フォントを元に戻す
NNS_G2dTextCanvasSetFont( &gTextCanvas, pBak );
}
void BaseFontWnd::PrintString(const NNSG2dFont *pFont, int x,int y, const char* const str, int color )
{
NNSG2dChar * p;
//文字列の長さを求める
int len = STD_GetStringLength( str );
//メモリ確保(ヌル文字用に1余分)
p = reinterpret_cast<NNSG2dChar *>(TXT_Alloc( sizeof(NNSG2dChar)*len + 1 ));
if( p ){
//確保したメモリにコピー
for( int i=0; i<len; i++ ){
p[i] = str[i];
}
//終端にヌルを入れる
p[len] = 0x0000;
//文字列を出力
PrintUnicodeString( pFont, x, y, p, color );
//メモリ開放
TXT_Free( p );
}
}
//10進数出力
void BaseFontWnd::PrintDec(const NNSG2dFont *pFont,int x,int y, s32 number, int color )
{
//Asciiで文字列生成
static char buf0[32];
OS_SPrintf( buf0, "%d", number );
//Unicodeに変換
static NNSG2dChar buf[32];
int i;
for( i=0; buf0[i] != 0; i++ ){
buf[i] = buf0[i];
}
buf[i] = 0;
//出力
PrintUnicodeString( pFont,x, y, buf, color );
}
//16進数出力
void BaseFontWnd::PrintHex(const NNSG2dFont *pFont,int x, int y, u32 number, int color )
{
static char buf0[32];
OS_SPrintf( buf0, "%04x", number ); //とりあえず今回4桁しか要らない
static NNSG2dChar buf[32];
int i;
for( i=0; buf0[i] != 0; i++ ){
buf[i] = buf0[i];
}
buf[i] = 0;
PrintUnicodeString( pFont, x, y, buf,color );
}
void MainWnd::Init( const NNSG2dFont *pFont )
{
// Main BG 0 を設定
G2_SetBG0Control(
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
GX_BG_COLORMODE_16, // カラーモード 16色
GX_BG_SCRBASE_0x0000, // スクリーンベース
GX_BG_CHARBASE_0x00000, // キャラクタベース
GX_BG_EXTPLTT_01 // 拡張パレットスロット
);
// Main BG0 を可視に
CMN_SetPlaneVisible( GX_PLANEMASK_BG0 );
// CharCanvas の初期化
NNS_G2dCharCanvasInitForBG(
&gCanvas,
gOffBuffer,
CANVAS_WIDTH,
CANVAS_HEIGHT,
NNS_G2D_CHARA_COLORMODE_16
);
// TextCanvasの初期化
NNS_G2dTextCanvasInit(
&gTextCanvas,
&gCanvas,
pFont,
TEXT_HSPACE,
TEXT_VSPACE
);
// スクリーンを設定
NNS_G2dMapScrToCharText(
G2_GetBG0ScrPtr(),
CANVAS_WIDTH,
CANVAS_HEIGHT,
CANVAS_LEFT,
CANVAS_TOP,
NNS_G2D_TEXT_BG_WIDTH_256,
CHARACTER_OFFSET,
TXT_CPALETTE_MAIN
);
}
void MainWnd::Draw()
{
// Vブランク期間中の転送タスクを登録します。
(void)NNS_GfdRegisterNewVramTransferTask(
NNS_GFD_DST_2D_BG0_CHAR_MAIN,
sizeof(GXCharFmt16) * CHARACTER_OFFSET,
gOffBuffer,
sizeof(gOffBuffer)
);
}
void SubWnd::Init( const NNSG2dFont *pFont )
{
//SUB BG0 セットアップ
G2S_SetBG0Control(
GX_BG_SCRSIZE_TEXT_256x256, // スクリーンサイズ 256x256
GX_BG_COLORMODE_16, // カラーモード 16色
GX_BG_SCRBASE_0x0000, // スクリーンベース
GX_BG_CHARBASE_0x04000, // キャラクタベース
GX_BG_EXTPLTT_01 // 拡張パレットスロット
);
//可視に
CMN_SetPlaneVisibleSub( GX_PLANEMASK_BG0 );
// CharCanvasの初期化
NNS_G2dCharCanvasInitForBG(
&gCanvas,
gOffBuffer,
CANVAS_WIDTH,
CANVAS_HEIGHT,
NNS_G2D_CHARA_COLORMODE_16
);
// TextCanvasの初期化
NNS_G2dTextCanvasInit(
&gTextCanvas,
&gCanvas,
pFont,
TEXT_HSPACE,
TEXT_VSPACE
);
// スクリーンを設定
NNS_G2dMapScrToCharText(
G2S_GetBG0ScrPtr(),
CANVAS_WIDTH,
CANVAS_HEIGHT,
CANVAS_LEFT,
CANVAS_TOP,
NNS_G2D_TEXT_BG_WIDTH_256,
CHARACTER_OFFSET,
TXT_CPALETTE_MAIN
);
}
void SubWnd::Draw()
{
// Vブランク期間中の転送タスクを登録します。
(void)NNS_GfdRegisterNewVramTransferTask(
NNS_GFD_DST_2D_BG0_CHAR_SUB,
sizeof(GXCharFmt16) * CHARACTER_OFFSET,
gOffBuffer,
sizeof(gOffBuffer)
);
}

View File

@ -1,101 +0,0 @@
/*===============================================================*//**
@file TextWnd.h
@brief nitro-systemを使ってのBGフォント表示機能を
使
nnsys_demo_lib/txt.hのLCDレジスタ設定に依存
@author Kazumasa Hirata
*//*================================================================*/
#ifndef TEXTWND_H_
#define TEXTWND_H_
//****************************************************************************
// Include
//****************************************************************************
//任天堂ライブラリ
// #ifndef NNS_G2D_UNICODE
#define NNS_G2D_UNICODE // 文字列描画関数が扱う文字をUnicodeにする
// #endif
#include <nitro.h>
#include <nnsys/g2d/g2d_TextCanvas.h>
#include <nnsys/g2d/g2d_CharCanvas.h>
//任天堂デモ用ライブラリ(一部改変)
#include "nnsys_demo_lib/cmn.h"
#include "nnsys_demo_lib/txt.h"
#include "nnsys_demo_lib/loader.h"
//****************************************************************************
// Declare
//****************************************************************************
//基本となるテキスト表示クラス
class BaseFontWnd {
protected:
NNSG2dCharCanvas gCanvas; // CharCanvas
NNSG2dTextCanvas gTextCanvas; // TextCanvas
static const int TEXT_HSPACE = 1; // 文字列描画時の文字間 (ピクセル単位)
static const int TEXT_VSPACE = 1; // 文字列描画時の行間 (ピクセル単位)
static const int TEXT_COLOR = TXT_COLOR_WHITE;
static const int BACK_COLOR = TXT_COLOR_NULL;
public:
//インターフェイス
/* 仮想関数テーブルがもったいないので消しておく
BaseFontWnd();
virtural ~BaseFontWnd() = 0;
virtual void Init() = 0;
virtual void Draw() = 0;
*/
//キャンバスのクリア
void Clear(int color=BACK_COLOR);
//しかくけい
void Fill(int x, int y, int w, int h, int color=TEXT_COLOR );
//文字出力
void PrintGlyphIndex( const NNSG2dFont *pFont, int x,int y, u16 index, int color=TEXT_COLOR );
//文字出力
void PrintChar( const NNSG2dFont *pFont, int x,int y, u16 code, int color=TEXT_COLOR );
//文字列出力
void PrintUnicodeString(const NNSG2dFont *pFont, int x,int y, const NNSG2dChar* const str, int color=TEXT_COLOR );
void PrintString(const NNSG2dFont *pFont, int x,int y, const char* const str, int color=TEXT_COLOR );
//10進数出力
void PrintDec(const NNSG2dFont *pFont, int x,int y, s32 number, int color=TEXT_COLOR );
//16進数出力
void PrintHex(const NNSG2dFont *pFont, int x,int y, u32 number, int color=TEXT_COLOR );
};
//2DグラフィックエンジンAを使用するテキスト表示クラス
class MainWnd : public BaseFontWnd {
static const int CANVAS_LEFT = 0; // 文字描画域の位置X (キャラクタ単位)
static const int CANVAS_TOP = 0; // 文字描画域の位置Y (キャラクタ単位)
static const int CANVAS_WIDTH = 32; // 文字描画域の幅 (キャラクタ単位)
static const int CANVAS_HEIGHT = 24; // 文字描画域の高さ (キャラクタ単位)
GXCharFmt16 gOffBuffer[CANVAS_HEIGHT][CANVAS_WIDTH];
public:
void Init( const NNSG2dFont *pFont );
void Draw();
};
//2DグラフィックエンジンB を使用するテキスト表示クラス
class SubWnd : public BaseFontWnd {
static const int CANVAS_LEFT = 0; // 文字描画域の位置X (キャラクタ単位)
static const int CANVAS_TOP = 0; // 文字描画域の位置Y (キャラクタ単位)
static const int CANVAS_WIDTH = 32; // 文字描画域の幅 (キャラクタ単位)
static const int CANVAS_HEIGHT = 24; // 文字描画域の高さ (キャラクタ単位)
GXCharFmt16 gOffBuffer[CANVAS_HEIGHT][CANVAS_WIDTH];
public:
void Init( const NNSG2dFont *pFont );
void Draw();
};
#endif // TEXTWND_H_

View File

@ -1,149 +0,0 @@
/*===============================================================*//**
@file Pad.cpp
@brief
@author Kazumasa Hirata
(C) Copyright FLOOR Co., Ltd. All rights reserved
*//*==============================================================*/
//----------------------------------------------------------------
// インクルード
//----------------------------------------------------------------
#include "Pad.hpp"
#include <nitro.h>
#include <algorithm> //std::fill
namespace LOB
{
//----------------------------------------------------------------
// 宣言
//----------------------------------------------------------------
//----------------------------------------------------------------
// 定義
//----------------------------------------------------------------
RawReader::RawReader()
: m_Data( PAD_Read() )
{
}
RawReader::RawReader( u16 init )
: m_Data( init )
{
}
u16 RawReader::Update()
{
m_Data = PAD_Read();
return m_Data;
}
TriggerReader::TriggerReader()
: m_Trig( Cont() )
{
}
TriggerReader::TriggerReader( u16 init )
: m_Base( init )
, m_Trig( Cont() )
{
}
u16 TriggerReader::Update()
{
const u16 PrevCont = m_Base.Get(); // 前のやつ退避
const u16 NewCont = m_Base.Update(); // 新しいやつを読み出す
const u16 result = (u16)(NewCont & ( NewCont ^ PrevCont )); // トリガ更新
m_Trig = result;
return result;
}
RepeatReader::RepeatReader( u16 Wait , u16 Interval )
: m_Rept( Trig() )
, m_Wait( Wait )
, m_Interval( Interval )
{
std::fill( &m_Counter[0] , &m_Counter[ NUM_KEYS ] , 0 );
}
RepeatReader::RepeatReader( u16 init )
: m_Base( init )
, m_Rept( Trig() )
, m_Wait( defaultWait )
, m_Interval( defaultInterval )
{
std::fill( &m_Counter[0] , &m_Counter[ NUM_KEYS ] , 0 );
}
RepeatReader::RepeatReader( u16 Wait , u16 Interval , u16 init )
: m_Base( init )
, m_Rept( Trig() )
, m_Wait( Wait )
, m_Interval( Interval )
{
std::fill( &m_Counter[0] , &m_Counter[ NUM_KEYS ] , 0 );
}
u16 RepeatReader::Update()
{
const unsigned trig = m_Base.Update(); // トリガー更新
const unsigned cont = m_Base.Cont();
const unsigned interval = m_Interval;
const int wait = m_Wait;
unsigned rept = 0;
unsigned mask = 1 << ( NUM_KEYS - 1 );
s16* pCounter = &m_Counter[ NUM_KEYS - 1 ];
do {
if( cont & mask )
{
int c; // カウンター更新値
if( !( trig & mask ) )
{// 押しっぱなし
c = *pCounter; // カウンタ読み出し
if( c != wait )
{
++c; // インクリメント
}else
{// リピートトリガー発生
rept |= mask;
c -= interval; // まき戻し
}
}else
{// 押しはじめ
rept |= mask;
c = 0;
}
*pCounter = (s16)c;
}
--pCounter;
} while( mask >>= 1 );
m_Rept = (u16)rept;
return (u16)rept;
}
void RepeatReader::SetWait( u16 Wait )
{
const unsigned cont = m_Base.Cont();
unsigned mask = 1 << ( NUM_KEYS - 1 );
s16* pCounter = &m_Counter[ NUM_KEYS - 1 ];
const int adjust = -m_Wait + Wait;
do {
if( cont & mask )
{// リピート中
*pCounter += adjust; // 元の m_Wait との相対値を保持
}
--pCounter;
} while( mask >>= 1 );
m_Wait = Wait;
}
void RepeatReader::SetInterval( u16 Interval )
{
m_Interval = Interval;
}
} //namespace LOB

View File

@ -1,182 +0,0 @@
/*===============================================================*//**
@file Pad.hpp
@brief
@author Kazumasa Hirata
(C) Copyright FLOOR Co., Ltd. All rights reserved
*//*==============================================================*/
#if !defined( LOB_PAD_HPP_INCLUDED )
#define LOB_PAD_HPP_INCLUDED
//----------------------------------------------------------------
// インクルード
//----------------------------------------------------------------
#include <nitro.h>
//----------------------------------------------------------------
// 宣言
//----------------------------------------------------------------
namespace LOB
{
/*------------------------------------------------*//**
* @brief
*//*------------------------------------------------*/
class RawReader{
u16 m_Data;
public:
/**
* @brief
*/
RawReader();
/**
* @brief
* @param u16 init
*/
explicit RawReader( u16 init );
/**
* @brief
* @return
*/
u16 Update();
/**
* @brief
* @return
*/
u16 Get() const { return m_Data; }
};
/*------------------------------------------------*//**
* @brief
*//*------------------------------------------------*/
class TriggerReader{
RawReader m_Base;
u16 m_Trig;
public:
/**
* @brief
*/
TriggerReader();
/**
* @brief
* @param u16 init
*/
explicit TriggerReader( u16 init );
/**
* @brief
* @return
*/
u16 Update();
/**
* @brief
* @return
*/
u16 Cont() const { return m_Base.Get(); }
/**
* @brief
* @return
*/
u16 Get() const { return m_Trig; }
};
/*------------------------------------------------*//**
* @class RepeatReader
* @brief
*//*------------------------------------------------*/
class RepeatReader{
TriggerReader m_Base;
u16 m_Rept;
u16 m_Wait;
u16 m_Interval;
static const unsigned NUM_KEYS = 10;
u32 dummy;
s16 m_Counter[ NUM_KEYS ];
public:
static const u16 defaultWait = 30;
static const u16 defaultInterval = 4;
/**
* @brief
* @param Wait
* @param Interval
*/
explicit RepeatReader( u16 Wait = defaultWait
, u16 Interval = defaultInterval );
/**
* @brief
* @param init
*/
explicit RepeatReader( u16 init );
/**
* @brief
* @param Wait
* @param Interval
* @param init
*/
RepeatReader( u16 Wait, u16 Interval, u16 init );
/**
* @brief
* @return
*/
u16 Update();
/**
* @brief
* @return
*/
u16 Cont() const { return m_Base.Cont(); }
/**
* @brief
* @return
*/
u16 Trig() const { return m_Base.Get(); }
/**
* @brief
* @return
*/
u16 Get() const { return m_Rept; }
/**
* @brief
* @param Wait
*/
void SetWait( u16 Wait );
/**
* @brief
* @param Interval
*/
void SetInterval( u16 Interval );
/**
* @brief
* @return Wait
*/
u16 GetWait() const { return m_Wait; }
/**
* @brief
* @return Interval
*/
u16 GetInterval() const { return m_Interval; }
};
} //namespace LOB
#endif //#if !defined( LOB_PAD_HPP_INCLUDED )

View File

@ -1,378 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: cmn.c
Copyright 2005 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.
$Log: cmn.c,v $
Revision 1.1 2005/05/20 04:34:35 hatamoto_minoru
NitroSystem
Revision 1.5 2005/03/10 08:18:55 hatamoto_minoru
API
Revision 1.4 2005/02/18 09:37:55 hatamoto_minoru
sign/unsign警告に対処
Revision 1.3 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.2 2005/02/01 11:52:30 hatamoto_minoru
typo修正
SDKのMATHに置き換え
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
Revision 1.3 2004/09/29 08:50:24 hatamoto_minoru
Revision 1.2 2004/09/15 08:57:52 hatamoto_minoru
CMN_LoadFile
Revision 1.1 2004/09/10 11:21:25 hatamoto_minoru
$NoKeywords: $
*---------------------------------------------------------------------------*/
#include "cmn.h"
#include <nitro.h>
#include <nnsys.h>
// ゲームパッド
CMNGamePad CMNGamePadState;
/*---------------------------------------------------------------------------*
Name: CMN_InitInterrupt
Description:
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void CMN_InitInterrupt( void )
{
// 個別割り込みフラグを全て不許可に
(void)OS_SetIrqMask(0);
// マスター割り込みフラグを許可に
(void)OS_EnableIrq();
}
/*---------------------------------------------------------------------------*
Name: CMN_BeginVBlankIntr
Description: Vブランク割り込みの発生を開始します
Arguments: vBlankFunc: Vブランク割り込みハンドラへのポインタ
Returns:
*---------------------------------------------------------------------------*/
void CMN_BeginHVBlankIntr( OSIrqFunction hBlankFunc, OSIrqFunction vBlankFunc )
{
if( vBlankFunc ){
// 割り込みハンドラ登録
OS_SetIrqFunction(OS_IE_V_BLANK, vBlankFunc);
// Blank割り込み許可
(void)OS_EnableIrqMask( OS_IE_V_BLANK );
// Blank割り込み生成開始
(void)GX_VBlankIntr(TRUE);
}
if( hBlankFunc ){
// 割り込みハンドラ登録
OS_SetIrqFunction(OS_IE_H_BLANK, hBlankFunc);
// Blank割り込み許可
(void)OS_EnableIrqMask( OS_IE_H_BLANK );
// Blank割り込み生成開始
(void)GX_HBlankIntr(TRUE);
}
}
/*---------------------------------------------------------------------------*
Name: CMN_InitAllocator
Description:
Arguments: pAllocator:
Returns:
*---------------------------------------------------------------------------*/
void CMN_InitAllocator( NNSFndAllocator* pAllocator )
{
u32 arenaLow = MATH_ROUNDUP ((u32)OS_GetMainArenaLo(), 16);
u32 arenaHigh = MATH_ROUNDDOWN((u32)OS_GetMainArenaHi(), 16);
u32 heapSize = arenaHigh - arenaLow;
void* heapMemory = OS_AllocFromMainArenaLo(heapSize, 16);
NNSFndHeapHandle heapHandle;
SDK_NULL_ASSERT( pAllocator );
heapHandle = NNS_FndCreateExpHeap(heapMemory, heapSize);
SDK_ASSERT( heapHandle != NNS_FND_HEAP_INVALID_HANDLE );
NNS_FndInitAllocatorForExpHeap(pAllocator, heapHandle, 4);
}
/*---------------------------------------------------------------------------*
Name: CMN_InitFileSystem
Description:
Arguments: pAllocator:
Returns:
*---------------------------------------------------------------------------*/
// ファイルシステム準備
void CMN_InitFileSystem( NNSFndAllocator* pAllocator )
{
SDK_NULL_ASSERT( pAllocator );
// ARM7との通信FIFO割り込み許可
(void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV);
// ファイルシステム初期化
FS_Init( FS_DMA_NOT_USE );
// ファイルテーブルキャッシュ
if( pAllocator != NULL )
{
const u32 need_size = FS_GetTableSize();
void *p_table = NNS_FndAllocFromAllocator( pAllocator, need_size );
SDK_ASSERT(p_table != NULL);
(void)FS_LoadTable(p_table, need_size);
}
}
/*---------------------------------------------------------------------------*
Name: CMN_ClearVram
Description: VRAM
VRAM
Arguments:
Returns:
*---------------------------------------------------------------------------*/
// VRAMクリア
void CMN_ClearVram( void )
{
//---------------------------------------------------------------------------
// 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
}
/*---------------------------------------------------------------------------*
Name: CMN_ReadGamePad
Description:
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void CMN_ReadGamePad(void)
{
u16 status = PAD_Read();
CMNGamePadState.trigger = (u16)(status & (status ^ CMNGamePadState.button));
CMNGamePadState.release = (u16)(CMNGamePadState.button & (status ^ CMNGamePadState.button));
CMNGamePadState.button = status;
}
/*---------------------------------------------------------------------------*
Name: CMN_LoadFile
Description:
CMN_UnloadFile( *ppFile, pAlloc )
Arguments: ppFile:
fpath:
pAlloc:
Returns:
0
*ppFile
*---------------------------------------------------------------------------*/
u32 CMN_LoadFile(void** ppFile, const char* fpath, NNSFndAllocator* pAlloc)
{
BOOL bSuccess;
FSFile f;
u32 length;
u32 read;
SDK_NULL_ASSERT( ppFile );
SDK_NULL_ASSERT( fpath );
SDK_NULL_ASSERT( pAlloc );
FS_InitFile(&f);
bSuccess = FS_OpenFile(&f, fpath);
if( ! bSuccess )
{
OS_Warning("file (%s) not found", fpath);
return 0;
}
length = FS_GetLength(&f);
*ppFile = NNS_FndAllocFromAllocator(pAlloc, length);
if( *ppFile == NULL )
{
OS_Warning("cant allocate memory for file: %s", fpath);
return 0;
}
read = (u32)FS_ReadFile(&f, *ppFile, (s32)length);
if( read != length )
{
OS_Warning("fail to load file: %s", fpath);
NNS_FndFreeToAllocator(pAlloc, *ppFile);
return 0;
}
bSuccess = FS_CloseFile(&f);
if( ! bSuccess )
{
OS_Warning("fail to close file: %s", fpath);
}
return length;
}
/*---------------------------------------------------------------------------*
Name: CMN_UnloadFile
Description:
Arguments: pFile:
pAlloc:
Returns:
*---------------------------------------------------------------------------*/
void CMN_UnloadFile(void* pFile, NNSFndAllocator* pAlloc)
{
NNS_FndFreeToAllocator(pAlloc, pFile);
}
/*---------------------------------------------------------------------------*
Name: CMN_LoadArchive
Description:
CMN_RemoveArchive( , pAllocator )
Arguments: name:
path:
pAllocator:
Returns: NNSFndArchive
NULLを返します
*---------------------------------------------------------------------------*/
NNSFndArchive*
CMN_LoadArchive(const char* name, const char* path, NNSFndAllocator* pAllocator)
{
FSFile file;
NNSFndArchive* archive = NULL;
SDK_NULL_ASSERT(name);
SDK_NULL_ASSERT(path);
SDK_NULL_ASSERT(pAllocator);
FS_InitFile(&file);
if (FS_OpenFile(&file, path))
{
u32 binarySize = FS_GetLength(&file);
u32 memorySize = MATH_ROUNDUP(sizeof(NNSFndArchive), 16) + MATH_ROUNDUP(binarySize, 16);
u8* memory = (u8*)NNS_FndAllocFromAllocator(pAllocator, memorySize);
if (memory != NULL)
{
u8* binary = memory + MATH_ROUNDUP(sizeof(NNSFndArchive), 16);
if ((u32)FS_ReadFile(&file, binary, (s32)binarySize) == binarySize)
{
if (NNS_FndMountArchive((NNSFndArchive*)memory, name, binary))
{
archive = (NNSFndArchive*)memory;
}
}
}
(void)FS_CloseFile(&file);
}
return archive;
}
/*---------------------------------------------------------------------------*
Name: CMN_RemoveArchive
Description:
Arguments: archive: NNSアーカイブ構造体へのポインタ
pAllocator:
Returns:
*---------------------------------------------------------------------------*/
void
CMN_RemoveArchive(NNSFndArchive* archive, NNSFndAllocator* pAllocator)
{
SDK_NULL_ASSERT(archive);
SDK_NULL_ASSERT(pAllocator);
(void)NNS_FndUnmountArchive(archive);
NNS_FndFreeToAllocator(pAllocator, archive);
}

View File

@ -1,144 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: cmn.h
Copyright 2005 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.
$Log: cmn.h,v $
Revision 1.1 2005/05/20 05:52:37 hatamoto_minoru
NitroSystem
Revision 1.5 2005/03/10 08:18:55 hatamoto_minoru
API
Revision 1.4 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.3 2005/02/01 11:52:06 hatamoto_minoru
typo修正
Revision 1.2 2005/01/25 01:49:34 hatamoto_minoru
CallTraceを無効に
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
Revision 1.4 2004/11/30 09:18:25 hatamoto_minoru
include
Revision 1.3 2004/09/29 08:46:57 hatamoto_minoru
Revision 1.2 2004/09/15 08:57:52 hatamoto_minoru
CMN_LoadFile
Revision 1.1 2004/09/10 11:21:25 hatamoto_minoru
$NoKeywords: $
*---------------------------------------------------------------------------*/
#ifndef CMN_H_
#define CMN_H_
#include <nitro/types.h>
#include <nitro/os/common/interrupt.h>
#include <nitro/os/common/arena.h>
#include <nitro/os/common/alloc.h>
#include <nnsys/fnd/allocator.h>
#include <nnsys/fnd/archive.h>
#ifdef __cplusplus
extern "C" {
#endif
#define ARY_SIZEOF(ary) ( sizeof(ary) / sizeof( (ary)[0] ) )
#define ROUNDUP_DIV(a, b) (( (a) + ((b) - 1) ) / (b))
const static float ONE_FRAME_US = 16715.1; // 1フレームは 16715.1 us
const static float ONE_VBLANK_US = 4512.4; // Vブランク期間は 4512.4 us
typedef struct CMNGamePad
{
u16 trigger;
u16 release;
u16 button;
}
CMNGamePad;
extern CMNGamePad CMNGamePadState;
void CMN_InitInterrupt( void );
void CMN_BeginHVBlankIntr( OSIrqFunction hBlankFunc , OSIrqFunction vBlankFunc );
void CMN_InitAllocator( NNSFndAllocator* pAllocator );
void CMN_InitFileSystem( NNSFndAllocator* pAllocator );
void CMN_ClearVram( void );
void CMN_ReadGamePad(void);
u32 CMN_LoadFile(void** ppFile, const char* fpath, NNSFndAllocator* pAlloc);
void CMN_UnloadFile(void* pFile, NNSFndAllocator* pAlloc);
NNSFndArchive* CMN_LoadArchive(const char* name, const char* path, NNSFndAllocator* pAllocator);
void CMN_RemoveArchive(NNSFndArchive* archive, NNSFndAllocator* pAllocator);
static inline u16 CMN_IsTrigger(u16 key)
{
return (u16)(CMNGamePadState.trigger & key);
}
static inline u16 CMN_IsRelease(u16 key)
{
return (u16)(CMNGamePadState.release & key);
}
static inline u16 CMN_IsPress(u16 key)
{
return (u16)(CMNGamePadState.button & key);
}
static inline void CMN_WaitVBlankIntr(void)
{
OS_WaitIrq(TRUE, OS_IE_V_BLANK);
}
static inline void CMN_SetPlaneVisible(GXPlaneMask plane)
{
GX_SetVisiblePlane(GX_GetVisiblePlane() | plane);
}
static inline void CMN_SetPlaneInvisible(GXPlaneMask plane)
{
GX_SetVisiblePlane(GX_GetVisiblePlane() & ~plane);
}
static inline void CMN_SetPlaneVisibleSub(GXPlaneMask plane)
{
GXS_SetVisiblePlane(GXS_GetVisiblePlane() | plane);
}
static inline void CMN_SetPlaneInvisibleSub(GXPlaneMask plane)
{
GXS_SetVisiblePlane(GXS_GetVisiblePlane() & ~plane);
}
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // CMN_H_

View File

@ -1,168 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: loader.c
Copyright 2005 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.
$Log: loader.c,v $
Revision 1.1 2005/05/20 04:34:35 hatamoto_minoru
NitroSystem
Revision 1.5 2005/03/18 09:19:46 hatamoto_minoru
API変更に対応
Revision 1.4 2005/03/10 08:18:55 hatamoto_minoru
API
Revision 1.3 2005/02/18 09:37:55 hatamoto_minoru
sign/unsign警告に対処
Revision 1.2 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
Revision 1.2 2004/11/30 09:16:33 hatamoto_minoru
LoadNFTR()
Revision 1.1 2004/09/10 11:21:25 hatamoto_minoru
$NoKeywords: $
*---------------------------------------------------------------------------*/
#include "loader.h"
#include <nitro.h>
#include <nnsys/g2d/g2d_Font.h>
#define LoadXXXX(ppData, pFname, pAlloc, unpack, print) \
void* pFile = NULL; \
\
SDK_NULL_ASSERT( ppData ); \
SDK_NULL_ASSERT( pFname ); \
\
pFile = LoadFileToMainMem_( pFname, pAlloc ); \
if( pFile != NULL ) \
{ \
if( unpack( pFile, ppData ) ) \
{ \
print( *ppData ); \
return pFile; \
} \
\
NNS_FndFreeToAllocator( pAlloc, pFile ); \
} \
\
return NULL; \
static void* LoadFileToMainMem_( const char* pFname, NNSFndAllocator* pAllocator )
{
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 = NNS_FndAllocFromAllocator( pAllocator, szFile );
SDK_NULL_ASSERT( pFile );
if( szFile != (u32)FS_ReadFile( &file, pFile, (s32)szFile ) )
{
NNS_FndFreeToAllocator( pAllocator, pFile );
pFile = NULL;
}
bSuccess = FS_CloseFile( &file );
SDK_ASSERT( bSuccess );
}else{
OS_Warning(" Can't find the file : %s ", pFname );
}
return pFile;
}
void* LoadNCER( NNSG2dCellDataBank** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedCellBank, NNS_G2dPrintCellBank );
}
void* LoadNANR( NNSG2dAnimBankData** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedAnimBank, NNS_G2dPrintAnimBank);
}
void* LoadNMCR( NNSG2dMultiCellDataBank** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedMultiCellBank, NNS_G2dPrintMultiCellBank );
}
void* LoadNMAR( NNSG2dMultiCellAnimBankData** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedMCAnimBank, NNS_G2dPrintAnimBank);
}
void* LoadNCGR( NNSG2dCharacterData** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedCharacterData, NNS_G2dPrintCharacterData );
}
void* LoadNCLR( NNSG2dPaletteData** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedPaletteData, NNS_G2dPrintPaletteData );
}
void* LoadNENR( NNSG2dEntityDataBank** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedEntityBank, NNS_G2dPrintEntityDataBank );
}
void* LoadNCBR( NNSG2dCharacterData** ppData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppData, pFname, pAllocator, NNS_G2dGetUnpackedCharacterData, NNS_G2dPrintCharacterData );
}
void* LoadNSCR( NNSG2dScreenData** ppScrData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppScrData, pFname, pAllocator, NNS_G2dGetUnpackedScreenData, NNS_G2dPrintScreenData);
}
void* LoadNCGRforBG( NNSG2dCharacterData** ppCharData, const char* pFname, NNSFndAllocator* pAllocator )
{
LoadXXXX(ppCharData, pFname, pAllocator, NNS_G2dGetUnpackedBGCharacterData, NNS_G2dPrintCharacterData);
}
void* LoadNFTR( NNSG2dFont* pFont, const char* pFname, NNSFndAllocator* pAllocator )
{
void* pFile = NULL;
SDK_NULL_ASSERT( pFont );
SDK_NULL_ASSERT( pFname );
pFile = LoadFileToMainMem_( pFname, pAllocator );
if( pFile != NULL )
{
NNS_G2dFontInitAuto(pFont, pFile);
NNS_G2dPrintFont(pFont);
return pFile;
}
return NULL;
}

View File

@ -1,66 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: loader.h
Copyright 2005 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.
$Log: loader.h,v $
Revision 1.1 2005/05/20 05:52:38 hatamoto_minoru
NitroSystem
Revision 1.3 2005/03/18 09:19:46 hatamoto_minoru
API変更に対応
Revision 1.2 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
Revision 1.2 2004/11/30 09:16:33 hatamoto_minoru
LoadNFTR()
Revision 1.1 2004/09/10 11:21:25 hatamoto_minoru
$NoKeywords: $
*---------------------------------------------------------------------------*/
#ifndef LOAD_H_
#define LOAD_H_
#include <nnsys/fnd.h>
#include <nnsys/g2d.h>
#include <nnsys/g2d/g2d_Font.h>
#include <nnsys/g2d/load/g2d_NFT_load.h>
#ifdef __cplusplus
extern "C" {
#endif
void* LoadNCER( NNSG2dCellDataBank** ppCellBank, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNANR( NNSG2dAnimBankData** ppAnimBank, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNMCR( NNSG2dMultiCellDataBank** ppMCBank, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNMAR( NNSG2dMultiCellAnimBankData** ppMCABank, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNCGR( NNSG2dCharacterData** ppCharData, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNCLR( NNSG2dPaletteData** ppPltData, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNENR( NNSG2dEntityDataBank** ppEntityBank, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNCBR( NNSG2dCharacterData** ppCharData, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNSCR( NNSG2dScreenData** ppScrData, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNCGRforBG( NNSG2dCharacterData** ppCharData, const char* pFname, NNSFndAllocator* pAllocator );
void* LoadNFTR( NNSG2dFont* pFont, const char* pFname, NNSFndAllocator* pAllocator );
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // LOAD_H_

View File

@ -1,229 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: txt.c
Copyright 2005 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.
$Log: txt.c,v $
Revision 1.1 2005/05/20 04:34:35 hatamoto_minoru
NitroSystem
Revision 1.6 2005/03/28 02:15:09 hatamoto_minoru
TXT_LoadFile
Revision 1.5 2005/03/18 09:19:46 hatamoto_minoru
API変更に対応
Revision 1.4 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.3 2005/02/01 11:53:15 hatamoto_minoru
Revision 1.2 2005/01/25 01:42:45 hatamoto_minoru
TXT_SetCharCanvasOBJAttrs()
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
$NoKeywords: $
*---------------------------------------------------------------------------*/
#include "txt.h"
#include <nnsys.h>
#include "cmn.h"
#include "loader.h"
static NNSFndAllocator sAllocator;
// デモ共通のカラーパレット
GXRgb TXTColorPalette[32] =
{
GX_RGB( 0, 0, 0), // NULL
GX_RGB(31, 31, 31), GX_RGB(25, 25, 25), GX_RGB(22, 22, 22), GX_RGB(20, 20, 20),
GX_RGB( 0, 0, 0), GX_RGB( 6, 6, 6), GX_RGB( 8, 8, 8), GX_RGB(10, 10, 10),
GX_RGB( 0, 0, 0), GX_RGB( 0, 0, 0), GX_RGB( 0, 0, 0), GX_RGB( 0, 0, 0),
GX_RGB( 0, 0, 0), GX_RGB( 0, 0, 0), GX_RGB( 0, 0, 0),
GX_RGB( 0, 0, 0), GX_RGB(12, 16, 19), GX_RGB(23, 9, 0), GX_RGB(31, 0, 3),
GX_RGB(31, 17, 31), GX_RGB(31, 18, 0), GX_RGB(30, 28, 0), GX_RGB(21, 31, 0),
GX_RGB( 0, 20, 7), GX_RGB( 9, 27, 17), GX_RGB( 6, 23, 30), GX_RGB( 0, 11, 30),
GX_RGB( 0, 0, 18), GX_RGB(17, 0, 26), GX_RGB(26, 0, 29), GX_RGB(31, 0, 18),
};
//****************************************************************************
//
//****************************************************************************
/*---------------------------------------------------------------------------*
Name: TXT_Init
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void TXT_Init( OSIrqFunction hBlankFunc, OSIrqFunction vBlankFunc )
{
// Common initialization.
OS_Init();
FX_Init();
GX_Init();
GX_DispOff();
GXS_DispOff();
CMN_InitInterrupt();
CMN_BeginHVBlankIntr( hBlankFunc, vBlankFunc );
CMN_ClearVram();
CMN_InitAllocator( &sAllocator );
CMN_InitFileSystem( &sAllocator );
}
/*---------------------------------------------------------------------------*
Name: TXT_Alloc
Description:
Arguments: size:
Returns:
*---------------------------------------------------------------------------*/
void* TXT_Alloc(u32 size)
{
return NNS_FndAllocFromAllocator( &sAllocator, size );
}
/*---------------------------------------------------------------------------*
Name: TXT_Free
Description: TXT_Alloc()
Arguments: ptr:
Returns:
*---------------------------------------------------------------------------*/
void TXT_Free(void* ptr)
{
NNS_FndFreeToAllocator( &sAllocator, ptr );
}
/*---------------------------------------------------------------------------*
Name: TXT_LoadFont
Description:
Arguments: pFname:
Returns:
*---------------------------------------------------------------------------*/
void TXT_LoadFont( NNSG2dFont* pFont, const char* pFname )
{
void* pBuf;
pBuf = LoadNFTR( pFont, pFname, &sAllocator );
if( pBuf == NULL ) {
OS_Panic("Fail to load font file(%s).", pFname);
}
return;
}
/*---------------------------------------------------------------------------*
Name: TXT_LoadFile
Description:
Arguments: ppFile:
fpath:
Returns:
0
*ppFile
*---------------------------------------------------------------------------*/
u32 TXT_LoadFile(void** ppFile, const char* fpath)
{
return CMN_LoadFile(ppFile, fpath, &sAllocator);
}
/*---------------------------------------------------------------------------*
Name: TXT_SetupBackground
Description: BG0に背景画像をロード
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void TXT_SetupBackground( void )
{
void* pPltFile;
void* pChrFile;
void* pScnFile;
NNSG2dPaletteData* pPltData;
NNSG2dCharacterData* pChrData;
NNSG2dScreenData* pScnData;
pPltFile = LoadNCLR( &pPltData, "/data/font_up3.NCLR", &sAllocator );
SDK_NULL_ASSERT( pPltFile );
pChrFile = LoadNCGR( &pChrData, "/data/font_up3.NCGR", &sAllocator );
SDK_NULL_ASSERT( pChrFile );
pScnFile = LoadNSCR( &pScnData, "/data/font_up3.NSCR", &sAllocator );
SDK_NULL_ASSERT( pScnFile );
GX_SetVisiblePlane(GX_PLANEMASK_BG1);
G2_SetBG1Priority(3);
NNS_G2dBGSetup(
NNS_G2D_BGSELECT_MAIN1,
pScnData,
pChrData,
pPltData,
GX_BG_SCRBASE_0x7800,
GX_BG_CHARBASE_0x38000
);
NNS_FndFreeToAllocator( &sAllocator, pPltFile );
NNS_FndFreeToAllocator( &sAllocator, pChrFile );
NNS_FndFreeToAllocator( &sAllocator, pScnFile );
pPltFile = LoadNCLR( &pPltData, "/data/font_dw.NCLR", &sAllocator );
SDK_NULL_ASSERT( pPltFile );
pChrFile = LoadNCGR( &pChrData, "/data/font_dw.NCGR", &sAllocator );
SDK_NULL_ASSERT( pChrFile );
pScnFile = LoadNSCR( &pScnData, "/data/font_dw.NSCR", &sAllocator );
SDK_NULL_ASSERT( pScnFile );
GXS_SetVisiblePlane(GX_PLANEMASK_BG1);
G2S_SetBG1Priority(3);
NNS_G2dBGSetup(
NNS_G2D_BGSELECT_SUB1,
pScnData,
pChrData,
pPltData,
GX_BG_SCRBASE_0x0800,
GX_BG_CHARBASE_0x0c000
);
NNS_FndFreeToAllocator( &sAllocator, pPltFile );
NNS_FndFreeToAllocator( &sAllocator, pChrFile );
NNS_FndFreeToAllocator( &sAllocator, pScnFile );
}
void TXT_EnableBackground( void )
{
GX_SetVisiblePlane( GX_GetVisiblePlane() | GX_PLANEMASK_BG1 );
GXS_SetVisiblePlane( GXS_GetVisiblePlane() | GX_PLANEMASK_BG1 );
}
void TXT_DisableBackground( void )
{
GX_SetVisiblePlane( GX_GetVisiblePlane() & (~GX_PLANEMASK_BG1) );
GXS_SetVisiblePlane( GXS_GetVisiblePlane() & (~GX_PLANEMASK_BG1) );
}

View File

@ -1,238 +0,0 @@
/*---------------------------------------------------------------------------*
Project: NITRO-System - build - demos - g2d - Text - textdemolib
File: txt.h
Copyright 2005 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.
$Log: txt.h,v $
Revision 1.3 2005/05/30 10:17:05 hatamoto_minoru
ISO8859からCP1252へ
Revision 1.2 2005/05/23 06:17:12 hatamoto_minoru
ISO-8859-1
Revision 1.1 2005/05/20 05:52:38 hatamoto_minoru
NitroSystem
Revision 1.9 2005/03/28 02:15:09 hatamoto_minoru
TXT_LoadFile
Revision 1.8 2005/03/18 09:19:46 hatamoto_minoru
API変更に対応
Revision 1.7 2005/03/10 08:18:55 hatamoto_minoru
API
Revision 1.6 2005/02/08 09:52:51 hatamoto_minoru
Revision 1.5 2005/02/08 04:06:59 hatamoto_minoru
Revision 1.4 2005/02/04 00:15:13 hatamoto_minoru
Revision 1.3 2005/02/01 11:53:15 hatamoto_minoru
Revision 1.2 2005/01/25 01:42:45 hatamoto_minoru
TXT_SetCharCanvasOBJAttrs()
Revision 1.1 2005/01/21 01:03:09 hatamoto_minoru
TextDraw
$NoKeywords: $
*---------------------------------------------------------------------------*/
#ifndef TEXT_H_
#define TEXT_H_
#define NNS_G2D_UNICODE // 文字列描画関数が扱う文字をUnicodeにする
#include <nnsys/g2d/g2d_Font.h>
#ifdef __cplusplus
extern "C" {
#endif
// DrawText での左上寄せ
#define TXT_DRAWTEXT_FLAG_DEFAULT (NNS_G2D_VERTICALORIGIN_TOP | NNS_G2D_HORIZONTALORIGIN_LEFT | NNS_G2D_HORIZONTALALIGN_LEFT)
// デモ用フォントリソース名
#define TXT_FONTRESOURCE_NAME "/data/fonts.NFTR"
#define TXT_SJIS_FONTRESOURCE_NAME "/data/fonts.NFTR"
#define TXT_UTF8_FONTRESOURCE_NAME "/data/fontu8.NFTR"
#define TXT_UTF16_FONTRESOURCE_NAME "/data/fontu16.NFTR"
#define TXT_CP1252_FONTRESOURCE_NAME "/data/font1252.NFTR"
// TXTColorPalette の色名 16色パレットへのロードを想定
enum
{
// パレット0 TXT_CPALETTE_MAIN
TXT_COLOR_NULL=0,
TXT_COLOR_WHITE,
TXT_COLOR_WHITE_1,
TXT_COLOR_WHITE_2,
TXT_COLOR_WHITE_3,
TXT_COLOR_BLACK,
TXT_COLOR_BLACK_1,
TXT_COLOR_BLACK_2,
TXT_COLOR_BLACK_3,
// パレット1 TXT_CPALETTE_USERCOLOR
TXT_UCOLOR_NULL=0,
TXT_UCOLOR_GRAY,
TXT_UCOLOR_BROWN,
TXT_UCOLOR_RED,
TXT_UCOLOR_PINK,
TXT_UCOLOR_ORANGE,
TXT_UCOLOR_YELLOW,
TXT_UCOLOR_LIMEGREEN,
TXT_UCOLOR_DARKGREEN,
TXT_UCOLOR_SEAGREEN,
TXT_UCOLOR_TURQUOISE,
TXT_UCOLOR_BLUE,
TXT_UCOLOR_DARKBLUE,
TXT_UCOLOR_PURPLE,
TXT_UCOLOR_VIOLET,
TXT_UCOLOR_MAGENTA
};
// TXTColorPalette のパレット名 16色パレットへのロードを想定
enum
{
TXT_CPALETTE_MAIN,
TXT_CPALETTE_USERCOLOR
};
// 共通カラーパレットデータ
extern GXRgb TXTColorPalette[32];
//****************************************************************************
//
//****************************************************************************
/*---------------------------------------------------------------------------*
Name: TXT_Init
Description:
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void TXT_Init( OSIrqFunction hBlankFunc, OSIrqFunction vBlankFunc );
/*---------------------------------------------------------------------------*
Name: TXT_SetupBackground
Description: BG0に背景画像をロード
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void TXT_SetupBackground( void );
/*---------------------------------------------------------------------------*
Name: TXT_Alloc
Description:
Arguments: size:
Returns:
*---------------------------------------------------------------------------*/
void* TXT_Alloc(u32 size);
/*---------------------------------------------------------------------------*
Name: TXT_Free
Description: TXT_Alloc()
Arguments: ptr:
Returns:
*---------------------------------------------------------------------------*/
void TXT_Free(void* ptr);
/*---------------------------------------------------------------------------*
Name: TXT_SetCharCanvasOBJAttrs
Description: OAMのNNS_G2dArrangeOBJ*
Arguments:
Returns:
*---------------------------------------------------------------------------*/
void TXT_SetCharCanvasOBJAttrs(
GXOamAttr * oam,
int num,
int priority,
GXOamMode mode,
BOOL mosaic,
GXOamEffect effect,
int cParam,
int rsParam
);
/*---------------------------------------------------------------------------*
Name: TXT_LoadFont
Description:
Arguments: pFname:
Returns:
*---------------------------------------------------------------------------*/
void TXT_LoadFont( NNSG2dFont* pFont, const char* pFname );
/*---------------------------------------------------------------------------*
Name: TXT_LoadFile
Description:
Arguments: ppFile:
fpath:
Returns:
0
*ppFile
*---------------------------------------------------------------------------*/
u32 TXT_LoadFile(void** ppFile, const char* fpath);
void TXT_EnableBackground( void );
void TXT_DisableBackground( void );
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif // TEXT_H_