Jump to content
IGNORED

Text Mandelbrot is available for the TI-99/4 now


vol

Recommended Posts

I adjusted a program,  which draws ASCII Mandelbrot, for the TI-99/4A.  Use W=26 (line 250) to get a proper picture on the TI-99/4A.

100 REM A BASIC, ASCII MANDELBROT
110 REM
120 REM THIS IMPLEMENTATION COPYRIGHT (C) 2019, GORDON HENDERSON
130 REM
140 REM PERMISSION TO USE/ABUSE ANYWHERE FOR ANY PURPOSE GRANTED, BUT
150 REM IT COMES WITH NO WARRANTY WHATSOEVER. GOOD LUCK!
160 REM TI-99/4A VARIANT BY LITWR, 2021
164 CALL INIT
168 CALL LOAD(-31840,5,160,131,174,22,2,5,160,131,172,4,91,0,0,0,0)
170 C$ = ".,'~=+:;[/<&?oxOX# " 
175 REM 'PALLET' LIGHTEST TO DARKEST...
180 SO = 1
185 REM SET TO 0 IF YOUR MID$() INDEXES FROM 0.
190 MI = LEN(C$)
200 MX = 4
210 LS = -2.0
220 TP = 1.25
230 XS = 2.5
240 YS = -2.5
250 W = 38
260 H = 21
270 SX = XS / W
280 SY = YS / H
290 CALL LOAD(-31804,131,160)
300 FOR Y = 0 TO H
310   CY = Y * SY + TP
320   FOR X = 0 TO W
330     CX = X * SX + LS
340     ZX = 0
350     ZY = 0
360     CC = SO
370     X2 = ZX * ZX
380     Y2 = ZY * ZY
390     IF CC > MI THEN 460
400     IF (X2 + Y2) > MX THEN 460
410     T = X2 - Y2 + CX
420     ZY = 2 * ZX * ZY + CY
430     ZX = T
440     CC = CC + 1
450     GOTO 370
460     PRINT SEG$(C$, CC - SO, 1);
470   NEXT X
480   PRINT
490 NEXT Y
510 CALL PEEK(-31828,T0,T1,T2,T3)
520 C = W*H*0.04
530 T0 = (T1*65536+T2*256+T3)/60
540 PRINT T0+C
550 CALL KEY(0,A,B)

The TI-99/4A shows that its Basic is rather slow.  All results are here

I have several questions about the TI-99/4A.

1. Is it possible to get a disk directory listing in Basic or Extension Basic?
2. Is it possible to use 32 columns in Basic?

I have used a custom code to sum the number of video interrupts.  However the system sometimes skips these interrupts because it has accesses to video memory quite often.  I had to use a heuristic correction to make the timer value more accurate.  Maybe there is a way to make a system less prone to corrupt its timer?

  • Like 2
Link to comment
Share on other sites



I adjusted a program,  which draws ASCII Mandelbrot, for the TI-99/4A.  Use W=26 (line 250) to get a proper picture on the TI-99/4A.
100 REM A BASIC, ASCII MANDELBROT110 REM120 REM THIS IMPLEMENTATION COPYRIGHT (C) 2019, GORDON HENDERSON130 REM140 REM PERMISSION TO USE/ABUSE ANYWHERE FOR ANY PURPOSE GRANTED, BUT150 REM IT COMES WITH NO WARRANTY WHATSOEVER. GOOD LUCK!160 REM TI-99/4A VARIANT BY LITWR, 2021164 CALL INIT168 CALL LOAD(-31840,5,160,131,174,22,2,5,160,131,172,4,91,0,0,0,0)170 C$ = ".,'~=+:;[/175 REM 'PALLET' LIGHTEST TO DARKEST...180 SO = 1185 REM SET TO 0 IF YOUR MID$() INDEXES FROM 0.190 MI = LEN(C$)200 MX = 4210 LS = -2.0220 TP = 1.25230 XS = 2.5240 YS = -2.5250 W = 38260 H = 21270 SX = XS / W280 SY = YS / H290 CALL LOAD(-31804,131,160)300 FOR Y = 0 TO H310   CY = Y * SY + TP320   FOR X = 0 TO W330     CX = X * SX + LS340     ZX = 0350     ZY = 0360     CC = SO370     X2 = ZX * ZX380     Y2 = ZY * ZY390     IF CC > MI THEN 460400     IF (X2 + Y2) > MX THEN 460410     T = X2 - Y2 + CX420     ZY = 2 * ZX * ZY + CY430     ZX = T440     CC = CC + 1450     GOTO 370460     PRINT SEG$(C$, CC - SO, 1);470   NEXT X480   PRINT490 NEXT Y510 CALL PEEK(-31828,T0,T1,T2,T3)520 C = W*H*0.04530 T0 = (T1*65536+T2*256+T3)/60540 PRINT T0+C550 CALL KEY(0,A,B)

