FORTH for every Atari

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

Yeah, many thanks :) I appreciate your work.

And I have a two little questions. A first one: when I'm in an editor and use F6 command to jump to the selected line, the cursor everytime jump to the second character in that line, not at the first. Is it intentional?

And the second: when I use command SAVEB and select an existing file, it shows me dialog if I really want to overwrite old file. But I can't select option "Overwrite" because there isn't a mouse cursor and I can't find any key to select it (in Hatari).
You do not have the required permissions to view the files attached to this post.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Sat Feb 19, 2022 9:52 pm Yeah, many thanks :) I appreciate your work.

And I have a two little questions. A first one: when I'm in an editor and use F6 command to jump to the selected line, the cursor everytime jump to the second character in that line, not at the first. Is it intentional?

And the second: when I use command SAVEB and select an existing file, it shows me dialog if I really want to overwrite old file. But I can't select option "Overwrite" because there isn't a mouse cursor and I can't find any key to select it (in Hatari).
It's a kind of trap !!!
I will change that, for now you have two solutions:

In the FORTH.INF file
you can disable those alerts by default.
or you can force the mouse to be always present.

If you don't have it, you can create one with a text editor. Don't add any tab or useless space:

#M
%17+0
%75+0
F:\FORTH\SOURCES\*.FOR
F:\FORTH\TEXTES\*.TXT

The very first line tells FORTH to always let the mouse on.
The second and third lines sets the amount of memory for the editor and dictionary (I put the default values).
The fourth line is the path to you source folder
The last one the path to you source folder when exported as TXT.

If you don't want to force the mouse but prefer to skip those alerts, you can change #M by #A0.
You can also mix the two:
#MA0 always the mouse and no alert

Hope this helps !

I will also see what happens with the cursor and F6.

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

Fascinating :o Your forth system is so smart and flexible, it's a really professional grade software. Many thanks :)
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Sun Feb 20, 2022 10:39 am Fascinating :o Your forth system is so smart and flexible, it's a really professional grade software. Many thanks :)
Many thanks!
A pleasure to read your messages!

I found the bug for the F6 "goto line" option. You can download the new version.
BTW: to verify that it's the last you can type

Code: Select all

ver
and you'll see:

Code: Select all

STE 0.2.2 + date
The last one is dated today.

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

Everything works perfectly now, thanks :)
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

Something wrong is happening with files in the last version for me. I don't know, if I can replicate this bug by words. Sometimes forth can't compile the whole file (I use command "compilb"), it just include only first line of a file. (When I use command 'vlist' I can see only the first word was added to forth dictionary.) And after exit to system it delete the other lines in the file, so the only first line remains. Maybe it's just my mistake, but when I did my little experiments yesterday, it didn't happened to me.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Sun Feb 20, 2022 12:59 pm Something wrong is happening with files in the last version for me. I don't know, if I can replicate this bug by words. Sometimes forth can't compile the whole file (I use command "compilb"), it just include only first line of a file. (When I use command 'vlist' I can see only the first word was added to forth dictionary.) And after exit to system it delete the other lines in the file, so the only first line remains. Maybe it's just my mistake, but when I did my little experiments yesterday, it didn't happened to me.
Damned !!

Can't reproduce any bug on the TT.
I'm copying the files to the MegaSTE, maybe it's a problem with a 68000 limitation (WORD or LONG access to an odd address...).

I've made the tests on the MegaSTE with FORTHSTE.PRG and still no problem...

