Jump to content
IGNORED

TI FORTH Version 3.0 dated October 20 1982


JonnyBritish

Recommended Posts

Turboforth obviously has a much faster display routine.

 

...lee

This is obviously crucial for games. However, I'm a big fan of the bitmap mode, and in that respect, TIF does seem to hold an edge over TF. The way I see it, I'll probably use TF for low res graphics applications, and TIF for my hi res mathematical explorations icon_smile.gif It is highly doubtful that I'll be using XB any time soon again icon_smile.gif And I can always imbedd assembly routines within Forth for even added flexibility.

 

Definitely. TI Forth has very very impressive bitmap capabilities.

 

I may add bitmap to TF (as a loadable option) in the future, but I think I'd need help... I don't know anything about things like drawing circles, plotting lines and all that fancy math stuff.

 

Does anyone know how much CPU RAM is taken up by the TI Forth editor and bitmap library? How does one obtain the amount of free memory in TI Forth?

 

Thanks

Link to comment
Share on other sites

...

 

Definitely. TI Forth has very very impressive bitmap capabilities.

 

I may add bitmap to TF (as a loadable option) in the future, but I think I'd need help... I don't know anything about things like drawing circles, plotting lines and all that fancy math stuff.

 

Does anyone know how much CPU RAM is taken up by the TI Forth editor and bitmap library? How does one obtain the amount of free memory in TI Forth?

 

Thanks

 

From Chapter 4 of the TI Forth Instruction Manual:

  • Low memory expansion: 806 bytes (3CDAh -- 3FFFh), reduced by the size of the return stack, which grows down from 3FFFh.
  • High memory expansion: 17184 bytes (BC80h -- FF9Fh), reduced by
    • the size of the user dictionary, which grows up from BC80 (actually, the start of TASK , the last word in the resident dictionary, so, really BC8Ch) and
    • the size of the parameter stack, which grows down from FFA0h, the address of the Terminal Input Buffer.

Available high memory is easy: SP@ HERE -

Low memory is harder because there is no RP@ in TI Forth. I've done it in TI Forth Assembler; but, the return stack can probably be estimated safely enough---unless you write an extensively recursive word.

 

Regarding the size of the editor and the bitmap library, I'll get back to you on that.

 

...lee

Link to comment
Share on other sites

...

 

Does anyone know how much CPU RAM is taken up by the TI Forth editor and bitmap library?

Thanks

 

Here are the TI Forth MENU options for LOADing the editors and bitmap library, along with the dictionary space they occupy and descriptions:

  • -EDITOR
    • 2424 bytes
    • Description: 40-column editor

    [*]-64SUPPORT

    • 6802 bytes
    • Description: 64-column editor. Additionally, loads bitmap graphics, which is virtually everything loaded by -VDPMODES and -GRAPH

    [*]-VDPMODES

    • 1622 bytes
    • Description: Loads code to switch among text and all of the graphics modes

    [*]-GRAPH

    • 2536 bytes
    • Description: Loads all of the TI Forth graphics primitives, including sprites, dot plotting and straight-line plotting

    [*]-VDPMODES and -GRAPH

    • 4158 bytes
    • Description: Loads both of the two above options.

...lee

Link to comment
Share on other sites

 

I may add bitmap to TF (as a loadable option) in the future, but I think I'd need help... I don't know anything about things like drawing circles, plotting lines and all that fancy math stuff.

 

 

Willsy, there is really no need to have these kind of algorithms built-in (although it would be nice). I think a function to clear the bit map screen and another to put a colored pixel on the screen will be a great start. Everything else can go from there, and it will up to the individual programmer to come up with their needed graphics routines.

Link to comment
Share on other sites

There is. I've done such things in the past, and you certainly need things like lines, arcs, putting text on the display and filling areas. Otherwise making graphic screens become very tedious.

But of course people who want to use such a package can contribute. Not everyone needs to do it all.

Link to comment
Share on other sites

