mirror of
https://github.com/rvtr/TwlToolsRED.git
synced 2025-10-31 06:41:18 -04:00
[メインメモリの内容を別本体にMPで転送するツール] とりあえず完成
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@572 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
parent
7ee77b384b
commit
b366026f40
BIN
build/tools/MainMemoryDumper/040A/libsyscall_c.bin
Normal file
BIN
build/tools/MainMemoryDumper/040A/libsyscall_c.bin
Normal file
Binary file not shown.
BIN
build/tools/MainMemoryDumper/040A/rom_header_040a.template.sbin
Normal file
BIN
build/tools/MainMemoryDumper/040A/rom_header_040a.template.sbin
Normal file
Binary file not shown.
74
build/tools/MainMemoryDumper/Makefile
Normal file
74
build/tools/MainMemoryDumper/Makefile
Normal file
@ -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 =====
|
||||
156
build/tools/MainMemoryDumper/ROM-TS.TWL.rsf
Normal file
156
build/tools/MainMemoryDumper/ROM-TS.TWL.rsf
Normal file
@ -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)
|
||||
}
|
||||
74
build/tools/MainMemoryDumper/etc/banner/Makefile
Normal file
74
build/tools/MainMemoryDumper/etc/banner/Makefile
Normal file
@ -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
|
||||
|
||||
#
|
||||
BIN
build/tools/MainMemoryDumper/etc/banner/myGameBanner.TWL.bsf
Normal file
BIN
build/tools/MainMemoryDumper/etc/banner/myGameBanner.TWL.bsf
Normal file
Binary file not shown.
BIN
build/tools/MainMemoryDumper/etc/banner/myGameBanner.bsf
Normal file
BIN
build/tools/MainMemoryDumper/etc/banner/myGameBanner.bsf
Normal file
Binary file not shown.
BIN
build/tools/MainMemoryDumper/etc/banner/myGameIcon.TWL.bin
Normal file
BIN
build/tools/MainMemoryDumper/etc/banner/myGameIcon.TWL.bin
Normal file
Binary file not shown.
BIN
build/tools/MainMemoryDumper/etc/banner/myGameIcon.bmp
Normal file
BIN
build/tools/MainMemoryDumper/etc/banner/myGameIcon.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
29
build/tools/MainMemoryDumper/include/data.h
Normal file
29
build/tools/MainMemoryDumper/include/data.h
Normal file
@ -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
|
||||
97
build/tools/MainMemoryDumper/include/misc_simple.h
Normal file
97
build/tools/MainMemoryDumper/include/misc_simple.h
Normal file
@ -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 <twl.h>
|
||||
#include <DEMO.h>
|
||||
|
||||
#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__
|
||||
51
build/tools/MainMemoryDumper/include/mmd_client.h
Normal file
51
build/tools/MainMemoryDumper/include/mmd_client.h
Normal file
@ -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 <twl.h>
|
||||
#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__
|
||||
53
build/tools/MainMemoryDumper/include/mmd_parent.h
Normal file
53
build/tools/MainMemoryDumper/include/mmd_parent.h
Normal file
@ -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 <twl.h>
|
||||
#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__
|
||||
76
build/tools/MainMemoryDumper/include/mmdumper.h
Normal file
76
build/tools/MainMemoryDumper/include/mmdumper.h
Normal file
@ -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 <twl.h>
|
||||
|
||||
#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__
|
||||
60
build/tools/MainMemoryDumper/include/wh_config.h
Normal file
60
build/tools/MainMemoryDumper/include/wh_config.h
Normal file
@ -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__
|
||||
620
build/tools/MainMemoryDumper/src/data.c
Normal file
620
build/tools/MainMemoryDumper/src/data.c
Normal file
@ -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, // <20>c
|
||||
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 */
|
||||
72
build/tools/MainMemoryDumper/src/main.c
Normal file
72
build/tools/MainMemoryDumper/src/main.c
Normal file
@ -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 <twl.h>
|
||||
#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ブランク割込チェックのセット
|
||||
}
|
||||
|
||||
154
build/tools/MainMemoryDumper/src/misc_simple.c
Normal file
154
build/tools/MainMemoryDumper/src/misc_simple.c
Normal file
@ -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 <twl.h>
|
||||
#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; l<param->num; 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] );
|
||||
}
|
||||
}
|
||||
344
build/tools/MainMemoryDumper/src/mmd_client.c
Normal file
344
build/tools/MainMemoryDumper/src/mmd_client.c
Normal file
@ -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 <twl.h>
|
||||
#include <twl/os/common/format_rom.h>
|
||||
#include "wh.h"
|
||||
#include "misc_simple.h"
|
||||
#include "mmd_client.h"
|
||||
|
||||
#include <twl/ltdmain_begin.h>
|
||||
|
||||
// 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 <twl/ltdmain_end.h>
|
||||
291
build/tools/MainMemoryDumper/src/mmd_parent.c
Normal file
291
build/tools/MainMemoryDumper/src/mmd_parent.c
Normal file
@ -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 <twl.h>
|
||||
#include <twl/os/common/format_rom.h>
|
||||
#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;
|
||||
}
|
||||
}
|
||||
203
build/tools/MainMemoryDumper/src/mmdumper.c
Normal file
203
build/tools/MainMemoryDumper/src/mmdumper.c
Normal file
@ -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 <twl.h>
|
||||
#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 <twl/ltdmain_begin.h>
|
||||
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 <twl/ltdmain_end.h>
|
||||
|
||||
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);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user