Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new commands to ZX BASIC
#7
boriel Wrote:
cheveron Wrote:Ok, well I'll code the commands up as libraries, but I'd still like to know how to add commands.
If by 'commands' you mean something like:
<identifier> <expression>, <expression> ...
E.g.
SCROLL 20, a, 30, c
No, it can't be done.
A library is just a .bas file with subroutines and functions (see for example point.bas or attr.bas). It's just that, nothing else.
Otherwise, yes, we have to touch the parser and at the moment this is not that easy.

I was assuming it would need to be done in Python. I had a look over the code and it seems that you are pre-tokenizing the .BAS files. Assuming you don't want to use tokens for commands currently implemented as libraries that still gives you codes 0 to 5 to use for new commands.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)