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,0,0,0,0,0,0,0,0,0,0,0,0,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}
- local regI=0
- v.drawFill(64,4,192,192,31)
- local stackPointer = 512
- while stackPointer<4096
- local loadedByteA = CodeTable[stackPointer+1]
- local loadedByteB = CodeTable[stackPointer+2]
- if loadedByteA == 0
- if loadedByteB == 224
- v.drawFill(64,4,192,192,31)
- stackPointer = stackPointer+2
- elseif loadedByteB == 238
- print("RET not implemented yet")
- stackPointer = stackPointer+2
- else
- print("UH OH AN ERROR")
- end
- elseif loadedByteA < 16
- print("UH OH AN ERROR")
- stackPointer = stackPointer+2
- elseif loadedByteA < 32
- stackPointer=loadedByteB+((loadedByteA%16)*256)
- print("Jumping to ",stackPointer)
- elseif loadedByteA < 48
- print("CALL not implemented yet")
- stackPointer = stackPointer+2
- elseif loadedByteA < 64
- print("Skip next instruction if Vx = kk. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 80
- print("Skip next instruction if Vx != kk. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 96
- print("Skip next instruction if Vx = Vy. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 112
- print("Set Vx = kk. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 128
- print("Set Vx = Vx + kk. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 144
- print("Doing math op on Vx and Vy (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 160
- print("Skip next instruction if Vx != Vy. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 176
- regI=loadedByteB+((loadedByteA%16)*256)
- print("Setting I = nnn.",regI)
- stackPointer = stackPointer+2
- elseif loadedByteA < 192
- print("Jump to location nnn + V0. (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 208
- print("Set Vx = random byte AND kk (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 224
- print("Display Sprite (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 240
- print("Check Joypad (not implemented yet)")
- stackPointer = stackPointer+2
- elseif loadedByteA < 256
- print("MISC Ops (not implemented yet)",loadedByteA,loadedByteB,loadedByteA & 240)
- stackPointer = stackPointer+2
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment