add new NDS firmware tool

This commit is contained in:
mtabachenko 2009-12-19 17:13:59 +00:00
parent d96d624d6e
commit 217c1d336f
11 changed files with 2280 additions and 0 deletions

View File

@ -0,0 +1,12 @@
NDS Firmware tools
Copyright (C) 2009 by DeSmuME Team
-= History =-
0.0.3 (19/12/2009)
- add WiFi settings viewer
0.0.2 (18/12/2009)
- add user settings viewer
0.0.1 (17/12/2009)
- initial version

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nds_firmware_tool_VS2008", "nds_firmware_tool_VS2008.vcproj", "{6D076DD4-4000-4249-BDEA-F7AB407C813D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Devel|Win32 = Devel|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6D076DD4-4000-4249-BDEA-F7AB407C813D}.Devel|Win32.ActiveCfg = Devel|Win32
{6D076DD4-4000-4249-BDEA-F7AB407C813D}.Devel|Win32.Build.0 = Devel|Win32
{6D076DD4-4000-4249-BDEA-F7AB407C813D}.Release|Win32.ActiveCfg = Release|Win32
{6D076DD4-4000-4249-BDEA-F7AB407C813D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,222 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="nds_firmware_tool_VS2008"
ProjectGUID="{6D076DD4-4000-4249-BDEA-F7AB407C813D}"
RootNamespace="nds_firmware_tool"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Devel|Win32"
OutputDirectory=".\.VS2008\$(ConfigurationName)"
IntermediateDirectory=".\.VS2008\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;DEVEL_VERSION"
ExceptionHandling="1"
RuntimeLibrary="0"
StructMemberAlignment="5"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
CallingConvention="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib"
OutputFile=".\.bin\$(ProjectName)_dev.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
AdditionalManifestFiles=".\src\nds_firmware_tool.manifest"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\.VS2008\$(ConfigurationName)"
IntermediateDirectory=".\.VS2008\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="0"
DebugInformationFormat="0"
CallingConvention="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib"
OutputFile=".\.bin\$(ProjectName).exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
AdditionalManifestFiles=".\src\nds_firmware_tool.manifest"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\common.h"
>
</File>
<File
RelativePath=".\src\console.cpp"
>
</File>
<File
RelativePath=".\src\console.h"
>
</File>
<File
RelativePath=".\src\main.cpp"
>
</File>
<File
RelativePath=".\src\main.h"
>
</File>
<File
RelativePath=".\src\resource_ids.h"
>
</File>
<File
RelativePath=".\src\templates.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,125 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _COMMON_H__
#define _COMMON_H__
#if defined(_MSC_VER) || defined(__INTEL_COMPILER)
#pragma warning(disable: 4995)
#pragma warning(disable: 4996)
#endif
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned __int64 u64;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef __int64 s64;
char __forceinline *hex2(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "0x%02X", val);
return strdup(buf);
}
char __forceinline *hex2w(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "%02X", val);
return strdup(buf);
}
char __forceinline *hex4(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "0x%04X", val);
return strdup(buf);
}
char __forceinline *hex4w(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "%04X", val);
return strdup(buf);
}
char __forceinline *hex6(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "0x%06X", val);
return strdup(buf);
}
char __forceinline *hex6w(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "%06X", val);
return strdup(buf);
}
char __forceinline *hex8(const u32 val)
{
char buf[30] = {0};
sprintf(buf, "0x%08X", val);
return strdup(buf);
}
#ifdef _WIN32
char __forceinline *error()
{
LPVOID lpMsgBuf = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 512, NULL);
return strdup((char*)lpMsgBuf);
}
u8 __forceinline read8(u8 *mem, u32 offset)
{
return (*(u8*)(mem + offset));
}
u16 __forceinline read16(u8 *mem, u32 offset)
{
return (*(u16*)(mem + offset));
}
u32 __forceinline read24(u8 *mem, u32 offset)
{
return (*(u16*)(mem + offset)) | (*(u8*)(mem + offset+2) << 16);
}
u32 __forceinline read32(u8 *mem, u32 offset)
{
return (*(u32*)(mem + offset));
}
u64 __forceinline read64(u8 *mem, u32 offset)
{
return (*(u64*)(mem + offset));
}
#endif
#endif

View File

@ -0,0 +1,111 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "console.h"
#include "main.h"
///////////////////////////////////////////////////////////////// Console
#ifdef DEVEL_VERSION
#include <windows.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#define BUFFER_SIZE 100
HANDLE hConsole;
void OpenConsole()
{
COORD csize;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
SMALL_RECT srect;
char buf[256];
//dont do anything if we're already attached
if (hConsole) return;
//attach to an existing console (if we can; this is circuitous because AttachConsole wasnt added until XP)
//remember to abstract this late bound function notion if we end up having to do this anywhere else
bool attached = false;
HMODULE lib = LoadLibrary("kernel32.dll");
if(lib)
{
typedef BOOL (WINAPI *_TAttachConsole)(DWORD dwProcessId);
_TAttachConsole _AttachConsole = (_TAttachConsole)GetProcAddress(lib,"AttachConsole");
if(_AttachConsole)
{
if(_AttachConsole(-1))
attached = true;
}
FreeLibrary(lib);
}
//if we failed to attach, then alloc a new console
if(!attached)
{
AllocConsole();
}
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
//redirect stdio
long lStdHandle = (long)hConsole;
int hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
if(hConHandle == -1)
return; //this fails from a visual studio command prompt
#if 1
FILE *fp = _fdopen( hConHandle, "w" );
#else
FILE *fp = fopen( "c:\\desmume.log", "w" );
#endif
*stdout = *fp;
//and stderr
*stderr = *fp;
memset(buf,0,256);
sprintf(buf,"%s OUTPUT", _TITLE);
SetConsoleTitle(TEXT(buf));
csize.X = 60;
csize.Y = 800;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csize);
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbiInfo);
srect = csbiInfo.srWindow;
srect.Right = srect.Left + 99;
srect.Bottom = srect.Top + 64;
SetConsoleWindowInfo(GetStdHandle(STD_OUTPUT_HANDLE), TRUE, &srect);
SetConsoleCP(GetACP());
SetConsoleOutputCP(GetACP());
if(attached) printf("\n");
printf("%s\n",_TITLE);
printf("- compiled: %s %s\n\n",__DATE__,__TIME__);
}
void CloseConsole()
{
if (hConsole == NULL) return;
INFO("Closing...");
FreeConsole();
hConsole = NULL;
}
#else
void OpenConsole() {}
void CloseConsole() {}
#endif

View File

