Jump to content

Photo

In DeNile


45 replies to this topic

#26 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Sat May 6, 2017 6:32 AM

I don't know what happened with this one Lee but the screen screwed up again during the pasting ... this was using the 2.09 version too



#27 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Sat May 6, 2017 6:34 AM

In the meantime, I've got another TI Basic example, this time , documented, (a nod to lee's documentation style)

 

I'd love to see this one running in Forth with a slight delay.  As it is you're gonna need CPU Overdrive in Classic99

 

REM / WATERFALL

 

REM / CHARS 104 TO 111 ARE WATER STRAIGHT
REM / CHARS 112 TO 119 ARE WATER DOWN
REM / CHAR 120 IS GROUND
REM / CHAR 128 TO 131 IS CLOUDS
REM / CHAR 132 & 133 IS A BIRD
 
10 CALL CLEAR
20 FOR N=104 TO 119
30 READ X$
40 CALL CHAR(N,X$)
50 NEXT N
60 DATA FFC7BB7DFFFFFFFF,FF8F77FAFFFFFFFF,FF1FEEF5FFFFFFFF,FF3EDDEBFFFFFFFF,FF7CBBD7FFFFFFFF
70 DATA FFF877AFFFFFFFFF,FFF1EE5FFFFFFFFF,FFE3DDBEFFFFFFFF
80 DATA FDFDFBDBDBBFBFBF,BFFDFDFBDBDBBFBF,BFBFFDFDFBDBDBBF,BFBFBFFDFDFBDBDB,DBBFBFBFFDFDFBDB
90 DATA DBDBBFBFBFFDFDFB,FBDBDBBFBFBFFDFD,FDFBDBDBBFBFBFFD
100 CALL CHAR(120,"423865D085D24D38")
110 CALL CHAR(128,"000003070F0F3F7F")
120 CALL CHAR(129,"FFFFFFFF7F0F0000")
130 CALL CHAR(130,"0000C0E0F0F0FCFE")
140 CALL CHAR(131,"FFFFFFFFFEF00000")
141 CALL CHAR(132,"000000C628100000")
142 CALL CHAR(133,"0000285482000000")
 
REM / BLANK THE SCREEN AND DRAW EVERYTHING
150 CALL SCREEN(2)
160 FOR N=2 TO 12
170 CALL COLOR(N,2,2)
180 NEXT N
 
REM / DRAW THE GROUND
190 FOR N=6 TO 24
200 CALL HCHAR(N,16,120,16)
210 NEXT N
 
REM / DRAW THE WATER STRAIGHT AND DOWN USING WA AND WB VARIABLES FOR THE CHARS 104 AND 112
REM / BIRD IS CHARS BA AND IT'S POSITION IS Y
214 WA=104
215 WB=112
216 BA=132
218 Y=1
220 CALL HCHAR(5,16,WA,16)
230 CALL VCHAR(5,15,WB,19)
240 CALL HCHAR(24,1,WA,15)
 
REM / DRAW CLOUDS USING CX,CY AND SUB TO 1000
250 CX=1
260 CY=5
270 GOSUB 1000
280 CX=2
290 CY=9
300 GOSUB 1000
310 CX=2
320 CY=17
330 GOSUB 1000
340 CX=1
350 CY=25
360 GOSUB 1000
 
REM / MAKE SCREEN BLUE AND SWITCH COLOR ON
370 CALL SCREEN(6)
380 CALL COLOR(10,5,16)
390 CALL COLOR(11,5,16)
400 CALL COLOR(12,7,10)
410 CALL COLOR(13,16,1)
 
REM / ANIMATE THE WATER & BIRD
REM / BIRD MOVES 1 CHAR POSITION EVERYTIME THE WATER GETS TO CHAR 111
430 WA=WA+1
440 WB=WB+1
450 IF WA>111 THEN 451 ELSE 460
451 WA=104
452 CALL HCHAR(4,1,32,32)
453 BA=BA+1
454 IF BA>133 THEN 455 ELSE 456
455 BA=132
456 Y=Y+1
457 IF Y>32 THEN 458 ELSE 460
458 Y=1
460 IF WB>119 THEN 461 ELSE 470
461 WB=112
470 CALL HCHAR(5,16,WA,16)
480 CALL VCHAR(5,15,WB,19)
490 CALL HCHAR(24,1,WA,15)
495 CALL HCHAR(4,Y,BA)
500 GOTO 430
 