There is. I've done such things in the past, and you certainly need things like lines, arcs, putting text on the display and filling areas. Otherwise making graphic screens become very tedious.

But of course people who want to use such a package can contribute. Not everyone needs to do it all.

What I meant was that all I need is a pixel plot routine. Everything else can be derived from that, and a programmer can then create his own graphical routines which can certainly be shared with the community. I have a whole library of assembly routines I have created to put text on the bitmap screen, draw lines, etc... which I have used repeatedly with my programs (Skychart, Ultimate Planet etc...), and the same can be done in Forth. No need to reinvent the wheel everytime...

Link to comment
Share on other sites

 

I got that much from the manual, but how do you FLUSH to a drive other than DSK1 the program that is currently being edited?

 

I may not be understanding exactly what you want to do or what, if anything, you might be missing; but, if you will indulge me a moment: FLUSHing only copies dirty screen buffers to their associated screens on disk. When you edit a screen, you give EDIT a screen number to start editing ( 99 EDIT , perhaps). It is the screen number that determines what disk you are actually working with. Let's say you are using three 90KB disks with the system on DSK1 and you want to put a program on the 10th screen of DSK2. That would be screen 9 if the disk were in the first drive. That screen in this scenario is screen 99. If you want the contents of that just-edited screen to be copied to, say, screen 189 (10th screen on DSK3), you would type FLUSH 99 189 SCOPY . The FLUSH simply insures your edits are first saved to screen 99.

 

...lee

Ah... I get it now! Thank you for the explanation :) I'm slowly getting there...

Link to comment
Share on other sites

Incidentally, some of the disk functions for TI Forth seem to corrupt the system under Classic99, but work fine with Win994a.

 

Which disk functions?

 

 

 

This is what I did:

 

1 DISK-FORMAT

to format a blank disk in DSK2 (no errors)

 

180 DISK_HI !

to set up 2 drives (no error reported)

 

DECIMAL 4 94 2 SMOVE

to copy screens 4 and 5 from DSK1 to DSK2 and I get a disk error message here and many of the non resident words I loaded from the modules at startup stop working from there on. This only happens with Classic 99, but not with Win994a.

Link to comment
Share on other sites

OK this is too cool. This is the first time I have ever been able to interactively play with the bitmap screen! Up until now, it was a painful process of editing, compiling and running in assembly. Using either the split or split2 modes, I am able to draw lines, plot pixels and create new graphical functions and watch the result in real time. This is a fabulously useful tool, and I am astounded that there is hardly anything out there that uses TI Forth despite it being available since 1983 in the public domain...

Now the bitmap tools seem rather slow, so creating rapidly changing patterns may be challenging, although I have yet to experiment with this.

Another observation is that prior familiarity with assembly and the TI's architecture seems to be assumed by the TI Forth manual, although it's not a strict requirement.

All in all, this is quite a powerful implementation that really leverages well the TI's capabilities, and I'm looking forward to exploring it further before I hop to Turbo Forth :)

  • Like 1
Link to comment
Share on other sites

Incidentally, some of the disk functions for TI Forth seem to corrupt the system under Classic99, but work fine with Win994a.

 

Which disk functions?

 

 

 

This is what I did:

 

1 DISK-FORMAT

to format a blank disk in DSK2 (no errors)

 

180 DISK_HI !

to set up 2 drives (no error reported)

 

DECIMAL 4 94 2 SMOVE

to copy screens 4 and 5 from DSK1 to DSK2 and I get a disk error message here and many of the non resident words I loaded from the modules at startup stop working from there on. This only happens with Classic 99, but not with Win994a.

 

I actually doubt that 1 FORMAT-DISK works in Classic99. I know that absolutely no screen writing words work in Classic99. This includes SCOPY , SMOVE , FLUSH , etc. Tursi has not yet implemented anything that does sector writes on disk images and, unfortunately, that is how TI Forth handles Forth screens. The sector-write functions don't even try to write to disk. They do nothing but issue disk-error messages. MESS works quite well, however. I think TI994w works, but I had an issue with it recently---don't recall what it was, though.

 

...lee

Link to comment
Share on other sites

Incidentally, some of the disk functions for TI Forth seem to corrupt the system under Classic99, but work fine with Win994a.

 

Which disk functions?

 

 

 

This is what I did:

 

1 DISK-FORMAT

to format a blank disk in DSK2 (no errors)

 

180 DISK_HI !

to set up 2 drives (no error reported)

 

DECIMAL 4 94 2 SMOVE

to copy screens 4 and 5 from DSK1 to DSK2 and I get a disk error message here and many of the non resident words I loaded from the modules at startup stop working from there on. This only happens with Classic 99, but not with Win994a.

 

Format doesn't do anything in Classic99.. I'm not sure but all bets may be off after that? Depends what those disk commands are doing. Classic99 doesn't have a TI disk DSR, so it manages video memory differently than Win994a (nothing to do with the emulator, you'd have the same effect if you didn't have a disk controller in your system and could somehow load files ;) ).

 

That said, Classic99 /does/ have a known issue with copying files under disk managers that I have not tracked down yet - you might be stepping on the same bug.

 

(Ah, and as Lee noted, if you are writing to disk images, that doesn't write today.)

Edited by Tursi
Link to comment
Share on other sites

All...

 

I have put together a TI Forth system disk (which is attached) that has true lower case in all modes and very quickly loads the 64-column editor along with the -DUMP menu option (loads DUMP , .S , VLIST words). To save space (about 250 bytes), the lower-case table for normal text is loaded from screen 41 each time a change of mode requires moving the character pattern table. The attached disk image is 400 KB for use with emulators and nanoPEB/CF7+. If anyone needs a different format, I can do that. I modfied screens 3 (the boot screen), 20, 51, 55 and 56. The system was BSAVEed to screens 21 -- 28 (overwriting the 64-colum editor source screens) and screen 29 (the last 64-column editor source screen) was overwritten with the final welcome screen.

 

Let me know if anything is awry or if you need more info.

 

TIFORTH-64col_ED.zip

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

I've decided I do not like the '@' in the TCHAR table used for the 64-column editor. The first image below has it the way TI (I think) did it and the second one shows my change. These are screen shots of screen 56 in EDIT mode. I also attached the disk image with the change.

 

...lee

 

TIFORTH-64col_ED@.zip

 

post-29677-0-49467600-1331063149_thumb.gif post-29677-0-51902800-1331063150_thumb.gif

Link to comment
Share on other sites

OK, so I tested your disk, and it boots fine and very fast! However, after I format DSK2 with FORMAT-DISK (should be 400k given that DISK_HI is defaulted to 800 at boot up) and transfer screens 4 and 5 with SMOVE, when I try to edit screen 404 I get garbage and TI FORTH indicates that I am in screen 0 when I should be in screen 404.

I'm using Win994a which works flawlessly with the original TI FORTH disk and 90K disks. Any thoughts or am I missing something here?

 

Addendum: Never mind. I was typing EDIT 404 instead of 404 EDIT... Old habits die hard indeed :) I guess I was attempting to edit whatever number was on the stack.

Your disk works perfectly. Thank you for taking the time :)

Edited by Vorticon
Link to comment
Share on other sites

OK, so I tested your disk, and it boots fine and very fast! However, after I format DSK2 with FORMAT-DISK (should be 400k given that DISK_HI is defaulted to 800 at boot up) and transfer screens 4 and 5 with SMOVE, when I try to edit screen 404 I get garbage and TI FORTH indicates that I am in screen 0 when I should be in screen 404.

I'm using Win994a which works flawlessly with the original TI FORTH disk and 90K disks. Any thoughts or am I missing something here?

 

Addendum: Never mind. I was typing EDIT 404 instead of 404 EDIT... Old habits die hard indeed :) I guess I was attempting to edit whatever number was on the stack.

