Closed Whammo closed 2 years ago
Hey, I merged this a bit quick - now I'm having second thoughts...
First, let me start by agreeing that GETIN is useful...
What I realize now, after thinking some more, that one could add many other words that are also potential useful... like, all the other Kernal I/O functions.
I find it difficult to draw the line, what should be included and not. For consistency, maybe it is best only to include the I/O functions that are strictly needed to build durexForth?
The rest can easily by added by user. for example. : getin $ffe4 sys ar @ ;
It could also be that I'm overthinking things, and it is fine just to add it. In that case, I think it should also be added to the manual.
IO: is optional. Many of the words are similar, and could be factored together. I used GETIN through SYS, and in no way did it effect performance. As a matter of fact: at 2400 baud, the forth version sits around waiting for a char just like the ASM. I wouldn't expect any meaningful performance hits by making ALL IO calls through SYS. I don't need to tell you that GETIN just releases the user and the system from the BASIC idle loop for input. Then, you can do other things while it's waiting for input. I'm just hoping that if it's there, then it will be used. That means someone is using Durexforth, and they're likely having a good time doing it.
Although: CHRIN with RS-232 loops until a nonnull character is found. scratches head
No, it will sit there with a full input buffer if it doesn't get a CR before that happens. It's the perfect thing for compile from rsr232, with a slight modification to .getLineFromConsole
Hey! I'm really sorry, but after much consideration I decided to revert this merge. The reason is that cartridge ROM space is really precious, and nothing else in Durexforth depends on this new functionality. So I want to reserve the free space, in case something essential pops up in the future. I think it would be great to have functions like this in an optional module, though. Apologies again, I really want to say, I'm grateful for the contribution!
Not to worry- It was no work at all, simply duplicating and changing the address from CHRIN.
GETIN is required for RS232 receive and is useful for input from the keyboard buffer.