mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
treenand2sdの追加。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2396 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
d314333589
commit
5da514b20d
71
build/debugsoft/treenand2sd/Makefile
Normal file
71
build/debugsoft/treenand2sd/Makefile
Normal file
@ -0,0 +1,71 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - tools - treenand
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Date:: $
|
||||
# $Rev$
|
||||
# $Author$
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIR_FLAGS = TWL_ARCHGEN=$(TWL_ARCHGEN)
|
||||
SUBDIRS = $(SDLOG_DIR)
|
||||
|
||||
TARGET_PLATFORM := TWL
|
||||
|
||||
TWL_PROC := ARM9
|
||||
TWL_ARCHGEN := LIMITED
|
||||
TARGET_BIN = treenand2sd.srl
|
||||
|
||||
SRCS = main.cpp text.c MyStrings.c fontdata.c
|
||||
|
||||
SDLOG_DIR = $(ROOT)/build/tests/sdlog/sdlog
|
||||
LINCLUDES += $(SDLOG_DIR)/include
|
||||
LLIBRARY_DIRS = $(SDLOG_DIR)/lib/$(TWL_BUILDTYPE)
|
||||
LLIBRARIES += libsdlog$(NITRO_LIBSUFFIX).a\
|
||||
|
||||
ROM_SPEC = demo.autogen.rsf
|
||||
ROM_SPEC_TEMPLATE = $(ROOT)/include/twl/specfiles/ROM-TS_sys.rsf
|
||||
ROM_SPEC_PARAM = MakerCode=01 \
|
||||
GameCode=4NTA \
|
||||
NANDAccess=TRUE \
|
||||
SDCardAccess=TRUE \
|
||||
Secure=TRUE \
|
||||
CardRegion=ALL \
|
||||
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
#----------------------------------
|
||||
# セキュアアプリ指定
|
||||
|
||||
MAKEROM := $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#追加するCCオプション
|
||||
#----------------------------------------------------------------------------
|
||||
CCFLAGS += -w nounwanted
|
||||
|
||||
ifeq ($(TWL_BUILD_TYPE),RELEASE)
|
||||
INSTALL_DIR = $(ROOT)/bin/ARM9-TS/Release
|
||||
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN)
|
||||
endif
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
#===== End of Makefile =====
|
||||
84
build/debugsoft/treenand2sd/include/MyStrings.h
Normal file
84
build/debugsoft/treenand2sd/include/MyStrings.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*************************************************************************
|
||||
|
||||
簡単な文字列表示する関数群
|
||||
|
||||
************************************************************************/
|
||||
#include <stdio.h>
|
||||
|
||||
#include "basicdef.h"
|
||||
#include "text.h"
|
||||
|
||||
/************************************************************************
|
||||
二重定義や宣言/参照を同じヘッダで使用するためのプリプロセッサ
|
||||
************************************************************************/
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#ifndef MYSTRINGS_H_INCLUDED
|
||||
#define MYSTRINGS_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆使用する構造体
|
||||
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/* 画面出力するために使用するコンソール */
|
||||
typedef struct {
|
||||
COORDINATE_TYPE Cursor; /* 現在のカーソル位置 */
|
||||
int Palette; /* 現在使用するパレット */
|
||||
|
||||
int ScrollStart; /* スクロール開始・終了位置 */
|
||||
int ScrollEnd;
|
||||
|
||||
TEXT_VRAM_TYPE *Text; /* 書き込み先 */
|
||||
|
||||
} CONSOLE_TYPE;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆参照宣言
|
||||
************************************************************************/
|
||||
|
||||
extern CONSOLE_TYPE StdConsole;
|
||||
extern CONSOLE_TYPE *Console;
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
☆パブリックと同等に使用するマクロ
|
||||
************************************************************************/
|
||||
#define wPuts( str__ ) wcPuts( &StdConsole, str__ )
|
||||
#define _Puts( str__ ) _cPuts( &StdConsole, str__ )
|
||||
#define wPutchar( character__ ) wcPutchar( &StdConsole, character__ )
|
||||
#define wPutcharNC( character__ ) wcPutcharNC( &StdConsole, character__ )
|
||||
#define wGotoxy( x__, y__ ) wcGotoxy( &StdConsole, x__, y__ )
|
||||
#define wSetPalette( Palette__ ) wcSetPalette( &StdConsole, Palette__ );
|
||||
|
||||
|
||||
/************************************************************************
|
||||
☆パブリック関数の宣言
|
||||
************************************************************************/
|
||||
extern int wcPuts ( CONSOLE_TYPE *Console, const char *str );
|
||||
extern void _cPuts ( CONSOLE_TYPE *Console, const char *str );
|
||||
extern void wcGotoxy ( CONSOLE_TYPE *Console, int x, int y );
|
||||
extern void wcSetPalette( CONSOLE_TYPE *Console, int Palette );
|
||||
extern int wcPutchar ( CONSOLE_TYPE *Console, int Character );
|
||||
extern int wcPutcharNC ( CONSOLE_TYPE *Console, int Character );
|
||||
extern void wcPrintf ( CONSOLE_TYPE *Console, const char *fmt , ... );
|
||||
extern void wPrintf ( const char *fmt , ... );
|
||||
extern void swPrintf ( const char *fmt , ... );
|
||||
extern int wCountLine ( const char *Str );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#endif
|
||||
|
||||
123
build/debugsoft/treenand2sd/include/basicdef.h
Normal file
123
build/debugsoft/treenand2sd/include/basicdef.h
Normal file
@ -0,0 +1,123 @@
|
||||
/**************************************************************************
|
||||
|
||||
基本定義ヘッダファイル
|
||||
|
||||
多くのソースファイルで使用する基本的な情報を記述しています。
|
||||
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#ifndef __BASICDEF_H__
|
||||
#define __BASICDEF_H__
|
||||
|
||||
/**************************************************************************
|
||||
標準でインクルードするヘッダファイル
|
||||
*************************************************************************/
|
||||
#include <nitro.h>
|
||||
#include <stdio.h> // NULLを使用するため
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
#define系プリプロセッサ命令 記述領域
|
||||
*************************************************************************/
|
||||
|
||||
//V周期
|
||||
#define VERTICAL_CYCLE 16743 //単位μS
|
||||
|
||||
|
||||
//画面関係の定義
|
||||
#define SCREEN_WIDTH 32 /* コンソールで使用するテキストRAMの列数 */
|
||||
#define SCREEN_HEIGHT 24 /* コンソールで使用するテキストRAMの行数 */
|
||||
|
||||
#define VIRTUAL_SCREEN_WIDTH 32 /* 仮想画面のサイズ */
|
||||
#define VIRTUAL_SCREEN_HEIGHT 32
|
||||
|
||||
#define CHARACTER_SIDE_LENGTH 8 /* キャラクタの一辺の長さ */
|
||||
|
||||
#define SCREEN_WIDTH_DOT 256
|
||||
#define SCREEN_HEIGHT_DOT 192
|
||||
|
||||
/**************************************************************************
|
||||
汎用マクロ定義
|
||||
*************************************************************************/
|
||||
|
||||
//配列の要素数を求める 'Code Complete 上 第二版 P379 から引用
|
||||
#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
/**************************************************************************
|
||||
型定義
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
#if 0
|
||||
/* ブール型の設定 */
|
||||
#undef FALSE
|
||||
#undef TRUE
|
||||
typedef enum { FALSE=0, TRUE=1 } BOOL;
|
||||
#endif
|
||||
|
||||
/* 整数型座標構造体 */
|
||||
typedef struct { /* 座標を指定する構造体 */
|
||||
int x; /* X座標 */
|
||||
int y; /* Y座標 */
|
||||
} COORDINATE_TYPE;
|
||||
|
||||
/* 各色の成分 */
|
||||
typedef enum {
|
||||
RAW_COLOR_BLACK = 0x0000,
|
||||
RAW_COLOR_RED = 0x001f,
|
||||
RAW_COLOR_GREEN = 0x03e0,
|
||||
RAW_COLOR_YELLOW = 0x03ff,
|
||||
RAW_COLOR_BLUE = 0x7c00,
|
||||
RAW_COLOR_MAGENTA = 0x7c1f,
|
||||
RAW_COLOR_CYAN = 0x7fe0,
|
||||
RAW_COLOR_WHITE = 0x7fff,
|
||||
|
||||
RAW_COLOR_GRAY1 = 0x1004,
|
||||
RAW_COLOR_GRAY2 = 0x2108,
|
||||
RAW_COLOR_GRAY3 = 0x318c,
|
||||
RAW_COLOR_GRAY4 = 0x4210,
|
||||
RAW_COLOR_GRAY5 = 0x5294,
|
||||
RAW_COLOR_GRAY6 = 0x6318
|
||||
|
||||
} RAW_COLOR;
|
||||
|
||||
/* パレット設定 */
|
||||
typedef enum {
|
||||
COLOR_TRANSLUCENT = 0,
|
||||
COLOR_RED = 1,
|
||||
COLOR_GREEN = 2,
|
||||
COLOR_YELLOW = 3,
|
||||
COLOR_BLUE = 4,
|
||||
COLOR_MAGENTA = 5,
|
||||
COLOR_CYAN = 6,
|
||||
COLOR_WHITE = 7,
|
||||
COLOR_BLACK = 8,
|
||||
COLOR_GRAY1 = 9,
|
||||
COLOR_GRAY2 =10,
|
||||
COLOR_GRAY3 =11,
|
||||
COLOR_GRAY4 =12,
|
||||
COLOR_GRAY5 =13,
|
||||
COLOR_GRAY6 =14
|
||||
|
||||
|
||||
} COLOR_TYPE;
|
||||
|
||||
#define COLOR_GRAY COLOR_GRAY5
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
27
build/debugsoft/treenand2sd/include/fontdata.h
Normal file
27
build/debugsoft/treenand2sd/include/fontdata.h
Normal file
@ -0,0 +1,27 @@
|
||||
/********************************************************************
|
||||
|
||||
標準データの定義
|
||||
|
||||
|
||||
********************************************************************/
|
||||
#ifndef _DATA_H
|
||||
#define _DATA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "basicdef.h"
|
||||
/************************************************************************
|
||||
|
||||
☆外部公開変数
|
||||
|
||||
***********************************************************************/
|
||||
extern const u16 PlttData_Sample[16][16];
|
||||
extern const u32 CharData_Sample[8*0x100];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _DATA_H */
|
||||
70
build/debugsoft/treenand2sd/include/text.h
Normal file
70
build/debugsoft/treenand2sd/include/text.h
Normal file
@ -0,0 +1,70 @@
|
||||
/************************************************************************
|
||||
|
||||
テキストVRAMエミュレーション
|
||||
|
||||
************************************************************************/
|
||||
#include "basicdef.h"
|
||||
|
||||
/************************************************************************
|
||||
二重定義や宣言/参照を同じヘッダで使用するためのプリプロセッサ
|
||||
************************************************************************/
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#ifndef TEXT_H_INCLUDED
|
||||
#define TEXT_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
☆パブリック関数の宣言
|
||||
************************************************************************/
|
||||
extern void wInitTextVram( void );
|
||||
extern void wSuspendTextVram( void );
|
||||
extern void wResumeTextVram( void );
|
||||
|
||||
extern void swSuspendTextVram( void );
|
||||
extern void swResumeTextVram( void );
|
||||
|
||||
extern void wRemoveTextVram( void );
|
||||
|
||||
/************************************************************************
|
||||
☆テキストVRAMで使用する定数値
|
||||
************************************************************************/
|
||||
|
||||
#define CLEAR_CHARACTER ' ' /* 画面クリア時に使用するキャラクタ */
|
||||
|
||||
/************************************************************************
|
||||
☆テキストVRAMで使用する構造体
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* テキストVRAM本体です。
|
||||
* Map :表示文字をアスキーコードで入力します
|
||||
*
|
||||
* 現在、他の属性はなし。
|
||||
*/
|
||||
|
||||
|
||||
typedef struct { /* テキストVRAM操作用*/
|
||||
u16 Map[VIRTUAL_SCREEN_HEIGHT][VIRTUAL_SCREEN_WIDTH];
|
||||
} TEXT_VRAM_TYPE;
|
||||
|
||||
/************************************************************************
|
||||
☆テキストVRAMの参照宣言
|
||||
************************************************************************/
|
||||
|
||||
/* テキストVRAM本体 */
|
||||
extern TEXT_VRAM_TYPE wText;
|
||||
extern TEXT_VRAM_TYPE swText;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* 多重インクルードの回避 */
|
||||
#endif
|
||||
313
build/debugsoft/treenand2sd/src/MyStrings.c
Normal file
313
build/debugsoft/treenand2sd/src/MyStrings.c
Normal file
@ -0,0 +1,313 @@
|
||||
/************************************************************************
|
||||
|
||||
タイトル:
|
||||
文字、文字列表示ルーチン集
|
||||
|
||||
************************************************************************/
|
||||
#include <string.h>
|
||||
#include "basicdef.h"
|
||||
#include "MyStrings.h"
|
||||
|
||||
/************************************************************************
|
||||
☆動作モード
|
||||
************************************************************************/
|
||||
#define USE_SDK_PRINTF //SDKのPrintf関係を使用するときに定義
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆実体宣言
|
||||
************************************************************************/
|
||||
|
||||
//標準のコンソール
|
||||
CONSOLE_TYPE StdConsole = { { 0, 0},
|
||||
COLOR_BLACK,
|
||||
0, SCREEN_HEIGHT-2,
|
||||
&wText
|
||||
};
|
||||
|
||||
CONSOLE_TYPE *Console = &StdConsole;
|
||||
|
||||
/************************************************************************
|
||||
☆プロトタイプ宣言
|
||||
************************************************************************/
|
||||
static void ScrollDown( CONSOLE_TYPE *Console );
|
||||
|
||||
/************************************************************************
|
||||
*************************************************************************
|
||||
*************************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
☆文字出力関係のユーティリティ
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*************************************************************************
|
||||
*************************************************************************
|
||||
*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
|
||||
一文字表示
|
||||
|
||||
概要:
|
||||
引数の文字コードをテキストVRAM上に表示させる
|
||||
( putchar とコンパチかな?)
|
||||
|
||||
引数:
|
||||
Console 表示コンソール
|
||||
Character 文字コード
|
||||
|
||||
戻り値:
|
||||
文字コード(putcharとなるべく仕様をあわせるため)
|
||||
|
||||
***********************************************************************/
|
||||
extern int wcPutchar( CONSOLE_TYPE *Console, int Character ){
|
||||
int i;
|
||||
u16 *Pointer;
|
||||
switch( Character ){
|
||||
|
||||
case '\n': /* 改行コードの処理 */
|
||||
Console->Cursor.y++;
|
||||
Console->Cursor.x = 0;
|
||||
break;
|
||||
|
||||
case '\t': /* タブコードの処理(4タブ) */
|
||||
Console->Cursor.x +=4 - ( (StdConsole.Cursor.x) % 4 );
|
||||
break;
|
||||
|
||||
case '\f': /* 改ページコードの処理 */
|
||||
Pointer = &(Console->Text->Map[0][0] );
|
||||
for( i=0 ; i<SCREEN_HEIGHT*SCREEN_WIDTH ; i++ ) *Pointer++=CLEAR_CHARACTER;
|
||||
wcGotoxy( Console, 0, 0 );
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
/* 文字の表示 */
|
||||
Console->Text->Map[ Console->Cursor.y ][ Console->Cursor.x++ ]
|
||||
= (u16)( (Console->Palette << 12 ) | Character );
|
||||
}
|
||||
|
||||
/* 行あふれの処理 */
|
||||
if( Console->Cursor.x > SCREEN_WIDTH-1 ){
|
||||
Console->Cursor.x = 0;
|
||||
Console->Cursor.y++;
|
||||
}
|
||||
|
||||
/* 列あふれの処理 */
|
||||
if( Console->Cursor.y > Console->ScrollEnd ){
|
||||
--Console->Cursor.y;
|
||||
ScrollDown( Console );
|
||||
|
||||
}
|
||||
return Character;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
一文字表示(制御コード処理なし)
|
||||
|
||||
概要:
|
||||
引数の文字コードをテキストVRAM上に表示させる
|
||||
wcPutcharの制御コード判定なしバージョン
|
||||
|
||||
引数:
|
||||
Console 表示コンソール
|
||||
Character 文字コード
|
||||
|
||||
戻り値:
|
||||
文字コード(putcharとなるべく仕様をあわせるため)
|
||||
|
||||
***********************************************************************/
|
||||
extern int wcPutcharNC( CONSOLE_TYPE *Console, int Character ){
|
||||
|
||||
/* 文字の表示 */
|
||||
Console->Text->Map[ Console->Cursor.y ][ Console->Cursor.x++ ]
|
||||
= (u16)( (Console->Palette << 12) | Character );
|
||||
/* 行あふれの処理 */
|
||||
if( Console->Cursor.x > SCREEN_WIDTH-1 ){
|
||||
Console->Cursor.x = 0;
|
||||
Console->Cursor.y++;
|
||||
}
|
||||
|
||||
/* 列あふれの処理 */
|
||||
if( Console->Cursor.y > Console->ScrollEnd ){
|
||||
--Console->Cursor.y;
|
||||
ScrollDown( Console );
|
||||
|
||||
}
|
||||
return Character;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
文字列表示(改行なし版)
|
||||
|
||||
概要:
|
||||
引数の文字列を表示させる(最後に改行コードが入らないので注意)
|
||||
|
||||
引数:
|
||||
Console 表示コンソール
|
||||
String 表示文字列
|
||||
|
||||
※ 0x80-0xffの文字コードに対応するため、(u8 *)へのキャストをしています。
|
||||
|
||||
***********************************************************************/
|
||||
extern void _cPuts( CONSOLE_TYPE *Console, const char *String ){
|
||||
int CurrentCharacter;
|
||||
while( CurrentCharacter = *(u8 *)String++ ) wcPutchar( Console, CurrentCharacter );
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
文字列表示
|
||||
|
||||
概要:
|
||||
引数の文字列を画面に表示させる(最後に改行コードが入ります)
|
||||
|
||||
引数:
|
||||
Console 表示コンソール
|
||||
String 表示文字列
|
||||
|
||||
戻り値:
|
||||
常に0 putsとのコンパチビリティを保つため
|
||||
|
||||
***********************************************************************/
|
||||
extern int wcPuts( CONSOLE_TYPE *Console, const char *String ){
|
||||
_cPuts( Console, String ); /* 文字列の表示 */
|
||||
_cPuts( Console, "\n" ); /* 改行 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
テキスト画面を下にスクロールさせる
|
||||
|
||||
引数:
|
||||
Console 該当コンソール
|
||||
|
||||
***********************************************************************/
|
||||
static void ScrollDown( CONSOLE_TYPE *Console ){
|
||||
int i;
|
||||
|
||||
for( i=Console->ScrollStart+1 ; i<=Console->ScrollEnd ; i++ ){
|
||||
/* 一列上にコピーする */
|
||||
memcpy( Console->Text->Map[i-1], Console->Text->Map[i], SCREEN_WIDTH* sizeof(u16) );
|
||||
}
|
||||
|
||||
/* 最終行のクリア */
|
||||
for( i=0 ; i<SCREEN_WIDTH ; i++ ){
|
||||
Console->Text->Map[ Console->ScrollEnd ][i] = CLEAR_CHARACTER;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
カーソル位置の設定
|
||||
|
||||
引数:
|
||||
Console 該当コンソール
|
||||
x X座標
|
||||
y Y座標
|
||||
|
||||
************************************************************************/
|
||||
extern void wcGotoxy( CONSOLE_TYPE *Console, int x, int y ){
|
||||
/* とりあえず座標のコピー */
|
||||
Console->Cursor.x = x;
|
||||
Console->Cursor.y = y;
|
||||
|
||||
/* 範囲制限をするこれをしないとオーバーランを起こす */
|
||||
if( Console->Cursor.x < 0 ) Console->Cursor.x = 0;
|
||||
if( Console->Cursor.x > SCREEN_WIDTH-1 ) Console->Cursor.x = SCREEN_WIDTH-1;
|
||||
if( Console->Cursor.y < 0 ) Console->Cursor.y = 0;
|
||||
if( Console->Cursor.y > SCREEN_HEIGHT-1 ) Console->Cursor.y = SCREEN_HEIGHT-1;
|
||||
|
||||
}
|
||||
/************************************************************************
|
||||
|
||||
パレットの設定
|
||||
|
||||
引数:
|
||||
Console 該当コンソール
|
||||
Palette 設定パレット
|
||||
|
||||
************************************************************************/
|
||||
extern void wcSetPalette( CONSOLE_TYPE *Console, int Palette ){
|
||||
|
||||
Console->Palette = Palette;
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆Printf
|
||||
|
||||
※NitroSDKのOS_Printfを参考にしています。
|
||||
|
||||
|
||||
Printfもどき
|
||||
|
||||
※標準のコンソールに表示されます。
|
||||
|
||||
引数:
|
||||
fmt: フォーマット付き文字列
|
||||
...: パラメータ
|
||||
|
||||
|
||||
************************************************************************/
|
||||
extern void wPrintf( const char *fmt , ... ){
|
||||
|
||||
char common_buffer[0x100];
|
||||
|
||||
va_list vlist;
|
||||
|
||||
//引数取得
|
||||
va_start( vlist, fmt );
|
||||
|
||||
//vprintf相当部分
|
||||
#ifdef USE_SDK_PRINTF
|
||||
OS_VSNPrintf( common_buffer, sizeof(common_buffer), fmt, vlist );
|
||||
#else
|
||||
vsnprintf( common_buffer, sizeof(common_buffer), fmt, vlist );
|
||||
#endif
|
||||
_Puts( common_buffer );
|
||||
|
||||
//引数後処理
|
||||
va_end( vlist );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
|
||||
文字列の行数のカウントする
|
||||
|
||||
引数:
|
||||
Str 文字列
|
||||
|
||||
戻り値:
|
||||
行数
|
||||
************************************************************************/
|
||||
extern int wCountLine( const char *Str ){
|
||||
|
||||
int Line;
|
||||
|
||||
if( *Str=='\0' ) return 0; //空文字列の判定
|
||||
|
||||
Line=1;
|
||||
while( *Str!='\0' ){
|
||||
if( *Str=='\n' ) Line++;
|
||||
Str++;
|
||||
}
|
||||
|
||||
return Line;
|
||||
}
|
||||
|
||||
|
||||
|
||||
594
build/debugsoft/treenand2sd/src/fontdata.c
Normal file
594
build/debugsoft/treenand2sd/src/fontdata.c
Normal file
@ -0,0 +1,594 @@
|
||||
/********************************************************************
|
||||
|
||||
タイトル:
|
||||
標準データの定義
|
||||
|
||||
|
||||
********************************************************************/
|
||||
#include "basicdef.h"
|
||||
#include "fontdata.h"
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆プライベート宣言
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆データ定義
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
|
||||
パレットデータ
|
||||
|
||||
概要:
|
||||
|
||||
0は背景用パレットデータ
|
||||
1~8はテキストVRAM用パレットデータ
|
||||
15はキャンパス用パレットデータ
|
||||
14はBG用パレットデータ
|
||||
|
||||
***********************************************************************/
|
||||
const u16 PlttData_Sample[16][16] = {
|
||||
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_BLACK }, // 背景用パレット
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_RED, }, // Palette 1
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_GREEN }, // Palette 2
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_YELLOW }, // Palette 3
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_BLUE }, // Palette 4
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_MAGENTA }, // Palette 5
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_CYAN }, // Palette 6
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_WHITE }, // Palette 7
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_BLACK }, // Palette 8
|
||||
|
||||
{ RAW_COLOR_WHITE}, // Palette 9
|
||||
{ RAW_COLOR_WHITE}, // Palette 10
|
||||
{ RAW_COLOR_WHITE}, // Palette 11
|
||||
{ RAW_COLOR_WHITE}, // Palette 12
|
||||
{ RAW_COLOR_WHITE}, // Palette 13
|
||||
{ RAW_COLOR_WHITE}, // Palette 14 壁紙用
|
||||
|
||||
{ RAW_COLOR_WHITE, RAW_COLOR_RED, // Palette 15
|
||||
RAW_COLOR_GREEN, RAW_COLOR_YELLOW,
|
||||
RAW_COLOR_BLUE, RAW_COLOR_MAGENTA,
|
||||
RAW_COLOR_CYAN, RAW_COLOR_WHITE,
|
||||
RAW_COLOR_BLACK, RAW_COLOR_GRAY1,
|
||||
RAW_COLOR_GRAY2, RAW_COLOR_GRAY3,
|
||||
RAW_COLOR_GRAY4, RAW_COLOR_GRAY5,
|
||||
RAW_COLOR_GRAY6, RAW_COLOR_WHITE,
|
||||
}, // キャンパス用パレット
|
||||
};
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
|
||||
キャラクタデータ
|
||||
|
||||
***********************************************************************/
|
||||
const u32 CharData_Sample[8*0x100] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0000
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x11111111,0x11111111,0x11111111,0x11111111, //0001
|
||||
0x11111111,0x11111111,0x11111111,0x11111111,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0002
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0003
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0004
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0005
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0006
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0007
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0008
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0009
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000A
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000B
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000C
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000D
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000E
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //000F
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0010
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0011
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0012
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0013
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0014
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0015
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0016
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0017
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0018
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0019
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001A
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001B
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001C
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001D
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001E
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //001F
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0020
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00011000,0x00011000,0x00011000,0x00011000, //0021 !
|
||||
0x00000000,0x00011000,0x00011000,0x00000000,
|
||||
0x00011011,0x00011011,0x00010010,0x00000000, //0022 "
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00010100,0x00111110,0x00010100, //0023 #
|
||||
0x00010100,0x00111110,0x00010100,0x00000000,
|
||||
0x00001000,0x00111110,0x00001011,0x00111110, //0024 $
|
||||
0x01101000,0x00111110,0x00001000,0x00000000,
|
||||
0x01100111,0x00110101,0x00011111,0x00001100, //0025 %
|
||||
0x01110110,0x01010011,0x01110001,0x00000000,
|
||||
0x00011100,0x00110110,0x00011100,0x00001110, //0026 &
|
||||
0x00011011,0x01110011,0x00111110,0x00000000,
|
||||
0x00000011,0x00000011,0x00000010,0x00000000, //0027 '
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00011100,0x00000110,0x00000011,0x00000011, //0028 (
|
||||
0x00000011,0x00000110,0x00011100,0x00000000,
|
||||
0x00011100,0x00110000,0x01100000,0x01100000, //0029 )
|
||||
0x01100000,0x00110000,0x00011100,0x00000000,
|
||||
0x00000000,0x00000000,0x00001000,0x00101010, //002A *
|
||||
0x00011100,0x00101010,0x00001000,0x00000000,
|
||||
0x00000000,0x00000000,0x00001000,0x00001000, //002B +
|
||||
0x00111110,0x00001000,0x00001000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //002C ,
|
||||
0x00000000,0x00000011,0x00000011,0x00000010,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //002D -
|
||||
0x00111110,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //002E .
|
||||
0x00000000,0x00000011,0x00000011,0x00000000,
|
||||
0x01100000,0x00110000,0x00011000,0x00001100, //002F /
|
||||
0x00000110,0x00000011,0x00000001,0x00000000,
|
||||
0x00011100,0x00110010,0x01100011,0x01100011, //0030 0
|
||||
0x01100011,0x00100110,0x00011100,0x00000000,
|
||||
0x00011000,0x00011100,0x00011110,0x00011000, //0031 1
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x00111000, //0032 2
|
||||
0x00001110,0x00000011,0x01111111,0x00000000,
|
||||
0x01111110,0x00110000,0x00011000,0x00111100, //0033 3
|
||||
0x01100000,0x01100011,0x00111110,0x00000000,
|
||||
0x00110000,0x00111000,0x00111100,0x00110110, //0034 4
|
||||
0x00110011,0x01111111,0x00110000,0x00000000,
|
||||
0x00111111,0x00000011,0x00000011,0x00111111, //0035 5
|
||||
0x01100000,0x01100011,0x00111110,0x00000000,
|
||||
0x00111100,0x00000110,0x00000011,0x00111111, //0036 6
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x01111111,0x01110000,0x00111000,0x00011100, //0037 7
|
||||
0x00001100,0x00001100,0x00001100,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x00111110, //0038 8
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x01111110, //0039 9
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000000,0x00011000,0x00011000,0x00000000, //003A :
|
||||
0x00000000,0x00011000,0x00011000,0x00000000,
|
||||
0x00000000,0x00011000,0x00011000,0x00000000, //003B ;
|
||||
0x00000000,0x00011000,0x00011000,0x00010000,
|
||||
0x01100000,0x00111000,0x00001110,0x00000011, //003C <
|
||||
0x00001110,0x00111000,0x01100000,0x00000000,
|
||||
0x00000000,0x00000000,0x00111110,0x00000000, //003D =
|
||||
0x00000000,0x00111110,0x00000000,0x00000000,
|
||||
0x00000011,0x00001110,0x00111000,0x01100000, //003E >
|
||||
0x00111000,0x00001110,0x00000011,0x00000000,
|
||||
0x01111110,0x11000011,0x11000011,0x01111000, //003F ?
|
||||
0x00011000,0x00000000,0x00011000,0x00000000,
|
||||
0x00111110,0x01100011,0x01011001,0x01010101, //0040 @
|
||||
0x01011101,0x01110011,0x00011110,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x01111111, //0041 A
|
||||
0x01100011,0x01100011,0x01100011,0x00000000,
|
||||
0x00111111,0x01100011,0x01100011,0x00111111, //0042 B
|
||||
0x01100011,0x01100011,0x00111111,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x00000011, //0043 C
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x00111111,0x01100011,0x01100011,0x01100011, //0044 D
|
||||
0x01100011,0x01100011,0x00111111,0x00000000,
|
||||
0x01111111,0x00000011,0x00000011,0x00111111, //0045 E
|
||||
0x00000011,0x00000011,0x01111111,0x00000000,
|
||||
0x01111111,0x00000011,0x00000011,0x00111111, //0046 F
|
||||
0x00000011,0x00000011,0x00000011,0x00000000,
|
||||
0x00111110,0x01100011,0x00000011,0x01111011, //0047 G
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x01100011,0x01100011,0x01100011,0x01111111, //0048 H
|
||||
0x01100011,0x01100011,0x01100011,0x00000000,
|
||||
0x00011000,0x00011000,0x00011000,0x00011000, //0049 I
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x01100000,0x01100000,0x01100000,0x01100000, //004A J
|
||||
0x01100000,0x01100011,0x00111110,0x00000000,
|
||||
0x01100011,0x01110011,0x00111011,0x00011111, //004B K
|
||||
0x00111011,0x01110011,0x01100011,0x00000000,
|
||||
0x00000011,0x00000011,0x00000011,0x00000011, //004C L
|
||||
0x00000011,0x00000011,0x01111111,0x00000000,
|
||||
0x01100011,0x01100011,0x01110111,0x01110111, //004D M
|
||||
0x01111111,0x01101011,0x01101011,0x00000000,
|
||||
0x01100011,0x01100111,0x01101111,0x01111111, //004E N
|
||||
0x01111011,0x01110011,0x01100011,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x01100011, //004F O
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x00111111,0x01100011,0x01100011,0x00111111, //0050 P
|
||||
0x00000011,0x00000011,0x00000011,0x00000000,
|
||||
0x00111110,0x01100011,0x01100011,0x01100011, //0051 Q
|
||||
0x01100011,0x00111110,0x01110000,0x00000000,
|
||||
0x00111111,0x01100011,0x01100011,0x00111111, //0052 R
|
||||
0x01100011,0x01100011,0x01100011,0x00000000,
|
||||
0x00111110,0x01100011,0x00000011,0x00111110, //0053 S
|
||||
0x01100000,0x01100011,0x00111110,0x00000000,
|
||||
0x11111111,0x00011000,0x00011000,0x00011000, //0054 T
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x01100011,0x01100011,0x01100011,0x01100011, //0055 U
|
||||
0x01100011,0x01100011,0x00111110,0x00000000,
|
||||
0x01100011,0x01100011,0x00110110,0x00110110, //0056 V
|
||||
0x00011100,0x00011100,0x00001000,0x00000000,
|
||||
0x11011011,0x11011011,0x11011011,0x11011011, //0057 W
|
||||
0x11011011,0x01111110,0x01100110,0x00000000,
|
||||
0x01000001,0x01100011,0x00110110,0x00011100, //0058 X
|
||||
0x00011100,0x00110110,0x01100011,0x00000000,
|
||||
0x11000011,0x11000011,0x11100111,0x01111110, //0059 Y
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x01111111,0x00110000,0x00011000,0x00001100, //005A Z
|
||||
0x00000110,0x00000011,0x01111111,0x00000000,
|
||||
0x00001111,0x00000011,0x00000011,0x00000011, //005B [
|
||||
0x00000011,0x00000011,0x00001111,0x00000000,
|
||||
0x01100110,0x01100110,0x11111111,0x00011000, //005C \'
|
||||
0x11111111,0x00011000,0x00011000,0x00000000,
|
||||
0x01111000,0x01100000,0x01100000,0x01100000, //005D ]
|
||||
0x01100000,0x01100000,0x01111000,0x00000000,
|
||||
0x00011100,0x00110110,0x00100010,0x00000000, //005E ^
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //005F _
|
||||
0x00000000,0x00000000,0x01111111,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0060
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x01111000,0x01100100, //0061 a
|
||||
0x01100110,0x01110110,0x01101110,0x00000000,
|
||||
0x00000110,0x00000110,0x00111110,0x01100110, //0062 b
|
||||
0x01100110,0x01100110,0x00111110,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x01100110, //0063 c
|
||||
0x00000110,0x01100110,0x00111100,0x00000000,
|
||||
0x01100000,0x01100000,0x01111100,0x01100110, //0064 d
|
||||
0x01100110,0x01100110,0x01111100,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x01100110, //0065 e
|
||||
0x01111110,0x00000110,0x00111100,0x00000000,
|
||||
0x01110000,0x00011000,0x01111110,0x00011000, //0066 f
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x01100110, //0067 g
|
||||
0x01100110,0x01111100,0x01100000,0x00111110,
|
||||
0x00000110,0x00000110,0x00000110,0x00111110, //0068 h
|
||||
0x01100110,0x01100110,0x01100110,0x00000000,
|
||||
0x00011000,0x00011000,0x00000000,0x00011000, //0069 i
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x00110000,0x00110000,0x00000000,0x00110000, //006A j
|
||||
0x00110000,0x00110000,0x00110011,0x00011110,
|
||||
0x00000011,0x01100011,0x00110011,0x00011111, //006B k
|
||||
0x00011111,0x00110011,0x01100011,0x00000000,
|
||||
0x00011000,0x00011000,0x00011000,0x00011000, //006C l
|
||||
0x00011000,0x00011000,0x00011000,0x00000000,
|
||||
0x00000000,0x00000000,0x01111111,0x11011011, //006D m
|
||||
0x11011011,0x11011011,0x11011011,0x00000000,
|
||||
0x00000000,0x00000000,0x00111110,0x01100110, //006E n
|
||||
0x01100110,0x01100110,0x01100110,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x01100110, //006F o
|
||||
0x01100110,0x01100110,0x00111100,0x00000000,
|
||||
0x00000000,0x00000000,0x00111110,0x01100110, //0070 p
|
||||
0x01100110,0x00111110,0x00000110,0x00000110,
|
||||
0x00000000,0x00000000,0x01111100,0x01100110, //0071 q
|
||||
0x01100110,0x01111100,0x01100000,0x01100000,
|
||||
0x00000000,0x00000000,0x00101100,0x00011100, //0072 r
|
||||
0x00001100,0x00001100,0x00001100,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x00000110, //0073 s
|
||||
0x00111100,0x01100000,0x00111100,0x00000000,
|
||||
0x00000000,0x00011000,0x00111100,0x00011000, //0074 t
|
||||
0x00011000,0x00011000,0x00110000,0x00000000,
|
||||
0x00000000,0x00000000,0x01100110,0x01100110, //0075 u
|
||||
0x01100110,0x01100110,0x01111100,0x00000000,
|
||||
0x00000000,0x00000000,0x01100110,0x01100110, //0076 v
|
||||
0x01100110,0x00111100,0x00011000,0x00000000,
|
||||
0x00000000,0x00000000,0x11011011,0x11011011, //0077 w
|
||||
0x11011011,0x11011011,0x01111110,0x00000000,
|
||||
0x00000000,0x00000000,0x01100110,0x00111100, //0078 x
|
||||
0x00011000,0x00111100,0x01100110,0x00000000,
|
||||
0x00000000,0x00000000,0x01100110,0x01100110, //0079 y
|
||||
0x01100110,0x01111100,0x01100000,0x00111110,
|
||||
0x00000000,0x00000000,0x01111110,0x00110000, //007A z
|
||||
0x00011000,0x00001100,0x01111110,0x00000000,
|
||||
0x00011100,0x00000110,0x00000110,0x00000111, //007B {
|
||||
0x00000110,0x00000110,0x00011100,0x00000000,
|
||||
0x00001000,0x00001000,0x00001000,0x00001000, //007C |
|
||||
0x00001000,0x00001000,0x00001000,0x00000000,
|
||||
0x00011100,0x00110000,0x00110000,0x01110000, //007D }
|
||||
0x00110000,0x00110000,0x00011100,0x00000000,
|
||||
0x01101100,0x00111110,0x00011011,0x00000000, //007E ~
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //007F
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0080
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0081
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0082
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0083
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0084
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0085
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0086
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0087
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0088
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0089
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008A
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008B
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008C
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008D
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008E
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //008F
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0090
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0091
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0092
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0093
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0094
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0095
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0096
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0097
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0098
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //0099
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009A
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009B
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009C
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009D
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009E
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //009F
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00A0
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00A1
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00A2
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00A3
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00A4
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00001100, //00A5 ・
|
||||
0x00001100,0x00000000,0x00000000,0x00000000,
|
||||
0x01111110,0x01000000,0x01111110,0x01000000, //00A6 ヲ
|
||||
0x01100000,0x00110000,0x00011100,0x00000000,
|
||||
0x00000000,0x00000000,0x00111110,0x00101000, //00A7 ァ
|
||||
0x00011000,0x00001000,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00100000,0x00011000, //00A8 ィ
|
||||
0x00001110,0x00001000,0x00001000,0x00000000,
|
||||
0x00000000,0x00000000,0x00001000,0x00111110, //00A9 ゥ
|
||||
0x00100010,0x00110000,0x00011100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00011100, //00AA ェ
|
||||
0x00001000,0x00001000,0x00111110,0x00000000,
|
||||
0x00000000,0x00000000,0x00010000,0x00111110, //00AB ォ
|
||||
0x00011000,0x00010100,0x00010010,0x00000000,
|
||||
0x00000000,0x00000000,0x00000100,0x00111110, //00AC ャ
|
||||
0x00100100,0x00010100,0x00000100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00011100, //00AD ュ
|
||||
0x00010000,0x00010000,0x01111110,0x00000000,
|
||||
0x00000000,0x00000000,0x00111100,0x00100000, //00AE ョ
|
||||
0x00111100,0x00100000,0x00111100,0x00000000,
|
||||
0x00000000,0x00000000,0x00001010,0x00101010, //00AF ッ
|
||||
0x00100000,0x00110000,0x00011100,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x01111110, //00B0 ー
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x01111111,0x01000000,0x01100100,0x00111100, //00B1 ア
|
||||
0x00000100,0x00000110,0x00000011,0x00000000,
|
||||
0x01100000,0x00110000,0x00011100,0x00010111, //00B2 イ
|
||||
0x00010000,0x00010000,0x00010000,0x00000000,
|
||||
0x00001000,0x01111111,0x01000001,0x01000001, //00B3 ウ
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000000,0x00111110,0x00001000,0x00001000, //00B4 エ
|
||||
0x00001000,0x00001000,0x01111111,0x00000000,
|
||||
0x00100000,0x01111111,0x00101000,0x00101100, //00B5 オ
|
||||
0x00100110,0x00100011,0x00110000,0x00000000,
|
||||
0x00000100,0x01111111,0x01000100,0x01000100, //00B6 カ
|
||||
0x01000100,0x01100110,0x00110011,0x00000000,
|
||||
0x00000100,0x01111111,0x00001000,0x00001000, //00B7 キ
|
||||
0x01111111,0x00010000,0x00010000,0x00000000,
|
||||
0x01111110,0x01000010,0x01000011,0x01000000, //00B8 ク
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000010,0x01111110,0x00010010,0x00010001, //00B9 ケ
|
||||
0x00010000,0x00011000,0x00001110,0x00000000,
|
||||
0x01111111,0x01000000,0x01000000,0x01000000, //00BA コ
|
||||
0x01000000,0x01000000,0x01111111,0x00000000,
|
||||
0x00100010,0x01111111,0x00100010,0x00100010, //00BB サ
|
||||
0x00100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000011,0x01000000,0x01000011,0x01000000, //00BC シ
|
||||
0x01000000,0x01100000,0x00111111,0x00000000,
|
||||
0x00111111,0x00100000,0x00100000,0x00010000, //00BD ス
|
||||
0x00001000,0x00010100,0x01100011,0x00000000,
|
||||
0x00000010,0x01111111,0x01000010,0x01100010, //00BE セ
|
||||
0x00100010,0x00000110,0x01111100,0x00000000,
|
||||
0x01000001,0x01000011,0x01000010,0x01100000, //00BF ソ
|
||||
0x00110000,0x00011000,0x00001100,0x00000000,
|
||||
0x01111110,0x01000010,0x01000011,0x01111000, //00C0 タ
|
||||
0x01000000,0x01100000,0x00111110,0x00000000,
|
||||
0x00110000,0x00011110,0x00010000,0x01111111, //00C1 チ
|
||||
0x00010000,0x00011000,0x00001110,0x00000000,
|
||||
0x01000101,0x01000101,0x01000101,0x01000000, //00C2 ツ
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00111110,0x00000000,0x01111111,0x00001000, //00C3 テ
|
||||
0x00001000,0x00001100,0x00000110,0x00000000,
|
||||
0x00000010,0x00000010,0x00000010,0x00011110, //00C4 ト
|
||||
0x00100010,0x00000010,0x00000010,0x00000000,
|
||||
0x00001000,0x00001000,0x01111111,0x00001000, //00C5 ナ
|
||||
0x00001000,0x00001100,0x00000111,0x00000000,
|
||||
0x00111110,0x00000000,0x00000000,0x00000000, //00C6 ニ
|
||||
0x00000000,0x00000000,0x01111111,0x00000000,
|
||||
0x00111111,0x00100000,0x00110000,0x00011010, //00C7 ヌ
|
||||
0x00001100,0x00010110,0x00100011,0x00000000,
|
||||
0x00001000,0x01111111,0x01100000,0x00110000, //00C8 ネ
|
||||
0x00011100,0x01101010,0x01001001,0x00000000,
|
||||
0x00100000,0x00100000,0x00100000,0x00100000, //00C9 ノ
|
||||
0x00110000,0x00011000,0x00001110,0x00000000,
|
||||
0x00011000,0x00110000,0x01100001,0x01000001, //00CA ハ
|
||||
0x01000001,0x01000001,0x01000001,0x00000000,
|
||||
0x00000001,0x00000001,0x00111111,0x00000001, //00CB ヒ
|
||||
0x00000001,0x00000011,0x00111110,0x00000000,
|
||||
0x01111111,0x01000000,0x01000000,0x01000000, //00CC フ
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000000,0x00000000,0x00001110,0x00011001, //00CD ヘ
|
||||
0x00110001,0x01100000,0x01000000,0x00000000,
|
||||
0x00001000,0x01111111,0x00001000,0x00001000, //00CE ホ
|
||||
0x01001001,0x01001001,0x01001001,0x00000000,
|
||||
0x01111111,0x01000000,0x01000000,0x01100011, //00CF マ
|
||||
0x00111110,0x00001100,0x00011000,0x00000000,
|
||||
0x00011111,0x01110000,0x00000110,0x00011100, //00D0 ミ
|
||||
0x00110000,0x00000111,0x01111100,0x00000000,
|
||||
0x00001100,0x00000110,0x00000010,0x01000011, //00D1 ム
|
||||
0x01000001,0x01000001,0x01111111,0x00000000,
|
||||
0x01000000,0x01100010,0x00110100,0x00011000, //00D2 メ
|
||||
0x00001100,0x00010110,0x00100011,0x00000000,
|
||||
0x01111111,0x00000100,0x01111111,0x00000100, //00D3 モ
|
||||
0x00000100,0x00001100,0x01111000,0x00000000,
|
||||
0x00000100,0x01111111,0x01000100,0x01100100, //00D4 ヤ
|
||||
0x00110100,0x00000100,0x00000100,0x00000000,
|
||||
0x00011110,0x00010000,0x00010000,0x00010000, //00D5 ユ
|
||||
0x00010000,0x00010000,0x01111111,0x00000000,
|
||||
0x01111110,0x01000000,0x01000000,0x01111110, //00D6 ヨ
|
||||
0x01000000,0x01000000,0x01111110,0x00000000,
|
||||
0x01111111,0x00000000,0x01111111,0x01000000, //00D7 ラ
|
||||
0x01000000,0x01100000,0x00111110,0x00000000,
|
||||
0x01000010,0x01000010,0x01000010,0x01000010, //00D8 リ
|
||||
0x01000000,0x01100000,0x00111100,0x00000000,
|
||||
0x00001010,0x00001010,0x00001010,0x00001010, //00D9 ル
|
||||
0x01001010,0x01101010,0x00111011,0x00000000,
|
||||
0x00000001,0x00000001,0x01000001,0x01100001, //00DA レ
|
||||
0x00110001,0x00011001,0x00001111,0x00000000,
|
||||
0x01111111,0x01000001,0x01000001,0x01000001, //00DB ロ
|
||||
0x01000001,0x01000001,0x01111111,0x00000000,
|
||||
0x01111111,0x01000001,0x01000001,0x01000000, //00DC ワ
|
||||
0x01100000,0x00110000,0x00011110,0x00000000,
|
||||
0x00000111,0x01000000,0x01000000,0x01000000, //00DD ン
|
||||
0x01100000,0x00110000,0x00011111,0x00000000,
|
||||
0x00001001,0x00010010,0x00000000,0x00000000, //00DE ゙
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00001110,0x00001010,0x00001110,0x00000000, //00DF ゚
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x11100000, //00E0 メニューの左上
|
||||
0x11110000,0x00111000,0x00011000,0x00011000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000111, //00E1 メニューの右上
|
||||
0x00001111,0x00011100,0x00011000,0x00011000,
|
||||
0x00011000,0x00011000,0x00111000,0x11110000, //00E2 メニューの左下
|
||||
0x11100000,0x00000000,0x00000000,0x00000000,
|
||||
0x00011000,0x00011000,0x00011100,0x00001111, //00E3 メニューの右下
|
||||
0x00000111,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x11111111, //00E4 メニューの縦線
|
||||
0x11111111,0x00000000,0x00000000,0x00000000,
|
||||
0x00011000,0x00011000,0x00011000,0x00011000, //00E5 メニューの横線
|
||||
0x00011000,0x00011000,0x00011000,0x00011000,
|
||||
0x11111111,0x11111111,0x11111111,0x11111111, //00E6 ■
|
||||
0x11111111,0x11111111,0x11111111,0x11111111,
|
||||
0x10101010,0x10101010,0x10101010,0x10101010, //00E7 縦ストライプ
|
||||
0x10101010,0x10101010,0x10101010,0x10101010,
|
||||
0x11111111,0x00000000,0x11111111,0x00000000, //00E8 横ストライプ
|
||||
0x11111111,0x00000000,0x11111111,0x00000000,
|
||||
0x00000000,0x11111110,0x11111110,0x11111110, //00E9 LCD検査のΓ
|
||||
0x11111110,0x11111110,0x11111110,0x11111110,
|
||||
0x11111000,0x11111111,0x11111111,0x11111111, //00EA LCD検査の ̄
|
||||
0x11111111,0x11111111,0x11111111,0x11111111,
|
||||
0x11111110,0x11111110,0x11111110,0x11111111, //00EB LCD検査のΙ
|
||||
0x11111111,0x11111111,0x11111111,0x11111111,
|
||||
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00EC TPマーカの左上
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000001,0x00000001,0x00000001, //00ED TPマーカの右上
|
||||
0x00000001,0x00000001,0x00000000,0x00000000,
|
||||
0x00111111,0x00000000,0x00000000,0x00000000, //00EE TPマーカの左下
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x11111001,0x00000000,0x00000000,0x00000001, //00EF TPマーカの右下
|
||||
0x00000001,0x00000001,0x00000001,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F0 TP精度マーカの左上
|
||||
0x11110000,0x11110000,0x00110000,0x00110000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F1 TP精度マーカの右上
|
||||
0x00011111,0x00011111,0x00011000,0x00011001,
|
||||
0x10110000,0x00110000,0x00110000,0x11110000, //00F2 TP精度マーカの左下
|
||||
0x11110000,0x00000000,0x00000000,0x00000000,
|
||||
0x00011011,0x00011001,0x00011000,0x00011111, //00F3 TP精度マーカの右下
|
||||
0x00011111,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x11111110,0x10000010,0x10000010, //00F4 □
|
||||
0x10000010,0x10000010,0x10000010,0x11111110,
|
||||
0x00000000,0x11111110,0x11111110,0x11111110, //00F5 ■
|
||||
0x11111110,0x11111110,0x11111110,0x11111110,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F6
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F7
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F8
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00F9
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FA
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FB
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FC
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FD
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FE
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000, //00FF
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,
|
||||
};
|
||||
|
||||
|
||||
365
build/debugsoft/treenand2sd/src/main.cpp
Normal file
365
build/debugsoft/treenand2sd/src/main.cpp
Normal file
@ -0,0 +1,365 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - tools - treenand
|
||||
File: main.c
|
||||
|
||||
Copyright 2007 Nintendo. All rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs contain
|
||||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
Company Ltd., and are protected by Federal copyright law. They may
|
||||
not be disclosed to third parties or copied or duplicated in any form,
|
||||
in whole or in part, without the prior written consent of Nintendo.
|
||||
|
||||
$Date:: $
|
||||
$Rev$
|
||||
$Author$
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <twl.h>
|
||||
#include <nitro/fs.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
#include <sd_log.h>
|
||||
#include "text.h"
|
||||
#include "MyStrings.h"
|
||||
|
||||
inline void* operator new(size_t size) { return OS_Alloc(size); }
|
||||
inline void* operator new[](size_t size) { return OS_Alloc(size); }
|
||||
inline void operator delete(void* ptr) { OS_Free(ptr); }
|
||||
inline void operator delete[](void* ptr) { OS_Free(ptr); }
|
||||
|
||||
namespace
|
||||
{
|
||||
void
|
||||
InitInterrupt(void)
|
||||
{
|
||||
OS_EnableIrq();
|
||||
OS_EnableInterrupts();
|
||||
}
|
||||
|
||||
void
|
||||
InitAlloc(void)
|
||||
{
|
||||
OSHeapHandle hHeap;
|
||||
void* lo = OS_GetMainArenaLo();
|
||||
void* hi = OS_GetMainArenaHi();
|
||||
|
||||
lo = OS_InitAlloc(OS_ARENA_MAIN, lo, hi, 1);
|
||||
OS_SetArenaLo(OS_ARENA_MAIN, lo);
|
||||
|
||||
hHeap = OS_CreateHeap(OS_ARENA_MAIN, lo, hi);
|
||||
SDK_ASSERT( hHeap >= 0 );
|
||||
|
||||
OS_SetCurrentHeap(OS_ARENA_MAIN, hHeap);
|
||||
}
|
||||
|
||||
void
|
||||
MyInit(void)
|
||||
{
|
||||
OS_Init();
|
||||
FX_Init();
|
||||
|
||||
GX_Init();
|
||||
|
||||
(void)OS_EnableIrqMask( OS_IE_V_BLANK );
|
||||
(void)OS_EnableIrq();
|
||||
|
||||
FS_Init(MI_DMA_MAX_NUM);
|
||||
|
||||
GX_DispOff();
|
||||
GXS_DispOff();
|
||||
|
||||
(void)GX_VBlankIntr(TRUE); // to generate VBlank interrupt request
|
||||
//---------------------------------------------------------------------------
|
||||
// All VRAM banks to LCDC
|
||||
//---------------------------------------------------------------------------
|
||||
GX_SetBankForLCDC(GX_VRAM_LCDC_ALL);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Clear all LCDC space
|
||||
//---------------------------------------------------------------------------
|
||||
MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Disable the banks on LCDC
|
||||
//---------------------------------------------------------------------------
|
||||
(void)GX_DisableBankForLCDC();
|
||||
|
||||
MI_CpuFillFast((void *)HW_OAM, 192, HW_OAM_SIZE); // clear OAM
|
||||
MI_CpuClearFast((void *)HW_PLTT, HW_PLTT_SIZE); // clear the standard palette
|
||||
|
||||
MI_CpuFillFast((void*)HW_DB_OAM, 192, HW_DB_OAM_SIZE); // clear OAM
|
||||
MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); // clear the standard palette
|
||||
|
||||
GX_DispOn();
|
||||
GXS_DispOn();
|
||||
|
||||
*(vu16 *) REG_IME_ADDR = 1; // IME セット
|
||||
|
||||
wInitTextVram();
|
||||
|
||||
//SDの存在チェック
|
||||
{
|
||||
FSPathInfo info;
|
||||
|
||||
if(FS_GetPathInfo( "sdmc:/", &info ) )
|
||||
{
|
||||
if( (info.attributes&FS_ATTRIBUTE_IS_PROTECTED)==FS_ATTRIBUTE_IS_PROTECTED )
|
||||
{
|
||||
wSetPalette(COLOR_RED);
|
||||
wPrintf("\n\n SD CARD IS PROTECTED!!");
|
||||
OS_Terminate();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wSetPalette(COLOR_RED);
|
||||
wPrintf("\n\n SD CARD NOTHING!!");
|
||||
OS_Terminate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
class DirEntry;
|
||||
typedef std::vector<DirEntry> EntryList;
|
||||
class DirEntry
|
||||
{
|
||||
private:
|
||||
FSDirectoryEntryInfo m_dei;
|
||||
std::string m_path;
|
||||
EntryList* m_pEntryList;
|
||||
|
||||
public:
|
||||
DirEntry(std::string parent, const FSDirectoryEntryInfo& dei)
|
||||
: m_path(parent + "/" + dei.longname)
|
||||
, m_dei(dei)
|
||||
, m_pEntryList(NULL)
|
||||
{}
|
||||
~DirEntry(){ delete m_pEntryList; }
|
||||
bool operator <(const DirEntry& rhs) const
|
||||
{
|
||||
return this->m_path < rhs.m_path;
|
||||
}
|
||||
|
||||
std::string GetPath() const { return m_path; }
|
||||
std::string GetName() const { return m_dei.longname; }
|
||||
std::string GetShortName() const { return m_dei.shortname; }
|
||||
u32 GetSize() const { return m_dei.filesize; }
|
||||
|
||||
bool IsDirectory() const { return (m_dei.attributes & FS_ATTRIBUTE_IS_DIRECTORY) != 0; }
|
||||
bool IsReadOnly() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_READONLY) != 0; }
|
||||
bool IsHidden() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_HIDDEN) != 0; }
|
||||
bool IsSystem() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_SYSTEM) != 0; }
|
||||
bool IsVolume() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_VOLUME) != 0; }
|
||||
bool IsArchive() const { return (m_dei.attributes & FS_ATTRIBUTE_DOS_ARCHIVE) != 0; }
|
||||
|
||||
void SetEntryList(EntryList* pEntryList)
|
||||
{
|
||||
delete m_pEntryList;
|
||||
m_pEntryList = pEntryList;
|
||||
}
|
||||
const EntryList& GetEntryList() const
|
||||
{
|
||||
return *m_pEntryList;
|
||||
}
|
||||
std::string GetDateTimeString() const
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
oss << std::setw(4) << std::setfill('0') << m_dei.mtime.year << "/";
|
||||
oss << std::setw(2) << std::setfill('0') << m_dei.mtime.month << "/";
|
||||
oss << std::setw(2) << std::setfill('0') << m_dei.mtime.day << " ";
|
||||
oss << std::setw(2) << std::setfill('0') << m_dei.mtime.hour << ":";
|
||||
oss << std::setw(2) << std::setfill('0') << m_dei.mtime.minute << ":";
|
||||
oss << std::setw(2) << std::setfill('0') << m_dei.mtime.second;
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::vector<DirEntry> EntryList;
|
||||
|
||||
void
|
||||
GetDirEntry(EntryList* pList, std::string path)
|
||||
{
|
||||
BOOL bSuccess;
|
||||
FSFile dir;
|
||||
FSDirectoryEntryInfo dei;
|
||||
|
||||
pList->clear();
|
||||
|
||||
FS_InitFile(&dir);
|
||||
bSuccess = FS_OpenDirectory(&dir, path.c_str(), FS_FILEMODE_R);
|
||||
if( bSuccess )
|
||||
{
|
||||
while( FS_ReadDirectory(&dir, &dei) )
|
||||
{
|
||||
std::string name = dei.longname;
|
||||
|
||||
if( (name == ".") || (name == "..") )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pList->push_back( DirEntry(path, dei) );
|
||||
}
|
||||
|
||||
FS_CloseDirectory(&dir);
|
||||
}
|
||||
|
||||
std::sort(pList->begin(), pList->end());
|
||||
}
|
||||
|
||||
void
|
||||
GetDirEntryRecursive(EntryList* pList, std::string path)
|
||||
{
|
||||
EntryList::iterator i;
|
||||
|
||||
GetDirEntry(pList, path);
|
||||
|
||||
for( i = pList->begin(); i != pList->end(); ++i )
|
||||
{
|
||||
if( i->IsDirectory() )
|
||||
{
|
||||
EntryList* pSubEntryList = new EntryList;
|
||||
GetDirEntryRecursive(pSubEntryList, i->GetPath());
|
||||
i->SetEntryList(pSubEntryList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DrawEntries(std::string prevPart, std::string prevPart2, const EntryList& elist)
|
||||
{
|
||||
EntryList::const_iterator i;
|
||||
|
||||
for( i = elist.begin(); i != elist.end(); ++i )
|
||||
{
|
||||
std::ostringstream oss, oss2;
|
||||
const bool isLast = (i + 1 == elist.end());
|
||||
|
||||
oss << prevPart;
|
||||
oss2<< prevPart2;
|
||||
oss << (isLast ? "└": "├" );
|
||||
oss2<< "+";
|
||||
oss << " " << i->GetName();
|
||||
oss2<< " " << i->GetName();
|
||||
if( i->IsDirectory() )
|
||||
{
|
||||
oss << "/";
|
||||
oss2<< "/";
|
||||
|
||||
}else
|
||||
{
|
||||
char str[0x100]="";
|
||||
char size[20]="";
|
||||
int offset,j;
|
||||
|
||||
offset = 60-STD_StrLen(oss.str().c_str());
|
||||
for(j=0;j<offset;j++) str[j]=' ';
|
||||
STD_TSPrintf(size,"(%d)",i->GetSize());
|
||||
STD_StrCat(str,size);
|
||||
|
||||
oss << " " << str;
|
||||
oss2<< " " << size;
|
||||
}
|
||||
oss << std::endl;
|
||||
oss2<< std::endl;
|
||||
|
||||
OS_PutString(oss.str().c_str());
|
||||
SDLOG_Printf(oss.str().c_str());
|
||||
wPrintf(oss2.str().c_str());
|
||||
OS_Sleep(100);
|
||||
|
||||
if( i->IsDirectory() )
|
||||
{
|
||||
DrawEntries(prevPart + (isLast ? " ": "| "), (prevPart2 + " "), i->GetEntryList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TreeNand(const char* root)
|
||||
{
|
||||
EntryList elist;
|
||||
GetDirEntryRecursive(&elist, root);
|
||||
|
||||
OS_TPrintf("%s\n", root);
|
||||
DrawEntries("","", elist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TwlStartUp()
|
||||
{
|
||||
OS_Init();
|
||||
InitAlloc();
|
||||
}
|
||||
|
||||
// 文字表示
|
||||
static void PutString( char *format, ... )
|
||||
{
|
||||
u16 *dest = (u16*)G2_GetBG1ScrPtr();
|
||||
char temp[32+1];
|
||||
int i;
|
||||
va_list va;
|
||||
|
||||
va_start(va, format);
|
||||
(void)OS_VSNPrintf(temp, sizeof(temp), format, va);
|
||||
va_end(va);
|
||||
|
||||
for (i = 0; i < 32 && temp[i]; i++)
|
||||
{
|
||||
dest[i] = (u16)((u8)temp[i] | (1 << 12));
|
||||
}
|
||||
}
|
||||
|
||||
#define BUFFER_SIZE 0x900
|
||||
#define PARTITION_SIZE 0x300
|
||||
char logBuffer[ (BUFFER_SIZE + 1) ];
|
||||
void
|
||||
TwlMain(void)
|
||||
{
|
||||
|
||||
MyInit();
|
||||
|
||||
if( !SDLOG_Init("sdmc:/treenand2sd/", logBuffer, BUFFER_SIZE, PARTITION_SIZE, SDLOG_WRITE_TYPE_CONTINUANCE) )
|
||||
{
|
||||
OS_Panic("Error");
|
||||
}
|
||||
|
||||
OS_TPrintf("treenand start.\n");
|
||||
OS_TPrintf("---------------------------------------------------------------\n");
|
||||
wPrintf("\fnand:\n");
|
||||
wPrintf("-------------------------------\n");
|
||||
TreeNand("nand:");
|
||||
|
||||
wPrintf("\n\nnand2:\n");
|
||||
wPrintf("-------------------------------\n");
|
||||
TreeNand("nand2:");
|
||||
OS_TPrintf("---------------------------------------------------------------\n");
|
||||
OS_TPrintf("treenand completed.\n");
|
||||
|
||||
SDLOG_Flush();
|
||||
SDLOG_Finish();
|
||||
OS_Printf("Program is finished!\n");
|
||||
|
||||
wSetPalette(COLOR_BLUE);
|
||||
wPrintf("\n !Program is finished!\n");
|
||||
|
||||
OS_Terminate();
|
||||
}
|
||||
|
||||
113
build/debugsoft/treenand2sd/src/text.c
Normal file
113
build/debugsoft/treenand2sd/src/text.c
Normal file
@ -0,0 +1,113 @@
|
||||
/********************************************************************
|
||||
|
||||
タイトル:
|
||||
テキストVRAMエミュレーション
|
||||
|
||||
********************************************************************/
|
||||
#include "fontdata.h"
|
||||
#include "text.h"
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆グローバル変数宣言
|
||||
|
||||
************************************************************************/
|
||||
/* テキストVRAM本体 */
|
||||
TEXT_VRAM_TYPE wText;
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆プロトタイプ宣言
|
||||
|
||||
************************************************************************/
|
||||
static void UpdateTextVram( void );
|
||||
static void Init( void );
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
|
||||
☆システム関数群
|
||||
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
|
||||
初期化
|
||||
|
||||
概要:
|
||||
キャラ・パレットの転送
|
||||
BG0コントロール
|
||||
|
||||
***********************************************************************/
|
||||
static void Init( void ){
|
||||
|
||||
GX_SetBankForBG(GX_VRAM_BG_128_A);
|
||||
GX_SetGraphicsMode(GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BG0_AS_2D);
|
||||
GX_SetVisiblePlane(GX_PLANEMASK_BG0);
|
||||
G2_SetBG0Priority(0);
|
||||
G2_BlendNone(); // no 2D alpha blending or brightness change
|
||||
G2_BG0Mosaic(FALSE);
|
||||
GX_SetVisibleWnd(GX_WNDMASK_NONE); // ウインドウ無し
|
||||
G2_SetBG0Offset(0, 0); //オフセット0
|
||||
GX_SetBGScrOffset(GX_BGSCROFFSET_0x00000);
|
||||
|
||||
//表示リソースの再ロード
|
||||
G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, // 256pix x 256pix text
|
||||
GX_BG_COLORMODE_16, // use 256 colors mode
|
||||
GX_BG_SCRBASE_0x0000, // screen base offset + 0x0000 is the address for BG #0 screen
|
||||
GX_BG_CHARBASE_0x04000, // character base offset + 0x04000 is the address for BG #0 characters
|
||||
GX_BG_EXTPLTT_01 // use BGExtPltt slot #0 if BGExtPltt is enabled
|
||||
);
|
||||
GX_LoadBG0Char(CharData_Sample, 0, sizeof(CharData_Sample));
|
||||
GX_LoadBGPltt(PlttData_Sample, 0, sizeof(PlttData_Sample));
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
テキストVRAMサービス初期化
|
||||
|
||||
注意事項:
|
||||
プログラム開始時に一度だけコールしてください。
|
||||
|
||||
***********************************************************************/
|
||||
extern void wInitTextVram( void ){
|
||||
|
||||
static BOOL Initialized = FALSE;
|
||||
|
||||
if( !Initialized ){
|
||||
|
||||
/* 初期設定をおこなう */
|
||||
Init();
|
||||
|
||||
// Vブランク割り込み設定
|
||||
OS_InitIrqTable();
|
||||
OS_SetIrqFunction(OS_IE_V_BLANK, UpdateTextVram);
|
||||
(void)OS_EnableIrqMask(OS_IE_V_BLANK);
|
||||
(void)OS_EnableIrq();
|
||||
(void)GX_VBlankIntr(TRUE);
|
||||
(void)OS_EnableInterrupts();
|
||||
|
||||
Initialized = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
||||
テキストVRAMの更新ルーチン
|
||||
|
||||
注意事項:
|
||||
割込みのコールバックルーチンです。
|
||||
|
||||
画面を自動的に更新するために定期的に呼び出してください。
|
||||
(上記のInitTextVramを使用する場合は不要)
|
||||
|
||||
***********************************************************************/
|
||||
static void UpdateTextVram( void ){
|
||||
|
||||
MI_CpuCopy16( wText.Map, G2_GetBG0ScrPtr(), sizeof(wText.Map) );
|
||||
DC_StoreRange( G2_GetBG0ScrPtr(), sizeof(wText.Map) );
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user