scripteur78

Untitled

Apr 5th, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. //when button is clicked, open file dialog
  4. OpenFileDialog ofd = new OpenFileDialog();
  5. ofd.Filter = "GB ROMs|*.gb";
  6.  
  7. // if user selects a file, get the file name and display it in the label get only the name, not the path
  8. if (ofd.ShowDialog() == DialogResult.OK)
  9. {
  10. label1.Text = ofd.SafeFileName;
  11. }
  12.  
  13. // get the map from the pointer
  14. // pointers are : 0x9800 to 0x9BFF for map 1 and 0x9C00 0x9FFF for map 2
  15.  
  16. const int map1 = 0x9800;
  17. const int map2 = 0x9C00;
  18.  
  19. // transform the data into a 2D array and display it in the textbox
Advertisement
Add Comment
Please, Sign In to add comment