lunar lander crashing my Vectrex

Started by rfgasser, March 31, 2024, 01:34:19 PM

Previous topic - Next topic

rfgasser

I finally had a chance to debug the lunar lander program (lander.bas) that was crashing my Vectrex.

Here is what I found:
While my Vectrex was in the crashed state (after pressing BTN 1 in the lunar instructions)

  • the screen went blank (after briefly flashing the lunar scene)
  • my console to the Vectrex32 (using screen terminal command) was unresponsive to Ctrl+C
  • I could still see the Vectrex32 as a USB memory and move files to it.

I used breakpoints in the lunar.bas file and found the offending line:

  line 239: controls = WaitForFrame(JoystickAnalog, Controller1, JoystickX + JoystickY)

I looked at the ScaleTest.bas program which never crashed and noticed it used JoystickDigital instead of JoystickAnalog.

I changed the code in lunar.bas to
    controls = WaitForFrame(JoystickDigital, Controller1, JoystickX + JoystickY)
and eureka it worked!

I am not sure why the controller constant JoystickAnalog crashes my machine. I bought my machine from a Canadian seller and it is Model 3000-C1.  Perhaps the rom is slightly different in the Canadian versions? i.e. the memory location for the analog stick on the controller?

Hope this helps others who have had issues with lunar.bas.
Raymond Gasser

Vectrex32

This is a very helpful insight. I still don't understand why this is failing on some people's systems, but it's a huge clue. Thank you.

- Bob