Your disk works perfectly. Thank you for taking the time :)

 

Thank you. I enjoy doing it.

 

***Please note: There is a gotcha, however. I did not modify FORMAT-DISK , DISK-HEAD or FORTH-COPY . They are the original routines, which only manage 90-KB disks. Please see Appendix L of my edition of the TI Forth Instruction Manual. I will work on incorporating my new versions into any more disk images I post. Sorry about that. :woozy: You will not have a problem until you try to edit screens past 489. I probably did not remember to say anything because I almost never used those routines. I almost always used the disk manager for formatting. Again, I apologize for any confusion.

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

OK, so I tested your disk, and it boots fine and very fast! However, after I format DSK2 with FORMAT-DISK (should be 400k given that DISK_HI is defaulted to 800 at boot up) and transfer screens 4 and 5 with SMOVE, when I try to edit screen 404 I get garbage and TI FORTH indicates that I am in screen 0 when I should be in screen 404.

I'm using Win994a which works flawlessly with the original TI FORTH disk and 90K disks. Any thoughts or am I missing something here?

 

Addendum: Never mind. I was typing EDIT 404 instead of 404 EDIT... Old habits die hard indeed :) I guess I was attempting to edit whatever number was on the stack.

Your disk works perfectly. Thank you for taking the time :)

 

Thank you. I enjoy doing it.

 

***Please note: There is a gotcha, however. I did not modify FORMAT-DISK , DISK-HEAD or FORTH-COPY . They are the original routines, which only manage 90-KB disks. Please see Appendix L of my edition of the TI Forth Instruction Manual. I will work on incorporating my new versions into any more disk images I post. Sorry about that. :woozy: You will not have a problem until you try to edit screens past 489. I probably did not remember to say anything because I almost never used those routines. I almost always used the disk manager for formatting. Again, I apologize for any confusion.

 

...lee

 

Ah yes, I remember reading that... I guess I can always use a disk manager to format the disks first... Win994a does have a disk creation utility, but it can only go to 360K (DSDD). Plenty enough in my opinion :)

Link to comment
Share on other sites

OK. Here's a joystick drawing program written in TI Forth. It's pretty useless, except to show bitmap graphics in use in TI Forth. The program is JDRAW and starts on screen 10 of a 400-KB disk image. With your system set up for 2 400-KB disks, the system disk in drive 0 (DSK1) and this one in drive 1 (DSK2), it will be screen 410:

410 LOAD

will get it loaded. Directions are printed to the screen at the end of the load. I will post the code later.

 

FORTH-WORK001.zip

 

...lee

Link to comment
Share on other sites

The disk in the last post might confuse some because it does not have a normally formatted sector 0, i.e., you can't use it with anything but TI Forth to tell what is on it---or, at least, you need a program that does direct sector access. The following disk has the same TI Forth program in screens 10 -- 13 as in the last post, but it has a normal disk header:

 

FORTH-WORK002.zip

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

Here is the TI Forth code for JDRAW, the program in my previous two posts:

 