The TI-99/4A shows that its Basic is rather slow.  All results are here
I have several questions about the TI-99/4A.
1. Is it possible to get a disk directory listing in Basic or Extension Basic?
2. Is it possible to use 32 columns in Basic?
I have used a custom code to sum the number of video interrupts.  However the system sometimes skips these interrupts because it has accesses to video memory quite often.  I had to use a heuristic correction to make the timer value more accurate.  Maybe there is a way to make a system less prone to corrupt its timer?



1 - yes but you have to type in a program or load it from disk the program is in the disk controller manual which is on ftp.whtech.com if you don't have it

2 - basic is 32 col you can access 40 col mode with t40 by senior falcon here in aa check development resources

Sent from my LM-V600 using Tapatalk

  • Like 1
Link to comment
Share on other sites

47 minutes ago, arcadeshopper said:


 

 


1 - yes but you have to type in a program or load it from disk the program is in the disk controller manual which is on ftp.whtech.com if you don't have it

2 - basic is 32 col you can access 40 col mode with t40 by senior falcon here in aa check development resources

Sent from my LM-V600 using Tapatalk
 

 

Thank you very much.  But Basic does not allow the use of the two outermost columns on the left and right.  XB manual has even a phrase about the DISPLAY AT statement "Columns are numbered 1 through 28".  The Atari 800 or MSX computers also disable their outermost columns in Basic by default but it is easy to enable them on these systems.  So I am seeking for a way to enable all 32 columns for PRINT, LIST, etc.  I want to print Mandelbrot with W=30. :)

Edited by vol
Link to comment
Share on other sites

Thank you very much.  But Basic does not allow the use of the two outermost columns on the left and right.  XB manual has even a phrase about the DISPLAY AT statement "Columns are numbered 1 through 28".  The Atari 800 or MSX computers also disable their outermost columns in Basic by default but it is easy to enable them on these systems.  So I am seeking for a way to enable all 32 columns for PRINT, LIST, etc.  I want to print Mandelbrot with W=30. [emoji4]
Try xb gem? Or t40

Sent from my LM-V600 using Tapatalk

Link to comment
Share on other sites

3 hours ago, vol said:

Thank you very much.  But Basic does not allow the use of the two outermost columns on the left and right.  XB manual has even a phrase about the DISPLAY AT statement "Columns are numbered 1 through 28".  The Atari 800 or MSX computers also disable their outermost columns in Basic by default but it is easy to enable them on these systems.  So I am seeking for a way to enable all 32 columns for PRINT, LIST, etc.  I want to print Mandelbrot with W=30. :)

Like Mizapf suggests, the only way to access the extra four columns in BASIC is using CALL HCHAR or CALL VCHAR...

 

as for the interrupts - scrolling takes numerous frames in BASIC, and no interrupts occur during that. Most other operations should be fast enough.

Link to comment
Share on other sites

19 minutes ago, mizapf said:

Would CALL HCHAR(x,y,c) be an option (to write the character c at the given position x,y)?

No, because I want to use the same Basic code with different platforms. I also want to use only standard Basic.

15 minutes ago, Tursi said:

as for the interrupts - scrolling takes numerous frames in BASIC, and no interrupts occur during that. Most other operations should be fast enough.

It is not so that easy.  I have found out that it is not only about scrolling, the dependency is more difficult.  In the Basic text above I had to add a compensating constant for every iteration, even if this iteration doesn't cause vertical scrolling.  IMHO floating point routines can stop interrupts too.