Can you check this:
(maybe there is a problem with your source file *.FOR)
can you write some other program from scratch (just some lines with variable x, variable y etc... and test if they compile right?


Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

I'll do some experiments and we will see. Don't bother with that, maybe I did something wrong or it happened because I'm using git version of Hatari.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

I tried to run your tutorial example and get some error. So I did a little research and get this:
You do not have the required permissions to view the files attached to this post.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Mon Feb 21, 2022 10:38 am I tried to run your tutorial example and get some error. So I did a little research and get this:
More than strange...
To get this interruption, you must press control+alt+both shifts !
And before the little line "random 20 mod ." has finished its execution.

If this occurs... The execution pointer is left on the stack, try to execute then:
w@ .
This will tell you where in the "random 20 mod ." the program was...

Guillaume.

ps: if you want to repeat the same sentence for execution, at the prompt, type Shift+Insert.

Can you show me the source code you've typed ?
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

I just write and execute that piece of code. After some amount of repeat this will happen. Or when I tried this simple word:

Code: Select all

: rnd_20 10 0 do random 20 mod . ."  " loop ;
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Mon Feb 21, 2022 11:36 am I just write and execute that piece of code. After some amount of repeat this will happen. Or when I tried this simple word:

Code: Select all

: rnd_20 10 0 do random 20 mod . ."  " loop ;
More than strange...
Can you tell me what TOS version are you using?

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

O.K. I was experimenting a little bit. Normally I use a git version of Hatari 2.4, because stock Hatari 2.3.1 behave about a year strangely on my computer (Manjaro Linux OS). It gets stuck in configuration menus, e.g. if I try to change rom file or load other config file. But I tried this little piece of code in both version configured as a normal Atari STE with 4 MB of RAM. The result is the same, I get this error.

But! When I tried it in Hatari configured as Falcon with EasyMint, it evidently works.

And yes, I downloaded version for M68000.

I forgot to say, I tried both Hatari 2.3.1 and 2.4 with latest EmuTOS and with TOS 1.62.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Mon Feb 21, 2022 5:50 pm O.K. I was experimenting a little bit. Normally I use a git version of Hatari 2.4, because stock Hatari 2.3.1 behave about a year strangely on my computer (Manjaro Linux OS). It gets stuck in configuration menus, e.g. if I try to change rom file or load other config file. But I tried this little piece of code in both version configured as a normal Atari STE with 4 MB of RAM. The result is the same, I get this error.

But! When I tried it in Hatari configured as Falcon with EasyMint, it evidently works.

And yes, I downloaded version for M68000.

I forgot to say, I tried both Hatari 2.3.1 and 2.4 with latest EmuTOS and with TOS 1.62.
I have modified a bit the way FORTH intercepts the special keys and uploaded the files, can you please try them?

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

Yeah, my little word works, your tutorial code for Sierpinski triangle too. Many thanks :)
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Mon Feb 21, 2022 6:46 pm Yeah, my little word works, your tutorial code for Sierpinski triangle too. Many thanks :)
yeah! Thanks to your reports, I have fixed some important bugs.

You can try this:

Code: Select all

timer 10000 main timer swap - 2/ .
This will tell you the time for this routine in 1/100 sec.

Then you can modify the source code, replace the ":" that starts a definition with "::":

Code: Select all

:: init
	...
	;
	
	and
	
	:: main
	...
	;
	
This creates an assembly routine in RAM instead of just an interpreted serie of codes. It's supposed to be faster!

Test again the timing ...

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

This creates an assembly routine in RAM instead of just an interpreted serie of codes. It's supposed to be faster!
Fascinating feature :o

I found a way to replicate that bug, which I meant before. When I use in editor function Shift+F5 (delete block), press ESC and save file (saveb), it save just one or two of the first lines of the file and the rest of lines are ignored.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Tue Feb 22, 2022 12:41 am
This creates an assembly routine in RAM instead of just an interpreted serie of codes. It's supposed to be faster!
Fascinating feature :o

I found a way to replicate that bug, which I meant before. When I use in editor function Shift+F5 (delete block), press ESC and save file (saveb), it save just one or two of the first lines of the file and the rest of lines are ignored.
I can't reproduce the error.
Can you send me the *.FOR and tell me the block that you select ?

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

It could be any file. E.g. your tutorial example. I selected two last lines as block, delete it and save as a new file. You can easily see, how that file is shortened.
You do not have the required permissions to view the files attached to this post.
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

AnachronyX wrote: Tue Feb 22, 2022 5:19 pm It could be any file. E.g. your tutorial example. I selected two last lines as block, delete it and save as a new file. You can easily see, how that file is shortened.
[EDIT]

I found it!!!
I was looking for a bug in the DelBlock part, but the problem appears after, during saveb.
I think I fixed it,

You'll find version 0.2.4 on my page! (try the HELP key from the prompt or in the Editor)

Guillaume.
AnachronyX
Atari freak
Atari freak
Posts: 74
Joined: Sun Mar 08, 2009 12:33 pm

Re: FORTH for every Atari

Post by AnachronyX »

It looks like it works :) Thanks for all of your work :)
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari (Parx modules)

Post by Moulinaie »

Hi,

