jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

Adds GETIN to io.fs #429

Closed Whammo closed 2 years ago

Whammo commented 2 years ago

GETIN is required for RS232 receive and is useful for input from the keyboard buffer.

jkotlinski commented 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 @ ;

jkotlinski commented 2 years ago

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.

Whammo commented 2 years ago

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.

Whammo commented 2 years ago

Although: CHRIN with RS-232 loops until a nonnull character is found. scratches head

Whammo commented 2 years ago

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

jkotlinski commented 2 years ago

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!

Whammo commented 2 years ago

Not to worry- It was no work at all, simply duplicating and changing the address from CHRIN.