public void setPokeIndex(object sender, EventArgs e) { MyComboBox c = sender as MyComboBox; evo[rowIndex].poke = (short)c.SelectedIndex; grid.Rows[rowIndex].Cells[2].Value = WordsDecoding.PreFixString((string[])c.DataSource, c.SelectedIndex); }
public void setGridEvoInfo(ReadAndWrite rw, int num, string[] pokeNames) { Evo[] e = getEvo(rw, num); for (int i = 0; i < EVO_PER_POKE; i++) { Evo e0 = e[i]; grid.Rows[i].Cells[0].Value = (int)e0.method; grid.Rows[i].Cells[1].Value = Operation.Hex(e0.padd0); grid.Rows[i].Cells[2].Value = WordsDecoding.PreFixString(pokeNames, e0.poke); grid.Rows[i].Cells[3].Value = Operation.Hex(e0.parameter); grid.Rows[i].Cells[4].Value = Operation.Hex(e0.padd1); } }
public void RepointPokesEm(int NewNumberOfPokes, int NewDexSize, int RamOffset, int StartOffset) { WordsDecoding wd = new WordsDecoding(); //插入数据 bw.BaseStream.Seek(0x5cdc00, SeekOrigin.Begin); bw.Write(wd.SaveSizeEm, 0, wd.SaveSizeEm.Length); bw.BaseStream.Seek(StartOffset, SeekOrigin.Begin); bw.Write(wd.SaveBlockEm, 0, wd.SaveBlockEm.Length); //设置saveblock bw.BaseStream.Seek(0x152E98, SeekOrigin.Begin); bw.Write(0x47004800); //开始地址转成指针先加0x8000000 bw.Write(StartOffset + 1 + 0x8000000); bw.BaseStream.Seek(0x15284E, SeekOrigin.Begin); bw.Write(new byte[] { 0x38, 0x47 }); bw.BaseStream.Seek(0x15288C, SeekOrigin.Begin); bw.Write(StartOffset + 61 + 0x8000000); bw.BaseStream.Seek(0x0D9CC6, SeekOrigin.Begin); bw.Write(new byte[] { 0x38, 0x47 }); bw.BaseStream.Seek(0x0D9D04, SeekOrigin.Begin); bw.Write(StartOffset + 61 + 0x8000000); bw.BaseStream.Seek(0x0DA284, SeekOrigin.Begin); bw.Write(0x47004800); bw.Write(StartOffset + 1 + 0x8000000); //扩容图鉴。重定义seenflag和caughtflag //内存地址不需要加 //安全地址1:0203D800 安全地址2:0x0203CF64 if (NewDexSize % 8 != 0) { NewDexSize += (8 - NewDexSize % 8); } byte NeededFlagBytes = (byte)(NewDexSize / 8); int SeenFlagOffset = RamOffset; int CaughtFlagOffset = SeenFlagOffset + NeededFlagBytes; bw.BaseStream.Seek(0xC06EC, SeekOrigin.Begin); bw.Write(SeenFlagOffset); bw.BaseStream.Seek(0xC06AC, SeekOrigin.Begin); bw.Write(0); bw.BaseStream.Seek(0xC0744, SeekOrigin.Begin); bw.Write(CaughtFlagOffset); bw.BaseStream.Seek(0xC06FE, SeekOrigin.Begin); bw.Write(new byte[6] { 0, 0, 0, 0, 0, 0 }); bw.BaseStream.Seek(0xC0710, SeekOrigin.Begin); bw.Write(new byte[2] { 0x15, 0xE0 }); bw.BaseStream.Seek(0xC0720, SeekOrigin.Begin); bw.Write(new byte[2] { 0xd, 0xE0 }); bw.BaseStream.Seek(0xC07C8, SeekOrigin.Begin); bw.Write(SeenFlagOffset); bw.BaseStream.Seek(0xC079E, SeekOrigin.Begin); bw.Write(0); bw.BaseStream.Seek(0xC07AC, SeekOrigin.Begin); bw.Write(new byte[2] { 0x1c, 0xE0 }); bw.BaseStream.Seek(0xC07F0, SeekOrigin.Begin); bw.Write(CaughtFlagOffset); bw.BaseStream.Seek(0xC07DA, SeekOrigin.Begin); bw.Write(0); bw.BaseStream.Seek(0x843BC, SeekOrigin.Begin); bw.Write(SeenFlagOffset); bw.BaseStream.Seek(0x8439A, SeekOrigin.Begin); bw.Write(0x1c20); bw.BaseStream.Seek(0x843A0, SeekOrigin.Begin); bw.Write(new byte[2] { NeededFlagBytes, 0x22 }); bw.BaseStream.Seek(0x843A6, SeekOrigin.Begin); bw.Write(new byte[2] { 0x20, 0x1c }); bw.BaseStream.Seek(0x843A8, SeekOrigin.Begin); bw.Write(new byte[2] { NeededFlagBytes, 0x30 }); bw.BaseStream.Seek(0x843AC, SeekOrigin.Begin); bw.Write(new byte[2] { NeededFlagBytes, 0x22 }); }