private void cheatForm_Load(object sender, EventArgs e) { switch (Machine.sBoard) { case "CPS-1": case "CPS-1(QSound)": case "CPS2": case "Neo Geo": CheatReadByte = (int i1) => { return(Memory.mainram[i1]); }; CheatWriteByte = (int i1, byte b1) => { Memory.mainram[i1] = b1; }; break; case "Namco System 1": CheatReadByte = (int i1) => { return(Namcos1.N0ReadMemory((ushort)i1)); }; CheatWriteByte = (int i1, byte b1) => { Namcos1.N0WriteMemory((ushort)i1, b1); }; break; case "IGS011": CheatReadByte = (int i1) => { return((byte)MC68000.m1.ReadByte(i1)); }; CheatWriteByte = (int i1, byte b1) => { MC68000.m1.WriteByte(i1, (sbyte)b1); }; break; case "PGM": CheatReadByte = (int i1) => { return((byte)MC68000.m1.ReadByte(i1)); }; CheatWriteByte = (int i1, byte b1) => { MC68000.m1.WriteByte(i1, (sbyte)b1); }; break; case "M72": case "M92": CheatReadByte = (int i1) => { return(Nec.nn1[0].ReadByte(i1)); }; CheatWriteByte = (int i1, byte b1) => { Nec.nn1[0].WriteByte(i1, b1); }; break; } }
private void cheatsearchForm_Load(object sender, EventArgs e) { cbRam.SelectedIndex = 0; cbByte.SelectedIndex = 0; cbMemory.SelectedIndex = 0; ColumnHeader columnheader; columnheader = new ColumnHeader(); columnheader.Text = "address"; columnheader.Width = 80; searchListView.Columns.Add(columnheader); columnheader = new ColumnHeader(); columnheader.Text = "value(hex)"; columnheader.Width = 80; searchListView.Columns.Add(columnheader); columnheader = new ColumnHeader(); columnheader.Text = "value(dec)"; columnheader.Width = 80; searchListView.Columns.Add(columnheader); columnheader = new ColumnHeader(); columnheader.Text = "last value(hex)"; columnheader.Width = 110; searchListView.Columns.Add(columnheader); searchListView.View = View.Details; searchListView.FullRowSelect = true; switch (Machine.sBoard) { case "CPS-1": case "CPS-1(QSound)": case "CPS2": case "Neo Geo": nRam = 0x10000; tbRamRange.Text = "0000-10000"; CheatReadByte = (int i1) => { return(Memory.mainram[i1]); }; CheatWriteByte = (int i1, byte b1) => { Memory.mainram[i1] = b1; }; break; case "Namco System 1": nRam = 0x10000; tbRamRange.Text = "0000-10000"; CheatReadByte = (int i1) => { return(Namcos1.N0ReadMemory((ushort)i1)); }; CheatWriteByte = (int i1, byte b1) => { Namcos1.N0WriteMemory((ushort)i1, b1); }; break; case "IGS011": case "PGM": break; } bbSearch1 = new byte[nRam]; bbSearch2 = new byte[nRam]; bbSearch3 = new byte[nRam]; }