scripteur78

Untitled

Apr 5th, 2023
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. byte[] mapData = ReadROM(ofd.FileName, map1, 1024); // read the first map (1024 bytes)
  2.  
  3. byte[,] map = new byte[32, 32];
  4. int count = 0;
  5.  
  6. for (int i = 0; i < 32; i++)
  7. {
  8. for (int j = 0; j < 32; j++)
  9. {
  10. map[j, i] = mapData[count++];
  11. }
  12. }
  13.  
  14. // display the map in the textbox
  15. StringBuilder sb = new StringBuilder();
  16. for (int i = 0; i < 32; i++)
  17. {
  18. for (int j = 0; j < 32; j++)
  19. {
  20. sb.AppendFormat("{0:x2} ", map[j, i]);
  21. }
  22. sb.AppendLine();
  23. }
  24.  
  25. textBox1.Text = sb.ToString();
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment