Enterprise Forever
:UK => Programming => Topic started by: Sdw on 2016.September.08. 23:07:59
-
Anyone have code snippets on how to read the joystick?
Also, generally, what is used as the "fire" button normally? Space bar? Shift? Whatever it is, some code to read that as well would be appreciated! :)
-
Read this document:
Converting Spectrum programs to run on the Enterprise (http://enterprise.iko.hu/technical/Converting_Spectrum_programs.pdf)
It will give you useful tips, not only related to converting Spectrum programs.
-
Are you think about the Internal or External joystick?
Internal:
LD A,7
OUT (0B5H),A
IN A,(0B5H)
Bit5: Left, b3: Up, b2: Right, b1: Down
LD A,8
OUT (0B5H),A
IN A,(0B5H)
Bit6: Space (Fire)
External: see one possible solution in the linke PDF at Page 3.
-
Thank you, yes, I was primarily thinking about the internal joystick.
But looking at the document, it would be quite easy to add external joystick support as well, so I guess I might as well read those values as well, and then the user can grab whatever he feels like to control! :)