@ -0,0 +1,33 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __CONSOLE_H_
#define __CONSOLE_H_
#ifdef DEVEL_VERSION
#define INFO(...) printf(__VA_ARGS__)
#else
#define INFO(...)
#endif
extern void OpenConsole();
extern void CloseConsole();
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __MAIN_H_
#define __MAIN_H_
#include <windows.h>
#include <stdio.h>
#include "common.h"
#include "console.h"
#define _TITLE "NDS Firmware tool v0.0.3 by DeSmuME Team"
#define MAINCLASS "NDS_FIRMWARE_TOOLS"
typedef struct
{
u16 part3_rom_gui9_addr; // 000h
u16 part4_rom_wifi7_addr; // 002h
u16 part34_gui_wifi_crc16; // 004h
u16 part12_boot_crc16; // 006h
u8 fw_identifier[4]; // 008h
u16 part1_rom_boot9_addr; // 00Ch
u16 part1_ram_boot9_addr; // 00Eh
u16 part2_rom_boot7_addr; // 010h
u16 part2_ram_boot7_addr; // 012h
u16 shift_amounts; // 014h
u16 part5_data_gfx_addr; // 016h
u8 fw_timestamp[5]; // 018h
u8 console_type; // 01Dh
u16 unused1; // 01Eh
u16 user_settings_offset; // 020h
u16 unknown1; // 022h
u16 unknown2; // 024h
u16 part5_crc16; // 026h
u16 unused2; // 028h - FFh filled
} HEADER;
#endif

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="NDS_Firmware_tools"
processorArchitecture="x86"
version="1.0.0.0"
type="win32"/>
<description>NDS Firmware tools</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1,146 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _RESOURCE_IDS_H_
#define _RESOURCE_IDS_H_
#define IDC_H_EDIT_START 100000
#define IDC_H1_TYPE 100001
#define IDC_H1_VERSION 100002
#define IDC_H1_TIMESTAMP 100003
#define IDC_H1_SIZE 100004
#define IDC_H1_CRC 100005
#define IDC_H1_ARM9_ROM 100006
#define IDC_H1_ARM9_RAM 100007
#define IDC_H1_ARM9_GUI 100008
#define IDC_H1_ARM7_ROM 100009
#define IDC_H1_ARM7_RAM 100010
#define IDC_H1_ARM7_WIFI 100011
#define IDC_H2_TYPE 100021
#define IDC_H2_VERSION 100022
#define IDC_H2_SIZE 100023
#define IDC_H2_CRC 100024
#define IDC_H2_ARM9_ROM 100025
#define IDC_H2_ARM9_RAM 100026
#define IDC_H2_ARM9_GUI 100027
#define IDC_H2_ARM7_ROM 100028
#define IDC_H2_ARM7_RAM 100029
#define IDC_H2_ARM7_WIFI 100030
#define IDC_H_EDIT_LAST 100300
#define IDC_COLOR 100500
#define IDC_BBROWSE 300000
#define IDC_BPATH 300001
#define IDC_BEXIT 300002
#define IDC_BUSER 300003
#define IDC_BWIFI 300005
#define IDC_BWIFIAP 300006
#define IDC_NICKNAME 300020
#define IDC_MESSAGE 300021
#define IDC_BIRTH_DAY 300022
#define IDC_BIRTH_MONTH 300023
#define IDC_LANGUAGE 300024
#define IDC_ALARM_ON 300025
#define IDC_ALARM_HOUR 300026
#define IDC_ALARM_MIN 300027
#define IDC_GBA_MODE_SCREENS 300028
#define IDC_BRIGHTLIGHT_LEVEL 300029
#define IDC_BOOTMENU 300030
#define IDC_TADC_X1 300031
#define IDC_TADC_Y1 300032
#define IDC_TADC_X2 300033
#define IDC_TADC_Y2 300034
#define IDC_TSCR_X1 300035
#define IDC_TSCR_Y1 300036
#define IDC_TSCR_X2 300037
#define IDC_TSCR_Y2 300038
#define IDC_RTC_OFFSET 300039
#define IDC_YEAR_BOOT 300040
#define IDC_UPDATE_COUNTER 300041
#define IDC_USER_CRC16 300042
#define IDC_WIFI_044 301000
#define IDC_WIFI_046 301001
#define IDC_WIFI_048 301002
#define IDC_WIFI_04A 301003
#define IDC_WIFI_04C 301004
#define IDC_WIFI_04E 301005
#define IDC_WIFI_050 301006
#define IDC_WIFI_052 301007
#define IDC_WIFI_054 301008
#define IDC_WIFI_056 301009
#define IDC_WIFI_058 301010
#define IDC_WIFI_05A 301011
#define IDC_WIFI_05C 301012
#define IDC_WIFI_05E 301013
#define IDC_WIFI_060 301014
#define IDC_WIFI_062 301015
#define IDC_WIFI_ECHANNEL_01 300200
#define IDC_WIFI_ECHANNEL_02 300201
#define IDC_WIFI_ECHANNEL_03 300202
#define IDC_WIFI_ECHANNEL_04 300203
#define IDC_WIFI_ECHANNEL_05 300204
#define IDC_WIFI_ECHANNEL_06 300205
#define IDC_WIFI_ECHANNEL_07 300206
#define IDC_WIFI_ECHANNEL_08 300207
#define IDC_WIFI_ECHANNEL_09 300208
#define IDC_WIFI_ECHANNEL_10 300209
#define IDC_WIFI_ECHANNEL_11 300210
#define IDC_WIFI_ECHANNEL_12 300211
#define IDC_WIFI_ECHANNEL_13 300212
#define IDC_WIFI_ECHANNEL_14 300213
#define IDC_WIFI_EDIT_STATIC 300400
#define IDC_WIFI_CRC16 300401
#define IDC_WIFI_VERSION 300402
#define IDC_WIFI_MACID 300403
#define IDC_WIFI_RFTYPE 300404
#define IDC_WIFI_BB 300500
#define IDC_WIFI_RF2_INIT 300700
#define IDC_WIFI_RF2_56_CH 300750
#define IDC_WIFI_RF2_BB_RF_CH 300800
#define IDC_WIFI_AP_SSID 301000
#define IDC_WIFI_AP_SSID2 301001
#define IDC_WIFI_AP_WEP_SIZE 301002
#define IDC_WIFI_AP_WEP_EMETHOD 301003
#define IDC_WIFI_AP_KEY1 301004
#define IDC_WIFI_AP_KEY2 301005
#define IDC_WIFI_AP_KEY3 301006
#define IDC_WIFI_AP_KEY4 301007
#define IDC_WIFI_AP_USER_ID 301008
#define IDC_WIFI_AP_IP 301009
#define IDC_WIFI_AP_IPMASK 301010
#define IDC_WIFI_AP_GATEWAY 301011
#define IDC_WIFI_AP_DNS1 301012
#define IDC_WIFI_AP_DNS2 301013
#define IDC_WIFI_AP_STATUS 301014
#define IDC_WIFI_AP_CRC16 301015
#endif