I will soon release version 0.3.0 of the FORTH Interpreter/Compiler.
The main change is the ability to use the M&E modules created by PARX in the 90's:
  • RIM modules to Read IMages (GIF, TGA, PNG, TIFF, JPEG...)
  • WIM modules to Write IMages (idem)
  • IFX modules to perform graphic effects
  • One TRM module (TRM for tramage in french, that means dithering, but does lot more (zoom, format conversion...)
It's been a long work to understand it all and provide the best instruction set:
  • dorim, dowim, doifx, dotrm that will suit most needs, this is the automatic mode
  • modinfo, modpal, modexe to perform the calls step by step and keep a total control of the process, this is the manual mode

Here is an example. The program loads both the TRM and the GIF RIM, it loads and decodes a GIF image and displays it, it should work in every resolution and adapt the output.
20220406_164218.jpg
The variables :

Code: Select all

variable p      		\ every module is pointed at by a variable, this one for the GIF
variable t       		\ the TRM
variable fichier 		\ the file address in memory
variable total   		\ the file size
256 string filename		\ the filename
1536 allot constant PALs	\ room for the source palette
1536 allot constant PALd	\ room for the dest palette (after conversion)
variable fhd			\ the file handle
First, we load the modules :

Code: Select all

: main
   " d:\parx.sys\" 1 modset			\ set the folder path for the modules

   0 t !
   " parx252.trm" graphic_card t modload drop	\ load the TRM

   0 p !
   " rim\gif00.rim" -1 p modload drop		\ load the GIF RIM
Then we open the file and test if the handle is positive (else error!):

Code: Select all

   " F:\FORTH\GIPHY.GIF" filename $!			\ set the name

   filename 0 fopensize dup fhd !			\ try to open the file
   0> if						\ if OK
      total !						\ store the file size
      fhd @ total @ dup allot dup fichier ! fread drop	\ read the whole file in memory
Then we run the RIM to decode the file and get a bitmap bloc

Code: Select all

      fichier @ total @ filename fhd @ PALs 1 p dorim drop
Then we prepare the mfdb destination to be adapted to the current number of planes, and then call the TRM to adapt the bloc:

Code: Select all

      mfdbs mfdbd fillmfdb			\ copy mfdb source to dest
      work_out 2- w@ mfdbd 12 + w!		\ get the planes and store it into mfdb dest
      %b0110010 1 PALs PALd 3 t dotrm drop	\ does the conversion
Then we copy the bloc to the screen:

Code: Select all

      mfdbd mfdbs fillmfdb			\ the dest bloc from TRM becomes source bloc
      PALd setvdipal				\ set the palette returned by TRM
      0 mfdbd ! 0 0 0 0				\ mfdb dest is the screen, coordinates 0,0 to 0,0
      mfdbs 4 + w@ mfdbs 6 + w@ 3 vro_cpyfm	\ get the image size from mfdb source, and copy bloc!
      key drop					\ wait for a key
Now, time to clean all:

Code: Select all

      fhd @ fclose drop		\ close GIF file
   then
   p modunload			\ unload the GIF module
   t modunload			\ unload the TRM
;
Here are the results, using the same program (not a line changed!) in 16 colors and monochrome on a TT without the gfx card:

20220406_164101.jpg
20220406_164025.jpg

I wait for Simon to finish the English translation of the manual, then I will add the PARX chapter and publish everything !

Guillaume.
You do not have the required permissions to view the files attached to this post.
Playmobil
Captain Atari
Captain Atari
Posts: 283
Joined: Fri Nov 13, 2015 7:40 pm

Re: FORTH for every Atari

Post by Playmobil »

C'est beau !!! Félicitations !

Nice ! Congratz !
User avatar
mrbombermillzy
Atari Super Hero
Atari Super Hero
Posts: 581
Joined: Tue Sep 13, 2016 9:24 am

Re: FORTH for every Atari

Post by mrbombermillzy »

Guillaume, I LOVE what you have done here!

(I pretty much say this on all your stuff, I guess, because we seem to have several similar interests).

Such a phenomenal set of FORTH Words being created for the Atari range.

Looking forwards to the English manual. (So I must also thank Simon for his effort too).

Dont stop what you are doing!

:cheers:
Moulinaie
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Wed Feb 01, 2012 9:34 pm

Re: FORTH for every Atari

Post by Moulinaie »

Playmobil wrote: Wed Apr 06, 2022 5:06 pm C'est beau !!! Félicitations !

Nice ! Congratz !
Merci a lot !

Guillaume.
Post Reply

Return to “Coding”