Jump to content

Photo

TI 99/4A interfacing


208 replies to this topic

#201 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

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

Posted Thu Nov 1, 2018 4:43 PM

I need to compare it to the Bresenham algorithm.  Although recursion is pretty cheap in Forth it ain't free.

 

Take a look at my fbForth 2.0 primitive for LINE in bitmap graphics mode, which uses an integer, no-divide version of the Bresenham line algorithm:

Spoiler

As I recall, I had a fair amount of help from Tursi on this.  There is a fair discussion somewhere in the fbForth thread (see below in my signature) at the time I was converting all of the graphics primitives from TI Forth to ALC for fbForth 2.0 before I first released the cartridge a few years ago.  You should have all of the source code.  The graphics primitives are in Bank 1 file, fbForth104_GraphicsPrimitives.a99.

 

...lee



#202 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 792 posts
  • Location:The Great White North

Posted Thu Nov 1, 2018 5:49 PM

Wow!.  What a gold mine. I need to get into Graphics II mode as well to have a test platform for the plotter.

 

You are THE man.  

 

Thanks



#203 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

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

Posted Thu Nov 1, 2018 6:45 PM

Wow!.  What a gold mine. I need to get into Graphics II mode as well to have a test platform for the plotter.

 

You are THE man.  

 

Thanks

 

You are more than welcome.

 

Besides straight-up Graphics2 mode, fbForth 2.0 (and TI Forth before it) has two hybrid modes that have bitmap graphics for part of the screen and text for the remainder:

  • Split mode has bitmap graphics in the top 2/3 of the screen and 8 lines of text in the bottom 1/3.  This is used for the 64-column editor.
  • Split2 mode has 4 lines of text in the top 1/6 of the screen and bitmap graphics in the bottom 5/6.

The split modes are ideal for testing bitmap graphics coding.

 

...lee



#204 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 792 posts
  • Location:The Great White North

Posted Thu Nov 1, 2018 7:47 PM

Yes I remember being very fond of the 64 column editor with the split screen.  It was a windowed environment on a TI-99!

 

I will look into those split modes.  For debugging it will be ideal for sure.

 

  I found my old binder with my BLOCK listings and I wrote an Indexer way back then so It even has the index at the beginning.  :)

 

I am going to use the Forth code as starting point see how far I get. These modes are foreign to me.  Bit of a learning curve.

When I look at your ALC for DOT it's not obvious yet what's going on. More staring required.



#205 FarmerPotato OFFLINE  

FarmerPotato

    Chopper Commander

  • 146 posts
  • Location:Austin, TX

Posted Fri Nov 2, 2018 12:28 PM

this probably belongs on a separate thread...

 

 

You are more than welcome.

 

Besides straight-up Graphics2 mode, fbForth 2.0 (and TI Forth before it) has two hybrid modes that have bitmap graphics for part of the screen and text for the remainder:

  • Split mode has bitmap graphics in the top 2/3 of the screen and 8 lines of text in the bottom 1/3.  This is used for the 64-column editor.
  • Split2 mode has 4 lines of text in the top 1/6 of the screen and bitmap graphics in the bottom 5/6.

The split modes are ideal for testing bitmap graphics coding.

 

...lee

I don't remember split2! split was fascinating and caused me to ponder all the ways bitmap mode could be exploited.

 

I put a lot of effort into implementing a split mode with 18 rows of graphics and 6 rows of proportionally spaced bitmapped text (A/L library, not FORTH.) It squeezed about 42 characters on each line.

 

It computed a width table for patterns after loading CHARA1. It kept a 2 char (16 byte) working pattern buffer in ram, and each character to emit would be bit shifted and ORed with the buffer, which would be then be sent to VDP.  When the right bytes were touched, the buffer would move the right char into the left and refresh.

 

It will be in my bag o stuff to show at CHI Friday.



#206 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 792 posts
  • Location:The Great White North

Posted Sat Nov 3, 2018 4:05 PM

I put together a test platform for myself for the Plotter control project and I realized that it could be a console for Vorticon's plotter control language.

It's not fancy but it let's me code some demos and get a solid platform upon which to build.

The sprite here will be simply following the progress of the plotter pen so it doesn't need to be too fast.

 

But even with this simple code the beauty of having a build-in interpreter can be demonstrated.

 

Here is the script that is interpreted as the BOXDEMO. 

\ interpreting drawing commands
 CLEAR
\ size  y  x
\ ----------------
   10  20 20  BOX
   20  20 20  BOX
   30  20 20  BOX
   40  20 20  BOX
   50  20 20  BOX
   60  20 20  BOX
   70  20 20  BOX
   80  20 20  BOX
   90  20 20  BOX
  100  20 20  BOX
  110  20 20  BOX
  120  20 20  BOX

And here are the user API commands so far. They could be enhanced with more error checking but this is a first cut.

 

The plan is to  get the turtle commands into the set as well.

 

And of course the commands will also need to have the plotter driver control added to them. That is not to tricky with concatenative languages.

