commit 8b686374efc6cee83d848efa7500c90778769fff Author: suloku Date: Fri Mar 24 12:46:50 2017 +0100 Can view all teams in the rom. Can export as jpk1 file to use with pkhex. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..94420dc --- /dev/null +++ b/.gitignore @@ -0,0 +1,236 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/Stadium_Viewer.sln b/Stadium_Viewer.sln new file mode 100644 index 0000000..2d8891a --- /dev/null +++ b/Stadium_Viewer.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +# SharpDevelop 5.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stadium_Viewer", "Stadium_Viewer\Stadium_Viewer.csproj", "{65D9D223-0FB6-4CA8-BF8C-6242BF62F284}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {65D9D223-0FB6-4CA8-BF8C-6242BF62F284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65D9D223-0FB6-4CA8-BF8C-6242BF62F284}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65D9D223-0FB6-4CA8-BF8C-6242BF62F284}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65D9D223-0FB6-4CA8-BF8C-6242BF62F284}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Stadium_Viewer/BigEndian.cs b/Stadium_Viewer/BigEndian.cs new file mode 100644 index 0000000..d8ee44b --- /dev/null +++ b/Stadium_Viewer/BigEndian.cs @@ -0,0 +1,75 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 08/02/2017 + * Time: 1:11 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; + +namespace Stadium_Viewer +{ + public static class BigEndian + { + public static uint ToUInt32(byte[] data, int offset) + { + int val = 0; + val |= data[offset + 0] << 24; + val |= data[offset + 1] << 16; + val |= data[offset + 2] << 8; + val |= data[offset + 3] << 0; + return (uint)val; + } + public static ushort ToUInt16(byte[] data, int offset) + { + int val = 0; + val |= data[offset + 0] << 8; + val |= data[offset + 1] << 0; + return (ushort)val; + } + public static int ToInt32(byte[] data, int offset) + { + int val = 0; + val |= data[offset + 0] << 24; + val |= data[offset + 1] << 16; + val |= data[offset + 2] << 8; + val |= data[offset + 3] << 0; + return val; + } + public static short ToInt16(byte[] data, int offset) + { + int val = 0; + val |= data[offset + 0] << 8; + val |= data[offset + 1] << 0; + return (short)val; + } + + public static byte[] GetBytes(int value) + { + return Invert(BitConverter.GetBytes(value)); + } + public static byte[] GetBytes(short value) + { + return Invert(BitConverter.GetBytes(value)); + } + public static byte[] GetBytes(uint value) + { + return Invert(BitConverter.GetBytes(value)); + } + public static byte[] GetBytes(ushort value) + { + return Invert(BitConverter.GetBytes(value)); + } + + private static byte[] Invert(byte[] data) + { + byte[] result = new byte[data.Length]; + int o = 0; + int i = data.Length; + while (o != data.Length) + result[--i] = data[o++]; + return result; + } + } +} diff --git a/Stadium_Viewer/FileIO.cs b/Stadium_Viewer/FileIO.cs new file mode 100644 index 0000000..4cbbe56 --- /dev/null +++ b/Stadium_Viewer/FileIO.cs @@ -0,0 +1,161 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 07/02/2017 + * Time: 19:13 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace Stadium_Viewer +{ + /// + /// Description of FileIO. + /// + public class FileIO + { + /// + /// Reads data into a complete array, throwing an EndOfStreamException + /// if the stream runs out of data first, or if an IOException + /// naturally occurs. + /// + /// The stream to read data from + /// The array to read bytes into. The array + /// will be completely filled from the stream, so an appropriate + /// size must be given. + private static void ReadWholeArray (Stream stream, ref byte[] data) + { + int offset=0; + int remaining = data.Length; + while (remaining > 0) + { + int read = stream.Read(data, offset, remaining); + if (read <= 0) + throw new EndOfStreamException + (String.Format("End of stream reached with {0} bytes left to read", remaining)); + remaining -= read; + offset += read; + } + } + private static void _read_data(ref byte [] buffer, string path) + { + System.IO.FileStream saveFile; + saveFile = new FileStream(path, FileMode.Open); + if (saveFile.Length < 1){ + MessageBox.Show("Invalid file length", "Error"); + return; + } + buffer = new byte[saveFile.Length]; + //MessageBox.Show(buffer.Length.ToString()); + ReadWholeArray(saveFile, ref buffer); + saveFile.Close(); + return; + } + public static int load_file(ref byte[] buffer, ref string path, string filter) + { + + if (path == null) + { + OpenFileDialog openFD = new OpenFileDialog(); + //openFD.InitialDirectory = "c:\\"; + openFD.Filter = filter; + if (openFD.ShowDialog() == DialogResult.OK) + { + #region filename + path = openFD.FileName; + //MessageBox.Show(path.ToString()); + #endregion + _read_data(ref buffer, path); + //MessageBox.Show(buffer.Length.ToString()); + return buffer.Length; + }else{ + return -1; + } + } + else + { + _read_data(ref buffer, path); + return buffer.Length; + } + + } + private static byte[] dsvfoot = new byte[] { + 0x7C, 0x3C, 0x2D, 0x2D, 0x53, 0x6E, 0x69, 0x70, 0x20, 0x61, 0x62, 0x6F, + 0x76, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x6F, 0x20, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x72, 0x61, 0x77, 0x20, + 0x73, 0x61, 0x76, 0x20, 0x62, 0x79, 0x20, 0x65, 0x78, 0x63, 0x6C, 0x75, + 0x64, 0x69, 0x6E, 0x67, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x44, 0x65, + 0x53, 0x6D, 0x75, 0x4D, 0x45, 0x20, 0x73, 0x61, 0x76, 0x65, 0x64, 0x61, + 0x74, 0x61, 0x20, 0x66, 0x6F, 0x6F, 0x74, 0x65, 0x72, 0x3A, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x2D, + 0x44, 0x45, 0x53, 0x4D, 0x55, 0x4D, 0x45, 0x20, 0x53, 0x41, 0x56, 0x45, + 0x2D, 0x7C + }; + + + public static void save_data(byte[] buffer) + { //if (savegamename.Text.Length < 1) return; + if (buffer == null) return; + SaveFileDialog saveFD = new SaveFileDialog(); + //saveFD.InitialDirectory = "c:\\"; + saveFD.Filter = "NDS RAW save data|*.sav|NDS Desmune/Drastic save data|*.dsv|All Files (*.*)|*.*"; + if (saveFD.ShowDialog() == DialogResult.OK) + { + System.IO.FileStream saveFile; + saveFile = new FileStream(saveFD.FileName, FileMode.Create); + + //Write file + var extension = Path.GetExtension(saveFD.FileName); + switch(extension.ToLower()) + { + case ".sav": + //Write file + saveFile.Write(buffer, 0, buffer.Length); + break; + /* + case ".dsv": + //Add dsv footer + byte[] dsv_save = new byte[SAV5.SIZERAW+122]; + buffer.CopyTo(dsv_save, 0); + dsvfoot.CopyTo(dsv_save, SAV5.SIZERAW); + //Write file + saveFile.Write( dsv_save, 0, dsv_save.Length); + break; + */ + default: + //throw new ArgumentOutOfRangeException(extension); + break; + } + + saveFile.Close(); + MessageBox.Show("File Saved.", "Save file"); + } + } + public static void save_file(byte[] buffer, string filter) + { //if (savegamename.Text.Length < 1) return; + if (buffer == null) return; + SaveFileDialog saveFD = new SaveFileDialog(); + //saveFD.InitialDirectory = "c:\\"; + saveFD.Filter = filter; + if (saveFD.ShowDialog() == DialogResult.OK) + { + System.IO.FileStream saveFile; + saveFile = new FileStream(saveFD.FileName, FileMode.Create); + //Write file + saveFile.Write(buffer, 0, buffer.Length); + saveFile.Close(); + MessageBox.Show("File Saved.", "Save file"); + } + } + } +} diff --git a/Stadium_Viewer/MainForm.Designer.cs b/Stadium_Viewer/MainForm.Designer.cs new file mode 100644 index 0000000..da5f2f2 --- /dev/null +++ b/Stadium_Viewer/MainForm.Designer.cs @@ -0,0 +1,1959 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 07/02/2017 + * Time: 19:12 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +namespace Stadium_Viewer +{ + partial class MainForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + private System.Windows.Forms.Button Load_but; + private System.Windows.Forms.TextBox filelocation; + private System.Windows.Forms.NumericUpDown PartySlot; + private System.Windows.Forms.ComboBox Species; + private System.Windows.Forms.ComboBox move1; + private System.Windows.Forms.ComboBox move2; + private System.Windows.Forms.ComboBox move3; + private System.Windows.Forms.ComboBox move4; + private System.Windows.Forms.NumericUpDown ID; + private System.Windows.Forms.ComboBox ppup1; + private System.Windows.Forms.ComboBox ppup2; + private System.Windows.Forms.ComboBox ppup3; + private System.Windows.Forms.ComboBox ppup4; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.NumericUpDown atk; + private System.Windows.Forms.NumericUpDown def; + private System.Windows.Forms.NumericUpDown spc; + private System.Windows.Forms.NumericUpDown spe; + private System.Windows.Forms.NumericUpDown hp; + private System.Windows.Forms.NumericUpDown hpEv; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.NumericUpDown atkEv; + private System.Windows.Forms.NumericUpDown defEv; + private System.Windows.Forms.NumericUpDown spcEv; + private System.Windows.Forms.NumericUpDown speEv; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox hpStat; + private System.Windows.Forms.TextBox atkStat; + private System.Windows.Forms.TextBox defStat; + private System.Windows.Forms.TextBox spcStat; + private System.Windows.Forms.TextBox speStat; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.NumericUpDown level; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.ComboBox type1; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.ComboBox type2; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.NumericUpDown catchrate; + private System.Windows.Forms.TextBox status; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.NumericUpDown exp; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.NumericUpDown offset_val; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label cur_offset; + private System.Windows.Forms.TextBox otraw; + private System.Windows.Forms.TextBox nickraw; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Button jpk1; + private System.Windows.Forms.ComboBox cups; + private System.Windows.Forms.ComboBox trainers; + private System.Windows.Forms.Label label25; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.Load_but = new System.Windows.Forms.Button(); + this.filelocation = new System.Windows.Forms.TextBox(); + this.PartySlot = new System.Windows.Forms.NumericUpDown(); + this.Species = new System.Windows.Forms.ComboBox(); + this.ID = new System.Windows.Forms.NumericUpDown(); + this.move1 = new System.Windows.Forms.ComboBox(); + this.move2 = new System.Windows.Forms.ComboBox(); + this.move3 = new System.Windows.Forms.ComboBox(); + this.move4 = new System.Windows.Forms.ComboBox(); + this.ppup1 = new System.Windows.Forms.ComboBox(); + this.ppup2 = new System.Windows.Forms.ComboBox(); + this.ppup3 = new System.Windows.Forms.ComboBox(); + this.ppup4 = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.atk = new System.Windows.Forms.NumericUpDown(); + this.def = new System.Windows.Forms.NumericUpDown(); + this.spc = new System.Windows.Forms.NumericUpDown(); + this.spe = new System.Windows.Forms.NumericUpDown(); + this.hp = new System.Windows.Forms.NumericUpDown(); + this.hpEv = new System.Windows.Forms.NumericUpDown(); + this.label6 = new System.Windows.Forms.Label(); + this.atkEv = new System.Windows.Forms.NumericUpDown(); + this.defEv = new System.Windows.Forms.NumericUpDown(); + this.spcEv = new System.Windows.Forms.NumericUpDown(); + this.speEv = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.hpStat = new System.Windows.Forms.TextBox(); + this.atkStat = new System.Windows.Forms.TextBox(); + this.defStat = new System.Windows.Forms.TextBox(); + this.spcStat = new System.Windows.Forms.TextBox(); + this.speStat = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.level = new System.Windows.Forms.NumericUpDown(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.type1 = new System.Windows.Forms.ComboBox(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.type2 = new System.Windows.Forms.ComboBox(); + this.label17 = new System.Windows.Forms.Label(); + this.catchrate = new System.Windows.Forms.NumericUpDown(); + this.status = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.exp = new System.Windows.Forms.NumericUpDown(); + this.label21 = new System.Windows.Forms.Label(); + this.offset_val = new System.Windows.Forms.NumericUpDown(); + this.label22 = new System.Windows.Forms.Label(); + this.cur_offset = new System.Windows.Forms.Label(); + this.otraw = new System.Windows.Forms.TextBox(); + this.nickraw = new System.Windows.Forms.TextBox(); + this.label23 = new System.Windows.Forms.Label(); + this.label24 = new System.Windows.Forms.Label(); + this.jpk1 = new System.Windows.Forms.Button(); + this.cups = new System.Windows.Forms.ComboBox(); + this.trainers = new System.Windows.Forms.ComboBox(); + this.label20 = new System.Windows.Forms.Label(); + this.label25 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.PartySlot)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ID)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.atk)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.def)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.spc)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.spe)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.hp)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.hpEv)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.atkEv)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.defEv)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.spcEv)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.speEv)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.level)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.catchrate)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.exp)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.offset_val)).BeginInit(); + this.SuspendLayout(); + // + // Load_but + // + this.Load_but.Location = new System.Drawing.Point(12, 12); + this.Load_but.Name = "Load_but"; + this.Load_but.Size = new System.Drawing.Size(75, 23); + this.Load_but.TabIndex = 0; + this.Load_but.Text = "Load"; + this.Load_but.UseVisualStyleBackColor = true; + this.Load_but.Click += new System.EventHandler(this.Load_butClick); + // + // filelocation + // + this.filelocation.Location = new System.Drawing.Point(12, 41); + this.filelocation.Name = "filelocation"; + this.filelocation.Size = new System.Drawing.Size(700, 20); + this.filelocation.TabIndex = 1; + // + // PartySlot + // + this.PartySlot.Location = new System.Drawing.Point(419, 130); + this.PartySlot.Maximum = new decimal(new int[] { + 5, + 0, + 0, + 0}); + this.PartySlot.Name = "PartySlot"; + this.PartySlot.Size = new System.Drawing.Size(132, 20); + this.PartySlot.TabIndex = 3; + this.PartySlot.ValueChanged += new System.EventHandler(this.PartySlotValueChanged); + // + // Species + // + this.Species.FormattingEnabled = true; + this.Species.Items.AddRange(new object[] { + "NONE", + "Bulbasaur", + "Ivysaur", + "Venusaur", + "Charmander", + "Charmeleon", + "Charizard", + "Squirtle", + "Wartortle", + "Blastoise", + "Caterpie", + "Metapod", + "Butterfree", + "Weedle", + "Kakuna", + "Beedrill", + "Pidgey", + "Pidgeotto", + "Pidgeot", + "Rattata", + "Raticate", + "Spearow", + "Fearow", + "Ekans", + "Arbok", + "Pikachu", + "Raichu", + "Sandshrew", + "Sandslash", + "Nidoran♀", + "Nidorina", + "Nidoqueen", + "Nidoran♂", + "Nidorino", + "Nidoking", + "Clefairy", + "Clefable", + "Vulpix", + "Ninetales", + "Jigglypuff", + "Wigglytuff", + "Zubat", + "Golbat", + "Oddish", + "Gloom", + "Vileplume", + "Paras", + "Parasect", + "Venonat", + "Venomoth", + "Diglett", + "Dugtrio", + "Meowth", + "Persian", + "Psyduck", + "Golduck", + "Mankey", + "Primeape", + "Growlithe", + "Arcanine", + "Poliwag", + "Poliwhirl", + "Poliwrath", + "Abra", + "Kadabra", + "Alakazam", + "Machop", + "Machoke", + "Machamp", + "Bellsprout", + "Weepinbell", + "Victreebel", + "Tentacool", + "Tentacruel", + "Geodude", + "Graveler", + "Golem", + "Ponyta", + "Rapidash", + "Slowpoke", + "Slowbro", + "Magnemite", + "Magneton", + "Farfetch\'d", + "Doduo", + "Dodrio", + "Seel", + "Dewgong", + "Grimer", + "Muk", + "Shellder", + "Cloyster", + "Gastly", + "Haunter", + "Gengar", + "Onix", + "Drowzee", + "Hypno", + "Krabby", + "Kingler", + "Voltorb", + "Electrode", + "Exeggcute", + "Exeggutor", + "Cubone", + "Marowak", + "Hitmonlee", + "Hitmonchan", + "Lickitung", + "Koffing", + "Weezing", + "Rhyhorn", + "Rhydon", + "Chansey", + "Tangela", + "Kangaskhan", + "Horsea", + "Seadra", + "Goldeen", + "Seaking", + "Staryu", + "Starmie", + "Mr. Mime", + "Scyther", + "Jynx", + "Electabuzz", + "Magmar", + "Pinsir", + "Tauros", + "Magikarp", + "Gyarados", + "Lapras", + "Ditto", + "Eevee", + "Vaporeon", + "Jolteon", + "Flareon", + "Porygon", + "Omanyte", + "Omastar", + "Kabuto", + "Kabutops", + "Aerodactyl", + "Snorlax", + "Articuno", + "Zapdos", + "Moltres", + "Dratini", + "Dragonair", + "Dragonite", + "Mewtwo", + "Mew", + "152", + "153", + "154", + "155", + "156", + "157", + "158", + "159", + "160", + "161", + "162", + "163", + "164", + "165", + "166", + "167", + "168", + "169", + "170", + "171", + "172", + "173", + "174", + "175", + "176", + "177", + "178", + "179", + "180", + "181", + "182", + "183", + "184", + "185", + "186", + "187", + "188", + "189", + "190", + "191", + "192", + "193", + "194", + "195", + "196", + "197", + "198", + "199", + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "209", + "210", + "211", + "212", + "213", + "214", + "215", + "216", + "217", + "218", + "219", + "220", + "221", + "222", + "223", + "224", + "225", + "226", + "227", + "228", + "229", + "230", + "231", + "232", + "233", + "234", + "235", + "236", + "237", + "238", + "239", + "240", + "241", + "242", + "243", + "244", + "245", + "246", + "247", + "248", + "249", + "250", + "251", + "252", + "253", + "254", + "255"}); + this.Species.Location = new System.Drawing.Point(101, 210); + this.Species.Name = "Species"; + this.Species.Size = new System.Drawing.Size(132, 21); + this.Species.TabIndex = 4; + // + // ID + // + this.ID.Location = new System.Drawing.Point(344, 368); + this.ID.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.ID.Name = "ID"; + this.ID.Size = new System.Drawing.Size(132, 20); + this.ID.TabIndex = 6; + // + // move1 + // + this.move1.FormattingEnabled = true; + this.move1.Items.AddRange(new object[] { + "NONE", + "Pound", + "Karate Chop", + "Double Slap", + "Comet Punch", + "Mega Punch", + "Pay Day", + "Fire Punch", + "Ice Punch", + "Thunder Punch", + "Scratch", + "Vice Grip", + "Guillotine", + "Razor Wind", + "Swords Dance", + "Cut", + "Gust", + "Wing Attack", + "Whirlwind", + "Fly", + "Bind", + "Slam", + "Vine Whip", + "Stomp", + "Double Kick", + "Mega Kick", + "Jump Kick", + "Rolling Kick", + "Sand Attack", + "Headbutt", + "Horn Attack", + "Fury Attack", + "Horn Drill", + "Tackle", + "Body Slam", + "Wrap", + "Take Down", + "Thrash", + "Double-Edge", + "Tail Whip", + "Poison Sting", + "Twineedle", + "Pin Missile", + "Leer", + "Bite", + "Growl", + "Roar", + "Sing", + "Supersonic", + "Sonic Boom", + "Disable", + "Acid", + "Ember", + "Flamethrower", + "Mist", + "Water Gun", + "Hydro Pump", + "Surf", + "Ice Beam", + "Blizzard", + "Psybeam", + "Bubble Beam", + "Aurora Beam", + "Hyper Beam", + "Peck", + "Drill Peck", + "Submission", + "Low Kick", + "Counter", + "Seismic Toss", + "Strength", + "Absorb", + "Mega Drain", + "Leech Seed", + "Growth", + "Razor Leaf", + "Solar Beam", + "Poison Powder", + "Stun Spore", + "Sleep Powder", + "Petal Dance", + "String Shot", + "Dragon Rage", + "Fire Spin", + "Thunder Shock", + "Thunderbolt", + "Thunder Wave", + "Thunder", + "Rock Throw", + "Earthquake", + "Fissure", + "Dig", + "Toxic", + "Confusion", + "Psychic", + "Hypnosis", + "Meditate", + "Agility", + "Quick Attack", + "Rage", + "Teleport", + "Night Shade", + "Mimic", + "Screech", + "Double Team", + "Recover", + "Harden", + "Minimize", + "Smokescreen", + "Confuse Ray", + "Withdraw", + "Defense Curl", + "Barrier", + "Light Screen", + "Haze", + "Reflect", + "Focus Energy", + "Bide", + "Metronome", + "Mirror Move", + "Self-Destruct", + "Egg Bomb", + "Lick", + "Smog", + "Sludge", + "Bone Club", + "Fire Blast", + "Waterfall", + "Clamp", + "Swift", + "Skull Bash", + "Spike Cannon", + "Constrict", + "Amnesia", + "Kinesis", + "Soft-Boiled", + "High Jump Kick", + "Glare", + "Dream Eater", + "Poison Gas", + "Barrage", + "Leech Life", + "Lovely Kiss", + "Sky Attack", + "Transform", + "Bubble", + "Dizzy Punch", + "Spore", + "Flash", + "Psywave", + "Splash", + "Acid Armor", + "Crabhammer", + "Explosion", + "Fury Swipes", + "Bonemerang", + "Rest", + "Rock Slide", + "Hyper Fang", + "Sharpen", + "Conversion", + "Tri Attack", + "Super Fang", + "Slash", + "Substitute", + "Struggle"}); + this.move1.Location = new System.Drawing.Point(271, 210); + this.move1.Name = "move1"; + this.move1.Size = new System.Drawing.Size(121, 21); + this.move1.TabIndex = 7; + // + // move2 + // + this.move2.FormattingEnabled = true; + this.move2.Items.AddRange(new object[] { + "NONE", + "Pound", + "Karate Chop", + "Double Slap", + "Comet Punch", + "Mega Punch", + "Pay Day", + "Fire Punch", + "Ice Punch", + "Thunder Punch", + "Scratch", + "Vice Grip", + "Guillotine", + "Razor Wind", + "Swords Dance", + "Cut", + "Gust", + "Wing Attack", + "Whirlwind", + "Fly", + "Bind", + "Slam", + "Vine Whip", + "Stomp", + "Double Kick", + "Mega Kick", + "Jump Kick", + "Rolling Kick", + "Sand Attack", + "Headbutt", + "Horn Attack", + "Fury Attack", + "Horn Drill", + "Tackle", + "Body Slam", + "Wrap", + "Take Down", + "Thrash", + "Double-Edge", + "Tail Whip", + "Poison Sting", + "Twineedle", + "Pin Missile", + "Leer", + "Bite", + "Growl", + "Roar", + "Sing", + "Supersonic", + "Sonic Boom", + "Disable", + "Acid", + "Ember", + "Flamethrower", + "Mist", + "Water Gun", + "Hydro Pump", + "Surf", + "Ice Beam", + "Blizzard", + "Psybeam", + "Bubble Beam", + "Aurora Beam", + "Hyper Beam", + "Peck", + "Drill Peck", + "Submission", + "Low Kick", + "Counter", + "Seismic Toss", + "Strength", + "Absorb", + "Mega Drain", + "Leech Seed", + "Growth", + "Razor Leaf", + "Solar Beam", + "Poison Powder", + "Stun Spore", + "Sleep Powder", + "Petal Dance", + "String Shot", + "Dragon Rage", + "Fire Spin", + "Thunder Shock", + "Thunderbolt", + "Thunder Wave", + "Thunder", + "Rock Throw", + "Earthquake", + "Fissure", + "Dig", + "Toxic", + "Confusion", + "Psychic", + "Hypnosis", + "Meditate", + "Agility", + "Quick Attack", + "Rage", + "Teleport", + "Night Shade", + "Mimic", + "Screech", + "Double Team", + "Recover", + "Harden", + "Minimize", + "Smokescreen", + "Confuse Ray", + "Withdraw", + "Defense Curl", + "Barrier", + "Light Screen", + "Haze", + "Reflect", + "Focus Energy", + "Bide", + "Metronome", + "Mirror Move", + "Self-Destruct", + "Egg Bomb", + "Lick", + "Smog", + "Sludge", + "Bone Club", + "Fire Blast", + "Waterfall", + "Clamp", + "Swift", + "Skull Bash", + "Spike Cannon", + "Constrict", + "Amnesia", + "Kinesis", + "Soft-Boiled", + "High Jump Kick", + "Glare", + "Dream Eater", + "Poison Gas", + "Barrage", + "Leech Life", + "Lovely Kiss", + "Sky Attack", + "Transform", + "Bubble", + "Dizzy Punch", + "Spore", + "Flash", + "Psywave", + "Splash", + "Acid Armor", + "Crabhammer", + "Explosion", + "Fury Swipes", + "Bonemerang", + "Rest", + "Rock Slide", + "Hyper Fang", + "Sharpen", + "Conversion", + "Tri Attack", + "Super Fang", + "Slash", + "Substitute", + "Struggle"}); + this.move2.Location = new System.Drawing.Point(271, 237); + this.move2.Name = "move2"; + this.move2.Size = new System.Drawing.Size(121, 21); + this.move2.TabIndex = 8; + // + // move3 + // + this.move3.FormattingEnabled = true; + this.move3.Items.AddRange(new object[] { + "NONE", + "Pound", + "Karate Chop", + "Double Slap", + "Comet Punch", + "Mega Punch", + "Pay Day", + "Fire Punch", + "Ice Punch", + "Thunder Punch", + "Scratch", + "Vice Grip", + "Guillotine", + "Razor Wind", + "Swords Dance", + "Cut", + "Gust", + "Wing Attack", + "Whirlwind", + "Fly", + "Bind", + "Slam", + "Vine Whip", + "Stomp", + "Double Kick", + "Mega Kick", + "Jump Kick", + "Rolling Kick", + "Sand Attack", + "Headbutt", + "Horn Attack", + "Fury Attack", + "Horn Drill", + "Tackle", + "Body Slam", + "Wrap", + "Take Down", + "Thrash", + "Double-Edge", + "Tail Whip", + "Poison Sting", + "Twineedle", + "Pin Missile", + "Leer", + "Bite", + "Growl", + "Roar", + "Sing", + "Supersonic", + "Sonic Boom", + "Disable", + "Acid", + "Ember", + "Flamethrower", + "Mist", + "Water Gun", + "Hydro Pump", + "Surf", + "Ice Beam", + "Blizzard", + "Psybeam", + "Bubble Beam", + "Aurora Beam", + "Hyper Beam", + "Peck", + "Drill Peck", + "Submission", + "Low Kick", + "Counter", + "Seismic Toss", + "Strength", + "Absorb", + "Mega Drain", + "Leech Seed", + "Growth", + "Razor Leaf", + "Solar Beam", + "Poison Powder", + "Stun Spore", + "Sleep Powder", + "Petal Dance", + "String Shot", + "Dragon Rage", + "Fire Spin", + "Thunder Shock", + "Thunderbolt", + "Thunder Wave", + "Thunder", + "Rock Throw", + "Earthquake", + "Fissure", + "Dig", + "Toxic", + "Confusion", + "Psychic", + "Hypnosis", + "Meditate", + "Agility", + "Quick Attack", + "Rage", + "Teleport", + "Night Shade", + "Mimic", + "Screech", + "Double Team", + "Recover", + "Harden", + "Minimize", + "Smokescreen", + "Confuse Ray", + "Withdraw", + "Defense Curl", + "Barrier", + "Light Screen", + "Haze", + "Reflect", + "Focus Energy", + "Bide", + "Metronome", + "Mirror Move", + "Self-Destruct", + "Egg Bomb", + "Lick", + "Smog", + "Sludge", + "Bone Club", + "Fire Blast", + "Waterfall", + "Clamp", + "Swift", + "Skull Bash", + "Spike Cannon", + "Constrict", + "Amnesia", + "Kinesis", + "Soft-Boiled", + "High Jump Kick", + "Glare", + "Dream Eater", + "Poison Gas", + "Barrage", + "Leech Life", + "Lovely Kiss", + "Sky Attack", + "Transform", + "Bubble", + "Dizzy Punch", + "Spore", + "Flash", + "Psywave", + "Splash", + "Acid Armor", + "Crabhammer", + "Explosion", + "Fury Swipes", + "Bonemerang", + "Rest", + "Rock Slide", + "Hyper Fang", + "Sharpen", + "Conversion", + "Tri Attack", + "Super Fang", + "Slash", + "Substitute", + "Struggle"}); + this.move3.Location = new System.Drawing.Point(271, 264); + this.move3.Name = "move3"; + this.move3.Size = new System.Drawing.Size(121, 21); + this.move3.TabIndex = 9; + // + // move4 + // + this.move4.FormattingEnabled = true; + this.move4.Items.AddRange(new object[] { + "NONE", + "Pound", + "Karate Chop", + "Double Slap", + "Comet Punch", + "Mega Punch", + "Pay Day", + "Fire Punch", + "Ice Punch", + "Thunder Punch", + "Scratch", + "Vice Grip", + "Guillotine", + "Razor Wind", + "Swords Dance", + "Cut", + "Gust", + "Wing Attack", + "Whirlwind", + "Fly", + "Bind", + "Slam", + "Vine Whip", + "Stomp", + "Double Kick", + "Mega Kick", + "Jump Kick", + "Rolling Kick", + "Sand Attack", + "Headbutt", + "Horn Attack", + "Fury Attack", + "Horn Drill", + "Tackle", + "Body Slam", + "Wrap", + "Take Down", + "Thrash", + "Double-Edge", + "Tail Whip", + "Poison Sting", + "Twineedle", + "Pin Missile", + "Leer", + "Bite", + "Growl", + "Roar", + "Sing", + "Supersonic", + "Sonic Boom", + "Disable", + "Acid", + "Ember", + "Flamethrower", + "Mist", + "Water Gun", + "Hydro Pump", + "Surf", + "Ice Beam", + "Blizzard", + "Psybeam", + "Bubble Beam", + "Aurora Beam", + "Hyper Beam", + "Peck", + "Drill Peck", + "Submission", + "Low Kick", + "Counter", + "Seismic Toss", + "Strength", + "Absorb", + "Mega Drain", + "Leech Seed", + "Growth", + "Razor Leaf", + "Solar Beam", + "Poison Powder", + "Stun Spore", + "Sleep Powder", + "Petal Dance", + "String Shot", + "Dragon Rage", + "Fire Spin", + "Thunder Shock", + "Thunderbolt", + "Thunder Wave", + "Thunder", + "Rock Throw", + "Earthquake", + "Fissure", + "Dig", + "Toxic", + "Confusion", + "Psychic", + "Hypnosis", + "Meditate", + "Agility", + "Quick Attack", + "Rage", + "Teleport", + "Night Shade", + "Mimic", + "Screech", + "Double Team", + "Recover", + "Harden", + "Minimize", + "Smokescreen", + "Confuse Ray", + "Withdraw", + "Defense Curl", + "Barrier", + "Light Screen", + "Haze", + "Reflect", + "Focus Energy", + "Bide", + "Metronome", + "Mirror Move", + "Self-Destruct", + "Egg Bomb", + "Lick", + "Smog", + "Sludge", + "Bone Club", + "Fire Blast", + "Waterfall", + "Clamp", + "Swift", + "Skull Bash", + "Spike Cannon", + "Constrict", + "Amnesia", + "Kinesis", + "Soft-Boiled", + "High Jump Kick", + "Glare", + "Dream Eater", + "Poison Gas", + "Barrage", + "Leech Life", + "Lovely Kiss", + "Sky Attack", + "Transform", + "Bubble", + "Dizzy Punch", + "Spore", + "Flash", + "Psywave", + "Splash", + "Acid Armor", + "Crabhammer", + "Explosion", + "Fury Swipes", + "Bonemerang", + "Rest", + "Rock Slide", + "Hyper Fang", + "Sharpen", + "Conversion", + "Tri Attack", + "Super Fang", + "Slash", + "Substitute", + "Struggle"}); + this.move4.Location = new System.Drawing.Point(271, 291); + this.move4.Name = "move4"; + this.move4.Size = new System.Drawing.Size(121, 21); + this.move4.TabIndex = 10; + // + // ppup1 + // + this.ppup1.BackColor = System.Drawing.SystemColors.Window; + this.ppup1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ppup1.Enabled = false; + this.ppup1.FormattingEnabled = true; + this.ppup1.Items.AddRange(new object[] { + "0", + "1", + "2", + "3"}); + this.ppup1.Location = new System.Drawing.Point(398, 210); + this.ppup1.Name = "ppup1"; + this.ppup1.Size = new System.Drawing.Size(49, 21); + this.ppup1.TabIndex = 11; + // + // ppup2 + // + this.ppup2.BackColor = System.Drawing.SystemColors.Window; + this.ppup2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ppup2.Enabled = false; + this.ppup2.FormattingEnabled = true; + this.ppup2.Items.AddRange(new object[] { + "0", + "1", + "2", + "3"}); + this.ppup2.Location = new System.Drawing.Point(398, 237); + this.ppup2.Name = "ppup2"; + this.ppup2.Size = new System.Drawing.Size(49, 21); + this.ppup2.TabIndex = 12; + // + // ppup3 + // + this.ppup3.BackColor = System.Drawing.SystemColors.Window; + this.ppup3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ppup3.Enabled = false; + this.ppup3.FormattingEnabled = true; + this.ppup3.Items.AddRange(new object[] { + "0", + "1", + "2", + "3"}); + this.ppup3.Location = new System.Drawing.Point(398, 264); + this.ppup3.Name = "ppup3"; + this.ppup3.Size = new System.Drawing.Size(49, 21); + this.ppup3.TabIndex = 13; + // + // ppup4 + // + this.ppup4.BackColor = System.Drawing.SystemColors.Window; + this.ppup4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ppup4.Enabled = false; + this.ppup4.FormattingEnabled = true; + this.ppup4.Items.AddRange(new object[] { + "0", + "1", + "2", + "3"}); + this.ppup4.Location = new System.Drawing.Point(398, 291); + this.ppup4.Name = "ppup4"; + this.ppup4.Size = new System.Drawing.Size(49, 21); + this.ppup4.TabIndex = 14; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(398, 190); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(49, 17); + this.label1.TabIndex = 15; + this.label1.Text = "PP Up"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(271, 190); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(121, 17); + this.label2.TabIndex = 16; + this.label2.Text = "Moves"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(26, 210); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(69, 21); + this.label3.TabIndex = 17; + this.label3.Text = "Species"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(269, 366); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(69, 21); + this.label4.TabIndex = 18; + this.label4.Text = "OT ID"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(509, 162); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(49, 17); + this.label5.TabIndex = 19; + this.label5.Text = "DV"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // atk + // + this.atk.Location = new System.Drawing.Point(509, 210); + this.atk.Maximum = new decimal(new int[] { + 15, + 0, + 0, + 0}); + this.atk.Name = "atk"; + this.atk.Size = new System.Drawing.Size(49, 20); + this.atk.TabIndex = 20; + // + // def + // + this.def.Location = new System.Drawing.Point(509, 238); + this.def.Maximum = new decimal(new int[] { + 15, + 0, + 0, + 0}); + this.def.Name = "def"; + this.def.Size = new System.Drawing.Size(49, 20); + this.def.TabIndex = 21; + // + // spc + // + this.spc.Location = new System.Drawing.Point(509, 265); + this.spc.Maximum = new decimal(new int[] { + 15, + 0, + 0, + 0}); + this.spc.Name = "spc"; + this.spc.Size = new System.Drawing.Size(49, 20); + this.spc.TabIndex = 22; + // + // spe + // + this.spe.Location = new System.Drawing.Point(509, 291); + this.spe.Maximum = new decimal(new int[] { + 15, + 0, + 0, + 0}); + this.spe.Name = "spe"; + this.spe.Size = new System.Drawing.Size(49, 20); + this.spe.TabIndex = 23; + // + // hp + // + this.hp.Location = new System.Drawing.Point(509, 182); + this.hp.Maximum = new decimal(new int[] { + 15, + 0, + 0, + 0}); + this.hp.Name = "hp"; + this.hp.ReadOnly = true; + this.hp.Size = new System.Drawing.Size(49, 20); + this.hp.TabIndex = 24; + // + // hpEv + // + this.hpEv.Location = new System.Drawing.Point(564, 181); + this.hpEv.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.hpEv.Name = "hpEv"; + this.hpEv.Size = new System.Drawing.Size(67, 20); + this.hpEv.TabIndex = 30; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(564, 161); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(49, 17); + this.label6.TabIndex = 25; + this.label6.Text = "Stat Exp"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // atkEv + // + this.atkEv.Location = new System.Drawing.Point(564, 209); + this.atkEv.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.atkEv.Name = "atkEv"; + this.atkEv.Size = new System.Drawing.Size(67, 20); + this.atkEv.TabIndex = 31; + // + // defEv + // + this.defEv.Location = new System.Drawing.Point(564, 237); + this.defEv.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.defEv.Name = "defEv"; + this.defEv.Size = new System.Drawing.Size(67, 20); + this.defEv.TabIndex = 32; + // + // spcEv + // + this.spcEv.Location = new System.Drawing.Point(564, 264); + this.spcEv.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.spcEv.Name = "spcEv"; + this.spcEv.Size = new System.Drawing.Size(67, 20); + this.spcEv.TabIndex = 33; + // + // speEv + // + this.speEv.Location = new System.Drawing.Point(564, 291); + this.speEv.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.speEv.Name = "speEv"; + this.speEv.Size = new System.Drawing.Size(67, 20); + this.speEv.TabIndex = 34; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(453, 181); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(50, 21); + this.label7.TabIndex = 35; + this.label7.Text = "HP"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label8 + // + this.label8.Location = new System.Drawing.Point(453, 208); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(50, 21); + this.label8.TabIndex = 36; + this.label8.Text = "ATK"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Location = new System.Drawing.Point(453, 236); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(50, 21); + this.label9.TabIndex = 37; + this.label9.Text = "DEF"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label10 + // + this.label10.Location = new System.Drawing.Point(453, 263); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(50, 21); + this.label10.TabIndex = 38; + this.label10.Text = "SPC"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label11 + // + this.label11.Location = new System.Drawing.Point(453, 290); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(50, 21); + this.label11.TabIndex = 39; + this.label11.Text = "SPE"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // hpStat + // + this.hpStat.Location = new System.Drawing.Point(637, 181); + this.hpStat.Name = "hpStat"; + this.hpStat.ReadOnly = true; + this.hpStat.Size = new System.Drawing.Size(75, 20); + this.hpStat.TabIndex = 40; + this.hpStat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // atkStat + // + this.atkStat.Location = new System.Drawing.Point(637, 211); + this.atkStat.Name = "atkStat"; + this.atkStat.ReadOnly = true; + this.atkStat.Size = new System.Drawing.Size(75, 20); + this.atkStat.TabIndex = 41; + this.atkStat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // defStat + // + this.defStat.Location = new System.Drawing.Point(637, 238); + this.defStat.Name = "defStat"; + this.defStat.ReadOnly = true; + this.defStat.Size = new System.Drawing.Size(75, 20); + this.defStat.TabIndex = 42; + this.defStat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // spcStat + // + this.spcStat.Location = new System.Drawing.Point(637, 265); + this.spcStat.Name = "spcStat"; + this.spcStat.ReadOnly = true; + this.spcStat.Size = new System.Drawing.Size(75, 20); + this.spcStat.TabIndex = 43; + this.spcStat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // speStat + // + this.speStat.Location = new System.Drawing.Point(637, 292); + this.speStat.Name = "speStat"; + this.speStat.ReadOnly = true; + this.speStat.Size = new System.Drawing.Size(75, 20); + this.speStat.TabIndex = 44; + this.speStat.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label12 + // + this.label12.Location = new System.Drawing.Point(26, 237); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(69, 21); + this.label12.TabIndex = 46; + this.label12.Text = "Level"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // level + // + this.level.Location = new System.Drawing.Point(101, 239); + this.level.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.level.Name = "level"; + this.level.Size = new System.Drawing.Size(132, 20); + this.level.TabIndex = 45; + this.level.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // label13 + // + this.label13.Location = new System.Drawing.Point(637, 162); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(75, 16); + this.label13.TabIndex = 47; + this.label13.Text = "Stats"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label14 + // + this.label14.Location = new System.Drawing.Point(0, 64); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(100, 23); + this.label14.TabIndex = 48; + this.label14.Text = "Start offset:"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // type1 + // + this.type1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.type1.Enabled = false; + this.type1.FormattingEnabled = true; + this.type1.Items.AddRange(new object[] { + "0x00 Normal", + "0x01 Fighting", + "0x02 Flying", + "0x03 Poison", + "0x04 Ground", + "0x05 Rock", + "0x06 UNUSED", + "0x07 Bug", + "0x08 Ghost", + "0x09 UNUSED", + "0x0A UNUSED", + "0x0B UNUSED", + "0x0C UNUSED", + "0c0D UNUSED", + "0c0E UNUSED", + "0c0F UNUSED", + "0x10 UNUSED", + "0x11 UNUSED", + "0x12 UNUSED", + "0x13 UNUSED", + "0x14 Fire", + "0x15 Water", + "0x16 Grass", + "0x17 Electric", + "0x18 Psychic", + "0x19 Ice", + "0x1A Dragon"}); + this.type1.Location = new System.Drawing.Point(101, 327); + this.type1.Name = "type1"; + this.type1.Size = new System.Drawing.Size(132, 21); + this.type1.TabIndex = 49; + // + // label15 + // + this.label15.Location = new System.Drawing.Point(26, 326); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(69, 21); + this.label15.TabIndex = 50; + this.label15.Text = "Type 1"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label16 + // + this.label16.Location = new System.Drawing.Point(26, 353); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(69, 21); + this.label16.TabIndex = 52; + this.label16.Text = "Type 2"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // type2 + // + this.type2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.type2.Enabled = false; + this.type2.FormattingEnabled = true; + this.type2.Items.AddRange(new object[] { + "0x00 Normal", + "0x01 Fighting", + "0x02 Flying", + "0x03 Poison", + "0x04 Ground", + "0x05 Rock", + "0x06 UNUSED", + "0x07 Bug", + "0x08 Ghost", + "0x09 UNUSED", + "0x0A UNUSED", + "0x0B UNUSED", + "0x0C UNUSED", + "0c0D UNUSED", + "0c0E UNUSED", + "0c0F UNUSED", + "0x10 UNUSED", + "0x11 UNUSED", + "0x12 UNUSED", + "0x13 UNUSED", + "0x14 Fire", + "0x15 Water", + "0x16 Grass", + "0x17 Electric", + "0x18 Psychic", + "0x19 Ice", + "0x1A Dragon"}); + this.type2.Location = new System.Drawing.Point(101, 354); + this.type2.Name = "type2"; + this.type2.Size = new System.Drawing.Size(132, 21); + this.type2.TabIndex = 51; + // + // label17 + // + this.label17.Location = new System.Drawing.Point(26, 379); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(69, 21); + this.label17.TabIndex = 53; + this.label17.Text = "Catch rate"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // catchrate + // + this.catchrate.Location = new System.Drawing.Point(101, 381); + this.catchrate.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.catchrate.Name = "catchrate"; + this.catchrate.ReadOnly = true; + this.catchrate.Size = new System.Drawing.Size(132, 20); + this.catchrate.TabIndex = 54; + // + // status + // + this.status.Location = new System.Drawing.Point(101, 407); + this.status.Name = "status"; + this.status.ReadOnly = true; + this.status.Size = new System.Drawing.Size(132, 20); + this.status.TabIndex = 55; + // + // label18 + // + this.label18.Location = new System.Drawing.Point(12, 407); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(83, 21); + this.label18.TabIndex = 56; + this.label18.Text = "Status condition"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label19 + // + this.label19.Location = new System.Drawing.Point(26, 264); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(69, 21); + this.label19.TabIndex = 58; + this.label19.Text = "EXP"; + this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // exp + // + this.exp.Location = new System.Drawing.Point(101, 266); + this.exp.Maximum = new decimal(new int[] { + 16777215, + 0, + 0, + 0}); + this.exp.Name = "exp"; + this.exp.Size = new System.Drawing.Size(132, 20); + this.exp.TabIndex = 57; + // + // label21 + // + this.label21.Location = new System.Drawing.Point(344, 130); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(69, 21); + this.label21.TabIndex = 60; + this.label21.Text = "Party slot:"; + this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // offset_val + // + this.offset_val.Hexadecimal = true; + this.offset_val.Location = new System.Drawing.Point(101, 68); + this.offset_val.Maximum = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.offset_val.Name = "offset_val"; + this.offset_val.Size = new System.Drawing.Size(132, 20); + this.offset_val.TabIndex = 61; + this.offset_val.ValueChanged += new System.EventHandler(this.Offset_valValueChanged); + // + // label22 + // + this.label22.Location = new System.Drawing.Point(0, 91); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(100, 23); + this.label22.TabIndex = 62; + this.label22.Text = "Current offset:"; + this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cur_offset + // + this.cur_offset.Location = new System.Drawing.Point(101, 91); + this.cur_offset.Name = "cur_offset"; + this.cur_offset.Size = new System.Drawing.Size(100, 23); + this.cur_offset.TabIndex = 63; + this.cur_offset.Text = "0xffffffff"; + this.cur_offset.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // otraw + // + this.otraw.Location = new System.Drawing.Point(344, 420); + this.otraw.Name = "otraw"; + this.otraw.Size = new System.Drawing.Size(344, 20); + this.otraw.TabIndex = 65; + // + // nickraw + // + this.nickraw.Location = new System.Drawing.Point(344, 394); + this.nickraw.Name = "nickraw"; + this.nickraw.Size = new System.Drawing.Size(344, 20); + this.nickraw.TabIndex = 66; + // + // label23 + // + this.label23.Location = new System.Drawing.Point(269, 419); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(69, 21); + this.label23.TabIndex = 67; + this.label23.Text = "OT (raw)"; + this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label24 + // + this.label24.Location = new System.Drawing.Point(253, 393); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(87, 21); + this.label24.TabIndex = 68; + this.label24.Text = "Nickname (raw)"; + this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // jpk1 + // + this.jpk1.Location = new System.Drawing.Point(82, 459); + this.jpk1.Name = "jpk1"; + this.jpk1.Size = new System.Drawing.Size(117, 23); + this.jpk1.TabIndex = 69; + this.jpk1.Text = "Save as jpk1"; + this.jpk1.UseVisualStyleBackColor = true; + this.jpk1.Click += new System.EventHandler(this.Jpk1Click); + // + // cups + // + this.cups.FormattingEnabled = true; + this.cups.Items.AddRange(new object[] { + "Level 50-55 Tournament", + "Level 30 Pokéball Cup", + "Level 30 Great Ball Cup", + "Level 30 Ultra Ball Cup", + "Level 30 Master Ball Cup"}); + this.cups.Location = new System.Drawing.Point(419, 76); + this.cups.Name = "cups"; + this.cups.Size = new System.Drawing.Size(293, 21); + this.cups.TabIndex = 70; + this.cups.SelectedIndexChanged += new System.EventHandler(this.CupsSelectedIndexChanged); + // + // trainers + // + this.trainers.FormattingEnabled = true; + this.trainers.Items.AddRange(new object[] { + "0: Katou Kazuhito", + "1: Yukiyo Jiro", + "2: Takahashi Jun", + "3: Toru", + "4: Suzuki Yusuke", + "5: Fujita Mika", + "6: Hiro Hayashiyasu", + "7: Yamadataka Hisa", + "8: Kitagawa Yasunori", + "9: Nishimura Shun", + "10: Imai Daisuke", + "11: Yuwamasa Kenji", + "12: Hiroki Yoshii", + "13: Tomitaisei Yoshi", + "14: Hiro Fuchiwakiaki"}); + this.trainers.Location = new System.Drawing.Point(419, 103); + this.trainers.Name = "trainers"; + this.trainers.Size = new System.Drawing.Size(293, 21); + this.trainers.TabIndex = 71; + this.trainers.SelectedIndexChanged += new System.EventHandler(this.TrainersSelectedIndexChanged); + // + // label20 + // + this.label20.Location = new System.Drawing.Point(313, 74); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(100, 23); + this.label20.TabIndex = 72; + this.label20.Text = "Cup:"; + this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label25 + // + this.label25.Location = new System.Drawing.Point(313, 101); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(100, 23); + this.label25.TabIndex = 73; + this.label25.Text = "Trainer:"; + this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(912, 497); + this.Controls.Add(this.label25); + this.Controls.Add(this.label20); + this.Controls.Add(this.trainers); + this.Controls.Add(this.cups); + this.Controls.Add(this.jpk1); + this.Controls.Add(this.label24); + this.Controls.Add(this.label23); + this.Controls.Add(this.nickraw); + this.Controls.Add(this.otraw); + this.Controls.Add(this.cur_offset); + this.Controls.Add(this.label22); + this.Controls.Add(this.offset_val); + this.Controls.Add(this.label21); + this.Controls.Add(this.label19); + this.Controls.Add(this.exp); + this.Controls.Add(this.label18); + this.Controls.Add(this.status); + this.Controls.Add(this.catchrate); + this.Controls.Add(this.label17); + this.Controls.Add(this.label16); + this.Controls.Add(this.type2); + this.Controls.Add(this.label15); + this.Controls.Add(this.type1); + this.Controls.Add(this.label14); + this.Controls.Add(this.label13); + this.Controls.Add(this.label12); + this.Controls.Add(this.level); + this.Controls.Add(this.speStat); + this.Controls.Add(this.spcStat); + this.Controls.Add(this.defStat); + this.Controls.Add(this.atkStat); + this.Controls.Add(this.hpStat); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.speEv); + this.Controls.Add(this.spcEv); + this.Controls.Add(this.defEv); + this.Controls.Add(this.atkEv); + this.Controls.Add(this.hpEv); + this.Controls.Add(this.label6); + this.Controls.Add(this.hp); + this.Controls.Add(this.spe); + this.Controls.Add(this.spc); + this.Controls.Add(this.def); + this.Controls.Add(this.atk); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.ppup4); + this.Controls.Add(this.ppup3); + this.Controls.Add(this.ppup2); + this.Controls.Add(this.ppup1); + this.Controls.Add(this.move4); + this.Controls.Add(this.move3); + this.Controls.Add(this.move2); + this.Controls.Add(this.move1); + this.Controls.Add(this.ID); + this.Controls.Add(this.Species); + this.Controls.Add(this.PartySlot); + this.Controls.Add(this.filelocation); + this.Controls.Add(this.Load_but); + this.Name = "MainForm"; + this.Text = "Stadium_Viewer"; + this.Load += new System.EventHandler(this.MainFormLoad); + ((System.ComponentModel.ISupportInitialize)(this.PartySlot)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ID)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.atk)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.def)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.spc)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.spe)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.hp)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.hpEv)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.atkEv)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.defEv)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.spcEv)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.speEv)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.level)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.catchrate)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.exp)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.offset_val)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + } +} diff --git a/Stadium_Viewer/MainForm.cs b/Stadium_Viewer/MainForm.cs new file mode 100644 index 0000000..d3831b7 --- /dev/null +++ b/Stadium_Viewer/MainForm.cs @@ -0,0 +1,486 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 07/02/2017 + * Time: 19:12 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace Stadium_Viewer +{ + /// + /// Description of MainForm. + /// + public partial class MainForm : Form + { + public MainForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + PartySlot.Value = 0; + offset_val.Maximum = 0xFFFFFFFF; + trainer_start = fifties_tournament; + trainers.SelectedIndex = 0; + cups.SelectedIndex = 0; + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + public string z64filter = "N64 rom|*.z64|All Files (*.*)|*.*"; + public string jpk1filter = "PkHex JPK1|*.jpk1|All Files (*.*)|*.*"; + public byte[] savebuffer; + public static js1pk pokemon; + + public int trainer_start; + public int fifties_tournament = 0x175980; + public int pokecup = 0x177690; + public int greatcup = 0x178610; + public int ultracup = 0x179590; + public int mastercup = 0x17A510; + + void Load_butClick(object sender, EventArgs e) + { + load_rom(null); + } + void load_rom(string filepath) + { + string path = filepath; + int filesize = FileIO.load_file(ref savebuffer, ref path, z64filter); + + if( filesize == 0x1000000 ) + { + filelocation.Text = path; + offset_val.Value = trainer_start; + load_pokemon(); + } + else + { + MessageBox.Show("Invalid file."); + } + + } + void load_pokemon() + { + if (filelocation.Text != "") + { + offset_val.Value = (int)(trainer_start+(trainers.SelectedIndex*js1pk.Size*6)+(trainers.SelectedIndex*0x10)+(PartySlot.Value*js1pk.Size)); + pokemon = new js1pk(getDatafromSave((int)offset_val.Value, js1pk.Size)); + + //Fill data + Species.SelectedIndex = pokemon.Species; + ID.Value = pokemon.TID; + move1.SelectedIndex = pokemon.Move1; + move2.SelectedIndex = pokemon.Move2; + move3.SelectedIndex = pokemon.Move3; + move4.SelectedIndex = pokemon.Move4; + + ppup1.SelectedIndex = pokemon.Move1_PPUps; + ppup2.SelectedIndex = pokemon.Move2_PPUps; + ppup3.SelectedIndex = pokemon.Move3_PPUps; + ppup4.SelectedIndex = pokemon.Move4_PPUps; + + + hp.Value = pokemon.IV_HP; + atk.Value = pokemon.IV_ATK; + def.Value = pokemon.IV_DEF; + spc.Value = pokemon.IV_SPC; + spe.Value = pokemon.IV_SPE; + + hpEv.Value = pokemon.EV_HP; + atkEv.Value = pokemon.EV_ATK; + defEv.Value = pokemon.EV_DEF; + spcEv.Value = pokemon.EV_SPC; + speEv.Value = pokemon.EV_SPE; + + //Stats + hpStat.Text = pokemon.Stat_HPCurrent.ToString()+"/"+pokemon.Stat_HPMax; + atkStat.Text = pokemon.Stat_ATK.ToString(); + defStat.Text = pokemon.Stat_DEF.ToString(); + spcStat.Text = pokemon.Stat_SPC.ToString(); + speStat.Text = pokemon.Stat_SPE.ToString(); + + level.Value = pokemon.Stat_Level; + exp.Value = pokemon.EXP; + + //Extra data + type1.SelectedIndex = pokemon.Type_A; + type2.SelectedIndex = pokemon.Type_B; + catchrate.Value = pokemon.Catch_Rate; + status.Text = "0x"+pokemon.Status_Condition.ToString("X"); + + //OT and nickname + otraw.Text = pokemon.raw_OT(); + nickraw.Text = pokemon.raw_Nick(); + } + } + byte[] getDatafromSave(int Offset, int Length) + { + return savebuffer.Skip(Offset).Take(Length).ToArray(); + } + + void PartySlotValueChanged(object sender, EventArgs e) + { + load_pokemon(); + } + void MainFormLoad(object sender, EventArgs e) + { + + } + void Offset_valValueChanged(object sender, EventArgs e) + { + //load_pokemon(); + } + void Jpk1Click(object sender, EventArgs e) + { + FileIO.save_file(pokemon.convertojpk1(), jpk1filter); + } + void CupsSelectedIndexChanged(object sender, EventArgs e) + { + trainers.Items.Clear(); + trainers.Items.AddRange(new object[] { + "0: Bug Catcher", + "1: Burglar", + "2: Bird Keeper", + "3: Picnicker", + "4: Super Nerd", + "5: Youngster", + "6: Camper", + "7: Lass"}); + + switch(cups.SelectedIndex) + { + case 0: + trainer_start = fifties_tournament; + trainers.Items.Clear(); + trainers.Items.AddRange(new object[] { + "0: Katou Kazuhito", + "1: Yukiyo Jiro", + "2: Takahashi Jun", + "3: Toru", + "4: Suzuki Yusuke", + "5: Fujita Mika", + "6: Hiro Hayashiyasu", + "7: Yamadataka Hisa", + "8: Kitagawa Yasunori", + "9: Nishimura Shun", + "10: Imai Daisuke", + "11: Yuwamasa Kenji", + "12: Hiroki Yoshii", + "13: Tomitaisei Yoshi", + "14: Hiro Fuchiwakiaki"}); + break; + case 1: + trainer_start = pokecup; + break; + case 2: + trainer_start = greatcup; + break; + case 3: + trainer_start = ultracup; + break; + case 4: + trainer_start = mastercup; + break; + } + trainers.SelectedIndex = 0; + PartySlot.Value = 0; + load_pokemon(); + } + void TrainersSelectedIndexChanged(object sender, EventArgs e) + { + PartySlot.Value = 0; + load_pokemon(); + } + } +} + +/* +chartable[0x00] = 0x00 //NULL +chartable[0x01] = 0xA5A4 //イ゛ //SPECIAL (2 CHARACTERS) A5A4 + A59B +chartable[0x02] = 0xA5F4 //ヴ +chartable[0x03] = 0xA5A8 //エ゛ //SPECIAL (2 CHARACTERS) A5A8 + A59B +chartable[0x04] = 0xA5AA //オ゛ //SPECIAL (2 CHARACTERS) A5AA + A59B +chartable[0x05] = 0xA5AC //ガ +chartable[0x06] = 0xA5AE //ギ +chartable[0x07] = 0xA5B0 //グ +chartable[0x08] = 0xA5B2 //ゲ +chartable[0x09] = 0xA5B4 //ゴ +chartable[0x0A] = 0xA5B6 //ザ +chartable[0x0B] = 0xA5B8 //ジ +chartable[0x0C] = 0xA5BA //ズ +chartable[0x0D] = 0xA5BC //ゼ +chartable[0x0E] = 0xA5BE //ゾ +chartable[0x0F] = 0xA5C0 //ダ + +chartable[0x10] = 0xA5C2 //ヂ +chartable[0x11] = 0xA5C5 //ヅ +chartable[0x12] = 0xA5C7 //デ +chartable[0x13] = 0xA5C9 //ド +chartable[0x14] = 0xA5CA //ナ゛ //SPECIAL (2 CHARACTERS) A5CA + A59B +chartable[0x15] = 0xA5CB //ニ゛ //SPECIAL (2 CHARACTERS) A5CB + A59B +chartable[0x16] = 0xA5CC //ヌ゛ //SPECIAL (2 CHARACTERS) A5CC + A59B +chartable[0x17] = 0xA5CD //ネ゛ //SPECIAL (2 CHARACTERS) A5CD + A59B +chartable[0x18] = 0xA5CE //ノ゛ //SPECIAL (2 CHARACTERS) A5CE + A59B +chartable[0x19] = 0xA5D0 //バ +chartable[0x1A] = 0xA5D3 //ビ +chartable[0x1B] = 0xA5D6 //ブ +chartable[0x1C] = 0xA5DC //ボ +chartable[0x1D] = 0xA5DE //マ゛ //SPECIAL (2 CHARACTERS) A5DE + A59B +chartable[0x1E] = 0xA5DF //ミ゛ //SPECIAL (2 CHARACTERS) A5DF + A59B +chartable[0x1F] = 0xA5E0 //ム゛ //SPECIAL (2 CHARACTERS) A5E0 + A59B + +chartable[0x20] = 0xA5A3 //ィ゛ //SPECIAL (2 CHARACTERS) A5A3 + A59B +chartable[0x21] = 0xA542 //あ゛ //SPECIAL (2 CHARACTERS) A543 + A59B +chartable[0x22] = 0xA544 //い゛ //SPECIAL (2 CHARACTERS) A544 + A59B +chartable[0x23] = 0xA5F4 //ゔ +chartable[0x24] = 0xA548 //え゛ //SPECIAL (2 CHARACTERS) A548 + A59B +chartable[0x25] = 0xA54A //お゛ //SPECIAL (2 CHARACTERS) A54A + A59B +chartable[0x26] = 0xA54C //が +chartable[0x27] = 0xA54E //ぎ +chartable[0x28] = 0xA550 //ぐ +chartable[0x29] = 0xA552 //げ +chartable[0x2A] = 0xA554 //ご +chartable[0x2B] = 0xA556 //ざ +chartable[0x2C] = 0xA558 //じ +chartable[0x2D] = 0xA55A //ず +chartable[0x2E] = 0xA55C //ぜ +chartable[0x2F] = 0xA55E //ぞ + +chartable[0x30] = 0xA560 //だ +chartable[0x31] = 0xA562 //ぢ +chartable[0x32] = 0xA565 //づ +chartable[0x33] = 0xA567 //で +chartable[0x34] = 0xA569 //ど +chartable[0x35] = 0xA56A //な゛ //SPECIAL (2 CHARACTERS) A56A + A59B +chartable[0x36] = 0xA56B //に゛ //SPECIAL (2 CHARACTERS) A56B + A59B +chartable[0x37] = 0xA56C //ぬ゛ //SPECIAL (2 CHARACTERS) A56C + A59B +chartable[0x38] = 0xA56D //ね゛ //SPECIAL (2 CHARACTERS) A56D + A59B +chartable[0x39] = 0xA56E //の゛ //SPECIAL (2 CHARACTERS) A56E + A59B +chartable[0x3A] = 0xA570 //ば +chartable[0x3B] = 0xA573 //び +chartable[0x3C] = 0xA576 //ぶ +chartable[0x3D] = 0xA579 //べ +chartable[0x3E] = 0xA57C //ぼ +chartable[0x3F] = 0xA57E //ま゛ //SPECIAL (2 CHARACTERS) A57E + A59B + +chartable[0x40] = 0xA5D1 //パ +chartable[0x41] = 0xA5D4 //ピ +chartable[0x42] = 0xA5D7 //プ +chartable[0x43] = 0xA5DD //ポ +chartable[0x44] = 0xA571 //ぱ +chartable[0x45] = 0xA574 //ぴ +chartable[0x46] = 0xA577 //ぷ +chartable[0x47] = 0xA57A //ぺ +chartable[0x48] = 0xA57D //ぽ +chartable[0x49] = 0xA57E //ま゜ //SPECIAL (2 CHARACTERS) A57E + A59C +chartable[0x4A] = 0x00 //Control +chartable[0x4B] = 0x00 //Control +chartable[0x4C] = 0x00 //Control +chartable[0x4D] = 0xA5 //も゜ +chartable[0x4E] = 0x00 //Control +chartable[0x4F] = 0x00 //Control + + +chartable[0x50] = 0x00 //Control +chartable[0x51] = 0x00 //Control +chartable[0x52] = 0x00 //Control +chartable[0x53] = 0x00 //Control +chartable[0x54] = 0x00 //Control +chartable[0x55] = 0x00 //Control +chartable[0x56] = 0x00 //Control +chartable[0x57] = 0x00 //Control +chartable[0x58] = 0x00 //Control +chartable[0x59] = 0x00 //Control +chartable[0x5A] = 0x00 //Control +chartable[0x5B] = 0x00 //Control +chartable[0x5C] = 0x00 //Control +chartable[0x5D] = 0x00 //Control +chartable[0x5E] = 0x00 //Control +chartable[0x5F] = 0x00 //Control + +chartable[0x60] = 0xA541 //A +chartable[0x61] = 0xA542 //B +chartable[0x62] = 0xA543 //C +chartable[0x63] = 0xA544 //D +chartable[0x64] = 0xA545 //E +chartable[0x65] = 0xA546 //F +chartable[0x66] = 0xA547 //G +chartable[0x67] = 0xA548 //H +chartable[0x68] = 0xA549 //I +chartable[0x69] = 0xA556 //V +chartable[0x6A] = 0xA553 //S +chartable[0x6B] = 0xA543 //L +chartable[0x6C] = 0xA54D //M +chartable[0x6D] = 0xA53A //: +chartable[0x6E] = 0xA543 //ぃ +chartable[0x6F] = 0xA545 //ぅ + +chartable[0x70] = 0xA50C //「 +chartable[0x71] = 0xA50D //」 +chartable[0x72] = 0xA50E //『 +chartable[0x73] = 0xA50F //』 +chartable[0x74] = 0xA5FB //・ +chartable[0x75] = 0xA526 //… +chartable[0x76] = 0xA541 //ぁ +chartable[0x77] = 0xA547 //ぇ +chartable[0x78] = 0xA549 //ぉ +chartable[0x79] = 0 //Unknown unicode +chartable[0x7A] = 0xA53D //= +chartable[0x7B] = 0 //Unknown unicode +chartable[0x7C] = 0xA57C //| ****The character in GB is actually two || +chartable[0x7D] = 0 //Unknown unicode +chartable[0x7E] = 0 //Unknown unicode +chartable[0x7F] = 0xA520 // space character + +chartable[0x80] = 0xA5A2 //ア +chartable[0x81] = 0xA5A4 //イ +chartable[0x82] = 0xA5A6 //ウ +chartable[0x83] = 0xA5A8 //エ +chartable[0x84] = 0xA5AA //オ +chartable[0x85] = 0xA5AB //カ +chartable[0x86] = 0xA5AD //キ +chartable[0x87] = 0xA5AF //ク +chartable[0x88] = 0xA5B1 //ケ +chartable[0x89] = 0xA5B3 //コ +chartable[0x8A] = 0xA5B5 //サ +chartable[0x8B] = 0xA5B7 //シ +chartable[0x8C] = 0xA5B9 //ス +chartable[0x8D] = 0xA5BB //セ +chartable[0x8E] = 0xA5BD //ソ +chartable[0x8E] = 0xA5BF //タ + + +chartable[0x90] = 0xA5C1 //チ +chartable[0x91] = 0xA5C4 //ツ +chartable[0x92] = 0xA5C6 //テ +chartable[0x93] = 0xA5C8 //ト +chartable[0x94] = 0xA5CA //ナ +chartable[0x95] = 0xA5CB //ニ +chartable[0x96] = 0xA5CC //ヌ +chartable[0x97] = 0xA5CD //ネ +chartable[0x98] = 0xA5CE //ノ +chartable[0x99] = 0xA5CF //ハ +chartable[0x9A] = 0xA5D2 //ヒ +chartable[0x9B] = 0xA5D5 //フ +chartable[0x9C] = 0xA5DB //ホ +chartable[0x9D] = 0xA5DE //マ +chartable[0x9E] = 0xA5DF //ミ +chartable[0x9F] = 0xA5E0 //ム + +chartable[0xA0] = 0xA5E1 //メ +chartable[0xA1] = 0xA5E2 //モ +chartable[0xA2] = 0xA5E4 //ヤ +chartable[0xA3] = 0xA5E6 //ユ +chartable[0xA4] = 0xA5E8 //ヨ +chartable[0xA5] = 0xA5E9 //ラ +chartable[0xA6] = 0xA5EB //ル +chartable[0xA7] = 0xA5EC //レ +chartable[0xA8] = 0xA5ED //ロ +chartable[0xA9] = 0xA5EF //ワ +chartable[0xAA] = 0xA5F2 //ヲ +chartable[0xAB] = 0xA5F3 //ン +chartable[0xAC] = 0xA5C3 //ッ +chartable[0xAD] = 0xA5E3 //ャ +chartable[0xAE] = 0xA5E5 //ュ +chartable[0xAF] = 0xA5E7 //ョ + + +chartable[0xB0] = 0xA5A3 //ィ +chartable[0xB1] = 0xA542 //あ +chartable[0xB2] = 0xA544 //い +chartable[0xB3] = 0xA546 //う +chartable[0xB4] = 0xA548 //え +chartable[0xB5] = 0xA54A //お +chartable[0xB6] = 0xA54B //か +chartable[0xB7] = 0xA54D //き +chartable[0xB8] = 0xA54F //く +chartable[0xB9] = 0xA551 //け +chartable[0xBA] = 0xA553 //さ +chartable[0xBB] = 0xA555 //こ +chartable[0xBC] = 0xA557 //し +chartable[0xBD] = 0xA559 //す +chartable[0xBE] = 0xA55B //せ +chartable[0xBF] = 0xA55D //そ + +chartable[0xc0] = 0xA55F //た +chartable[0xc1] = 0xA561 //ち +chartable[0xc2] = 0xA564 //つ +chartable[0xc3] = 0xA566 //て +chartable[0xc4] = 0xA568 //と +chartable[0xc5] = 0xA56A //な +chartable[0xc6] = 0xA56B //に +chartable[0xc7] = 0xA56C //ぬ +chartable[0xc8] = 0xA56D //ね +chartable[0xc9] = 0xA56E //の +chartable[0xcA] = 0xA56F //は +chartable[0xcB] = 0xA572 //ひ +chartable[0xcC] = 0xA575 //ふ +chartable[0xcD] = 0xA58 //へ +chartable[0xcE] = 0xA57B //ほ +chartable[0xcF] = 0xA57E //ま + +chartable[0xD0] = 0xA57F //み +chartable[0xD1] = 0xA580 //む +chartable[0xD2] = 0xA581 //め +chartable[0xD3] = 0xA582 //も +chartable[0xD4] = 0xA584 //や +chartable[0xD5] = 0xA586 //ゆ +chartable[0xD6] = 0xA588 //よ +chartable[0xD7] = 0xA589 //ら +chartable[0xD8] = 0xA58A //り +chartable[0xD9] = 0xA58B //る +chartable[0xDA] = 0xA58C //れ +chartable[0xDB] = 0xA58D //ろ +chartable[0xDC] = 0xA58F //わ //small version isn't in GB charset (A58E) +chartable[0xDD] = 0xA592 //を +chartable[0xDE] = 0xA593 //ん +chartable[0xDF] = 0xA563 //っ + +chartable[0xE0] = 0xA583 //ゃ +chartable[0xE1] = 0xA585 //ゅ +chartable[0xE2] = 0xA587 //ょ +chartable[0xE3] = 0xA5FC //ー +chartable[0xE4] = 0xA59C //゜ //needs special handling +chartable[0xE5] = 0xA59B //゛ //needs special handling +chartable[0xE6] = 0xA53F //? +chartable[0xE7] = 0xA521 //! +chartable[0xE8] = 0xA502 //。 +chartable[0xE9] = 0xA5A1 //ァ +chartable[0xEA] = 0xA5A5 //ゥ +chartable[0xEB] = 0xA5A7 //ェ +chartable[0xEC] = 0xA5B7 //▷ +chartable[0xED] = 0xA5B6 //▶ +chartable[0xEE] = 0xA5BC //▼ +chartable[0xEF] = 0xA542 //♂ + + +chartable[0xF0] = 0xA5A5 //円 //Yen sign, conflicts with ゥ (0xEA in GB table) +chartable[0xF1] = 0xA5D7 //× +chartable[0xF2] = 0xA52E //. +chartable[0xF3] = 0xA52F //'/' +chartable[0xF4] = 0xA5A9 //ォ +chartable[0xF5] = 0xA540 //♀ +chartable[0xF6] = 0xA530 //0 +chartable[0xF7] = 0xA531 //1 +chartable[0xF8] = 0xA532 //2 +chartable[0xF9] = 0xA533 //3 +chartable[0xFA] = 0xA534 //4 +chartable[0xFB] = 0xA535 //5 +chartable[0xFC] = 0xA536 //6 +chartable[0xFD] = 0xA537 //7 +chartable[0xFE] = 0xA538 //8 +chartable[0xFF] = 0xA539 //9 +*/ \ No newline at end of file diff --git a/Stadium_Viewer/MainForm.resx b/Stadium_Viewer/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Stadium_Viewer/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Stadium_Viewer/Program.cs b/Stadium_Viewer/Program.cs new file mode 100644 index 0000000..083c030 --- /dev/null +++ b/Stadium_Viewer/Program.cs @@ -0,0 +1,31 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 07/02/2017 + * Time: 19:12 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Windows.Forms; + +namespace Stadium_Viewer +{ + /// + /// Class with program entry point. + /// + internal sealed class Program + { + /// + /// Program entry point. + /// + [STAThread] + private static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + + } +} diff --git a/Stadium_Viewer/Properties/AssemblyInfo.cs b/Stadium_Viewer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..48f4c5a --- /dev/null +++ b/Stadium_Viewer/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +#region Using directives + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Stadium_Viewer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Stadium_Viewer")] +[assembly: AssemblyCopyright("Copyright 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all the values or you can use the default the Revision and +// Build Numbers by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] diff --git a/Stadium_Viewer/Stadium_Viewer.csproj b/Stadium_Viewer/Stadium_Viewer.csproj new file mode 100644 index 0000000..ed06400 --- /dev/null +++ b/Stadium_Viewer/Stadium_Viewer.csproj @@ -0,0 +1,73 @@ + + + + {65D9D223-0FB6-4CA8-BF8C-6242BF62F284} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + AnyCPU + WinExe + Stadium_Viewer + Stadium_Viewer + v4.0 + Properties + + + x86 + + + bin\Debug\ + True + Full + False + True + DEBUG;TRACE + + + bin\Release\ + False + None + True + False + TRACE + + + + 4.0 + + + + 3.5 + + + + 3.5 + + + + + + 3.5 + + + + + + + + + + MainForm.cs + + + + + + + + + + MainForm.cs + + + + \ No newline at end of file diff --git a/Stadium_Viewer/app.config b/Stadium_Viewer/app.config new file mode 100644 index 0000000..970c80b --- /dev/null +++ b/Stadium_Viewer/app.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Stadium_Viewer/jpk1.cs b/Stadium_Viewer/jpk1.cs new file mode 100644 index 0000000..fe00b47 --- /dev/null +++ b/Stadium_Viewer/jpk1.cs @@ -0,0 +1,95 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 08/02/2017 + * Time: 0:47 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Linq; + +namespace Stadium_Viewer +{ + /// + /// Description of jpk1. + /// + public class jpk1 + { + public jpk1() + { + } + public int Size = 44; + public byte[] Data; + public jpk1(byte[] data = null) + { + Data = data ?? new byte[Size]; + } + + + //Quite riped from pkhex + public int Species + { + get { return Data[0]; } + set + { + Data[0] = (byte)value; + } + } + + public int Stat_HPCurrent { get { return BigEndian.ToUInt16(Data, 0x1); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x1); } } + public int Status_Condition { get { return Data[4]; } set { Data[4] = (byte)value; } } + public int Type_A { get { return Data[5]; } set { Data[5] = (byte)value; } } + public int Type_B { get { return Data[6]; } set { Data[6] = (byte)value; } } + public int Catch_Rate { get { return Data[7]; } set { Data[7] = (byte)value; } } + public int Move1 { get { return Data[8]; } set { Data[8] = (byte) value; } } + public int Move2 { get { return Data[9]; } set { Data[9] = (byte)value; } } + public int Move3 { get { return Data[10]; } set { Data[10] = (byte)value; } } + public int Move4 { get { return Data[11]; } set { Data[11] = (byte)value; } } + public int TID { get { return BigEndian.ToUInt16(Data, 0xC); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0xC); } } + public uint EXP + { + get { return (BigEndian.ToUInt32(Data, 0xE) >> 8) & 0x00FFFFFF; } + set { Array.Copy(BigEndian.GetBytes((value << 8) & 0xFFFFFF00), 0, Data, 0xE, 3); } + } + public int EV_HP { get { return BigEndian.ToUInt16(Data, 0x11); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x11); } } + public int EV_ATK { get { return BigEndian.ToUInt16(Data, 0x13); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x13); } } + public int EV_DEF { get { return BigEndian.ToUInt16(Data, 0x15); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x15); } } + public int EV_SPE { get { return BigEndian.ToUInt16(Data, 0x17); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x17); } } + public int EV_SPC { get { return BigEndian.ToUInt16(Data, 0x19); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x19); } } + public int EV_SPA { get { return EV_SPC; } set { EV_SPC = value; } } + public int EV_SPD { get { return EV_SPC; } set { } } + public ushort DV16 { get { return BigEndian.ToUInt16(Data, 0x1B); } set { BigEndian.GetBytes(value).CopyTo(Data, 0x1B); } } + public int IV_HP { get { return ((IV_ATK & 1) << 3) | ((IV_DEF & 1) << 2) | ((IV_SPE & 1) << 1) | ((IV_SPC & 1) << 0); } set { } } + public int IV_ATK { get { return (DV16 >> 12) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 12)) | (ushort)((value > 0xF ? 0xF : value) << 12)); } } + public int IV_DEF { get { return (DV16 >> 8) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 8)) | (ushort)((value > 0xF ? 0xF : value) << 8)); } } + public int IV_SPE { get { return (DV16 >> 4) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 4)) | (ushort)((value > 0xF ? 0xF : value) << 4)); } } + public int IV_SPC { get { return (DV16 >> 0) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); } } + public int IV_SPA { get { return IV_SPC; } set { IV_SPC = value; } } + public int IV_SPD { get { return IV_SPC; } set { } } + public int Move1_PP { get { return Data[0x1D] & 0x3F; } set { Data[0x1D] = (byte)((Data[0x1D] & 0xC0) | (value & 0x3F)); } } + public int Move2_PP { get { return Data[0x1E] & 0x3F; } set { Data[0x1E] = (byte)((Data[0x1E] & 0xC0) | (value & 0x3F)); } } + public int Move3_PP { get { return Data[0x1F] & 0x3F; } set { Data[0x1F] = (byte)((Data[0x1F] & 0xC0) | (value & 0x3F)); } } + public int Move4_PP { get { return Data[0x20] & 0x3F; } set { Data[0x20] = (byte)((Data[0x20] & 0xC0) | (value & 0x3F)); } } + public int Move1_PPUps { get { return (Data[0x1D] & 0xC0) >> 6; } set { Data[0x1D] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move2_PPUps { get { return (Data[0x1E] & 0xC0) >> 6; } set { Data[0x1E] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move3_PPUps { get { return (Data[0x1F] & 0xC0) >> 6; } set { Data[0x1F] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move4_PPUps { get { return (Data[0x20] & 0xC0) >> 6; } set { Data[0x20] = (byte)((Data[0x20] & 0x3F) | ((value & 0x3) << 6)); } } + + public int Stat_Level + { + get { return Data[0x21]; } + set { Data[0x21] = (byte)value; Data[0x3] = (byte)value; } + } + public int Stat_HPMax { get { return BigEndian.ToUInt16(Data, 0x22); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x22); } } + public int Stat_ATK { get { return BigEndian.ToUInt16(Data, 0x24); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x24); } } + public int Stat_DEF { get { return BigEndian.ToUInt16(Data, 0x26); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x26); } } + public int Stat_SPE { get { return BigEndian.ToUInt16(Data, 0x28); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x28); } } + public int Stat_SPC { get { return BigEndian.ToUInt16(Data, 0x2A); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2A); } } + // Leave SPA and SPD as alias for SPC + public int Stat_SPA { get { return Stat_SPC; } set { Stat_SPC = value; } } + public int Stat_SPD { get { return Stat_SPC; } set { } } + + + } +} diff --git a/Stadium_Viewer/js1pk.cs b/Stadium_Viewer/js1pk.cs new file mode 100644 index 0000000..1adf53a --- /dev/null +++ b/Stadium_Viewer/js1pk.cs @@ -0,0 +1,905 @@ +/* + * Created by SharpDevelop. + * User: sergi + * Date: 08/02/2017 + * Time: 0:47 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Linq; +using System.Windows.Forms; + +namespace Stadium_Viewer +{ + /// + /// Description of js1pk. + /// + public class js1pk + { + public js1pk() + { + } + public static int Size = 80; + public byte[] Data; + public js1pk(byte[] data = null) + { + Data = data ?? new byte[Size]; + + init_table(); + init_speciestable(); + } + + //Quite riped from pkhex + public int Species + { + get { return Data[0]; } + set + { + Data[0] = (byte)value; + } + } + + public int Stat_HPCurrent { get { return BigEndian.ToUInt16(Data, 0x2); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2); } } + public int Status_Condition { get { return Data[5]; } set { Data[5] = (byte)value; } } + public int Type_A { get { return Data[6]; } set { Data[6] = (byte)value; } } + public int Type_B { get { return Data[7]; } set { Data[7] = (byte)value; } } + public int Catch_Rate { get { return Data[8]; } set { Data[8] = (byte)value; } } + public int Move1 { get { return Data[9]; } set { Data[9] = (byte) value; } } + public int Move2 { get { return Data[10]; } set { Data[10] = (byte)value; } } + public int Move3 { get { return Data[11]; } set { Data[11] = (byte)value; } } + public int Move4 { get { return Data[12]; } set { Data[12] = (byte)value; } } + public int TID { get { return BigEndian.ToUInt16(Data, 0xE); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0xE); } } + public uint EXP + { + get { return (BigEndian.ToUInt32(Data, 0x11) >> 8) & 0x00FFFFFF; } + set { Array.Copy(BigEndian.GetBytes((value << 8) & 0xFFFFFF00), 0, Data, 0x11, 3); } + } + public int EV_HP { get { return BigEndian.ToUInt16(Data, 0x14); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x14); } } + public int EV_ATK { get { return BigEndian.ToUInt16(Data, 0x16); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x16); } } + public int EV_DEF { get { return BigEndian.ToUInt16(Data, 0x18); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x18); } } + public int EV_SPE { get { return BigEndian.ToUInt16(Data, 0x1A); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x1A); } } + public int EV_SPC { get { return BigEndian.ToUInt16(Data, 0x1C); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x1C); } } + public int EV_SPA { get { return EV_SPC; } set { EV_SPC = value; } } + public int EV_SPD { get { return EV_SPC; } set { } } + public ushort DV16 { get { return BigEndian.ToUInt16(Data, 0x1E); } set { BigEndian.GetBytes(value).CopyTo(Data, 0x1E); } } + public int IV_HP { get { return ((IV_ATK & 1) << 3) | ((IV_DEF & 1) << 2) | ((IV_SPE & 1) << 1) | ((IV_SPC & 1) << 0); } set { } } + public int IV_ATK { get { return (DV16 >> 12) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 12)) | (ushort)((value > 0xF ? 0xF : value) << 12)); } } + public int IV_DEF { get { return (DV16 >> 8) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 8)) | (ushort)((value > 0xF ? 0xF : value) << 8)); } } + public int IV_SPE { get { return (DV16 >> 4) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 4)) | (ushort)((value > 0xF ? 0xF : value) << 4)); } } + public int IV_SPC { get { return (DV16 >> 0) & 0xF; } set { DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); } } + public int IV_SPA { get { return IV_SPC; } set { IV_SPC = value; } } + public int IV_SPD { get { return IV_SPC; } set { } } + public int Move1_PP { get { return Data[0x20] & 0x3F; } set { Data[0x20] = (byte)((Data[0x1D] & 0xC0) | (value & 0x3F)); } } + public int Move2_PP { get { return Data[0x21] & 0x3F; } set { Data[0x21] = (byte)((Data[0x1E] & 0xC0) | (value & 0x3F)); } } + public int Move3_PP { get { return Data[0x22] & 0x3F; } set { Data[0x22] = (byte)((Data[0x1F] & 0xC0) | (value & 0x3F)); } } + public int Move4_PP { get { return Data[0x23] & 0x3F; } set { Data[0x23] = (byte)((Data[0x20] & 0xC0) | (value & 0x3F)); } } + public int Move1_PPUps { get { return (Data[0x20] & 0xC0) >> 6; } set { Data[0x20] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move2_PPUps { get { return (Data[0x21] & 0xC0) >> 6; } set { Data[0x21] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move3_PPUps { get { return (Data[0x22] & 0xC0) >> 6; } set { Data[0x22] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) << 6)); } } + public int Move4_PPUps { get { return (Data[0x23] & 0xC0) >> 6; } set { Data[0x23] = (byte)((Data[0x20] & 0x3F) | ((value & 0x3) << 6)); } } + + public int Stat_Level + { + get { return Data[0x24]; } + set { Data[0x24] = (byte)value; Data[0x4] = (byte)value; } + } + public int Stat_HPMax { get { return BigEndian.ToUInt16(Data, 0x26); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x26); } } + public int Stat_ATK { get { return BigEndian.ToUInt16(Data, 0x28); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x26); } } + public int Stat_DEF { get { return BigEndian.ToUInt16(Data, 0x2A); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x28); } } + public int Stat_SPE { get { return BigEndian.ToUInt16(Data, 0x2C); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2A); } } + public int Stat_SPC { get { return BigEndian.ToUInt16(Data, 0x2E); } set { BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2C); } } + // Leave SPA and SPD as alias for SPC + public int Stat_SPA { get { return Stat_SPC; } set { Stat_SPC = value; } } + public int Stat_SPD { get { return Stat_SPC; } set { } } + + public string raw_Nick() + { + return BitConverter.ToString(Data, 0x30, 0xF); + } + public string raw_OT() + { + return BitConverter.ToString(Data, 0x40, 0xF); + } + + public byte[] gb_string(int name) //0 nickname, 1 OT + { + int offset = 0x30; + if (name == 1) + offset = 0x40; + byte[] jnick = new byte[6]; + int i, j; + UInt16 temp = 0; + UInt16 temp2 = 0; + for (i=0;i<0x5;i++) + { + temp = BitConverter.ToUInt16(Data, offset+(i*2)); + temp = (ushort)((ushort)((temp & 0xff) << 8) | ((temp >> 8) & 0xff)); + + temp2 = 0; + + //Handle special ゜ (0xA59C) and ゛ (0xA59B) characters + //I don't actually know if the n64 game handles this characters as a separate character, + //but since it seems to follow some kind of standard and not use a custom font/encoding like the GB games, + //this seems the most reasonable way to do it (without actual knowledge of the specific encoding the game uses) + if(i<0x5) + { + temp2 = BitConverter.ToUInt16(Data, offset+(i*2)+2); + temp2 = (ushort)((ushort)((temp2 & 0xff) << 8) | ((temp2 >> 8) & 0xff)); + } + + if (temp2 == 0xA59C) + { + if (temp == 0xA5A4) + jnick[i] = 0x01; + else if (temp == 0xA5A8) + jnick[i] = 0x03; + else if (temp == 0xA5AA) + jnick[i] = 0x04; + else if (temp == 0xA5CA) + jnick[i] = 0x14; + else if (temp == 0xA5CB) + jnick[i] = 0x14; + else if (temp == 0xA5CC) + jnick[i] = 0x16; + else if (temp == 0xA5CD) + jnick[i] = 0x17; + else if (temp == 0xA5CE) + jnick[i] = 0x18; + else if (temp == 0xA5DE) + jnick[i] = 0x1D; + else if (temp == 0xA5DF) + jnick[i] = 0x1E; + else if (temp == 0xA5E0) + jnick[i] = 0x1F; + else if (temp == 0xA5A3) + jnick[i] = 0x20; + else if (temp == 0xA542) + jnick[i] = 0x21; + else if (temp == 0xA544) + jnick[i] = 0x22; + else if (temp == 0xA548) + jnick[i] = 0x24; + else if (temp == 0xA54A) + jnick[i] = 0x25; + else if (temp == 0xA56A) + jnick[i] = 0x35; + else if (temp == 0xA56B) + jnick[i] = 0x36; + else if (temp == 0xA56C) + jnick[i] = 0x37; + else if (temp == 0xA56D) + jnick[i] = 0x38; + else if (temp == 0xA56E) + jnick[i] = 0x39; + else if (temp == 0xA57E) + jnick[i] = 0x3F; + else //This should not happen afaik + { + MessageBox.Show("Unrecognized n64 string encoding 0x"+temp.ToString("X")+" 0x"+temp2.ToString("X")); + jnick[i] = 0x00; + } + i++;//Skip the special character + } + else if (temp2 == 0xA59B) + { + if (temp == 0xA57E) + jnick[i] = 0x49; + else if (temp == 0xA582) + jnick[i] = 0x4D; + else //This should not happen afaik + { + MessageBox.Show("Unrecognized n64 string encoding 0x"+temp.ToString("X")+" 0x"+temp2.ToString("X")); + jnick[i] = 0x00; + } + i++;//Skip the special character + } + else //Not a special ゜ (0xA59C) or ゛ (0xA59B) + { + + if (temp == 0) + { + jnick[i] = 0x50; + break; + } + for (j=0xFF;j>0;j--) //Reverse for loop, because this way characters without special ゜ (0xA59C) or ゛ (0xA59B) are asigned first. + { + if (temp == 0xA1A1)//Invalid chars are mapped to this + { + + } + else if (chartable[j] == temp) + { + jnick[i] = (byte)j; + break; + } + } + } + } + return jnick; + } + + public byte[] convertojpk1() + { + byte [] temparray = new byte[44]; + jpk1 jpoke = new jpk1(temparray); + + + jpoke.Species = speciestable[Species]; + jpoke.Stat_HPCurrent = Stat_HPCurrent; + jpoke.Stat_Level = Stat_Level; + jpoke.Status_Condition = Status_Condition; + jpoke.Type_A = Type_A; + jpoke.Type_B = Type_B; + jpoke.Catch_Rate = Catch_Rate; + jpoke.Move1 = Move1; + jpoke.Move2 = Move2; + jpoke.Move3 = Move3; + jpoke.Move4 = Move4; + jpoke.TID = TID; + jpoke.EXP = EXP; + jpoke.EV_HP = EV_HP; + jpoke.EV_ATK = EV_ATK; + jpoke.EV_DEF = EV_DEF; + jpoke.EV_SPE = EV_SPE; + jpoke.EV_SPC = EV_SPC; + jpoke.DV16 = DV16; + jpoke.Move1_PPUps = Move1_PPUps; + jpoke.Move2_PPUps = Move2_PPUps; + jpoke.Move3_PPUps = Move3_PPUps; + jpoke.Move4_PPUps = Move4_PPUps; + jpoke.Stat_HPMax = Stat_HPMax; + jpoke.Stat_ATK = Stat_ATK; + jpoke.Stat_DEF = Stat_DEF; + jpoke.Stat_SPE = Stat_SPE; + jpoke.Stat_SPC = Stat_SPC; + + byte[] finalpoke = new byte[59]; + + finalpoke[0] = 0x01; + finalpoke[1] = (byte)Species; + finalpoke[2] = 0xFF; + jpoke.Data.CopyTo(finalpoke, 3); + + gb_string(1).CopyTo(finalpoke, 47);//OT + gb_string(0).CopyTo(finalpoke, 53);//Nickname + + //To do: NICK and OT conversion + + return finalpoke; + + } + internal int[] speciestable = new int[152]; + internal void init_speciestable() + { + speciestable[1] = 0x99; + speciestable[2] = 0x9; + speciestable[3] = 0x9A; + speciestable[4] = 0xB0; + speciestable[5] = 0xB2; + speciestable[6] = 0xB4; + speciestable[7] = 0xB1; + speciestable[8] = 0xB3; + speciestable[9] = 0x1C; + speciestable[10] = 0x7B; + speciestable[11] = 0x7C; + speciestable[12] = 0x7D; + speciestable[13] = 0x70; + speciestable[14] = 0x71; + speciestable[15] = 0x72; + speciestable[16] = 0x24; + speciestable[17] = 0x96; + speciestable[18] = 0x97; + speciestable[19] = 0xA5; + speciestable[20] = 0xA6; + speciestable[21] = 0x5; + speciestable[22] = 0x23; + speciestable[23] = 0x6C; + speciestable[24] = 0x2D; + speciestable[25] = 0x54; + speciestable[26] = 0x55; + speciestable[27] = 0x60; + speciestable[28] = 0x61; + speciestable[29] = 0x0F; + speciestable[30] = 0xA8; + speciestable[31] = 0x10; + speciestable[32] = 0x3; + speciestable[33] = 0xA7; + speciestable[34] = 0x7; + speciestable[35] = 0x4; + speciestable[36] = 0x8E; + speciestable[37] = 0x52; + speciestable[38] = 0x53; + speciestable[39] = 0x64; + speciestable[40] = 0x65; + speciestable[41] = 0x6B; + speciestable[42] = 0x82; + speciestable[43] = 0xB9; + speciestable[44] = 0xBA; + speciestable[45] = 0xBB; + speciestable[46] = 0x6D; + speciestable[47] = 0x2E; + speciestable[48] = 0x41; + speciestable[49] = 0x77; + speciestable[50] = 0x3B; + speciestable[51] = 0x76; + speciestable[52] = 0x4D; + speciestable[53] = 0x90; + speciestable[54] = 0x2F; + speciestable[55] = 0x80; + speciestable[56] = 0x39; + speciestable[57] = 0x75; + speciestable[58] = 0x21; + speciestable[59] = 0x14; + speciestable[60] = 0x47; + speciestable[61] = 0x6E; + speciestable[62] = 0x6F; + speciestable[63] = 0x94; + speciestable[64] = 0x26; + speciestable[65] = 0x95; + speciestable[66] = 0x6A; + speciestable[67] = 0x29; + speciestable[68] = 0x7E; + speciestable[69] = 0xBC; + speciestable[70] = 0xBD; + speciestable[71] = 0xBE; + speciestable[72] = 0x18; + speciestable[73] = 0x9B; + speciestable[74] = 0xA9; + speciestable[75] = 0x27; + speciestable[76] = 0x31; + speciestable[77] = 0xA3; + speciestable[78] = 0xA4; + speciestable[79] = 0x25; + speciestable[80] = 0x8; + speciestable[81] = 0xAD; + speciestable[82] = 0x36; + speciestable[83] = 0x40; + speciestable[84] = 0x46; + speciestable[85] = 0x74; + speciestable[86] = 0x3A; + speciestable[87] = 0x78; + speciestable[88] = 0x0D; + speciestable[89] = 0x88; + speciestable[90] = 0x17; + speciestable[91] = 0x8B; + speciestable[92] = 0x19; + speciestable[93] = 0x93; + speciestable[94] = 0x0E; + speciestable[95] = 0x22; + speciestable[96] = 0x30; + speciestable[97] = 0x81; + speciestable[98] = 0x4E; + speciestable[99] = 0x8A; + speciestable[100] = 0x6; + speciestable[101] = 0x8D; + speciestable[102] = 0x0C; + speciestable[103] = 0x0A; + speciestable[104] = 0x11; + speciestable[105] = 0x91; + speciestable[106] = 0x2B; + speciestable[107] = 0x2C; + speciestable[108] = 0x0B; + speciestable[109] = 0x37; + speciestable[110] = 0x8F; + speciestable[111] = 0x12; + speciestable[112] = 0x1; + speciestable[113] = 0x28; + speciestable[114] = 0x1E; + speciestable[115] = 0x2; + speciestable[116] = 0x5C; + speciestable[117] = 0x5D; + speciestable[118] = 0x9D; + speciestable[119] = 0x9E; + speciestable[120] = 0x1B; + speciestable[121] = 0x98; + speciestable[122] = 0x2A; + speciestable[123] = 0x1A; + speciestable[124] = 0x48; + speciestable[125] = 0x35; + speciestable[126] = 0x33; + speciestable[127] = 0x1D; + speciestable[128] = 0x3C; + speciestable[129] = 0x85; + speciestable[130] = 0x16; + speciestable[131] = 0x13; + speciestable[132] = 0x4C; + speciestable[133] = 0x66; + speciestable[134] = 0x69; + speciestable[135] = 0x68; + speciestable[136] = 0x67; + speciestable[137] = 0xAA; + speciestable[138] = 0x62; + speciestable[139] = 0x63; + speciestable[140] = 0x5A; + speciestable[141] = 0x5B; + speciestable[142] = 0xAB; + speciestable[143] = 0x84; + speciestable[144] = 0x4A; + speciestable[145] = 0x4B; + speciestable[146] = 0x49; + speciestable[147] = 0x58; + speciestable[148] = 0x59; + speciestable[149] = 0x42; + speciestable[150] = 0x83; + speciestable[151] = 0x15; + /* + //Some Gen 1 Missingnos + speciestable[] = 0x1F; + speciestable[] = 0x20; + speciestable[] = 0x32; + speciestable[] = 0x34; + speciestable[] = 0x38; + speciestable[] = 0x3D; + speciestable[] = 0x3E; + speciestable[] = 0x3F; + speciestable[] = 0x43; + speciestable[] = 0x44; + speciestable[] = 0x45; + speciestable[] = 0x4F; + speciestable[] = 0x50; + speciestable[] = 0x51; + speciestable[] = 0x56; + speciestable[] = 0x57; + speciestable[] = 0x5E; + speciestable[] = 0x5F; + speciestable[] = 0x73; + speciestable[] = 0x79; + speciestable[] = 0x7A; + speciestable[] = 0x7F; + speciestable[] = 0x86; + speciestable[] = 0x87; + speciestable[] = 0x89; + speciestable[] = 0x8C; + speciestable[] = 0x92; + speciestable[] = 0x9C; + speciestable[] = 0x9F; + speciestable[] = 0xA0; + speciestable[] = 0xA1; + speciestable[] = 0xA2; + speciestable[] = 0xAC; + speciestable[] = 0xAE; + speciestable[] = 0xAF; + speciestable[] = 0xB5; + speciestable[] = 0xB6; + speciestable[] = 0xB7; + speciestable[] = 0xB8; + */ + /* + speciestable[112] = 0x1; + speciestable[115] = 0x2; + speciestable[32] = 0x3; + speciestable[35] = 0x4; + speciestable[21] = 0x5; + speciestable[100] = 0x6; + speciestable[34] = 0x7; + speciestable[80] = 0x8; + speciestable[2] = 0x9; + speciestable[103] = 0x0A; + speciestable[108] = 0x0B; + speciestable[102] = 0x0C; + speciestable[88] = 0x0D; + speciestable[94] = 0x0E; + speciestable[29] = 0x0F; + speciestable[31] = 0x10; + speciestable[104] = 0x11; + speciestable[111] = 0x12; + speciestable[131] = 0x13; + speciestable[59] = 0x14; + speciestable[151] = 0x15; + speciestable[130] = 0x16; + speciestable[90] = 0x17; + speciestable[72] = 0x18; + speciestable[92] = 0x19; + speciestable[123] = 0x1A; + speciestable[120] = 0x1B; + speciestable[9] = 0x1C; + speciestable[127] = 0x1D; + speciestable[114] = 0x1E; + speciestable[58] = 0x21; + speciestable[95] = 0x22; + speciestable[22] = 0x23; + speciestable[16] = 0x24; + speciestable[79] = 0x25; + speciestable[64] = 0x26; + speciestable[75] = 0x27; + speciestable[113] = 0x28; + speciestable[67] = 0x29; + speciestable[122] = 0x2A; + speciestable[106] = 0x2B; + speciestable[107] = 0x2C; + speciestable[24] = 0x2D; + speciestable[47] = 0x2E; + speciestable[54] = 0x2F; + speciestable[96] = 0x30; + speciestable[76] = 0x31; + speciestable[126] = 0x33; + speciestable[125] = 0x35; + speciestable[82] = 0x36; + speciestable[109] = 0x37; + speciestable[56] = 0x39; + speciestable[86] = 0x3A; + speciestable[50] = 0x3B; + speciestable[128] = 0x3C; + speciestable[83] = 0x40; + speciestable[48] = 0x41; + speciestable[149] = 0x42; + speciestable[84] = 0x46; + speciestable[60] = 0x47; + speciestable[124] = 0x48; + speciestable[146] = 0x49; + speciestable[144] = 0x4A; + speciestable[145] = 0x4B; + speciestable[132] = 0x4C; + speciestable[52] = 0x4D; + speciestable[98] = 0x4E; + speciestable[37] = 0x52; + speciestable[38] = 0x53; + speciestable[25] = 0x54; + speciestable[26] = 0x55; + speciestable[147] = 0x58; + speciestable[148] = 0x59; + speciestable[140] = 0x5A; + speciestable[141] = 0x5B; + speciestable[116] = 0x5C; + speciestable[117] = 0x5D; + speciestable[27] = 0x60; + speciestable[28] = 0x61; + speciestable[138] = 0x62; + speciestable[139] = 0x63; + speciestable[39] = 0x64; + speciestable[40] = 0x65; + speciestable[133] = 0x66; + speciestable[136] = 0x67; + speciestable[135] = 0x68; + speciestable[134] = 0x69; + speciestable[66] = 0x6A; + speciestable[41] = 0x6B; + speciestable[23] = 0x6C; + speciestable[46] = 0x6D; + speciestable[61] = 0x6E; + speciestable[62] = 0x6F; + speciestable[13] = 0x70; + speciestable[14] = 0x71; + speciestable[15] = 0x72; + speciestable[85] = 0x74; + speciestable[57] = 0x75; + speciestable[51] = 0x76; + speciestable[49] = 0x77; + speciestable[87] = 0x78; + speciestable[10] = 0x7B; + speciestable[11] = 0x7C; + speciestable[12] = 0x7D; + speciestable[68] = 0x7E; + speciestable[55] = 0x80; + speciestable[97] = 0x81; + speciestable[42] = 0x82; + speciestable[150] = 0x83; + speciestable[143] = 0x84; + speciestable[129] = 0x85; + speciestable[89] = 0x88; + speciestable[99] = 0x8A; + speciestable[91] = 0x8B; + speciestable[101] = 0x8D; + speciestable[36] = 0x8E; + speciestable[110] = 0x8F; + speciestable[53] = 0x90; + speciestable[105] = 0x91; + speciestable[93] = 0x93; + speciestable[63] = 0x94; + speciestable[65] = 0x95; + speciestable[17] = 0x96; + speciestable[18] = 0x97; + speciestable[121] = 0x98; + speciestable[1] = 0x99; + speciestable[3] = 0x9A; + speciestable[73] = 0x9B; + speciestable[118] = 0x9D; + speciestable[119] = 0x9E; + speciestable[77] = 0xA3; + speciestable[78] = 0xA4; + speciestable[19] = 0xA5; + speciestable[20] = 0xA6; + speciestable[33] = 0xA7; + speciestable[30] = 0xA8; + speciestable[74] = 0xA9; + speciestable[137] = 0xAA; + speciestable[142] = 0xAB; + speciestable[81] = 0xAD; + speciestable[4] = 0xB0; + speciestable[7] = 0xB1; + speciestable[5] = 0xB2; + speciestable[8] = 0xB3; + speciestable[6] = 0xB4; + speciestable[43] = 0xB9; + speciestable[44] = 0xBA; + speciestable[45] = 0xBB; + speciestable[69] = 0xBC; + speciestable[70] = 0xBD; + speciestable[71] = 0xBE; + */ + } + internal UInt16[] chartable = new UInt16[256]; + internal void init_table() + { + //All commented chars become 0xA1A1 in stadium (space character) + chartable[0x00] = 0x00; //NULL + //chartable[0x01] = 0xA5A4; //イ゛ //SPECIAL (2 CHARACTERS) A5A4 + A59B + //chartable[0x02] = 0xA5F4; //ヴ + //chartable[0x03] = 0xA5A8; //エ゛ //SPECIAL (2 CHARACTERS) A5A8 + A59B + //chartable[0x04] = 0xA5AA; //オ゛ //SPECIAL (2 CHARACTERS) A5AA + A59B + chartable[0x05] = 0xA5AC; //ガ + chartable[0x06] = 0xA5AE; //ギ + chartable[0x07] = 0xA5B0; //グ + chartable[0x08] = 0xA5B2; //ゲ + chartable[0x09] = 0xA5B4; //ゴ + chartable[0x0A] = 0xA5B6; //ザ + chartable[0x0B] = 0xA5B8; //ジ + chartable[0x0C] = 0xA5BA; //ズ + chartable[0x0D] = 0xA5BC; //ゼ + chartable[0x0E] = 0xA5BE; //ゾ + chartable[0x0F] = 0xA5C0; //ダ + + chartable[0x10] = 0xA5C2; //ヂ + chartable[0x11] = 0xA5C5; //ヅ + chartable[0x12] = 0xA5C7; //デ + chartable[0x13] = 0xA5C9; //ド + //chartable[0x14] = 0xA5CA; //ナ゛ //SPECIAL (2 CHARACTERS) A5CA + A59B + //chartable[0x15] = 0xA5CB; //ニ゛ //SPECIAL (2 CHARACTERS) A5CB + A59B + //chartable[0x16] = 0xA5CC; //ヌ゛ //SPECIAL (2 CHARACTERS) A5CC + A59B + //chartable[0x17] = 0xA5CD; //ネ゛ //SPECIAL (2 CHARACTERS) A5CD + A59B + //chartable[0x18] = 0xA5CE; //ノ゛ //SPECIAL (2 CHARACTERS) A5CE + A59B + chartable[0x19] = 0xA5D0; //バ + chartable[0x1A] = 0xA5D3; //ビ + chartable[0x1B] = 0xA5D6; //ブ + chartable[0x1C] = 0xA5DC; //ボ + //chartable[0x1D] = 0xA5DE; //マ゛ //SPECIAL (2 CHARACTERS) A5DE + A59B + //chartable[0x1E] = 0xA5DF; //ミ゛ //SPECIAL (2 CHARACTERS) A5DF + A59B + //chartable[0x1F] = 0xA5E0; //ム゛ //SPECIAL (2 CHARACTERS) A5E0 + A59B + + //chartable[0x20] = 0xA5A3; //ィ゛ //SPECIAL (2 CHARACTERS) A5A3 + A59B + //chartable[0x21] = 0xA542; //あ゛ //SPECIAL (2 CHARACTERS) A543 + A59B + //chartable[0x22] = 0xA544; //い゛ //SPECIAL (2 CHARACTERS) A544 + A59B + //chartable[0x23] = 0xA5F4; //ゔ + //chartable[0x24] = 0xA548; //え゛ //SPECIAL (2 CHARACTERS) A548 + A59B + //chartable[0x25] = 0xA54A; //お゛ //SPECIAL (2 CHARACTERS) A54A + A59B + chartable[0x26] = 0xA4AC; //が + chartable[0x27] = 0xA4AE; //ぎ + chartable[0x28] = 0xA4B0; //ぐ + chartable[0x29] = 0xA4B2; //げ + chartable[0x2A] = 0xA4B4; //ご + chartable[0x2B] = 0xA4B6; //ざ + chartable[0x2C] = 0xA4B8; //じ + chartable[0x2D] = 0xA4BA; //ず + chartable[0x2E] = 0xA4BC; //ぜ + chartable[0x2F] = 0xA4BE; //ぞ + + chartable[0x30] = 0xA4C0; //だ + chartable[0x31] = 0xA4C2; //ぢ + chartable[0x32] = 0xA4C5; //づ + chartable[0x33] = 0xA4C7; //で + chartable[0x34] = 0xA4C9; //ど + //chartable[0x35] = 0xA56A; //な゛ //SPECIAL (2 CHARACTERS) A56A + A59B + //chartable[0x36] = 0xA56B; //に゛ //SPECIAL (2 CHARACTERS) A56B + A59B + //chartable[0x37] = 0xA56C; //ぬ゛ //SPECIAL (2 CHARACTERS) A56C + A59B + //chartable[0x38] = 0xA56D; //ね゛ //SPECIAL (2 CHARACTERS) A56D + A59B + //chartable[0x39] = 0xA56E; //の゛ //SPECIAL (2 CHARACTERS) A56E + A59B + chartable[0x3A] = 0xA4D0; //ば + chartable[0x3B] = 0xA4D3; //び + chartable[0x3C] = 0xA4D6; //ぶ + chartable[0x3D] = 0xA4DA; //べ + chartable[0x3E] = 0xA4DD; //ぼ + //chartable[0x3F] = 0xA57E; //ま゛ //SPECIAL (2 CHARACTERS) A57E + A59B + + //chartable[0x40] = 0xA5D1; //パ + //chartable[0x41] = 0xA5D4; //ピ + chartable[0x42] = 0xA5D7; //プ + chartable[0x43] = 0xA5DD; //ポ + chartable[0x44] = 0xA4D1; //ぱ + chartable[0x45] = 0xA4D4; //ぴ + chartable[0x46] = 0xA4D7; //ぷ + //chartable[0x47] = 0xAA; //ぺ + //chartable[0x48] = 0xA57D; //ぽ + //chartable[0x49] = 0xA57E; //ま゜ //SPECIAL (2 CHARACTERS) A57E + A59C + //chartable[0x4A] = 0x00; //Control + //chartable[0x4B] = 0x00; //Control + //chartable[0x4C] = 0x00; //Control + //chartable[0x4D] = 0xA582; //も゜ //SPECIAL (2 CHARACTERS) A582 + A59C + //chartable[0x4E] = 0x00; //Control + //chartable[0x4F] = 0x00; //Control + + /* + chartable[0x50] = 0x00; //Control + chartable[0x51] = 0x00; //Control + chartable[0x52] = 0x00; //Control + chartable[0x53] = 0x00; //Control + chartable[0x54] = 0x00; //Control + chartable[0x55] = 0x00; //Control + chartable[0x56] = 0x00; //Control + chartable[0x57] = 0x00; //Control + chartable[0x58] = 0x00; //Control + chartable[0x59] = 0x00; //Control + chartable[0x5A] = 0x00; //Control + chartable[0x5B] = 0x00; //Control + chartable[0x5C] = 0x00; //Control + chartable[0x5D] = 0x00; //Control + chartable[0x5E] = 0x00; //Control + chartable[0x5F] = 0x00; //Control + */ + + chartable[0x60] = 0xA3C1; //A + chartable[0x61] = 0xA3C2; //B + chartable[0x62] = 0xA3C3; //C + chartable[0x63] = 0xA3C4; //D + chartable[0x64] = 0xA3C5; //E + chartable[0x65] = 0xA3C6; //F + chartable[0x66] = 0xA3C7; //G + chartable[0x67] = 0xA3C8; //H + chartable[0x68] = 0xA3C9; //I + chartable[0x69] = 0xA3CA; //V + chartable[0x6A] = 0xA3CB; //S + chartable[0x6B] = 0xA3CC; //L + chartable[0x6C] = 0xA3CD; //M + chartable[0x6D] = 0xA5CE; //: //N in stadium 1 jap + chartable[0x6E] = 0xA4A3; //ぃ + chartable[0x6F] = 0xA4A5; //ぅ + + chartable[0x70] = 0xA3D1; //「 //Q in stadium 1 jap + chartable[0x71] = 0xA3D2; //」 //R in stadium 1 jap + chartable[0x72] = 0xA3D3; //『 //S in stadium 1 jap + chartable[0x73] = 0xA3D4; //』 //T in stadium 1 jap + chartable[0x74] = 0xA3D5; //・ //U in stadium 1 jap + chartable[0x75] = 0xA3D6; //… //V in stadium 1 jap + chartable[0x76] = 0xA4A1; //ぁ + chartable[0x77] = 0xA4A7; //ぇ + chartable[0x78] = 0xA4A9; //ぉ + chartable[0x79] = 0xA3DA; //Unknown unicode //Z in stadium 1 jap + //chartable[0x7A] = 0xA53D; //= + //chartable[0x7B] = 0; //Unknown unicode + //chartable[0x7C] = 0xA57C; //| ****The character in GB is actually two || (need to check if it is a valid in-game text input) + //chartable[0x7D] = 0; //Unknown unicode + //chartable[0x7E] = 0; //Unknown unicode + chartable[0x7F] = 0xA1A1; // space character + + chartable[0x80] = 0xA5A2; //ア + chartable[0x81] = 0xA5A4; //イ + chartable[0x82] = 0xA5A6; //ウ + chartable[0x83] = 0xA5A8; //エ + chartable[0x84] = 0xA5AA; //オ + chartable[0x85] = 0xA5AB; //カ + chartable[0x86] = 0xA5AD; //キ + chartable[0x87] = 0xA5AF; //ク + chartable[0x88] = 0xA5B1; //ケ + chartable[0x89] = 0xA5B3; //コ + chartable[0x8A] = 0xA5B5; //サ + chartable[0x8B] = 0xA5B7; //シ + chartable[0x8C] = 0xA5B9; //ス + chartable[0x8D] = 0xA5BB; //セ + chartable[0x8E] = 0xA5BD; //ソ + chartable[0x8E] = 0xA5BF; //タ + + + chartable[0x90] = 0xA5C1; //チ + chartable[0x91] = 0xA5C4; //ツ + chartable[0x92] = 0xA5C6; //テ + chartable[0x93] = 0xA5C8; //ト + chartable[0x94] = 0xA5CA; //ナ + chartable[0x95] = 0xA5CB; //ニ + chartable[0x96] = 0xA5CC; //ヌ + chartable[0x97] = 0xA5CD; //ネ + chartable[0x98] = 0xA5CE; //ノ + chartable[0x99] = 0xA5CF; //ハ + chartable[0x9A] = 0xA5D2; //ヒ + chartable[0x9B] = 0xA5D5; //フ + chartable[0x9C] = 0xA5DB; //ホ + chartable[0x9D] = 0xA5DE; //マ + chartable[0x9E] = 0xA5DF; //ミ + chartable[0x9F] = 0xA5E0; //ム + + chartable[0xA0] = 0xA5E1; //メ + chartable[0xA1] = 0xA5E2; //モ + chartable[0xA2] = 0xA5E4; //ヤ + chartable[0xA3] = 0xA5E6; //ユ + chartable[0xA4] = 0xA5E8; //ヨ + chartable[0xA5] = 0xA5E9; //ラ + chartable[0xA6] = 0xA5EB; //ル + chartable[0xA7] = 0xA5EC; //レ + chartable[0xA8] = 0xA5ED; //ロ + chartable[0xA9] = 0xA5EF; //ワ + chartable[0xAA] = 0xA5F2; //ヲ + chartable[0xAB] = 0xA5F3; //ン + chartable[0xAC] = 0xA5C3; //ッ + chartable[0xAD] = 0xA5E3; //ャ + chartable[0xAE] = 0xA5E5; //ュ + chartable[0xAF] = 0xA5E7; //ョ + + + chartable[0xB0] = 0xA5A3; //ィ + chartable[0xB1] = 0xA4A2; //あ + chartable[0xB2] = 0xA4A4; //い + chartable[0xB3] = 0xA4A6; //う + chartable[0xB4] = 0xA4A8; //え + chartable[0xB5] = 0xA4AA; //お + chartable[0xB6] = 0xA4AB; //か + chartable[0xB7] = 0xA4AD; //き + chartable[0xB8] = 0xA4AF; //く + chartable[0xB9] = 0xA4B1; //け + chartable[0xBA] = 0xA4B3; //さ + chartable[0xBB] = 0xA4B5; //こ + chartable[0xBC] = 0xA4B7; //し + chartable[0xBD] = 0xA4B9; //す + chartable[0xBE] = 0xA4BB; //せ + chartable[0xBF] = 0xA4BD; //そ + + chartable[0xc0] = 0xA4BF; //た + chartable[0xc1] = 0xA4C1; //ち + chartable[0xc2] = 0xA4C4; //つ + chartable[0xc3] = 0xA4C6; //て + chartable[0xc4] = 0xA4C8; //と + chartable[0xc5] = 0xA4CA; //な + chartable[0xc6] = 0xA4CB; //に + chartable[0xc7] = 0xA4CC; //ぬ + chartable[0xc8] = 0xA4CD; //ね + chartable[0xc9] = 0xA4CE; //の + chartable[0xcA] = 0xA4CF; //は + chartable[0xcB] = 0xA4D2; //ひ + chartable[0xcC] = 0xA4D5; //ふ + chartable[0xcD] = 0xA4D8; //へ + chartable[0xcE] = 0xA4DB; //ほ + chartable[0xcF] = 0xA4DE; //ま + + chartable[0xD0] = 0xA4DF; //み + chartable[0xD1] = 0xA4E0; //む + chartable[0xD2] = 0xA4E1; //め + chartable[0xD3] = 0xA4E2; //も + chartable[0xD4] = 0xA4E4; //や + chartable[0xD5] = 0xA4E6; //ゆ + chartable[0xD6] = 0xA4E8; //よ + chartable[0xD7] = 0x44E9; //ら + chartable[0xD8] = 0xA4EA; //り + chartable[0xD9] = 0xA4EB; //る + chartable[0xDA] = 0xA4EC; //れ + chartable[0xDB] = 0xA4ED; //ろ + chartable[0xDC] = 0xA4EF; //わ //small version isn't in GB charset (A58E) + chartable[0xDD] = 0xA4F2; //を + chartable[0xDE] = 0xA4F3; //ん + chartable[0xDF] = 0xA4C3; //っ + + chartable[0xE0] = 0xA4E3; //ゃ + chartable[0xE1] = 0xA4E5; //ゅ + chartable[0xE2] = 0xA4E7; //ょ + chartable[0xE3] = 0xA1BC; //ー + chartable[0xE4] = 0xA1A3; //゜ //needs special handling? + chartable[0xE5] = 0xA1A5; //゛ //needs special handling? + chartable[0xE6] = 0xA1A9; //? + chartable[0xE7] = 0xA1AA; //! + chartable[0xE8] = 0xA1A; //。 //some sort of ' punctuation, but appers in the bottom in stadium 1 jap + chartable[0xE9] = 0xA5A1; //ァ + chartable[0xEA] = 0xA5A5; //ゥ + chartable[0xEB] = 0xA5A7; //ェ + //chartable[0xEC] = 0xA5B7; //▷ + //chartable[0xED] = 0xA5B6; //▶ + //chartable[0xEE] = 0xA5BC; //▼ + chartable[0xEF] = 0xA1E9; //♂ + + //chartable[0xF0] = 0xA5A5; //円 //Yen sign, conflicts with ゥ (0xEA in GB table) (need to check if it is a valid in-game text input) + //chartable[0xF1] = 0xA5D7; //× //Conflicts with プ (0x42 in GB table) (need to check if it is a valid in-game text input) + //chartable[0xF2] = 0xA52E; //. + //chartable[0xF3] = 0xA52F; //'/' + //chartable[0xF4] = 0xA5A9; //ォ + chartable[0xF5] = 0xA1EA; //♀ + chartable[0xF6] = 0xA3B0; //0 + chartable[0xF7] = 0xA3B1; //1 + chartable[0xF8] = 0xA3B2; //2 + chartable[0xF9] = 0xA3B3; //3 + chartable[0xFA] = 0xA3B4; //4 + chartable[0xFB] = 0xA3B5; //5 + chartable[0xFC] = 0xA3B6; //6 + chartable[0xFD] = 0xA3B7; //7 + chartable[0xFE] = 0xA3B8; //8 + chartable[0xFF] = 0xA3B9; //9 + } + + + } +}