V-FORTH - Forth-83 for the VIC

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

I think you have your if ... then nesting wrong. Remember that Forth syntax is

Code: Select all

<condition> if <true path> then
or

Code: Select all

<condition> if <true path> else <false path> then
I think you want something like

Code: Select all

: t81
if  xb  c@  1-  dup  0<  if  drop  0  then  xb  c!  then  then  ; 
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

I've uploaded a new disk image that has a module for doing user defined graphics. It is in a file called graphics-user.fs and here's an example that uses it

Code: Select all

include graphics-user.fs

create ship
0  c,  24  c,  60  c,  126  c,  255  c,  24  c,  36  c,  66  c,

: ships
    graphics  user
    charset1 redefset
    ship  30  1  redef
    cr  20  0  do
	94  emit
    loop  cr  ;
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.
graphics-user.fs is not on the vforth.d64 on 15.09.2019.

thanks.
greeting
Attachments
forth.jpg
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

Are you sure you are using the latest version of the file?

Code: Select all

[srowe@nimloth ~]$ wget https://eden.mose.org.uk/download/vforth.d64
--2019-09-15 17:34:07--  https://eden.mose.org.uk/download/vforth.d64
Resolving eden.mose.org.uk... 192.168.1.254
Connecting to eden.mose.org.uk|192.168.1.254|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 174848 (171K)
Saving to: ‘vforth.d64’

vforth.d64                           100%[======================================================================>] 170.75K  --.-KB/s    in 0.002s  

2019-09-15 17:34:07 (70.8 MB/s) - ‘vforth.d64’ saved [174848/174848]

[srowe@nimloth ~]$ c1541 vforth.d64 -list
0 "vforth          " vf 2a
33    "vforth.prg"        prg 
33    "vforth.rom"        prg 
1     "loader"            prg 
3     "demo.fs"           seq 
1     "demo-graphics.fs"  seq 
15    "assembler.fs"      seq 
2     "autosave.fs"       seq 
15    "debugger.fs"       seq 
15    "dos.fs"            seq 
4     "gameio.fs"         seq 
13    "graphics.fs"       seq 
4     "graphics-user.fs"  seq 
4     "printer.fs"        seq 
5     "sound.fs"          seq 
3     "vicrel.fs"         seq 
4     "votrax.fs"         seq 
2     "sysconsts.fs"      seq 
507 blocks free.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Here she is out.
is this the wrong folder?

vfoth.d64 2019-09-15 16:27 171K
graphics-user.fs not.

Can you please put the d64 here.

thanks.
Greeting
Attachments
forth1.jpg
Last edited by funkheld on Sun Sep 15, 2019 1:33 pm, edited 3 times in total.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

hello , this is from the if-then : "xb c@ 255 = if 0 xb c! then" is ok.

"xb c@ 0 < if 0 xb c! then" the byte : "0 < " (-1 is 255 )

greeting
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

funkheld wrote: Sun Sep 15, 2019 12:56 pm Here she is out.
is this the wrong folder?

vfoth.d64 2019-09-15 16:27 171K
graphics-user.fs not.

Can you please put the d64 here.

thanks.
Greeting
Not sure what is happening. I've completely rebuilt the image and uploaded it again

Code: Select all

[srowe@nimloth ~]$ wget https://eden.mose.org.uk/download/vforth.d64
--2019-09-15 21:15:25--  https://eden.mose.org.uk/download/vforth.d64
Resolving eden.mose.org.uk... 192.168.1.254
Connecting to eden.mose.org.uk|192.168.1.254|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 174848 (171K)
Saving to: ‘vforth.d64’

vforth.d64                           100%[======================================================================>] 170.75K  --.-KB/s    in 0.003s  

2019-09-15 21:15:25 (59.0 MB/s) - ‘vforth.d64’ saved [174848/174848]