View File

@ -0,0 +1,324 @@
/* NDS Firmware tools
Copyright 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __TEMPLATES_H_
#include "common.h"
#include "resource_ids.h"
typedef struct
{
char wclass[20];
char wtitle[50];
u32 style;
u32 x;
u32 y;
u32 w;
u32 h;
u32 id;
} TEMPLATE;
#define Y_HEADER 65
#define Y_ARM9 250
#define Y_ARM7 375
#define Y_OTHERS 520
#define X_SECOND_FW 350
#define Y_BUTTONS 500
const TEMPLATE TmainWnd[] = {
{"STATIC", "Firmware path:", 0, 5, 5, 100, 20, NULL},
{"EDIT", "", ES_READONLY, 5, 25, 595, 20, IDC_BPATH},
{"BUTTON", "Browse...", WS_TABSTOP | BS_DEFPUSHBUTTON, 610, 25, 80, 20, IDC_BBROWSE},
{"BUTTON", "Header data", BS_GROUPBOX, 4, Y_HEADER, 340, 180, NULL},
{"STATIC", "Console type", 0, 15, Y_HEADER + 30, 300, 20, NULL},
{"STATIC", "Version", 0, 15, Y_HEADER + 60, 300, 20, NULL},
{"STATIC", "Built timestamp (d/m/y h:m)", 0, 15, Y_HEADER + 90, 300, 20, NULL},
{"STATIC", "Size of firmware", 0, 15, Y_HEADER + 120, 300, 20, NULL},
{"STATIC", "CRC", 0, 15, Y_HEADER + 150, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_HEADER + 30, 100, 20, IDC_H1_TYPE},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_HEADER + 60, 100, 20, IDC_H1_VERSION},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_HEADER + 90, 100, 20, IDC_H1_TIMESTAMP},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_HEADER + 120, 100, 20, IDC_H1_SIZE},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_HEADER + 150, 100, 20, IDC_H1_CRC},
{"BUTTON", "ARM9", BS_GROUPBOX, 4, Y_ARM9, 340, 120, NULL},
{"STATIC", "ARM9 boot code address", 0, 15, Y_ARM9+30, 300, 20, NULL},
{"STATIC", "ARM9 boot code RAM address", 0, 15, Y_ARM9+60, 300, 20, NULL},
{"STATIC", "ARM9 GUI code address", 0, 15, Y_ARM9+90, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM9 + 30, 100, 20, IDC_H1_ARM9_ROM},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM9 + 60, 100, 20, IDC_H1_ARM9_RAM},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM9 + 90, 100, 20, IDC_H1_ARM9_GUI},
{"BUTTON", "ARM7", BS_GROUPBOX, 4, Y_ARM7, 340, 120, NULL},
{"STATIC", "ARM7 boot code address", 0, 15, Y_ARM7+30, 300, 20, NULL},
{"STATIC", "ARM7 boot code RAM address", 0, 15, Y_ARM7+60, 300, 20, NULL},
{"STATIC", "ARM7 WiFi code address", 0, 15, Y_ARM7+90, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM7 + 30, 100, 20, IDC_H1_ARM7_ROM},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM7 + 60, 100, 20, IDC_H1_ARM7_RAM},
{"EDIT", "", ES_READONLY | ES_RIGHT, 230, Y_ARM7 + 90, 100, 20, IDC_H1_ARM7_WIFI},
{"BUTTON", "FlashME: Header data", BS_GROUPBOX, X_SECOND_FW, Y_HEADER, 340, 120, NULL},
{"STATIC", "FlashME version", 0, X_SECOND_FW+11, Y_HEADER + 30, 300, 20, NULL},
{"STATIC", "Size of firmware", 0, X_SECOND_FW+11, Y_HEADER + 60, 300, 20, NULL},
{"STATIC", "CRC", 0, X_SECOND_FW+11, Y_HEADER + 90, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_HEADER + 30, 100, 20, IDC_H2_VERSION},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_HEADER + 60, 100, 20, IDC_H2_SIZE},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_HEADER + 90, 100, 20, IDC_H2_CRC},
{"BUTTON", "FlashME: ARM9", BS_GROUPBOX, X_SECOND_FW, Y_ARM9, 340, 120, NULL},
{"STATIC", "ARM9 boot code address", 0, X_SECOND_FW+11, Y_ARM9+30, 300, 20, NULL},
{"STATIC", "ARM9 boot code RAM address", 0, X_SECOND_FW+11, Y_ARM9+60, 300, 20, NULL},
{"STATIC", "ARM9 GUI code address", 0, X_SECOND_FW+11, Y_ARM9+90, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM9 + 30, 100, 20, IDC_H2_ARM9_ROM},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM9 + 60, 100, 20, IDC_H2_ARM9_RAM},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM9 + 90, 100, 20, IDC_H2_ARM9_GUI},
{"BUTTON", "FlashME: ARM7", BS_GROUPBOX, X_SECOND_FW, Y_ARM7, 340, 120, NULL},
{"STATIC", "ARM7 boot code address", 0, X_SECOND_FW+11, Y_ARM7+30, 300, 20, NULL},
{"STATIC", "ARM7 boot code RAM address", 0, X_SECOND_FW+11, Y_ARM7+60, 300, 20, NULL},
{"STATIC", "ARM7 WiFi code address", 0, X_SECOND_FW+11, Y_ARM7+90, 300, 20, NULL},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM7 + 30, 100, 20, IDC_H2_ARM7_ROM},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM7 + 60, 100, 20, IDC_H2_ARM7_RAM},
{"EDIT", "", ES_READONLY | ES_RIGHT, X_SECOND_FW+230, Y_ARM7 + 90, 100, 20, IDC_H2_ARM7_WIFI},
{"BUTTON", "User", WS_TABSTOP | WS_DISABLED, 5, Y_BUTTONS, 100, 20, IDC_BUSER},
{"BUTTON", "WiFi", WS_TABSTOP | WS_DISABLED, 120, Y_BUTTONS, 100, 20, IDC_BWIFI},
{"BUTTON", "WiFi AP", WS_TABSTOP | WS_DISABLED, 235, Y_BUTTONS, 100, 20, IDC_BWIFIAP},
{"BUTTON", "Dump", WS_TABSTOP | WS_DISABLED, 350, Y_BUTTONS, 100, 20, NULL},
{"BUTTON", "Extract...", WS_TABSTOP | WS_DISABLED, 465, Y_BUTTONS, 100, 20, NULL},
{"BUTTON", "Exit", WS_TABSTOP, 620, Y_BUTTONS, 70, 20, IDC_BEXIT}
};
#define Y_BIRTH_LANG 105
#define Y_FAV_COLOR 165
#define Y_TCALIB 290
#define Y_USR_MISC 385
#define Y_USR_BUTTONS 570
const TEMPLATE TuserDlg1[] = {
{"STATIC", "Nickname:", 0, 5, 5, 100, 17, NULL},
{"EDIT", "", WS_TABSTOP, 5, 25, 160, 17, IDC_NICKNAME},
{"STATIC", "Message:", 0, 5, 55, 100, 17, NULL},
{"EDIT", "", WS_TABSTOP, 5, 75, 400, 17, IDC_MESSAGE},
{"BUTTON", "Birthday", BS_GROUPBOX, 4, Y_BIRTH_LANG, 160, 55, NULL},
{"COMBOBOX", "Day", WS_TABSTOP | WS_VSCROLL | BS_GROUPBOX, 15, Y_BIRTH_LANG+20, 40, 120, IDC_BIRTH_DAY},
{"COMBOBOX", "Month", WS_TABSTOP | BS_GROUPBOX, 60, Y_BIRTH_LANG+20, 95, 120, IDC_BIRTH_MONTH},
{"BUTTON", "Language", BS_GROUPBOX, 170, Y_BIRTH_LANG, 110, 55, NULL},
{"COMBOBOX", "Language", WS_TABSTOP | BS_GROUPBOX, 180, Y_BIRTH_LANG+20, 90, 120, IDC_LANGUAGE},
{"BUTTON", "Alarm", BS_GROUPBOX, 285, Y_BIRTH_LANG, 120, 55, NULL},
{"BUTTON", "", WS_TABSTOP | BS_AUTOCHECKBOX, 295, Y_BIRTH_LANG+25, 13, 13, IDC_ALARM_ON},
{"COMBOBOX", "hour", WS_TABSTOP | WS_VSCROLL | BS_GROUPBOX, 315, Y_BIRTH_LANG+20, 40, 120, IDC_ALARM_HOUR},
{"COMBOBOX", "min", WS_TABSTOP | WS_VSCROLL | BS_GROUPBOX, 355, Y_BIRTH_LANG+20, 40, 120, IDC_ALARM_MIN},
{"BUTTON", "Favorite color", BS_GROUPBOX, 4, Y_FAV_COLOR, 400, 115, NULL}
};
const TEMPLATE TuserDlg2[] = {
{"BUTTON", "Touch-screen calibraion (HEX)",BS_GROUPBOX, 4, Y_TCALIB, 400, 95, NULL},
{"BUTTON", "ADC", BS_GROUPBOX, 14, Y_TCALIB+15, 190, 75, NULL},
{"STATIC", "X1", 0, 25, Y_TCALIB+35, 100, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT , 45, Y_TCALIB+35, 50, 17, IDC_TADC_X1},
{"STATIC", "Y1", 0, 25, Y_TCALIB+60, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 45, Y_TCALIB+60, 50, 17, IDC_TADC_Y1},
{"STATIC", "X2", 0, 120, Y_TCALIB+35, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 140, Y_TCALIB+35, 50, 17, IDC_TADC_X2},
{"STATIC", "Y2", 0, 120, Y_TCALIB+60, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 140, Y_TCALIB+60, 50, 17, IDC_TADC_Y2},
{"BUTTON", "Screen", BS_GROUPBOX, 205, Y_TCALIB+15, 190, 75, NULL},
{"STATIC", "X1", 0, 215, Y_TCALIB+35, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 235, Y_TCALIB+35, 50, 17, IDC_TSCR_X1},
{"STATIC", "Y1", 0, 215, Y_TCALIB+60, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 235, Y_TCALIB+60, 50, 17, IDC_TSCR_Y1},
{"STATIC", "X2", 0, 310, Y_TCALIB+35, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 330, Y_TCALIB+35, 50, 17, IDC_TSCR_X2},
{"STATIC", "Y2", 0, 310, Y_TCALIB+60, 40, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 330, Y_TCALIB+60, 50, 17, IDC_TSCR_Y2},
{"BUTTON", "Misc", BS_GROUPBOX, 4, Y_USR_MISC, 400, 180, NULL},
{"STATIC", "GBA mode screen selection",0, 15, Y_USR_MISC+20, 180, 17, NULL},
{"COMBOBOX","GBA", WS_TABSTOP | BS_GROUPBOX, 215, Y_USR_MISC+20, 180, 120, IDC_GBA_MODE_SCREENS},
{"STATIC", "Backlight level", 0, 15, Y_USR_MISC+50, 130, 17, NULL},
{"COMBOBOX","Backlight", WS_TABSTOP | BS_GROUPBOX, 215, Y_USR_MISC+50, 180, 120, IDC_BRIGHTLIGHT_LEVEL},
{"STATIC", "Boot menu", 0, 15, Y_USR_MISC+80, 100, 17, NULL},
{"COMBOBOX","boot", WS_TABSTOP | BS_GROUPBOX, 215, Y_USR_MISC+80, 180, 120, IDC_BOOTMENU},
{"STATIC", "RTC offset", 0, 15, Y_USR_MISC+120, 100, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 100, Y_USR_MISC+120, 90, 17, IDC_RTC_OFFSET},
{"STATIC", "First boot (year)", 0, 220, Y_USR_MISC+120, 120, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 345, Y_USR_MISC+120, 50, 17, IDC_YEAR_BOOT},
{"STATIC", "Update counter", ES_READONLY, 15, Y_USR_MISC+150, 120, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 140, Y_USR_MISC+150, 50, 17, IDC_UPDATE_COUNTER},
{"STATIC", "CRC16 (HEX)", ES_READONLY, 220, Y_USR_MISC+150, 90, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 345, Y_USR_MISC+150, 50, 17, IDC_USER_CRC16},
{"BUTTON", "Backup", WS_TABSTOP | WS_DISABLED, 15, Y_USR_BUTTONS, 70, 17, NULL},
{"BUTTON", "Restore", WS_TABSTOP | WS_DISABLED, 90, Y_USR_BUTTONS, 70, 17, NULL},
{"BUTTON", "Update", WS_TABSTOP | WS_DISABLED, 245, Y_USR_BUTTONS, 70, 17, NULL},
{"BUTTON", "Cancel", WS_TABSTOP | BS_DEFPUSHBUTTON, 320, Y_USR_BUTTONS, 70, 17, IDCANCEL}
};
#define Y_WIFI_GENERAL 5
#define X_WIFI_CHANNELS 490
#define Y_WIFI_CHANNELS 5
#define Y_WIFI_REGS 55
#define Y_WIFI_BB 155
#define Y_WIFI_RF 275
#define Y_WIFI_BUTTONS 575
const TEMPLATE TwifiDlg1[] = {
{"BUTTON", "General", BS_GROUPBOX, 4, Y_WIFI_GENERAL, 485, 50, NULL},
{"STATIC", "CRC16", 0, 15, Y_WIFI_GENERAL+20, 45, 17, NULL},
{"EDIT", "", ES_RIGHT | ES_READONLY, 65, Y_WIFI_GENERAL+20, 55, 17, IDC_WIFI_CRC16},
{"STATIC", "Version", 0, 125, Y_WIFI_GENERAL+20, 55, 17, NULL},
{"EDIT", "", ES_RIGHT | ES_READONLY, 180, Y_WIFI_GENERAL+20, 25, 17, IDC_WIFI_VERSION},
{"STATIC", "MAC ID", 0, 215, Y_WIFI_GENERAL+20, 55, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 265, Y_WIFI_GENERAL+20, 110, 17, IDC_WIFI_MACID},
{"STATIC", "RF type", 0, 385, Y_WIFI_GENERAL+20, 55, 17, NULL},
{"EDIT", "", ES_READONLY| ES_RIGHT, 440, Y_WIFI_GENERAL+20, 35, 17, IDC_WIFI_RFTYPE},
{"BUTTON", "Enabled channels", BS_GROUPBOX, X_WIFI_CHANNELS + 4, Y_WIFI_CHANNELS, 230, 50, NULL},
{"BUTTON", "ch01", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 15, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_01},
{"BUTTON", "ch02", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 30, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_02},
{"BUTTON", "ch03", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 45, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_03},
{"BUTTON", "ch04", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 60, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_04},
{"BUTTON", "ch05", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 75, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_05},
{"BUTTON", "ch06", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 90, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_06},
{"BUTTON", "ch07", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 105, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_07},
{"BUTTON", "ch08", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 120, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_08},
{"BUTTON", "ch09", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 135, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_09},
{"BUTTON", "ch10", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 150, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_10},
{"BUTTON", "ch11", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 165, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_11},
{"BUTTON", "ch12", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 180, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_12},
{"BUTTON", "ch13", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 195, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_13},
{"BUTTON", "ch14", WS_TABSTOP | BS_AUTOCHECKBOX, X_WIFI_CHANNELS + 210, Y_WIFI_CHANNELS+25, 13, 13, IDC_WIFI_ECHANNEL_14},
{"BUTTON", "Initial values for... (HEX)", BS_GROUPBOX, 4, Y_WIFI_REGS, 720, 100, NULL},
{"STATIC", "0x4808146", 0, 15, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 15, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_044},
{"STATIC", "0x4808148", 0, 105, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 105, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_046},
{"STATIC", "0x480814A", 0, 195, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 195, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_048},
{"STATIC", "0x480814C", 0, 285, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 285, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_04A},
{"STATIC", "0x4808120", 0, 375, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 375, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_04C},
{"STATIC", "0x4808122", 0, 465, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 465, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_04E},
{"STATIC", "0x4808154", 0, 555, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 555, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_050},
{"STATIC", "0x4808144", 0, 645, Y_WIFI_REGS+15, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 645, Y_WIFI_REGS+30, 70, 17, IDC_WIFI_052},
{"STATIC", "0x4808130", 0, 15, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 15, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_054},
{"STATIC", "0x4808132", 0, 105, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 105, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_056},
{"STATIC", "0x4808140", 0, 195, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 195, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_058},
{"STATIC", "0x4808142", 0, 285, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 285, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_05A},
{"STATIC", "0x4808038", 0, 375, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 375, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_05C},
{"STATIC", "0x4808124", 0, 465, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 465, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_05E},
{"STATIC", "0x4808128", 0, 555, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 555, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_060},
{"STATIC", "0x4808150", 0, 645, Y_WIFI_REGS+55, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_RIGHT, 645, Y_WIFI_REGS+70, 70, 17, IDC_WIFI_062},
{"BUTTON", "Initial 8bit values for BB (HEX)", BS_GROUPBOX, 4, Y_WIFI_BB, 720, 120, NULL},
{"STATIC", " 0:", 0, 15, Y_WIFI_BB+15, 75, 17, NULL},
{"STATIC", "27:", 0, 15, Y_WIFI_BB+40, 75, 17, NULL},
{"STATIC", "53:", 0, 15, Y_WIFI_BB+65, 75, 17, NULL},
{"STATIC", "79:", 0, 15, Y_WIFI_BB+90, 75, 17, NULL}
};
const TEMPLATE TwifiDlg2[] = {
{"BUTTON", "Backup", WS_TABSTOP | WS_DISABLED, 15, Y_WIFI_BUTTONS, 70, 17, NULL},
{"BUTTON", "Restore", WS_TABSTOP | WS_DISABLED, 90, Y_WIFI_BUTTONS, 70, 17, NULL},
{"BUTTON", "Update", WS_TABSTOP | WS_DISABLED, 570, Y_WIFI_BUTTONS, 70, 17, NULL},
{"BUTTON", "Cancel", WS_TABSTOP | BS_DEFPUSHBUTTON, 645, Y_WIFI_BUTTONS, 70, 17, IDCANCEL}
};
#define Y_WIFI_AP_BUTTONS 670
const TEMPLATE TwifiAPDlg1[] = {
{"BUTTON", "Connection Data", BS_GROUPBOX, 4, 15, 720, 215, NULL},
{"STATIC", "SSID", 0, 15, 35, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 50, 35, 150, 17, IDC_WIFI_AP_SSID},
{"STATIC", "SSID (WEP)", 0, 220, 35, 125, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 300, 35, 150, 17, IDC_WIFI_AP_SSID2},
{"STATIC", "User ID", 0, 470, 35, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 525, 35, 185, 17, IDC_WIFI_AP_USER_ID},
{"BUTTON", "WEP", BS_GROUPBOX, 14, 55, 700, 80, NULL},
{"STATIC", "Key1", 0, 25, 75, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 65, 75, 150, 17, IDC_WIFI_AP_KEY1},
{"STATIC", "Key2", 0, 225, 75, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 265, 75, 150, 17, IDC_WIFI_AP_KEY2},
{"STATIC", "Key3", 0, 25, 105, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 65, 100, 150, 17, IDC_WIFI_AP_KEY3},
{"STATIC", "Key4", 0, 225, 105, 75, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_LEFT, 265, 100, 150, 17, IDC_WIFI_AP_KEY4},
{"STATIC", "WEP mode", 0, 445, 75, 75, 17, NULL},
{"COMBOBOX","WEPsize", WS_TABSTOP | WS_VSCROLL | BS_GROUPBOX, 535, 75, 80, 120, IDC_WIFI_AP_WEP_SIZE},
{"COMBOBOX","WEPmethod", WS_TABSTOP | WS_VSCROLL | BS_GROUPBOX, 620, 75, 80, 120, IDC_WIFI_AP_WEP_EMETHOD},
{"BUTTON", "IP", BS_GROUPBOX, 14, 140, 345, 80, NULL},
{"STATIC", "IP", 0, 25, 155, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 165, 155, 150, 17, IDC_WIFI_AP_IP},
{"STATIC", "Subnet mask", 0, 25, 175, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 165, 175, 150, 17, IDC_WIFI_AP_IPMASK},
{"STATIC", "Gateway", 0, 25, 195, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 165, 195, 150, 17, IDC_WIFI_AP_GATEWAY},
{"BUTTON", "DNS", BS_GROUPBOX, 370, 140, 345, 60, NULL},
{"STATIC", "Primary", 0, 385, 155, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 525, 155, 150, 17, IDC_WIFI_AP_DNS1},
{"STATIC", "Secondary", 0, 385, 175, 95, 17, NULL},
{"EDIT", "", WS_TABSTOP | ES_CENTER, 525, 175, 150, 17, IDC_WIFI_AP_DNS2},
{"STATIC", "Status", 0, 375, 205, 95, 17, NULL},
{"EDIT", "", ES_CENTER | ES_READONLY, 425, 205, 150, 17, IDC_WIFI_AP_STATUS},
{"STATIC", "CRC16", 0, 595, 205, 95, 17, NULL},
{"EDIT", "", ES_CENTER | ES_READONLY, 645, 205, 70, 17, IDC_WIFI_AP_CRC16},
};
const TEMPLATE TwifiAPDlg2[] = {
{"BUTTON", "Backup", WS_TABSTOP | WS_DISABLED, 15, Y_WIFI_AP_BUTTONS, 70, 20, NULL},
{"BUTTON", "Restore", WS_TABSTOP | WS_DISABLED, 90, Y_WIFI_AP_BUTTONS, 70, 20, NULL},
{"BUTTON", "Update", WS_TABSTOP | WS_DISABLED, 570, Y_WIFI_AP_BUTTONS, 70, 20, NULL},
{"BUTTON", "Cancel", WS_TABSTOP | BS_DEFPUSHBUTTON, 645, Y_WIFI_AP_BUTTONS, 70, 20, IDCANCEL}
};
#endif