frozenLake

Untitled

Apr 19th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. addHook("MapLoad", function()
  2. end)
  3.  
  4. hud.add(function(v,p)
  5. local CodeTable={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 224, 162, 72, 96, 0, 97, 30, 98, 0, 210, 2, 210, 18, 114, 8, 50, 64, 18, 10, 96, 0, 97, 62, 98, 2, 162, 74, 208, 46, 209, 46, 114, 14, 208, 46, 209, 46, 162, 88, 96, 11, 97, 8, 208, 31, 112, 10, 162, 103, 208, 31, 112, 10, 162, 118, 208, 31, 112, 3, 162, 133, 208, 31, 112, 10, 162, 148, 208, 31, 18, 70, 255, 255, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 255, 129, 129, 129, 129, 129, 129, 129, 255, 129, 129, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 255, 129, 129, 129, 129, 129, 129, 255, 128, 128, 128, 128, 128, 128, 128, 255, 129, 129, 129, 129, 129, 129, 255, 129, 129, 129, 129, 129, 129, 255, 255}
  6. local regI=0
  7. v.drawFill(64,4,192,192,31)
  8. local stackPointer = 512
  9. while stackPointer<4096
  10. local loadedByteA = CodeTable[stackPointer+1]
  11. local loadedByteB = CodeTable[stackPointer+2]
  12. if loadedByteA == 0
  13. if loadedByteB == 224
  14. v.drawFill(64,4,192,192,31)
  15. stackPointer = stackPointer+2
  16. elseif loadedByteB == 238
  17. print("RET not implemented yet")
  18. stackPointer = stackPointer+2
  19. else
  20. print("UH OH AN ERROR")
  21. end
  22. elseif loadedByteA < 16
  23. print("UH OH AN ERROR")
  24. stackPointer = stackPointer+2
  25. elseif loadedByteA < 32
  26. stackPointer=loadedByteB+((loadedByteA%16)*256)
  27. print("Jumping to ",stackPointer)
  28. elseif loadedByteA < 48
  29. print("CALL not implemented yet")
  30. stackPointer = stackPointer+2
  31. elseif loadedByteA < 64
  32. print("Skip next instruction if Vx = kk. (not implemented yet)")
  33. stackPointer = stackPointer+2
  34. elseif loadedByteA < 80
  35. print("Skip next instruction if Vx != kk. (not implemented yet)")
  36. stackPointer = stackPointer+2
  37. elseif loadedByteA < 96
  38. print("Skip next instruction if Vx = Vy. (not implemented yet)")
  39. stackPointer = stackPointer+2
  40. elseif loadedByteA < 112
  41. print("Set Vx = kk. (not implemented yet)")
  42. stackPointer = stackPointer+2
  43. elseif loadedByteA < 128
  44. print("Set Vx = Vx + kk. (not implemented yet)")
  45. stackPointer = stackPointer+2
  46. elseif loadedByteA < 144
  47. print("Doing math op on Vx and Vy (not implemented yet)")
  48. stackPointer = stackPointer+2
  49. elseif loadedByteA < 160
  50. print("Skip next instruction if Vx != Vy. (not implemented yet)")
  51. stackPointer = stackPointer+2
  52. elseif loadedByteA < 176
  53. regI=loadedByteB+((loadedByteA%16)*256)
  54. print("Setting I = nnn.",regI)
  55. stackPointer = stackPointer+2
  56. elseif loadedByteA < 192
  57. print("Jump to location nnn + V0. (not implemented yet)")
  58. stackPointer = stackPointer+2
  59. elseif loadedByteA < 208
  60. print("Set Vx = random byte AND kk (not implemented yet)")
  61. stackPointer = stackPointer+2
  62. elseif loadedByteA < 224
  63. print("Display Sprite (not implemented yet)")
  64. stackPointer = stackPointer+2
  65. elseif loadedByteA < 240
  66. print("Check Joypad (not implemented yet)")
  67. stackPointer = stackPointer+2
  68. elseif loadedByteA < 256
  69. print("MISC Ops (not implemented yet)",loadedByteA,loadedByteB,loadedByteA & 240)
  70. stackPointer = stackPointer+2
  71. end
  72. end
  73. end)
Advertisement
Add Comment
Please, Sign In to add comment