[srowe@nimloth ~]$ sha256 vforth.d64
bash: sha256: command not found
[srowe@nimloth ~]$ sha256sum vforth.d64
c4528f81085a52582c0f3957077cfc258357305a934f1b24d8004d6307d4cf9e  vforth.d64
[srowe@nimloth ~]$ c1541 vforth.d64 -list
0 "vforth          " vf 2a
33    "vforth.prg"        prg 
33    "vforth.rom"        prg 
1     "loader"            prg 
3     "demo.fs"           seq 
1     "demo-graphics.fs"  seq 
15    "assembler.fs"      seq 
2     "autosave.fs"       seq 
15    "debugger.fs"       seq 
15    "dos.fs"            seq 
4     "gameio.fs"         seq 
13    "graphics.fs"       seq 
4     "graphics-user.fs"  seq 
4     "printer.fs"        seq 
5     "sound.fs"          seq 
3     "vicrel.fs"         seq 
4     "votrax.fs"         seq 
2     "sysconsts.fs"      seq 
507 blocks free.
Can you use something like this https://docs.microsoft.com/en-us/powers ... wershell-6 to test what you have downloaded?
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

funkheld wrote: Sun Sep 15, 2019 1:06 pm "xb c@ 0 < if 0 xb c! then" the byte : "0 < " (-1 is 255 )
Single bytes are always going to be positive

Code: Select all

variable byte  ok
-1 byte c!  ok
byte c@ . 255  ok
If you want signed integers use 16 bit fetch/stores.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

I downloaded it here.

greeting.
Attachments
forth2.jpg
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

the latest date has been loaded.
not : graphics-user.fs

greeting
Attachments
vbild.jpg
vbild.jpg (3.5 KiB) Viewed 1249 times
vbild1.jpg
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hi good afternoon.
I give it up now. it does not work.
the vforth.d64 is there, but one is not in there : graphics-user.fs

thanks.
greeting
Attachments
vic11.jpg
vic11.jpg (3.66 KiB) Viewed 1239 times
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

Hello, my first little program.
push a ball over the screen with the buttons.
Q / W / E / S and the color change with R / F.

how can you do it, the ball continues as long as you hold down a button?

Greeting

Code: Select all

variable xb 
variable yb 
variable fb 
variable pw
variable sw 
variable cw

: cls
511 0 do 32 i 4096 + c! loop
0 0 214  c! 211 c! 58640 sys ; 

: setze
dup 81 = if xb c@ 1 - xb c!  then  xb c@ 255 = if 0  xb c!  then  
dup 69 = if xb c@ 1 + xb c!  then  xb c@ 21 > if 21 xb c!  then  
dup 87 = if yb c@ 1 - yb c!  then  yb c@ 255 = if 0  yb c!  then 
dup 83 = if yb c@ 1 + yb c!  then  yb c@ 22 > if 22 yb c!  then
dup 82 = if fb c@ 1 + fb c!  then  fb c@ 7  > if 7  fb c!  then
    70 = if fb c@ 1 - fb c!  then  fb c@ 255 = if 0  fb c!  then

yb c@ 22 * xb c@ + pw ! 
81 sw @ pw @ + c!
fb c@ cw @ pw @ + c! ;

: gehe 
cls 
4096 sw !
37888 cw !
10 yb c!  10 xb  c! 5 fb c!
setze
cr  begin
key  setze ?terminal  until  ;
Attachments
erste.jpg
Last edited by funkheld on Mon Sep 16, 2019 7:48 am, edited 1 time in total.
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

how can you do it, the ball continues as long as you hold down a button? >>>>> is ok.

"peek(197)" is the key ! or in vforth "197 c@ .

greeting
User avatar
srowe
Vic 20 Scientist
Posts: 1339
Joined: Mon Jun 16, 2014 3:19 pm

Re: V-FORTH - Forth-83 for the VIC

Post by srowe »

funkheld wrote: Mon Sep 16, 2019 1:02 am Hi good afternoon.
I give it up now. it does not work.
the vforth.d64 is there, but one is not in there : graphics-user.fs

thanks.
greeting
I've downloaded the file from work and it has the correct SHA256 hash. Somehow you are downloading a cached old copy. Or perhaps your browser is copying it to a different folder or filename?
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: V-FORTH - Forth-83 for the VIC

Post by funkheld »

hello,good day.

this i invite:
vforth.d64 2019-09-15 21:14 171K


the file is downloaded and appears in the folder with me.
the folder is empty before.

see image.

greeting
Attachments
vfroth11.jpg
Post Reply