EgonOlsen71/basicv2

INPUT#/PRINT# problems when using for keyboard/screen

Closed this issue · 1 comments

Background:
BASIC 4.0 for PET has a bug, that a program is stopped after a INPUT command without input.
There exists several workarounds (see https://www.youtube.com/watch?v=M1leqcEyYT8). They are not necessary for C64, but they still works and are a good test for basic compatibility.

One possibility is to use INPUT# instead of INPUT (see 4:34 in video).
I modified the program, so that also PRINT# is tested:

10 open 2,0: open 3,3
20 print#3,"? ";: input#2,a$
30 print: print a$
40 print "ende"
50 close 2: close 3

With compiler it works, but BasicShell and console output (run_gui.cmd) have problems with line 20:

  • there is no output to screen with PRINT#
  • INPUT# generates an error "FILE NOT OPEN FOR READING" instead reading the input from keyboard

"#" isn't fully implemented for the interpreter, because that would basically require emulation of all the possible devices which is out of the scope of this project.
By default, every OPEN is being redirected to a virtual storage device in memory which can handle simple read/write calls to/from storage but has no concept of channels like the screen or the keyboard.
This isn't going to change anytime soon, I'm afraid, because, as said, it's out of the scope of this project.