From b366026f4054fa9d738962880e280582f3d03e1c Mon Sep 17 00:00:00 2001 From: "(no author)" Date: Thu, 1 Sep 2011 04:10:21 +0000 Subject: [PATCH] =?UTF-8?q?[=E3=83=A1=E3=82=A4=E3=83=B3=E3=83=A1=E3=83=A2?= =?UTF-8?q?=E3=83=AA=E3=81=AE=E5=86=85=E5=AE=B9=E3=82=92=E5=88=A5=E6=9C=AC?= =?UTF-8?q?=E4=BD=93=E3=81=ABMP=E3=81=A7=E8=BB=A2=E9=80=81=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=84=E3=83=BC=E3=83=AB]=20=E3=81=A8=E3=82=8A?= =?UTF-8?q?=E3=81=82=E3=81=88=E3=81=9A=E5=AE=8C=E6=88=90?= 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@572 7061adef-622a-194b-ae81-725974e89856 --- .../MainMemoryDumper/040A/libsyscall_c.bin | Bin 0 -> 2048 bytes .../040A/rom_header_040a.template.sbin | Bin 0 -> 16384 bytes build/tools/MainMemoryDumper/Makefile | 74 +++ build/tools/MainMemoryDumper/ROM-TS.TWL.rsf | 156 +++++ .../MainMemoryDumper/etc/banner/Makefile | 74 +++ .../etc/banner/myGameBanner.TWL.bsf | Bin 0 -> 976 bytes .../etc/banner/myGameBanner.bsf | Bin 0 -> 966 bytes .../etc/banner/myGameIcon.TWL.bin | Bin 0 -> 4480 bytes .../etc/banner/myGameIcon.bmp | Bin 0 -> 630 bytes build/tools/MainMemoryDumper/include/data.h | 29 + .../MainMemoryDumper/include/misc_simple.h | 97 +++ .../MainMemoryDumper/include/mmd_client.h | 51 ++ .../MainMemoryDumper/include/mmd_parent.h | 53 ++ .../tools/MainMemoryDumper/include/mmdumper.h | 76 +++ .../MainMemoryDumper/include/wh_config.h | 60 ++ build/tools/MainMemoryDumper/src/data.c | 620 ++++++++++++++++++ build/tools/MainMemoryDumper/src/main.c | 72 ++ .../tools/MainMemoryDumper/src/misc_simple.c | 154 +++++ build/tools/MainMemoryDumper/src/mmd_client.c | 344 ++++++++++ build/tools/MainMemoryDumper/src/mmd_parent.c | 291 ++++++++ build/tools/MainMemoryDumper/src/mmdumper.c | 203 ++++++ 21 files changed, 2354 insertions(+) create mode 100644 build/tools/MainMemoryDumper/040A/libsyscall_c.bin create mode 100644 build/tools/MainMemoryDumper/040A/rom_header_040a.template.sbin create mode 100644 build/tools/MainMemoryDumper/Makefile create mode 100644 build/tools/MainMemoryDumper/ROM-TS.TWL.rsf create mode 100644 build/tools/MainMemoryDumper/etc/banner/Makefile create mode 100644 build/tools/MainMemoryDumper/etc/banner/myGameBanner.TWL.bsf create mode 100644 build/tools/MainMemoryDumper/etc/banner/myGameBanner.bsf create mode 100644 build/tools/MainMemoryDumper/etc/banner/myGameIcon.TWL.bin create mode 100644 build/tools/MainMemoryDumper/etc/banner/myGameIcon.bmp create mode 100644 build/tools/MainMemoryDumper/include/data.h create mode 100644 build/tools/MainMemoryDumper/include/misc_simple.h create mode 100644 build/tools/MainMemoryDumper/include/mmd_client.h create mode 100644 build/tools/MainMemoryDumper/include/mmd_parent.h create mode 100644 build/tools/MainMemoryDumper/include/mmdumper.h create mode 100644 build/tools/MainMemoryDumper/include/wh_config.h create mode 100644 build/tools/MainMemoryDumper/src/data.c create mode 100644 build/tools/MainMemoryDumper/src/main.c create mode 100644 build/tools/MainMemoryDumper/src/misc_simple.c create mode 100644 build/tools/MainMemoryDumper/src/mmd_client.c create mode 100644 build/tools/MainMemoryDumper/src/mmd_parent.c create mode 100644 build/tools/MainMemoryDumper/src/mmdumper.c diff --git a/build/tools/MainMemoryDumper/040A/libsyscall_c.bin b/build/tools/MainMemoryDumper/040A/libsyscall_c.bin new file mode 100644 index 0000000000000000000000000000000000000000..4477b076747e42b6ce9286d9dd9892d1b1b57ea0 GIT binary patch literal 2048 zcmV+b2>d)=vQKc~?sRBTkKywGMIKlQej>j5PzlufWa?y)n*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001 diff --git a/build/tools/MainMemoryDumper/Makefile b/build/tools/MainMemoryDumper/Makefile new file mode 100644 index 0000000..89b247d --- /dev/null +++ b/build/tools/MainMemoryDumper/Makefile @@ -0,0 +1,74 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - GX - demos - tips/BuildFinalRom +# File: Makefile +# +# Copyright 2003,2004 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM = TWL + +SUBDIRS = etc/banner + + +#---------------------------------------------------------------------------- + +SRCS = main.c data.c misc_simple.c mmdumper.c mmd_parent.c mmd_client.c \ + $(ROOT)/build/demos/wireless_shared/wh/wh.c + +TARGET_BIN = MainMemoryDumper.srl +LINCLUDES = $(ROOT)/build/demos/gx/UnitTours/DEMOLib/include \ + $(ROOT)/build/demos/wireless_shared/wh + +LLIBRARY_DIRS = $(ROOT)/build/demos/gx/UnitTours/DEMOLib/lib/$(TWL_BUILDTYPE) +LLIBRARIES = libDEMO$(TWL_LIBSUFFIX).a + +MAKEROM_ROMSPEED = 1TROM + +#SRCDIR = # using default +#LCFILE = # using default + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +###-------------------------------------------------------------------------- +### Setting for finalrom +###-------------------------------------------------------------------------- +#### BEGIN +#### +#### Please get your "libsyscall.a" and "rom header template" from Nintendo. +#### And put them in ./etc directory. +#### +# +# ROM SPEC FILE +# +ROM_SPEC = ./ROM-TS.TWL.rsf +# +# LIBSYSCALL: Provided to every product by NINTENDO +# +LIBSYSCALL = ./040A/libsyscall.a +### +### +### +#### END + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/build/tools/MainMemoryDumper/ROM-TS.TWL.rsf b/build/tools/MainMemoryDumper/ROM-TS.TWL.rsf new file mode 100644 index 0000000..d03aad2 --- /dev/null +++ b/build/tools/MainMemoryDumper/ROM-TS.TWL.rsf @@ -0,0 +1,156 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - include +# File: ROM-TS.rsf +# +# Copyright 2007-2009 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 "MMDUMPER" + + # + # MAKER CODE: Your company ID# in 2 ascii words + # issued by NINTENDO + # + MakerCode "01" + + # + # REMASTER VERSION: Mastering version + # + RemasterVersion 0 + + # + # ROM SPEED TYPE: [MROM/1TROM/UNDEFINED] + # + RomSpeedType $(MAKEROM_ROMSPEED) + + # + # ROM SIZE: in bit [64M/128M/256M/512M/1G/2G] + # + RomSize 256M + + # + # ROM PADDING: TRUE if finalrom + # + #RomFootPadding TRUE + RomFootPadding FALSE + + # + # ROM HEADER TEMPLATE: Provided to every product by NINTENDO + # + RomHeaderTemplate ./040A/rom_header_040a.template.sbin + + # + # BANNER FILE: generated from Banner Spec File + # + BannerFile ./etc/myGameBanner.TWL.bnr + #BannerFile $(TWLSDK_ROOT)/include/twl/specfiles/default.bnr + + ### + ### Setting for TWL + ### + + # + # ROM HEADER Ltd: + # don't have to edit + # + RomHeaderLtd $(TWLSDK_ROOT)/tools/bin/rom_header.LTD.sbin + + # + # Digest parameters: + # + DigestParam 1024 32 + + # + # WRAM mapping: [MAP2_TS_HYB/MAP2_TS_LTD] + # don't have to edit + # + WramMapping $(MAKEROM_WRAM_MAPPING) + + # + # CardRegion: card region [Japan/America/Europe/Australia] + # + CardRegion ALL + + # + # Codec mode: + # don't have to edit + # + CodecMode $(MAKEROM_CODEC_MODE) + + # + # Disp WiFiConnection Icon for Launcher [TRUE/FALSE] + # + #WiFiConnectionIcon FALSE + WiFiConnectionIcon TRUE + + # + # Disp DSWireless Icon for Launcher [TRUE/FALSE] + # + #DSWirelessIcon FALSE + + SDCardAccess ReadWrite + + ### + #### END +} + +RomSpec +{ + Offset 0x00000000 + Segment ALL + HostRoot $(MAKEROM_ROMROOT) + Root / + File $(MAKEROM_ROMFILES) +} diff --git a/build/tools/MainMemoryDumper/etc/banner/Makefile b/build/tools/MainMemoryDumper/etc/banner/Makefile new file mode 100644 index 0000000..735a86e --- /dev/null +++ b/build/tools/MainMemoryDumper/etc/banner/Makefile @@ -0,0 +1,74 @@ +#! make -f +#--------------------------------------------------------------------------- +# Project: TwlSDK - tools +# File: Makefile +# +# Copyright 2003-2008 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 = NITRO TWL + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +ifneq ($(filter TWL,$(TARGET_PLATFORM_LIST)),) +BANNER_ICON += myGameIcon.TWL.bin +BANNER_SPEC += myGameBanner.TWL.bsf +endif +ifneq ($(filter NITRO,$(TARGET_PLATFORM_LIST)),) +BANNER_ICON += myGameIcon.bmp +BANNER_SPEC += myGameBanner.bsf +endif + + +TARGETS = $(BANNER_SPEC:.bsf=.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) + +ifeq ($(TARGET_PLATFORM),TWL) +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) + $(MAKEBANNER) -p TWL $(BANNER_SPEC) $(TARGETS) +else +$(TARGETS): $(BANNER_SPEC) $(BANNER_ICON) $(BANNER_ICON_MIDDLE) + $(MAKEBANNER) -N $(BANNER_ICON_NAME) $(BANNER_SPEC) $(TARGETS) +endif + +#---------------------------------------------------------------------------- +# test +#---------------------------------------------------------------------------- +ifeq ($(TARGET_PLATFORM),TWL) +include $(TWLSDK_ROOT)/build/buildtools/twl/commondefs.emtype.IS +else +include $(TWLSDK_ROOT)/build/buildtools/nitro/commondefs.emtype.IS +endif + +test: $(TARGETS) + $(ADDBANNER) $(TARGETS) $(TARGETS:.bnr=.srl) +ifdef ISD_NITLOAD + $(ISD_NITLOAD) $(TARGETS:.bnr=.srl) +endif + +# diff --git a/build/tools/MainMemoryDumper/etc/banner/myGameBanner.TWL.bsf b/build/tools/MainMemoryDumper/etc/banner/myGameBanner.TWL.bsf new file mode 100644 index 0000000000000000000000000000000000000000..fc629145ad0d9f0a4198724240df8fa44812dafd GIT binary patch literal 976 zcmc(ey-veG5QL`%iFdH%ns5k-A{{?*FhVFI{M051#8PaKV+eUN#1p`C(9qD)BH-Jz zQ3|Ax3Utclc6V-Wb~gF^2(_)QA_ZFYDxE3DDgoxj|giE^0-AGTo3V$(^Gx&;;!%aY>XDr+)8oGodmjYuFRGB05>urViBl*UqfF zQ*@cSR9EP2qHx1&vf37zls*TF*%Mv*Q?5SWcVL&~Ja&fbFfDT+=H?9b6Zbt=kbVS>1Y8|8#dE7pDRY`@2GCAdp_6BLhAPxLRp`o_bgS6ot=L!FL#wwK{HGbSW`Xkt(J>K$=DxNUEgKqAw;sfj);D5!`hv>NiP> zy0QgPE*a+j%$ak~oxH#K+Et`bMjN#m{8(cwRY^3`1-pb@s7yKgHLc2TtD7@_vo`k{ z^)-UY1V(2qBcno>L@Htf7#dCCp5a$`WBjaM6HdltCPZEBDOe$$Y->k{+WXheTz3aL zR!1xH)KizQ52v029lkleXNkpk2xbdEw! z!4ick^m6_uUZ|5L@ScCf+lS$A^6R42;&@rjZ{F=q+im)#-)M^U&DZh%*nJ>6~kcE@OAkKh&dXqvGaV?RLTieJ5{o(gk0cRaIkCUygf$9!Cu8>{G$&RA=|9 z2UNAMJQc5b?gNnM7zQxD#kao^ZaAKUPF01o(#u!XTd-H{cB~F{8QxZx&u;IosonE1 zb@DvJ;&1q?D2> z<7lsN9p+#U@VP-g#`#D^YQFv>kQf*Pur6TaGQyQ969#aPm!e)i=YPT=A91Y#UWN~N z`4Z<2=hq>AhiW&OHA;V7*C+aVdk*&;l`(M(V&dl~pbljo0`%~y+IVlz1xSYRUj7&n zL!?*kXnPT?(O&qZXRLB4;`}ihsa`xTCMS(i&#z}(=;@mW89tBIT(9Y*e*`tC=kmEP zn=v5--AP`c$C1Q3Cj{7|V&RyW6k@zecM4eq(xa28|7Bd45pFb7fKegfCqG|^dvHud zTuiONAyK{>jyNK6+q=^!zp1Q2`dis-HWmqs88I16%G*#6>Q5Gbvc-7Zkzw&27&MpP zAd(0J;n@<{(J&krQ?+U7-kX-SD>E`4xBMB*=3EfsI%twq^7W^G0TK^EJ(s_}QKZ>7 z@J#xpE#yceViGyz;h~gfX7QB2Z@58i|E~ZxT zH=(+OYx)dNN%L8w^fyhDdY+W=Swp)I^`Iu1*efYhjwa;|uxPFl2m@iS%qZl+o|TZ0 zac53*D|4E2C!yU;*|VPCG+oTU4Z21u`9|uc@Ls9s^4E8YH2YT0%=(eUVIk5Qa%jZ` zEv4b`=L)|5Dg5vzZiKG$DkUryiZF+J%=`J8_7E_|#nc*H(rS54b2aS&;3;W7YmokS zu~?*eGxSW>HXW!3HK~ZL*7cm5)%CmRGy$87Enk7x#v<5@IxOiKayfa^Em&ru;KgA+ z_FC5;fSJWVk}F2);jws%%jYc+g-LtzLm%^49T^6(6*4Y5VjUeW#|g2I=2)eRzg8Z1;WjQliaxU3u%}j;@`b%7 literal 0 HcmV?d00001 diff --git a/build/tools/MainMemoryDumper/etc/banner/myGameIcon.bmp b/build/tools/MainMemoryDumper/etc/banner/myGameIcon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0b2bcfd1d97414e5bde7b04cd014f3de3dcac71d GIT binary patch literal 630 zcmY+BF;Buk6vv;KH9EMYKVk~Vw*+EE8WyXiob+du}>CM>uRy0g%k33iuuRTJWU z0;Qu9%BC*1=l`xX)|cG1zq?=Gd)I58xx1vo#e9r$l#dU26Z7z}7Q9MX6^rs;G_^ZA^@Fr?LLMR6RH5Q5117qss<4pvNE*DHv_ zZk>=jJ6e z%}ACPGYHqhMjfr97{axXJ)9^Gd<=u6h4qqcZs36|>WrKfZ3FNM*Q@yyk5Cj_Zm!zn2Vw jA#hK&4l&liP;(a literal 0 HcmV?d00001 diff --git a/build/tools/MainMemoryDumper/include/data.h b/build/tools/MainMemoryDumper/include/data.h new file mode 100644 index 0000000..6143c1f --- /dev/null +++ b/build/tools/MainMemoryDumper/include/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/MainMemoryDumper/include/misc_simple.h b/build/tools/MainMemoryDumper/include/misc_simple.h new file mode 100644 index 0000000..a316a63 --- /dev/null +++ b/build/tools/MainMemoryDumper/include/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/MainMemoryDumper/include/mmd_client.h b/build/tools/MainMemoryDumper/include/mmd_client.h new file mode 100644 index 0000000..525c202 --- /dev/null +++ b/build/tools/MainMemoryDumper/include/mmd_client.h @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------* + 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 __MMD_CLIENT_H__ +#define __MMD_CLIENT_H__ + +#include +#include "mmdumper.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// define data---------------------------------------------------------- +typedef enum MMDCStage +{ + MMDC_STAGE_INIT, + MMDC_STAGE_WAIT_INIT, + MMDC_STAGE_CHILD_CONNECT_AUTO, + MMDC_STAGE_WAIT_CHILD_CONNECT_AUTO, + MMDC_STAGE_START_MP, + MMDC_STAGE_END, + + MMDC_STAGE_NUMS +} MMDCStage; + +// global variables-------------------------------------------------- + +// function------------------------------------------------------------- +void printClient(void); +void actionClient(void); + +#ifdef __cplusplus +} +#endif + +#endif // __MISC_H__ diff --git a/build/tools/MainMemoryDumper/include/mmd_parent.h b/build/tools/MainMemoryDumper/include/mmd_parent.h new file mode 100644 index 0000000..f01c25a --- /dev/null +++ b/build/tools/MainMemoryDumper/include/mmd_parent.h @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------* + 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 __MMD_PARENT_H__ +#define __MMD_PARENT_H__ + +#include +#include "mmdumper.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// define data---------------------------------------------------------- +typedef enum MMDPStage +{ + MMDP_STAGE_INIT, + MMDP_STAGE_WAIT_INIT, + MMDP_STAGE_MEASURE_CHANNEL, + MMDP_STAGE_WAIT_MEASURE_CHANNEL, + MMDP_STAGE_START_PARENT, + MMDP_STAGE_WAIT_START_PARENT, + MMDP_STAGE_START_MP, + MMDP_STAGE_END, + + MMDP_STAGE_NUMS +} MMDPStage; + +// global variables-------------------------------------------------- + +// function------------------------------------------------------------- +void printParent(void); +void actionParent(void); + +#ifdef __cplusplus +} +#endif + +#endif // __MISC_H__ diff --git a/build/tools/MainMemoryDumper/include/mmdumper.h b/build/tools/MainMemoryDumper/include/mmdumper.h new file mode 100644 index 0000000..d06022c --- /dev/null +++ b/build/tools/MainMemoryDumper/include/mmdumper.h @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------* + 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 __MMDUMPER_H__ +#define __MMDUMPER_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// define data---------------------------------------------------------- +typedef enum MMDumperStage +{ + MMD_STAGE_INIT = 0, + MMD_STAGE_PARENT, + MMD_STAGE_CLIENT, + MMD_STAGE_PRE_END, + MMD_STAGE_END, + + MMD_STAGE_ERROR, + + MMD_STAGE_NUMS +} MMDumperStage; + +#define BEGIN_ADDRESS 0x02000000 +#define END_ADDRESS 0x023ffd80 // +1 + +typedef struct UserGameInfo +{ + u32 wepSeed; +} UserGameInfo; + +typedef struct RequestFormat +{ + u8* addr; + u16 length; +} RequestFormat; + +// global variables-------------------------------------------------- +// WEP Key 作成用の共通鍵(親子で共通の鍵を使用する) +// アプリケーションごとに固有のものとすること +// ASCII 文字列である必要はなく、任意の長さのバイナリデータでよい +#define SECRET_KEY "this is a secret key for Main Memory Dumper" +#define SECRET_KEY_LENGTH sizeof(SECRET_KEY) + +// function------------------------------------------------------------- +void mmdumperInit(void); +void mmdumperEnd(void); +BOOL mmdumperMain(void); + +void printWMError(const char* strWMError); + +u16 cursorUpDown(u16 now, u16 nums); + + +#ifdef __cplusplus +} +#endif + +#endif // __MISC_H__ diff --git a/build/tools/MainMemoryDumper/include/wh_config.h b/build/tools/MainMemoryDumper/include/wh_config.h new file mode 100644 index 0000000..6261e17 --- /dev/null +++ b/build/tools/MainMemoryDumper/include/wh_config.h @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - wireless_shared - demos - wh + File: wh_config.h + + Copyright 2006-2008 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 _DEFAULT_WH_CONFIG_H__ +#define _DEFAULT_WH_CONFIG_H__ + + +// 無線で使用するDMA番号 +#define WH_DMA_NO 2 + +// 子機最大数(親機を含まない数) +#define WH_CHILD_MAX 1 + +// シェア出来るデータの最大サイズ +#define WH_DS_DATA_SIZE 12 + +// 1回の通信で送れるデータの最大サイズ +// データシェアリングに加えて通常の通信をする場合は、その分だけ +// ここの値を増やしてください。その際は、複数パケット送信による追加の +// ヘッダフッタ分を加算する必要があります。 +// 詳しくは docs/TechnicalNotes/WirelessManager.doc を参照してください。 +// GUIDELINE : ガイドライン準拠ポイント(6.3.2) +// リファレンスのワイヤレスマネージャ(WM)→図表・情報→無線通信時間計算シート +// で計算した MP 通信1回分の所要時間が 5600 μ秒以下となることを推奨しています。 +#define WH_PARENT_MAX_SIZE 512//(WH_DS_DATA_SIZE * (1 + WH_CHILD_MAX) + WM_SIZE_DS_PARENT_HEADER) +#define WH_CHILD_MAX_SIZE 8//(WH_DS_DATA_SIZE) + +// 1ピクチャーフレームあたりのMP通信回数上限 +// データシェアリングとブロック転送など複数のプロトコルを並行する場合は +// この値を1より大きく(または無制限を示す0に)設定する必要があります。 +// そうでない場合、もっとも優先度の高い1つのプロトコル以外は +// MP通信を一切実行できなくなってしまいます。 +#define WH_MP_FREQUENCY 0 + +// 通常の MP 通信で使用するポート +#define WH_DATA_PORT 14 + +// 通常の MP 通信で使用する優先度 +#define WH_DATA_PRIO WM_PRIORITY_NORMAL + +// データシェアリングで使用するポート +#define WH_DS_PORT 13 + + + +#endif // _DEFAULT_WH_CONFIG_H__ diff --git a/build/tools/MainMemoryDumper/src/data.c b/build/tools/MainMemoryDumper/src/data.c new file mode 100644 index 0000000..51fa2de --- /dev/null +++ b/build/tools/MainMemoryDumper/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/MainMemoryDumper/src/main.c b/build/tools/MainMemoryDumper/src/main.c new file mode 100644 index 0000000..7e72f52 --- /dev/null +++ b/build/tools/MainMemoryDumper/src/main.c @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------* + Project: MainMemoryDumper + File: main.c + + Copyright 2011 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 "mmdumper.h" + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + +// function's prototype------------------------------------------------------- +static void INTR_VBlank( void ); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- + +// const data------------------------------------------------------------------ + + +// ============================================================================ +// function's description +// ============================================================================ +void TwlMain(void) +{ + BOOL loop = TRUE; + + myInit(); + mmdumperInit(); + + while(loop) + { + + myPreMain(); + + loop = mmdumperMain(); + + myProMain(); + + OS_WaitIrq(1, OS_IE_V_BLANK); // Vブランク割り込み待ち + } + while (1) + { + 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/MainMemoryDumper/src/misc_simple.c b/build/tools/MainMemoryDumper/src/misc_simple.c new file mode 100644 index 0000000..1565358 --- /dev/null +++ b/build/tools/MainMemoryDumper/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/MainMemoryDumper/src/mmd_client.c b/build/tools/MainMemoryDumper/src/mmd_client.c new file mode 100644 index 0000000..618f77c --- /dev/null +++ b/build/tools/MainMemoryDumper/src/mmd_client.c @@ -0,0 +1,344 @@ +/*---------------------------------------------------------------------------* + Project: MainMemoryDumper + File: main.c + + Copyright 2011 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 "wh.h" +#include "misc_simple.h" +#include "mmd_client.h" + +#include + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + +typedef enum SDStat +{ + SDSTAT_INSERTED = 0, + SDSTAT_REMOVED = 1, + SDSTAT_MAX +} +SDStat; + +// function's prototype------------------------------------------------------- +static u16 ChildWEPKeyGenerator(u16 *wepkey, const WMBssDesc *bssDesc); +static void ChildReceiveCallback(u16 aid, u16 *data, u16 length); +static void ChildSendCallback(void); +static void whSessionUpdateCallback(void* arg); + +static void subCallBack( void* userdata, FSEvent event, void* argument ); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- +static MMDCStage stage; +static RequestFormat request; + +static s32 s_SDCheck = 0; +static FSEventHook s_hook; +static FSFile dumpFile; +static u8 buffer[2][16*1024] ATTRIBUTE_ALIGN(32); +static size_t offset[2]; +static BOOL flip; +static BOOL allEnd; + +// const data------------------------------------------------------------------ +static const u8 ANY_PARENT[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; +static const u16 ALL_CHANNEL = 0; + +// ============================================================================ +// function's description +// ============================================================================ +void printClient(void) +{ + static int count = 0; + if ( WH_GetSystemState() == WH_SYSSTATE_ERROR ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Stopped because of an error."); + } + else if ( WH_GetSystemState() != WH_SYSSTATE_CONNECTED ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Waiting to connect"); + switch ( count++ & 0x30 ) + { + case 0x00: break; + case 0x10: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "."); break; + case 0x20: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, ".."); break; + case 0x30: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "..."); break; + } + } + else if ( stage == MMDC_STAGE_END ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Done."); + } + else + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Receiving"); + myDp_Printf(3, 4, TXT_COLOR_RED, MAIN_SCREEN, "%08X-%08X", request.addr, request.addr + request.length - 1); + switch ( count++ & 0x30 ) + { + case 0x00: break; + case 0x10: myDp_Printf(10, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "."); break; + case 0x20: myDp_Printf(10, 3, TXT_COLOR_BLACK, MAIN_SCREEN, ".."); break; + case 0x30: myDp_Printf(10, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "..."); break; + } + } +} + +void actionClient(void) +{ + if ( s_SDCheck == SDSTAT_REMOVED ) + { + printWMError("SD Card is removed."); + } + + switch (stage) + { + case MMDC_STAGE_INIT: + FS_Init(3); + FS_InitFatDriver(); + RTC_Init(); + { // SDカード + FSPathInfo info; + FS_RegisterEventHook("sdmc", &s_hook, subCallBack, NULL); + if ( !FS_GetPathInfo("sdmc:/", &info) ) + { + FSResult result = FS_GetArchiveResultCode("sdmc:/"); + printWMError("SD Card is not inserted."); + OS_TPrintf("FSResult: %d\n", result); + return; + } + if ( info.attributes & FS_ATTRIBUTE_IS_PROTECTED ) + { + printWMError("SD Card is not writable."); + return; + } + } + request.addr = (u8*)BEGIN_ADDRESS; + request.length = 128; + offset[0] = offset[1] = 0; + flip = FALSE; + allEnd = FALSE; + WH_SetSessionUpdateCallback( whSessionUpdateCallback ); + if ( !WH_Initialize() ) + { + printWMError("WH_Initialize() was failed"); + return; + } + else + { + stage = MMDC_STAGE_WAIT_INIT; + } + break; + case MMDC_STAGE_WAIT_INIT: + if ( WH_GetSystemState() != WH_SYSSTATE_BUSY ) + { + stage = MMDC_STAGE_CHILD_CONNECT_AUTO; + } + break; + case MMDC_STAGE_CHILD_CONNECT_AUTO: + { // SDカード + RTCDate date; + RTCTime time; + char temp[64]; + if (RTC_GetDateTime(&date, &time) == RTC_RESULT_SUCCESS) + { + STD_TSNPrintf(temp, sizeof(temp)-1, "sdmc:/MMD-%04d%02d%02d-%02d%02d%02d.dat", 2000+date.year, date.month, date.day, time.hour, time.minute, time.second); + } + else + { + STD_TSNPrintf(temp, sizeof(temp)-1, "sdmc:/MMD-00000000-000000.dat"); + } + if ( !FS_CreateFile(temp, FS_PERMIT_W) ) + { + printWMError("Cannot create a dump file."); + return; + } + FS_InitFile(&dumpFile); + if ( !FS_OpenFileEx(&dumpFile, temp, FS_FILEMODE_W) ) + { + printWMError("Cannot open the dump file."); + return; + } + } + WH_SetReceiver(ChildReceiveCallback); + WH_SetChildWEPKeyGenerator(ChildWEPKeyGenerator); + if ( !WH_ChildConnectAuto(WH_CONNECTMODE_MP_CHILD, ANY_PARENT, ALL_CHANNEL) ) + { + printWMError("WH_ChildConnectAuto() was failed"); + } + else + { + stage = MMDC_STAGE_WAIT_CHILD_CONNECT_AUTO; + } + break; + case MMDC_STAGE_WAIT_CHILD_CONNECT_AUTO: + if ( WH_GetSystemState() == WH_SYSSTATE_CONNECTED ) + { + stage = MMDC_STAGE_START_MP; + } + break; + case MMDC_STAGE_START_MP: + if ( WH_GetSystemState() == WH_SYSSTATE_ERROR ) + { + printWMError("Some error occurred."); + } + if ( offset[flip^1] ) // writable data is available + { + FS_WriteFile(&dumpFile, buffer[flip^1], (s32)offset[flip^1]); + offset[flip^1] = 0; + } + if ( allEnd ) + { + if ( offset[flip] ) + { + FS_WriteFile(&dumpFile, buffer[flip], (s32)offset[flip]); + } + FS_CloseFile(&dumpFile); + mmdumperEnd(); + stage = MMDC_STAGE_END; + } + break; + case MMDC_STAGE_END: + break; + } +} + +static u16 ChildWEPKeyGenerator(u16 *wepkey, const WMBssDesc *bssDesc) +{ + u16 data[20 / sizeof(u16)]; + u16 tmpWep[20 / sizeof(u16)]; + UserGameInfo* userGameInfo = (UserGameInfo*)bssDesc->gameInfo.userGameInfo; + + MI_CpuClear16(data, sizeof(data)); + + // UserGameInfo 内に埋め込まれていた Seed 値を使用して WEP Key を計算 + MI_CpuCopy16(&userGameInfo->wepSeed, data, 4); + // GGID や TGID や親機の MAC Address も考慮に入れる + MI_CpuCopy16(&bssDesc->gameInfo.ggid, data + 2, sizeof(u32)); + *(u16 *)(data + 4) = bssDesc->gameInfo.tgid; + MI_CpuCopy8(bssDesc->bssid, (u8 *)(data + 5), WM_SIZE_MACADDR); + + // HMAC-SHA-1 で鍵付ハッシュ値を取り、128bit に切り詰めて WEP Key とする。 + // HMAC で使用する鍵はアプリケーション固有のものとすること。 + // (HMAC に関しては RFC2104 参照) + MATH_CalcHMACSHA1(tmpWep, data, sizeof(data), SECRET_KEY, SECRET_KEY_LENGTH); + MI_CpuCopy8(tmpWep, wepkey, 16); + OS_TPrintf("wepkey: %04x%04x %04x%04x %04x%04x %04x%04x\n", wepkey[0], wepkey[1], + wepkey[2], wepkey[3], wepkey[4], wepkey[5], wepkey[6], wepkey[7]); + + return WM_WEPMODE_128BIT; +} + +static void ChildReceiveCallback(u16 aid, u16 *data, u16 length) +{ + OS_TPrintf("ChildReceiveCallback: %d, 0x%x, %d\n", aid, data, length); + if ( aid != 0 ) + { + printWMError("Unsupported AID"); + } + if ( data == NULL ) + { + OS_TPrintf("Received NO data.\n"); + } + else + { + if ( length != request.length ) + { + OS_TPrintf("WARNING: Received length is not valid (%d <> %d).\n", length, request.length); + } + if ( offset[flip] + length > sizeof(buffer[0]) ) // overflow then using new buffer + { + flip ^= 1; + offset[flip] = 0; + } + MI_CpuCopy8( data, &buffer[flip][offset[flip]], length ); + offset[flip] += length; + request.addr += length; + if ( (u32)request.addr >= END_ADDRESS ) + { + allEnd = TRUE; + } + else + { + if ( (u32)request.addr + request.length > END_ADDRESS ) + { + request.length = (u16)(END_ADDRESS - (u32)request.addr); + } + ChildSendCallback(); + } + } +} + +static void ChildSendCallback(void) +{ + WH_SendData(&request, sizeof(request), NULL); +} + +static void whSessionUpdateCallback(void* arg) +{ + switch ( ((WMCallback*)arg)->apiid ) + { + case WM_APIID_START_MP: + { + WMStartMPCallback *cb = (WMStartMPCallback *)arg; + if ( cb->state == WM_STATECODE_MP_START ) + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_START_MP: WM_STATECODE_MP_START: %d\n", cb->errcode); + // first request + ChildSendCallback(); + } + } + case WM_APIID_SET_MP_DATA: + { + WMPortSendCallback* cb = (WMPortSendCallback*)arg; + if ( cb->errcode ) + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_SET_MP_DATA: %d\n", cb->errcode); + } + else + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_SET_MP_DATA: %d %d %d \n", cb->destBitmap, cb->restBitmap, cb->sentBitmap); + } + } + break; + default: + OS_TPrintf("whSessionUpdateCallback: apiid=%d\n", ((WMCallback*)arg)->apiid); + break; + } +} + +//****************************************************************************** +// SD抜け監視コールバック +//****************************************************************************** + +static void subCallBack( void* userdata, FSEvent event, void* argument ) +{ +#pragma unused( userdata, argument ) + + if( event == FS_EVENT_MEDIA_INSERTED ) + { + s_SDCheck = SDSTAT_INSERTED; //挿入 + } + else if( event == FS_EVENT_MEDIA_REMOVED ) + { + s_SDCheck = SDSTAT_REMOVED; //抜け + } +} + +#include diff --git a/build/tools/MainMemoryDumper/src/mmd_parent.c b/build/tools/MainMemoryDumper/src/mmd_parent.c new file mode 100644 index 0000000..507d725 --- /dev/null +++ b/build/tools/MainMemoryDumper/src/mmd_parent.c @@ -0,0 +1,291 @@ +/*---------------------------------------------------------------------------* + Project: MainMemoryDumper + File: main.c + + Copyright 2011 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 "wh.h" +#include "misc_simple.h" +#include "mmd_parent.h" + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- + +// function's prototype------------------------------------------------------- +static u16 ParentWEPKeyGenerator(u16 *wepkey, const WMParentParam *parentParam); +static void ParentReceiveCallback(u16 aid, u16 *data, u16 length); +static void ParentSendCallback(u16 *data, u16 length); +static void whSessionUpdateCallback(void* arg); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- +static MMDPStage stage; +static u16 tgid; +static UserGameInfo userGameInfo; +static RequestFormat requestForPrint; + +// const data------------------------------------------------------------------ + + +// ============================================================================ +// function's description +// ============================================================================ +void printParent(void) +{ + static int count = 0; + if ( WH_GetSystemState() == WH_SYSSTATE_ERROR ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Stopped because of an error."); + } + else if ( !requestForPrint.addr ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Waiting to connect"); + switch ( count++ & 0x30 ) + { + case 0x00: break; + case 0x10: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "."); break; + case 0x20: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, ".."); break; + case 0x30: myDp_Printf(19, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "..."); break; + } + } + else if ( stage == MMDP_STAGE_END ) + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Done."); + } + else + { + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Sending"); + myDp_Printf(3, 4, TXT_COLOR_RED, MAIN_SCREEN, "%08X-%08X", requestForPrint.addr, requestForPrint.addr + requestForPrint.length - 1); + switch ( count++ & 0x30 ) + { + case 0x00: break; + case 0x10: myDp_Printf(8, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "."); break; + case 0x20: myDp_Printf(8, 3, TXT_COLOR_BLACK, MAIN_SCREEN, ".."); break; + case 0x30: myDp_Printf(8, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "..."); break; + } + } +} + +void actionParent(void) +{ + switch (stage) + { + case MMDP_STAGE_INIT: + RTC_Init(); + requestForPrint.addr = 0; + requestForPrint.length = 0; + WH_SetSessionUpdateCallback( whSessionUpdateCallback ); + if ( !WH_Initialize() ) + { + printWMError("WH_Initialize() was failed"); + return; + } + else + { + stage = MMDP_STAGE_WAIT_INIT; + } + break; + case MMDP_STAGE_WAIT_INIT: + if ( WH_GetSystemState() != WH_SYSSTATE_BUSY ) + { + stage = MMDP_STAGE_MEASURE_CHANNEL; + } + break; + case MMDP_STAGE_MEASURE_CHANNEL: + WH_SetReceiver(ParentReceiveCallback); + WH_SetParentWEPKeyGenerator(ParentWEPKeyGenerator); + { // WEP + MATHRandContext32 sRand; + u64 randSeed = 0; + RTCDate date; + RTCTime time; + if (RTC_GetDateTime(&date, &time) == RTC_RESULT_SUCCESS) + { + randSeed = + (((((((u64)date.year * 16ULL + date.month) * 32ULL) + date.day) * 32ULL + + time.hour) * 64ULL + time.minute) * 64ULL + time.second); + } + MATH_InitRand32(&sRand, randSeed); + userGameInfo.wepSeed = MATH_Rand32(&sRand, 0); + WH_SetUserGameInfo((u16 *)&userGameInfo, 4); + } + if ( !WH_StartMeasureChannel() ) + { + printWMError("WH_StartMeasureChannel() was failed"); + } + else + { + stage = MMDP_STAGE_WAIT_MEASURE_CHANNEL; + } + break; + case MMDP_STAGE_WAIT_MEASURE_CHANNEL: + if ( WH_GetSystemState() == WH_SYSSTATE_MEASURECHANNEL ) + { + stage = MMDP_STAGE_START_PARENT; + } + break; + case MMDP_STAGE_START_PARENT: + if ( !WH_ParentConnect(WH_CONNECTMODE_MP_PARENT, ++tgid, WH_GetMeasureChannel()) ) + { + printWMError("WH_ParentConnect() was failed"); + } + else + { + stage = MMDP_STAGE_WAIT_START_PARENT; + } + break; + case MMDP_STAGE_WAIT_START_PARENT: + if ( WH_GetSystemState() == WH_SYSSTATE_CONNECTED ) + { + stage = MMDP_STAGE_START_MP; + } + break; + case MMDP_STAGE_START_MP: + if ( WH_GetSystemState() == WH_SYSSTATE_ERROR ) + { + printWMError("Some error occurred."); + } + break; + case MMDP_STAGE_END: + break; + } +} + +static u16 ParentWEPKeyGenerator(u16 *wepkey, const WMParentParam *parentParam) +{ + u16 data[20 / sizeof(u16)]; + u16 tmpWep[20 / sizeof(u16)]; + u8 macAddress[WM_SIZE_MACADDR]; + UserGameInfo* userGameInfo = (UserGameInfo*)parentParam->userGameInfo; + + OS_GetMacAddress(macAddress); + MI_CpuClear16(data, sizeof(data)); + + // 前もって WH_ParentConnect 関数の直前に WH_SetUserGameInfo 関数で + // UserGameInfo に設定しておいた Seed 値を WEP Key に反映させる + MI_CpuCopy16(&userGameInfo->wepSeed, data, 4); + // 同じアルゴリズムを異なるアプリケーションで使いまわせるように + // GGID も WEP Key に反映させる + MI_CpuCopy16(&parentParam->ggid, data + 2, sizeof(u32)); + *(u16 *)(data + 4) = parentParam->tgid; + // 親機が異なれば WEP Key も異なるように MAC Address も WEP Key に反映させる + MI_CpuCopy8(macAddress, (u8 *)(data + 5), WM_SIZE_MACADDR); + + // HMAC-SHA-1 で鍵付ハッシュ値を取り、128bit に切り詰めて WEP Key とする。 + // HMAC で使用する鍵はアプリケーション固有のものとすること。 + // (HMAC に関しては RFC2104 参照) + MATH_CalcHMACSHA1(tmpWep, data, sizeof(data), SECRET_KEY, SECRET_KEY_LENGTH); + MI_CpuCopy8(tmpWep, wepkey, 16); + OS_TPrintf("wepkey: %04x%04x %04x%04x %04x%04x %04x%04x\n", wepkey[0], wepkey[1], + wepkey[2], wepkey[3], wepkey[4], wepkey[5], wepkey[6], wepkey[7]); + + return WM_WEPMODE_128BIT; +} + +static void ParentReceiveCallback(u16 aid, u16 *data, u16 length) +{ + OS_TPrintf("ParentReceiveCallback: %d, 0x%x, %d\n", aid, data, length); + if ( aid != 1 ) + { + printWMError("Unsupported AID"); + } + if ( data == NULL ) + { + OS_TPrintf("Received NO data.\n"); + return; + } + if ( length != sizeof(RequestFormat) ) + { + OS_TPrintf("Received invalid length.\n"); + return; + } + ParentSendCallback(data, length); +} + +static void ParentSendCallback(u16 *data, u16 length) +{ + RequestFormat* request = (RequestFormat*)data; + (void)length; + OS_TPrintf("ParentSendCallback: 0x%x, %d (addr=%x, length=%d)\n", data, length, request->addr, request->length); + + // 先頭が範囲外ならエラー + if ( (u32)request->addr < BEGIN_ADDRESS ) + { + printWMError("Unsupported data address from child."); + } + else + { + // 終端が範囲外なら丸めて送信 + u16 len = (u32)request->addr + request->length < END_ADDRESS ? request->length : (u16)(END_ADDRESS - (u32)request->addr); + requestForPrint.addr = request->addr; + requestForPrint.length = len; + WH_SendData(request->addr, len, NULL); + OS_TPrintf("WH_SendData: addr=%x, length=%d\n", request->addr, len); + } +} + +static void whSessionUpdateCallback(void* arg) +{ + switch ( ((WMCallback*)arg)->apiid ) + { + case WM_APIID_START_MP: + { + WMStartMPCallback *cb = (WMStartMPCallback *)arg; + if ( cb->state == WM_STATECODE_MP_START ) + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_START_MP: WM_STATECODE_MP_START: %d\n", cb->errcode); + } + } + break; + case WM_APIID_START_PARENT: + { + WMStartParentCallback* cb = (WMStartParentCallback*)arg; + switch ( cb->state ) + { + case WM_STATECODE_CONNECTED: + OS_TPrintf("whSessionUpdateCallback: WM_APIID_START_PARENT: WM_STATE_CODE_CONNECTED: %d\n", cb->aid); + break; + case WM_STATECODE_DISCONNECTED: + OS_TPrintf("whSessionUpdateCallback: WM_APIID_START_PARENT: WM_STATE_CODE_DISCONNECTED: %d\n", cb->aid); + if ( (u32)requestForPrint.addr + requestForPrint.length >= END_ADDRESS ) + { + mmdumperEnd(); + stage = MMDP_STAGE_END; + } + break; + } + } + break; + case WM_APIID_SET_MP_DATA: + { + WMPortSendCallback* cb = (WMPortSendCallback*)arg; + if ( cb->errcode ) + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_SET_MP_DATA: %d\n", cb->errcode); + } + else + { + OS_TPrintf("whSessionUpdateCallback: WM_APIID_SET_MP_DATA: %d %d %d \n", cb->destBitmap, cb->restBitmap, cb->sentBitmap); + } + } + break; + default: + OS_TPrintf("whSessionUpdateCallback: apiid=%d\n", ((WMCallback*)arg)->apiid); + break; + } +} diff --git a/build/tools/MainMemoryDumper/src/mmdumper.c b/build/tools/MainMemoryDumper/src/mmdumper.c new file mode 100644 index 0000000..f2f609f --- /dev/null +++ b/build/tools/MainMemoryDumper/src/mmdumper.c @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------* + Project: MainMemoryDumper + File: main.c + + Copyright 2011 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 "wh.h" +#include "misc_simple.h" +#include "data.h" +#include "mmdumper.h" +#include "mmd_parent.h" +#include "mmd_client.h" + +// extern data----------------------------------------------------------------- + +// define data----------------------------------------------------------------- +#define WH_GGID SDK_MAKEGGID_SYSTEM(0xfe) + +// function's prototype------------------------------------------------------- +static void printHeader(void); +static void printParentOrClient(void); +static void actionParentOrClient(void); + +static void TraceWH(const char *fmt, ...); + +// global variable------------------------------------------------------------- + +// static variable------------------------------------------------------------- +static MMDumperStage stage; + +static u16 cursor; + +static MenuPos pos[] = +{ + { TRUE, 1, 3 }, + { TRUE, 1, 4 }, + { TRUE, 1, 5 }, + { TRUE, 1, 6 }, + { TRUE, 1, 7 }, + { TRUE, 1, 8 }, + { TRUE, 1, 9 }, + { TRUE, 1, 10 }, + { TRUE, 1, 11 }, + { TRUE, 1, 12 }, + { TRUE, 1, 13 }, + { TRUE, 1, 14 }, +}; + +// const data------------------------------------------------------------------ +static const char *strStage[] = +{ + "", + "(Parent)", + "(Client)", + "", + "", + "!ERROR!" +}; + +static const char *strParentOrClient[] = +{ + "Parent for dumping", + "Client for storing" +}; +static const MenuParam menuParentOrClient = +{ + sizeof(strParentOrClient)/sizeof(char*), + TXT_COLOR_BLACK, + TXT_COLOR_DARKGREEN, + TXT_COLOR_DARKGRAY, + pos, + strParentOrClient +}; + + +// ============================================================================ +// function's description +// ============================================================================ +void mmdumperInit(void) +{ + stage = MMD_STAGE_INIT; + cursor = 0; + + WH_SetGgid(WH_GGID); + WH_SetDebugOutput(TraceWH); +} + +void mmdumperEnd(void) +{ + WH_Finalize(); + stage = MMD_STAGE_END; +} + +BOOL mmdumperMain(void) +{ + printHeader(); + + switch (stage) + { + case MMD_STAGE_INIT: + if ( OS_IsRunOnTwl() ) + { + printParentOrClient(); + actionParentOrClient(); + } + else + { + stage = MMD_STAGE_PARENT; + } + break; + case MMD_STAGE_PARENT: + printParent(); + actionParent(); + break; + case MMD_STAGE_CLIENT: + printClient(); + actionClient(); + break; + case MMD_STAGE_PRE_END: + mmdumperEnd(); + stage = MMD_STAGE_END; + break; + case MMD_STAGE_END: + myDp_Printf(1, 3, TXT_COLOR_BLACK, MAIN_SCREEN, "Done."); + break; + } + if ( stage == MMD_STAGE_ERROR ) + { + return FALSE; + } + return TRUE; +} + +void printWMError(const char* strWMError) +{ + myDp_Printf(1, 18, TXT_COLOR_RED, MAIN_SCREEN, "WMError: %s", strWMError); + mmdumperEnd(); + stage = MMD_STAGE_ERROR; +} + +u16 cursorUpDown(u16 now, u16 nums) +{ + if ( DEMO_IS_TRIG( PAD_KEY_UP ) ) + { + return (now + nums - 1) % nums; + } + if ( DEMO_IS_TRIG( PAD_KEY_DOWN ) ) + { + return (now + 1) % nums; + } + return now; +} + + +static void printHeader(void) +{ + myDp_Printf(1, 1, TXT_COLOR_BLUE, MAIN_SCREEN, "Main Memory Dumper %s", strStage[stage]); +} + +#include +static void printParentOrClient(void) +{ + myDp_DrawMenu(cursor, MAIN_SCREEN, &menuParentOrClient); +} + +static void actionParentOrClient(void) +{ + cursor = cursorUpDown(cursor, (u16)menuParentOrClient.num); + + if ( DEMO_IS_TRIG( PAD_BUTTON_A ) ) + { + switch (cursor) + { + case 0: stage = MMD_STAGE_PARENT; break; + case 1: stage = MMD_STAGE_CLIENT; break; + } + } +} +#include + +static void TraceWH(const char *fmt, ...) +{ + va_list vlist; + char temp[SCREEN_SIZE+1]; + temp[sizeof(temp)-1] = 0; + va_start(vlist, fmt); + STD_TVSNPrintf(temp, sizeof(temp) - 1, fmt, vlist); + va_end(vlist); + myDp_Write(1, 20, TXT_COLOR_RED, MAIN_SCREEN, temp); + OS_TPrintf("(1,20) %s\n", temp); +}