vforth 1.5 is wonderful for the next.

Discuss game and other programming topics not specifically covered in another forum

Moderator: Programming Moderators

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

vforth 1.5 is wonderful for the next.

Postby funkheld » Sun Sep 19, 2021 3:03 pm

hello, this vforth is wonderful for the next.
it pays to work / learn with it.
i can also explain the vforth commands if
there is interest. this is wonderful to learn:
!Blocks-64.bin_20210916.txt
vForth1.5-core-en.pdf

the newest vforth is with floating.
I once created this little demo.

https://github.com/mattsteeldue/vforth-next

greeting

Code: Select all

NEEDS VALUE 
needs to   
NEEDS J
needs layer11
needs floating

floating

43 load
220 load
down

0 value wx 0 value wy

: at.    22 emitc  swap  emitc emitc ;
: ink.   16 emitc   emitc ;
: paper. 17 emitc   emitc ;  

: los
  layer11
  cls
  
  360 0 do 
    i 0 deg>rad fsin 75 0 f* fint drop to wx
    i 0 deg>rad fcos 75 0 f* fint drop to wy
    128 96 plot
    wx wy draw
  
    5
  +loop ;
  
Attachments
vforthfloating.jpg
vforthfloating.jpg (55.23 KiB) Viewed 747 times

User avatar
Mmattsteel
Posts: 31
Joined: Wed May 31, 2017 5:38 am
Location: Venice Italy
Contact:

Re: vforth 1.5 is wonderful for the next.

Postby Mmattsteel » Sun Sep 19, 2021 8:47 pm

Well done, Peter. It seems vForth for Next starts being useful !
_Matteo.
Matteo.
Backer #1227. ZX Spectrum+ m/c programmer since 1985.
Take a look to https://github.com/mattsteeldue/vforth-next

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

Re: vforth 1.5 is wonderful for the next.

Postby funkheld » Mon Sep 20, 2021 7:31 am

i believe that this vforth does the same job as the next basic.
you just have to have the courage to deal with the vforth (forth). the vforth can be used to make good system tests.

people and experts would have to find each other who have the courage to integrate the vforth into next like this nextbasic.
a new generation of programming language in the next.

thanks.
greeting

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

Re: vforth 1.5 is wonderful for the next.

Postby funkheld » Thu Sep 23, 2021 5:40 pm

Hi good afternoon.
when I start the program with include /fth/inter.f , this picture comes up. why is that please?
thanks.
greeting

Code: Select all

needs interrupt
needs value    
needs to

: at.    22 emitc  swap  emitc emitc ;
: ink.   16 emitc   emitc ;
: paper. 17 emitc   emitc ;  

0 value wert

: isr-test
   23672 ( frames )  @ 7 and 0= if
    wert 1 + to wert
    0 0 at. wert .
  endif  ;

int-off 
' isr-test int-w ! 
int-on 
Attachments
inter.jpg
inter.jpg (57.75 KiB) Viewed 604 times

User avatar
Mmattsteel
Posts: 31
Joined: Wed May 31, 2017 5:38 am
Location: Venice Italy
Contact:

Re: vforth 1.5 is wonderful for the next.

Postby Mmattsteel » Thu Sep 23, 2021 7:33 pm

Hi Peter,
I was able to reproduce your bug and how to avoid it: you have to put an empty line at the end of your source file.
It seems that if a source file doesn't end with an empty line, INCLUDE falls in loop.
This is a strange bug I'm still unable to fix, sorry.

Anyway, your interrupt experiment doesn't go much far, since you're modifying "in background" the AT cursor-position very often, but since the "foreground" process share the same AT cursor-position any other print is jammed in the upper-left corner of the screen.

You must carefully choose what to do during the interrupt service routine, avoiding any interference with the foreground program...

_Matteo.
Last edited by Mmattsteel on Fri Sep 24, 2021 6:59 am, edited 1 time in total.
Matteo.
Backer #1227. ZX Spectrum+ m/c programmer since 1985.
Take a look to https://github.com/mattsteeldue/vforth-next

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

Re: vforth 1.5 is wonderful for the next.

Postby funkheld » Thu Sep 23, 2021 8:13 pm

hello, thanks for your quick help.

thanks
greeting

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

Re: vforth 1.5 is wonderful for the next.

Postby funkheld » Sun Sep 26, 2021 7:19 pm

hello, here demo not do/loop for layer2 .

tanks.

1. 4 lines are draw correctly

2. with do / loop i wanted to draw 32 lines.
that does not work. 32 points are plotted one below the other. why?