CR ." LOADing JDRAW---" CR ."   Joystick drawing program..."  
-VDPMODES -GRAPH BASE->R HEX	0 VARIABLE JPEN				
5F VARIABLE JDR 7F VARIABLE JDC : J_INIT GRAPHICS2			
1E SCREEN 1E DCOLOR ! 3800 ' SATR ! 3800 SSDT 1 DMODE !		
F890 A0C0 8000 0000 10 SPCHAR 0000 0000 0000 0000 11 SPCHAR	
0000 0000 0000 0000 12 SPCHAR 0000 0000 0000 0000 13 SPCHAR	
0078 4444 7940 4040 14 SPCHAR 0078 2424 2524 2478 15 SPCHAR	
0000 000E D11F 100E 16 SPCHAR 0000 0016 D910 1010 17 SPCHAR	
0000 0016 1911 1111 18 SPCHAR 0000 000E 010F 110F 19 SPCHAR	
0000 0000 0000 0000 1A SPCHAR 0000 0011 1115 150A 1B SPCHAR	
0038 4444 4554 4834 1C SPCHAR 00FF 0034 2A2A 2A2A 1D SPCHAR	
0000 0011 D111 130D 1E SPCHAR 00FF 001C 223E 201C 1F SPCHAR	
0004 000C 0404 040F 20 SPCHAR 00FF 002C 3222 2222 21 SPCHAR	
0004 041F 0404 0502 22 SPCHAR 00FF 0022 2222 261A 23 SPCHAR	
JDC @ JDR @ F 10 0 SPRITE F D0 8 14 1 SPRITE 1F D0 8 18 2 SPRITE
F D0 08 1C 3 SPRITE 1F D0 8 20 4 SPRITE 2 MAGNIFY ; R->BASE -->
( JDRAW continued...)										  
BASE->R HEX													
: JUP_CUR JPEN @ IF 5 0 SPRCOL ELSE F 0 SPRCOL ENDIF ;		
: JER_CUR F890 A0C0 8000 0000 10 SPCHAR ;					  
: JDR_CUR F8F0 E0C0 8000 0000 10 SPCHAR ;					  
: JMENU F F 1 SPRPUT 1F F 2 SPRPUT F 1F 3 SPRPUT 1F 1F 4 SPRPUT
BEGIN KEY DUP CASE ( Toggle DMODE|JPEN|Quit & leave key)  
	 44 OF DMODE @ 1 XOR DUP DMODE !					  
		  IF JER_CUR ELSE JDR_CUR ENDIF ENDOF			  
	 50 OF JPEN @ 1 XOR JPEN ! JUP_CUR ENDOF			  
	 51 OF ( Just leave 'Q')  ENDOF						
   DROP 0 SWAP ENDCASE ( Leave 0 if illegal key)		  
-DUP UNTIL ( Leave value if legal key)					
5 1 DO 10 0D0 I SPRPUT LOOP ( Hide menu)	;  R->BASE -->
														  
														  
( JDRAW continued...)										  
BASE->R HEX													
: J_DIR ( n1 --- n2 ) ( Change FC|0|4 to -1|0|1)			  
CASE FC OF -1 ENDOF										
	  4 OF 1 ENDOF										
	  0 SWAP ENDCASE  ;  ( illegal|down key)			  
: JLIM ( n1 n2 --- n3 ) SWAP DUP 0< IF DROP DROP 0 ELSE DUP ROT
DUP ROT < IF SWAP DROP ELSE DROP ENDIF ENDIF ;			
: JDRAW J_INIT BEGIN 1 JOYST ROT	( Main program loop)	  
 CASE													  
   FF OF DROP DROP 0 ENDOF								
   12 OF DROP DROP JMENU 51 = ENDOF						
   DROP J_DIR MINUS JDR @ + BF JLIM JDR ! J_DIR JDC @ + FF
	 JLIM JDC ! JDC @ JDR @ 0 SPRPUT					  
	 JPEN @ IF JDC @ JDR @ DOT ENDIF 0 0 ENDCASE		  
 UNTIL TEXT ;							   R->BASE	-->
( JDRAW continued...)										  
." done."		CR CR										
." Type 'JDRAW' to start Joystick Drawing " CR				
." program. The Fire button pops up a menu" CR				
." with 3 options for state of cursor:	" CR				
."   P-en  (tap `P' to toggle pen up|down)" CR				
."		 (pen up=white; down=blue)	  " CR				
."   D-raw (tap `D' to toggle draw|erase) " CR				
."		 (draw=solid; erase=hollow)	 " CR				
."   Q-uit (Quit program)				 " CR CR			  

 

As you can tell, I used sprites for the menu, the setup for which takes up most of the first screen (16 lines X 64 characters).

 

...lee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...