Jump to content
  • 0
pzembrod

x16emu -keybuf flag, like in VICE

Question

I would like to propose a -keybuf flag, similar to the one in VICE, that injects further text into the keyboard buffer after loading and running a program with -prg/-bas and -run.

Background/reason: I'm currently working on an X16 port of the C64/C16 flavour of VolksForth (https://github.com/forth-ev/VolksForth). I am using VICE and now x16emu in automated build and test scripts, where I need this flag to initiate a build or test procedure after loading and starting a FolksForth binary. See https://github.com/pzembrod/VolksForth/blob/x16-390/6502/C64/emulator/run-in-x16emu.sh#L41 and https://github.com/pzembrod/VolksForth/blob/x16-390/6502/C64/Makefile#L134 for how this is used.

I have an implementation proposal of this flag in https://github.com/pzembrod/x16-emulator/blob/master/main.c and would be happy to send a pull request.

Cheers

Philip

  • Like 1

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I might be wrong, but isn't that exactly what the -bas flag does?

A quick test shows that a .bas file with the contents:

10 INPUT "WHAT IS YOUR NAME";N$
20 PRINT "HELLO, ";N$;"!"
RUN
JOHN DOE

does in fact result in:

grafik.png.b9f9ced2f944c3089e4994b9415b837b.png

 

I'm not sure how well this works together with -prg and -run, but you could probably just start your text file with

LOAD "MYPROG.PRG"
RUN

as a workaround.

Hope this helps!

Share this post


Link to post
Share on other sites
  • 0

Ah, I see how the same might be achievable with the -bas flag.

The difference is that -bas takes its input from a file whereas -keybuf takes its input from the command line.

And my sample implementation works such that the additional keystrokes work with a BASIC program "typed" via -bas as well as with any program loaded via -prg. The added keystrokes are just appended after the RUN into the keyboard buffer, in the two appropriate places in the code.

I'll try out how the integration into make files would look if I used the LOAD+RUN+<myinput> workaround in a file via the -bas flag that you suggest. I would consider it more of a workaround, though. One difference in the first place between -prg and LOAD would be (I guess) that -prg takes its input from the host file system whereas with LOAD the tested program would need to be in the mounted sdcard image - which is doable, of course.

 

Share this post


Link to post
Share on other sites
  • 0

Took me a while, but I finally got around to try your script file suggestion, and it works, and more nicely than I had anticipated.

Especially it is actually easier to convert keystrokes from ASCII to PETSCII if they live in a file than if they live in shell variables, so I suggest closing this feature request.

Edited by pzembrod

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use