Link to comment
Share on other sites

31 minutes ago, vol said:

No, because I want to use the same Basic code with different platforms. I also want to use only standard Basic.

 

You may run into some serious issues with TI BASIC then, as it is one of the very few machines that coded their BASIC to the ANSI Standard dialect, as opposed to the Microsoft BASIC dialects used by almost every other machine out there. There are a lot of similarities, but there are places where the ANSI approach is a bit different.

 

Without using the solution @mizapf suggested, you are pretty much doomed to a 28 column display on the TI when using only the standard BASIC command set. There are no easy tricks to open up the other four columns. There are lots of ways to do this using some of the extensions to TI BASIC. XB256, XB GEM, and T40 have all been mentioned as possible ways around the limitation.

  • Like 2
Link to comment
Share on other sites

Basic Disk directory program

 

100 CALL CLEAR
110 DIM TYPE$(5)
120 TYPE$(1)="DIS/FIX"
130 TYPE$(2)="DIS/VAR"
140 TYPE$(3)="INT/FIX"
150 TYPE$(4)="INT/VAR"
160 TYPE$(5)="PROGRAM"
170 DISPLAY "DIRECTORY DISPLAY": : :
180 INPUT "MASTER DISK[1-3]?":M
190 M=INT(M)
200 IF M<1 THEN 180
210 IF M>3 THEN 180
220 OPEN #1:"DSK"&STR$(M)&".",INPUT ,RELATIVE,INTERNAL
230 INPUT #1:A$,A,J,K
240 DISPLAY "DSK";STR$(M);"-DISKNAME=";A$:"AVAILABLE=";K;"USED=";J-K: :
250 DISPLAY " FILENAME  SIZE    TYPE    P"
260 DISPLAY "---------- ---- ---------- -"
270 FOR LOOP=1 TO 127
280 INPUT #1:A$,A,J,K
290 IF LEN(A$)=0 THEN 370
300 DISPLAY :A$;TAB(12);J;TAB(17);TYPE$(ABS(A));
310 IF ABS(A)=5 THEN 340
320 B$=" "&STR$(K)
330 DISPLAY SEG$(B$,LEN(B$)-2,3);
340 IF A>0 THEN 360
350 DISPLAY TAB(28);"Y";
360 NEXT LOOP
370 CLOSE #1
380 END

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, vol said:

No, because I want to use the same Basic code with different platforms. I also want to use only standard Basic.

It is not so that easy.  I have found out that it is not only about scrolling, the dependency is more difficult.  In the Basic text above I had to add a compensating constant for every iteration, even if this iteration doesn't cause vertical scrolling.  IMHO floating point routines can stop interrupts too.

It's true, /any/ instruction /can/ stop interrupts. Interrupts are only checked between GPL instructions - it's a polling architecture.

 

But if you already have custom assembly code for timing, why the resistance to meeting your other goals? You could also time with the 9901 instead, but given the speed of TI BASIC, most people aren't concerned about millisecond accuracy. ;)

 

 

  • Like 1
Link to comment
Share on other sites

9 hours ago, vol said:

The TI-99/4A shows that its Basic is rather slow.  All results are here

Since you're using Classic99, you can also time with the real time clock...

 

90 OPEN #1:"CLOCK",INPUT
95 INPUT #1:A$,A$,START$
...
542 INPUT #1:A$,A$,END$
544 PRINT START$:END$

Calculating the delta is left as an exercise for the reader, but the clock won't slip ;)

 

  • Like 2
Link to comment
Share on other sites

9 hours ago, vol said:

1. Is it possible to get a disk directory listing in Basic or Extension Basic?

 

 

If you have a Myarc Controller (DDCC-1 or HFDC), you can do a CALL DIR(1) for a listing of DSK1.

 

And if you have a Rich Extended Basic Cartridge (RXB), you can do a CALL CAT(1) or CALL CAT("DSK1.")

 

 

 

 

  • Like 1
Link to comment
Share on other sites

8 hours ago, vol said:

