EgonOlsen71 / basicv2

A Commodore (CBM) BASIC V2 interpreter/compiler written in Java
https://egonolsen71.github.io/basicv2/
The Unlicense
84 stars 15 forks source link

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

Closed viteisele closed 1 year ago

viteisele commented 1 year ago

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:

EgonOlsen71 commented 1 year ago

"#" 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.