ZX81 Toddy Forth-79

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
Vorticon
Posts: 69
Joined: Tue Mar 01, 2022 1:14 pm

Re: ZX81 Toddy Forth-79

Post by Vorticon »

How large of a program can Toddy Forth-79 handle?
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Depends on how big you want your dictionary to be.

A fresh install without any of the extensions added has 13846 bytes free. Personally I have the doubles extension plus a few added permanent definitions of my own and have about 9k to play with which for Forth is quite a useful amount, considering that if you cannot do what you want in a couple of K with Forth then something's wrong with whatever you are trying to program.

I have routines to calculate things such as time dilation,energy yields for a given mass using the E = mc2 equation,pendulum period/frequency and various other scientific routines and these seldom take more than a screen or a couple of K tops.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Vorticon wrote: Mon Jan 16, 2023 4:42 pm How large of a program can Toddy Forth-79 handle?
It's like Moggy said above, initially you have 13846 bytes available for the dictionary which is already a fair amount considering that Forth is much more compact than BASIC. But this value can be changed if you need more space at the expense of a decrease in the size of the area allocated to the RAM disk. See section 11.4 of the User Guide for more details on how to do it and also Appendix B for the memory diagrams.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
Vorticon
Posts: 69
Joined: Tue Mar 01, 2022 1:14 pm

Re: ZX81 Toddy Forth-79

Post by Vorticon »

Awesome thank you. I wrote a port of Jet Pac (Spectrum) for the TI 99/4A in TurboForth a few years ago ( https://youtu.be/HZZ2pu5BrF4 ) and I was really impressed by the capabilities of Forth, so I'm hoping to develop something for the Zeddy in Forth as well.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79 - New fix release

Post by kmurta »

Hello guys!

After a long time away and motivated by this video on YouTube, I turned my attention to the TF79 and ended up discovering issues in the behavior of the words INKEY and WAIT, which motivated a new release.

I also took the opportunity to correct what I now recognize was a bad decision: the existence of two versions (UDG and NOUDG). The new TF79 release unifies these two versions, facilitating the operation and maintenance of the system.

The use of UDG characters is now switched by the word CHR$128, modified to incorporate the new functionality, as can be seen in the video below.

Click to open video
Click to open video

As usual, the download is available in the first post.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Thanks Kelly for this, I did have some problems at first but they were all down to me and now all is good. :D
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

I saved the kernel and a changed chr$ set using 8192 8192 BSAVE >TF79.BIN but upon reloading the chr$ set still defaults to the system font not my changed font and I have to change it manually every time.

Saving using 8192 8192 BSAVE >TF79.BIN works ok in v113 and always boots up with the changed font but this version does not.

Also using 0 chr$128 does not switch of the UDG's, it is stuck in 1 chr$128 mode all the time.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Moggy wrote: Sun Mar 03, 2024 10:12 pm I saved the kernel and a changed chr$ set using 8192 8192 BSAVE >TF79.BIN but upon reloading the chr$ set still defaults to the system font not my changed font and I have to change it manually every time.
COLD start with ROM characters (1E00h), to initialize with UDG characters make the following change:

61 15215 C!
8192 8192 BSAVE >TF79.BIN

Now the system will boot using UDG characters in CHR$128 mode (128 unique characters).
Also using 0 chr$128 does not switch of the UDG's, it is stuck in 1 chr$128 mode all the time.
The word CHR$128 switches between 64 and 128 character modes, but always takes into account the content of address 16420. So when using it, make sure that this address contains the desired value (30 for ROM characters, or 60 for characters stored in 15360).
Result of 0 CHR$128 with 16420 containing 60
Result of 0 CHR$128 with 16420 containing 60
CHR64.png (5.18 KiB) Viewed 247 times

Result of 0 CHR$128 with 16420 containing 60
Result of 0 CHR$128 with 16420 containing 60
CHR128.png (4.96 KiB) Viewed 247 times

The INKEY fix affected the Editor requiring it to be changed, so use the new ones (EDITOR.F79, EDASM.F79 and EDHGR.F79) provided with the new version.
Last edited by kmurta on Sun Mar 03, 2024 11:40 pm, edited 1 time in total.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Thanks Kelly all's good many thanks for quick reply.

PS what was the problem with INKEY and the editor? I never had a problem with the editor I have say worked ok for me.

Try this little compilation...

1 GET FRAME

1 LOAD

FRAME1

BEST IN INVERSE MODE. :D


Just realised I created two words not in the vocab' for this they are....

: CLS PAGE ;

and

: BRK ?TERMINAL IF LEAVE THEN ;

Either create them or edit them out of the compilation.
Attachments
FRAME.P
(6 KiB) Downloaded 12 times
360_F_217188426_smgwnDFnQC5DHQ8mKGkdsMO7oDDP5nZn.jpg
360_F_217188426_smgwnDFnQC5DHQ8mKGkdsMO7oDDP5nZn.jpg (22.95 KiB) Viewed 245 times
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Moggy wrote: Sun Mar 03, 2024 11:20 pm PS what was the problem with INKEY and the editor? I never had a problem with the editor I have say worked ok for me.
In fact, it was the correction of the INKEY problem that affected the EDITOR, so it was necessary to change it by replacing INKEY with a direct call to the keyboard reading routine.

Basically the problem was that when holding down a key during a loop with INKEY, the values of 0 and the key code were returned alternately, when only the code of the pressed key was expected.
Try this little compilation...
Very cool and nice effect!

Tips:
- You don't need the first 5 lines, TF79 includes the words RAND and RND to generate random numbers. Check section 1.9 of the manual.
- The word BRK is also unnecessary since any program running in SLOW can be interrupted with SHIFT-SPACE. Try this:

: INFINITELOOP 0 BEGIN DUP . 1+ AGAIN ;
INFINITELOOP

and when you want, press SHIFT+SPACE to stop execution.


I find it strange that you use the .p extension for the block file, I personally prefer to use .BLK to differentiate it from a common program. But I imagine it is a matter of your preference, since ZXpand automatically adds the .p when the extension is not informed, so, it´s ok.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Post Reply