4 lines ok !

Code: Select all

NEEDS VALUE    
NEEDS TO
NEEDS CASE
NEEDS J
needs code
needs layer2

220 load
down

: at.    22 emitc  swap  emitc emitc ;

0 value wx 

hex
: plotte

[ hex ]
  layer2
  cls
  0a 0 at.
  
  e000 to wx
  100 0 do
      12 mmu7! e0 i wx + c!
  loop  

  e000 100 + to wx
  100 0 do
      12 mmu7! e0 i wx + c!
  loop  
  
  e000 200 + to wx
  100 0 do
      12 mmu7! e0 i wx + c!
  loop 

  e000 300 + to wx
  100 0 do
      12 mmu7! e0 i wx + c!
  loop  
  
  [ decimal ] ;
32 lines not ok !

Code: Select all

NEEDS VALUE    
NEEDS TO
NEEDS CASE
NEEDS J
needs code
needs layer2

220 load
down

: at.    22 emitc  swap  emitc emitc ;

0 value wx 

hex
: plotte

[ hex ]
  layer2
  cls
  0a 0 at.
  
  
  20 0 do
    e000 i 100 * + to wx
    
    100 0 do
        12 mmu7! e0 j wx + c!
    loop  
  loop 
  
  [ decimal ] ;
  
Attachments
plot-ok.jpg
plot-ok.jpg (20.29 KiB) Viewed 445 times
plot-not-ok.jpg
plot-not-ok.jpg (18.1 KiB) Viewed 445 times

User avatar
Mmattsteel
Posts: 31
Joined: Wed May 31, 2017 5:38 am
Location: Venice Italy
Contact:

Re: vforth 1.5 is wonderful for the next.

Postby Mmattsteel » Sun Sep 26, 2021 8:43 pm

Hi Peter,
there is no need to give 220 LOAD DOWN since vForth 1.5 is already build with MMU7 available for this purpose.

Here is my experiment, it is quite slow, it fills all Layer 2 Screen in less than 30 sec.

Code: Select all

   needs J  needs CHOOSE  needs LAYERS
   HEX
   : pause0  begin ?terminal until ;  
   : pixeladd ( x y -- a ) 
      \ given x and y coords returns the address in MMU7 that is Layer 2 address.
     over 5 rshift          \ divide x by 32
     12 reg@ 2* + mmu7!     \ fits correct 8K page in MMU7
     swap 01F and           \ x mod 32
     8 lshift +             \ turn it high byte part
     E000 or                \ calc address $E000-$FFFF
   ;
   : test
     LAYER2
     100 0 do
       0C0 0 do
         FF choose
         i j pixeladd c!
       loop
    loop
    pause0    \ waits for [BREAK]
    LAYER12
   ;
Attachments
Layer2-random-plot.png
Layer2-random-plot.png (191.11 KiB) Viewed 427 times
Matteo.
Backer #1227. ZX Spectrum+ m/c programmer since 1985.
Take a look to https://github.com/mattsteeldue/vforth-next

funkheld
Posts: 76
Joined: Tue May 11, 2021 5:36 pm

Re: vforth 1.5 is wonderful for the next.

Postby funkheld » Mon Sep 27, 2021 7:17 am

hello, this error occurs again.

is it the text editor?
i have notepad ++.

what do you have to consider when entering the text? indentation, spaces ....?

thanks.
greeting
Attachments
fehler.jpg
fehler.jpg (197.04 KiB) Viewed 379 times

User avatar
Mmattsteel
Posts: 31
Joined: Wed May 31, 2017 5:38 am
Location: Venice Italy
Contact:

Re: vforth 1.5 is wonderful for the next.

Postby Mmattsteel » Mon Sep 27, 2021 8:50 am

funkheld wrote: Mon Sep 27, 2021 7:17 am hello, this error occurs again.

is it the text editor?
i have notepad ++.

what do you have to consider when entering the text? indentation, spaces ....?

thanks.
greeting
Besides the "empty line" at the end of the file and the maximum length of 510 characters per line, maybe some issue could araise from the encoding, since the file should be encoded as "ASCII 7-bit" with 0x0A or 0x0D as line-terminator.

Sorry, I need to see your .f file.
Send it me privately.

_M.
Last edited by Mmattsteel on Mon Sep 27, 2021 1:06 pm, edited 1 time in total.
Matteo.
Backer #1227. ZX Spectrum+ m/c programmer since 1985.
Take a look to https://github.com/mattsteeldue/vforth-next


Who is online

Users browsing this forum: No registered users and 1 guest