FIF. Another FORTH.

Discussion about ZX80 / ZX81 Software
roganjosh
Posts: 88
Joined: Thu Jun 14, 2018 12:59 pm

Re: FIF. Another FORTH.

Post by roganjosh »

Chuckle.
A profitable day here too. I worked out a way to split up the assembler output so as to secrete bits of code into multiple nooks and crannies whilst still letting the assembler deal with resolving all the addresses (otherwise memory reorganisation would be a nightmare). Not bad for an assembler with no linker. It's applicable to many hardware configurations (so I'll be applying it to the UDG4ZXPAND version in due course (and will allow me to quickly maximise contiguous execution-friendly memory.

It's allowed me to start writing some words for the colour functionality of Chroma 81. Hurrah! They'll get tested tomorrow.

Alan
Moggy
Posts: 2446
Joined: Wed Jun 18, 2008 2:00 pm

Re: FIF. Another FORTH.

Post by Moggy »

Excellent news, Alan the day just gets better and better. :D

PS
A pendulum with a 2 meter long rod has a rough period of 2.837 seconds T = 2π√(L/g)

and a frequency of .353 Hz f = 1/[2π√(L/g)]

just had to tell someone!! :lol:



Regards.

Fred Sadman (Mrs)
User avatar
kmurta
Posts: 209
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: FIF. Another FORTH.

Post by kmurta »

roganjosh wrote: Sat May 22, 2021 11:18 pm It's allowed me to start writing some words for the colour functionality of Chroma 81. Hurrah! They'll get tested tomorrow.
Warning of undesirable behavior of EO related to the use of Chroma81 (I do not know if the same occurs with the real device): when attribute color mode is set the memory between 8Kb~16Kb is mirrored from 49152($C000), where the color attribute area is located.

In my case, as my forth kernel is based on 8K, writing the color attributes corrupts the kernel and the system crash :( . I didn't realize this before because I was working with the ZX Camel Forth located on the ROM page (0~8Kb).
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
roganjosh
Posts: 88
Joined: Thu Jun 14, 2018 12:59 pm

Re: FIF. Another FORTH.

Post by roganjosh »

Moggy wrote: Sun May 23, 2021 1:01 pm PS
A pendulum with a 2 meter long rod has a rough period of 2.837 seconds T = 2π√(L/g)

and a frequency of .353 Hz f = 1/[2π√(L/g)]
My life is undeniably and indescribably richer. I shall revel in the new found knowledge.

Kelly: Thanks for that. I indeed ran into problems with EO. I'll report the problem.

Alan
roganjosh
Posts: 88
Joined: Thu Jun 14, 2018 12:59 pm

Re: FIF. Another FORTH.

Post by roganjosh »

Ah, the EO problem was just stupidity on my part (some files should have been in the ZXpand directory and weren't). My chroma 81 code is working fine on EO now. If it's any help my configuration is:

$2000-$21ff UDG character definitions
$2200-$3fff Forth primitives and functions
$4009-$9fff D_FILE at $4100, Forth functions, words and lots of free RAM
$c000-$c3ff Colour character mapping (mode 0). Attribute file at $c100 (Colour mode 1).
$c400-$dfff Forth secondary (non-machine code) words, buffers, data and machine stack.

On EO I selected CHR$128 as the CHR$ generator, Chroma as the Colour, checked the ZXpand box and checked the "Allow RAM between 8-16K"
box.

My CMODE, COLENABLE, BORDER, CLRATT, PAPER & INK words all work fine using the above.

Alan
roganjosh
Posts: 88
Joined: Thu Jun 14, 2018 12:59 pm

Re: FIF. Another FORTH.

Post by roganjosh »

FIF version 1.00 is now available.

The ChangeLog is reproduced here:

1.00 26/05/21
Support Chroma81. Colour words BORDER, CLRATT,
CLRCOL, COLDEF, COLENABLE, CMODE, INK & PAPER added.
UDG creation word CHRDEF added.
SETPOS added to move print cursor to column/row.
MEMFREE leaves amount of free memory on the stack.
D/ moved to core vocabulary.
Fixed boundary checks in ASCII conversion and EMIT.
ZXpand memory configuration is now always M=L.
Optimised memory usage for ZXpand and Chroma81
versions.
Implemented file loading messages during boot.
UDG protocol changed to Chr$128 (was Chr$64).
UDG4ZXPAND owners may need to set the 128 switch.
D_FILE location fixed at $4100 for Chroma 81.
Added Chroma 81 and Character Set files to Docs
directory.
Updated the fif81 glossary in the Docs directory.
Updated installation instructions.

The big fanfare is for Chroma 81 support. Also, the memory reorganisation will leave you with approximately 16 KB for the ZXpand NON-UDG version, 15KB for the UDG4ZXPAND version and 22K for the Chroma 81+ZXpand version. The vast majority is execution-friendly RAM (there is some non-execution-friendly RAM between $8000-$9fff on the Chroma 81 version).


Given that I don't have a UDG4ZXPAND board there is a possible GOTCHA I'm unable to test. Previous releases of FIF were only giving Chrs$64 support; the latest version provides Chr$128 support. I remember reading that UDG4ZXPAND boards have a switch to select 128 mode so make sure that switch is set. If there are any problems I'll provide a separate version for Chrs$64.

I've edited the first post in this thread to more clearly show that the latest release is always available there.

Alan
Moggy
Posts: 2446
Joined: Wed Jun 18, 2008 2:00 pm

Re: FIF. Another FORTH.

Post by Moggy »

Most excellent, that's tonight taken care of. :lol:

As for the UDG4ZXPAND I don't think the setting would make a difference as I believe it only allows access to the inverse chrs which I don't think FIF uses and not likely to crash anything plus I don't expect much use would be made of it in Forth but will check anyway.
Moggy
Posts: 2446
Joined: Wed Jun 18, 2008 2:00 pm

Re: FIF. Another FORTH.

Post by Moggy »

All ok re the UDG board set at 128 and FIF but then I remembered that with the 64 version of FIF my UDG was set at 128 anyway with no problems, 128 being the default setting I use when converting games for UDG use as I never bother with just 64 CHRS so yes all good up to press. :D
Moggy
Posts: 2446
Joined: Wed Jun 18, 2008 2:00 pm

Re: FIF. Another FORTH.

Post by Moggy »

D2* is missing from the glossary too or am I not looking hard enough?.
roganjosh
Posts: 88
Joined: Thu Jun 14, 2018 12:59 pm

Re: FIF. Another FORTH.

Post by roganjosh »

Thanks Moggy, that's a big relief.

FIF indeed doesn't use the inverse characters for normal FORTH use however they can still be EMITed. The combination of EMIT and SETPOS might be useful for some simple games or somesuch. So I thought that having the ability to redefine the inverses was potentially useful. In FIF the inverses have the range 96-159 ($60-$9f) so you can (e.g.) redefine inverse-A to a chequerboard pattern and display it using:

Code: Select all

HEX AA 55 AA 55 AA 55 AA 55 61 CHRDEF
61 EMIT

You're probably right in thinking that not much use may be made of it. It was satisfying to do though and I'm quite shameless about such things.

Alan
Post Reply