[vcf-midatlantic] Known-good IBM joystick?

Douglas Crawford touchetek at gmail.com
Tue Jul 10 14:51:47 EDT 2018


Well that is mighty simple.
So if you speak the truth, your PC subroutine becomes:

3000  REM NAVIGATION
3010 FB=STICK(1):LR=STICK(0):M=0: REM SET VARIABLES
3020  IF FB < 75 THEN M = 5
3030  IF FB > 180 THEN M = 10
3040  IF LR < 75 THEN M = 9
3050  IF LR > 180 THEN M = 6
3060 OUT P,M: REM SEND COMMANDS
3070  REM IF M = 10 THEN  CALL  - 198: FOR W = 1 TO 500: NEXT W: REM 
BACKUP ALERT
3080  RETURN

Is P set somewhere?  It should be the port number of the interface...
and is it definitely not being clobbered somewhere?
That would be a difference you would not notice on the
Apple side since it uses L instead of P.

And this is obviously a subroutine, so there could be other areas of the 
code that
are not portable between the PC and Apple.
For instance, all the pokes shown on the web page won't work:
These poke into Apple memory space where the card is mapped; not the 
same  on the PC.

1000 REM Activate the Lego interface card
1010 S = 7:L = 49280 + S * 16
1020 POKE L + 3,1: POKE L + 2,63: POKE L + 1,0
1030 POKE L,0: REM CLEAR ALL PORTS
1040 RETURN

You may know this, I'm only saying because you indicated in some words
that the code "was the same".  Maybe you meant the "algorithm" is the 
same, and maybe
the variable names are the same... I can't be sure, but this code won't work
as is on the PC.



On 7/10/2018 1:34 PM, Evan Koblentz via vcf-midatlantic wrote:
> I know anyone can make mistakes, but .... I am VERY confident in my 
> code this time around.  :)
>
> Alas, I don't have the actual IBM code here at home.
>
> The joystick routine in my (perfectly working) Applesoft code is:
>
> --------------------------
>
> 3000  REM NAVIGATION
> 3010 FB =  PDL (1):LR =  PDL (0):M = 0: REM  SET VARIABLES
> 3020  IF FB < 75 THEN M = 5
> 3030  IF FB > 180 THEN M = 10
> 3040  IF LR < 75 THEN M = 9
> 3050  IF LR > 180 THEN M = 6
> 3060  POKE L,M: REM  SEND COMMANDS
> 3070  IF M = 10 THEN  CALL  - 198: FOR W = 1 TO 500: NEXT W: REM 
> BACKUP ALERT
> 3080  RETURN
>
> --------------------------
>
> I made two changes for the IBM side:
>
> 3010 FB=STICK(1):LR=STICK(0):M=0: REM SET VARIABLES
>
> 3060 OUT P,M: REM SEND COMMANDS
>
> Both lines are correct. No room for gray area there.
>
> I omitted line 3070 for now. It makes the backup beep when the robot 
> goes in reverse. :)  I'll add an IBM version back in after I get the 
> navigation working again.
>
> I don't have time now to explain to everyone how the Lego system 
> works, but anyone who's interested is welcome to examine the relevant 
> pages of my under-construction web site about this subject. :)
>
> http://www.snarc.net/mbts/applebasic.htm
> http://www.snarc.net/mbts/direct.htm
>
>



More information about the vcf-midatlantic mailing list