REM / DRAW THE CLOUDS SUBROUTINE FOR CX,CY
1000 CALL HCHAR(CX,CY,128)
1010 CALL HCHAR(CX,CY+1,130)
1020 CALL HCHAR(CX+1,CY,129)
1030 CALL HCHAR(CX+1,CY+1,131)
1040 RETURN


#28 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,343 posts
  • Location:Silver Run, Maryland

Posted Sat May 6, 2017 7:11 AM

I don't know what happened with this one Lee but the screen screwed up again during the pasting ... this was using the 2.09 version too

 

Sorry about that.  I did not expect this one to be pasted into fbForth.  It was only explanatory.  The operating code is identical to the earlier post.  The reason the last version will not work is that several lines are longer than 80 characters.  The fbForth terminal input mechanism will only accept 80 characters per line.  This results in the remainder of lines longer than 80 characters being pasted in as a second new line.  That second new line almost certainly will result in an error.

 

...lee



#29 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Sat May 6, 2017 7:41 AM

 

Sorry about that.  I did not expect this one to be pasted into fbForth.  It was only explanatory.  The operating code is identical to the earlier post.  The reason the last version will not work is that several lines are longer than 80 characters.  The fbForth terminal input mechanism will only accept 80 characters per line.  This results in the remainder of lines longer than 80 characters being pasted in as a second new line.  That second new line almost certainly will result in an error.

 

...lee

ahh my mistake ... I notice the errors start right away, this is due to the nature of forth, it doesn't have to wait for an execution command as such? :)



#30 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,343 posts
  • Location:Silver Run, Maryland

Posted Sat May 6, 2017 8:24 AM

ahh my mistake ... I notice the errors start right away, this is due to the nature of forth, it doesn't have to wait for an execution command as such? :)

 

Yeah—When typing at the “command line”, you are in the hands of the outer or text interpreter.  After a line is entered with <ENTER> or typing the 80th character of a line, the interpreter parses the line as space-delimited tokens, each of which it looks up in the dictionary.  If it finds it, it either executes it or compiles it depending on STATE (executing or compiling).  If you are defining a word, you are compiling.  Otherwise, you are executing.  If the interpreter does not find the word, it tries to convert the token to a number to push onto the stack.  Failing that, you immediately get an error message and the interpreter aborts, which clears the stacks and restarts the interpreter—it is an infinite loop.

 

...lee



#31 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,343 posts
  • Location:Silver Run, Maryland

Posted Sun May 7, 2017 7:35 PM

In the meantime, I've got another TI Basic example, this time , documented, (a nod to lee's documentation style)

  ...

I'd love to see this one running in Forth with a slight delay.  As it is you're gonna need CPU Overdrive in Classic99

 

Here ya go, Joe:

 

Spoiler

 

The waterfall and bird are moving with a ~10 ms delay.

 

Sorry it took me so long.  After I was sure there was nothing wrong with the code, there was still something wrong.  It turned out the problem was my using "Paste XB" to paste the code into fbForth—bad move!  ‘ ! ’ is a Forth word but a rest-of-line comment in XB (like \ in fbForth) and the Classic99 manual clearly states you should not use “Paste XB” without the XB cartridge. :dunce: It obviously swallowed my ! words.

 

...lee



#32 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Mon May 8, 2017 8:35 AM

That's brilliant Lee ... that slight delay seems to be just right.

 

Of course, I'll be attempting to study all this Forth later tonight in the hope that I can start learning some of it even though it's such a steep learning curve for me at the moment.  

 

Your comments in the code will help a lot though!  I might start out with something simple like a little Dopewars selling/buying game.



#33 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,012 posts
  • Location:Uzbekistan (no, really!)

Posted Mon May 8, 2017 2:37 PM

This should help:

http://turboforth.ne.../tutorials.html

Most of it will apply equally well to fbForth.

#34 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Mon May 8, 2017 2:40 PM

This should help:

http://turboforth.ne.../tutorials.html

Most of it will apply equally well to fbForth.

Nice one Willsy.  I'm having a look at it 



#35 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,343 posts
  • Location:Silver Run, Maryland

Posted Tue May 9, 2017 11:25 AM

Here is a variation that has the waterfall going 8 times the speed of the upper and lower rivers.  Tthe rivers are now updated at the same time as the bird.

 

Spoiler

 

...lee



#36 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,438 posts
  • Location:Denmark

Posted Tue May 9, 2017 12:56 PM

 