Thank you very much.  But Basic does not allow the use of the two outermost columns on the left and right.  XB manual has even a phrase about the DISPLAY AT statement "Columns are numbered 1 through 28".  The Atari 800 or MSX computers also disable their outermost columns in Basic by default but it is easy to enable them on these systems.  So I am seeking for a way to enable all 32 columns for PRINT, LIST, etc.  I want to print Mandelbrot with W=30. :)

RXB has built in commands CALL HCHAR(row,column,character,repetition,row,column,character,repetion[,...]) unlike XB.

or use CALL HPUT(row,column,string,row,column,variable[,...])  this is better then DISPLAY AT(row,column) as it uses entire screen.

 

A added new feature to RXB 2020 is SIZE or from a program CALL SIZE:

RXB 2020 SIZE FIXED - YouTube

 

 

  • Like 1
Link to comment
Share on other sites

13 minutes ago, TheBF said:

Does anybody know why TI decided to limit the text width to less than the screen width?

Seems weird.

At the time the TI99 was using TV screens and most would not correctly display far left and right side of screens as even old TV shows 

had a tendency to slightly warped. Shows from the 1950s for example the left and right edge were kind of warped with screen screens.

Some screens were taller then wide especially outside the USA, the USA was mostly square screens.

Vintage old 1950's Westinghouse 17" Lynwood Television TV Commercial 1950 - Bing video

  • Like 5
Link to comment
Share on other sites

Yes, I think I remember that the outermost columns were sometimes too close to the edge of the visible screen, and I had two knobs at the rear of the TV set to control the width and height of the picture - of course, for all programs, not for single ones. So if you reduced the width, other programs may not have filled the screen.

 

P.S.: Still remember when you moved your hand over the CRT to collect static electricity, and then give someone else a shock? ;-) Feels like decades ago. OK, it was some decades ago.

Edited by mizapf
  • Like 4
  • Haha 2
  • Sad 1
Link to comment
Share on other sites

 

2 hours ago, RXB said:

At the time the TI99 was using TV screens and most would not correctly display far left and right side of screens as even old TV shows 

had a tendency to slightly warped. Shows from the 1950s for example the left and right edge were kind of warped with screen screens.

Some screens were taller then wide especially outside the USA, the USA was mostly square screens.

Vintage old 1950's Westinghouse 17" Lynwood Television TV Commercial 1950 - Bing video

LOL. I should have known that.  The television system was designed so that the picture was "over-scanned" in the home TV ie: cropped.

In the studio we always set the monitors to underscan so the director could see edge to edge.  But home TVs were purposely cropped on all sides.

With CRT's in the home it was really hard to know how wide the image at home would actually be set since it was analog electromagnetism that controlled it.

And the top of the screen was specified to be made invisible at home to hide the vertical retrace of the cathode ray, driven my very poor slew rate tube amplifiers. :) 

Not sure what TVs the line below is referring to in the 1930s unless they were in a lab somewhere. ?

 

Thanks for the reminder about the "good old days" Rich.

 

"Overscan is a behaviour in certain television sets, in which part of the input picture is shown outside of the visible bounds of the screen. It exists because cathode-ray tube (CRT) television sets from the 1930s through to the early 2000s were highly variable in how the video image was positioned within the borders of the screen. It then became common practice to have video signals with black edges around the picture, which the television was meant to discard in this way."

Wikipedia

  • Like 3
Link to comment
Share on other sites

13 hours ago, Tursi said:

But if you already have custom assembly code for timing, why the resistance to meeting your other goals? You could also time with the 9901 instead, but given the speed of TI BASIC, most people aren't concerned about millisecond accuracy. ;)

Sorry, I don't like my code for handling the timer.  My heuristic is not very good. :( So thank you very much about mentioning the TMS9901.  I have just checked documentation and found out that the timer has only 14 bits and it decrements at 46875 Hz rate. This gives us a maximum interval of just 0.35 seconds. It is too little.  :( Maybe I am wrong on these details.  Any help is welcome.

Edited by vol
Link to comment
Share on other sites

1 hour ago, Tursi said:

Yeah, TI was obsessed with standards on the home computer, so they honored the "safe text area" for PRINT :)

 

They could have offered a way to use a larger area.  The Atari 800 has a POKE for this.

