From d6ec98e4d99a379f31756feff8751d1e4473b593 Mon Sep 17 00:00:00 2001 From: yoshida_teruhisa Date: Wed, 27 Jan 2010 05:38:37 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=BB=E3=82=AB=E3=83=BC=E3=83=89=E3=82=A2?= =?UTF-8?q?=E3=83=97=E3=83=AA=EF=BC=88=E3=82=BB=E3=82=AD=E3=83=A5=E3=82=A2?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E9=99=A4=E3=81=8F=EF=BC=89=E3=82=92=20SD=20?= =?UTF-8?q?=E3=81=AB=E6=9B=B8=E3=81=8D=E8=BE=BC=E3=82=80=E3=83=84=E3=83=BC?= =?UTF-8?q?=E3=83=AB=20=E3=83=BB=E3=82=AB=E3=83=BC=E3=83=89=E3=82=A2?= =?UTF-8?q?=E3=83=97=E3=83=AA=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=EF=BC=88=E4=B8=80=E9=83=A8=E3=81=AE?= =?UTF-8?q?=E3=81=BF=EF=BC=89=E3=82=92=E5=88=A4=E5=AE=9A=E3=81=97=E3=81=A6?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=83=84=E3=83=BC=E3=83=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@497 7061adef-622a-194b-ae81-725974e89856 --- build/tools/CardToSD/Makefile | 66 ++ build/tools/CardToSD/ROM-TS_nand_alt.rsf | 245 +++++++ build/tools/CardToSD/banner/Makefile | 49 ++ build/tools/CardToSD/banner/banner_v3.bsf | Bin 0 -> 916 bytes build/tools/CardToSD/banner/icon/gameIcon.bmp | Bin 0 -> 630 bytes .../header/rom_header_0vna.template.sbin | Bin 0 -> 16384 bytes build/tools/CardToSD/src/NitroGameCardToSD.c | 636 ++++++++++++++++++ build/tools/CardToSD/src/NitroGameCardToSD.h | 37 + build/tools/CardToSD/src/data.c | 620 +++++++++++++++++ build/tools/CardToSD/src/data.h | 29 + build/tools/CardToSD/src/main.c | 68 ++ build/tools/CardToSD/src/misc_simple.c | 154 +++++ build/tools/CardToSD/src/misc_simple.h | 97 +++ build/tools/NitroArm7VerChecker/AutoBuild.pl | 13 + build/tools/NitroArm7VerChecker/Makefile | 72 ++ .../NitroArm7VerChecker/ROM-TS_nand_alt.rsf | 243 +++++++ .../tools/NitroArm7VerChecker/banner/Makefile | 49 ++ .../NitroArm7VerChecker/banner/banner_v3.bsf | Bin 0 -> 1140 bytes .../banner/icon/gameIcon.bmp | Bin 0 -> 630 bytes .../NitroArm7VerChecker/demo.autogen.rsf | 243 +++++++ .../header/rom_header_0via.template.sbin | Bin 0 -> 16384 bytes .../NitroArm7VerChecker/include/revision.h | 1 + .../src/NitroArm7VerChecker.c | 351 ++++++++++ .../src/NitroArm7VerChecker.h | 37 + build/tools/NitroArm7VerChecker/src/data.c | 620 +++++++++++++++++ build/tools/NitroArm7VerChecker/src/data.h | 29 + build/tools/NitroArm7VerChecker/src/main.c | 68 ++ .../NitroArm7VerChecker/src/misc_simple.c | 154 +++++ .../NitroArm7VerChecker/src/misc_simple.h | 97 +++ 29 files changed, 3978 insertions(+) create mode 100644 build/tools/CardToSD/Makefile create mode 100644 build/tools/CardToSD/ROM-TS_nand_alt.rsf create mode 100644 build/tools/CardToSD/banner/Makefile create mode 100644 build/tools/CardToSD/banner/banner_v3.bsf create mode 100644 build/tools/CardToSD/banner/icon/gameIcon.bmp create mode 100644 build/tools/CardToSD/header/rom_header_0vna.template.sbin create mode 100644 build/tools/CardToSD/src/NitroGameCardToSD.c create mode 100644 build/tools/CardToSD/src/NitroGameCardToSD.h create mode 100644 build/tools/CardToSD/src/data.c create mode 100644 build/tools/CardToSD/src/data.h create mode 100644 build/tools/CardToSD/src/main.c create mode 100644 build/tools/CardToSD/src/misc_simple.c create mode 100644 build/tools/CardToSD/src/misc_simple.h create mode 100755 build/tools/NitroArm7VerChecker/AutoBuild.pl create mode 100644 build/tools/NitroArm7VerChecker/Makefile create mode 100644 build/tools/NitroArm7VerChecker/ROM-TS_nand_alt.rsf create mode 100644 build/tools/NitroArm7VerChecker/banner/Makefile create mode 100644 build/tools/NitroArm7VerChecker/banner/banner_v3.bsf create mode 100644 build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp create mode 100644 build/tools/NitroArm7VerChecker/demo.autogen.rsf create mode 100644 build/tools/NitroArm7VerChecker/header/rom_header_0via.template.sbin create mode 100644 build/tools/NitroArm7VerChecker/include/revision.h create mode 100644 build/tools/NitroArm7VerChecker/src/NitroArm7VerChecker.c create mode 100644 build/tools/NitroArm7VerChecker/src/NitroArm7VerChecker.h create mode 100644 build/tools/NitroArm7VerChecker/src/data.c create mode 100644 build/tools/NitroArm7VerChecker/src/data.h create mode 100644 build/tools/NitroArm7VerChecker/src/main.c create mode 100644 build/tools/NitroArm7VerChecker/src/misc_simple.c create mode 100644 build/tools/NitroArm7VerChecker/src/misc_simple.h 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 0000000000000000000000000000000000000000..beca36a6d1c1c1f01dda30059538ac10b78089d3 GIT binary patch literal 916 zcmc(ePiw+J5XIlMg5P1mvzAiu;L$(P77;PF_f51IFjh=d`sLgHW@A6VUMvgC&YL%z z_cF6T-yIE=Dv?t+EJy5hU~P2*O?Bjyb4pZb&$+FZIyZJxbDzEWuG3mOlvF7CxG8cf zbq1-yG88&p(OwYOL^YU5Oa*G(H||Ps@}$1zn*6IXbN7xeQ&;E{y#o|J2ThiH z)e_`EV>;qA#YY*Oj)J2N*qSQq*ErNnw20y-T1D}v{I3{2FX)Tmr;&a~k$z{9{AT+8 zX0WDD_DU*Vgb!0@9mw>>z6*1A#O)*NN>@&>HtNCLlk>XJVVhPDmXj~x*^SNZzvR7j ASpWb4 literal 0 HcmV?d00001 diff --git a/build/tools/CardToSD/banner/icon/gameIcon.bmp b/build/tools/CardToSD/banner/icon/gameIcon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3aff42caf539878b7eb1b6125db6f291bb93f84d GIT binary patch literal 630 zcmZ?rEn{K;gEAng0mKSW%*en3WMK#Y{{LtApPtU}A1Ey-D9FIU!NFi^YRV887|5`G z{S$`&9UTm!GK%ES2#z#v9dkFK8qO&-pN U+s_CJe+H0qk==`M`JiM00OSujH2?qr literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..69ff8286091d22189acbf5e0ed2d0e835401f884 GIT binary patch literal 16384 zcmeI&Q;;Swzb5duZQHhO+uhT)ZQHi(Y1@3;=5+V8Z5w;GYOA*P`dpl?`sTSxa`8{{ zyGT_k0RsBJVbV|#{@*>=|2y>GZy9OF_{BF0mLOLeb_0`vqVS|GBU4}%$HhYr>wyTv;AR@JE^m>(1WQO(F3T?6`uv6 z@-8Kl*+yC!C6u3_neL?cV@9B0bsGI#p+G_v2wy)c-=Gd@Om`U{17U`%f#g*teW1V! zT>EduY(L!spkkgtiBpltJgH^_z9td3eD$m3hcR3*wa&!LuaFvZ|L&1r~idKB8ToApsE@^n%W9a!z1BB|A0Bc-9vkZgN;fyiv0=?WEp z6VP@{Jo*awIVHPG3Z-pEW6A2OlN-?CS$bt>0Q9_d&uVkRT-_PC12GfC*DA4oW^9ix zt#9!hjsas5R4tzAGwe6(p+$GwmABKHg zaLY=~naapwGsJBb;kO!;fzXwiY=3O8=#pJ5YwG!R+Mr2T~SaA0DjpD%fRxui~rZjm-s$f*lI=GMRlU9t(*t8$IC| zXqclPhid6{n#|z|se5rngL$EPn|o7dT+@8I9I&v&y5~^GVu_N(u!=97Bxor5LJ+1y z+}E;!raN%avU}Kh$j?fCzrn;p#yxi&=1|;$oA3E6I#lBjE<_9b%ib;h9VMSSo)2=m zS(+4X5>%hsV)WY;J(!rA88Mw_fj|sxit1xdv;k>N&$zKhEWUW{#4&1}l$JbQ9jRFE zQGz4g4U)334(hV;-I`x#%~P7i>%iC8py)CW)X$?99k*|hPl8YJ2bIlF4PG5#}XFli|>MJp~Z78N2Cr6Jl%y4W1PcT;h~gLam50aS(z0=)!wZ zjUAv1yR)>&3n+n(oUI$44ory7QKpISHygscB{zKAP4rQNG!eD>Yzi^g8pX zx&gZaI^Gq~JD_O+Ln+0!zEowhEHW^v(7n+UxwbHmz$V_V@D(ENO$jyocJ!O(&mw$> z^)~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yU2&Yo_;9MGu#k9i@ePmYM_p;ShLs{VqzF8n8I!PXmGn7E7;4CQSh*j z_+Y?|XupA|dG2SsN>hbA(3`(3X%SzY7=q#b@EbB*pV|Ll|1R3iUz5OYeH5CWFg6@y zK@Cx&%lQHN0jgH7R)>OyfrW!dKtw`DK}AEyz{JAF!NtQTAS5CtAtfWHproRvp{1i| zU}R!uVP#|I;N;@w;pO8O5EK#?5fu}ckd%^^k(HBIP*hS@QB_md(A3h_(bfB?c?j`9}pN691EF>tv z&&SKd&Be*V&c@2Z%*4n*Pe)5bO+`sTPDV;XOhib4kB5tcjfIJUj)sbYjD&~)4+jea z4Fw4S4h9MW4D_GA|Np6fNB`#i|3l#CU;d*75dY;rTHy9y{-Xud|K&egp!#3_lLdhO E7pCh%MF0Q* literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a2a39befcc0a36dd1365a161af0c085162bcc610 GIT binary patch literal 1140 zcmc(fPfNo<5XIkB!SAq;vlbCN^k{9gDk4U`Z4;kGD_A9+oa<5#n*M8N*4-Ptj9t(>e8(`nh@32U zrzavunvmP@O{~Itvpyz?QD^G-80LrsWxW$1=A)nhiSQqS42ZeW(H#~I%?7gm+= z?k5@V{x&04nyzFWs%qn3pkv~FoT3JO&Gn64;rA$TtPyL65?iVool&_a8cApigX literal 0 HcmV?d00001 diff --git a/build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp b/build/tools/NitroArm7VerChecker/banner/icon/gameIcon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..bea78bf037070a89069b4fcbd204cdbcba3cb737 GIT binary patch literal 630 zcmZ?rEn{K;gEAng0mKSW%*en3WMK#YfWoi4JQ)N91;LnugM%S3FpwcJF_B^Y`X>xu zZ_Z(8ZEaC*@cJ125aPs6yhP!v~GW`GlAG@K*qG?b76U+Y!)b@Y2l3@0@&*j3d}9U%i2DB^d1GT^1E73)Xovk*a0oCMgVdLo!tFNz VsV^^wxDRYS15guC8-$HQ0sy}trsMzs literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7c9dccb07a616dd37c3d868426081c4572774503 GIT binary patch literal 16384 zcmeI&Q*dTYm2jX8rg&H zSp1$7EaUWh3}~R9`kU$OIKll%KkofU%RPH2`9&e+tYu@T5iv1`~xC%#-g=c8h>Hqnxe|vug z{tEmR_$%;N;IF`6fxiNO1^x>B75FRgSK$9jAbax4WdHk?KDm}Y?9aGwGI$Q^9*rAr zK`8;p>v5sr@O_kPoV-}=2-K8=`Zz1;t+bxxmbhRwvOf{>CK3vfk;1Txj{y%}wmM}N z_Q93Oaj=*s6-Sp;0m>Zo`??c`RHVRb%xl0ONvsq$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ZY;JAu?Ecx?KR7%(J~=%*zqq`*zPY`-e|UU) zetCU+|M>g@0R;nxfP{knx32%|^W**P_2v2L@!|gN_U8KP^5XpL^yK*H@L+%M&+g9l z*5=0g+Um;k(&EDW-0aNs)a1nY*yzac(BMFSUvE!$S7%3iTWd>mQ)5GYU2RQuRb@qa zS!qdeQDMRF{Jh+p?5xZTV0v0=N^(--uY~xx*qG?3$cXT;(2(GuzyNep_21FodH;V1eErS8S^)WP{?!84fAg;vQ2CpGwLsb5 J{F? +#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__