vforth for the next....

The Speccy's spritely young offspring. Discuss everything from FPGA to ZX
Post Reply
funkheld
Dizzy
Posts: 55
Joined: Tue May 18, 2021 9:01 pm

vforth for the next....

Post by funkheld »

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

0 value wx 0 value wy

: los
  layer11
  cls
  
  360 0 do 
    i float deg>rad fsin 75 float f* fint drop to wx
    i float deg>rad fcos 75 float f* fint drop to wy
    128 96 plot
    wx wy draw
  
    5
  +loop ;
  
Image
funkheld
Dizzy
Posts: 55
Joined: Tue May 18, 2021 9:01 pm

Re: vforth for the next....

Post by funkheld »

hello, this is vforth with graphic plot in layer2.
with sine floating plot and sine table plot.

https://www.specnext.com/forum/viewtopi ... 8&start=10

greeting
funkheld
Dizzy
Posts: 55
Joined: Tue May 18, 2021 9:01 pm

Re: vforth for the next....

Post by funkheld »

circle for layer 2.

greeting

Code: Select all

NEEDS VALUE 
needs to   
needs LAYERS

471 load

 0 value wx 0 value wy  0 value wz
 0 value grad
 0 value color

 HEX
 : pixeladd ( x y -- a )
   over 5 rshift          
   12 reg@ 2* + mmu7!    
   swap 01F and           
   8 lshift +             
   E000 or                
   ;
decimal

2 constant cell
: sinus@ cell * sine-table + @ ;

: sin 
  dup >r 
  abs 360 mod
  dup 180 > if 180 - -1 else 0 then >r
  dup 90 > if 180 swap - then
  sinus@
  r> +- 
  r> +-  ;

: cos 90 + sin ;
     
: test
  LAYER2
  cls
 
   8 0 do
     wz 10 + to wz
     color 20 + to color
     360 0 do 
       i sin wz 10000 */ to wx
       i cos wz 10000 */ to wy
       color 100 wy + 120 wx + pixeladd c!
     loop   
  loop
 ;
 




Image
funkheld
Dizzy
Posts: 55
Joined: Tue May 18, 2021 9:01 pm

Re: vforth for the next....

Post by funkheld »

With GIMP you can make wonderful drawings 8bit for vforth layer2. Use the layer2 palette and off you go.
the graphics are finished colored samples from GIMP.

1. layer2

2. layer11, layer2-scroll and sprite . sprite is between layer11 and layer2

greeting
Image

Image
Post Reply