Edited by vol
Link to comment
Share on other sites

2 hours ago, vol said:

They could have offered a way to use a larger area.  The Atari 800 has a POKE for this.

ANSI BASIC didn't define a screen size poke. :)

 

TI wasn't interested in opening up anything at all on the machine... we all spent our youths wishing for such things, you're just learning it now! You're lucky you decided to use /Extended/ BASIC. Regular BASIC is slower still and doesn't even have CALL LOAD. ;)

 

As for the timer, 0.35 seconds is enough time for /one/ instruction to finish - even the screen scroll is faster than that. Just have your interrupt routine read the timer to determine how long elapsed, instead of assuming it was 1/60th of a second.

 

But using the CLOCK is still the simplest.

 

Link to comment
Share on other sites

8 hours ago, Tursi said:

ANSI BASIC didn't define a screen size poke. :)

 

TI wasn't interested in opening up anything at all on the machine... we all spent our youths wishing for such things, you're just learning it now! You're lucky you decided to use /Extended/ BASIC. Regular BASIC is slower still and doesn't even have CALL LOAD. ;)

 

As for the timer, 0.35 seconds is enough time for /one/ instruction to finish - even the screen scroll is faster than that. Just have your interrupt routine read the timer to determine how long elapsed, instead of assuming it was 1/60th of a second.

 

But using the CLOCK is still the simplest.

 

Thank you very much.  I have just made code which uses interrupt calls to check the 9901 timer.  It works perfectly. :) Just replace the next lines in the text above.

162 CALL INIT
164 CALL LOAD(-20480,96,130,200,2,131,172,200,2,131,174,4,204,29,0,2,2,63,255,200,2,131,170,5,204,51,130,6,76,30,0,2,2)
165 CALL LOAD(-20448,177,0,200,2,131,196,4,91)
166 CALL LOAD(-20224,4,204,29,0,55,194,30,0,9,18,195,32,131,170,200,2,131,170,99,2,2,76,63,255,168,12,131,174,23,2,5,160)
167 CALL LOAD(-20192,131,172,4,91)

290 CALL LOAD(-31804,176,0)

520 CALL LOAD(-31804,0)
530 PRINT ((T0*256+T1)*65536+T2*256+T3)/3000000*64

It is interesting that the standard TI Basic (+Editor/Assembler cartridge) is noticeably faster than Extended Basic.  I have gotten the next results

 

     d7,1   691     TI-99/4A + Editor/Assembler cartridge (Classic99 emu)
     d7,1   774     TI-99/4A + Extended Basic cartridge (Classic99 emu)

 

I  tried to use 't40xb' utility but it doesn't also allow to use 2 edge columns for PRINT. :( 

  • Like 1
Link to comment
Share on other sites

5 hours ago, vol said:

Thank you very much.  I have just made code which uses interrupt calls to check the 9901 timer.  It works perfectly. :) Just replace the next lines in the text above.


162 CALL INIT
164 CALL LOAD(-20480,96,130,200,2,131,172,200,2,131,174,4,204,29,0,2,2,63,255,200,2,131,170,5,204,51,130,6,76,30,0,2,2)
165 CALL LOAD(-20448,177,0,200,2,131,196,4,91)
166 CALL LOAD(-20224,4,204,29,0,55,194,30,0,9,18,195,32,131,170,200,2,131,170,99,2,2,76,63,255,168,12,131,174,23,2,5,160)
167 CALL LOAD(-20192,131,172,4,91)

290 CALL LOAD(-31804,176,0)

520 CALL LOAD(-31804,0)
530 PRINT ((T0*256+T1)*65536+T2*256+T3)/3000000*64

It is interesting that the standard TI Basic (+Editor/Assembler cartridge) is noticeably faster than Extended Basic.  I have gotten the next results

 

     d7,1   691     TI-99/4A + Editor/Assembler cartridge (Classic99 emu)
     d7,1   774     TI-99/4A + Extended Basic cartridge (Classic99 emu)

 

I  tried to use 't40xb' utility but it doesn't also allow to use 2 edge columns for PRINT. :( 

I am curious. Do you use the interrupt to poll the timer and accumulate in a memory location?

 

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...