: PEN-UP   ( -- )   1 CURSOR SP.COLOR ;
: PEN-DOWN ( -- ) RED CURSOR SP.COLOR ;
: MOVETO   ( y x -- ) PEN-UP   (X,Y) LINE .XY ;
: LINETO   ( y x -- ) PEN-DOWN (X,Y) LINE .XY ;
: HOME     ( -- ) 0 0 MOVETO ;
: RIGHT    ( n -- ) (X,Y)  >R +   0 255 CLIP  R>  LINETO ;
: LEFT     ( n -- ) NEGATE RIGHT ;
: DOWN     ( n -- ) (X,Y) ROT +  0 192 CLIP LINETO ;
: UP       ( n -- ) (X,Y) ROT -  0 192 CLIP LINETO ;

: BOX  ( size y x -- )
       DEPTH 3 < ABORT" BOX args"
       MOVETO
       DUP RIGHT
       DUP DOWN
       DUP LEFT
           UP
;

So when I have a something that I think can drive the plotter we can test the box demo as a first venture.

I have never done anything with graphics generation so I am in over my head but it's interesting.

Attached Files


Edited by TheBF, Sat Nov 3, 2018 10:00 PM.


#207 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,395 posts
  • Location:Eagan, MN, USA

Posted Sat Nov 3, 2018 6:33 PM

I put together a test platform for myself for the Plotter control project and I realized that it could be a console for Vorticon's plotter control language.

It's not fancy but it let's me code some demos and get a solid platform upon which to build.

The sprite here will be simply following the progress of the plotter pen so it doesn't need to be too fast.

 

But even with this simple code the beauty of having a build-in interpreter can be demonstrated.

 

Here is the script that is interpreted as the BOXDEMO. 

\ interpreting drawing commands
 CLEAR
\ size  y  x
\ ----------------
   10  20 20  BOX
   20  20 20  BOX
   30  20 20  BOX
   40  20 20  BOX
   50  20 20  BOX
   60  20 20  BOX
   70  20 20  BOX
   80  20 20  BOX
   90  20 20  BOX
  100  20 20  BOX
  110  20 20  BOX
  120  20 20  BOX

And here are the user API commands so far. They could be enhanced with more error checking but this is a first cut.

 

The plan is to  get the turtle commands into the set as well.

 

And of course the commands will also need to have the plotter driver control added to them. That is not to tricky with concatenative languages.

: PEN-UP   ( -- )   1 CURSOR SP.COLOR ;
: PEN-DOWN ( -- ) RED CURSOR SP.COLOR ;
: MOVETO   ( y x -- ) PEN-UP   (X,Y) LINE .XY ;
: LINETO   ( y x -- ) PEN-DOWN (X,Y) LINE .XY ;
: HOME     ( -- ) 0 0 MOVETO ;
: RIGHT    ( n -- ) (X,Y)  >R +   0 255 CLIP  R>  LINETO ;
: LEFT     ( n -- ) NEGATE RIGHT ;
: DOWN     ( n -- ) (X,Y) ROT +  0 192 CLIP LINETO ;
: UP       ( n -- ) (X,Y) ROT -  0 192 CLIP LINETO ;

: BOX  ( size y x -- )
       DEPTH 2 < ABORT" BOX args"
       MOVETO
       DUP RIGHT
       DUP DOWN
       DUP LEFT
           UP
;

So when I have a something that I think can drive the plotter we can test the box demo as a first venture.

I have never done anything with graphics generation so I am in over my head but it's interesting.

 

 

 

 

Nice! This is exactly what I was envisioning for the plotter control program in Forth. 



#208 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,395 posts
  • Location:Eagan, MN, USA

Posted Sat Nov 3, 2018 6:36 PM

Yes I remember being very fond of the 64 column editor with the split screen.  It was a windowed environment on a TI-99!

 

I will look into those split modes.  For debugging it will be ideal for sure.

 

  I found my old binder with my BLOCK listings and I wrote an Indexer way back then so It even has the index at the beginning.  :)

 

I am going to use the Forth code as starting point see how far I get. These modes are foreign to me.  Bit of a learning curve.

When I look at your ALC for DOT it's not obvious yet what's going on. More staring required.

 

I used this split mode when I programmed Core War in TI Forth, the granddaddy of FbForth :)

 



#209 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 792 posts
  • Location:The Great White North

Posted Sun Nov 4, 2018 7:59 PM

I got the mini LOGO words working with a sprite so that give me the rest of the hi-level platform.

This was written in Forth for a tiny machine and it used single letter names for things. So this is pretty big re-write, but I was grateful for the head start.

You can see the author working here:  https://blogs.msdn.m...-the-fignition/

 

It has a 6 degree resolution for angles from what I can understand ie: 15 TURN changes by 90 degrees, but it will be fine for a test platform.

 

I put some place holders in the code where the plotter control will go.

The spoiler has the code.  The movie runs the demo.

 

1 step closer. I gotta stop for a while :-\

 

Spoiler

Attached Files


Edited by TheBF, Sun Nov 4, 2018 8:07 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users