Are you using it with v2.0:9?  When I selected "software", it brought up v2.0:5---that definitely will not work!

 

...lee

 

I have updated the bundled version in js99er.net to 2.0.9.



#37 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,343 posts
  • Location:Silver Run, Maryland

Posted Tue May 9, 2017 1:18 PM

 

I have updated the bundled version in js99er.net to 2.0.9.

 

Thank you, Sir!  I was going to ask, but you beat me to it—thanks again.

 

...lee



#38 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Wed May 10, 2017 4:21 AM

Lee that's brill!   Love how the waterfall is in the new one.  

 

Cheers Rasmus for updating forth. 

 

 

I have a little something planned for later on, to show, it's not quite "there" yet ... but it's gonna be good.



#39 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Wed May 10, 2017 1:39 PM

Just a rough bit of code, I'm sat on the Chromebook at work, taking a slightly longer than expected break due to not much happenings ...   :)

 

Right, this one needs XB.

 

Couple of issues with it,

 

* For some strange reason it REALLY slows down when you fire.  I'm talking worse than Nintendo SNES slowdown. This needs looking at.

 

* once an alien has been shot, for some reason the "getting shot" thing happens again and again until it counts to 8 (the number of aliens on screen) and then congratulates you.

 

* When the aliens have moved down to the lowest assigned position, the congratulatory noise happens and the screen re-draws. (this is done on purpose for now)

 

* Collision detection is barely there but you CAN shoot some of them

 

* Control with S and D and space to shoot

 

* Needs compiling! if you do , change the ticker  in line 291 to max out at something like 64 instead of 8

 

Attached File  INVASION.zip   2.5KB   6 downloads 

Attached File  THE INVASION.txt   5.06KB   18 downloads 


Edited by Retrospect, Wed May 10, 2017 1:41 PM.


#40 Retrospect OFFLINE  

Retrospect

    Dragonstomper

  • Topic Starter
  • 866 posts
  • Location:Wakefield, England

Posted Wed May 10, 2017 4:30 PM

Here is a variation that has the waterfall going 8 times the speed of the upper and lower rivers.  Tthe rivers are now updated at the same time as the bird.

 

Spoiler

 

...lee

This is a great little program lee.  I'll use this alongside learning the basics of forth .  



#41 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 321 posts
  • Location:The Great White North

Posted Thu May 11, 2017 2:48 PM

I have been working on creating additions to CAMEL99 Forth that make some training wheels for people who want to try Forth after TI BASIC
The latest version of the EA5 file is here: https://github.com/bfox9900/CAMEL99
 
I used the DENILE program to beat up on my GRAPHICS words and it helped me find some bugs.
 
I also thought it would funny/informative to write a Forth version that uses VARIABLES exactly like the BASIC
program.  The hard thing for Forth is imitating BASIC strings, but fortunately I did that work in 1987
for TI FORTH.  Willsy liked the concepts so much he completely re-wrote them his own way for Turbo Forth and I re-wrote them again
for this job.
 
So here is DENILE  translated to Forth in a more literal way.
So I guess this can be a ROSETTA stone to translate for BASIC PROGRAMERS.
 
To use it start CAMEL99 in Classic99 and past it in.
Then type RUN.
 
BY THE WAY: Do not make Forth programs like this. Use Lee's example to see how it's really done. ;)
 
Spoiler

Edited by TheBF, Thu May 11, 2017 5:43 PM.


#42 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 321 posts
  • Location:The Great White North

Posted Thu May 11, 2017 3:35 PM

In fact I think that if that source wasn't documented it's byte-count would be less than the BASIC list I made.

 

Comments are FREE in Forth. The compiler reads the file and throws comments away.

 

Regarding code size I just measured CAMEL99 version at 554 bytes (all in mem. expansion)

Of course there is 8K of run time block underneath it all but that is not so different than TI BASIC ROMS and GROMS.

One the reasons This Forth version is smaller is because it loads the character patterns with the interpreter when the program loads.

CHARDEF just loads the data into VDP ram in "IMMEDIATE MODE" as we say in BASIC and nothing is stored in the program. Kind of cool.

 

In Extended BASIC the program uses: 976 bytes for program and 11 bytes of "stack memory"


Edited by TheBF, Thu May 11, 2017 3:36 PM.


#43 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,922 posts
  • Location:Denmark

Posted Fri May 12, 2017 1:32 AM

