Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading Kempston Joystick using function IN 31
#1
Hi,

I´m missing the IN function in ZX BASIC (as it was in Original Sinclair ZX Spectrum BASIC).

Would like to use it as described here:
<!-- m --><a class="postlink" href="https://chuntey.wordpress.com/2010/01/06/using-kempston-joystick-in-your-own-basic-programs/">https://chuntey.wordpress.com/2010/01/0 ... -programs/</a><!-- m -->

Must I use some machine code emulate?
If so, can someone please post me an example?

Regards,

Luzie
Reply
#2
ZX Basic supports the IN and OUT instructions. If you cannot compile them then there is a syntax error.

Reading the listings in the page, remember that ZX BASIC, at this moment, requires every IF to be closed with END IF.
E.g.
Code:
10 LET x=10: LET y=10
20 LET kj=IN 31: REM get the state of joystick
30 PRINT AT y,x;"*"
40 IF (kj>31) OR (kj=0) THEN GO TO 20: END IF: REM ignore spurious inputs
Reply
#3
Hi,

thanks for your reply. I did some things wrong with the FUSE Emulator I used for testing:

On FUSE Kempston has to be enabled in at least two menus (Options / Peripherals / General and Options / Joystick).

Also I thought IN is not supported as I can´t find it on the Wiki. My fault. If I had a look at the MCode I should see that IN is correctly supported by ZX Basic.

Regards,

Luzie
Reply
#4
Luzie Wrote:Hi,

thanks for your reply. I did some things wrong with the FUSE Emulator I used for testing:

On FUSE Kempston has to be enabled in at least two menus (Options / Peripherals / General and Options / Joystick).

Also I thought IN is not supported as I can´t find it on the Wiki. My fault. If I had a look at the MCode I should see that IN is correctly supported by ZX Basic.

Regards,

Luzie
No worries! Thanks for using ZX Basic. Hope you find it helpful
Reply
#5
Luzie Wrote:Hi,

Also I thought IN is not supported as I can´t find it on the Wiki. My fault. If I had a look at the MCode I should see that IN is correctly supported by ZX Basic.

It seems to be at least in the keyword list:

<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Identifier#Reserved_Identifiers">http://www.boriel.com/wiki/en/index.php ... dentifiers</a><!-- m -->
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)