public void InitPopulateList() { ushort resetAddr = nes.GetResetAddr(); int updateIndex = 0; for (ushort i = resetAddr; i < 0xFFFF; i++) { listBytes.Items.Add("0x" + ConvertHex(i)); listBytes.Items[updateIndex].SubItems.Add(ConvertHex(nes.Read8(i))); updateIndex += 1; } lblReset.Text = "0x" + Convert.ToString(resetAddr, 16); }
public void ListOpcodesAt() { ushort offset = 0x8000; string msgBuffer = ""; for (int i = 0; i < 40; i++) { byte opcodeAt = nes.Read8((ushort)(offset + i)); msgBuffer += "0x" + ConvertHex(offset + i) + ": " + ConvertHex(opcodeAt).ToUpper() + nl; } txtConsole.Text += "RESET POINT: 0x" + ConvertHex(nes.GetResetAddr()) + nl; txtConsole.Text += msgBuffer + nl; txtConsole.Text += ConvertHex(nes.Read8(0x8015)) + nl; txtConsole.Text += ConvertHex(nes.Read8(0x8016)) + nl; txtConsole.Text += ConvertHex(nes.Read16(0x8015)); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "NES Roms (*.nes)|*.nes"; if (ofd.ShowDialog() == DialogResult.OK) { fileName = ofd.FileName; //START INIT CODE cr = cs.ReadCart(fileName); nes = new NESCore(cr); cpu = new NES6502(cr, nes); ren = new BMP16Renderer(cr); ppu = new PPUCore(cr, ren); cpu.pc_reg = nes.GetResetAddr(); //END INIT CODE MessageBox.Show("PRG ROM loaded!!!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); buttons(true); } }