Just a rough bit of code, I'm sat on the Chromebook at work, taking a slightly longer than expected break due to not much happenings ...   :)
 
Right, this one needs XB.
 
Couple of issues with it,
 
INVASION.txt

 

Truly amazing. Actually had to check if CPU Overdrive was on. Very inspirational. Thanks. :)
 



#44 RXB OFFLINE  

RXB

    River Patroller

  • 2,765 posts
  • Location:Vancouver, Washington, USA

Posted Fri May 12, 2017 4:55 AM

Just for fun RXB version:

10 CALL CLEAR
20 FOR N=104 TO 119
30 READ X$
40 CALL CHAR(N,X$)
50 NEXT N
60 DATA FFC7BB7DFFFFFFFF,FF8F77FAFFFFFFFF,FF1FEEF5FFFFFFFF,FF3EDDEBFFFFFFFF,FF7CBBD7FFFFFFFF
70 DATA FFF877AFFFFFFFFF,FFF1EE5FFFFFFFFF,FFE3DDBEFFFFFFFF
80 DATA FDFDFBDBDBBFBFBF,BFFDFDFBDBDBBFBF,BFBFFDFDFBDBDBBF,BFBFBFFDFDFBDBDB,DBBFBFBFFDFDFBDB
90 DATA DBDBBFBFBFFDFDFB,FBDBDBBFBFBFFDFD,FDFBDBDBBFBFBFFD
100 CALL CHAR(120,"423865D085D24D38")
110 CALL CHAR(128,"000003070F0F3F7FFFFFFFFF7F0F00000000C0E0F0F0FCFEFFFFFFFFFEF00000000000C6281000000000285482000000")
150 CALL SCREEN(2)
160 FOR N=2 TO 12
170 CALL COLOR(N,2,2)
180 NEXT N
190 FOR N=6 TO 24
200 CALL HCHAR(N,16,120,16)
210 NEXT N
214 WA=104
215 WB=112
216 BA=132
218 Y=1
220 CALL HCHAR(5,16,WA,16,24,1,WA,15)
230 CALL VCHAR(5,15,WB,19)
250 CX=1
260 CY=5
270 GOSUB 1000
280 CX=2
290 CY=9
300 GOSUB 1000
310 CX=2
320 CY=17
330 GOSUB 1000
340 CX=1
350 CY=25
360 GOSUB 1000
370 CALL SCREEN(6)
380 CALL COLOR(10,5,16,11,5,16,12,7,10,13,16,1)
430 WA=WA+1
440 WB=WB+1
450 IF WA>111 THEN 451 ELSE 460
451 WA=104
452 CALL HCHAR(4,1,32,32)
453 BA=BA+1
454 IF BA>133 THEN 455 ELSE 456
455 BA=132
456 Y=Y+1
457 IF Y>32 THEN 458 ELSE 460
458 Y=1
460 IF WB>119 THEN 461 ELSE 470
461 WB=112
470 CALL HCHAR(5,16,WA,16,24,1,WA,15,4,Y,BA)
480 CALL VCHAR(5,15,WB,19)
500 GOTO 430
1000 CALL HCHAR(CX,CY,128,1,CX,CY+1,130,1,CX+1,CY,129,1,CX+1,CY+1,131)
1040 RETURN



#45 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 321 posts
  • Location:The Great White North

Posted Fri May 12, 2017 6:21 AM

Just a rough bit of code, I'm sat on the Chromebook at work, taking a slightly longer than expected break due to not much happenings ...   :)

 

Right, this one needs XB.

 

Couple of issues with it,

<snip>

 

attachicon.gifINVASION.zip

attachicon.gifTHE INVASION.txt

 

This is very cool.  Thank you.

 

I am going to use this to debug my SPRITE CODE.

 

BF


Edited by TheBF, Fri May 12, 2017 6:21 AM.


#46 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 321 posts
  • Location:The Great White North

Posted Sun May 21, 2017 4:45 PM

Attached File  Denile multi.mov   1.23MB   13 downloads

 

I want to thank retrospect for this nice little scene.

It gave me something to work on to beat up my graphics and muli-tasker.

 

I might have gone a little overboard...

 

But anyway, it works!!

 

... And isn't that all we care about.

 

Here is the reworked code in Forth with 5 tasks running independently including the Console task.

 

Check back in a few minutes for a movie of the "animation"

 

(No sprites yet... this is not done yet.)

 

Spoiler

Edited by TheBF, Sun May 21, 2017 5:05 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users