diff --git a/build/tests/DispOwnerInfo/Makefile b/build/tests/DispOwnerInfo/Makefile new file mode 100644 index 00000000..1cfbe132 --- /dev/null +++ b/build/tests/DispOwnerInfo/Makefile @@ -0,0 +1,103 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: debugIPL2 +# File: Makefile +# +# Copyright 2003,2004 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: Makefile,v $ +# Revision 1.10.2.1 2006/02/01 05:10:42 yosiokat +# ビルドソースにIPLType.cを追加。 +# +# Revision 1.10 2005/04/14 05:53:29 yosiokat +# NITRO設定データ関係を強制的に中国版にするスイッチFORCE_CHINAを追加。 +# +# Revision 1.9 2005/04/07 02:23:25 yosiokat +# リリースタイム更新用のルール追加。 +# +# Revision 1.8 2005/04/06 02:19:03 yosiokat +# ソースのcheckFontData.cをcheckIPL2Font.cに変更。 +# +# Revision 1.7 2005/04/05 08:05:14 yosiokat +# BUILD_MAINTEスイッチによって、共通ソースからDebugToolForIPL2とMaintenanceToolForIPL2 +# をビルドできるよう変更。 +# +# Revision 1.6 2005/03/31 05:45:12 yosiokat +# rev.1.5は間違いNitroConfigData.cに戻す。 +# +# Revision 1.5 2005/03/31 05:44:17 yosiokat +# NitroConfigData.cをnitroConfigData.cに戻す。 +# +# Revision 1.4 2005/03/28 09:34:12 yosiokat +# バナー追加。 +# +# Revision 1.3 2005/03/09 04:44:11 yosiokat +# 機能追加。 +# +# Revision 1.2 2004/09/23 11:27:45 yosiokat +# small fix. +# +# Revision 1.1.1.1 2004/08/31 06:20:24 Yosiokat +# no message +# +# +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +SUBDIRS = banner + +#---------------------------------------------------------------------------- + +TARGET_NEF = DebugForIPL2.nef +TARGET_BIN = DebugForIPL2.srl + +SRCS = main.c initFunc.c font.c data.c dispNCD.c myFunc.c myChar.c + +FONT_DIR = font +FONTS = f08han.dat f08zen.dat f10han.dat f10zen.dat f12han.dat f12zen.dat f16han.dat f16zen.dat +FONT_DATAS = $(addprefix $(FONT_DIR)/, $(FONTS)) +FONT_OBJS = $(FONT_DATAS:.dat=.o) + +ROM_SPEC = main.rsf + +#LCFILE_SPEC = # using default +#SRCDIR = # using default + +# makerom settings +MAKEROM_ROMROOT = ./data +MAKEROM_ROMFILES = *.bin + +LINCLUDES += include +LLIBRARY_DIRS += mlib/$(NITRO_LIBTYPE) +LLIBRARIES += libfnt.a + +LDIRT_CLEAN = $(FONT_DIR)/*.o + +include $(NITROSDK_ROOT)/build/buildtools/commondefs + +CCFLAGS += -DSDK_NCD_LOCAL_USE -DD$(IPL2_VER) + +#---------------------------------------------------------------------------- + +do-build: $(FONT_OBJS) $(TARGETS) + +include $(NITROSDK_ROOT)/build/buildtools/modulerules + +OBJS_STATIC += $(FONT_OBJS) + +$(TARGETS) : $(MAKEROM_ARM7) + +$(FONT_DIR)/%.o : $(FONT_DIR)/%.dat + $(CW_BINDIR)/BinToElf.exe $< -aligndata 4 -endian little -output $@ + +release: + updateReleasetime.plx src/mainMenu.c + + +#===== End of Makefile ===== diff --git a/build/tests/DispOwnerInfo/banner/Makefile b/build/tests/DispOwnerInfo/banner/Makefile new file mode 100644 index 00000000..a665404a --- /dev/null +++ b/build/tests/DispOwnerInfo/banner/Makefile @@ -0,0 +1,73 @@ +#! make -f +#--------------------------------------------------------------------------- +# Project: NitroSDK - tools +# File: Makefile +# +# Copyright 2003,2004 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: Makefile,v $ +# Revision 1.3 2005/04/14 05:58:28 yosiokat +# NITRO設定データ関係を強制的に中国版にするスイッチFORCE_CHINAを追加。 +# +# Revision 1.2 2005/04/02 10:00:08 yosiokat +# BUILD_MAINTE=TRUE時には、バナータイトルを変えるようにする。 +# +# Revision 1.1 2005/03/28 09:36:16 yosiokat +# バナー追加。 +# +# Revision 1.2 2004/10/18 05:37:51 yasu +# Fix how to make banners +# +# Revision 1.1 2004/09/21 02:02:53 yasu +# Demo for building final rom +# +# Revision 1.1 2004/09/17 09:10:59 yasu +# Build default banner file for SDK demos +# +# $NoKeywords: $ +#--------------------------------------------------------------------------- +include $(NITROSDK_ROOT)/build/buildtools/commondefs + +BANNER_ICON = myGameIcon.bmp +BANNER_SPEC = myGameBanner.bsf +TARGETS = myGameBanner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_NAME).nbfs \ + $(BANNER_ICON_NAME).nbfc \ + $(BANNER_ICON_NAME).nbfp \ + $(TARGETS:.bnr=.srl) + +include $(NITROSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) + $(NTEXCONV) -no -bg -bgb -bgnc $(BANNER_ICON) >/dev/null && \ + $(MAKEBANNER) -d -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +#---------------------------------------------------------------------------- +# test +#---------------------------------------------------------------------------- +include $(NITROSDK_ROOT)/build/buildtools/commondefs.emtype.ISD + +test: $(TARGETS) + $(ADDBANNER) $(TARGETS) $(TARGETS:.bnr=.srl) +ifdef ISD_NITLOAD + $(ISD_NITLOAD) $(TARGETS:.bnr=.srl) +endif + +# diff --git a/build/tests/DispOwnerInfo/banner/myGameBanner.bsf b/build/tests/DispOwnerInfo/banner/myGameBanner.bsf new file mode 100644 index 00000000..78a2a72c Binary files /dev/null and b/build/tests/DispOwnerInfo/banner/myGameBanner.bsf differ diff --git a/build/tests/DispOwnerInfo/banner/myGameIcon.bmp b/build/tests/DispOwnerInfo/banner/myGameIcon.bmp new file mode 100644 index 00000000..0b2bcfd1 Binary files /dev/null and b/build/tests/DispOwnerInfo/banner/myGameIcon.bmp differ diff --git a/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bncmp b/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bncmp new file mode 100644 index 00000000..29754732 Binary files /dev/null and b/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bncmp differ diff --git a/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bnfr b/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bnfr new file mode 100644 index 00000000..36525719 Binary files /dev/null and b/build/tests/DispOwnerInfo/data/NITRO_LC_Font_s.bnfr differ diff --git a/build/tests/DispOwnerInfo/font/f08han.dat b/build/tests/DispOwnerInfo/font/f08han.dat new file mode 100644 index 00000000..11a56ec7 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f08han.dat differ diff --git a/build/tests/DispOwnerInfo/font/f08zen.dat b/build/tests/DispOwnerInfo/font/f08zen.dat new file mode 100644 index 00000000..c36ef492 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f08zen.dat differ diff --git a/build/tests/DispOwnerInfo/font/f10han.dat b/build/tests/DispOwnerInfo/font/f10han.dat new file mode 100644 index 00000000..8917e0f0 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f10han.dat differ diff --git a/build/tests/DispOwnerInfo/font/f10zen.dat b/build/tests/DispOwnerInfo/font/f10zen.dat new file mode 100644 index 00000000..256b04c1 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f10zen.dat differ diff --git a/build/tests/DispOwnerInfo/font/f12han.dat b/build/tests/DispOwnerInfo/font/f12han.dat new file mode 100644 index 00000000..08bd466f Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f12han.dat differ diff --git a/build/tests/DispOwnerInfo/font/f12zen.dat b/build/tests/DispOwnerInfo/font/f12zen.dat new file mode 100644 index 00000000..ee38836d Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f12zen.dat differ diff --git a/build/tests/DispOwnerInfo/font/f16han.dat b/build/tests/DispOwnerInfo/font/f16han.dat new file mode 100644 index 00000000..6477fda3 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f16han.dat differ diff --git a/build/tests/DispOwnerInfo/font/f16zen.dat b/build/tests/DispOwnerInfo/font/f16zen.dat new file mode 100644 index 00000000..2e1f78f7 Binary files /dev/null and b/build/tests/DispOwnerInfo/font/f16zen.dat differ diff --git a/build/tests/DispOwnerInfo/include/fnt.h b/build/tests/DispOwnerInfo/include/fnt.h new file mode 100644 index 00000000..3f9d6b63 --- /dev/null +++ b/build/tests/DispOwnerInfo/include/fnt.h @@ -0,0 +1,9 @@ +#ifndef FNT_H_ +#define FNT_H_ + +#include "fnt/fnt_enum.h" +#include "fnt/fnt_struct.h" +#include "fnt/fnt_func.h" +#include "fnt/fnt_data.h" + +#endif // FNT_H_ diff --git a/build/tests/DispOwnerInfo/include/fnt/fnt_data.h b/build/tests/DispOwnerInfo/include/fnt/fnt_data.h new file mode 100644 index 00000000..e4a7f162 --- /dev/null +++ b/build/tests/DispOwnerInfo/include/fnt/fnt_data.h @@ -0,0 +1,32 @@ +extern u8 NITRO_LC_Font_t_bncmp[]; +extern u8 NITRO_LC_Font_t_bncmp_end[]; +extern u8 NITRO_LC_Font_t_bnfr[]; +extern u8 NITRO_LC_Font_t_bnfr_end[]; +extern u8 NITRO_LC_Font_s_bncmp[]; +extern u8 NITRO_LC_Font_s_bncmp_end[]; +extern u8 NITRO_LC_Font_s_bnfr[]; +extern u8 NITRO_LC_Font_s_bnfr_end[]; +extern u8 NITRO_LC_Font_Chinese_t_bncmp[]; +extern u8 NITRO_LC_Font_Chinese_t_bncmp_end[]; +extern u8 NITRO_LC_Font_Chinese_t_bnfr[]; +extern u8 NITRO_LC_Font_Chinese_t_bnfr_end[]; +extern u8 NITRO_LC_Font_Chinese_s_bncmp[]; +extern u8 NITRO_LC_Font_Chinese_s_bncmp_end[]; +extern u8 NITRO_LC_Font_Chinese_s_bnfr[]; +extern u8 NITRO_LC_Font_Chinese_s_bnfr_end[]; +extern u8 NITRO_LC_Font_Hangul_t_bncmp[]; +extern u8 NITRO_LC_Font_Hangul_t_bncmp_end[]; +extern u8 NITRO_LC_Font_Hangul_t_bnfr[]; +extern u8 NITRO_LC_Font_Hangul_t_bnfr_end[]; +extern u8 NITRO_LC_Font_Hangul_s_bncmp[]; +extern u8 NITRO_LC_Font_Hangul_s_bncmp_end[]; +extern u8 NITRO_LC_Font_Hangul_s_bnfr[]; +extern u8 NITRO_LC_Font_Hangul_s_bnfr_end[]; +extern u8 NITRO_LC_Font_s_NAT_WW_bncmp[]; +extern u8 NITRO_LC_Font_s_NAT_WW_bncmp_end[]; +extern u8 NITRO_LC_Font_s_NAT_WW_bnfr[]; +extern u8 NITRO_LC_Font_s_NAT_WW_bnfr_end[]; +extern u8 NITRO_LC_Font_s_NAT_KR_bncmp[]; +extern u8 NITRO_LC_Font_s_NAT_KR_bncmp_end[]; +extern u8 NITRO_LC_Font_s_NAT_KR_bnfr[]; +extern u8 NITRO_LC_Font_s_NAT_KR_bnfr_end[]; diff --git a/build/tests/DispOwnerInfo/include/fnt/fnt_enum.h b/build/tests/DispOwnerInfo/include/fnt/fnt_enum.h new file mode 100644 index 00000000..e78252fc --- /dev/null +++ b/build/tests/DispOwnerInfo/include/fnt/fnt_enum.h @@ -0,0 +1,35 @@ +#ifndef FNT_ENUM_H_ +#define FNT_ENUM_H_ + +enum tFntDrawContextType +{ + FNT_DCTYPE_4BITS, + FNT_DCTYPE_8BITS, + FNT_DCTYPE_LAST +}; + +enum tFntPosXOrigin +{ + FNT_POSX_ORIGIN_LEFT, + FNT_POSX_ORIGIN_CENTER, + FNT_POSX_ORIGIN_RIGHT, + FNT_POSX_ORIGIN_LAST +}; + +enum tFntPosYOrigin +{ + FNT_POSY_ORIGIN_TOP, + FNT_POSY_ORIGIN_CENTER, + FNT_POSY_ORIGIN_BOTTOM, + FNT_POSY_ORIGIN_LAST +}; + +enum tFntTextHAlign +{ + FNT_H_ALIGN_LEFT, + FNT_H_ALIGN_CENTER, + FNT_H_ALIGN_RIGHT, + FNT_H_ALIGN_LAST +}; + +#endif // FNT_ENUM_H_ diff --git a/build/tests/DispOwnerInfo/include/fnt/fnt_func.h b/build/tests/DispOwnerInfo/include/fnt/fnt_func.h new file mode 100644 index 00000000..196749b5 --- /dev/null +++ b/build/tests/DispOwnerInfo/include/fnt/fnt_func.h @@ -0,0 +1,50 @@ +#ifndef FNT_FUNC_H_ +#define FNT_FUNC_H_ + +// fnt_utils.c +extern int fnt_GetLeftFromOrigin( tFntPosition posx, int width ); +extern int fnt_GetTopFromOrigin ( tFntPosition posy, int height ); + +// fnt_font.c +extern void fnt_CreateFont ( tFntEntry* font, const void* fontRsrc, const void* cmapRsrc ); +extern void fnt_CreateDrawContext( tFntDrawContext* dc, u16* canvas, u16 width, u16 height, int type, tFntEntry* font ); + +extern void fnt_DrawLetter ( tFntEntry* font, tFntDrawContext* dc, s32 x, s32 y, u16 letter, int palette ); +extern void fnt_DrawLetterGlyph( tFntEntry* font, tFntDrawContext* dc, s32 x, s32 y, u16 glyph, int palette ); +extern void fnt_DrawString ( tFntEntry* font, tFntDrawContext* dc, tFntPosition posx, tFntPosition posy, int step_x, int step_y, const u16* str, int palette ); +extern int fnt_GetLetterWidth ( tFntEntry* font, u16 letter ); +extern int fnt_GetLetterOffset( tFntEntry* font, u16 letter ); +extern void fnt_DrawLetterGlyphFast( tFntEntry* font, tFntDrawContext* dc, s32 x, s32 y, u16 glyph, int palette ); +extern BOOL fnt_SetDefaultLetter( tFntEntry* font, u16 letter ); + +extern const u16* fnt_GetLineWidth ( tFntEntry* font, const u16* str, int* pwidth, int step_x ); +extern int fnt_GetStringWidth ( tFntEntry* font, const u16* str, int step_x ); +extern int fnt_GetStringHeight( tFntEntry* font, const u16* str, int step_y ); + +extern void fnt_ClearRect( tFntDrawContext* dc, u16 x, u16 y, u16 height, u16 width ); + + +// fnt_layout.c +extern void fnt_DrawMessage ( tFntDrawContext* dc, tFntMessage* message, const u16* mes_data ); +extern void fnt_DrawLetterLayout( tFntDrawContext* dc, const void* layout ); +extern tFntMessage* fnt_GetFntMessage ( const void* layout, int index ); +extern const u16* fnt_GetMessage ( const void* layout, int index ); +extern int fnt_GetMessageNum ( const void* layout ); +extern int fnt_LoadCelltoOam ( const void* celldata, GXOamAttr* poam, tFntPosition posx, tFntPosition posy, int cell_index ); +extern int fnt_DrawCellLayout ( const void* celldata, const void* layout, GXOamAttr* poam ); + +// fnt_celldata.c +extern int fnt_GetCellOamNum ( const void* celldata, int index ); +extern tFntCellCharInfo* fnt_GetCellCharInfo ( const void* celldata, int index ); +extern tFntCellCharOam* fnt_GetCellOam ( const void* celldata, int index ); +extern const void* fnt_GetCellObjChar ( const void* celldata ); +extern u32 fnt_GetCellObjCharSizeAll( const void* celldata ); +extern int fnt_GetCellCharVramMode ( const void* celldata ); +extern int fnt_GetCellCharNameShift ( const void* celldata ); + +// fnt_touch.c +extern int fnt_GetFntRegionNum ( const void* base ); +extern tFntRegion* fnt_GetFntRegion ( const void* base, int index ); +extern int fnt_GetHitFntRegionIndex( const void* base, int x, int y ); + +#endif // FNT_FUNC_H_ diff --git a/build/tests/DispOwnerInfo/include/fnt/fnt_struct.h b/build/tests/DispOwnerInfo/include/fnt/fnt_struct.h new file mode 100644 index 00000000..9ff11878 --- /dev/null +++ b/build/tests/DispOwnerInfo/include/fnt/fnt_struct.h @@ -0,0 +1,224 @@ +#ifndef FNT_STRUCT_H_ +#define FNT_STRUCT_H_ + +/** -------------------------------------------------------------------- + セル情報構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntCellInfo +{ + u16 width : 5; // 最大32 + u16 height : 5; // 最大32 + u16 dummy : 6; +} tFntCellInfo; + +/** -------------------------------------------------------------------- + 幅情報構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntWidthEntry +{ + u16 offset : 8; // オフセット(書きはじめまでのピクセル数) + u16 width : 8; // 幅 +} tFntWidthEntry; + +/** -------------------------------------------------------------------- + フォントCMAPの連続領域用構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntCtEntry +{ + u16 start; + u16 end; +} tFntCtEntry; + +/** -------------------------------------------------------------------- + フォント管理構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntEntry +{ + const u16* font_image; // フォントイメージへのポインタ + const u16* cmap; // コード->glyph変換用cmapへのポインタ + tFntCtEntry* ctmap; // コード->glyph変換用cmapへのポインタ + tFntWidthEntry* width_table; // 幅テーブル + u16 glyph_num; // glyph数 + u16 default_glyph; // 見つからなかったときに使われる文字のglyph + s16 cell_size; // 一文字のセルサイズ(ワード単位) + tFntCellInfo cell_info; // セルの情報 + u16 cmap_num; // glyph_comp == 1のときのcmapの数 + u16 ctmap_num; // glyph_comp == 1のときのctmapの数 + u32 glyph_sort : 1; // グリフがソートされているかどうか + u32 glyph_comp : 1; // グリフの連続されている部分が圧縮されているかどうか +} tFntEntry; + +/** -------------------------------------------------------------------- + 描画する先のデバイスコンテキスト管理構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntDrawContext +{ + u16* canvas; + u16 width; + u16 height; + u16 canvas_type; + u8 pad[2]; + tFntEntry* font; +} tFntDrawContext; + + +/** -------------------------------------------------------------------- + レイアウト表示用の構造体 + ----------------------------------------------------------------------*/ +/** -------------------------------------------------------------------- + レイアウトヘッダー + ----------------------------------------------------------------------*/ +typedef struct tagFntLayoutHeader +{ + u8 name[4]; + u16 version; + u16 table_num; +} tFntLayoutHeader; + +/** -------------------------------------------------------------------- + CMAPヘッダー + ----------------------------------------------------------------------*/ +typedef struct tagFntCmapHeader +{ + u32 ct_offset; + u32 cm_offset; +} tFntCmapHeader; + +/** -------------------------------------------------------------------- + レイアウト表示のためのメッセージ構造体 + ----------------------------------------------------------------------*/ +typedef struct tagFntPosition +{ + s16 pos : 12; + u16 pos_origin : 2; + u16 text_align : 2; +} tFntPosition; // この宣言でも、2Bytesにきちんと収まる。処理系によっては、sizeof()でチェックすること。 + + + + +/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + 文字レイアウトを表示するための構造体。 + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +/** -------------------------------------------------------------------- + メッセージ構造体 + + メッセージデータは、 + tFntLayoutHeader header; + tFntMessage message[header.table_num]; + で構成されます。 + ----------------------------------------------------------------------*/ +typedef struct tagFntMessage +{ + // 位置 + tFntPosition x; + tFntPosition y; + + // 文字間隔 + s16 spacing_x : 8; + s16 spacing_y : 8; + + // 色 + u16 color : 8; + u16 palette : 4; + u16 font : 4; + + // メッセージへのオフセット + u32 offset; +} tFntMessage; + + + + +/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + OBJのセルを扱うための構造体 + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +/** -------------------------------------------------------------------- + セル情報構造体 + + セルデータは、 + tFntLayoutHeader header; + tFntCell cell[header.table_num]; + で構成されます。 + ----------------------------------------------------------------------*/ +typedef struct tagFntCell +{ + // 位置 + tFntPosition x; + tFntPosition y; + + // セルキャラクタへのインデックス + u32 cell_index; +} tFntCell; + +/** -------------------------------------------------------------------- + セルキャラクタ情報構造体 + + セルキャラクタデータは、 + tFntLayoutHeader header; + tFntCellCharHeader char_header; + tFntCellCharInfo cellchar_info[header.table_num]; + tFntCellCharOam cellchar_oam[]; + u16 char_data[]; + で構成されます。 + ----------------------------------------------------------------------*/ +/** -------------------------------------------------------------------- + セルキャラクタヘッダ + ----------------------------------------------------------------------*/ +typedef struct tagFntCellCharHeader +{ + u32 cell_offset; // tFntCellChar配列へのオフセット + u32 oam_offset; // tFntOamChar配列へのオフセット + u32 char_offset; // キャラクタデータへのオフセット + u32 char_size; // キャラクタデータのサイズ + u32 char_mode : 3; // OBJVRAMMODE_CHAR_1DのEXOBJフラグ +} tFntCellCharHeader; + +/** -------------------------------------------------------------------- + セルキャラクタ情報 + ----------------------------------------------------------------------*/ +typedef struct tagFntCellCharInfo +{ + u16 width : 8; // セルの大きさ情報。 + u16 height : 8; + u16 oam_index; // oam_offset[oam_index] から、 + u16 oam_num; // oam_num分だけのoamを使用します。 +} tFntCellCharInfo; + +/** -------------------------------------------------------------------- + OAM情報 + ----------------------------------------------------------------------*/ +typedef struct tagFntCellCharOam +{ + GXOamAttr attr; // CharNameの部分は、使用しません。(ロード位置をユーザ定義にするため。) + u16 char_index; // キャラクタデータのインデックス。 + u16 char_num; // キャラクタデータの数。(最大、64ぐらい) +} tFntCellCharOam; + + + + +/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + タッチの場所を取得するための構造体 + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +/** -------------------------------------------------------------------- + リージョン情報 + ----------------------------------------------------------------------*/ +typedef struct tagFntRegion +{ + // 位置 + tFntPosition x; + tFntPosition y; + + // サイズ + u16 width : 8; // セルの大きさ情報。 + u16 height : 8; +} tFntRegion; + +#endif // FNT_STRUCT_H_ diff --git a/build/tests/DispOwnerInfo/main.rsf b/build/tests/DispOwnerInfo/main.rsf new file mode 100644 index 00000000..41bdcfc9 --- /dev/null +++ b/build/tests/DispOwnerInfo/main.rsf @@ -0,0 +1,39 @@ +# +# Nitro ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).sbin" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.sbin" + OverlayTable "$(MAKEROM_ARM9:r)_table.sbin" + Nef "$(MAKEROM_ARM9:r).nef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7:r).sbin" + OverlayDefs "$(MAKEROM_ARM7:r)_defs.sbin" + OverlayTable "$(MAKEROM_ARM7:r)_table.sbin" + Nef "$(MAKEROM_ARM7:r).nef" +} + +Property +{ + BannerFile ./banner/myGameBanner.bnr +# RomSpeedType MROM +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + + Align 512 + Padding 0xFF + + HostRoot data + Root /data + File *.bncmp *.bnfr +} + diff --git a/build/tests/DispOwnerInfo/mlib/ARM9-TS/Release/libfnt.a b/build/tests/DispOwnerInfo/mlib/ARM9-TS/Release/libfnt.a new file mode 100644 index 00000000..8a3c5675 Binary files /dev/null and b/build/tests/DispOwnerInfo/mlib/ARM9-TS/Release/libfnt.a differ diff --git a/build/tests/DispOwnerInfo/mlib/ARM9-TS/Rom/libfnt.a b/build/tests/DispOwnerInfo/mlib/ARM9-TS/Rom/libfnt.a new file mode 100644 index 00000000..6d345064 Binary files /dev/null and b/build/tests/DispOwnerInfo/mlib/ARM9-TS/Rom/libfnt.a differ diff --git a/build/tests/DispOwnerInfo/src/NitroConfigData.h b/build/tests/DispOwnerInfo/src/NitroConfigData.h new file mode 100644 index 00000000..23ff02f9 --- /dev/null +++ b/build/tests/DispOwnerInfo/src/NitroConfigData.h @@ -0,0 +1,679 @@ +/********************************************************************/ +/* NitroConfigData.h */ +/* NITRO-IPL */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + NITR設定データ定義 ヘッダ + + + $Log: NitroConfigData.h,v $ + Revision 1.4.2.2.4.1.4.1 2007/01/22 07:36:16 yosiokat + NAT-IPL2への対応。 + + Revision 1.4.2.5 2006/06/26 02:57:54 yosiokat + ・言語コードを韓国語に対応させる。 + ・一部の定義データの名称変更。 + + Revision 1.4.2.4 2006/02/06 11:34:56 yosiokat + NCD_GetIPL2BM7RomAddr関数の追加。 + + Revision 1.4.2.3 2006/02/06 08:27:19 yosiokat + IPL2バージョンの定義をIPLType.hの定義値を使うよう変更。 + + Revision 1.4.2.2 2005/10/31 08:49:57 yosiokat + USG_BACKLIGHT_DEFAULTを"2"に変更。 + + Revision 1.4.2.1 2005/10/25 08:14:41 yosiokat + USG対応のため、以下の変更を行う。 + ・NitroConfigData構造体にbackLightBrightnessを追加。 + ・IPL2_TYPE判定用の定数定義にUSGのものを追加。 + + Revision 1.4 2005/04/01 05:45:04 yosiokat + 最新版に更新。 + + Revision 1.3 2005/03/31 06:06:54 yosiokat + NitroConfigDataアクセス関数の全面改定。 + + Revision 1.31.2.2 2005/03/16 00:36:01 yosiokat + 言語コードの中国語追加に伴うNitroConfigDataExの新設とNitroConfigDataの取扱いの変更。 + + Revision 1.31.2.1 2005/03/11 11:08:56 yosiokat + 中国語の追加。 + + Revision 1.31 2005/02/15 02:38:27 yosiokat + NCD_CorrectDataの削除。 + + Revision 1.30 2005/02/07 11:12:03 yosiokat + NCD_CorrectDataの追加。 + + Revision 1.29 2004/09/25 10:42:54 Yosiokat + NvOption内のrsv領域にrtcOffset算出用パラメータrtcLastSetYearを保存するよう変更。 + + Revision 1.28 2004/09/16 07:02:51 Yosiokat + オーナー情報のニックネーム、好きな色、誕生日をクリアするNCD_ClearOwnerInfoの追加。 + + Revision 1.27 2004/09/01 09:18:35 Yosiokat + ・NvOptionにdestroyFlashFlagを追加。 + ・上記アクセス関数NCD_GetDestroyFlash、NCD_SetDestroyFlashを追加。 + + Revision 1.26 2004/08/31 09:52:38 Yosiokat + small fix. + + Revision 1.25 2004/08/27 12:36:08 Yosiokat + IPL2_BUILD_をSDK_SMALL_BUILDに変更。 + + Revision 1.24 2004/08/25 09:27:41 Yosiokat + ・必要なくなった下記要素をrsvに変更。(フォーマットの互換を保つため、データは詰めない) + NvAlarm.second + NvAlarm.enableWeek + NvOption.detectPullOutCardFlag + NvOption.detectPullOutCtrdgFlag + NvOption.timezone + + Revision 1.23 2004/08/25 05:12:20 Yosiokat + ブランチタグred_ipl2_2004_08_24_pp2_isdbg_fixとのマージ。 + + Revision 1.22 2004/08/25 01:28:23 Yosiokat + ・NvOption.backLightOffFlagがビットフィールドになっていなかったのを修正。 + ・NvOption.input_birthdayフラグを追加。アクセス関数NCD_GetInputBirthday、NCD_SetInputBirthday + ・NCDStoreを32byte単位のサイズになるよう調整。(キャッシュラインにあわせる) + + Revision 1.21 2004/08/23 08:24:23 Yosiokat + バックライトON,OFFフラグをIPl2_workから再度NitroConfigDataに戻す。 + + Revision 1.20 2004/08/19 06:06:02 yosiokat + NitroConfigDataにビットフィールドが使われているため、他コンパイラで問題が出る可能性がある。 + とりあえず、SDK_CWが定義されていなければ、ヘッダを切ってエラーを出させることで、他コンパイラで問題がないかを確認できるようにしておく。 + + Revision 1.19 2004/08/18 07:33:00 Yosiokat + ・NCD_FAVORITE_COLOR_MAX_NUM追加。 + ・NitroConfigData.option.input_favoriteColor追加。 + + Revision 1.18 2004/08/17 05:44:19 Nakasima + ・topLcdBackLightOffをNitroConfigDataからIPL2_workへ移動。 + ・detectPullOutFlagを削除し、detectPullOutCardFlaとdetectPullOutCtrdgFlagを追加。 + + Revision 1.17 2004/08/16 10:13:09 Yosiokat + pullCardFlagをdetectPullOutFlagに変更。 + + Revision 1.16 2004/08/16 10:09:34 Yosiokat + NvOptionにpullCardFlagを追加。 + + Revision 1.15 2004/08/13 07:41:30 Yosiokat + ・NvOwnerInfoからsexを削除。 + ・NvOptionからbottomLcdBackLightOffを削除。 + ・NvOptionにautoBootFlagを追加。 + ・NCD_SetSex, NCD_GetSexを削除。 + ・NCD_GetRtcClockAdjust、NCD_GetAutoBootFlag、NCD_SetRtcClockAdjust、NCD_SetAutoBootFlagの追加。 + + Revision 1.14 2004/07/29 04:53:18 Yosiokat + 構造体のパディングを明示的に追加。 + + Revision 1.13 2004/07/18 10:55:13 Yosiokat + NITRO設定データのセット関数を用意。 + + Revision 1.12 2004/07/17 09:00:14 Yosiokat + ・構造体サイズのコメント修正。 + + Revision 1.11 2004/07/15 12:47:33 Yosiokat + ・オーナー情報の誕生日の「年」を削除。 + + Revision 1.10 2004/07/15 12:26:43 Yosiokat + ・NITRO設定データのフォーマットを変更。 + ・オーナー情報を以下のように変更。 +  a)ニックネーム長を10に変更。 +  b)コメントデータを追加 +  c)血液型データを削除。 +  d)好きな色データを追加。(中身は未定) + e)性別データをビットフィールドに。 + ・アラーム情報を追加。 + ・タッチパネルキャリブレーション情報の各要素を詳細に定義。 + ・その他の情報をオプション情報にまとめる。(言語コードもビットフィールドとしてここに入れる。) + + Revision 1.9 2004/07/13 00:20:15 Yosiokat + ・small fix. + + Revision 1.8 2004/07/05 02:29:23 Yosiokat + 言語コードをFRENCHに修正。 + + Revision 1.7 2004/06/28 01:56:17 Yosiokat + ・バックライトON,OFF設定の値を追加。 + ・TP、言語設定、RTC、オーナー情報の入力済みフラグを追加。 + ・バージョンを"3"に。 + + Revision 1.6 2004/06/14 04:55:10 yosiokat + NitroConfigDataのrtcOffsetをintからs64に変更。 + これに伴いNCDフォーマットのバージョンを"2"に変更。 + + Revision 1.5 2004/06/07 10:51:58 Yosiokat + オーナー情報のニックネームをSJISからUnicode(UTF16)に変更したため、バージョンを1に上げる。 + + Revision 1.4 2004/05/21 06:12:17 Yosiokat + ヘッダのC++対応部分で「};」のセミコロンがエラーになっていたので、削除。 + + Revision 1.3 2004/05/21 05:37:46 Yosiokat + TPキャリブレーションをNVRAMに保存するデータにLCDの左上ポイント+LCDの右下ポイントを含めるよう変更。(サイズが8->12byteへ) + また、SDKにconfig.hの名前でNitroConfigData.hと同一ファイルが入っていたので、これをインクルードしないよう、Makefileでコンパイル時にIPL2_BUILD_シンボルを与えるよう変更。 + + Revision 1.2 2004/05/19 08:25:28 yosiokat + 更新ログの追加。 + + +*/ + + +#ifndef NITRO_CONFIG_DATA_H_ +#define NITRO_CONFIG_DATA_H_ +#if defined(SDK_CW) // NitroConfigDataにビットフィールドを使っているので、コンパイラ依存で不具合が発生する可能性がある。 + // よって、CW以外のコンパイラの場合は、このヘッダを無効にしてエラーを出させるようにして再確認する。 +#ifdef __cplusplus +extern "C" { +#endif + + +#include + +#define USING_COMPONENT // IPL2上ではないので、このスイッチを有効に。 + + +// define data ------------------------------------ +#define NITRO_CONFIG_DATA_VERSION 5 // NITRO設定データフォーマットバージョン +#define NITRO_CONFIG_DATA_EX_VERSION 1 // 拡張NITRO設定データフォーマットバージョン +#define NCD_NICKNAME_LENGTH 10 // ニックネーム長 +#define NCD_COMMENT_LENGTH 26 // コメント長 +#define NCD_FAVORITE_COLOR_MAX_NUM 16 // 好きな色の最大数 + +#define NCD_ROM_ADDR_SHIFT 3 // IPL2ヘッダのNitroConfigData格納アドレスのシフト値 +#define FONT_ROM_ADDR_SHIFT 2 // IPL2ヘッダのフォントデータ格納アドレスのシフト値 +#define NCD_SYS_RSV_SIZE 1024 // システム予約領域サイズ +#define NCD_APP_RSV_SIZE 512 // アプリ 予約領域サイズ + // NCD_SYS_RSV_ROM_ADDR = ncd_rom_addr - NCD_SYS_RSV_SIZE + // NCD_APP_RSV_ROM_ADDR = ncd_rom_addr - NCD_SYS_RSV_SIZE - NCD_APP_RSV_SIZE +#define USG_BACKLIGHT_DEFAULT 2 // USGのバックライトデフォルト値 + + +// 言語設定コード +typedef enum NvLangCode{ + LANG_JAPANESE =0, // 日本語 + LANG_ENGLISH, // 英語 + LANG_FRENCH, // フランス語 + LANG_GERMAN, // ドイツ語 + LANG_ITALIAN, // イタリア語 + LANG_SPANISH, // スペイン語 + LANG_CHINESE, // 中国語 + LANG_HANGUL, // 韓国語 + LANG_CODE_MAX +}NvLangCode; + +#define LANG_CODE_MAX_WW LANG_CHINESE // 中国版以前の通常版IPL2でのLANG_CODE_MAX + +#define LANG_BITMAP_WW ( ( 0x0001 << LANG_JAPANESE ) \ + | ( 0x0001 << LANG_ENGLISH ) \ + | ( 0x0001 << LANG_FRENCH ) \ + | ( 0x0001 << LANG_GERMAN ) \ + | ( 0x0001 << LANG_ITALIAN ) \ + | ( 0x0001 << LANG_SPANISH ) ) // 通常版での対応言語ビットマップ + +#define LANG_BITMAP_CN ( ( 0x0001 << LANG_ENGLISH ) \ + | ( 0x0001 << LANG_FRENCH ) \ + | ( 0x0001 << LANG_GERMAN ) \ + | ( 0x0001 << LANG_ITALIAN ) \ + | ( 0x0001 << LANG_SPANISH ) \ + | ( 0x0001 << LANG_CHINESE ) ) // 中国版での対応言語ビットマップ + +#define LANG_BITMAP_KR ( ( 0x0001 << LANG_JAPANESE ) \ + | ( 0x0001 << LANG_ENGLISH ) \ + | ( 0x0001 << LANG_FRENCH ) \ + | ( 0x0001 << LANG_GERMAN ) \ + | ( 0x0001 << LANG_SPANISH ) \ + | ( 0x0001 << LANG_HANGUL ) ) // 韓国版での対応言語ビットマップ + +// 日付データ +typedef struct NvDate{ + u8 month; // 月:01〜12 + u8 day; // 日:01〜31 +}NvDate; // 2byte + +// ニックネーム +typedef struct NvNickname{ + u16 str[NCD_NICKNAME_LENGTH]; // ニックネーム(Unicode(UTF16)で最大10文字、終端コードなし) + u8 length; // 文字数 + u8 rsv; +}NvNickname; // 22byte + +// コメント +typedef struct NvComment{ + u16 str[NCD_COMMENT_LENGTH]; //コメント(Unicode(UTF16)で最大26文字、終端コードなし) + u8 length; // 文字数 + u8 rsv; +}NvComment; // 54byte + +// オーナー情報 +typedef struct NvOwnerInfo{ + u8 favoriteColor : 4; // 好きな色 + u8 rsv : 4; // 予約。 + NvDate birthday; // 生年月日 + u8 pad; + NvNickname nickname; // ニックネーム + NvComment comment; // コメント +}NvOwnerInfo; // 80byte + +// IPL用目覚まし時計データ +typedef struct NvAlarm{ + u8 hour; // アラーム時:00〜23 + u8 minute; // アラーム分:00〜59 + u8 rsv1; // 予約 + u8 pad; + u16 alarmOn : 1; // アラームON,OFF(0:OFF, 1:ON) + u16 rsv2 : 15; // 予約 +}NvAlarm; // 6byte + +// タッチパネルキャリブレーションデータ +typedef struct NvTpCalibData{ + u16 raw_x1; // 第1キャリブレーション点のTP取得値X + u16 raw_y1; //     〃        TP取得値Y + u8 dx1; //     〃        LCD座標 X + u8 dy1; //     〃        LCD座標 Y + u16 raw_x2; // 第2キャリブレーション点のTP取得値X + u16 raw_y2; //     〃        TP取得値Y + u8 dx2; //     〃        LCD座標 X + u8 dy2; //     〃        LCD座標 Y +}NvTpCalibData; // 12byte + +// オプション情報 +typedef struct NvOption{ + u16 language : 3; // 言語コード(LANG_SPANISHまでの標準言語コードが入る) + u16 agbLcd : 1; // AGBモードで起動する時にどちらのLCDで起動するか?(0:TOP,1:BOTTOM) + u16 backLightBrightness : 2; // バックライト輝度データ + u16 autoBootFlag : 1; // 起動シーケンスで、メニュー停止なしで自動起動するかどうか?(0:OFF, 1:ON) + u16 backLightOffFlag : 1; // バックライトON,OFFフラグ(0:ON, 1:OFF) + u16 rsv2 : 1; // 予約。 + u16 destroyFlashFlag : 1; // フラッシュ壊れシーケンス中フラグ + u16 input_birthday : 1; // 誕生日が入力されたか? + u16 input_favoriteColor : 1; // 好きな色が入力されたか? + u16 input_tp : 1; // タッチパネルがキャリブレーションされたか?( 〃 ) + u16 input_language : 1; // 言語入力がされたか?  (0:未設定, 1:設定済み) + u16 input_rtc : 1; // RTC設定がされたか? ( 〃      ) + u16 input_nickname : 1; // ニックネームが入力されたか? ( 〃      ) + u8 rtcLastSetYear; // RTCの前回設定年 + u8 rtcClockAdjust; // RTCクロック調整値 + s64 rtcOffset; // RTC設定時のオフセット値(ユーザーがRTC設定を変更する度にその値に応じて増減します。) +}NvOption; // 12byte + +// NITRO各種設定データ +typedef struct NitroConfigData{ + u8 version; // フラッシュ格納データフォーマットのバージョン + u8 pad; + NvOwnerInfo owner; // オーナー情報 + NvAlarm alarm; // IPL用目覚まし時計データ + NvTpCalibData tp; // タッチパネルキャリブレーションデータ + NvOption option; // オプション +}NitroConfigData; // 112byte + +// NITRO各種設定データのNVRAM保存時フォーマット +typedef struct NCDStore{ + NitroConfigData ncd; // NITRO各種設定データ + u16 saveCount; // 0x00-0x7fをループしてカウントし、カウント値が新しいデータが有効。 + u16 crc16; // NITRO各種設定データの16bitCRC + u8 pad[ 128 - sizeof(NitroConfigData) - 4]; +}NCDStore; // 128byte // ※本来なら、saveCountとcrc16は256byteの最後に付加して、間にパディングを埋める方がいい。 + + +//---------------------------------------------- +// IPL2中国版での拡張フォーマット +//---------------------------------------------- +// 拡張NITRO設定データ +typedef struct NitroConfigDataEx{ + u8 version; // バージョン + u8 language; // 言語コード(LANG_CHINESE以降に拡張された値が入る。) + u16 valid_language_bitmap; // 本IPL2で有効な言語コードを示したビットマップ + u8 pad[ 256 - sizeof(NitroConfigData) - 4 - 4 - 2 ]; // 4:saveCount+crc16, 2:NCDEx.version+NCDEx.language, 2:crc16_ex +}NitroConfigDataEx; // 138bytes + +// NITRO各種設定データのNVRAM保存時フォーマット +typedef struct NCDStoreEx{ + NitroConfigData ncd; // NITRO各種設定データ + u16 saveCount; // 0x00-0x7fをループしてカウントし、カウント値が新しいデータが有効。 + u16 crc16; // NITRO各種設定データの16bitCRC + NitroConfigDataEx ncd_ex; + u16 crc16_ex; +}NCDStoreEx; // 256byte // ※本来なら、saveCountとcrc16は256byteの最後に付加して、間にパディングを埋める方がいい。 + + +typedef struct NCDTimeStamp { + u8 minute; + u8 hour; + u8 day; + u8 month; + u8 year; +}NCDTimeStamp; + + +//========================================================= +// NVRAMへのリードライト関数 +//========================================================= +#ifdef SDK_ARM9 +extern int NVRAMm_ReadNitroConfigData (NitroConfigData *dstp); +extern void NVRAMm_WriteNitroConfigData(NitroConfigData *dstp); +#endif + + +//========================================================= +// NITRO設定データへのアクセス関数 +//========================================================= +extern NitroConfigDataEx ncdEx; +extern u16 valid_lang_bitmap; + +#define GetNcdWorkAddr() ( (NitroConfigData *)( HW_NVRAM_USER_INFO ) ) +#define GetNcdExWorkAddr() ( &ncdEx ) + // NITRO設定データ領域のアドレス獲得 + +extern void NCD_ClearOwnerInfo( void ); // ニックネーム・誕生日・好きな色のクリア + +#ifdef USING_COMPONENT +extern void NCD_ReadIPL2Header ( void ); // IPL2ヘッダの読み出し。 +extern u8 NCD_GetIPL2Type ( void ); // IPL2タイプの取得。 +extern u16 NCD_GetIPL2TypeEx ( void ); // 拡張IPL2タイプの取得。 +extern u8 *NCD_GetIPL2Version ( void ); // IPL2バージョンの取得。 +extern u32 NCD_GetNCDRomAddr ( void ); // NCD格納ROMアドレスの取得。 +extern u32 NCD_GetSysRsvRomAddr( void ); // システム予約領域ROMアドレスの取得。 +extern u32 NCD_GetAppRsvRomAddr( void ); // アプリ 予約領域ROMアドレスの取得。 +extern u32 NCD_GetIPL2BM7RomAddr( void ); // ブートメニューARM7コードROMアドレスの取得。 +extern u32 NCD_GetIPL2DataRomAddr( void ); // IPL2データROMアドレスの取得。 +extern u32 NCD_GetFontBncmpRomAddr( void ); // フォントデータbncmpのROMアドレス取得。(中国版、日本向け試遊台版でのみ有効。) +extern u32 NCD_GetFontBnfrRomAddr( void ); // フォントデータbnfr のROMアドレス取得。(中国版、日本向け試遊台版でのみ有効。) +#endif + +//========================================================= +// データ取得 +//========================================================= + +//----------------------------------- +// オーナー情報全体の取得。 +static inline NvOwnerInfo *NCD_GetOwnerInfo(void) +{ + return &GetNcdWorkAddr()->owner; +} + +// 好きな色の取得。 +static inline u8 NCD_GetFavoriteColor(void) +{ + return (u8)GetNcdWorkAddr()->owner.favoriteColor; +} + +// 誕生日の取得。 +static inline NvDate *NCD_GetBirthday(void) +{ + return &GetNcdWorkAddr()->owner.birthday; +} + +// ニックネームの取得。 +static inline NvNickname *NCD_GetNickname(void) +{ + return &GetNcdWorkAddr()->owner.nickname; +} + +// コメントの取得。 +static inline NvComment *NCD_GetComment(void) +{ + return &GetNcdWorkAddr()->owner.comment; +} + + +//----------------------------------- +// アラーム情報の取得。 +static inline NvAlarm *NCD_GetAlarmData(void) +{ + return &GetNcdWorkAddr()->alarm; +} + + +//----------------------------------- +// タッチパネルキャリブレーションデータの取得。 +static inline NvTpCalibData *NCD_GetTPCalibration(void) +{ + return &GetNcdWorkAddr()->tp; +} + + +//----------------------------------- +// オプション情報の取得。 + +// 言語コードの取得 +static inline NvLangCode NCD_GetLanguageOrg(void) +{ + return (NvLangCode)GetNcdWorkAddr()->option.language; +} + +static inline NvLangCode NCD_GetLanguage(void) +{ + return (NvLangCode)GetNcdExWorkAddr()->language; +} + + +// RTCオフセット値の取得 +static inline s64 NCD_GetRtcOffset(void) +{ + return GetNcdWorkAddr()->option.rtcOffset; +} + +// RTCクロック調整値の取得 +static inline u8 NCD_GetRtcClockAdjust(void) +{ + return GetNcdWorkAddr()->option.rtcClockAdjust; +} + +// RTCの前回セットした年の取得 +static inline u8 NCD_GetRtcLastSetYear(void) +{ + return GetNcdWorkAddr()->option.rtcLastSetYear; +} + +// 起動シーケンスの自動起動ONか?(0:OFF, 1:ON) +static inline int NCD_GetAutoBootFlag(void) +{ + return (int)GetNcdWorkAddr()->option.autoBootFlag; +} + +// バックライトOFFか?(0:ON, 1:OFF) +static inline int NCD_GetBackLightOffFlag(void) +{ + return (int)GetNcdWorkAddr()->option.backLightOffFlag; +} + +// フラッシュ壊れシーケンス中かどうか? +static inline int NCD_GetDestroyFlash(void) +{ + return (int)GetNcdWorkAddr()->option.destroyFlashFlag; +} + +// 誕生日データがセットされているか? +static inline int NCD_GetInputBirthday(void) +{ + return (int)GetNcdWorkAddr()->option.input_birthday; +} + +// 好きな色データがセットされているか? +static inline int NCD_GetInputFavoriteColor(void) +{ + return (int)GetNcdWorkAddr()->option.input_favoriteColor; +} + +// TPキャリブレーションデータがセットされているか? +static inline int NCD_GetInputTP(void) +{ + return (int)GetNcdWorkAddr()->option.input_tp; +} + +// 言語コードがセットされているか? +static inline int NCD_GetInputLanguage(void) +{ + return (int)GetNcdWorkAddr()->option.input_language; +} + +// RTCデータがセットされているか? +static inline int NCD_GetInputRTC(void) +{ + return (int)GetNcdWorkAddr()->option.input_rtc; +} + +// オーナー情報のニックネームがセットされているか? +static inline int NCD_GetInputNickname(void) +{ + return (int)GetNcdWorkAddr()->option.input_nickname; +} + +//========================================================= +// データセット +//========================================================= +//----------------------------------- +// オーナー情報全体のセット。 +static inline void NCD_SetOwnerInfo(NvOwnerInfo *owinfop) +{ + SVC_CpuCopy( owinfop, &GetNcdWorkAddr()->owner, sizeof(NvOwnerInfo), 16); +} + +// 好きな色のセット。 +static inline void NCD_SetFavoriteColor(u8 favoriteColor) +{ + GetNcdWorkAddr()->owner.favoriteColor = favoriteColor; +} + +// 誕生日のセット。 +static inline void NCD_SetBirthday(NvDate *birthp) +{ + GetNcdWorkAddr()->owner.birthday.month = birthp->month; + GetNcdWorkAddr()->owner.birthday.day = birthp->day; +} + +// ニックネームのセット。 +static inline void NCD_SetNickname(NvNickname *namep) +{ + SVC_CpuCopy( namep, &GetNcdWorkAddr()->owner.nickname, sizeof(NvNickname), 16); +} + +// コメントのセット。 +static inline void NCD_SetComment(NvComment *commentp) +{ + SVC_CpuCopy( commentp, &GetNcdWorkAddr()->owner.comment, sizeof(NvComment), 16); +} + + +//----------------------------------- +// アラーム情報のセット。 +static inline void NCD_SetAlarmData(NvAlarm *alarmp) +{ + SVC_CpuCopy( alarmp, &GetNcdWorkAddr()->alarm, sizeof(NvAlarm), 16); +} + + +//----------------------------------- +// タッチパネルキャリブレーションデータのセット。 +static inline void NCD_SetTPCalibration(NvTpCalibData *tp_calibp) +{ + SVC_CpuCopy( tp_calibp, &GetNcdWorkAddr()->tp, sizeof(NvTpCalibData), 16); +} + + +//----------------------------------- +// オプション情報のセット。 + +// 言語コードのセット +#if 0 +static inline void NCD_SetLanguage(NvLangCode language) +{ + GetNcdExWorkAddr()->language = language; + GetNcdExWorkAddr()->valid_language_bitmap = LANG_BITMAP_CHINESE; + + if( language == LANG_CHINESE ) { + GetNcdWorkAddr()->option.language = LANG_ENGLISH; + }else { + GetNcdWorkAddr()->option.language = language; + } +} +#endif + +// RTCオフセット値のセット +static inline void NCD_SetRtcOffset(s64 rtcOffset) +{ + GetNcdWorkAddr()->option.rtcOffset = rtcOffset; +} + +// RTCクロック調整値のセット +static inline void NCD_SetRtcClockAdjust(u8 rtcClockAdjust) +{ + GetNcdWorkAddr()->option.rtcClockAdjust = rtcClockAdjust; +} + + +// RTCのLastSetYearへのセット +static inline void NCD_SetRtcLastSetYear(u8 rtcLastSetYear) +{ + GetNcdWorkAddr()->option.rtcLastSetYear = rtcLastSetYear; +} + + +// 起動シーケンスの自動起動ON,OFFフラグをセット。 +static inline void NCD_SetAutoBootFlag(BOOL autoBootFlag) +{ + GetNcdWorkAddr()->option.autoBootFlag = (u16)autoBootFlag; +} + +// バックライトON,OFFフラグをセット。 +static inline void NCD_SetBackLightOffFlag(BOOL backLightOffFlag) +{ + GetNcdWorkAddr()->option.backLightOffFlag = (u16)backLightOffFlag; +} + +// フラッシュ壊れシーケンス中かどうかのフラグセット。 +static inline void NCD_SetDestroyFlash(BOOL destroy) +{ + GetNcdWorkAddr()->option.destroyFlashFlag = (u16)destroy; +} + +// 誕生日データの入力済みフラグセット。 +static inline void NCD_SetInputBirthday(BOOL input) +{ + GetNcdWorkAddr()->option.input_birthday = (u16)input; +} + +// 好きな色データの入力済みフラグセット。 +static inline void NCD_SetInputFavoriteColor(BOOL input) +{ + GetNcdWorkAddr()->option.input_favoriteColor = (u16)input; +} + +// TPキャリブレーションデータの入力済みフラグセット。 +static inline void NCD_SetInputTP(BOOL input) +{ + GetNcdWorkAddr()->option.input_tp = (u16)input; +} + +// 言語コードの入力済みフラグセット。 +static inline void NCD_SetInputLanguage(BOOL input) +{ + GetNcdWorkAddr()->option.input_language = (u16)input; +} + +// RTCデータの入力済みフラグセット。 +static inline void NCD_SetInputRTC(BOOL input) +{ + GetNcdWorkAddr()->option.input_rtc = (u16)input; +} + +// オーナー情報のニックネームの入力済みフラグセット。 +static inline void NCD_SetInputNickname(BOOL input) +{ + GetNcdWorkAddr()->option.input_nickname = (u16)input; +} + + + +#ifdef __cplusplus +} +#endif + +#endif // SDK_CW +#endif // NITRO_CONFIG_DATA_H_ diff --git a/build/tests/DispOwnerInfo/src/data.c b/build/tests/DispOwnerInfo/src/data.c new file mode 100644 index 00000000..39420c0e --- /dev/null +++ b/build/tests/DispOwnerInfo/src/data.c @@ -0,0 +1,595 @@ +/********************************************************************/ +/* data.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + データ群 + + $Log: data.c,v $ + Revision 1.3 2005/04/02 07:43:18 yosiokat + IPL2フォント表示のためのデータ定義追加。 + + Revision 1.2 2005/03/31 06:01:14 yosiokat + インデント調整。 + + Revision 1.1 2004/08/31 06:20:24 Yosiokat + Initial revision + + +*/ + + + +#include +#include "data.h" + +// global variables---------------------------------------- +int (*nowProcess)(void); // 現在実行中のプロセス +GXOamAttr oamBakM[ 128 ]; // OAM バックアップ +GXOamAttr oamBakS[ 128 ]; // OAM バックアップ +u16 bgBakM[ 32*24 ]; // BG バックアップ +u16 bgBakS[ 32*24 ]; // BG バックアップ +TpWork tpd; // タッチパネルデータ +KeyWork pad; // キーパッド入力データ + + +// IPL2フォント表示用 +tFntEntry font_m; +tFntDrawContext context_m; +u16 canvas_m[ CANVAS_WIDTH * CANVAS_HEIGHT / 4 ] ATTRIBUTE_ALIGN(32); +u16 screen_m[ (CANVAS_WIDTH>>3) * (CANVAS_HEIGHT>>3) ] ATTRIBUTE_ALIGN(32); + +tFntEntry font_s; +tFntDrawContext context_s; +u16 canvas_s[ CANVAS_WIDTH * CANVAS_HEIGHT / 4 ] ATTRIBUTE_ALIGN(32); +u16 screen_s[ (CANVAS_WIDTH>>3) * (CANVAS_HEIGHT>>3) ] ATTRIBUTE_ALIGN(32); + +u16 s_Palette[] = { + 0x0000, 0x001f, 0x03e0, 0x03ff, + 0x7c00, 0x7c1f, 0x7fe0, 0x7fff, + 0x0000, 0x001f, 0x03e0, 0x03ff, + 0x7c00, 0x7c1f, 0x7fe0, 0x7fff, +}; + +/*---------------------- パレットデータ ---------------------------*/ +#define RGB555(r,g,b) (b<<10|g<<5|r) + +// 背景黒ベース +const u16 myPlttData[13][16] = { + {RGB555( 0, 0, 0), RGB555(31, 31, 31), RGB555(15, 15, 15), RGB555( 0, 0, 0),}, // White + {RGB555( 0, 0, 0), RGB555(31, 0, 0), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Red + {RGB555( 0, 0, 0), RGB555( 0, 19, 0), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Green + {RGB555( 0, 0, 0), RGB555( 0, 11, 31), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Blue + {RGB555( 0, 0, 0), RGB555(31, 31, 0), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Yellow + {RGB555( 0, 0, 0), RGB555( 0, 31, 31), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Cyan + {RGB555( 0, 0, 0), RGB555(31, 0, 31), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Purple + {RGB555( 0, 0, 0), RGB555( 0, 31, 0), RGB555( 0, 0, 0), RGB555( 0, 0, 0),}, // Light Green + {RGB555( 0, 0, 0), RGB555( 0, 0, 0), RGB555(31, 31, 0), RGB555(31, 31, 0),}, // HighLight Yellow + {RGB555( 0, 0, 0), RGB555( 0, 0, 0), RGB555( 0, 31, 31), RGB555( 0, 31, 31),}, // HighLight CYAN + {RGB555( 0, 0, 0), RGB555( 0, 0, 0), RGB555(31, 31, 31), RGB555(31, 31, 31),}, // HighLight WHITE + {RGB555( 0, 0, 0), RGB555( 0, 0, 0), RGB555( 0, 11, 31), RGB555( 0, 11, 31),}, // HighLight BLUE + {RGB555( 0, 0, 0), RGB555( 0, 0, 0), RGB555(31, 0, 0), RGB555(31, 0, 0),}, // HighLight RED +}; + + +/*---------------------- キャラクタデータ -------------------------*/ +/* +const u32 sampleCharData[8*0x100] = { + 0x00000000,0x00000000,0x00000000,0x00000000, // 0000h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x01010010,0x01010010,0x00000110, // 0001h + 0x00011010,0x01100010,0x00000010,0x00000010, + 0x00000000,0x01011010,0x01010010,0x00010010, // 0002h + 0x00100010,0x00100010,0x00100001,0x00100001, + 0x00000000,0x01010001,0x01010001,0x01111111, // 0003h + 0x00000001,0x00000001,0x00000001,0x01111110, + 0x00000000,0x01010000,0x01111111,0x00100000, // 0004h + 0x00100000,0x00010000,0x00001000,0x00000110, + 0x00000000,0x01010000,0x01010100,0x00001010, // 0005h + 0x00010001,0x00100001,0x01000000,0x00000000, + 0x00000000,0x01011000,0x01011000,0x01111111, // 0006h + 0x00001000,0x00101010,0x01001010,0x01001001, + 0x00000000,0x01010010,0x01101111,0x01010010, // 0007h + 0x00010010,0x00010010,0x00010010,0x00001001, + 0x00000000,0x01010010,0x01011111,0x00000100, // 0008h + 0x00011111,0x00001000,0x00000001,0x00011110, + 0x00000000,0x01010000,0x01011000,0x00000110, // 0009h + 0x00000001,0x00000110,0x00011000,0x00100000, + 0x00000000,0x01010000,0x01111101,0x00010001, // 000ah + 0x00010001,0x00010001,0x00010001,0x00001010, + 0x00000000,0x01010000,0x01011110,0x00100000, // 000bh + 0x00000000,0x00000001,0x00000001,0x00111110, + 0x00000000,0x01010100,0x01011111,0x00001000, // 000ch + 0x00010000,0x00000001,0x00000001,0x00011110, + 0x00000000,0x01010001,0x01010001,0x00000001, // 000dh + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x01010000,0x01111111,0x00011000, // 000eh + 0x00010100,0x00010100,0x00011000,0x00001100, + 0x00000000,0x01010010,0x01111111,0x00010010, // 000fh + 0x00010010,0x00000010,0x00000010,0x00111100, + 0x00000000,0x00001110,0x01010100,0x01010010, // 0010h + 0x00111111,0x00000100,0x00000100,0x00011000, + 0x00000000,0x01010100,0x01011111,0x00000100, // 0011h + 0x01110100,0x00000010,0x00001010,0x01110010, + 0x00000000,0x01010100,0x01011111,0x00000010, // 0012h + 0x00011110,0x00100001,0x00100000,0x00011110, + 0x00000000,0x01010000,0x01011100,0x00100011, // 0013h + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x01010000,0x01111111,0x00010000, // 0014h + 0x00001000,0x00001000,0x00001000,0x00110000, + 0x00000000,0x01010010,0x01010010,0x00001100, // 0015h + 0x00000010,0x00000001,0x00000001,0x00111110, + 0x00000000,0x01010001,0x01111101,0x00010001, // 0016h + 0x00010001,0x00111001,0x01010101,0x00011001, + 0x00000000,0x01010100,0x01010011,0x01110010, // 0017h + 0x00010001,0x00010001,0x00001010,0x00000100, + 0x00000000,0x01011110,0x01011000,0x00000100, // 0018h + 0x00101001,0x01010001,0x01010001,0x00001100, + 0x00000000,0x01010000,0x01011100,0x00010010, // 0019h + 0x00010010,0x00100001,0x01000000,0x00000000, + 0x00000000,0x01011101,0x01010001,0x00111101, // 001ah + 0x00010001,0x00011001,0x00110101,0x00001001, + 0x00000000,0x01110001,0x01011101,0x00110001, // 001bh + 0x00010001,0x00111001,0x01010101,0x00011001, + 0x00000000,0x01110100,0x01010011,0x00110010, // 001ch + 0x00010001,0x00010001,0x00001010,0x00000100, + 0x00000000,0x01101110,0x01011000,0x00100100, // 001dh + 0x00101001,0x01010001,0x01010001,0x00001100, + 0x00000000,0x01110000,0x01011100,0x00110010, // 001eh + 0x00010010,0x00100001,0x01000000,0x00000000, + 0x00000000,0x01111101,0x01010001,0x00111101, // 001fh + 0x00010001,0x00011001,0x00110101,0x00001001, + 0x00000000,0x00000000,0x00000000,0x00000000, // 0020h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00001000,0x00001000,0x00001000, // 0021h + 0x00001000,0x00001000,0x00000000,0x00001000, + 0x00000000,0x01101100,0x01001000,0x00100100, // 0022h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00100100,0x01111111,0x00100100, // 0023h + 0x00100100,0x01111111,0x00010010,0x00010010, + 0x00000000,0x00001000,0x01111110,0x00001001, // 0024h + 0x00111110,0x01001000,0x00111111,0x00001000, + 0x00000000,0x01000010,0x00100101,0x00010010, // 0025h + 0x00001000,0x00100100,0x01010010,0x00100001, + 0x00000000,0x00001110,0x00010001,0x00001001, // 0026h + 0x01000110,0x00101001,0x00110001,0x01001110, + 0x00000000,0x00011000,0x00010000,0x00001000, // 0027h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x01110000,0x00001000,0x00000100, // 0028h + 0x00000100,0x00000100,0x00001000,0x01110000, + 0x00000000,0x00000111,0x00001000,0x00010000, // 0029h + 0x00010000,0x00010000,0x00001000,0x00000111, + 0x00000000,0x00001000,0x01001001,0x00101010, // 002ah + 0x00011100,0x00101010,0x01001001,0x00001000, + 0x00000000,0x00001000,0x00001000,0x00001000, // 002bh + 0x01111111,0x00001000,0x00001000,0x00001000, + 0x00000000,0x00000000,0x00000000,0x00000000, // 002ch + 0x00000000,0x00001100,0x00001000,0x00000100, + 0x00000000,0x00000000,0x00000000,0x00000000, // 002dh + 0x01111111,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, // 002eh + 0x00000000,0x00000000,0x00000000,0x00001100, + 0x00000000,0x01000000,0x00100000,0x00010000, // 002fh + 0x00001000,0x00000100,0x00000010,0x00000001, + 0x00000000,0x00111110,0x01000001,0x01000001, // 0030h + 0x01000001,0x01000001,0x01000001,0x00111110, + 0x00000000,0x00011100,0x00010000,0x00010000, // 0031h + 0x00010000,0x00010000,0x00010000,0x00010000, + 0x00000000,0x00111110,0x01000001,0x01000000, // 0032h + 0x00111110,0x00000001,0x00000001,0x01111111, + 0x00000000,0x00111110,0x01000001,0x01000000, // 0033h + 0x00111110,0x01000000,0x01000001,0x00111110, + 0x00000000,0x00100000,0x00110000,0x00101000, // 0034h + 0x00100100,0x00100010,0x01111111,0x00100000, + 0x00000000,0x01111111,0x00000001,0x00111111, // 0035h + 0x01000000,0x01000000,0x01000001,0x00111110, + 0x00000000,0x00111110,0x00000001,0x00111111, // 0036h + 0x01000001,0x01000001,0x01000001,0x00111110, + 0x00000000,0x01111111,0x00100000,0x00100000, // 0037h + 0x00010000,0x00010000,0x00001000,0x00001000, + 0x00000000,0x00111110,0x01000001,0x01000001, // 0038h + 0x00111110,0x01000001,0x01000001,0x00111110, + 0x00000000,0x00111110,0x01000001,0x01000001, // 0039h + 0x01000001,0x01111110,0x01000000,0x00111110, + 0x00000000,0x00000000,0x00001100,0x00000000, // 003ah + 0x00000000,0x00000000,0x00001100,0x00000000, + 0x00000000,0x00000000,0x00001100,0x00000000, // 003bh + 0x00000000,0x00001100,0x00001000,0x00000100, + 0x00000000,0x01100000,0x00011000,0x00000110, // 003ch + 0x00000001,0x00000110,0x00011000,0x01100000, + 0x00000000,0x00000000,0x01111111,0x00000000, // 003dh + 0x00000000,0x00000000,0x01111111,0x00000000, + 0x00000000,0x00000011,0x00001100,0x00110000, // 003eh + 0x01000000,0x00110000,0x00001100,0x00000011, + 0x00000000,0x00111110,0x01000001,0x01000001, // 003fh + 0x00110000,0x00001000,0x00000000,0x00001000, + 0x00000000,0x00011100,0x00100010,0x01001001, // 0040h + 0x01010101,0x01010101,0x01010101,0x00111010, + 0x00000000,0x00001000,0x00010100,0x00010100, // 0041h + 0x00100010,0x00111110,0x01000001,0x01000001, + 0x00000000,0x00111111,0x01000001,0x01000001, // 0042h + 0x00111111,0x01000001,0x01000001,0x00111111, + 0x00000000,0x00111100,0x01000010,0x00000001, // 0043h + 0x00000001,0x00000001,0x01000010,0x00111100, + 0x00000000,0x00011111,0x00100001,0x01000001, // 0044h + 0x01000001,0x01000001,0x00100001,0x00011111, + 0x00000000,0x01111111,0x00000001,0x00000001, // 0045h + 0x01111111,0x00000001,0x00000001,0x01111111, + 0x00000000,0x01111111,0x00000001,0x00000001, // 0046h + 0x00111111,0x00000001,0x00000001,0x00000001, + 0x00000000,0x00111100,0x01000010,0x00000001, // 0047h + 0x01111001,0x01000001,0x01000010,0x00111100, + 0x00000000,0x01000001,0x01000001,0x01000001, // 0048h + 0x01111111,0x01000001,0x01000001,0x01000001, + 0x00000000,0x00111110,0x00001000,0x00001000, // 0049h + 0x00001000,0x00001000,0x00001000,0x00111110, + 0x00000000,0x01000000,0x01000000,0x01000000, // 004ah + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x01100001,0x00011001,0x00000101, // 004bh + 0x00000011,0x00000101,0x00011001,0x01100001, + 0x00000000,0x00000001,0x00000001,0x00000001, // 004ch + 0x00000001,0x00000001,0x00000001,0x01111111, + 0x00000000,0x01000001,0x01100011,0x01010101, // 004dh + 0x01001001,0x01000001,0x01000001,0x01000001, + 0x00000000,0x01000001,0x01000011,0x01000101, // 004eh + 0x01001001,0x01010001,0x01100001,0x01000001, + 0x00000000,0x00011100,0x00100010,0x01000001, // 004fh + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x00111111,0x01000001,0x01000001, // 0050h + 0x00111111,0x00000001,0x00000001,0x00000001, + 0x00000000,0x00011100,0x00100010,0x01000001, // 0051h + 0x01000001,0x01011001,0x00100010,0x01011100, + 0x00000000,0x00111111,0x01000001,0x01000001, // 0052h + 0x00111111,0x01000001,0x01000001,0x01000001, + 0x00000000,0x00111110,0x01000001,0x00000001, // 0053h + 0x00111110,0x01000000,0x01000001,0x00111110, + 0x00000000,0x01111111,0x00001000,0x00001000, // 0054h + 0x00001000,0x00001000,0x00001000,0x00001000, + 0x00000000,0x01000001,0x01000001,0x01000001, // 0055h + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x01000001,0x01000001,0x00100010, // 0056h + 0x00100010,0x00010100,0x00010100,0x00001000, + 0x00000000,0x01000001,0x01000001,0x01000001, // 0057h + 0x01001001,0x01010101,0x01100011,0x01000001, + 0x00000000,0x01000001,0x00100010,0x00010100, // 0058h + 0x00001000,0x00010100,0x00100010,0x01000001, + 0x00000000,0x01000001,0x00100010,0x00010100, // 0059h + 0x00001000,0x00001000,0x00001000,0x00001000, + 0x00000000,0x01111111,0x00100000,0x00010000, // 005ah + 0x00001000,0x00000100,0x00000010,0x01111111, + 0x00000000,0x01111100,0x00000100,0x00000100, // 005bh + 0x00000100,0x00000100,0x00000100,0x01111100, + 0x00000000,0x00100010,0x00010100,0x00111110, // 005ch + 0x00001000,0x00111110,0x00001000,0x00001000, + 0x00000000,0x00011111,0x00010000,0x00010000, // 005dh + 0x00010000,0x00010000,0x00010000,0x00011111, + 0x00000000,0x00001000,0x00010100,0x00100010, // 005eh + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, // 005fh + 0x00000000,0x00000000,0x00000000,0x01111111, + 0x00000000,0x00010000,0x00001000,0x00011000, // 0060h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00011110,0x00100001, // 0061h + 0x00111110,0x00100001,0x00100001,0x01011110, + 0x00000000,0x00000001,0x00000001,0x00111111, // 0062h + 0x01000001,0x01000001,0x01000001,0x00111111, + 0x00000000,0x00000000,0x00111100,0x01000010, // 0063h + 0x00000001,0x00000001,0x01000010,0x00111100, + 0x00000000,0x01000000,0x01000000,0x01111110, // 0064h + 0x01000001,0x01000001,0x01000001,0x01111110, + 0x00000000,0x00000000,0x00111110,0x01000001, // 0065h + 0x01111111,0x00000001,0x01000001,0x00111110, + 0x00000000,0x00110000,0x00001000,0x00001000, // 0066h + 0x01111111,0x00001000,0x00001000,0x00001000, + 0x00000000,0x00000000,0x01111110,0x01000001, // 0067h + 0x01000001,0x01111110,0x01000000,0x00111110, + 0x00000000,0x00000001,0x00000001,0x00000001, // 0068h + 0x00111111,0x01000001,0x01000001,0x01000001, + 0x00000000,0x00001000,0x00000000,0x00001000, // 0069h + 0x00001000,0x00001000,0x00001000,0x00001000, + 0x00000000,0x00100000,0x00000000,0x00100000, // 006ah + 0x00100000,0x00100001,0x00100001,0x00011110, + 0x00000000,0x00000001,0x00000001,0x01100001, // 006bh + 0x00011001,0x00000111,0x00011001,0x01100001, + 0x00000000,0x00001000,0x00001000,0x00001000, // 006ch + 0x00001000,0x00001000,0x00001000,0x00001000, + 0x00000000,0x00000000,0x00110111,0x01001001, // 006dh + 0x01001001,0x01001001,0x01001001,0x01001001, + 0x00000000,0x00000000,0x00111111,0x01000001, // 006eh + 0x01000001,0x01000001,0x01000001,0x01000001, + 0x00000000,0x00000000,0x00011100,0x00100010, // 006fh + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x00000000,0x00111101,0x01000011, // 0070h + 0x01000001,0x01000011,0x00111101,0x00000001, + 0x00000000,0x00000000,0x01011110,0x01100001, // 0071h + 0x01000001,0x01100001,0x01011110,0x01000000, + 0x00000000,0x00000000,0x00110001,0x00001101, // 0072h + 0x00000011,0x00000001,0x00000001,0x00000001, + 0x00000000,0x00000000,0x00111110,0x01000001, // 0073h + 0x00001110,0x00110000,0x01000001,0x00111110, + 0x00000000,0x00000100,0x00000100,0x01111111, // 0074h + 0x00000100,0x00000100,0x00000100,0x01111000, + 0x00000000,0x00000000,0x01000001,0x01000001, // 0075h + 0x01000001,0x01000001,0x01000001,0x01111110, + 0x00000000,0x00000000,0x01000001,0x01000001, // 0076h + 0x00100010,0x00100010,0x00010100,0x00001000, + 0x00000000,0x00000000,0x01000001,0x01000001, // 0077h + 0x01001001,0x00101010,0x00101010,0x00010100, + 0x00000000,0x00000000,0x00100001,0x00010010, // 0078h + 0x00001100,0x00001100,0x00010010,0x00100001, + 0x00000000,0x00000000,0x01000001,0x01000001, // 0079h + 0x00100010,0x00011100,0x00001000,0x00000110, + 0x00000000,0x00000000,0x00111111,0x00010000, // 007ah + 0x00001000,0x00000100,0x00000010,0x00111111, + 0x00000000,0x00001000,0x00011110,0x01100100, // 007bh + 0x00011000,0x00100100,0x00000100,0x01111000, + 0x00000000,0x00000000,0x00011110,0x00000100, // 007ch + 0x00011110,0x00110101,0x00101101,0x00010010, + 0x00000000,0x00000000,0x00000000,0x00010001, // 007dh + 0x00100001,0x00100001,0x00000001,0x00000010, + 0x00000000,0x00000000,0x00011100,0x00000000, // 007eh + 0x00011110,0x00100000,0x00100000,0x00011100, + 0x00000000,0x00000000,0x00011100,0x00000000, // 007fh + 0x00111110,0x00010000,0x00001100,0x00110010, + 0x00000000,0x00000000,0x00000100,0x00101111, // 0080h + 0x01000100,0x00011110,0x00100101,0x00010110, + 0x00000000,0x00000000,0x00001010,0x00011110, // 0081h + 0x00101011,0x00100010,0x00010100,0x00000100, + 0x00000000,0x00000000,0x00001000,0x00011101, // 0082h + 0x00101011,0x00101001,0x00011001,0x00000100, + 0x00000000,0x00000000,0x00001000,0x00111000, // 0083h + 0x00001000,0x00011110,0x00101001,0x00000110, + 0x00000000,0x00000000,0x00000000,0x00011100, // 0084h + 0x00100011,0x00100000,0x00100000,0x00011100, + 0x00000000,0x00000110,0x01001001,0x00110000, // 0085h + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000100,0x00111111,0x00000100, // 0086h + 0x00111110,0x01010101,0x01001101,0x00100110, + 0x00000000,0x00000000,0x00100001,0x01000001, // 0087h + 0x01000001,0x01000001,0x00000001,0x00000010, + 0x00000000,0x00111100,0x00000000,0x00111110, // 0088h + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x00011100,0x00000000,0x00111110, // 0089h + 0x00010000,0x00001000,0x00010100,0x01100010, + 0x00000000,0x00100100,0x01011111,0x00000100, // 008ah + 0x00111110,0x01000101,0x01000101,0x00100010, + 0x00000000,0x00100010,0x01001111,0x01010010, // 008bh + 0x01010010,0x00010010,0x00010010,0x00001001, + 0x00000000,0x00000100,0x00111110,0x00001000, // 008ch + 0x00111110,0x00010000,0x00000010,0x00111100, + 0x00000000,0x00100000,0x00011000,0x00000110, // 008dh + 0x00000001,0x00000110,0x00011000,0x00100000, + 0x00000000,0x00100000,0x01111101,0x00100001, // 008eh + 0x00100001,0x00100001,0x00100001,0x00010010, + 0x00000000,0x00011110,0x00100000,0x00000000, // 008fh + 0x00000000,0x00000001,0x00000001,0x00111110, + 0x00000000,0x00001000,0x01111111,0x00010000, // 0090h + 0x00100000,0x00000010,0x00000010,0x00111100, + 0x00000000,0x00000001,0x00000001,0x00000001, // 0091h + 0x01000001,0x01000001,0x00100010,0x00011100, + 0x00000000,0x00010000,0x01111111,0x00011000, // 0092h + 0x00010100,0x00010100,0x00011000,0x00001100, + 0x00000000,0x00100010,0x01111111,0x00100010, // 0093h + 0x00100010,0x00000010,0x00000010,0x01111100, + 0x00000000,0x00111100,0x00010000,0x00001100, // 0094h + 0x01111111,0x00001000,0x00001000,0x00110000, + 0x00000000,0x00000100,0x00011111,0x00000100, // 0095h + 0x01110100,0x00000010,0x00001010,0x01110010, + 0x00000000,0x00001000,0x01111111,0x00000100, // 0096h + 0x00111100,0x01000010,0x01000000,0x00111100, + 0x00000000,0x00000000,0x00011100,0x00100011, // 0097h + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x01111111,0x00010000,0x00001000, // 0098h + 0x00001000,0x00001000,0x00001000,0x00110000, + 0x00000000,0x00000010,0x00110010,0x00001100, // 0099h + 0x00000010,0x00000001,0x00000001,0x00111110, + 0x00000000,0x00100100,0x01001111,0x01000010, // 009ah + 0x00010001,0x00111100,0x00010010,0x00001100, + 0x00000000,0x00000010,0x01111010,0x01000010, // 009bh + 0x00000010,0x00000010,0x00001010,0x01110010, + 0x00000000,0x00100010,0x00111110,0x01010010, // 009ch + 0x01001011,0x01101101,0x01010101,0x00110010, + 0x00000000,0x00110010,0x01001011,0x01000110, // 009dh + 0x01000110,0x01110010,0x01001011,0x00110010, + 0x00000000,0x00011100,0x00101010,0x01001001, // 009eh + 0x01001001,0x01000101,0x01000101,0x00110010, + 0x00000000,0x00100001,0x01111101,0x00100001, // 009fh + 0x00100001,0x00111001,0x01100101,0x00011001, + 0x00000000,0x00000100,0x00100011,0x01100010, // 00a0h + 0x00100001,0x00100001,0x00010010,0x00001100, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00a1h + 0x00000000,0x00000100,0x00001010,0x00000100, + 0x00000000,0x01110000,0x00010000,0x00010000, // 00a2h + 0x00010000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00a3h + 0x00001000,0x00001000,0x00001000,0x00001110, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00a4h + 0x00000000,0x00000010,0x00000100,0x00000100, + 0x00000000,0x00000000,0x00000000,0x00011000, // 00a5h + 0x00011000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x01111111,0x01000000,0x01111111, // 00a6h + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x00000000,0x00111111,0x00100000, // 00a7h + 0x00010100,0x00001100,0x00000100,0x00000010, + 0x00000000,0x00000000,0x00100000,0x00100000, // 00a8h + 0x00010000,0x00001111,0x00001000,0x00001000, + 0x00000000,0x00000000,0x00000100,0x00111111, // 00a9h + 0x00100001,0x00100000,0x00010000,0x00001100, + 0x00000000,0x00000000,0x00000000,0x00111110, // 00aah + 0x00001000,0x00001000,0x00001000,0x01111111, + 0x00000000,0x00000000,0x00010000,0x00111111, // 00abh + 0x00011000,0x00010100,0x00010010,0x00011001, + 0x00000000,0x00000000,0x00000010,0x00111111, // 00ach + 0x00100010,0x00010010,0x00000100,0x00000100, + 0x00000000,0x00000000,0x00000000,0x00111110, // 00adh + 0x00100000,0x00100000,0x00100000,0x01111111, + 0x00000000,0x00000000,0x00111110,0x00100000, // 00aeh + 0x00111110,0x00100000,0x00100000,0x00111110, + 0x00000000,0x00000000,0x00100101,0x00101010, // 00afh + 0x00101010,0x00100000,0x00010000,0x00001110, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00b0h + 0x01111111,0x00000000,0x00000000,0x00000000, + 0x00000000,0x01111111,0x01000000,0x00101000, // 00b1h + 0x00011000,0x00001000,0x00001000,0x00000100, + 0x00000000,0x01000000,0x00100000,0x00011000, // 00b2h + 0x00010111,0x00010000,0x00010000,0x00010000, + 0x00000000,0x00001000,0x01111111,0x01000001, // 00b3h + 0x01000001,0x01000000,0x00100000,0x00011000, + 0x00000000,0x00000000,0x00111110,0x00001000, // 00b4h + 0x00001000,0x00001000,0x00001000,0x01111111, + 0x00000000,0x00100000,0x01111111,0x00110000, // 00b5h + 0x00101000,0x00100100,0x00100010,0x00110001, + 0x00000000,0x00000100,0x01111111,0x01000100, // 00b6h + 0x01000100,0x01000100,0x01000010,0x00100001, + 0x00000000,0x00000100,0x00111111,0x00001000, // 00b7h + 0x01111111,0x00010000,0x00010000,0x00010000, + 0x00000000,0x01111100,0x01000100,0x01000100, // 00b8h + 0x01000010,0x01000000,0x00100000,0x00011000, + 0x00000000,0x00000010,0x01111110,0x00100010, // 00b9h + 0x00100001,0x00100000,0x00010000,0x00001100, + 0x00000000,0x01111110,0x01000000,0x01000000, // 00bah + 0x01000000,0x01000000,0x01000000,0x01111110, + 0x00000000,0x00100010,0x01111111,0x00100010, // 00bbh + 0x00100010,0x00100000,0x00010000,0x00001100, + 0x00000000,0x00000011,0x00000100,0x01000011, // 00bch + 0x01000100,0x00100000,0x00011000,0x00000111, + 0x00000000,0x01111111,0x01000000,0x00100000, // 00bdh + 0x00010000,0x00011000,0x00100100,0x01000011, + 0x00000000,0x00000010,0x01111111,0x01000010, // 00beh + 0x00100010,0x00000010,0x00000010,0x01111100, + 0x00000000,0x01000001,0x01000010,0x01000000, // 00bfh + 0x00100000,0x00100000,0x00011000,0x00000110, + 0x00000000,0x01111110,0x01000010,0x01001110, // 00c0h + 0x01110001,0x01000000,0x00100000,0x00011000, + 0x00000000,0x01100000,0x00011110,0x00010000, // 00c1h + 0x01111111,0x00010000,0x00010000,0x00001100, + 0x00000000,0x01000101,0x01001010,0x01001010, // 00c2h + 0x01000000,0x00100000,0x00010000,0x00001110, + 0x00000000,0x00111110,0x00000000,0x01111111, // 00c3h + 0x00010000,0x00010000,0x00001000,0x00000110, + 0x00000000,0x00000010,0x00000010,0x00000110, // 00c4h + 0x00011010,0x01100010,0x00000010,0x00000010, + 0x00000000,0x00010000,0x00010000,0x01111111, // 00c5h + 0x00010000,0x00010000,0x00001000,0x00000110, + 0x00000000,0x00000000,0x00111110,0x00000000, // 00c6h + 0x00000000,0x00000000,0x00000000,0x01111111, + 0x00000000,0x01111110,0x01000000,0x01000100, // 00c7h + 0x00101000,0x00010000,0x00101000,0x01000110, + 0x00000000,0x00001000,0x01111111,0x00100000, // 00c8h + 0x00010000,0x00011100,0x01101011,0x00001000, + 0x00000000,0x01000000,0x01000000,0x01000000, // 00c9h + 0x00100000,0x00100000,0x00011000,0x00000111, + 0x00000000,0x00010010,0x00100010,0x00100010, // 00cah + 0x01000010,0x01000010,0x01000001,0x01000001, + 0x00000000,0x00000001,0x00000001,0x01111111, // 00cbh + 0x00000001,0x00000001,0x00000001,0x01111110, + 0x00000000,0x01111111,0x01000000,0x01000000, // 00cch + 0x01000000,0x00100000,0x00010000,0x00001110, + 0x00000000,0x00000000,0x00000100,0x00001010, // 00cdh + 0x00010001,0x00100001,0x01000000,0x00000000, + 0x00000000,0x00001000,0x00001000,0x01111111, // 00ceh + 0x00001000,0x00101010,0x01001010,0x01001001, + 0x00000000,0x01111111,0x01000000,0x01000000, // 00cfh + 0x00100010,0x00010100,0x00001000,0x00010000, + 0x00000000,0x00001110,0x01110000,0x00001110, // 00d0h + 0x01110000,0x00000110,0x00011000,0x01100000, + 0x00000000,0x00001000,0x00001000,0x00000100, // 00d1h + 0x00000100,0x00100010,0x01000010,0x01111111, + 0x00000000,0x01000000,0x01000000,0x00100100, // 00d2h + 0x00101000,0x00010000,0x00101100,0x01000011, + 0x00000000,0x01111111,0x00000100,0x01111111, // 00d3h + 0x00000100,0x00000100,0x00000100,0x01111000, + 0x00000000,0x00000010,0x01111111,0x01000010, // 00d4h + 0x00100010,0x00010100,0x00000100,0x00000100, + 0x00000000,0x00000000,0x00111110,0x00100000, // 00d5h + 0x00100000,0x00100000,0x00100000,0x01111111, + 0x00000000,0x01111110,0x01000000,0x01000000, // 00d6h + 0x01111110,0x01000000,0x01000000,0x01111110, + 0x00000000,0x00111110,0x00000000,0x01111111, // 00d7h + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x01000010,0x01000010,0x01000010, // 00d8h + 0x01000010,0x01000000,0x00100000,0x00011000, + 0x00000000,0x00001010,0x00001010,0x00001010, // 00d9h + 0x01001010,0x01001010,0x00101010,0x00011001, + 0x00000000,0x00000010,0x00000010,0x01000010, // 00dah + 0x01000010,0x00100010,0x00010010,0x00001110, + 0x00000000,0x01111111,0x01000001,0x01000001, // 00dbh + 0x01000001,0x01000001,0x01000001,0x01111111, + 0x00000000,0x01111111,0x01000001,0x01000001, // 00dch + 0x01000000,0x01000000,0x00100000,0x00011100, + 0x00000000,0x01000011,0x01000100,0x01000000, // 00ddh + 0x01000000,0x00100000,0x00010000,0x00001111, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00deh + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000, // 00dfh + 0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00011110,0x00001000,0x00000100, // 00e0h + 0x00101001,0x01010001,0x01010001,0x00001100, + 0x00000000,0x00000000,0x00001100,0x00010010, // 00e1h + 0x00010010,0x00100001,0x01000000,0x00000000, + 0x00000000,0x01111101,0x00100001,0x01111101, // 00e2h + 0x00100001,0x00111001,0x01100101,0x00011001, + 0x00000000,0x00111100,0x00010000,0x00111100, // 00e3h + 0x00010000,0x00011100,0x00110010,0x00001100, + 0x00000000,0x00001110,0x00101000,0x00101000, // 00e4h + 0x00111110,0x01100101,0x00100101,0x00010010, + 0x00000000,0x00000100,0x00101111,0x01000100, // 00e5h + 0x00000110,0x01000101,0x01000101,0x00111110, + 0x00000000,0x00100010,0x00100010,0x00111110, // 00e6h + 0x01010010,0x01010101,0x01001101,0x00100110, + 0x00000000,0x00000100,0x00011111,0x00000010, // 00e7h + 0x00011111,0x01000010,0x01000010,0x00111100, + 0x00000000,0x00010010,0x00111110,0x01010011, // 00e8h + 0x01000010,0x00100100,0x00000100,0x00000100, + 0x00000000,0x00001000,0x00111101,0x01001011, // 00e9h + 0x01001001,0x01001001,0x00111000,0x00000100, + 0x00000000,0x00001000,0x00111000,0x00001000, // 00eah + 0x00001000,0x00011110,0x00101001,0x00000110, + 0x00000000,0x00011000,0x00100000,0x00000100, // 00ebh + 0x00111010,0x01000110,0x01000000,0x00111000, + 0x00000000,0x01000010,0x01000010,0x01000010, // 00ech + 0x01000110,0x01000000,0x00100000,0x00011000, + 0x00000000,0x00111110,0x00010000,0x00111100, // 00edh + 0x01000011,0x01001100,0x01010010,0x00111100, + 0x00000000,0x00100010,0x00110011,0x00101010, // 00eeh + 0x00100110,0x00100010,0x00100011,0x01000010, + 0x00000000,0x00111110,0x00010000,0x00111100, // 00efh + 0x01000011,0x01000000,0x01000010,0x00111100, + 0x00000000,0x00000010,0x00111011,0x01000110, // 00f0h + 0x01000010,0x01000011,0x01000010,0x00110010, + 0x00000000,0x00000100,0x00000100,0x00000010, // 00f1h + 0x01000110,0x01000101,0x01000101,0x00111001, + 0x00000000,0x01010100,0x01111111,0x00100100, // 00f2h + 0x00100100,0x00100100,0x00100010,0x00010001, + 0x00000000,0x01010100,0x01011111,0x00000100, // 00f3h + 0x00111111,0x00001000,0x00001000,0x00001000, + 0x00000000,0x01011110,0x01100010,0x00100010, // 00f4h + 0x00100001,0x00100000,0x00010000,0x00001100, + 0x00000000,0x01010010,0x01111110,0x00100010, // 00f5h + 0x00100001,0x00100000,0x00010000,0x00001100, + 0x00000000,0x01010000,0x01111111,0x00100000, // 00f6h + 0x00100000,0x00100000,0x00100000,0x00111111, + 0x00000000,0x01010010,0x01010010,0x00111111, // 00f7h + 0x00010010,0x00010000,0x00010000,0x00001100, + 0x00000000,0x01010011,0x01010100,0x00100011, // 00f8h + 0x00100100,0x00010000,0x00001000,0x00000111, + 0x00000000,0x01010000,0x01011111,0x00010000, // 00f9h + 0x00001000,0x00001100,0x00010010,0x00100001, + 0x00000000,0x01010010,0x01111111,0x00100010, // 00fah + 0x00010010,0x00000010,0x00000010,0x00111100, + 0x00000000,0x01010001,0x01010010,0x00100000, // 00fbh + 0x00100000,0x00010000,0x00001000,0x00000110, + 0x00000000,0x01011110,0x01010010,0x00100110, // 00fch + 0x00111001,0x00100000,0x00010000,0x00001100, + 0x00000000,0x01010000,0x01011110,0x00010000, // 00fdh + 0x01111111,0x00010000,0x00010000,0x00001100, + 0x00000000,0x00100101,0x01001010,0x00101010, // 00feh + 0x00100000,0x00010000,0x00001000,0x00000111, + 0x00000000,0x01011110,0x01010000,0x00111111, // 00ffh + 0x00001000,0x00001000,0x00001000,0x00000110 +}; +*/ + + diff --git a/build/tests/DispOwnerInfo/src/data.h b/build/tests/DispOwnerInfo/src/data.h new file mode 100644 index 00000000..cdfa09ce --- /dev/null +++ b/build/tests/DispOwnerInfo/src/data.h @@ -0,0 +1,108 @@ +/********************************************************************/ +/* data.h */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + データ定義 ヘッダ +*/ + +#ifndef __DATA_H__ +#define __DATA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include +#include + +// define data--------------------------------------------- + + // パレットカラー +#define WHITE ( 1 << 12 ) +#define RED ( 2 << 12 ) +#define GREEN ( 3 << 12 ) +#define BLUE ( 4 << 12 ) +#define YELLOW ( 5 << 12 ) +#define CYAN ( 6 << 12 ) +#define PURPLE ( 7 << 12 ) +#define LIGHTGREEN ( 8 << 12 ) +#define HIGHLIGHT_Y ( 9 << 12 ) +#define HIGHLIGHT_C ( 10 << 12 ) +#define HIGHLIGHT_W ( 11 << 12 ) +#define HIGHLIGHT_B ( 12 << 12 ) +#define HIGHLIGHT_R ( 13 << 12 ) + + +// fntライブラリのカラー指定 +#define FNT_BLACK 0 +#define FNT_RED 1 +#define FNT_LIGHT_GREEN 2 +#define FNT_YELLOW 3 +#define FNT_BLUE 4 +#define FNT_PURPLE 5 +#define FNT_VERMILION 6 +#define FNT_WHITE 7 +#define FNT_SYUIRO 8 +#define FNT_GREEN 9 +#define FNT_USER_COLOR 10 + + +#define CANVAS_WIDTH 256 // 文字表示キャンパス横ドット数 +#define CANVAS_HEIGHT 192 //    〃     縦ドット数 +#define LINE_DOT_NUM 10 + + + // キーデータワーク +typedef struct { + u16 trg; // トリガ入力 + u16 cont; // ベタ 入力 +}KeyWork; + + + // タッチパネルワーク +typedef struct { + int detached; // 今回のデータ入力でタッチが離れたことを示す。 + BOOL initial; // 初期化直後は、TPがデタッチされるまで、データ取得しないようにする。 + TPData disp; // 今回の入力値(LCD座標) + TPData raw; // 今回の入力値(TP 座標) + TPData last; // 前回の入力値(LCD座標) +}TpWork; + + +// global variables---------------------------------------- +extern int (*nowProcess)( void ); +extern GXOamAttr oamBakM[ 128 ]; // OAM バックアップ +extern GXOamAttr oamBakS[ 128 ]; // OAM バックアップ +extern u16 bgBakM[ 32*24 ]; // BG バックアップ +extern u16 bgBakS[ 32*24 ]; // BG バックアップ +extern TpWork tpd; // タッチパネルデータ +extern KeyWork pad; // キーパッド入力データ + +extern tFntEntry font_m; +extern tFntDrawContext context_m; +extern u16 canvas_m[ CANVAS_WIDTH * CANVAS_HEIGHT / 4 ] ATTRIBUTE_ALIGN(32); +extern u16 screen_m[ (CANVAS_WIDTH>>3) * (CANVAS_HEIGHT>>3) ] ATTRIBUTE_ALIGN(32); + +extern tFntEntry font_s; +extern tFntDrawContext context_s; +extern u16 canvas_s[ CANVAS_WIDTH * CANVAS_HEIGHT / 4 ] ATTRIBUTE_ALIGN(32); +extern u16 screen_s[ (CANVAS_WIDTH>>3) * (CANVAS_HEIGHT>>3) ] ATTRIBUTE_ALIGN(32); + +extern u16 s_Palette[ 0x10 ]; + +// global const data--------------------------------------- +extern const u16 myPlttData[13][16]; + + +// function------------------------------------------------ + + +#ifdef __cplusplus +} +#endif + +#endif // __DATA_H__ diff --git a/build/tests/DispOwnerInfo/src/dispNCD.c b/build/tests/DispOwnerInfo/src/dispNCD.c new file mode 100644 index 00000000..20960d6c --- /dev/null +++ b/build/tests/DispOwnerInfo/src/dispNCD.c @@ -0,0 +1,280 @@ +/********************************************************************/ +/* dispNCD.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + NITRO設定データ表示 + + $Log: dispNCD.c,v $ + Revision 1.7.2.2.8.1 2007/01/22 07:36:16 yosiokat + NAT-IPL2への対応。 + + Revision 1.7.2.3 2006/06/26 04:09:02 yosiokat + DrawNCD_Elementの言語コードの表示判定部を修正。 + + Revision 1.7.2.2 2006/02/01 06:32:43 yosiokat + IPL2バージョン情報取得関数の整理。 + + Revision 1.7.2.1 2005/10/25 08:19:39 yosiokat + ・中国版かどうかの判定を関数IsIPLTypeChineseで行うよう変更。 + ・USG版の時に、バックライト輝度情報(0〜3)を表示するよう変更。 + + Revision 1.7 2005/04/14 05:53:47 yosiokat + NITRO設定データ関係を強制的に中国版にするスイッチFORCE_CHINAを追加。 + + Revision 1.6 2005/04/02 10:04:08 yosiokat + ユーザーカラーの色表示に対応。 + + Revision 1.5 2005/04/02 07:42:54 yosiokat + ユーザーネーム&コメントをIPL2フォントを使用して全て表示できるよう変更。 + + Revision 1.4 2005/04/01 05:47:24 yosiokat + NitroConfigDataEx対応IPL2の時には、言語コードをEx側も表示するよう変更。 + + Revision 1.3 2005/03/31 05:59:15 yosiokat + ・言語コードにCHINESE、UNKNOWNの追加。 + ・TPデータワークのクリアをInitTPData()に変更。 + + Revision 1.2 2005/03/09 04:44:39 yosiokat + 機能追加。 + + Revision 1.1.1.1 2004/08/31 06:20:24 Yosiokat + no message + + +*/ + +#include +#include "main.h" +#include "NitroConfigData.h" +#include "font.h" + +// define data------------------------------------------ +#define CANCEL_BUTTON_LT_X 2 +#define CANCEL_BUTTON_LT_Y 22 +#define CANCEL_BUTTON_RB_X (CANCEL_BUTTON_LT_X+8) +#define CANCEL_BUTTON_RB_Y (CANCEL_BUTTON_LT_Y+2) + +#define IPL2_GAIJI_SIKAKU 0x25a0 + +/* 本体情報 : 「お気に入りの色」定数 (GXRgb) */ +#define FAVORITE_COLOR_VALUE_GRAY GX_RGB(12,16,19) +#define FAVORITE_COLOR_VALUE_BROWN GX_RGB(23, 9, 0) +#define FAVORITE_COLOR_VALUE_RED GX_RGB(31, 0, 3) +#define FAVORITE_COLOR_VALUE_PINK GX_RGB(31,17,31) +#define FAVORITE_COLOR_VALUE_ORANGE GX_RGB(31,18, 0) +#define FAVORITE_COLOR_VALUE_YELLOW GX_RGB(30,28, 0) +#define FAVORITE_COLOR_VALUE_LIME_GREEN GX_RGB(21,31, 0) +#define FAVORITE_COLOR_VALUE_GREEN GX_RGB( 0,31, 0) +#define FAVORITE_COLOR_VALUE_DARK_GREEN GX_RGB( 0,20, 7) +#define FAVORITE_COLOR_VALUE_SEA_GREEN GX_RGB( 9,27,17) +#define FAVORITE_COLOR_VALUE_TURQUOISE GX_RGB( 6,23,30) +#define FAVORITE_COLOR_VALUE_BLUE GX_RGB( 0,11,30) +#define FAVORITE_COLOR_VALUE_DARK_BLUE GX_RGB( 0, 0,18) +#define FAVORITE_COLOR_VALUE_PURPLE GX_RGB(17, 0,26) +#define FAVORITE_COLOR_VALUE_VIOLET GX_RGB(26, 0,29) +#define FAVORITE_COLOR_VALUE_MAGENTA GX_RGB(31, 0,18) + + +// extern data------------------------------------------ + +// function's prototype declaration--------------------- +static void DrawNCD_ElementName( void ); +static void DrawNCD_Element( void ); +static void DispUserNameAndComment( u16 color ); + +// global variable ------------------------------------- + +// static variable ------------------------------------- + +// const data ----------------------------------------- +static const u8 *str_lcd[] = { (const u8 *)"TOP", + (const u8 *)"BOTTOM" }; +static const u8 *str_onoff[] = { (const u8 *)"OFF", + (const u8 *)"ON" }; +static const u8 *str_inputFlags[] = { + (const u8 *)"NAME", + (const u8 *)"RTC ", + (const u8 *)"LANG", + (const u8 *)"TP ", + (const u8 *)"COL ", + (const u8 *)"BDAY", }; +static const u8 *str_language[] = { (const u8 *)"JAPANESE", + (const u8 *)"ENGLISH", + (const u8 *)"FRENCH", + (const u8 *)"GERMAN", + (const u8 *)"ITALIAN", + (const u8 *)"SPANISH", + (const u8 *)"CHINISE", + (const u8 *)"HANGUL", + (const u8 *)"UNKNOWN", +}; + +static const u8 *str_userColor[] = { + (const u8 *)"GRAY", + (const u8 *)"BROWN", + (const u8 *)"RED", + (const u8 *)"PINK", + (const u8 *)"ORANGE", + (const u8 *)"YELLOW", + (const u8 *)"LIME GREEN ", + (const u8 *)"GREEN", + (const u8 *)"DARK GREEN", + (const u8 *)"SEA GREEN", + (const u8 *)"TURQUOISE", + (const u8 *)"BLUE", + (const u8 *)"DARK BLUE", + (const u8 *)"PURPLE", + (const u8 *)"VIOLET", + (const u8 *)"MAGENTA", +}; + +static const u16 palette_userColor[] = { + FAVORITE_COLOR_VALUE_GRAY, + FAVORITE_COLOR_VALUE_BROWN, + FAVORITE_COLOR_VALUE_RED, + FAVORITE_COLOR_VALUE_PINK, + FAVORITE_COLOR_VALUE_ORANGE, + FAVORITE_COLOR_VALUE_YELLOW, + FAVORITE_COLOR_VALUE_LIME_GREEN, + FAVORITE_COLOR_VALUE_GREEN, + FAVORITE_COLOR_VALUE_DARK_GREEN, + FAVORITE_COLOR_VALUE_SEA_GREEN, + FAVORITE_COLOR_VALUE_TURQUOISE, + FAVORITE_COLOR_VALUE_BLUE, + FAVORITE_COLOR_VALUE_DARK_BLUE, + FAVORITE_COLOR_VALUE_PURPLE, + FAVORITE_COLOR_VALUE_VIOLET, + FAVORITE_COLOR_VALUE_MAGENTA, +}; + +static const u16 str_sikaku[] = L"■■■■"; + +//====================================================== +// NITRO設定データ表示 +//====================================================== + +// NITRO設定データ表示の初期化 +void SEQ_DispNCD_init( void ) +{ + GXS_SetVisiblePlane( GX_PLANEMASK_NONE ); + GX_SetVisiblePlane ( GX_PLANEMASK_NONE ); + + SVC_CpuClearFast( 0x0000, bgBakM, sizeof(bgBakM) ); + SVC_CpuClearFast( 0x0000, bgBakS, sizeof(bgBakS) ); + + ClearAllStringSJIS(); + + (void)DrawStringSJIS( 1, 0, YELLOW, (const u8 *)"Disp OwnerInfo [Use SDK]" ); + + DrawNCD_ElementName(); + DrawNCD_Element(); + + GX_SetVisiblePlane ( GX_PLANEMASK_BG1 | GX_PLANEMASK_BG2 ); + GXS_SetVisiblePlane( GX_PLANEMASK_BG1 | GX_PLANEMASK_BG2 | GX_PLANEMASK_OBJ ); +} + + +// NITRO設定データの表示 +int SEQ_DispNCD( void ) +{ + BOOL tp_cancel = FALSE; + + return 0; +} + + +// NITRO設定データの要素名表示 +static void DrawNCD_ElementName( void ) +{ + { // TOP LCD + SetTargetScreenSJIS( BOTTOM_SCREEN ); + (void)DrawStringSJIS( 1, 4, CYAN , (const u8 *)"[OPTION]" ); + (void)DrawStringSJIS( 2, 6, LIGHTGREEN, (const u8 *)"Language :" ); + (void)DrawStringSJIS( 1, 8, CYAN , (const u8 *)"[OWNER]" ); + (void)DrawStringSJIS( 2, 10, LIGHTGREEN, (const u8 *)"fav color:" ); + (void)DrawStringSJIS( 2, 12, LIGHTGREEN, (const u8 *)"birthday :" ); + (void)DrawStringSJIS( 2, 14, LIGHTGREEN, (const u8 *)"nickname :" ); + (void)DrawStringSJIS( 2, 16, LIGHTGREEN, (const u8 *)"comment :" ); +// SetTargetScreenSJIS( BOTTOM_SCREEN ); + } +} + + +// NITRO設定データの各要素表示 +static void DrawNCD_Element( void ) +{ + const u8 *str; + OSOwnerInfo info; + OS_GetOwnerInfo( &info ); + + { // TOP LCD + SetTargetScreenSJIS( BOTTOM_SCREEN ); + if( info.language < LANG_CODE_MAX ) { + str = str_language[ info.language ]; + }else { + str = str_language[ LANG_CODE_MAX ]; + } + (void)DrawStringSJISEx( 12, 6, WHITE, str, 0 ); + +// SetTargetScreenSJIS( BOTTOM_SCREEN ); + } + { + int temp; + + // ユーザーカラー + { + tFntPosition x = (tFntPosition){ 12 * 8 , FNT_POSX_ORIGIN_LEFT, FNT_H_ALIGN_LEFT }; + tFntPosition y = (tFntPosition){ 11 * 8 + 4, FNT_POSY_ORIGIN_BOTTOM , 0 /*unused*/ }; + temp = info.favoriteColor; + fnt_DrawString( &font_s, &context_s, x, y, 1, 0, str_sikaku, FNT_USER_COLOR ); + (void)DrawDecimalSJIS( 18, 10, WHITE, &temp, 2, 4 ); + (void)DrawStringSJIS ( 20, 10, WHITE, str_userColor[ temp ] ); + GXS_LoadBGPltt( &palette_userColor[ temp ], FNT_USER_COLOR * 2, 2 ); + } + (void)DrawStringSJIS ( 14, 12, WHITE, (const u8 *)"/" ); + (void)DrawDecimalSJIS( 12, 12, WHITE, &info.birthday.month, 2, 1 ); + (void)DrawDecimalSJIS( 15, 12, WHITE, &info.birthday.day, 2, 1 ); + + // ユーザーネーム、コメント + DispUserNameAndComment( FNT_WHITE ); + + // ユーザーネーム長、コメント長 + (void)DrawDecimalSJIS ( 0, 14, YELLOW, &info.nickNameLength, 2, 1 ); + (void)DrawDecimalSJIS ( 0, 16, YELLOW, &info.commentLength, 2, 1 ); + } +} + + +static void DispUserNameAndComment( u16 color ) +{ + u16 color2 = ( color == FNT_BLACK ) ? (u16)FNT_BLACK : (u16)FNT_YELLOW; + u16 buff[ 256 ]; + tFntPosition x = (tFntPosition){ 12 * 8 , FNT_POSX_ORIGIN_LEFT, FNT_H_ALIGN_LEFT }; + tFntPosition y = (tFntPosition){ 15 * 8 + 4, FNT_POSY_ORIGIN_BOTTOM , 0 /*unused*/ }; + OSOwnerInfo info; + OS_GetOwnerInfo( &info ); + + // ユーザーネームの表示 + MI_CpuCopy16 ( info.nickName, buff, NCD_NICKNAME_LENGTH * 2 ); + buff[ NCD_NICKNAME_LENGTH ] = 0; + fnt_DrawString( &font_s, &context_s, x, y, 1, 0, buff, color2 ); + buff[ info.nickNameLength ] = 0; + fnt_DrawString( &font_s, &context_s, x, y, 1, 0, buff, color ); + + + // コメントの表示 + y.pos = 19 * 8 + 4; + MI_CpuCopy16( info.comment, buff, (u32)( info.commentLength * 2 ) ); + buff[ info.commentLength ] = 0; + if ( info.commentLength > 13 ) { // 2行にまたがる時。 + fnt_DrawString( &font_s, &context_s, x, y, 1, 0, &buff[13], color ); + } + buff[ 13 ] = 0; + y.pos -= 2 * 8; + fnt_DrawString( &font_s, &context_s, x, y, 1, 0, buff, color ); +} + + diff --git a/build/tests/DispOwnerInfo/src/font.c b/build/tests/DispOwnerInfo/src/font.c new file mode 100644 index 00000000..5d57afd5 --- /dev/null +++ b/build/tests/DispOwnerInfo/src/font.c @@ -0,0 +1,1094 @@ +/********************************************************************/ +/* font.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + フォント処理 + + + $Log: font.c,v $ + Revision 1.1 2004/08/31 06:20:24 Yosiokat + Initial revision + + + + + // **** old logs **** + + Revision 1.19 2004/08/25 02:21:40 Yosiokat + ・1.14のコメントは間違いのため、再コミット。 + ・small fix. + + Revision 1.18 2004/08/25 02:15:51 Yosiokat + タグred_ipl2_2004_08_24_pp2_isdbg_fixの削除。 + + Revision 1.17 2004/08/20 11:35:29 Yosiokat + small fix. + + Revision 1.16 2004/08/18 07:17:29 Yosiokat + 上下LCDをターゲットにして、別個に初期化できるよう変更。 + + Revision 1.15 2004/08/17 07:52:03 Yosiokat + ・SetTargetScreenSJISを追加して、上下LCDのどちらにも文字表示が可能になるよう変更。 + + Revision 1.14 2004/08/16 10:03:08 Yosiokat + GetStrEntryで範囲外のhandleが与えられた際にNULLを返すよう変更。 + + Revision 1.13 2004/08/13 07:32:58 Yosiokat + small fix. + + Revision 1.12 2004/08/13 04:33:18 Yosiokat + small fix. + + Revision 1.11 2004/08/10 07:02:10 yosiokat + small fix. + + Revision 1.10 2004/08/07 05:44:44 Yosiokat + ・SJIS文字列表示関数を引数でハンドルを指定しない仕様に変更する。 + ・上記変更に対応して、クリア関数も仕様変更。 + + Revision 1.9 2004/07/29 04:58:42 Yosiokat + 構造体のパディングを明示的に追加。 + + Revision 1.8 2004/07/13 00:31:48 Yosiokat + ・サブLCD側のVRAMを対象にするよう変更。 + + Revision 1.7 2004/06/15 13:09:10 Yosiokat + ・MY_PrintfをOS_Printfに。 + + Revision 1.6 2004/06/06 06:28:24 Yosiokat + OS_PrintfをOS_Printfに。 + + Revision 1.5 2004/06/06 02:39:31 Yosiokat + SJISコード判定用の定数定義をfont.hに移動。 + + Revision 1.4 2004/05/31 11:53:23 yosiokat + __DEBUGを__PRINTに変更。 + + Revision 1.3 2004/05/26 05:07:34 Yosiokat + DrawStringSJISで空文字列を指定した際に異常動作するバグを修正。 + + Revision 1.2 2004/05/26 01:16:57 Yosiokat + 文字制御をSJISベースに変更中。 + + Revision 1.1 2004/05/25 08:59:22 Yosiokat + 文字列をSJISで制御するように変更。 + + +*/ + + +#include +#include "font.h" +#include "data.h" + +// define data---------------------------------- +#define SEARCH_ENTRY_MAX_NUM 128 // 処理が重くなるのを防ぐための、エントリのサーチ回数上限 +#define NITRO_CHAR_SIZE 0x20 // NITRO標準キャラクタサイズ(4bitカラー) +#define CHAR_CODE_OFFSET (SJIS_CHAR_VRAM_OFFSET / NITRO_CHAR_SIZE) // キャラナンバーをスクリーンに転送する際のオフセット(BG_CHAR_VRAM+0x4000から始めているので、オフセットは0x200) +#define DRAW_CHAR_NUM_LIMIT (SJIS_CHAR_VRAM_SIZE / NITRO_CHAR_SIZE) // 1つの文字列で表示できるキャラクタ数の限界 + +#define HANDLE_INDEX 0x40000000 + +// フォント構成データ +typedef struct FontComponent { + u16 need_tate_dot; // 文字を表示するのに必要なキャラ単位のドット数 + u16 tate_dot; // 文字キャラの縦ドット数 + u16 yoko_dot; // 文字キャラの横ドット数 + u16 org_char_size; // 文字キャラのbyteサイズ + u32 org_row_size; // 文字キャラ + u32 start_adr; // キャラクタバイナリのスタートアドレス + u32 end_adr; // キャラクタバイナリのエンドアドレス +}FontComponent; + + +// VRAMキャラデータのメモリブロック動的確保リスト +typedef struct CharAllocListTag CharAllocList; +struct CharAllocListTag { + CharAllocList *next; // 次のメモリブロック確保構造体へのポインタ + u16 memTop; // キャラ割り当てテーブルcharAllocTblの占有ブロックの先頭ポイント + u16 memNum; // 確保したメモリブロックの数 +}CharAllocListTag; + + +// SJIS文字列表示のためのVRAMエントリデータ +typedef struct StrEntry { + const FontComponent *font; // 表示するフォントの構成要素 + u32 dataAddr; // データ元のアドレス(IDとして使用) + u32 *charMemp; // 動的に確保したVRAMメモリブロックへのポインタ + u16 charNum; // トータルのキャラ数 + u16 drawPos; // 表示位置(BGスクリーンバッファの先頭からの2byteオフセット) +}StrEntry; + + +// フォントの文字間隔詰め展開用データ +typedef struct FontPropotion { + u16 *leftp; // 現在の左側フォントデータへのポインタ + u16 *rightp; // 現在の右側フォントデータへのポインタ + u16 h_offset; // 16x16ドット単位のキャラクタデータ内の現在の横オフセット + u8 pad[2]; + u32 buff16x16[2][16/2]; +}FontPropotion; + +// インクリメント/インクリメントなしフラグ(SetScrDataで使用) +typedef enum IncFlag { + NO_INC, // インクリメントなし + INC_1 // 1インクリメント +}IncFlag; + +// extern data---------------------------- +extern void _binary_f12han_dat(void); +extern void _binary_f12han_dat_end(void); + + +// function's prototype declaration------------- +static void SetScrData(u16 code_top, StrEntry *sEntryp, IncFlag inc_flag); +static u16 MeasureStringCharWidth(const u8 *str); +static void SpreadStringCloser(u8 *str, StrEntry *sEntryp, u16 v_offset); +static void SetFirstFont(u8 **strpp, u16 v_offset, FontPropotion *fontProp); +static u8 * CloseFontChar(u8 **strpp, u16 v_offset, FontPropotion *fontProp); +static u32 CalcCharCodeAddress(u8 **strpp, const FontComponent **font); +static void SpreadFontZen(u16 bit0_color, u16 bit1_color, u8 *fromAdr, u32 *toAdr); +static void InitStrEntryTable( StrEntry **sEntrypp ); +static StrEntry *GetStrEntry( u16 handle ); +static StrEntry **GetStrEntryAddress( u16 handle ); +static int InsertStrEntry(u16 *handle, u16 charNum); +static int InsertStrEntry2(u16 handle, u16 charNum); +static u16 DeleteStrEntry( u16 handle); +static BOOL GetEmptyStrEntry(u32 dataAddr, u16 *handlep); +static u16 SearchStrEntry(u32 dataAddr); +static u8 * HexToDecimalString(const void *hexp, u8 *strp, u16 figure, u16 size); +static u8 * HexToString(const void *hexp, u8 *strp, u16 figure); +static void InitAllocSystemSJIS( TargetScreen target ); +static void *AllocMemoryFromVram( int size ); +static void FreeMemoryToVram( void *p ); + +static u16 DrawStringSJIS_Core(u16 x, u16 y, u16 color, const void *strp, int handleIndex); +static int CalcHandleIndex(u32 dataAddr, int index); + +// global variables----------------------------- + + +// static variables----------------------------- +static int font_init = 0; +static TargetScreen targetScreen = BOTTOM_SCREEN; +static const FontComponent *nowFontHan; +static StrEntry *entryTblS[ STR_ENTRY_MAX_NUM ]; +static StrEntry *entryTblM[ STR_ENTRY_MAX_NUM ]; +static StrEntry **entryTblp; +static u16 *bgBakp; + +// const data----------------------------------- +const u16 tbl_ASCII_to_SJIS[0x100]; +const FontComponent fontTypeTableHan[] = { + { 16, 12, 6, 12, 14*0xbc, (u32)&_binary_f12han_dat, (u32)&_binary_f12han_dat_end}, +}; + + +// functions description------------------------ + +//---------------------------------------------- +// API関数 +//---------------------------------------------- + +// フォントAPIの初期化 +void InitFont( TargetScreen target) +{ + if( font_init & (0x01 << target ) ) { // ターゲットが初期すみならリターン + return; + } + + InitAllocSystemSJIS( target ); // ターゲットのVRAMアリーナ初期化 + + if( target == TOP_SCREEN ) { // ターゲットのエントリを初期化 + InitStrEntryTable( &entryTblM[0] ); + }else { + InitStrEntryTable( &entryTblS[0] ); + } + + if( font_init == 0 ) { // まだ何も初期化されていないなら、スクリーンを初期設定に。 + SetTargetScreenSJIS( target ); + } + + SetFont( (FontType)0 ); + font_init |= 0x01 << target; +} + + +// 表示フォントの切り替え +void SetFont(FontType font) +{ + if(font >= FONT_TYPE_MAX) { + font = (FontType)0; + } + nowFontHan = &fontTypeTableHan[font]; +} + + +// 表示ターゲットスクリーンの切り替え +void SetTargetScreenSJIS( TargetScreen target ) +{ + targetScreen = target; + if( target == TOP_SCREEN ) { + entryTblp = &entryTblM[0]; + bgBakp = bgBakM; + }else { + entryTblp = &entryTblS[0]; + bgBakp = bgBakS; + } +} + + +// 指定されたSJIS文字列を表示する。(ハンドル指定なしでハンドル算出加算値付き) +static u16 DrawStringSJIS_Core(u16 x, u16 y, u16 color, const void *strp, int handleIndex) +{ + StrEntry *sEntryp; + int newEntry; + u16 handle; + u16 charNum; + u16 code; + u16 v_offset = 1; // ※v_offsetは引数にすることもできる。 + + InitFont( targetScreen ); + + // 空文字列チェック + if(*(u8 *)strp == 0x00) { + return 0; + } + + // 文字列表示に必要なキャラクタ数の測定 + charNum = MeasureStringCharWidth((const u8 *)strp); + if(charNum > DRAW_CHAR_NUM_LIMIT) { // 必要キャラクタ数が512以内ならメモリ確保。 + OS_Printf("SJIS-draw: str length max over.\n"); + return DSJIS_ERR_STR_LENGTH_TOO_LONG; + } + + // ハンドル取得 + if( !GetEmptyStrEntry( (u32)handleIndex, &handle ) ) { + OS_Printf("SJIS-draw: error StrEntry get failed.\n"); + return DSJIS_ERR_ENTRY_GET_FAILED; + } + + // 文字列エントリの登録 + newEntry = InsertStrEntry2( handle, charNum ); + if(newEntry < 0) { + OS_Printf("SJIS-draw: error StrEntry alloc failed.\n"); + return DSJIS_ERR_ENTRY_ALLOC_FAILED; + } + sEntryp = GetStrEntry(handle); // エントリへのポインタを格納 + sEntryp->dataAddr = (u32)handleIndex; + + // VRAMキャラメモリの動的確保 + if(newEntry > 0) { + sEntryp->charMemp = AllocMemoryFromVram( charNum * NITRO_CHAR_SIZE * 2 ); + // ※縦も2キャラ分必要なので、NITRO_CHAR_SIZE*2 +// OS_Printf("alloc charMemp = %x\n",sEntryp->charMemp); + if( sEntryp->charMemp == NULL ) { // メモリ確保に失敗したら、エントリのメモリを解放してリターン + OS_Printf("VRAM char memory alloc failed.\n"); + OS_Free(sEntryp); + return DSJIS_ERR_CHAR_ALLOC_FAILED; + } + } + + // 文字列エントリの登録 + sEntryp->font = nowFontHan; // 現在のフォントタイプを格納 + sEntryp->drawPos = (u16)(x + y * 0x20); // 表示場所を格納。 + sEntryp->charNum = charNum; + + // 縦配置位置指定v_offsetの矯正 + if(v_offset) { + if(((nowFontHan->tate_dot & 0x07)== 0)) { // 縦8dot or 16dotの場合はv_offsetは0 + v_offset = 0; + }else { + if( (16 - nowFontHan->tate_dot) < v_offset ) { // それ以外の時は、縦16dotに収まる範囲に矯正 + v_offset = (u16)(16 - nowFontHan->tate_dot); + } + } + } + // 対象文字列のフォントデータをビット展開&キャラデータ詰めをおこなって、確保したVRAMキャラメモリに転送 + SpreadStringCloser((u8 *)strp, sEntryp, v_offset); + + // スクリーンデータに今回の文字列のキャラナンバーを書き込み + code = (u16)( (((u32)sEntryp->charMemp - (u32)G2_GetBG1CharPtr()) / NITRO_CHAR_SIZE) | color ); + SetScrData(code, sEntryp, INC_1); + + return handle; +} + +// ハンドルインデックスの算出 +static int CalcHandleIndex(u32 dataAddr, int index) +{ + if(index) { + index += HANDLE_INDEX + (int)dataAddr; // インデックスを加算した場合は、他のデータのアドレスと被らないよう、NITROメモリマップ外になるようオフセットを加算。 + }else { + index = (int)dataAddr; + } + return index; +} + + +// 指定されたSJIS文字列を表示する。(ハンドル指定なし) +u16 DrawStringSJIS(u16 x, u16 y, u16 color, const void *strp) +{ + return DrawStringSJIS_Core( x, y, color, strp, (int)strp); // index = strp でCoreをコール +} + + +// 指定された値を16進数で表示する。(ハンドル指定なし版) +u16 DrawHexSJIS(u16 x, u16 y, u16 color, const void *hexp, u16 figure) +{ + u8 buff[16]; + u8 *strp = HexToString(hexp, buff, figure); + return DrawStringSJIS_Core(x, y, color, strp, (int)hexp); +} + + +// 指定された値を10進数で表示する。(ハンドル指定なし版) +u16 DrawDecimalSJIS(u16 x, u16 y, u16 color, const void *hexp, u16 figure, u16 size) +{ + u8 buff[16]; + u8 *strp = HexToDecimalString(hexp, buff, figure, size); + return DrawStringSJIS_Core(x, y, color, strp, (int)hexp); +} + + +// 指定されたSJIS文字列を表示する。(ハンドル指定なしでハンドル算出加算値付き) +u16 DrawStringSJISEx(u16 x, u16 y, u16 color, const void *strp, int index) +{ + index = CalcHandleIndex( (u32)strp, index); + return DrawStringSJIS_Core( x, y, color, strp, index); // index を加算してCoreをコール +} + + +// 指定された値を16進数で表示する。(ハンドル指定なし版) +u16 DrawHexSJISEx(u16 x, u16 y, u16 color, const void *hexp, u16 figure, int index) +{ + u8 buff[16]; + u8 *strp = HexToString(hexp, buff, figure); + index = CalcHandleIndex( (u32)hexp, index); + return DrawStringSJIS_Core(x, y, color, strp, index); +} + + +// 指定された値を10進数で表示する。(ハンドル指定なし版) +u16 DrawDecimalSJISEx(u16 x, u16 y, u16 color, const void *hexp, u16 figure, u16 size, int index) +{ + u8 buff[16]; + u8 *strp = HexToDecimalString(hexp, buff, figure, size); + index = CalcHandleIndex( (u32)hexp, index); + return DrawStringSJIS_Core(x, y, color, strp, index); +} + + +// 指定コードから始まるスクリーンデータのセット +static void SetScrData(u16 code_top, StrEntry *sEntryp, IncFlag inc_flag) +{ + u16 i; + u16 lastPos; + u16 pos_l; + u16 *buffp_l; + u16 *buffp_h; + + lastPos = 0x800 >> 1; // バッファ最終位置 == BGスクリーンサイズ(0x800) + pos_l = (u16)(sEntryp->drawPos + 0x0020); // 下8dotキャラクタ表示位置 + buffp_h = bgBakp + sEntryp->drawPos; + buffp_l = buffp_h + 0x0020; + + for(i = 0; i < sEntryp->charNum; i++) { + *buffp_h++ = code_top; + code_top += inc_flag; + if(nowFontHan->need_tate_dot == 16) { // 必要縦ドットが16の場合(8ドット文字以外全部)、もう1キャラセット + *buffp_l++ = code_top; + } + code_top += inc_flag; + pos_l++; + if(pos_l == lastPos) { + break; + } + } +} + + +// 指定されたハンドルのSJIS文字列をクリアする。 +void ClearStringSJIS_handle(u16 handle) +{ + StrEntry *sEntryp; + + InitFont( targetScreen ); + + sEntryp = GetStrEntry(handle); + if(sEntryp == NULL) { + return; + } + + // スクリーンデータのクリア + SetScrData(0x0000, sEntryp, NO_INC); + + // キャラクタデータのクリア +// MI_CpuClearFast(sEntryp->charMemp, sEntryp->charNum * NITRO_CHAR_SIZE * 2); + // 動的に確保したVRAMキャラデータのクリア + FreeMemoryToVram( sEntryp->charMemp ); // このエントリが確保していたキャラクタメモリの解放。 + (void)DeleteStrEntry(handle); +} + + +// 指定されたデータアドレスで表示しているSJIS文字列をクリアする。 +void ClearStringSJIS(void *datap) +{ + u16 handle = SearchStrEntry( (u32)datap ); + + if( handle > STR_ENTRY_MAX_NUM ) { + return; + } + ClearStringSJIS_handle(handle); +} + + +// 指定されたデータアドレスで表示しているSJIS文字列をクリアする。Ex系で描画したものを消す場合。 +void ClearStringSJISEx(void *datap, int handleIndex) +{ + u16 handle; + + handleIndex = CalcHandleIndex( (u32)datap, handleIndex); + + handle = SearchStrEntry( (u32)handleIndex ); + + if( handle > STR_ENTRY_MAX_NUM ) { + return; + } + ClearStringSJIS_handle(handle); +} + + + +// 現在登録されている全てのSJIS文字列をクリアする(動的メモリも全て解放) +void ClearAllStringSJIS(void) +{ + u16 handle; + + InitFont( targetScreen ); + + for(handle = 0; handle < STR_ENTRY_MAX_NUM; handle++) { + if( GetStrEntry( handle ) != NULL) { + ClearStringSJIS_handle(handle); + } + } +} + + +// 指定されたハンドルで表示されている文字列のカラーを変更。 +u16 ChangeColorSJIS(u16 handle, u16 new_color) +{ + int i; + u16 *buffp_l; + u16 *buffp_h; + StrEntry *sEntryp = GetStrEntry( handle ); // エントリへのポインタを格納 + + if((handle > STR_ENTRY_MAX_NUM) || (sEntryp == NULL)) { + return 0; + } + + buffp_h = bgBakp + sEntryp->drawPos; + buffp_l = buffp_h + 0x20; + for(i = 0; i < sEntryp->charNum; i++) { + *buffp_h = (u16)((*buffp_h & 0x0fff) | new_color); + *buffp_l = (u16)((*buffp_l & 0x0fff) | new_color); + buffp_h++; + buffp_l++; + } + return 1; +} + +//---------------------------------------------- +// 文字列エントリテーブルの処理 +//---------------------------------------------- + +// エントリテーブルの初期化 +static void InitStrEntryTable( StrEntry **sEntrypp ) +{ + u16 i; + for(i = 0; i < STR_ENTRY_MAX_NUM; i++) { + *sEntrypp++ = NULL; + } +} + + +// 指定されたハンドルのStrEntryポインタを返す +static StrEntry * GetStrEntry( u16 handle ) +{ + if ( handle >= STR_ENTRY_MAX_NUM ) { + return NULL; + }else { +// return entryTblS[ handle ]; + return entryTblp[ handle ]; + } +} + + +// 指定されたハンドルのStrEntryポインタへのポインタを返す +static StrEntry ** GetStrEntryAddress( u16 handle ) +{ + if ( handle >= STR_ENTRY_MAX_NUM ) { + return NULL; + }else { +// return &entryTblS[ handle ]; + return &entryTblp[ handle ]; + } +} + + +// StrEntryの登録 +static int InsertStrEntry(u16 *handle, u16 charNum) +{ + StrEntry **sEntrypp = GetStrEntryAddress( *handle ); + + if(*handle >= STR_ENTRY_MAX_NUM) { + return -1; + }else if(*handle > 0) { + if( *sEntrypp != NULL) { // 指定ハンドルに既にエントリがある場合は、確保メモリ量を新規メモリ量と比べて、 + if( charNum > (*sEntrypp)->charNum ) { // 再確保が必要な場合は、メモリ解放→再確保を行う。 +// OS_Printf("SJIS: same entry free to charMemory.\n"); +// OS_Printf("free charMemp = %x\n",(*sEntrypp)->charMemp); + SetScrData( 0x0000, *sEntrypp, NO_INC ); // スクリーンデータのクリア + FreeMemoryToVram( (*sEntrypp)->charMemp ); // このエントリが確保していたキャラクタメモリの解放。 + return 1; + }else { + if( charNum < (*sEntrypp)->charNum ) { + SetScrData( 0x0000, *sEntrypp, NO_INC ); // スクリーンデータのクリア + } + return 0; // このエントリでは、キャラクタメモリを継続して使用 + } + } + } + + // *handle == 0 // 指定ハンドルが0の時は新しいハンドルを確保 + *handle = 0; + sEntrypp = GetStrEntryAddress( *handle ); + + for( ; *handle < STR_ENTRY_MAX_NUM; (*handle)++ ) { + if( *sEntrypp++ == NULL) { // NULLエントリを探す + break; + } + } + if(*handle == STR_ENTRY_MAX_NUM) { + return -1; // NULLエントリが見つからなかったら、エラー終了。 + } + + // StrEntryのメモリ確保 + *sEntrypp = (StrEntry *)OS_Alloc( sizeof(StrEntry) ); + if( *sEntrypp == NULL) { + OS_Printf("StrEntry allocate failed.\n"); + return -1; + }else { + return 1; + } +} + + +// エントリ挿入処理2 +static int InsertStrEntry2(u16 handle, u16 charNum) +{ + StrEntry **sEntrypp = GetStrEntryAddress( handle ); + + if( *sEntrypp != NULL) { // 指定ハンドルに既にエントリがある場合は、確保メモリ量を新規メモリ量と比べて、 + if( charNum > (*sEntrypp)->charNum ) { // 再確保が必要な場合は、メモリ解放→再確保を行う。 +// OS_Printf("SJIS: same entry free to charMemory.\n"); +// OS_Printf("free charMemp = %x\n",(*sEntrypp)->charMemp); + SetScrData( 0x0000, *sEntrypp, NO_INC ); // スクリーンデータのクリア + FreeMemoryToVram( (*sEntrypp)->charMemp ); // このエントリが確保していたキャラクタメモリの解放。 + return 1; + }else { + if( charNum < (*sEntrypp)->charNum ) { + SetScrData( 0x0000, *sEntrypp, NO_INC ); // スクリーンデータのクリア + } + return 0; // このエントリでは、キャラクタメモリを継続して使用 + } + } + + // StrEntryのメモリを新規確保 + *sEntrypp = (StrEntry *)OS_Alloc( sizeof(StrEntry) ); + if( *sEntrypp == NULL) { + OS_Printf("StrEntry allocate failed.\n"); + return -1; + }else { + return 1; + } +} + + +// 指定されたハンドルのStrEntry要素をエントリテーブルから削除 +static u16 DeleteStrEntry(u16 handle) +{ + StrEntry **sEntrypp = GetStrEntryAddress( handle ); + + if( *sEntrypp == NULL) { + return NULL; + } + + OS_Free( *sEntrypp ); + *sEntrypp = NULL; + + return handle; +} + + +// 空きエントリを探す(あんま効率よくない) +static BOOL GetEmptyStrEntry(u32 dataAddr, u16 *handlep) +{ + int i = SEARCH_ENTRY_MAX_NUM; // 処理が重くなるのを防ぐため、サーチ回数に制限を加える。 + u16 handle = (u16)( (dataAddr >> 2) & (STR_ENTRY_MAX_NUM - 1) ); + + while(i--) { + StrEntry *sEntryp = GetStrEntry( handle ); + if( sEntryp == NULL ) { + *handlep = handle; + return TRUE; // 新規ハンドル位置確保 + }else { + if( sEntryp->dataAddr == dataAddr ) { + *handlep = handle; + return TRUE; // 既存ハンドル位置発見 + } + handle = (u16)( (handle + 1) & (STR_ENTRY_MAX_NUM - 1) ); + } + } + return FALSE; +} + + +// 指定データのハンドルを探す(あんま効率よくない) +static u16 SearchStrEntry(u32 dataAddr) +{ + int i = SEARCH_ENTRY_MAX_NUM; // 処理が重くなるのを防ぐため、サーチ回数に制限を加える。 + u16 handle = (u16)( (dataAddr >> 2) & (STR_ENTRY_MAX_NUM - 1) ); + + while(i--) { + StrEntry *sEntryp = GetStrEntry( handle ); + if(sEntryp != NULL) { + if( sEntryp->dataAddr == dataAddr ) { + return handle; // 既存ハンドル位置発見 + } + } + handle = (u16)( (handle + 1) & (STR_ENTRY_MAX_NUM - 1) ); + } + return 0xffff; +} + + +//---------------------------------------------- +// キャラクタVRAMの動的確保処理 +//---------------------------------------------- + +// 文字列表示に必要なキャラクタ数の測定 +static u16 MeasureStringCharWidth(const u8 *str) +{ + u16 totalWidth = 0; // 文字列のトータルの横ドットサイズ + u16 charNum = 0; // 文字列表示に必要なキャラクタ数 + + // 文字列のトータルの横ドットサイズを算出 + while(*str) { // 各文字は SJIS か ASCII か? + if( ((*str >= SJIS_HIGHER_CODE1_MIN) && (*str <= SJIS_HIGHER_CODE1_MAX)) + || ((*str >= SJIS_HIGHER_CODE2_MIN) && (*str <= SJIS_HIGHER_CODE2_MAX)) ) { + str += 2; // SJIS文字 + totalWidth += nowFontHan->yoko_dot; + }else { + str++; // ASCII文字 + totalWidth += nowFontHan->yoko_dot; + } + } + // トータル横ドット数から、文字列の表示に必要なキャラクタ数を算出 + charNum = (u16)(totalWidth >> 3); + if(totalWidth & 0x0007) { + charNum = (u16)(charNum + 1); + } + + return charNum; +} + + +//---------------------------------------------- +// フォントデータ→NITROキャラデータへの変換関数群 +//---------------------------------------------- + +// 指定された文字列を指定メモリブロックに展開しながら転送(使用フォントによって文字詰めも行う) +static void SpreadStringCloser(u8 *strp, StrEntry *sEntryp, u16 v_offset) +{ + u32 charBuff[(NITRO_CHAR_SIZE * 4) / 4]; // 16x16キャラ2文字で4キャラ分のバッファ。(2文字展開して、文字詰めを行うため) + u8 *charMemp; + u8 *fromAdr; + u16 i; + u16 charNum; + FontPropotion fontPro; + + // Spread target string char data to WRAM pool + charNum = sEntryp->charNum; + charMemp = (u8 *)sEntryp->charMemp; + fontPro.h_offset = 0; + fontPro.leftp = (u16 *)0x0; + fontPro.rightp = (u16 *)0x0; + + while(1) { + // 隣接する2つの1bitフォントデータを16x16ドットキャラクタ配列にロード + if(fontPro.h_offset == 0) { + SetFirstFont(&strp, v_offset, &fontPro); // 表示文字列を16x16ドット単位に区切った時に先頭にくるキャラクタをロード + } + fromAdr = CloseFontChar(&strp, v_offset, &fontPro); // 上記キャラクタに隣接するキャラクタをロード + + // ロードした1bitフォントデータを4bitNITROキャラデータに展開 + SpreadFontZen(3, 1, fromAdr, (u32 *)charBuff); // キャラクタデータを4bitに展開。 + + // 展開したキャラデータをVRAMにコピー + fromAdr = (u8 *)charBuff; + for(i = 0; i < 2; i++) { // 生成した16x16ドット(4キャラ)分のデータを転送 + MI_CpuCopyFast(fromAdr, charMemp, (NITRO_CHAR_SIZE * 2)); + fromAdr += NITRO_CHAR_SIZE * 2; + charMemp+= NITRO_CHAR_SIZE * 2; + if(--charNum == 0) { + return; + } + } + } +} + + +// 最初のフォントデータをバッファにセット +static void SetFirstFont(u8 **strpp, u16 v_offset, FontPropotion *fontProp) +{ + u8 tate; + u8 *fontAdr; + u16 *firstp; + const FontComponent *fontComp; + + if(**strpp == 0x00) { + return; + } + + fontAdr = (u8 *)CalcCharCodeAddress(strpp, &fontComp); // 今回の文字のコードから、フォントデータ格納アドレスを算出。 + + MI_CpuClearFast(fontProp->buff16x16[0], 64); // 16x16ドット単位の一時展開バッファのクリア + + firstp = (u16 *)fontProp->buff16x16[0] + v_offset; + for(tate = 0; tate < fontComp->tate_dot - 1; tate++) { + *firstp = (u16)(*fontAdr++ << 8); + if(fontComp->yoko_dot > 8) { + *firstp |= *fontAdr++; + } + firstp++; + } + fontProp->h_offset = fontComp->yoko_dot; + fontProp->leftp = (u16 *)fontProp->buff16x16[0]; + fontProp->rightp = (u16 *)fontProp->buff16x16[1]; +} + + +// 隣接するフォントデータをバッファにセット +static u8 * CloseFontChar(u8 **strpp, u16 v_offset, FontPropotion *fontProp) +{ + u8 tate; + u8 *fontAdr; + u16 *temp; + u16 *leftp_tmp; + u16 *rightp_tmp; + const FontComponent *fontComp; + + while(fontProp->h_offset < 16) { + if(**strpp == 0x00) { + break; + } + + fontAdr = (u8 *)CalcCharCodeAddress(strpp, &fontComp); // 今回の文字のコードから、フォントデータ格納アドレスを算出。 + + leftp_tmp = fontProp->leftp + v_offset; // フォントデータを横ドット詰めしながらロード + rightp_tmp = fontProp->rightp + v_offset; + for(tate=0; tate < fontComp->tate_dot - 1; tate++) { + *rightp_tmp = (u16)(*fontAdr++ << 8); + if(fontComp->yoko_dot > 8) { + *rightp_tmp |= *fontAdr++; + } + + *leftp_tmp |= *rightp_tmp >> fontProp->h_offset; + *rightp_tmp <<= 16 - fontProp->h_offset; + leftp_tmp++; + rightp_tmp++; + } + fontProp->h_offset += fontComp->yoko_dot; + } + fontProp->h_offset -= 16; + temp = fontProp->leftp; + fontProp->leftp = fontProp->rightp; + fontProp->rightp = temp; + return (u8 *)temp; +} + + +// 文字コードに対応したフォントデータ格納アドレスを算出する。 +static u32 CalcCharCodeAddress(u8 **strpp, const FontComponent **font) +{ + u8 higher_code; + u8 lower_code; + u16 sjis_code; + u32 adr; + + // 対象文字が SJIS or ASCII かを判定 + higher_code = *(*strpp)++; + if( ((higher_code >= SJIS_HIGHER_CODE1_MIN) && (higher_code <= SJIS_HIGHER_CODE1_MAX)) + ||((higher_code >= SJIS_HIGHER_CODE2_MIN) && (higher_code <= SJIS_HIGHER_CODE2_MAX)) ) { // SJISか? + lower_code = *(*strpp)++; + *font = nowFontHan; + }else { // ASCII + sjis_code = tbl_ASCII_to_SJIS[higher_code]; + higher_code = (u8)(sjis_code >> 8); + lower_code = (u8)(sjis_code & 0x00ff); + *font = nowFontHan; + } + + // 文字コードからフォントデータアドレスを算出 + if(higher_code <= SJIS_HIGHER_CODE1_MIN + 3) { + higher_code -= 0x81; + }else if(higher_code <= SJIS_HIGHER_CODE1_MIN + 6) { + higher_code -= 0x83; + }else if(higher_code <= SJIS_HIGHER_CODE1_MAX) { + higher_code -= 0x84; + }else if(higher_code >= SJIS_HIGHER_CODE2_MIN) { + higher_code -= 0xc4; + } + + if(lower_code < 0x80) { + lower_code -= 0x40; + }else { + lower_code -= 0x41; + } + + adr = (*font)->start_adr + +((*font)->org_row_size) * higher_code + +((*font)->org_char_size+2) * lower_code + 2; + + return adr; +} + + +// 指定バッファの1bitフォントデータを4bitNITROキャラデータに展開。 +static void SpreadFontZen(u16 bit0_color, u16 bit1_color, u8 *fromAdr, u32 *toAdr) +{ + int i; + u8 tate; + u8 yoko; + u8 rd_data; + u32 wr_data; + u32 b0c; + u32 b1c; + u32 *toAdr_left; + u32 *toAdr_right; + + toAdr_left = toAdr; + toAdr_right = toAdr + 16; // toAdr + (16 * 4byte) + + for(tate = 0; tate < nowFontHan->need_tate_dot; tate++) { // キャラクタの縦ドット数だけ展開 + // 左右それぞれの8dotキャラを展開 + for(yoko = 0; yoko < 2; yoko++) { + wr_data = 0x00000000; // ライトデータ初期化 + + if(tate < nowFontHan->tate_dot) { + rd_data = *fromAdr++; // 左右8dotキャラの読み出し + b0c = (u32)bit0_color; // bit0 のカラー + b1c = (u32)bit1_color; // bit1 のカラー + + for(i = 0; i < 8; i++) { // 8dot分の各1bitの判定 + if(rd_data & 0x80) { + wr_data |= b1c; // "1"をカラー1へ + }else { + wr_data |= b0c; // "0"をカラー0へ + } + rd_data <<= 1; + b0c <<= 4; + b1c <<= 4; + } + } + + if(yoko==0) { + *toAdr_right++ = wr_data; // 32bit書きこみ + }else { + *toAdr_left++ = wr_data; + } + } + } +} + + +//---------------------------------------------- +// MALLOCシステムの初期化 +//---------------------------------------------- + +// VRAM上にヒープを作成。(アリーナにVRAMはないので、WRAM_MAIN, WRAM_SUBのアリーナで代用) +static void InitAllocSystemSJIS( TargetScreen target ) +{ + void* tempLo; + OSHeapHandle hh; + + // VRAM上にヒープを作成 + + if( target == TOP_SCREEN ) { + // メインLCD + OS_SetArenaLo( OS_ARENA_WRAM_MAIN, (void *)VRAM_M_ARENA_LO ); + OS_SetArenaHi( OS_ARENA_WRAM_MAIN, (void *)VRAM_M_ARENA_HI ); + tempLo = OS_InitAlloc( OS_ARENA_WRAM_MAIN, OS_GetWramMainArenaLo(), OS_GetWramMainArenaHi(), 1 ); + OS_SetArenaLo( OS_ARENA_WRAM_MAIN, tempLo ); + + hh = OS_CreateHeap( OS_ARENA_WRAM_MAIN, OS_GetWramMainArenaLo(), OS_GetWramMainArenaHi() ); + if(hh < 0) OS_Panic( "ARM9-MAIN LCD: Fail to create heap...\n" ); + OS_Printf( " arena lo = %x\n", OS_GetWramMainArenaLo() ); + OS_Printf( "WRAM arena hi = %x\n", OS_GetWramMainArenaHi() ); + hh = OS_SetCurrentHeap( OS_ARENA_WRAM_MAIN, hh ); + }else { // BOTTOM_SCREEN + // サブLCD + OS_SetArenaLo( OS_ARENA_WRAM_SUB, (void *)VRAM_S_ARENA_LO ); + OS_SetArenaHi( OS_ARENA_WRAM_SUB, (void *)VRAM_S_ARENA_HI ); + tempLo = OS_InitAlloc( OS_ARENA_WRAM_SUB, OS_GetWramSubArenaLo(), OS_GetWramSubArenaHi(), 1 ); + OS_SetArenaLo( OS_ARENA_WRAM_SUB, tempLo ); + + hh = OS_CreateHeap( OS_ARENA_WRAM_SUB, OS_GetWramSubArenaLo(), OS_GetWramSubArenaHi() ); + if(hh < 0) OS_Panic( "ARM9-SUB LCD: Fail to create heap...\n" ); + OS_Printf( "WRAM arena lo = %x\n", OS_GetWramSubArenaLo() ); + OS_Printf( "WRAM arena hi = %x\n", OS_GetWramSubArenaHi() ); + hh = OS_SetCurrentHeap( OS_ARENA_WRAM_SUB, hh ); + } +} + + +// VRAMへのキャラメモリ確保 +static void *AllocMemoryFromVram( int size ) +{ + if ( targetScreen == TOP_SCREEN ) { + return OS_AllocFromWramMain( size ); // ※縦も2キャラ分必要なので、NITRO_CHAR_SIZE*2 + }else { + return OS_AllocFromWramSub ( size ); // ※縦も2キャラ分必要なので、NITRO_CHAR_SIZE*2 + } +} + + +// VRAMへのキャラメモリ解放 +static void FreeMemoryToVram( void *p ) +{ + if ( targetScreen == TOP_SCREEN ) { + OS_FreeToWramMain( p ); + }else { + OS_FreeToWramSub( p ); + } +} + + +//---------------------------------------------- +// 16進データを文字列に変換 +//---------------------------------------------- + +// メインメモリからでも大丈夫な形式での1byteのデータ読み出し。 +__inline static u16 ReadByteHWBus(const void *srcp) +{ + if((int)srcp & 0x00000001) return (u16)(*(u16 *)((int)srcp ^ 0x00000001) >> 8); + else return (u16)(*(u16 *)(srcp) & 0x00ff); +} + +// 16進データを10進文字列に変換 +static u8 *HexToDecimalString(const void *hexp, u8 *strp, u16 figure, u16 size) +{ + u16 i; + u32 target = 0; + + for(i = 0; i < size; i++) { + target |= ReadByteHWBus( ((u8 *)hexp)++ ) << (8 * i); + } + + strp += figure; + *strp-- = 0x00; + for(i = 0; i < figure; i++) { + CP_SetDiv32_32(target, 10); + *strp-- = (u8 )(CP_GetDivRemainder32() + 0x30); + target = (u32) CP_GetDivResult32(); + } + return (strp + 1); +} + + +// 16進データを16進文字列に変換 +static u8 *HexToString(const void *hexp, u8 *strp, u16 figure) +{ + u16 i; + u8 hex; + + strp += figure; + *strp-- = 0x00; + + for(i = 0; i < figure; i++){ + hex = (u8)ReadByteHWBus(hexp); + if(i & 0x01){ + hex = (u8)( (hex >> 4) & 0x0f); + ((u8 *)hexp)++; + }else{ + hex = (u8)( hex & 0x0f); + } + if(hex < 0x000a) hex += 0x30; + else hex += 0x41 - 0x0a; + *strp-- = hex; + } + return (strp + 1); +} + + +//---------------------------------------------- +// ASCII -> SJIS 変換テーブル +//---------------------------------------------- + +const u16 tbl_ASCII_to_SJIS[0x100] = { + // 00 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + // 10 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + // 20 + 0x8140,0x8149,0x8168,0x81f2,0x8190,0x8193,0x8195,0x8166, + 0x8169,0x816a,0x8196,0x817b,0x8143,0x817c,0x8144,0x815e, + // 30 + 0x824f,0x8250,0x8251,0x8252,0x8253,0x8254,0x8255,0x8256, + 0x8257,0x8258,0x8146,0x8147,0x8183,0x8181,0x8184,0x8148, + // 40 + 0x8197,0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266, + 0x8267,0x8268,0x8269,0x826a,0x826b,0x826c,0x826d,0x826e, + // 50 + 0x826f,0x8270,0x8271,0x8272,0x8273,0x8274,0x8275,0x8276, + 0x8277,0x8278,0x8279,0x816d,0x818f,0x816e,0x814f,0x8151, + // 60 + 0x8165,0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287, + 0x8288,0x8289,0x828a,0x828b,0x828c,0x828d,0x828e,0x828f, + // 70 + 0x8290,0x8291,0x8292,0x8293,0x8294,0x8295,0x8296,0x8297, + 0x8298,0x8299,0x829a,0x816f,0x8162,0x8170,0x8160,0x81fc, + + // 80 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + // 90 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + // a0 + 0x81fc,0x8142,0x8175,0x8176,0x8141,0x8145,0x8192,0x8340, + 0x8342,0x8344,0x8346,0x8348,0x8383,0x8385,0x8387,0x8362, + // b0 + 0x815b,0x8341,0x8343,0x8345,0x8347,0x8349,0x834a,0x834c, + 0x834e,0x8350,0x8352,0x8354,0x8356,0x8358,0x835a,0x835c, + // c0 + 0x835e,0x8360,0x8363,0x8365,0x8367,0x8369,0x836a,0x836b, + 0x836c,0x836d,0x836e,0x8371,0x8374,0x8377,0x837a,0x837d, + // d0 + 0x837e,0x837f,0x838a,0x8382,0x8384,0x8386,0x8388,0x8389, + 0x838a,0x838b,0x838c,0x838d,0x838f,0x8393,0x814a,0x814b, + + // e0 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + // f0 + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, + 0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc,0x81fc, +}; + diff --git a/build/tests/DispOwnerInfo/src/font.h b/build/tests/DispOwnerInfo/src/font.h new file mode 100644 index 00000000..3d13af9a --- /dev/null +++ b/build/tests/DispOwnerInfo/src/font.h @@ -0,0 +1,123 @@ +/********************************************************************/ +/* font.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + フォント処理ヘッダ + + + $Log: font.h,v $ + Revision 1.2 2005/03/09 04:44:39 yosiokat + 機能追加。 + + Revision 1.1.1.1 2004/08/31 06:20:24 Yosiokat + no message + + + + + // **** old logs **** + + Revision 1.7 2004/08/18 07:17:26 Yosiokat + 上下LCDをターゲットにして、別個に初期化できるよう変更。 + + Revision 1.6 2004/08/17 07:52:03 Yosiokat + ・SetTargetScreenSJISを追加して、上下LCDのどちらにも文字表示が可能になるよう変更。 + + Revision 1.5 2004/08/07 05:44:43 Yosiokat + ・SJIS文字列表示関数を引数でハンドルを指定しない仕様に変更する。 + ・上記変更に対応して、クリア関数も仕様変更。 + + Revision 1.4 2004/07/13 00:31:48 Yosiokat + ・サブLCD側のVRAMを対象にするよう変更。 + + Revision 1.3 2004/06/06 02:39:31 Yosiokat + SJISコード判定用の定数定義をfont.hに移動。 + + Revision 1.2 2004/05/26 01:16:57 Yosiokat + 文字制御をSJISベースに変更中。 + + Revision 1.1 2004/05/25 08:59:22 Yosiokat + 文字列をSJISで制御するように変更。 + + +*/ + +#ifndef __FONT_H_ +#define __FONT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +// define data---------------------------------- +#define STR_ENTRY_MAX_NUM 256 // 登録可能な文字列データの最大個数 + +#define SJIS_CHAR_VRAM_OFFSET 0x100 // SJIS文字列キャラクタ用VRAMのオフセット値 +#define SJIS_CHAR_VRAM_SIZE (0x8000 + 0x20) //   〃          のサイズ(0x20はヒープのヘッダ) + +#define VRAM_M_ARENA_LO (HW_BG_VRAM + SJIS_CHAR_VRAM_OFFSET - 0x20) +#define VRAM_M_ARENA_HI (VRAM_M_ARENA_LO + SJIS_CHAR_VRAM_SIZE) +#define VRAM_S_ARENA_LO (HW_DB_BG_VRAM + SJIS_CHAR_VRAM_OFFSET - 0x20) +#define VRAM_S_ARENA_HI (VRAM_S_ARENA_LO + SJIS_CHAR_VRAM_SIZE) + // VRAMアリーナのLo & Hi + // SJISコード判定用の値 +#define SJIS_HIGHER_CODE1_MIN 0x81 +#define SJIS_HIGHER_CODE1_MAX 0x9f +#define SJIS_HIGHER_CODE2_MIN 0xe0 +#define SJIS_HIGHER_CODE2_MAX 0xea + +// 関数のエラーリターン値 +#define DSJIS_ERR_ENTRY_GET_FAILED 0x8000 +#define DSJIS_ERR_ENTRY_ALLOC_FAILED 0x8001 +#define DSJIS_ERR_CHAR_ALLOC_FAILED 0x8002 +#define DSJIS_ERR_STR_MEMORY_OVER 0x8003 +#define DSJIS_ERR_STR_LENGTH_TOO_LONG 0x8004 + +// SetTargetScreenSJISの引数target +typedef enum TargetScreen { + TOP_SCREEN =0, + BOTTOM_SCREEN +}TargetScreen; + +// フォント種類データ(SelectFontで指定) +typedef enum FontType{ // 全角  半角 + FONT12, // 12x12 & 12x 7dot + FONT_TYPE_MAX +}FontType; + + +// function's prototype declaration------------- + +void InitFont( TargetScreen target ); +void SetFont( FontType font ); +void SetTargetScreenSJIS( TargetScreen target ); +u16 ChangeColorSJIS( u16 handle, u16 new_color ); + +// 以下の表示関数は、データアドレスからデータハンドルを算出するので、ハンドルを引数で与えなくて良いが、同一アドレスのデータを複数場所に配置することができない。 +u16 DrawStringSJIS ( u16 x, u16 y, u16 color, const void *str ); +u16 DrawHexSJIS ( u16 x, u16 y, u16 color, const void *hexp, u16 figure ); +u16 DrawDecimalSJIS( u16 x, u16 y, u16 color, const void *hexp, u16 figure, u16 size ); + +// Ex系は、引数にindexを設けることで、上記関数で制限されている同一アドレスデータの複数場所配置に対応している。 +u16 DrawStringSJISEx ( u16 x, u16 y, u16 color, const void *strp, int index ); +u16 DrawHexSJISEx ( u16 x, u16 y, u16 color, const void *hexp, u16 figure, int index ); +u16 DrawDecimalSJISEx( u16 x, u16 y, u16 color, const void *hexp, u16 figure, u16 size, int index ); + +// 表示文字列クリア関数 +void ClearStringSJIS( void *datap ); +void ClearStringSJISEx( void *datap, int handleIndex ); +void ClearStringSJIS_handle( u16 handle ); +void ClearAllStringSJIS( void ); + + +#ifdef __cplusplus +} +#endif + +#endif // __FONT_H_ + diff --git a/build/tests/DispOwnerInfo/src/initFunc.c b/build/tests/DispOwnerInfo/src/initFunc.c new file mode 100644 index 00000000..ceb4211d --- /dev/null +++ b/build/tests/DispOwnerInfo/src/initFunc.c @@ -0,0 +1,149 @@ +/********************************************************************/ +/* initFunc.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + 初期化関数群 + + $Log: initFunc.c,v $ + Revision 1.2.10.1 2007/01/22 07:36:16 yosiokat + NAT-IPL2への対応。 + + Revision 1.2.2.1 2006/02/06 11:34:35 yosiokat + GetIPL2CRC16をUSG-IPL2-WW版でのコードのNVRAM格納フォーマットが変更されたことに + 対応させる。 + + Revision 1.2 2005/04/02 07:42:19 yosiokat + IPL2フォントを"s"に変更。 + + Revision 1.1 2005/04/02 06:41:18 yosiokat + main.cから起動時の初期化関数を分離。 + + +*/ + + +#include +#include "data.h" +#include "main.h" + +// define data--------------------------------------------- + +// extern data--------------------------------------------- + +// function's prototype------------------------------------ + +// global variables---------------------------------------- +u32 ipl2_crc32 = 0; + +// static variables---------------------------------------- + + +// const data---------------------------------------------- + + +// ================================================================== +/* function */ + +// 表示系初期化 +void InitDisp( void ) +{ + // メインLCD + { + GX_SetBankForBG ( GX_VRAM_BG_128_A ); //  〃     BG 用 + GX_SetBankForOBJ( GX_VRAM_OBJ_32_FG ); //  〃     OBJ用 + GX_SetGraphicsMode( GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D ); + G2_SetBG1Control( GX_BG_SCRSIZE_TEXT_256x256, // 256pix x 256pix text + GX_BG_COLORMODE_16, // use 256 colors mode + GX_BG_SCRBASE_0xf000, // screen base offset + 0x0000 is the address for BG #0 screen + GX_BG_CHARBASE_0x00000, // character base offset + 0x04000 is the address for BG #0 characters + GX_BG_EXTPLTT_01 // use BGExtPltt slot #0 if BGExtPltt is enabled + ); + G2_SetBG1Priority( 3 ); + G2_BG1Mosaic( FALSE ); + G2_SetBG2ControlText( GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, + GX_BG_CHARBASE_0x10000 + ); + G2_SetBG2Priority( 2 ); + G2_BG2Mosaic( FALSE ); + MI_CpuClearFast( (void *)HW_BG_VRAM, 0x20000 ); // BG -VRAM クリア + MI_CpuClearFast( (void *)HW_OBJ_VRAM, 0x8000 ); // OBJ-VRAM クリア + MI_CpuClearFast( (void *)HW_PLTT, HW_PLTT_SIZE ); // パレット クリア // NitroSDKではcrt0.cでクリアしている。 + MI_CpuFill32( (void *)HW_OAM, 192, HW_OAM_SIZE ); // OAM クリア // NitroSDKではcrt0.cでクリアしている。 + MI_CpuCopyFast( myPlttData, (void *)( HW_BG_PLTT + 2 * 16 ), sizeof(myPlttData) ); // BGパレット セット + MI_CpuCopyFast( myPlttData, (void *)( HW_BG_PLTT + 2 * 16 ), sizeof(myPlttData) ); // OBJパレット セット + } + // サブLCD + { + GXS_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); + GX_SetBankForSubBG ( GX_VRAM_SUB_BG_128_C ); // VRAM-C for BGs + GX_SetBankForSubOBJ( GX_VRAM_SUB_OBJ_128_D ); // VRAM-D for BGs + GXS_SetGraphicsMode( GX_BGMODE_0 ); // BGMODE is 0 + G2S_SetBG1Control( GX_BG_SCRSIZE_TEXT_256x256, // 256pix x 256pix text + GX_BG_COLORMODE_16, // use 256 colors mode + GX_BG_SCRBASE_0xf000, // screen base offset + 0x0000 is the address for BG #0 screen + GX_BG_CHARBASE_0x00000, // character base offset + 0x04000 is the address for BG #0 characters + GX_BG_EXTPLTT_01 // use BGExtPltt slot #0 if BGExtPltt is enabled + ); + G2S_SetBG1Priority( 3 ); + G2S_BG1Mosaic( FALSE ); + G2S_SetBG2ControlText( GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0xf800, + GX_BG_CHARBASE_0x10000 + ); + G2S_SetBG2Priority( 2 ); + G2S_BG2Mosaic( FALSE ); + GXS_SetVisiblePlane( GX_PLANEMASK_BG1 | GX_PLANEMASK_BG2 ); // display only BG #0 + MI_CpuFill32( (void *)HW_DB_OAM, 192, HW_OAM_SIZE ); // OAM クリア + MI_CpuClearFast( (void *)HW_DB_BG_VRAM, 0x20000 ); // BG -VRAM クリア + MI_CpuClearFast( (void *)HW_DB_OBJ_VRAM, 0x20000 ); // OBJ -VRAM クリア + MI_CpuCopyFast( myPlttData, (void *)( HW_DB_BG_PLTT + 2 * 16 ), sizeof(myPlttData) ); // BGパレット セット + MI_CpuCopyFast( myPlttData, (void *)( HW_DB_BG_PLTT + 2 * 16 ), sizeof(myPlttData) ); // OBJパレット セット + } +} + + +//--------------------------------------------------------------------------- +// IPL2フォント初期化 +//--------------------------------------------------------------------------- +void InitIPL2Font( void ) +{ + // フォントインスタンスの作成。 + // 描画用のキャラクタバッファを作成。 + fnt_CreateFont( &font_m, NITRO_LC_Font_s_bnfr, NITRO_LC_Font_s_bncmp ); + fnt_CreateDrawContext( &context_m, canvas_m, CANVAS_WIDTH, CANVAS_HEIGHT, FNT_DCTYPE_4BITS, &font_m ); + + fnt_CreateFont( &font_s, NITRO_LC_Font_s_bnfr, NITRO_LC_Font_s_bncmp ); + fnt_CreateDrawContext( &context_s, canvas_s, CANVAS_WIDTH, CANVAS_HEIGHT, FNT_DCTYPE_4BITS, &font_s ); + + InitIPL2FontBG(); +} + +//--------------------------------------------------------------------------- +// IPL2フォント表示用スクリーン&パレット初期化 +//--------------------------------------------------------------------------- +void InitIPL2FontBG( void ) +{ + int x, y; + + GX_LoadBGPltt ( s_Palette, 0, sizeof(s_Palette) ); + GXS_LoadBGPltt( s_Palette, 0, sizeof(s_Palette) ); + for ( y = 0 ; y < (CANVAS_HEIGHT >> 3) ; ++y ) { + for ( x = 0 ; x < (CANVAS_WIDTH >> 3) ; ++x ) { + screen_m[ y * 32 + x] = (u16)(y * 32 + x); + screen_s[ y * 32 + x] = (u16)(y * 32 + x); + } + } + DC_FlushRange ( screen_m, (CANVAS_WIDTH >> 3) * (CANVAS_HEIGHT >> 3) * 2 ); + GX_LoadBG2Scr ( screen_m, 0, (CANVAS_WIDTH >> 3) * (CANVAS_HEIGHT >> 3) * 2 ); + MI_CpuFillFast( canvas_m, 0, sizeof(canvas_m) ); + + DC_FlushRange ( screen_s, (CANVAS_WIDTH >> 3) * (CANVAS_HEIGHT >> 3) * 2 ); + GXS_LoadBG2Scr( screen_s, 0, (CANVAS_WIDTH >> 3) * (CANVAS_HEIGHT >> 3) * 2 ); + MI_CpuFillFast( canvas_s, 0, sizeof(canvas_s) ); +} diff --git a/build/tests/DispOwnerInfo/src/main.c b/build/tests/DispOwnerInfo/src/main.c new file mode 100644 index 00000000..9f2fdf27 --- /dev/null +++ b/build/tests/DispOwnerInfo/src/main.c @@ -0,0 +1,164 @@ +/********************************************************************/ +/* main.c */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + メイン + + $Log: main.c,v $ + Revision 1.7 2005/04/06 08:26:57 yosiokat + IPL2フォントチェックでのメモリ確保サイズ増加に伴い、ヒープサイズを0x100000に増加。 + + Revision 1.6 2005/04/02 07:41:57 yosiokat + ・IPL2フォント表示に対応。 + ・起動時の初期化ルーチンをinitFunc.cに分離。 + + Revision 1.5 2005/04/01 05:46:48 yosiokat + デバッグ変数&表示追加。 + + Revision 1.4 2005/03/31 05:58:17 yosiokat + ・NVRAMアクセス関数を修正し、別ソースに分離。 + ・IPL2ヘッダ情報取得を専用関数を用いるよう変更。 + ・GetIPL2CRC16のNVRAMアクセス関数を変更。 + + Revision 1.3 2005/03/09 04:44:39 yosiokat + 機能追加。 + + Revision 1.2 2004/09/23 11:28:32 Yosiokat + 本体フラッシュに格納されているIPL2 verを表示するよう変更。 + + Revision 1.1.1.1 2004/08/31 06:20:24 Yosiokat + no message + + +*/ + + +#include +#include "data.h" +#include "main.h" + +// define data--------------------------------------------- + +// extern data--------------------------------------------- + +// function's prototype------------------------------------ +static void VBlankIntr( void ); + +// global variables---------------------------------------- + +// static variables---------------------------------------- + + +// const data---------------------------------------------- + + + +// ================================================================== +/* function */ + + +// メイン +void NitroMain( void ) +{ + /* OS 初期化 */ + OS_InitPrintServer(); + OS_Init(); + PXI_InitFifo(); + OS_InitThread(); + OS_InitTick(); + OS_InitAlarm(); + FX_Init(); + TP_Init(); + (void)RTC_Init(); + + /* GX 初期化 */ + GX_Init(); + GX_DispOff(); + GXS_DispOff(); + + /* Vブランク割込設定 */ + (void)OS_SetIrqFunction( OS_IE_V_BLANK, VBlankIntr ); + (void)OS_EnableIrqMask( OS_IE_V_BLANK ); + (void)OS_EnableIrqMask(OS_IE_FIFO_RECV); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + (void)GX_VBlankIntr( TRUE ); + + { /* メモリ割り当ての初期化 */ + enum { MAIN_HEAP_SIZE = 0x100000 } ; + void *heapStart, *nstart; + int hh; + + nstart = OS_InitAlloc( OS_ARENA_MAIN, OS_GetMainArenaLo(), OS_GetMainArenaHi(), 16 ); + OS_SetMainArenaLo( nstart ); + heapStart = OS_AllocFromMainArenaLo( (u32)MAIN_HEAP_SIZE, 32 ); + hh = OS_CreateHeap( OS_ARENA_MAIN, heapStart, (void*)( (u32)heapStart + MAIN_HEAP_SIZE ) ); + (void)OS_SetCurrentHeap( OS_ARENA_MAIN, hh ); + } + + { /* FS 初期化 */ + static u32 fs_tablework[0x100 / 4]; + FS_Init(FS_DMA_NOT_USE); + (void)FS_LoadTable(fs_tablework, sizeof(fs_tablework)); + } + + // Disp初期化 + InitDisp(); + InitIPL2Font(); + /* 表示開始 */ + GX_DispOn(); + GXS_DispOn(); + + // 初期メインループ関数の設定 + pad.cont = 0xffff; + + SEQ_DispNCD_init(); + nowProcess = SEQ_DispNCD; + + /* メインループ */ + while(1) { + SVC_WaitVBlankIntr(); + ReadKeyPad(); + + (void)nowProcess(); + + OS_PrintServer(); + } +} + + +// Vブランク割り込み処理 +static void VBlankIntr( void ) +{ + // OAM, BG-VRAMの更新 + DC_FlushRange ( oamBakM, sizeof(oamBakM) ); + DC_FlushRange ( oamBakS, sizeof(oamBakS) ); + DC_FlushRange ( bgBakM, sizeof(bgBakM) ); + DC_FlushRange ( bgBakS, sizeof(bgBakS) ); + MI_CpuCopyFast( oamBakM, (void*)HW_OAM, sizeof(oamBakM) ); + MI_CpuCopyFast( oamBakS, (void*)HW_DB_OAM, sizeof(oamBakS) ); + MI_CpuCopyFast( bgBakM, (void*)(HW_BG_VRAM + 0xf000), sizeof(bgBakM) ); + MI_CpuCopyFast( bgBakS, (void*)(HW_DB_BG_VRAM + 0xf000), sizeof(bgBakS) ); + + // BG2キャラクタに転送。 + DC_FlushRange ( context_m.canvas, sizeof( canvas_m ) ); + GX_LoadBG2Char ( context_m.canvas, 0, sizeof( canvas_m ) ); + DC_FlushRange ( context_s.canvas, sizeof( canvas_s ) ); + GXS_LoadBG2Char( context_s.canvas, 0, sizeof( canvas_s ) ); + + //---- 割り込みチェックフラグ + OS_SetIrqCheckFlag( OS_IE_V_BLANK ); +} + + +// キー入力データ読み出し +void ReadKeyPad( void ) +{ + u16 readData = PAD_Read(); + pad.trg = (u16)(readData & (readData ^ pad.cont)); // トリガ 入力 + pad.cont = readData; // ベタ 入力 +} + diff --git a/build/tests/DispOwnerInfo/src/main.h b/build/tests/DispOwnerInfo/src/main.h new file mode 100644 index 00000000..e654fccb --- /dev/null +++ b/build/tests/DispOwnerInfo/src/main.h @@ -0,0 +1,41 @@ +/********************************************************************/ +/* main.h */ +/* DebugForIPL2 */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + メイン定義 ヘッダ +*/ + +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include +#include +#include "myFunc.h" + +// define data-------------------------------------------- +#define MSG_VIEW_COUNT 30 + + +// function----------------------------------------------- +extern void SEQ_DispNCD_init( void ); +extern int SEQ_DispNCD( void ); + +// プログラム起動時に使用 +extern void InitDisp( void ); +extern void InitIPL2Font( void ); +extern void InitIPL2FontBG( void ); +extern void ReadKeyPad( void ); + +#ifdef __cplusplus +} +#endif + +#endif // __MAIN_H__ diff --git a/build/tests/DispOwnerInfo/src/myChar.c b/build/tests/DispOwnerInfo/src/myChar.c new file mode 100644 index 00000000..1787d52d --- /dev/null +++ b/build/tests/DispOwnerInfo/src/myChar.c @@ -0,0 +1,667 @@ +/********************************************************************/ +/* myChar.c */ +/* NITRO-IPL */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + キャラクタ&パレットデータ + + + $Log: myChar.c,v $ + Revision 1.1 2005/02/08 04:41:25 yosiokat + 新規追加。 + + Revision 1.2 2004/05/19 08:25:28 yosiokat + 更新ログの追加。 + + +*/ + +#include "myFunc.h" + +// パレットデータ-------------------------------------------------------------- + +// キャラクタデータ------------------------------------------------------------ +const u16 myChar[0x2800*8/16]={ + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //0 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //3 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //4 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //5 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //6 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //7 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //8 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //b + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //c + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //d + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //e + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //f + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //10 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //11 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //12 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //13 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //14 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //15 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //16 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //17 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //18 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //19 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1a + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1b + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1c + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1d + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1e + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //1f + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //20 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //21 + 0x1333,0x3321,0x2333,0x3332,0x1333,0x3321,0x2333,0x3332, + 0x2113,0x3211,0x2113,0x3211,0x2123,0x3212,0x3213,0x3321, //22 + 0x3323,0x3332,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x2133,0x3321,0x1113,0x3211,0x2123,0x3321, //23 + 0x2133,0x3321,0x1113,0x3211,0x2123,0x3321,0x3233,0x3332, + 0x3333,0x3333,0x1333,0x3332,0x1133,0x3211,0x1213,0x3322, //24 + 0x1123,0x3311,0x1233,0x2112,0x1113,0x3211,0x1223,0x3322, + 0x3333,0x3333,0x2133,0x2133,0x1213,0x3212,0x2123,0x3321, //25 + 0x1233,0x3212,0x2133,0x2121,0x3213,0x3212,0x3323,0x3323, + 0x3333,0x3333,0x1133,0x3331,0x2113,0x3212,0x1123,0x3321, //26 + 0x2113,0x2111,0x3213,0x3213,0x1123,0x2121,0x2233,0x3232, + 0x1133,0x3332,0x1133,0x3332,0x1233,0x3332,0x2133,0x3333, //27 + 0x3233,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3213,0x3333,0x3321,0x1333,0x3332, //28 + 0x1333,0x3332,0x1333,0x3332,0x2333,0x3331,0x3333,0x3312, + 0x3333,0x3333,0x3133,0x3333,0x1233,0x3333,0x2333,0x3321, //29 + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2133,0x3333, + 0x3333,0x3333,0x1333,0x3332,0x1213,0x3212,0x1133,0x3321, //2a + 0x1233,0x3332,0x1133,0x3321,0x1213,0x3212,0x1323,0x3222, + 0x3333,0x3333,0x3333,0x3333,0x1333,0x3332,0x1333,0x3332, //2b + 0x1113,0x3211,0x1223,0x3222,0x1333,0x3332,0x2333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2c + 0x1133,0x3332,0x1133,0x3332,0x1233,0x3332,0x2133,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2d + 0x1113,0x3211,0x2223,0x3222,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //2e + 0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x2233,0x3333, + 0x3333,0x3333,0x3333,0x2133,0x3333,0x3213,0x3333,0x3321, //2f + 0x1333,0x3332,0x2133,0x3333,0x3213,0x3333,0x3323,0x3333, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //30 + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1333,0x3321,0x1133,0x3321,0x1233,0x3321, //31 + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x2112,0x1133,0x3211, //32 + 0x2113,0x3322,0x2113,0x3333,0x1113,0x2111,0x2223,0x3222, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x2112,0x1133,0x3211, //33 + 0x2233,0x2112,0x3333,0x2113,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x3333,0x3211,0x1333,0x3211,0x2133,0x3211, //34 + 0x3213,0x3211,0x1113,0x2111,0x2223,0x3211,0x3333,0x3322, + 0x3333,0x3333,0x1113,0x3211,0x2213,0x3322,0x1113,0x3211, //35 + 0x2223,0x2112,0x3333,0x2113,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x3322,0x1113,0x3211, //36 + 0x2113,0x2112,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1113,0x2111,0x2223,0x2122,0x3333,0x3213, //37 + 0x3333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3332, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x1123,0x3211, //38 + 0x2113,0x2112,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //39 + 0x1123,0x2111,0x2233,0x2112,0x1133,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, //3a + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, //3b + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x2333,0x3321, + 0x3333,0x3333,0x3333,0x3321,0x1333,0x3332,0x2133,0x3333, //3c + 0x2133,0x3333,0x1233,0x3333,0x2333,0x3321,0x3333,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3211, //3d + 0x2233,0x3222,0x1133,0x3211,0x2233,0x3222,0x3333,0x3333, + 0x3333,0x3333,0x1333,0x3333,0x2333,0x3331,0x3333,0x3212, //3e + 0x3333,0x3213,0x3333,0x3321,0x1333,0x3332,0x2333,0x3333, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //3f + 0x3223,0x3211,0x1333,0x3321,0x2333,0x3332,0x1333,0x3321, + 0x3333,0x3333,0x1133,0x3321,0x2213,0x3212,0x1213,0x2121, //40 + 0x2113,0x2121,0x2113,0x2121,0x1213,0x3211,0x1123,0x2121, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //41 + 0x1113,0x2111,0x2113,0x2112,0x2113,0x2113,0x2223,0x2223, + 0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //42 + 0x2113,0x2112,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2223, //43 + 0x2113,0x3333,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x2113,0x2113, //44 + 0x2113,0x2113,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x1113,0x2111,0x2113,0x2222,0x1113,0x3211, //45 + 0x2113,0x3222,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222, + 0x3333,0x3333,0x1113,0x2111,0x2113,0x2222,0x1113,0x3211, //46 + 0x2113,0x3222,0x2113,0x3333,0x2113,0x3333,0x2223,0x3333, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x3322,0x2113,0x2111, //47 + 0x2113,0x2112,0x2113,0x2113,0x1123,0x2111,0x2233,0x3222, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x1113,0x2111, //48 + 0x2113,0x2112,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223, + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //49 + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x3333,0x2113,0x3333,0x2113,0x3333,0x2113, //4a + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x3211,0x1113,0x3322, //4b + 0x1113,0x3331,0x2113,0x3311,0x2113,0x2112,0x2223,0x2223, + 0x3333,0x3333,0x2113,0x3333,0x2113,0x3333,0x2113,0x3333, //4c + 0x2113,0x3333,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222, + 0x3333,0x3333,0x2133,0x2133,0x1113,0x1112,0x1113,0x1112, //4d + 0x1113,0x1111,0x2113,0x1121,0x2113,0x1121,0x3223,0x2232, + 0x3333,0x3333,0x2113,0x2113,0x1113,0x2112,0x1113,0x2112, //4e + 0x2113,0x2111,0x2113,0x2111,0x2113,0x2112,0x2223,0x2223, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //4f + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //50 + 0x2113,0x3322,0x2113,0x3333,0x2113,0x3333,0x2223,0x3333, + 0x3333,0x3333,0x1133,0x3211,0x2113,0x2112,0x2113,0x2113, //51 + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x2111, + 0x3333,0x3333,0x1113,0x3211,0x2113,0x2112,0x1113,0x3211, //52 + 0x2113,0x2112,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223, + 0x3333,0x3333,0x1133,0x2111,0x2113,0x3222,0x1123,0x3331, //53 + 0x1233,0x3311,0x2333,0x2112,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x1113,0x2111,0x1223,0x3221,0x1333,0x3321, //54 + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2113,0x2113, //55 + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2113,0x2113, //56 + 0x2113,0x2113,0x2123,0x3213,0x1233,0x3321,0x2333,0x3332, + 0x3333,0x3333,0x2113,0x1121,0x2113,0x1121,0x2113,0x1121, //57 + 0x1113,0x1111,0x1123,0x2112,0x2133,0x2133,0x3233,0x3233, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x1123,0x3211, //58 + 0x1233,0x3211,0x2113,0x2112,0x2113,0x2113,0x3223,0x3223, + 0x3333,0x3333,0x2113,0x2113,0x2113,0x2113,0x2133,0x3213, //59 + 0x1133,0x3211,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x1113,0x2111,0x2223,0x2112,0x1333,0x3221, //5a + 0x1133,0x3332,0x2113,0x3333,0x1113,0x2111,0x2223,0x2222, + 0x3333,0x3333,0x1333,0x3321,0x1333,0x3322,0x1333,0x3332, //5b + 0x1333,0x3332,0x1333,0x3332,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x3313,0x3333,0x3123,0x3333,0x1233,0x3333, //5c + 0x2333,0x3331,0x3333,0x3312,0x3333,0x3123,0x3333,0x3233, + 0x3333,0x3333,0x1333,0x3321,0x2333,0x3321,0x3333,0x3321, //5d + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x1333,0x3332,0x2133,0x3321,0x3233,0x3322, //5e + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //5f + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2222, + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3332,0x2333,0x3321, //60 + 0x3333,0x3332,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2213,0x2112, //61 + 0x1123,0x2111,0x2113,0x2112,0x1123,0x2111,0x2233,0x2222, + 0x2113,0x3333,0x2113,0x3333,0x1113,0x3211,0x2113,0x2112, //62 + 0x2113,0x2113,0x2113,0x2113,0x1113,0x3211,0x2223,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2122, //63 + 0x2113,0x3233,0x2113,0x2133,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x2113,0x3333,0x2113,0x1133,0x2111,0x2113,0x2112, //64 + 0x2113,0x2113,0x2113,0x2113,0x1123,0x2111,0x2233,0x2222, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2112, //65 + 0x1113,0x2111,0x2113,0x3222,0x1123,0x2111,0x2233,0x3222, + 0x1333,0x3211,0x1133,0x3322,0x1113,0x3321,0x1123,0x3332, //66 + 0x1133,0x3332,0x1133,0x3332,0x1133,0x3332,0x2233,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x2111,0x2113,0x2112, //67 + 0x2113,0x2113,0x1123,0x2111,0x2213,0x2112,0x1133,0x3211, + 0x2113,0x3333,0x2113,0x3333,0x1113,0x3311,0x2113,0x2112, //68 + 0x2113,0x2113,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223, + 0x1333,0x3321,0x2333,0x3332,0x1333,0x3321,0x1333,0x3321, //69 + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3211,0x3333,0x3322,0x3333,0x3211,0x3333,0x3211, //6a + 0x3333,0x3211,0x3333,0x3211,0x3213,0x3211,0x1123,0x3321, + 0x2113,0x3333,0x2113,0x3213,0x2113,0x3211,0x1113,0x3321, //6b + 0x1113,0x3321,0x2113,0x3311,0x2113,0x2112,0x2223,0x3223, + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x1333,0x3321, //6c + 0x1333,0x3321,0x1333,0x3321,0x1333,0x3321,0x2333,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x1211,0x1121, //6d + 0x1211,0x1121,0x1211,0x1121,0x1211,0x1121,0x2322,0x2232, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x2113,0x2112, //6e + 0x2113,0x2113,0x2113,0x2113,0x2113,0x2113,0x2223,0x2223, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2112, //6f + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x2113,0x2112, //70 + 0x2113,0x2113,0x1113,0x3211,0x2113,0x3322,0x2113,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x2111,0x2113,0x2112, //71 + 0x2113,0x2113,0x1123,0x2111,0x2233,0x2112,0x3333,0x2113, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x2112,0x1133,0x2111, //72 + 0x1133,0x3222,0x1133,0x3332,0x1133,0x3332,0x2233,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x1113,0x3322, //73 + 0x1133,0x3211,0x2233,0x2111,0x1133,0x3211,0x2233,0x3322, + 0x1133,0x3332,0x1113,0x3321,0x1123,0x3332,0x1133,0x3332, //74 + 0x1133,0x3332,0x1133,0x3332,0x1233,0x3321,0x2333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //75 + 0x2113,0x2113,0x2113,0x2113,0x1123,0x3211,0x2233,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //76 + 0x2113,0x2113,0x2113,0x3213,0x1113,0x3321,0x2223,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1211,0x1121,0x1211,0x1121, //77 + 0x1211,0x1121,0x1211,0x1121,0x1111,0x2111,0x2222,0x3222, + 0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //78 + 0x1123,0x3211,0x2113,0x2112,0x2113,0x2113,0x3223,0x3223, + 0x3333,0x3333,0x3333,0x3333,0x2113,0x2113,0x2113,0x2113, //79 + 0x2113,0x2113,0x1123,0x2111,0x2233,0x2112,0x1133,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x3211, //7a + 0x1333,0x3321,0x1133,0x3332,0x1113,0x2111,0x2223,0x2222, + 0x3333,0x3333,0x3333,0x3321,0x1333,0x3332,0x1333,0x3332, //7b + 0x2133,0x3333,0x1333,0x3332,0x1333,0x3332,0x3333,0x3321, + 0x3333,0x3333,0x1333,0x3332,0x1333,0x3332,0x1333,0x3332, //7c + 0x1333,0x3332,0x1333,0x3332,0x1333,0x3332,0x2333,0x3332, + 0x3333,0x3333,0x1333,0x3332,0x3333,0x3321,0x3333,0x3321, //7d + 0x3333,0x3213,0x3333,0x3321,0x3333,0x3321,0x1333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3113,0x3333, //7e + 0x1221,0x2133,0x2332,0x3211,0x3333,0x3322,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //7f + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x2211,0x2222,0x2211,0x2222,0x2211,0x2222,0x2211,0x2222, //80 + 0x2211,0x2222,0x2211,0x2222,0x2211,0x2222,0x2211,0x2222, + 0x1111,0x2222,0x1111,0x2222,0x1111,0x2222,0x1111,0x2222, //81 + 0x1111,0x2222,0x1111,0x2222,0x1111,0x2222,0x1111,0x2222, + 0x1111,0x2211,0x1111,0x2211,0x1111,0x2211,0x1111,0x2211, //82 + 0x1111,0x2211,0x1111,0x2211,0x1111,0x2211,0x1111,0x2211, + 0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111, //83 + 0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111, + 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, //84 + 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, + 0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, //85 + 0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, + 0x1333,0x3331,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, //86 + 0x1111,0x1111,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //87 + 0x1111,0x1111,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3333,0x2213, //88 + 0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x1111,0x2222,0x2222, //89 + 0x1111,0x1111,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x1111,0x2222,0x2222, //8a + 0x1111,0x1111,0x1333,0x3331,0x1333,0x3331,0x1333,0x3331, + 0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213, //8b + 0x3333,0x1213,0x3333,0x1213,0x3333,0x1213,0x3333,0x1213, + 0x3133,0x3333,0x1133,0x3333,0x1133,0x3331,0x1133,0x3311, //8c + 0x1133,0x3321,0x1133,0x3332,0x2133,0x3333,0x3233,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3332, //8d + 0x2123,0x3213,0x1133,0x3321,0x1213,0x3212,0x2113,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //8e + 0x3333,0x3321,0x3213,0x3213,0x3213,0x3213,0x2133,0x3323, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //8f + 0x1133,0x3332,0x2213,0x3321,0x3323,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x2133,0x3333, //90 + 0x1113,0x3321,0x1223,0x3332,0x2133,0x3333,0x1213,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3312, //91 + 0x2123,0x3323,0x1113,0x3321,0x2113,0x3213,0x2113,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3213,0x3321, //92 + 0x1123,0x3211,0x2113,0x3212,0x1223,0x3322,0x1333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //93 + 0x1213,0x3321,0x1113,0x3212,0x1213,0x3211,0x1323,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //94 + 0x1333,0x3321,0x1133,0x3332,0x1213,0x3321,0x1123,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //95 + 0x1333,0x3321,0x2113,0x3212,0x3223,0x3213,0x1333,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //96 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //97 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //98 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //99 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9a + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9b + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9c + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9d + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9e + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //9f + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a0 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a1 + 0x3333,0x3333,0x1133,0x3321,0x2133,0x3321,0x1133,0x3321, + 0x3333,0x3333,0x1333,0x3211,0x1333,0x3322,0x1333,0x3332, //a2 + 0x1333,0x3332,0x2333,0x3332,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //a3 + 0x3333,0x3321,0x3333,0x3321,0x1133,0x3321,0x2233,0x3322, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a4 + 0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x1333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //a5 + 0x1333,0x3332,0x2333,0x3332,0x3333,0x3333,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //a6 + 0x1113,0x2111,0x2223,0x2122,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x3321, //a7 + 0x2223,0x3321,0x2133,0x3321,0x2133,0x3332,0x3213,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //a8 + 0x1133,0x3332,0x2111,0x3333,0x2122,0x3333,0x2133,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1333,0x3332, //a9 + 0x1113,0x3211,0x2213,0x3212,0x3323,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //aa + 0x1133,0x3321,0x1233,0x3332,0x1333,0x3332,0x1113,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3321, //ab + 0x1113,0x3211,0x2223,0x3321,0x1333,0x3321,0x2113,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1213,0x3211, //ac + 0x2111,0x3212,0x2122,0x3323,0x1333,0x3332,0x1333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //ad + 0x1113,0x3321,0x2223,0x3321,0x3333,0x3321,0x1113,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3211, //ae + 0x2233,0x3212,0x1133,0x3211,0x2233,0x3212,0x1133,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //af + 0x1213,0x3212,0x2323,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //b0 + 0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x3333,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x3212, //b1 + 0x2133,0x3213,0x2133,0x3321,0x2133,0x3332,0x3211,0x3333, + 0x3333,0x3333,0x3333,0x2133,0x3333,0x3213,0x1333,0x3321, //b2 + 0x2113,0x3321,0x3223,0x3321,0x3333,0x3321,0x3333,0x3321, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x2213,0x2122, //b3 + 0x3323,0x2133,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x3211,0x1223,0x3322, //b4 + 0x1333,0x3332,0x1333,0x3332,0x1333,0x3332,0x1111,0x2111, + 0x3333,0x3333,0x3333,0x3213,0x1113,0x2111,0x2223,0x3212, //b5 + 0x3333,0x3211,0x1333,0x3212,0x1333,0x3212,0x2113,0x3213, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x1223,0x2122, //b6 + 0x1333,0x2132,0x2133,0x2133,0x2133,0x2133,0x3213,0x3213, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x2111,0x2223,0x3221, //b7 + 0x3333,0x3321,0x1113,0x1111,0x2223,0x2212,0x3333,0x3213, + 0x3333,0x3333,0x1133,0x2111,0x2133,0x2122,0x3213,0x2133, //b8 + 0x3323,0x3213,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3213,0x3333,0x1113,0x2111,0x2213,0x3212, //b9 + 0x3321,0x3213,0x3332,0x3321,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //ba + 0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x1113,0x2111, + 0x3333,0x3333,0x3213,0x3213,0x1111,0x2111,0x2212,0x3212, //bb + 0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x2113,0x2133,0x3223,0x2133, //bc + 0x2113,0x2133,0x3223,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x3212, //bd + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3212,0x2113,0x2133, + 0x3333,0x3333,0x2133,0x3333,0x1133,0x2111,0x2111,0x2122, //be + 0x2122,0x3213,0x2133,0x3323,0x2133,0x3333,0x1133,0x2111, + 0x3333,0x3333,0x3333,0x3333,0x3213,0x2133,0x3213,0x2133, //bf + 0x2123,0x3213,0x3233,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x1133,0x2111,0x2133,0x2122,0x2133,0x2133, //c0 + 0x1213,0x2111,0x2323,0x2122,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x3333,0x3333,0x3213,0x1113,0x3321,0x2223,0x3321, //c1 + 0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1213,0x2132,0x1213,0x2132, //c2 + 0x2323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x1111,0x2111, //c3 + 0x2222,0x3221,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333, + 0x3333,0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x3333, //c4 + 0x1133,0x3332,0x2133,0x3211,0x2133,0x3322,0x2133,0x3333, + 0x3333,0x3333,0x3333,0x3321,0x1111,0x2111,0x2222,0x3221, //c5 + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2233,0x3322, //c6 + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1113,0x2111, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x3212, //c7 + 0x3133,0x3321,0x1233,0x3332,0x2133,0x3321,0x3211,0x3213, + 0x3333,0x3333,0x1333,0x3332,0x1111,0x2111,0x2222,0x3212, //c8 + 0x3333,0x3321,0x1133,0x3212,0x1211,0x2132,0x1322,0x3232, + 0x3333,0x3333,0x3333,0x3213,0x3333,0x3213,0x3333,0x3213, //c9 + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3332,0x2113,0x3333, + 0x3333,0x3333,0x1333,0x3332,0x3333,0x3321,0x3213,0x3213, //ca + 0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133, + 0x3333,0x3333,0x3213,0x2133,0x3213,0x3211,0x1113,0x3322, //cb + 0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1133,0x2111, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x2122, //cc + 0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x2133,0x3333,0x1213,0x3332, //cd + 0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233, + 0x3333,0x3333,0x1333,0x3332,0x1111,0x2111,0x1222,0x3222, //ce + 0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2222,0x2122, //cf + 0x3213,0x3213,0x2133,0x3321,0x1333,0x3332,0x3333,0x3321, + 0x3333,0x3333,0x3113,0x3333,0x1223,0x3311,0x2333,0x2122, //d0 + 0x1133,0x3231,0x2233,0x3212,0x1113,0x3322,0x2223,0x2111, + 0x3333,0x3333,0x1333,0x3332,0x2133,0x3333,0x3213,0x3333, //d1 + 0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x1111,0x2111, + 0x3333,0x3333,0x3333,0x3213,0x3213,0x3213,0x2133,0x3321, //d2 + 0x1333,0x3332,0x1333,0x3332,0x2133,0x3321,0x3211,0x3213, + 0x3333,0x3333,0x3333,0x3333,0x1111,0x2111,0x2122,0x3222, //d3 + 0x1111,0x2111,0x2122,0x3222,0x2133,0x3333,0x1133,0x2111, + 0x3333,0x3333,0x2133,0x3333,0x1133,0x2111,0x2111,0x2122, //d4 + 0x2122,0x3213,0x2133,0x3323,0x1333,0x3332,0x1333,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x3321,0x2223,0x3321, //d5 + 0x3333,0x3321,0x3333,0x3321,0x3333,0x3321,0x1111,0x2111, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2223,0x2122, //d6 + 0x1113,0x2111,0x2223,0x2122,0x3333,0x2133,0x1113,0x2111, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x3322,0x1111,0x2111, //d7 + 0x2222,0x2122,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x3333,0x3213,0x3213,0x3213,0x3213,0x3213,0x3213, //d8 + 0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x1333,0x3332,0x1213,0x3332,0x1213,0x3332, //d9 + 0x1213,0x2132,0x1213,0x2132,0x1213,0x3212,0x1321,0x3321, + 0x3333,0x3333,0x3213,0x3333,0x3213,0x3333,0x3213,0x3333, //da + 0x3213,0x3213,0x3213,0x3213,0x3213,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2213,0x2122, //db + 0x3213,0x2133,0x3213,0x2133,0x3213,0x2133,0x1113,0x2111, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2111,0x2213,0x2122, //dc + 0x3323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x1113,0x2132,0x2223,0x2133, //dd + 0x3333,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x1223,0x2122, //de + 0x1333,0x2132,0x2133,0x2133,0x2133,0x2133,0x3213,0x3213, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x2223,0x3221, //df + 0x3333,0x3321,0x1113,0x1111,0x2223,0x2212,0x3333,0x3213, + 0x3333,0x1213,0x3333,0x2323,0x1133,0x2111,0x2133,0x2122, //e0 + 0x3213,0x3213,0x3323,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x1313,0x3213,0x2323,0x1113,0x2111,0x2213,0x3212, //e1 + 0x3321,0x3213,0x3332,0x3321,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x1313,0x3333,0x2323,0x1113,0x2111,0x2223,0x2122, //e2 + 0x3333,0x2133,0x3333,0x2133,0x3333,0x2133,0x1113,0x2111, + 0x3333,0x1313,0x3333,0x2323,0x3213,0x3213,0x1111,0x2111, //e3 + 0x2212,0x3212,0x3213,0x3213,0x3323,0x3321,0x1133,0x3332, + 0x3333,0x1313,0x3333,0x2323,0x2113,0x2133,0x3223,0x2133, //e4 + 0x2113,0x2133,0x3223,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x1313,0x3333,0x2323,0x1113,0x2111,0x2223,0x3212, //e5 + 0x3333,0x3321,0x3333,0x3321,0x1333,0x3212,0x2113,0x2133, + 0x3333,0x1313,0x2133,0x2323,0x1133,0x2111,0x2111,0x2122, //e6 + 0x2122,0x3213,0x2133,0x3323,0x2133,0x3333,0x1133,0x2111, + 0x3333,0x1313,0x3333,0x2323,0x3213,0x2133,0x3213,0x2133, //e7 + 0x2123,0x3213,0x3233,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x1313,0x3333,0x2323,0x1133,0x2111,0x2133,0x2122, //e8 + 0x1213,0x2111,0x2323,0x2122,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x1313,0x3333,0x2323,0x1113,0x3211,0x2223,0x3321, //e9 + 0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x1313,0x3333,0x2323,0x1213,0x2132,0x1213,0x2132, //ea + 0x2323,0x2133,0x3333,0x2133,0x3333,0x3213,0x1113,0x3321, + 0x3333,0x1313,0x3333,0x2323,0x1113,0x3211,0x2223,0x3322, //eb + 0x1111,0x2111,0x2222,0x3221,0x3333,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x2133,0x1313,0x2133,0x2323,0x2133,0x3333, //ec + 0x1133,0x3333,0x2133,0x3211,0x2133,0x3322,0x2133,0x3333, + 0x3333,0x1313,0x1333,0x2323,0x3333,0x3331,0x3213,0x3213, //ed + 0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133, + 0x3333,0x1313,0x3213,0x2323,0x3213,0x2111,0x1113,0x3222, //ee + 0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1123,0x2111, + 0x3333,0x1313,0x3333,0x2323,0x1111,0x2111,0x2222,0x2122, //ef + 0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x3333,0x1313,0x2133,0x2323,0x1213,0x3332, //f0 + 0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233, + 0x3333,0x1313,0x1333,0x2323,0x1111,0x2111,0x1222,0x3222, //f1 + 0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x2111,0x2213,0x2122, //f2 + 0x3323,0x2133,0x3333,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3133,0x1333,0x1212,0x3333,0x2121,0x3213,0x3213, //f3 + 0x3213,0x3213,0x3321,0x2133,0x3321,0x2133,0x3321,0x2133, + 0x3333,0x3133,0x3213,0x1213,0x3213,0x2111,0x1113,0x3222, //f4 + 0x2213,0x3333,0x3213,0x3333,0x3213,0x3333,0x1133,0x2111, + 0x3333,0x3133,0x3333,0x1213,0x1111,0x2111,0x2222,0x2122, //f5 + 0x3333,0x3213,0x3333,0x3213,0x3333,0x3321,0x1113,0x3332, + 0x3333,0x3133,0x3333,0x1213,0x2133,0x2123,0x1213,0x3232, //f6 + 0x3321,0x3321,0x3332,0x3213,0x3333,0x2133,0x3333,0x3233, + 0x3333,0x3133,0x1333,0x1212,0x1111,0x2111,0x1222,0x3222, //f7 + 0x1213,0x3212,0x1213,0x2132,0x1321,0x2132,0x1321,0x2132, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //f8 + 0x1113,0x2113,0x1223,0x3221,0x2133,0x3332,0x1133,0x2111, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3321,0x2123,0x2132, //f9 + 0x1113,0x3211,0x2121,0x2121,0x1321,0x2132,0x2113,0x3213, + 0x3333,0x3333,0x3213,0x3333,0x3213,0x3213,0x3213,0x2133, //fa + 0x3213,0x2133,0x3213,0x2133,0x1213,0x3232,0x2133,0x3333, + 0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x1333,0x3211, //fb + 0x2113,0x2122,0x3223,0x2133,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x1113,0x3211, //fc + 0x2223,0x3321,0x1333,0x3332,0x2133,0x3321,0x3213,0x2113, + 0x3333,0x3333,0x2133,0x2133,0x1133,0x2121,0x2113,0x3232, //fd + 0x1123,0x3211,0x2113,0x2122,0x2121,0x2133,0x2113,0x3213, + 0x3333,0x3333,0x3333,0x3321,0x2133,0x3213,0x1111,0x2132, //fe + 0x2122,0x2121,0x3213,0x3321,0x3321,0x3321,0x1132,0x3332, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2223,0x3321, //ff + 0x1133,0x2111,0x2233,0x3212,0x3313,0x3323,0x1133,0x3211, + 0x3333,0x3333,0x3333,0x3213,0x3333,0x3321,0x1333,0x3332, //100 + 0x2133,0x3333,0x1333,0x3332,0x3333,0x3321,0x3333,0x3213, + 0x3333,0x3333,0x3333,0x3213,0x1213,0x2111,0x2213,0x3212, //101 + 0x3213,0x3213,0x3213,0x3213,0x2133,0x3213,0x3233,0x3321, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2233,0x2122, //102 + 0x3333,0x3213,0x3333,0x3323,0x3213,0x3333,0x1133,0x2111, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2223,0x3321, //103 + 0x3333,0x3212,0x3333,0x3213,0x3213,0x3333,0x1123,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3213,0x3333,0x3213,0x3333, //104 + 0x3213,0x3333,0x3213,0x3333,0x3213,0x3213,0x1123,0x3321, + 0x3333,0x3333,0x3333,0x3321,0x1113,0x2111,0x2223,0x3221, //105 + 0x1133,0x3321,0x2133,0x3321,0x1333,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x3333,0x3333,0x3213,0x3321,0x1113,0x2111, //106 + 0x3211,0x3321,0x3212,0x3321,0x3213,0x2133,0x1133,0x3211, + 0x3333,0x3333,0x2133,0x2133,0x2133,0x2133,0x3233,0x3213, //107 + 0x1113,0x2111,0x1223,0x3222,0x2133,0x3333,0x1333,0x2111, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //108 + 0x3213,0x2111,0x3213,0x3222,0x1213,0x3332,0x3321,0x2111, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3211,0x2123,0x3322, //109 + 0x1213,0x3311,0x2113,0x2122,0x3223,0x2133,0x1333,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2211,0x2122, //10a + 0x3322,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x3333,0x3333,0x2113,0x1133,0x3211,0x2211,0x3321, //10b + 0x1322,0x3332,0x1333,0x3332,0x3333,0x3321,0x3333,0x2113, + 0x3333,0x3333,0x3213,0x3333,0x3213,0x2133,0x2133,0x3211, //10c + 0x1133,0x3322,0x2213,0x3333,0x3213,0x3333,0x1133,0x2111, + 0x3333,0x3333,0x2133,0x3333,0x1111,0x2112,0x2212,0x3223, //10d + 0x3213,0x3213,0x1321,0x3211,0x2132,0x2112,0x1333,0x3221, + 0x3333,0x3333,0x3333,0x3333,0x1213,0x2111,0x2213,0x3222, //10e + 0x3213,0x3333,0x3213,0x3333,0x3213,0x3321,0x2133,0x2113, + 0x3333,0x3333,0x3333,0x3321,0x3213,0x3321,0x1213,0x3211, //10f + 0x2113,0x2121,0x1121,0x2112,0x2121,0x2121,0x3213,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3213,0x3211,0x1211,0x2122, //110 + 0x2112,0x2133,0x3213,0x2111,0x3211,0x2121,0x3212,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x1133,0x3211,0x2113,0x2122, //111 + 0x2121,0x2133,0x2121,0x2133,0x2121,0x2133,0x3213,0x3213, + 0x3333,0x3333,0x3333,0x3213,0x1121,0x2111,0x2221,0x3212, //112 + 0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221, + 0x3333,0x3333,0x2133,0x3333,0x2111,0x3213,0x3212,0x2113, //113 + 0x3321,0x3213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332, + 0x3333,0x3333,0x1133,0x3333,0x2233,0x3321,0x3333,0x3332, //114 + 0x1213,0x3332,0x3321,0x2121,0x3321,0x2121,0x1132,0x3232, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x1133,0x3332, //115 + 0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x2233, + 0x3333,0x3333,0x1321,0x2111,0x2321,0x3212,0x1321,0x2111, //116 + 0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x3321,0x1113,0x3211, //117 + 0x2223,0x3321,0x1113,0x3321,0x2221,0x3211,0x1113,0x3322, + 0x3333,0x3333,0x1113,0x3321,0x1223,0x3332,0x2133,0x3213, //118 + 0x1113,0x3211,0x2121,0x2112,0x3211,0x3213,0x3322,0x3321, + 0x3333,0x3333,0x2133,0x3333,0x1111,0x3212,0x2122,0x2133, //119 + 0x2113,0x3333,0x2121,0x2133,0x3213,0x2133,0x1133,0x3211, + 0x3333,0x3333,0x3333,0x3321,0x1213,0x3211,0x2113,0x2121, //11a + 0x1211,0x2132,0x1121,0x2132,0x2121,0x2133,0x3213,0x3213, + 0x3333,0x3333,0x1333,0x3332,0x1113,0x3321,0x2123,0x3332, //11b + 0x1113,0x3321,0x2123,0x2132,0x2133,0x2133,0x1333,0x3211, + 0x3333,0x3333,0x3333,0x3321,0x1213,0x3211,0x2113,0x2121, //11c + 0x3211,0x2132,0x2122,0x3213,0x2133,0x3323,0x1333,0x3332, + 0x3333,0x3333,0x1333,0x3332,0x1321,0x3211,0x1121,0x2122, //11d + 0x1211,0x2132,0x1321,0x2132,0x1332,0x3212,0x2133,0x3323, + 0x3333,0x3333,0x1333,0x3332,0x1333,0x3211,0x1333,0x3322, //11e + 0x1333,0x3332,0x1113,0x3321,0x1221,0x3212,0x2113,0x3323, + 0x3333,0x3333,0x1133,0x3321,0x2233,0x3332,0x2133,0x3211, //11f + 0x1213,0x2122,0x2113,0x2133,0x3223,0x2133,0x1333,0x3211, + 0x3333,0x3333,0x2133,0x3333,0x3213,0x3213,0x3213,0x3213, //120 + 0x2113,0x3213,0x3223,0x3213,0x3333,0x3321,0x1133,0x3332, + 0x3333,0x3333,0x1113,0x3211,0x2223,0x3321,0x1333,0x3211, //121 + 0x2113,0x2122,0x1221,0x2121,0x2132,0x2121,0x1333,0x3211, + 0x3333,0x3333,0x3333,0x3211,0x1213,0x3212,0x1211,0x3212, //122 + 0x2112,0x3213,0x3213,0x3213,0x3211,0x3213,0x3212,0x2133, + 0x3333,0x3333,0x1333,0x3211,0x2113,0x3321,0x1223,0x3332, //123 + 0x1133,0x3211,0x2211,0x2122,0x3322,0x2133,0x1333,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x3213,0x3311,0x1211,0x2122, //124 + 0x2112,0x2133,0x3213,0x2133,0x3211,0x2133,0x3212,0x3211, + 0x3333,0x3333,0x3333,0x3333,0x1333,0x3332,0x1333,0x3332, //125 + 0x2133,0x3333,0x1133,0x3332,0x1213,0x2132,0x3321,0x3211, + 0x3333,0x1313,0x3333,0x2323,0x2133,0x3213,0x1111,0x2132, //126 + 0x2122,0x2121,0x3213,0x3221,0x3321,0x3321,0x1132,0x3332, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2223,0x3321, //127 + 0x1133,0x2111,0x2233,0x3212,0x3313,0x3323,0x1123,0x3211, + 0x3333,0x1313,0x3333,0x2323,0x3333,0x3321,0x1333,0x3332, //128 + 0x2133,0x3333,0x1233,0x3333,0x2333,0x3331,0x3333,0x3312, + 0x3333,0x1313,0x3333,0x2323,0x1213,0x2111,0x3213,0x3213, //129 + 0x3213,0x3213,0x3213,0x3213,0x2123,0x3213,0x3233,0x3321, + 0x3333,0x1313,0x3333,0x2323,0x1133,0x3211,0x2233,0x2122, //12a + 0x3333,0x3213,0x3333,0x3323,0x3213,0x3333,0x1123,0x3111, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2223,0x3321, //12b + 0x3333,0x3212,0x3333,0x3213,0x3213,0x3323,0x1123,0x3211, + 0x3333,0x3333,0x3333,0x3131,0x3213,0x3232,0x3213,0x3333, //12c + 0x3213,0x3333,0x3213,0x3333,0x3213,0x3213,0x1133,0x3321, + 0x3333,0x1313,0x3333,0x2321,0x1113,0x2111,0x2223,0x3321, //12d + 0x1133,0x3321,0x2133,0x3321,0x1333,0x3321,0x1113,0x3332, + 0x3333,0x1313,0x3333,0x2323,0x3213,0x3321,0x1113,0x2111, //12e + 0x2211,0x3221,0x3212,0x3321,0x3213,0x2132,0x1133,0x3211, + 0x3333,0x1313,0x2133,0x2323,0x2133,0x2133,0x3233,0x3213, //12f + 0x1113,0x3111,0x1223,0x3222,0x2133,0x3333,0x1233,0x2111, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2123,0x3322, //130 + 0x3213,0x2111,0x3213,0x3222,0x1213,0x3332,0x2321,0x2111, + 0x3333,0x1313,0x1333,0x2322,0x1113,0x3211,0x2123,0x3322, //131 + 0x1213,0x3211,0x2113,0x2122,0x3223,0x2133,0x1333,0x3211, + 0x3333,0x1313,0x3333,0x2323,0x1133,0x3211,0x2211,0x2122, //132 + 0x3322,0x2133,0x3333,0x2133,0x3333,0x3213,0x1133,0x3321, + 0x3333,0x1313,0x3333,0x2323,0x1133,0x2111,0x2211,0x3221, //133 + 0x1322,0x3332,0x1333,0x3332,0x3333,0x3321,0x3333,0x2113, + 0x3333,0x1313,0x3213,0x2323,0x3213,0x2133,0x2133,0x3211, //134 + 0x1133,0x3322,0x2213,0x3333,0x3213,0x3333,0x1133,0x2111, + 0x3333,0x1313,0x3333,0x2323,0x1121,0x2111,0x2221,0x3212, //135 + 0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221, + 0x3333,0x1313,0x2133,0x2323,0x2111,0x3213,0x3212,0x2113, //136 + 0x3321,0x3213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332, + 0x3333,0x1313,0x1133,0x2323,0x2233,0x3321,0x3333,0x3332, //137 + 0x1213,0x3332,0x2321,0x2121,0x3321,0x2121,0x1132,0x3232, + 0x3333,0x3333,0x3333,0x3131,0x3333,0x3232,0x1133,0x3332, //138 + 0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x3233, + 0x3333,0x1313,0x1321,0x2321,0x2321,0x3212,0x1321,0x2111, //139 + 0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221, + 0x3333,0x3133,0x3333,0x1213,0x1121,0x2111,0x2221,0x3212, //13a + 0x3321,0x3213,0x1321,0x3211,0x2121,0x2112,0x1332,0x3221, + 0x3333,0x3133,0x2133,0x1213,0x2111,0x2123,0x3213,0x1113, //13b + 0x3321,0x2213,0x3321,0x3213,0x3321,0x3321,0x1113,0x3332, + 0x3333,0x3133,0x1133,0x1213,0x2233,0x2121,0x3333,0x3232, //13c + 0x1213,0x3332,0x3321,0x2121,0x3321,0x2121,0x1132,0x3232, + 0x3333,0x3313,0x3333,0x2121,0x3333,0x3212,0x1133,0x3322, //13d + 0x2213,0x3321,0x3321,0x3213,0x3332,0x2133,0x3333,0x3233, + 0x3333,0x3133,0x1321,0x1211,0x2321,0x2112,0x1321,0x2111, //13e + 0x2321,0x3212,0x1321,0x3211,0x2121,0x2112,0x1213,0x3221, + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, //13f + 0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333,0x3333, +}; diff --git a/build/tests/DispOwnerInfo/src/myFunc.c b/build/tests/DispOwnerInfo/src/myFunc.c new file mode 100644 index 00000000..eaa7679d --- /dev/null +++ b/build/tests/DispOwnerInfo/src/myFunc.c @@ -0,0 +1,361 @@ +/********************************************************************/ +/* myFunc.c */ +/* NITRO-IPL */ +/* */ +/* Copyright (C) 2003-2004 NINTENDO Co.,Ltd. */ +/********************************************************************/ +/* + 標準サブルーチン群 + + + $Log: myFunc.c,v $ + Revision 1.1.4.1 2006/02/01 06:29:37 yosiokat + mf_strcpyの仕様変更。 + + Revision 1.1 2005/02/08 04:41:25 yosiokat + 新規追加。 + + Revision 1.2 2004/05/19 08:25:28 yosiokat + 更新ログの追加。 + + +*/ + +#include "myFunc.h" + +// define data---------------------------------- +#define CHAR_INDEX 0x200 // キャラベース0x4000 + + +// function's prototype------------------------- +void mf_copyBuffer(u8 *srcp,u8 *dstp,u16 length); + +// extern data---------------------------------- +//extern u16 bgBakS[32*24]; // BG バックアップ +//extern u32 oamBakS[128*2]; // OAM バックアップ + + +// const data----------------------------------- +const u16 csr_charList1[] ={0x008c, 0x008c, 0x008c, 0x008c}; +const u8 str_time_period[]={" . ."}; + + +// global variable------------------------------ +MyTime myTime; +//KeyWork pad; + +// static variable------------------------------ +static u16 csr_animeCount, csr_animeCharNum; +static u16 key_rapid[4]; +static u16 blinkCount; +static u16 csr_pos_x, csr_pos_y, csr_add_y; + + +// ============================================================================ +// function's description +// ============================================================================ + +// BgBakオフセット値算出 +__inline static u16 *calcBgOffset(u16 pos_x,u16 pos_y) +{ + return bgBakS+pos_x+(pos_y<<5); +} + + +// メインメモリからでも大丈夫な形式での1byteのデータ読み出し。 +__inline static u16 ReadByteHWBus(const void *srcp) +{ + if((int)srcp & 0x00000001) return (u16)(*(u16 *)((int)srcp ^ 0x00000001) >> 8); + else return (u16)(*(u16 *)(srcp) & 0x00ff); +} + + +// 初期化 +void mf_init(void) +{ + mf_KEYPAD_initRapid(); + mf_CSR_init(0,0,0); + mf_BLINK_initCounter(); +} +/* +// キー入力読み出し +void mf_KEYPAD_read(void) +{ + u16 ReadData= PAD_Read(); + pad.trg = (u16)(ReadData & (ReadData ^ pad.cont)); // トリガ 入力 + pad.cont= ReadData; // ベタ 入力 +} +*/ + +// キー連射入力処理 初期化(十字キーのみ) +void mf_KEYPAD_initRapid(void) +{ + u16 *krp=key_rapid; + + *krp++=0; + *krp++=0; + *krp++=0; + *krp++=0; +} + + +// キー連射入力(十字キーのみ) +void mf_KEYPAD_rapid(void) +{ + u16 mask,i; + + for(i=0;i<4;i++){ + mask=(u16)(0x0001<<(i+4)); + if(pad.cont & mask){ + key_rapid[i]++; + if(key_rapid[i]==30) { + pad.trg|=mask; + key_rapid[i]=20; + } + }else{ + key_rapid[i]=0; + } + } +} + + +// 10進データ表示 +void mf_drawDecimal(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength,u8 size) +{ + u16 count,charCode; + u16 *dstp; + u32 mask,divisor,target; + + mask=0xff; + while(--size>0) mask=(mask<<8)|0xff; + target=(*(u32 *)valuep)&mask; + count=10; + divisor=1000000000; + dstp=calcBgOffset(pos_x,pos_y); + while(count) { + CP_SetDiv32_32(target, divisor); + if (count<=drawLength) { + charCode=(u16)(CP_GetDivResult32()+0x0030); + *dstp++ =(u16)( charCode | color | CHAR_INDEX ); + } + target=(u32)CP_GetDivRemainder32(); + CP_SetDiv32_32(divisor, 10); + divisor=(u32)CP_GetDivResult32(); + count--; + } +} + + +// 16進データ表示 +void mf_drawHex(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength) +{ + u16 count,charCode; + u16 *dstp=calcBgOffset(pos_x,pos_y)+drawLength-1; + + for(count=0;count>4) & 0x000f); + ((u8 *)valuep)++; + }else{ + charCode=(u16)( charCode & 0x000f); + } + if (charCode<0x000a) charCode+=0x0030; + else charCode+=0x0041-0x000a; + *dstp--=(u16)( charCode | color | CHAR_INDEX ); + } +} + + +// 1byte文字列データ表示(0x00〜0xffまでの1文字が1byteで良い文字列を描画する +void mf_drawString(u16 pos_x,u16 pos_y, u16 color, const u8 *strp) +{ + u16 data16; + u16 *dstp=calcBgOffset(pos_x,pos_y); + + while(1) { + data16=ReadByteHWBus(strp++); + if(data16==0) break; + *dstp++=(u16)( color | data16 | CHAR_INDEX ); + } +} + + +// 2byte文字列データ表示(0x0100以降の1文字に2byte必要な文字列を描画する +void mf_drawString2(u16 pos_x,u16 pos_y, u16 color, const u16 *strp) +{ + u16 *dstp=calcBgOffset(pos_x,pos_y); + + while(*strp) *dstp++ = (u16)( *strp++ | color | CHAR_INDEX ); +} + + +// 矩形BGクリア +void mf_clearRect(u16 pos_x,u16 pos_y,u8 height,u8 width) +{ + u16 i,j; + u16 *dstp=calcBgOffset(pos_x,pos_y); + + for(i=0;i +#include "data.h" + +// define data --------------------------------- + +// 時間計測構造体 +typedef struct { + int enable; + int frame; + int second; + int minute; + int hour; +}MyTime; + +// キーデータ・ワークエリア構造体 +//typedef struct { +// u16 trg; // トリガ入力 +// u16 cont; // ベタ 入力 +//}KeyWork; + + +// global variable------------------------------ +extern MyTime myTime; +//extern KeyWork pad; + + +// const data----------------------------------- +extern const u16 myChar[0x2800*8/16]; // キャラクターデータ + + +// function------------------------------------- +extern void mf_init(void); +extern void mf_KEYPAD_read(void); +extern void mf_KEYPAD_initRapid(void); +extern void mf_KEYPAD_rapid(void); +extern void mf_drawDecimal(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength,u8 size); +extern void mf_drawHex(u16 pos_x,u16 pos_y,u16 color,const void *valuep,u8 drawLength); +extern void mf_drawString(u16 pos_x,u16 pos_y,u16 color,const u8 *strp); +extern void mf_drawString2(u16 pos_x,u16 pos_y,u16 color,const u16 *strp); +extern void mf_clearRect(u16 pos_x,u16 pos_y,u8 height,u8 width); +extern void mf_CSR_init(u16 pos_x,u16 pos_y,u16 add_y); +extern void mf_CSR_moveAndAnime(int nowNum); +extern void mf_CSR_anime(const u16 *csr_charListp); +extern void mf_BLINK_initCounter(void); +extern void mf_BLINK_drawString(u16 pos_x,u16 pos_y,u16 color,const u8 *strp); +extern void mf_waitXframe(u16 frame); +extern void mf_TIME_init(void); +extern void mf_TIME_start(int init_flag); +extern void mf_TIME_stop(void); +extern void mf_TIME_count(void); +extern void mf_TIME_draw(u16 pos_x,u16 pos_y,u16 color); +extern u8* mf_strcpy(const u8 *str1p,u8 *str2p); +extern u8 mf_strcmp(const u8 *str1p,const u8 *str2p); + + +#ifdef __cplusplus + +#endif + +#endif // __MY_FUNC_H__ +