ZX81 Toddy Forth-79

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
swetland
Posts: 20
Joined: Mon Jul 25, 2022 12:13 am
Location: Palo Alto, CA
Contact:

Re: ZX81 Toddy Forth-79

Post by swetland »

Wow! I stumbled on ToddyForth 1.0 earlier today and was impressed... and then discovered there's been a lot further work done since then!

Are there any plans to resource source code for ToddyForth-79?

If not, would you consider adding a mechanism to add custom io implementations for load/save/list/print/etc?

I'd like to adapt it to use the IO expansion card I'm building (viewtopic.php?t=4780) for storage -- the zx81+38 I'm using has 32KB SRAM (0x2000 through 0xA000 then repeating) so should be memory footprint compatible, but I wasn't planning on trying to emulate a ZXpand (not sure if the interface is even documented, if it depends on their BASIC extensions, etc, etc).
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Nice to see another Forth advocate. :D

Toddy Forth-79 is indeed a superb implementation of the language and faster than most of the flavours from back then used on faster processors. Kmurta is still working on this project and no doubt when he sees your post he will reply suitably.

You may be interested to know that another Forth-79 version has been introduced by forum member Roganjosh.
His version is called FIF81 and can be found here...

viewtopic.php?f=11&t=4131&hilit=fif81
User avatar
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Hello swetland, welcome aboard!
swetland wrote: Sun Aug 21, 2022 5:11 am Are there any plans to resource source code for ToddyForth-79?
Yes, I plan to release the source code soon. I'm currently working on a new (and hopefully definitive) version of TF79, several modifications and improvements. As soon as I finish writing the documentation I intend to release it here.
swetland wrote: Sun Aug 21, 2022 5:11 am If not, would you consider adding a mechanism to add custom io implementations for load/save/list/print/etc?
But this is already available, see the words P@ and P!:

Code: Select all

P!  ( b addr -- )
     Writes b to the output port at address addr.

P@  ( addr -- b )
     Reads b from the input port address addr.
And if you prefer, you can also implement your routines directly in assembler, see as an example the PRINTER.BLK extension available in the SCREENS folder.

See examples of the use of the words P@ and P!:

HEX
EFFE P@ ( Reads the keyboard, keys 6,7,8,9,0 )

0 FD P! ( disable nmi genarator )
0 FE P! ( enable nmi genarator )

Try: 0 FD P! VLIST 0 FE P!

Note: the last one is just to illustrate the use of P@ and P!, TF79 already has SLOW and FAST words implemented.
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
swetland
Posts: 20
Joined: Mon Jul 25, 2022 12:13 am
Location: Palo Alto, CA
Contact:

Re: ZX81 Toddy Forth-79

Post by swetland »

kmurta wrote: Sun Aug 21, 2022 3:51 pm Yes, I plan to release the source code soon. I'm currently working on a new (and hopefully definitive) version of TF79, several modifications and improvements. As soon as I finish writing the documentation I intend to release it here.
Excellent. I look forward to it. It kind of blew my mind how responsive the ZX81+38 when running your FORTH (just not constantly dropping characters while typing like BASIC does was pretty amazing).
User avatar
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

ZX81 Toddy Forth-79 Version 1.13 - New Release

Post by kmurta »

Hello Forth fans!

It is with great pleasure that I announce the new release of Toddy Forth-79, available for download in the first post of this topic!

It is my intention for this to be the last update for TF79, I have achieved all the goals I had in mind for a complete Forth system for our dear Zeddy and I am quite pleased with the result. Going forward, new releases just to fix some undetected bug.

TFBN.png

TF79 went through a lot of changes, some words were deleted, others renamed, the built-in support for Chroma-81 was removed and moved to an external extension.

Built-in support for low resolution plots, pseudo-random numbers, values and execution vectors has been added. And a new keyboard routine, fast and suitable for use with external mechanical keyboards that suffered from key bounce problems in previous versions.

Added Extensions to support high resolution graphics and a rudimentary multi-tasking.

And a complete user guide that will help you learn about the new features and get the most out of the TF79.

It was a learning experience and fun for me to develop TF79, so I hope that somehow you can find some use in it.


Cheers,

Kelly
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
mrtinb
Posts: 1910
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: ZX81 Toddy Forth-79

Post by mrtinb »

Great work, and a great manual. Thank you.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Thanks Kelly for this superb implementation of Forth-79 it was a an honour to test it for you and give some small help with the manual.

The RND function is very nice as is the inverse feature, the ability to alter the de-bounce rate for external keyboards is most welcome and fast typing with a Memotech keyboard is now a reality without excessive character repeats and can be tailored to even worn out keyboards I have found. Those keyboards that use the membrane sockets suffer far less de-bounce difficulties, I have also discovered, so may not need any adjustment.

This Forth stand alongside the very best in my opinion and is more fully featured than the Forth-79 of old whilst retaining the original ideals of Forth79.
I congratulate you on a wonderful piece of work and look forward to many happy hours using it.

Thanks once again.
User avatar
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Thanks Martin and Moggy for the kind words.

A video demonstrating some features: https://youtu.be/6MJHeJtC_WE


Edited: The ROTSOM that appears in the video is not included in the TF79 package, so I make it available below.

Code: Select all

\ ROTSOM
: SON 15 8 SOUND 254 7 SOUND ;
: SOFF 0 8 SOUND 255 7 SOUND ;
: ROTSOM 256 /MOD 1 SOUND
  0 SOUND ;

: BEEP ( freq dur -- )
  0 DO DUP ROTSOM LOOP DROP ;

: RAIO<  ( freq< freq> -- )
  SWAP DO I 1 BEEP LOOP ;

: RAIO>  ( freq> freq< -- )
  2DUP + ROT ROT DO DUP I -
  1 BEEP LOOP DROP ;

: SIRENE  ( freq> freq< rep -- )
  0 DO 2DUP RAIO> 2DUP SWAP
  RAIO< LOOP 2DROP ;

: ZORRA SON 200 50 2 SIRENE 0 
255 10 220 55 190 RAIO< RAIO< 
RAIO< 190 55 220 1 255 0 RAIO>
RAIO> RAIO> 230 25 3 SIRENE 180 
70 70 180 180 70 70 180 RAIO< 
RAIO> RAIO< RAIO> 200 0 170 0 
140 0 110 0 RAIO> RAIO> RAIO> 
RAIO> 80 0 50 0 20 0 RAIO> RAIO>
 RAIO> 0 220 0 190 0 160 0 130 
RAIO< RAIO< RAIO< RAIO< 0 100 0 
70 0 40 0 10 RAIO< RAIO< RAIO< 
RAIO< 650 0 3 SIRENE SOFF ;
Attachments
ROTSOM.zip
(474 Bytes) Downloaded 86 times
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
kmurta
Posts: 305
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

I recently made some updates to the EDITOR and HGR extensions to fix bugs and add new features, they are:

EDITOR:
- correction of a bug that occurred in FILE mode and caused the system to crash when deleting or adding lines.
- added the V command to clear the current screen.

HGR:
- correction of a bug that made the STOPOFF command ineffective.
- added blinking cursor.

Consequently, the relevant parts of the manual have been updated. Download the following package and copy the files to your SD card overwriting the previous ones:

EDITOR_HGR_Updates.zip
(1.46 MiB) Downloaded 98 times

I also take the opportunity to make available a small utility written in Perl and which I have been using to convert block files (.BLK) into text (.FTH), and vice-versa. Quite useful for those who want to edit their programs on the PC:

blk2fth.zip
(2.7 KiB) Downloaded 80 times
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: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Many thanks, Kelly much appreciated. :D
Post Reply