diff --git a/build/tools/CardToSD/Makefile b/build/tools/CardToSD/Makefile new file mode 100644 index 0000000..628b777 --- /dev/null +++ b/build/tools/CardToSD/Makefile @@ -0,0 +1,66 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - demos.TWL - nandApp - appliCooperation - cooperationA +# 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = banner + +#------------------------- +#-- NAND アプリのビルドを指定します。 + +TWL_NANDAPP = TRUE + + +#---------------------------------------------------------------------------- + +GAME_CODE = 0VNA + +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED + +SRCS = main.c NitroGameCardToSD.c \ + misc_simple.c \ + data.c + +LIBSYSCALL = header/libsyscall.a + +TARGET_BIN = DSGameCardToSD.tad + + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = demo.autogen.rsf +ROM_SPEC_TEMPLATE = ROM-TS_nand_alt.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=$(GAME_CODE) \ + BannerFile="banner/banner.bnr" \ + PermitLandingNormalJump=TRUE \ + TitleName="DSCARDTOSD" + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +#---------------------------------------------------------------------------- + +do-build : $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== diff --git a/build/tools/CardToSD/ROM-TS_nand_alt.rsf b/build/tools/CardToSD/ROM-TS_nand_alt.rsf new file mode 100644 index 0000000..4137743 --- /dev/null +++ b/build/tools/CardToSD/ROM-TS_nand_alt.rsf @@ -0,0 +1,245 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + #TitleName "MY APP NAME" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + #MakerCode "00" + + # + # REMASTER VERSION: Mastering version + # + #RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./header/rom_header_0vna.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + SDCardAccess TRUE + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + #GameCode ABCJ + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + GameCardOn TRUE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + GameCardNitroMode TRUE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/tools/CardToSD/banner/Makefile b/build/tools/CardToSD/banner/Makefile new file mode 100644 index 0000000..19d3159 --- /dev/null +++ b/build/tools/CardToSD/banner/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - nandApp - demos - launcher_param - AppliCooperation +# 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe + +ICON_DIR = ./icon + +BANNER_ICON = $(ICON_DIR)/gameIcon.bmp +BANNER_SPEC = banner_v3.bsf + +TARGETS = banner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) +BANNER_ICON_MIDDLE = $(addprefix $(BANNER_ICON_NAME), .nbfs .nbfc .nbfp) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_MIDDLE) \ + $(TARGETS:.bnr=.srl) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE) + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +# diff --git a/build/tools/CardToSD/banner/banner_v3.bsf b/build/tools/CardToSD/banner/banner_v3.bsf new file mode 100644 index 0000000..beca36a Binary files /dev/null and b/build/tools/CardToSD/banner/banner_v3.bsf differ diff --git a/build/tools/CardToSD/banner/icon/gameIcon.bmp b/build/tools/CardToSD/banner/icon/gameIcon.bmp new file mode 100644 index 0000000..3aff42c Binary files /dev/null and b/build/tools/CardToSD/banner/icon/gameIcon.bmp differ diff --git a/build/tools/CardToSD/header/rom_header_0vna.template.sbin b/build/tools/CardToSD/header/rom_header_0vna.template.sbin new file mode 100644 index 0000000..69ff828 Binary files /dev/null and b/build/tools/CardToSD/header/rom_header_0vna.template.sbin differ diff --git a/build/tools/CardToSD/src/NitroGameCardToSD.c b/build/tools/CardToSD/src/NitroGameCardToSD.c new file mode 100644 index 0000000..a1beaa7 --- /dev/null +++ b/build/tools/CardToSD/src/NitroGameCardToSD.c @@ -0,0 +1,636 @@ +/*---------------------------------------------------------------------------* + Project: NitroGameCardToSD + File: NitroGameCardToSD.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 +#include +#include +#include "misc_simple.h" +#include "NitroGameCardToSD.h" + +// define data------------------------------------------ + +//#define MENU_ELEMENT_NUM 5 // メニューの項目数 + +#define ARM7_INFO_NUM 3 + +#define ROMSIZE_TO_BYTE( x ) ( 1 << ( x + 17 ) ) + +typedef struct Arm7Info +{ + char name[32]; + unsigned char hash[MATH_SHA1_DIGEST_SIZE]; +} +Arm7Info; + +typedef enum DetectError +{ + DETECT_ERROR_NONE = 0, + DETECT_ERROR_FILE_CREATE = 1, + DETECT_ERROR_FILE_OPEN = 2, + DETECT_ERROR_FILE_WRITE = 3, + DETECT_ERROR_GAMECARD_REMOVED = 4, + DETECT_ERROR_MAX +} +DetectError; + +typedef enum RunningMode +{ + MODE_WRITABLE = 0, + MODE_NOSD = 1, + MODE_WRITING = 2, + MODE_WAITING_GAMECARD = 3, + MODE_MAX +} +RunningMode; + +typedef enum SDStat +{ + SDSTAT_INSERTED = 0, + SDSTAT_REMOVED = 1, + SDSTAT_MAX +} +SDStat; + +// extern data------------------------------------------ + +// function's prototype declaration--------------------- + +static void MenuScene( void ); + +// global variable ------------------------------------- + +// static variable ------------------------------------- + +static char s_mode = 0; +static BOOL s_secret = FALSE; +static u8 s_error = DETECT_ERROR_NONE; +static u8 s_digest[MATH_SHA1_DIGEST_SIZE]; +static u8 s_hit = 0; +static s32 s_SDCheck = 0; +static BOOL s_protected = FALSE; +static BOOL s_protect_checked = FALSE; +static FSEventHook s_hook; +static u32 s_read_count = 0; +static BOOL s_complete = FALSE; + + +// const data ----------------------------------------- + +static const ROM_Header_Short *sp_header = (ROM_Header_Short *)HW_CARD_ROM_HEADER; +static const Arm7Info s_info[ ARM7_INFO_NUM ] = +{ + { + "NitroSDK 2.2 RELEASE plus 3", + { 0xB4, 0x6C, 0xD3, 0x35, 0x5D, 0xB1, 0x6E, 0xC9, 0xEC, 0x5F, + 0xC4, 0x82, 0x23, 0x23, 0xA1, 0x90, 0xD9, 0x8D, 0xBA, 0xC4 } + }, + { + "NitroSDK 4.0 RELEASE plus 1", + { 0x77, 0xA5, 0xC0, 0x89, 0x83, 0x66, 0xC1, 0x0D, 0x0A, 0x3B, + 0x31, 0xA0, 0x63, 0xE6, 0xF5, 0x4F, 0xED, 0xC4, 0xC7, 0xAE } + }, + { + "NitroSDK 2.0 RC4 plus 3", + { 0x83, 0x1E, 0x93, 0x52, 0x58, 0x9A, 0xF5, 0x11, 0x62, 0x06, + 0x63, 0x7F, 0x79, 0x57, 0xDD, 0xB2, 0x24, 0x3B, 0x95, 0x33 } + }, +}; + +static const char *s_error_message[ DETECT_ERROR_MAX ] = +{ + "NOTHING", + "ERROR_FILE_CREATE", + "ERROR_FILE_OPEN", + "ERROR_FILE_WRITE", + "DETECT_ERROR_GAMECARD_REMOVED" +}; + +/* +static const char *s_pStrMenu[ MENU_ELEMENT_NUM ] = +{ + "AAA", + "BBB", + "CCC", + "DDD", + "EEE", +}; + +static MenuPos s_menuPos[] = { + { TRUE, 3, 6 }, + { TRUE, 3, 8 }, + { TRUE, 3, 10 }, + { TRUE, 3, 12 }, + { TRUE, 3, 14 }, +}; + +static const MenuParam s_menuParam = { + MENU_ELEMENT_NUM, + TXT_COLOR_BLACK, + TXT_COLOR_GREEN, + TXT_COLOR_RED, + &s_menuPos[ 0 ], + (const char **)&s_pStrMenu, +}; +*/ + +//****************************************************************************** +// SD抜け監視コールバック +//****************************************************************************** + +static void subCallBack( void* userdata, FSEvent event, void* argument ) +{ +#pragma unused( userdata, argument ) + + if( event == FS_EVENT_MEDIA_INSERTED ) + { + s_SDCheck = SDSTAT_INSERTED; //挿入 + s_protect_checked = FALSE; + } + else if( event == FS_EVENT_MEDIA_REMOVED ) + { + s_SDCheck = SDSTAT_REMOVED; //抜け + } +} + +static BOOL IsSDProtected( void ) +{ + FSPathInfo info; + if( TRUE == FS_GetPathInfo("sdmc:/", &info) ) + { + if( info.attributes & FS_ATTRIBUTE_IS_PROTECTED ) + { + return TRUE; + } + } + return FALSE; +} + +static FSResult IsSDExist( void ) +{ + FSPathInfo info; + if( TRUE == FS_GetPathInfo("sdmc:/", &info) ) + { + return FS_RESULT_SUCCESS; + }else + { + return FS_GetArchiveResultCode("sdmc:/"); + } +} + +// 活線挿抜からのパクり + +#define SLOT_STATUS_MODE_10 0x08 +#define REG_MC1_OFFSET 0x4010 +#define REG_MC1_ADDR (HW_REG_BASE + REG_MC1_OFFSET) +#define reg_MI_MC1 (*( REGType32v *) REG_MC1_ADDR) + +/*---------------------------------------------------------------------------* + Name: HOTSW_IsCardExist + + Description: SCFG_MC1のCDETフラグを見て、カードの存在判定を行う + *---------------------------------------------------------------------------*/ +static BOOL HOTSW_IsCardExist(void) +{ + if( !(reg_MI_MC1 & REG_MI_MC_SL1_CDET_MASK) ){ + return TRUE; + } + else{ + return FALSE; + } +} + +/*---------------------------------------------------------------------------* + Name: GetMcSlotMode + + Description: スロットの現在のモードを返す + *---------------------------------------------------------------------------*/ +static u32 GetMcSlotMode(void) +{ + return reg_MI_MC1 & REG_MI_MC_SL1_MODE_MASK; +} + +/*---------------------------------------------------------------------------* + Name: HOTSW_IsCardAccessible + + Description: SCFG_MC1のCDETフラグとM(モード)を見て、カードスロットにアクセスできる状態か判定する + *---------------------------------------------------------------------------*/ +static BOOL HOTSW_IsCardAccessible(void) +{ + if( HOTSW_IsCardExist() && (GetMcSlotMode() == SLOT_STATUS_MODE_10)){ + return TRUE; + } + else{ + return FALSE; + } +} + + + +//====================================================== +// ARM7コンポーネントに使われているSDKバージョンのチェックプログラム +//====================================================== + +// 描画まとめ +static void DrawMainScene( void ) +{ + // 共通描画処理 + myDp_Printf( 0, 0, TXT_COLOR_BLUE, MAIN_SCREEN, "DS Game Card To SD"); + + if( s_error != DETECT_ERROR_NONE ) + { + // エラー表示 + myDp_Printf( 1, 8, TXT_COLOR_RED, MAIN_SCREEN, "Error : %d", s_error); + myDp_Printf( 1, 9, TXT_COLOR_RED, MAIN_SCREEN, " %s", s_error_message[ s_error ]); + myDp_Printf( 1, 10, TXT_COLOR_RED, MAIN_SCREEN, "SDERROR%d", FS_GetArchiveResultCode("sdmc:/") ); + } + + // モードごとの描画処理 + switch( s_mode ) + { + case MODE_WRITABLE: + // ライト可モード + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Press A Button to start."); + myDp_Printf( 1, 4, TXT_COLOR_BLACK, MAIN_SCREEN, "GameCode : %c%c%c%c", sp_header->game_code[0],sp_header->game_code[1],sp_header->game_code[2],sp_header->game_code[3]); + if( s_complete ) + { + myDp_Printf( 1, 6, TXT_COLOR_BLUE, MAIN_SCREEN, "Complete."); + } + break; + case MODE_NOSD: + // SD カード見当たらないモード + if( ( s_SDCheck == SDSTAT_INSERTED ) && s_protected) + { + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "SD card is locked."); + myDp_Printf( 1, 4, TXT_COLOR_BLACK, MAIN_SCREEN, "Please insert unlocked SD card."); + }else + { + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Please insert SD card."); + } + break; + case MODE_WRITING: + { + // ライティングモード + int l; + static u8 count = 0; + static u8 count2 = 0; + static u8 cc = 0; + u64 prog = ( 30ULL * s_read_count ) / ROMSIZE_TO_BYTE( sp_header->rom_size ) ; + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Now writing%c%c%c%c", + ( (count%5>0) ? '.' : ' ' ), ( (count%5>1) ? '.' : ' ' ), ( (count%5>2) ? '.' : ' ' ), ( (count%5>3) ? '.' : ' ' ) ); + myDp_Printf( 1, 4, TXT_COLOR_BLACK, MAIN_SCREEN, "GameCode : %c%c%c%c", + sp_header->game_code[0],sp_header->game_code[1],sp_header->game_code[2],sp_header->game_code[3]); + myDp_Printf( 1, 6, TXT_COLOR_BLACK, MAIN_SCREEN, "------------------------------"); + for( l=0;l"); + } + cc++; + if(cc == 6) + { + cc = 0; + count++; + count2++; + if( count == 5 ) count = 0; + if( count2 == 48 ) count2 = 0; + } + } + break; + case MODE_WAITING_GAMECARD: + // カード待ちモード + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Please insert DS game card."); + break; + default: + break; + } +} + +#define SIZE_512K (512 * 1024) + +static void SaveCardToSD( void *arg ) +{ +#pragma unused( arg ) + void *p_buf; + void *old_lo; + FSFile dest; + char filename[64]; + RTCDate date; + RTCTime time; + + s32 lock_id = OS_GetLockID(); + + s_error = DETECT_ERROR_NONE; + s_complete = FALSE; + + CARD_Enable( TRUE ); + CARD_LockRom( (u16)lock_id ); + + // 読み込みバッファはアリーナLoからHiまでの間を適当に使ってアリーナLoを移動させよう + old_lo = OS_GetMainArenaLo(); + p_buf = (void *)( MATH_ROUNDUP32( (int)OS_GetMainArenaLo() ) ); + OS_SetMainArenaLo( (void *)((u32)p_buf + SIZE_512K ) ); // とりあえず1MBぐらい確保してみる + + // ヘッダのチェックはしないでとりあえず無視して読み込む + + // ROMの読み込み + // まずBootSegment4kbはすでに読み込まれているはずのヘッダを利用する + // HW_CARD_ROM_HEADER_SIZE(0x160)しか残ってないと思うので、とりあえずそれだけ。 + // 残りは0埋め。 + // その後読み込めない領域(KeyTable+Secure)が28KB。つまり0x7000ぶん。 + // 実際にカードから読み込むのは0x8000からとなる。 + // 実効サイズから0x8000引いておき、書き込み終了の目安とする + + // ファイル作成&オープン + + RTC_GetDateTime( &date, &time ); + STD_TSNPrintf( filename, 64, "sdmc:/%c%c%c%c_20%02d%02d%02d_%02d%02d%02d.srl.dmp", + sp_header->game_code[0],sp_header->game_code[1],sp_header->game_code[2],sp_header->game_code[3], + date.year, date.month, date.day, time.hour, time.minute, time.second ); + + FS_InitFile( &dest ); + if( !FS_CreateFile( filename, FS_PERMIT_W | FS_PERMIT_R) ) + { + s_error = DETECT_ERROR_FILE_CREATE; + return; + } + if( !FS_OpenFileEx( &dest, filename, FS_FILEMODE_W )) + { + BOOL read_ok = FALSE; + int retry_count = 0; + // なんか作成直後にオープンできない事があるのでリトライしてみる + while( FS_RESULT_NO_ENTRY == FS_GetArchiveResultCode("sdmc:/") ) + { + if( FS_OpenFileEx( &dest, filename, FS_FILEMODE_W ) ) + { + read_ok = TRUE; + break; + } + retry_count++; + if( retry_count > 100 ) break; + } + if( !read_ok ) + { + FS_CloseFile( &dest ); + s_error = DETECT_ERROR_FILE_OPEN; + return; + } + } + + s_read_count = 0; + + // 読み込んで書き出し + while( s_read_count < ROMSIZE_TO_BYTE( sp_header->rom_size ) ) + { + u32 remain = ROMSIZE_TO_BYTE( sp_header->rom_size ) - s_read_count; + u32 read_size = ( ( SIZE_512K < remain ) ? SIZE_512K : remain ); + + // 一応カード抜けたかのチェックをしておく + if( !( HOTSW_IsCardExist() && HOTSW_IsCardAccessible() ) ) + { + // 読み込める状態ではない + FS_CloseFile( &dest ); + s_error = DETECT_ERROR_GAMECARD_REMOVED; + return; + } + + CARD_ReadRom( MI_DMA_NOT_USE, (void *)s_read_count, p_buf, read_size ); + if( s_read_count == 0 ) + { + // 最初の一回だけ処理しなければならない領域 + MI_CpuClear32( p_buf, 0x8000 ); + MI_CpuCopy32( sp_header, p_buf, HW_CARD_ROM_HEADER_SIZE ); + } + if ( -1 == FS_WriteFile( &dest, (void *)p_buf, (s32)read_size ) ) + { + // 書き込み失敗 + FS_CloseFile( &dest ); + s_error = DETECT_ERROR_FILE_WRITE; + return; + } + + s_read_count += read_size; + } + + // ファイルクローズ + FS_CloseFile( &dest ); + + CARD_UnlockRom( (u16)lock_id ); + OS_ReleaseLockID( (u16)lock_id ); + + // もうバッファいらない + OS_SetMainArenaLo( old_lo ); + + s_error = DETECT_ERROR_NONE; + s_complete = TRUE; + return; +} + + +// 初期化 +void NitroGameCardToSDInit( void ) +{ + GX_DispOff(); + GXS_DispOff(); + + myDp_Printf( 0, 0, TXT_COLOR_BLUE, MAIN_SCREEN, "DS Game Card To SD"); + + GXS_SetVisiblePlane( GX_PLANEMASK_BG0 ); + + GX_DispOn(); + GXS_DispOn(); + + FS_Init(3); + RTC_Init(); + + // ここでおおまかにモードを切り替える。まずゲームカードを見る + if( HOTSW_IsCardExist() && HOTSW_IsCardAccessible() ) + { + // ゲームカードがあったら SD も見る + FSResult fsr = IsSDExist(); + s_protected = IsSDProtected(); + + if( fsr == FS_RESULT_SUCCESS ) + { + s_SDCheck = SDSTAT_INSERTED; + }else + { + s_SDCheck = SDSTAT_REMOVED; + } + + if( ( fsr == FS_RESULT_SUCCESS ) && !s_protected ) + { + // 書き込み準備万端 + s_mode = MODE_WRITABLE; + }else + { + // SD カードが無いかプロテクトされてる + s_mode = MODE_NOSD; + } + + // ここから SD カード挿抜を見はじめる + FS_RegisterEventHook("sdmc", &s_hook, subCallBack, NULL); + + }else + { + // ゲームカードがない + s_mode = MODE_WAITING_GAMECARD; + } + + + // 表示 + DrawMainScene(); + +} + +static BOOL IsGameCardRemovedAndChangeMode( void ) +{ + // ゲームカードが抜けたのを検出したらカード待ちモードへ + if( HOTSW_IsCardExist() == FALSE ) + { + s_mode = MODE_WAITING_GAMECARD; + // もうSDカード見る必要なし + FS_UnregisterEventHook( &s_hook ); + return TRUE; + } + return FALSE; +} + +static BOOL IsCardRemovedAndChangeMode( void ) +{ + // ゲームカード抜け検出とモードチェンジ + if( IsGameCardRemovedAndChangeMode() == TRUE ) + { + return TRUE; + } + + // SD カードが抜けたか、いきなりプロテクトがかかったら、 + // SD カード見当たらないモードへ + if( ( s_SDCheck == SDSTAT_REMOVED ) || s_protected ) + { + s_mode = MODE_NOSD; + return TRUE; + } + return FALSE; +} + +#define THREAD_PRIO 17 +#define STACK_SIZE 0x2000 +static OSThread readwrite_thread; +static u64 stack[ STACK_SIZE / sizeof(u64) ]; + +// メインループ +void NitroGameCardToSDMain(void) +{ + OSIntrMode intrmode; + // 再表示 + DrawMainScene(); + + + // SD カードが刺さったら一回だけプロテクトチェックする + // 再び刺さるまでチェックしない + + // 割り込み禁止 + intrmode = OS_DisableInterrupts(); + if( !s_protect_checked ) + { + s_protect_checked = TRUE; + // ここで割り込み禁止解除しないとかえってこなくなる + OS_RestoreInterrupts( intrmode ); + s_protected = IsSDProtected(); + }else + { + // こちらでも割り込み禁止解除 + OS_RestoreInterrupts( intrmode ); + } + + // モードごとのメイン処理(キー処理、モード遷移など) + switch( s_mode ) + { + case MODE_WRITABLE: + // ライト可モード + + // カード、SDカード抜け検出と共通モードチェンジ + if ( IsCardRemovedAndChangeMode() == TRUE ) + { + break; + } + + // キー入力があれば読み込みスレッド起動してライティングモードへ + if( gKeyWork.trigger == PAD_BUTTON_A ) + { + OS_CreateThread( &readwrite_thread, SaveCardToSD, NULL, stack+STACK_SIZE/sizeof(u64), STACK_SIZE, THREAD_PRIO ); + OS_WakeupThreadDirect( &readwrite_thread ); + s_mode = MODE_WRITING; + break; + } + + break; + case MODE_NOSD: + // SD カード見当たらないモード + + // ゲームカード抜け検出とモードチェンジ + if ( IsGameCardRemovedAndChangeMode() == TRUE ) + { + break; + } + + // SD カードが刺さったらライト可モードへ + // ただしプロテクトがかかってたら遷移しない + if( s_SDCheck == SDSTAT_INSERTED ) + { + if( !s_protected ) + { + s_mode = MODE_WRITABLE; + break; + } + } + + break; + case MODE_WRITING: + // ライティングモード + + // カード、SDカード抜け検出と共通モードチェンジ + if ( IsCardRemovedAndChangeMode() == TRUE ) + { + // とりあえず読み込みスレッド終了を待ってから終わる + // そうしないと読み込み用スレッド並立してしまう可能性 + while( !OS_IsThreadTerminated( &readwrite_thread ) ){} + break; + } + + // 読み込みスレッドが終了したらライト可モードへ + if( OS_IsThreadTerminated( &readwrite_thread ) ) + { + s_mode = MODE_WRITABLE; + s_read_count = 0; // 読み込みスレッド終わってからでないとかっこわるい + break; + } + + break; + case MODE_WAITING_GAMECARD: + // カード待ちモード + + // カードが刺さったのを検出したら再起動 + if( HOTSW_IsCardExist() == TRUE ) { + OS_DoApplicationJump( OS_GetTitleId(), OS_APP_JUMP_NORMAL ); + } + break; + default: + break; + } + +} + diff --git a/build/tools/CardToSD/src/NitroGameCardToSD.h b/build/tools/CardToSD/src/NitroGameCardToSD.h new file mode 100644 index 0000000..9ba87b8 --- /dev/null +++ b/build/tools/CardToSD/src/NitroGameCardToSD.h @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------* + Project: NitroGameCardToSD + File: NitroGameCardToSD.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef __NITROGAMECARDTOSD_H__ +#define __NITROGAMECARDTOSD_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include + +// define data---------------------------------------------------------- + +void NitroGameCardToSDInit( void ); +void NitroGameCardToSDMain( void ); + +#ifdef __cplusplus +} +#endif + +#endif // __NITROGAMECARDTOSD_H__ diff --git a/build/tools/CardToSD/src/data.c b/build/tools/CardToSD/src/data.c new file mode 100644 index 0000000..51fa2de --- /dev/null +++ b/build/tools/CardToSD/src/data.c @@ -0,0 +1,620 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos.TWL - nandApp - ExecPreLoadedApp + File: data.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 "data.h" + +/*---------------------- Palette Data ---------------------------*/ +const unsigned int d_64_256_bg_sclDT[8 * 16] = { + 0x0000ffff, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f001e, 0x001d001c, 0x001b001a, 0x00190018, // red + 0x00170016, 0x00150014, 0x00130012, 0x00110010, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x000f000e, 0x000d000c, 0x000b000a, 0x00090008, // dark red + 0x00070006, 0x00050004, 0x00030002, 0x00010000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; + +/*---------------------- Character Data -------------------------*/ +const unsigned int d_64_256_bg_schDT[8 * 256] = { + 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, + 0x00000100, 0x00001000, 0x00000010, 0x00000100, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000100, 0x00001010, 0x00001010, 0x00000100, // 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, +}; + +/*---------------------- Character Data2 -------------------------*/ +const unsigned int d_64_256_bg_schDT2[16 * 11] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, // 横 + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, // 縦 + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, // w + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // blk + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, // r + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, // g + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, // b + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, // y + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, // m + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, // c + 0x61616161, 0x61616161, 0x61616161, 0x61616161, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, +}; + +/* EOF */ diff --git a/build/tools/CardToSD/src/data.h b/build/tools/CardToSD/src/data.h new file mode 100644 index 0000000..6143c1f --- /dev/null +++ b/build/tools/CardToSD/src/data.h @@ -0,0 +1,29 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - GX - demos - UnitTours/2D_CharBg_1 + File: data.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef BG_DATA_H_ +#define BG_DATA_H_ + +#define SCREEN_SIZE (32 * 24) + +/*-------------------------- Data -------------------------------*/ +#define CHAR_SIZE (16 * 128 * sizeof(int)) +extern const unsigned int d_64_256_bg_schDT[8 * 256]; +extern const unsigned int d_64_256_bg_schDT2[16 * 11]; +extern const unsigned int d_64_256_bg_sclDT[8 * 16]; + +#endif diff --git a/build/tools/CardToSD/src/main.c b/build/tools/CardToSD/src/main.c new file mode 100644 index 0000000..c470328 --- /dev/null +++ b/build/tools/CardToSD/src/main.c @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------* + Project: NitroGameCardToSD + 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 +#include "misc_simple.h" +#include "NitroGameCardToSD.h" + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + +// function's prototype------------------------------------------------------- +static void INTR_VBlank( void ); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- +BOOL g_isValidTSD; + +// const data------------------------------------------------------------------ + + +// ============================================================================ +// function's description +// ============================================================================ +void TwlMain(void) +{ + myInit(); + + NitroGameCardToSDInit(); + // メインループ---------------------------- + while(1){ + + myPreMain(); + + NitroGameCardToSDMain(); + + myProMain(); + + OS_WaitIrq(1, OS_IE_V_BLANK); // Vブランク割り込み待ち + } +} + + +// ============================================================================ +// 割り込み処理 +// ============================================================================ + +// Vブランク割り込み +static void INTR_VBlank(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); // Vブランク割込チェックのセット +} + diff --git a/build/tools/CardToSD/src/misc_simple.c b/build/tools/CardToSD/src/misc_simple.c new file mode 100644 index 0000000..1565358 --- /dev/null +++ b/build/tools/CardToSD/src/misc_simple.c @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - nandApp - demos - launcher_param + File: misc_simple.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 +#include "misc_simple.h" +#include "data.h" + +// define data----------------------------------------------------------------- + + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + + +// function's prototype------------------------------------------------------- + + +// global variable------------------------------------------------------------- + + +// static variable------------------------------------------------------------- +static u16 sScrnBuf[2][SCREEN_SIZE]; // Buffer for screen data(BG #0) + +// const data------------------------------------------------------------------ + +void myInit( void ) +{ + //--------------------------------------------------------------------------- + // Initialize: + // They enable IRQ interrupts, initialize VRAM, and set BG #0 for text mode. + //--------------------------------------------------------------------------- + DEMOInitCommon(); + DEMOInitVRAM(); + DEMOInitDisplayBG0Only(); + DEMOInitDisplaySubBG0Only(); + + //--------------------------------------------------------------------------- + // Transmitting the character data and the palette data + //--------------------------------------------------------------------------- + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0x0800, GX_BG_CHARBASE_0x04000, GX_BG_EXTPLTT_01); + + GX_LoadBG0Char(d_64_256_bg_schDT, 0, sizeof(d_64_256_bg_schDT)); + GX_LoadBGPltt(d_64_256_bg_sclDT, 0, sizeof(d_64_256_bg_sclDT)); + + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0x1000, GX_BG_CHARBASE_0x08000, GX_BG_EXTPLTT_01); + + GXS_LoadBG0Char(d_64_256_bg_schDT, 0, sizeof(d_64_256_bg_schDT)); + GXS_LoadBGPltt(d_64_256_bg_sclDT, 0, sizeof(d_64_256_bg_sclDT)); + + GX_SetVisiblePlane(GX_PLANEMASK_BG0|GX_PLANEMASK_BG2); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0|GX_PLANEMASK_BG2); + + G2_SetBG0Priority(0); + G2S_SetBG0Priority(0); + + GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); + + DEMOStartDisplay(); +} + +void myPreMain( void ) +{ + // 描画前クリア処理。まぁどのシーンでも使うので。 + myDp_Cls16(MAIN_SCREEN); + myDp_Cls16(SUB_SCREEN); + + DEMOReadKey(); +} + +void myProMain( void ) +{ + // Store the data onto the main memory, and invalidate the cache. + // キャッシュONになってると、CPUとDMAの見てるメモリの値が違って、悲しい事が起きる + DC_FlushRange(sScrnBuf[0], sizeof(sScrnBuf[0])); + DC_FlushRange(sScrnBuf[1], sizeof(sScrnBuf[1])); + // 描画後フリップ処理。まぁどのシーンでも使うので。 + OS_WaitVBlankIntr(); // Waiting the end of VBlank interrupt + GX_LoadBG0Scr(sScrnBuf[0], 0, sizeof(sScrnBuf[0])); + GXS_LoadBG0Scr(sScrnBuf[1], 0, sizeof(sScrnBuf[1])); +} + +void myDp_Cls16(MyScreen scr) +{ + if( !(scr < SCREEN_MAX) ) return; + MI_CpuClear8((void *)sScrnBuf[scr],SCREEN_SIZE * sizeof(u16)); +} + +void myDp_Cls8(MyScreen scr) +{ + if( !(scr < SCREEN_MAX) ) return; + MI_CpuClear8((void *)sScrnBuf[scr],SCREEN_SIZE * sizeof(u8)); +} + +void myDp_Putchar(s32 x, s32 y, u8 color, MyScreen scr, u8 c) +{ + if( !(scr < SCREEN_MAX) ) return; + sScrnBuf[scr][(y * 32) + x] = (u16)((color << 12) | c); +} + +void myDp_Write(s32 x, s32 y, u8 color, MyScreen scr, char* str) +{ + while (*str) { + while (x >= 32) { + x -= 32; + y++; + } + while (y >= 24) { + return; // out of range + } + myDp_Putchar(x, y, color, scr, (u8)*str++); + x++; + } +} + +void myDp_Printf(s32 x, s32 y, u8 color, MyScreen scr, const char *s, ...) +{ + va_list vlist; + char temp[SCREEN_SIZE+1]; + temp[sizeof(temp)-1] = 0; + va_start(vlist, s); + vsnprintf(temp, sizeof(temp) - 1, s, vlist); + va_end(vlist); + myDp_Write(x, y, color, scr, temp); +} + +void myDp_DrawMenu( u16 csr, MyScreen scr, const MenuParam *param ) +{ + int l; + for( l=0; lnum; l++) + { + myDp_Printf( param->pos[l].x, param->pos[l].y, + (u8)( param->pos[l].enable ? ( l==csr ? param->select_color : param->normal_color ) : param->disable_color ), + scr, ( l==csr ? "=>%s" : " %s" ), param->str_elem[l] ); + } +} \ No newline at end of file diff --git a/build/tools/CardToSD/src/misc_simple.h b/build/tools/CardToSD/src/misc_simple.h new file mode 100644 index 0000000..a316a63 --- /dev/null +++ b/build/tools/CardToSD/src/misc_simple.h @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - nandApp - demos - launcher_param + File: misc_simple.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef __MISC_SIMPLE_H__ +#define __MISC_SIMPLE_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// define data---------------------------------------------------------- + +#define MYPAD_IS_TRIG DEMO_IS_TRIG +#define MYPAD_IS_PRESS DEMO_IS_PRESS + +// TXTColorPalette の色名 256色パレットへのロードを想定 +enum +{ + TXT_COLOR_BLACK=0, + TXT_COLOR_RED, + TXT_COLOR_GREEN, + TXT_COLOR_BLUE, + TXT_COLOR_YELLOW, + TXT_COLOR_PURPLE, + TXT_COLOR_LIGHTBLUE, + TXT_COLOR_DARKRED, + TXT_COLOR_DARKGREEN, + TXT_COLOR_DARKBLUE, + TXT_COLOR_DARKYELLOW, + TXT_COLOR_DARKPURPLE, + TXT_COLOR_DARKLIGHTBLUE, + TXT_COLOR_GRAY, + TXT_COLOR_DARKGRAY, + TXT_COLOR_WHITE +}; + +typedef enum +{ + MAIN_SCREEN = 0, + SUB_SCREEN, + SCREEN_MAX +} +MyScreen; + +// メニュー要素座標 +typedef struct MenuPos { + BOOL enable; + int x; + int y; +}MenuPos; + +// メニュー構成パラメータ構造体 +typedef struct MenuParam { + int num; + int normal_color; + int select_color; + int disable_color; + MenuPos *pos; + const char **str_elem; +}MenuParam; + +// global variables-------------------------------------------------- + +// function------------------------------------------------------------- +void myInit( void ); +void myPreMain( void ); +void myProMain( void ); + +void myDp_Cls16(MyScreen scr); +void myDp_Cls8(MyScreen scr); +void myDp_Putchar(s32 x, s32 y, u8 color, MyScreen scr, u8 c); +void myDp_Write(s32 x, s32 y, u8 color, MyScreen scr, char* str); +void myDp_Printf(s32 x, s32 y, u8 color, MyScreen scr, const char *s, ...); +void myDp_DrawMenu( u16 csr, MyScreen scr, const MenuParam *param ); + +#ifdef __cplusplus +} +#endif + +#endif // __MISC_H__ diff --git a/build/tools/NitroArm7VerChecker/AutoBuild.pl b/build/tools/NitroArm7VerChecker/AutoBuild.pl new file mode 100755 index 0000000..f3d7f66 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/AutoBuild.pl @@ -0,0 +1,13 @@ +#!/bin/perl + +if( @ARGV[0] !~ /^[0-9]+$/ || @ARGV[1] !~ /^[0-9]+$/ || @ARGV[0] > @ARGV[1] ) +{ + print STDOUT "Usage : AutoBuild.pl start end [BUILDOPTIONS...] \n"; + print STDOUT " start, end - positive number. must be ( start <= end ) \n"; + exit 1; +} + +foreach $number(@ARGV[0]..@ARGV[1]) +{ + system "make ID_NUMBER=$number @ARGV[2..$#ARGV]"; +} \ No newline at end of file diff --git a/build/tools/NitroArm7VerChecker/Makefile b/build/tools/NitroArm7VerChecker/Makefile new file mode 100644 index 0000000..6bdd9e7 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/Makefile @@ -0,0 +1,72 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - demos.TWL - nandApp - appliCooperation - cooperationA +# 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$ +#---------------------------------------------------------------------------- + +SUBDIRS = banner + +#------------------------- +#-- NAND アプリのビルドを指定します。 + +TWL_NANDAPP = TRUE + + +#---------------------------------------------------------------------------- + +ID_NUMBER ?= 0 + +GAME_CODE = 0VIA + +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED + +SRCS = main.c NitroArm7VerChecker.c \ + misc_simple.c \ + data.c + +LIBSYSCALL = header/libsyscall.a + +TARGET_BIN = ComponentSDKVersionIdentifier_$(ID_NUMBER).tad +BINDIR = ./bin/$(TWL_BUILDTYPE)/$(ID_NUMBER) + + +#------------------------- +#-- NAND アプリではいくつかのパラメータの指定のために固有の RSF ファイルが必要です。 + +ROM_SPEC = demo.autogen.rsf +ROM_SPEC_TEMPLATE = ROM-TS_nand_alt.rsf +ROM_SPEC_PARAM = MakerCode=01 \ + GameCode=$(GAME_CODE) \ + BannerFile="banner/banner.bnr" \ + PermitLandingNormalJump=TRUE \ + TitleName="CSDKVERIDER" + + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +include $(TWLSDK_ROOT)/build/buildtools/commondefs.gx.demolib + +#---------------------------------------------------------------------------- + +do-build : include/revision.h $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +include/revision.h :: + echo "#define ID_NUM "$(ID_NUMBER) > $@ + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== diff --git a/build/tools/NitroArm7VerChecker/ROM-TS_nand_alt.rsf b/build/tools/NitroArm7VerChecker/ROM-TS_nand_alt.rsf new file mode 100644 index 0000000..489e098 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/ROM-TS_nand_alt.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + #TitleName "MY APP NAME" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + #MakerCode "00" + + # + # REMASTER VERSION: Mastering version + # + #RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./header/rom_header_0via.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingNormalJump FALSE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + #GameCode ABCJ + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + GameCardOn TRUE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + GameCardNitroMode TRUE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/tools/NitroArm7VerChecker/banner/Makefile b/build/tools/NitroArm7VerChecker/banner/Makefile new file mode 100644 index 0000000..19d3159 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/banner/Makefile @@ -0,0 +1,49 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - nandApp - demos - launcher_param - AppliCooperation +# 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$ +#---------------------------------------------------------------------------- +TARGET_PLATFORM = TWL + +include $(TWLSDK_ROOT)/build/buildtools/commondefs +MAKEBANNER = $(TWL_TOOLSDIR)/bin/makebanner.TWL.exe + +ICON_DIR = ./icon + +BANNER_ICON = $(ICON_DIR)/gameIcon.bmp +BANNER_SPEC = banner_v3.bsf + +TARGETS = banner.bnr +INSTALL_DIR = ./ +INSTALL_TARGETS = $(TARGETS) + +BANNER_ICON_NAME = $(basename $(BANNER_ICON)) +BANNER_ICON_MIDDLE = $(addprefix $(BANNER_ICON_NAME), .nbfs .nbfc .nbfp) + +LDIRT_CLEAN = $(TARGETS) \ + $(BANNER_ICON_MIDDLE) \ + $(TARGETS:.bnr=.srl) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- +# build +#---------------------------------------------------------------------------- +do-build: $(TARGETS) + +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE) + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) + +# diff --git a/build/tools/NitroArm7VerChecker/banner/banner_v3.bsf b/build/tools/NitroArm7VerChecker/banner/banner_v3.bsf new file mode 100644 index 0000000..a2a39be Binary files /dev/null and b/build/tools/NitroArm7VerChecker/banner/banner_v3.bsf differ diff --git a/build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp b/build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp new file mode 100644 index 0000000..bea78bf Binary files /dev/null and b/build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp differ diff --git a/build/tools/NitroArm7VerChecker/demo.autogen.rsf b/build/tools/NitroArm7VerChecker/demo.autogen.rsf new file mode 100644 index 0000000..f546af1 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/demo.autogen.rsf @@ -0,0 +1,243 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- +# +# TWL ROM SPEC FILE +# + +Arm9 +{ + Static "$(MAKEROM_ARM9:r).TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.FLX.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.FLX.sbin$(COMPSUFFIX9)" + Elf "$(MAKEROM_ARM9:r).tef" +} + +Arm7 +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.FLX.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.FLX.sbin$(COMPSUFFIX7)" + Elf "$(MAKEROM_ARM7_BASE:r).tef" +} + +Arm9.Ltd +{ + Static "$(MAKEROM_ARM9:r).TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayDefs "$(MAKEROM_ARM9:r)_defs.TWL.LTD.sbin$(COMPSUFFIX9)" + OverlayTable "$(MAKEROM_ARM9:r)_table.TWL.LTD.sbin$(COMPSUFFIX9)" +} + +Arm7.Ltd +{ + Static "$(MAKEROM_ARM7_BASE:r).TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayDefs "$(MAKEROM_ARM7_BASE:r)_defs.TWL.LTD.sbin$(COMPSUFFIX7)" + OverlayTable "$(MAKEROM_ARM7_BASE:r)_table.TWL.LTD.sbin$(COMPSUFFIX7)" +} + +Property +{ + ### + ### Settings for FinalROM + ### + #### BEGIN + # + # TITLE NAME: Your product name within 12bytes + # + TitleName CSDKVERIDER + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode 01 + + # + # REMASTER VERSION: Mastering version + # + #RomVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G/4G] + # + #RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./header/rom_header_0via.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile "banner/banner.bnr" + + # + # Permit LandingNormalJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + PermitLandingNormalJump TRUE + + # + # Permit LandingTmpJump: for TWL "ApplicationJump" function [TRUE/FALSE] + # + #PermitLandingTmpJump FALSE + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: Provided to every product by NINTENDO + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP_BB_HYB/MAP_BB_LTD/MAP_TS_HYB/MAP_TS_LTD + # MAP2_BB_HYB/MAP2_BB_LTD/MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia/China/Korea] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + # + # Agree EULA [TRUE/FALSE] + # + #AgreeEULA FALSE + + # + # Agree EULA version [1 - 255] + # + #AgreeEULAVersion 1 + + ### + #### END +} + +AppendProperty +{ + # + # Boot allowed Media: [GameCard] + # + Media NAND + + # + # GameCode for TitleID : Your GameCode in 4 ascii words + # + GameCode 0VIA + + # + # Public save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PublicSaveDataSize 0K + + # + # Private save data size: [0K/16K/32K/64K/128K/256K/512K/1M/2M/4M] + # + #PrivateSaveDataSize 0K + + # + # Enable SubBannerFile + #SubBannerFile TRUE + + # + # Game card power on: [TRUE/FALSE] + # + GameCardOn TRUE + + # + # Game card transferd to nitro mode: [TRUE/FALSE] + # + GameCardNitroMode TRUE +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} + +Rating +{ + # + # Permited age to play for each rating organization + # + # Supported organization + # - CERO (OGN0) : for Japan + # - ESRB (OGN1) : for North America + # - BBFC (OGN2) : obsolete organization + # - USK (OGN3) : for German + # - PEGI_GEN (OGN4) : for Europe + # - PEGI_FINLAND (OGN5) : obsolete organization + # - PEGI_PRT (OGN6) : for Portugal + # - PEGI_BBFC (OGN7) : for UK + # - OFLC (OGN8) : for Australia and NewZealand + # - GRB (OGN9) : for Korea + # - OGN10 : reserved + # - OGN11 : reserved + # - OGN12 : reserved + # - OGN13 : reserved + # - OGN14 : reserved + # - OGN15 : reserved + # + # Available age [ 0 - 31 / PENDING / FREE ] + + CERO FREE +# ESRB FREE +# USK FREE +# PEGI_GEN FREE +# PEGI_PRT FREE +# PEGI_BBFC FREE +# OFLC FREE +# GRB FREE +} diff --git a/build/tools/NitroArm7VerChecker/header/rom_header_0via.template.sbin b/build/tools/NitroArm7VerChecker/header/rom_header_0via.template.sbin new file mode 100644 index 0000000..7c9dccb Binary files /dev/null and b/build/tools/NitroArm7VerChecker/header/rom_header_0via.template.sbin differ diff --git a/build/tools/NitroArm7VerChecker/include/revision.h b/build/tools/NitroArm7VerChecker/include/revision.h new file mode 100644 index 0000000..e31646b --- /dev/null +++ b/build/tools/NitroArm7VerChecker/include/revision.h @@ -0,0 +1 @@ +#define ID_NUM 5 diff --git a/build/tools/NitroArm7VerChecker/src/NitroArm7VerChecker.c b/build/tools/NitroArm7VerChecker/src/NitroArm7VerChecker.c new file mode 100644 index 0000000..b0e0429 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/NitroArm7VerChecker.c @@ -0,0 +1,351 @@ +/*---------------------------------------------------------------------------* + Project: NitroArm7VerChecker + File: CooperationA.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 +#include +#include +#include "misc_simple.h" +#include "NitroArm7VerChecker.h" +#include "revision.h" + +// define data------------------------------------------ + +//#define MENU_ELEMENT_NUM 5 // メニューの項目数 + +#define ARM7_INFO_NUM 4 + +typedef struct Arm7Info +{ + char name[32]; + unsigned char hash[MATH_SHA1_DIGEST_SIZE]; +} +Arm7Info; + +typedef enum DetectError +{ + DETECT_ERROR_NONE = 0, + DETECT_ERROR_ARM7FLX_SIZE_OVER = 1, + DETECT_ERROR_ARM7FLX_SIZE_ZERO = 2, + DETECT_ERROR_NO_HIT = 3, + DETECT_ERROR_MAX +} +DetectError; + +// extern data------------------------------------------ + +// function's prototype declaration--------------------- + +static void MenuScene( void ); + +// global variable ------------------------------------- + +// static variable ------------------------------------- + +static char s_mode = 0; +static BOOL s_secret = FALSE; +static u8 s_error = 0; +static u8 s_digest[MATH_SHA1_DIGEST_SIZE]; +static u8 s_hit = 0; + +// const data ----------------------------------------- + +static const ROM_Header_Short *sp_header = (ROM_Header_Short *)HW_CARD_ROM_HEADER; +static const Arm7Info s_info[ ARM7_INFO_NUM ] = +{ + { + "NitroSDK 2.2 RELEASE plus 3", + { 0xB4, 0x6C, 0xD3, 0x35, 0x5D, 0xB1, 0x6E, 0xC9, 0xEC, 0x5F, + 0xC4, 0x82, 0x23, 0x23, 0xA1, 0x90, 0xD9, 0x8D, 0xBA, 0xC4 } + }, + { + "NitroSDK 4.0 RELEASE plus 1", + { 0x77, 0xA5, 0xC0, 0x89, 0x83, 0x66, 0xC1, 0x0D, 0x0A, 0x3B, + 0x31, 0xA0, 0x63, 0xE6, 0xF5, 0x4F, 0xED, 0xC4, 0xC7, 0xAE } + }, + { + "NitroSDK 2.0 RC4 plus 3", + { 0x83, 0x1E, 0x93, 0x52, 0x58, 0x9A, 0xF5, 0x11, 0x62, 0x06, + 0x63, 0x7F, 0x79, 0x57, 0xDD, 0xB2, 0x24, 0x3B, 0x95, 0x33 } + }, + { + "NitroSDK 4.2 RELEASE plus 1", + { 0x82, 0x7d, 0xa0, 0x82, 0xd0, 0x56, 0xb3, 0x5a, 0x57, 0x19, + 0xca, 0xea, 0x1b, 0xd4, 0xa2, 0xda, 0x3e, 0xdc, 0xab, 0xbc } + }, +}; + +/* +static const char *s_pStrMenu[ MENU_ELEMENT_NUM ] = +{ + "AAA", + "BBB", + "CCC", + "DDD", + "EEE", +}; + +static MenuPos s_menuPos[] = { + { TRUE, 3, 6 }, + { TRUE, 3, 8 }, + { TRUE, 3, 10 }, + { TRUE, 3, 12 }, + { TRUE, 3, 14 }, +}; + +static const MenuParam s_menuParam = { + MENU_ELEMENT_NUM, + TXT_COLOR_BLACK, + TXT_COLOR_GREEN, + TXT_COLOR_RED, + &s_menuPos[ 0 ], + (const char **)&s_pStrMenu, +}; +*/ + +// 活線挿抜からのパクり + +#define SLOT_STATUS_MODE_10 0x08 +#define REG_MC1_OFFSET 0x4010 +#define REG_MC1_ADDR (HW_REG_BASE + REG_MC1_OFFSET) +#define reg_MI_MC1 (*( REGType32v *) REG_MC1_ADDR) + +/*---------------------------------------------------------------------------* + Name: HOTSW_IsCardExist + + Description: SCFG_MC1のCDETフラグを見て、カードの存在判定を行う + *---------------------------------------------------------------------------*/ +static BOOL HOTSW_IsCardExist(void) +{ + if( !(reg_MI_MC1 & REG_MI_MC_SL1_CDET_MASK) ){ + return TRUE; + } + else{ + return FALSE; + } +} + +/*---------------------------------------------------------------------------* + Name: GetMcSlotMode + + Description: スロットの現在のモードを返す + *---------------------------------------------------------------------------*/ +static u32 GetMcSlotMode(void) +{ + return reg_MI_MC1 & REG_MI_MC_SL1_MODE_MASK; +} + +/*---------------------------------------------------------------------------* + Name: HOTSW_IsCardAccessible + + Description: SCFG_MC1のCDETフラグとM(モード)を見て、カードスロットにアクセスできる状態か判定する + *---------------------------------------------------------------------------*/ +static BOOL HOTSW_IsCardAccessible(void) +{ + if( HOTSW_IsCardExist() && (GetMcSlotMode() == SLOT_STATUS_MODE_10)){ + return TRUE; + } + else{ + return FALSE; + } +} + + + +//====================================================== +// ARM7コンポーネントに使われているSDKバージョンのチェックプログラム +//====================================================== + +// 描画まとめ +static void DrawMainScene( void ) +{ + //int l; + myDp_Printf( 0, 0, TXT_COLOR_BLUE, MAIN_SCREEN, "Component SDK Version Identifier"); + + if( s_mode == 0 ) + { + // 結果表示モード + if( s_error != DETECT_ERROR_NONE ) + { + // エラー表示 + myDp_Printf( 1, 3, TXT_COLOR_RED, MAIN_SCREEN, "Registered ARM7 component"); + myDp_Printf( 1, 4, TXT_COLOR_RED, MAIN_SCREEN, "was not detected."); + myDp_Printf( 1, 6, TXT_COLOR_RED, MAIN_SCREEN, "Error : %d", s_error); + }else + { + // 通常結果表示 + myDp_Printf( 1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Registered ARM7 component"); + myDp_Printf( 1, 4, TXT_COLOR_BLACK, MAIN_SCREEN, "was detected."); + myDp_Printf( 1, 6, TXT_COLOR_BLACK, MAIN_SCREEN, "Same as"); + myDp_Printf( 1, 7, TXT_COLOR_BLUE, MAIN_SCREEN, "%s", s_info[s_hit].name); + myDp_Printf( 1, 9, TXT_COLOR_BLUE, MAIN_SCREEN, "GameCode : %c%c%c%c", sp_header->game_code[0],sp_header->game_code[1],sp_header->game_code[2],sp_header->game_code[3]); + /* + myDp_Printf( 1, 10, TXT_COLOR_BLUE, MAIN_SCREEN, "Arm7FLXDigest :"); + for(l=0;lsub_size > BOOTABLE_SIZE_ARM7 ) + { + // エラー + s_error = DETECT_ERROR_ARM7FLX_SIZE_OVER; + return; + }else if ( sp_header->sub_size == 0 ) + { + s_error = DETECT_ERROR_ARM7FLX_SIZE_ZERO; + return; + } + + OS_SetMainArenaLo( (void *)((u32)sp_arm7flx + sp_header->sub_size) ); // アリーナLo修正 + + CARD_ReadRom( MI_DMA_NOT_USE, (void *)sp_header->sub_rom_offset, sp_arm7flx, sp_header->sub_size ); + + CARD_UnlockRom( 0x03 ); + + // Arm7FLX のハッシュ計算 + MATH_CalcSHA1( s_digest, sp_arm7flx, sp_header->sub_size ); + + // 該当する SDK を検索 + for( s_hit=0;s_hit + +// define data---------------------------------------------------------- + +void NitroArm7VerCheckerInit( void ); +void NitroArm7VerCheckerMain( void ); + +#ifdef __cplusplus +} +#endif + +#endif // __NITROARM7VERCHECKER_H__ diff --git a/build/tools/NitroArm7VerChecker/src/data.c b/build/tools/NitroArm7VerChecker/src/data.c new file mode 100644 index 0000000..51fa2de --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/data.c @@ -0,0 +1,620 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - demos.TWL - nandApp - ExecPreLoadedApp + File: data.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 "data.h" + +/*---------------------- Palette Data ---------------------------*/ +const unsigned int d_64_256_bg_sclDT[8 * 16] = { + 0x0000ffff, 0x00000000, 0x00000000, 0x00000000, // black + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001f001e, 0x001d001c, 0x001b001a, 0x00190018, // red + 0x00170016, 0x00150014, 0x00130012, 0x00110010, + 0x03e00000, 0x00000000, 0x00000000, 0x00000000, // green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c000000, 0x00000000, 0x00000000, 0x00000000, // blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03ff0000, 0x00000000, 0x00000000, 0x00000000, // yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7c1f0000, 0x00000000, 0x00000000, 0x00000000, // purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fe00000, 0x00000000, 0x00000000, 0x00000000, // light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x000f000e, 0x000d000c, 0x000b000a, 0x00090008, // dark red + 0x00070006, 0x00050004, 0x00030002, 0x00010000, + 0x03000000, 0x00000000, 0x00000000, 0x00000000, // dark green + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60000000, 0x00000000, 0x00000000, 0x00000000, // dark blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x03180000, 0x00000000, 0x00000000, 0x00000000, // dark yellow + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x60180000, 0x00000000, 0x00000000, 0x00000000, // dark purple + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x63000000, 0x00000000, 0x00000000, 0x00000000, // dark light blue + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x56b50000, 0x00000000, 0x00000000, 0x00000000, // gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x2d6b0000, 0x00000000, 0x00000000, 0x00000000, // dark gray + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7fff0000, 0x00000000, 0x00000000, 0x00000000, // white + 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; + +/*---------------------- Character Data -------------------------*/ +const unsigned int d_64_256_bg_schDT[8 * 256] = { + 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, + 0x00000100, 0x00001000, 0x00000010, 0x00000100, // 00deh + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000100, 0x00001010, 0x00001010, 0x00000100, // 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, +}; + +/*---------------------- Character Data2 -------------------------*/ +const unsigned int d_64_256_bg_schDT2[16 * 11] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 0000h + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, // 横 + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf1f1f1f1, 0xf1f1f1f1, 0x00000000, 0x00000000, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, // 縦 + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf100f100, 0xf100f100, 0xf100f100, 0xf100f100, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, // w + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, 0xf1f1f1f1, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, // blk + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, // r + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x11111111, 0x11111111, 0x11111111, 0x11111111, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, // g + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x21212121, 0x21212121, 0x21212121, 0x21212121, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, // b + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x31313131, 0x31313131, 0x31313131, 0x31313131, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, // y + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x41414141, 0x41414141, 0x41414141, 0x41414141, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, // m + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x51515151, 0x51515151, 0x51515151, 0x51515151, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, // c + 0x61616161, 0x61616161, 0x61616161, 0x61616161, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, + 0x61616161, 0x61616161, 0x61616161, 0x61616161, +}; + +/* EOF */ diff --git a/build/tools/NitroArm7VerChecker/src/data.h b/build/tools/NitroArm7VerChecker/src/data.h new file mode 100644 index 0000000..6143c1f --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/data.h @@ -0,0 +1,29 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - GX - demos - UnitTours/2D_CharBg_1 + File: data.h + + Copyright 2003 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$ + *---------------------------------------------------------------------------*/ + +#ifndef BG_DATA_H_ +#define BG_DATA_H_ + +#define SCREEN_SIZE (32 * 24) + +/*-------------------------- Data -------------------------------*/ +#define CHAR_SIZE (16 * 128 * sizeof(int)) +extern const unsigned int d_64_256_bg_schDT[8 * 256]; +extern const unsigned int d_64_256_bg_schDT2[16 * 11]; +extern const unsigned int d_64_256_bg_sclDT[8 * 16]; + +#endif diff --git a/build/tools/NitroArm7VerChecker/src/main.c b/build/tools/NitroArm7VerChecker/src/main.c new file mode 100644 index 0000000..f6ec7b1 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/main.c @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------* + Project: NitroArm7VerChecker + 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 +#include "misc_simple.h" +#include "NitroArm7VerChecker.h" + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + +// function's prototype------------------------------------------------------- +static void INTR_VBlank( void ); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- +BOOL g_isValidTSD; + +// const data------------------------------------------------------------------ + + +// ============================================================================ +// function's description +// ============================================================================ +void TwlMain(void) +{ + myInit(); + + NitroArm7VerCheckerInit(); + // メインループ---------------------------- + while(1){ + + myPreMain(); + + NitroArm7VerCheckerMain(); + + myProMain(); + + OS_WaitIrq(1, OS_IE_V_BLANK); // Vブランク割り込み待ち + } +} + + +// ============================================================================ +// 割り込み処理 +// ============================================================================ + +// Vブランク割り込み +static void INTR_VBlank(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); // Vブランク割込チェックのセット +} + diff --git a/build/tools/NitroArm7VerChecker/src/misc_simple.c b/build/tools/NitroArm7VerChecker/src/misc_simple.c new file mode 100644 index 0000000..1565358 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/misc_simple.c @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - nandApp - demos - launcher_param + File: misc_simple.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 +#include "misc_simple.h" +#include "data.h" + +// define data----------------------------------------------------------------- + + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + + +// function's prototype------------------------------------------------------- + + +// global variable------------------------------------------------------------- + + +// static variable------------------------------------------------------------- +static u16 sScrnBuf[2][SCREEN_SIZE]; // Buffer for screen data(BG #0) + +// const data------------------------------------------------------------------ + +void myInit( void ) +{ + //--------------------------------------------------------------------------- + // Initialize: + // They enable IRQ interrupts, initialize VRAM, and set BG #0 for text mode. + //--------------------------------------------------------------------------- + DEMOInitCommon(); + DEMOInitVRAM(); + DEMOInitDisplayBG0Only(); + DEMOInitDisplaySubBG0Only(); + + //--------------------------------------------------------------------------- + // Transmitting the character data and the palette data + //--------------------------------------------------------------------------- + G2_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0x0800, GX_BG_CHARBASE_0x04000, GX_BG_EXTPLTT_01); + + GX_LoadBG0Char(d_64_256_bg_schDT, 0, sizeof(d_64_256_bg_schDT)); + GX_LoadBGPltt(d_64_256_bg_sclDT, 0, sizeof(d_64_256_bg_sclDT)); + + G2S_SetBG0Control(GX_BG_SCRSIZE_TEXT_256x256, + GX_BG_COLORMODE_16, + GX_BG_SCRBASE_0x1000, GX_BG_CHARBASE_0x08000, GX_BG_EXTPLTT_01); + + GXS_LoadBG0Char(d_64_256_bg_schDT, 0, sizeof(d_64_256_bg_schDT)); + GXS_LoadBGPltt(d_64_256_bg_sclDT, 0, sizeof(d_64_256_bg_sclDT)); + + GX_SetVisiblePlane(GX_PLANEMASK_BG0|GX_PLANEMASK_BG2); + GXS_SetVisiblePlane(GX_PLANEMASK_BG0|GX_PLANEMASK_BG2); + + G2_SetBG0Priority(0); + G2S_SetBG0Priority(0); + + GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); + + DEMOStartDisplay(); +} + +void myPreMain( void ) +{ + // 描画前クリア処理。まぁどのシーンでも使うので。 + myDp_Cls16(MAIN_SCREEN); + myDp_Cls16(SUB_SCREEN); + + DEMOReadKey(); +} + +void myProMain( void ) +{ + // Store the data onto the main memory, and invalidate the cache. + // キャッシュONになってると、CPUとDMAの見てるメモリの値が違って、悲しい事が起きる + DC_FlushRange(sScrnBuf[0], sizeof(sScrnBuf[0])); + DC_FlushRange(sScrnBuf[1], sizeof(sScrnBuf[1])); + // 描画後フリップ処理。まぁどのシーンでも使うので。 + OS_WaitVBlankIntr(); // Waiting the end of VBlank interrupt + GX_LoadBG0Scr(sScrnBuf[0], 0, sizeof(sScrnBuf[0])); + GXS_LoadBG0Scr(sScrnBuf[1], 0, sizeof(sScrnBuf[1])); +} + +void myDp_Cls16(MyScreen scr) +{ + if( !(scr < SCREEN_MAX) ) return; + MI_CpuClear8((void *)sScrnBuf[scr],SCREEN_SIZE * sizeof(u16)); +} + +void myDp_Cls8(MyScreen scr) +{ + if( !(scr < SCREEN_MAX) ) return; + MI_CpuClear8((void *)sScrnBuf[scr],SCREEN_SIZE * sizeof(u8)); +} + +void myDp_Putchar(s32 x, s32 y, u8 color, MyScreen scr, u8 c) +{ + if( !(scr < SCREEN_MAX) ) return; + sScrnBuf[scr][(y * 32) + x] = (u16)((color << 12) | c); +} + +void myDp_Write(s32 x, s32 y, u8 color, MyScreen scr, char* str) +{ + while (*str) { + while (x >= 32) { + x -= 32; + y++; + } + while (y >= 24) { + return; // out of range + } + myDp_Putchar(x, y, color, scr, (u8)*str++); + x++; + } +} + +void myDp_Printf(s32 x, s32 y, u8 color, MyScreen scr, const char *s, ...) +{ + va_list vlist; + char temp[SCREEN_SIZE+1]; + temp[sizeof(temp)-1] = 0; + va_start(vlist, s); + vsnprintf(temp, sizeof(temp) - 1, s, vlist); + va_end(vlist); + myDp_Write(x, y, color, scr, temp); +} + +void myDp_DrawMenu( u16 csr, MyScreen scr, const MenuParam *param ) +{ + int l; + for( l=0; lnum; l++) + { + myDp_Printf( param->pos[l].x, param->pos[l].y, + (u8)( param->pos[l].enable ? ( l==csr ? param->select_color : param->normal_color ) : param->disable_color ), + scr, ( l==csr ? "=>%s" : " %s" ), param->str_elem[l] ); + } +} \ No newline at end of file diff --git a/build/tools/NitroArm7VerChecker/src/misc_simple.h b/build/tools/NitroArm7VerChecker/src/misc_simple.h new file mode 100644 index 0000000..a316a63 --- /dev/null +++ b/build/tools/NitroArm7VerChecker/src/misc_simple.h @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - nandApp - demos - launcher_param + File: misc_simple.h + + 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$ + *---------------------------------------------------------------------------*/ + +#ifndef __MISC_SIMPLE_H__ +#define __MISC_SIMPLE_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// define data---------------------------------------------------------- + +#define MYPAD_IS_TRIG DEMO_IS_TRIG +#define MYPAD_IS_PRESS DEMO_IS_PRESS + +// TXTColorPalette の色名 256色パレットへのロードを想定 +enum +{ + TXT_COLOR_BLACK=0, + TXT_COLOR_RED, + TXT_COLOR_GREEN, + TXT_COLOR_BLUE, + TXT_COLOR_YELLOW, + TXT_COLOR_PURPLE, + TXT_COLOR_LIGHTBLUE, + TXT_COLOR_DARKRED, + TXT_COLOR_DARKGREEN, + TXT_COLOR_DARKBLUE, + TXT_COLOR_DARKYELLOW, + TXT_COLOR_DARKPURPLE, + TXT_COLOR_DARKLIGHTBLUE, + TXT_COLOR_GRAY, + TXT_COLOR_DARKGRAY, + TXT_COLOR_WHITE +}; + +typedef enum +{ + MAIN_SCREEN = 0, + SUB_SCREEN, + SCREEN_MAX +} +MyScreen; + +// メニュー要素座標 +typedef struct MenuPos { + BOOL enable; + int x; + int y; +}MenuPos; + +// メニュー構成パラメータ構造体 +typedef struct MenuParam { + int num; + int normal_color; + int select_color; + int disable_color; + MenuPos *pos; + const char **str_elem; +}MenuParam; + +// global variables-------------------------------------------------- + +// function------------------------------------------------------------- +void myInit( void ); +void myPreMain( void ); +void myProMain( void ); + +void myDp_Cls16(MyScreen scr); +void myDp_Cls8(MyScreen scr); +void myDp_Putchar(s32 x, s32 y, u8 color, MyScreen scr, u8 c); +void myDp_Write(s32 x, s32 y, u8 color, MyScreen scr, char* str); +void myDp_Printf(s32 x, s32 y, u8 color, MyScreen scr, const char *s, ...); +void myDp_DrawMenu( u16 csr, MyScreen scr, const MenuParam *param ); + +#ifdef __cplusplus +} +#endif + +#endif // __MISC_H__