Planning a PLATOTerm port for the Atari ST, some questions.

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Sat Aug 18, 2018 9:57 pm

Hello, everyone.

Now that there have been ports of PLATOTerm for the Atari 8-bit, Apple ][, Commodore 64, Commodore 128, and TI 99/4A that work to a usable point, I am starting to turn my attention to writing the 16-bit versions of PLATOTerm, and starting with the Atari ST, but I have some things that need to be thought through:

Particularly, the 16-bit machines all have windowing systems, adding in window borders, to an already cramped amount of screen resolution, e.g. 640x200, 640x400, etc. PLATO requires that everything fit nicely on one screen, the user interface is designed around this assumption, so the simple act of having a text area that scrolls (PLATO does not scroll, at all.) simply will not fly here, everything has to fit, and when you have various window controls taking precious screen area, this can become a problem, so ideally, the program would be a full screen application. What's the best way to do this, that works on all systems? Can I realistically take over the screen, and center my drawing into the display, if needed?

I currently have PureC set up in an ST environment, but I am curious if there are other environments that can produce a fairly compatible TOS binary? (I do not consider MiNT to be a compatible solution, I want this to run on all STs)

-Thom

joska
Hardware Guru
Hardware Guru
Posts: 4148
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby joska » Sat Aug 18, 2018 10:51 pm

tschak909 wrote:I currently have PureC set up in an ST environment, but I am curious if there are other environments that can produce a fairly compatible TOS binary? (I do not consider MiNT to be a compatible solution, I want this to run on all STs)


Not sure what you mean. MiNT is a TOS replacement and has nothing to do with what the compiler generates. If you run PureC under TOS or MiNT it will generate the exact same binary. If you by "MiNT" actually means gcc, then gcc will also produce TOS-compatible binaries as long as you don't explicitly use MiNT-only features. gcc (or MiNTlib to be exact) do tend to produce really, really big binaries though.

tschak909 wrote:the program would be a full screen application. What's the best way to do this, that works on all systems? Can I realistically take over the screen, and center my drawing into the display, if needed?


There is no really clean way to do this that works everywhere. I suggest you take a look at zView though, it has a fullscreen mode that seems to work everywhere.

https://sourceforge.net/p/z-tools/code/ ... unk/zview/
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Sat Aug 18, 2018 11:07 pm

Oh wow. Thank you so much! This is very helpful.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1748
Joined: Sun Jul 31, 2011 1:11 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby Eero Tamminen » Sun Aug 19, 2018 8:22 pm

By using a minimal C-library instead MiNTlib, one can get small binaries also with GCC.

GCC can produce significantly faster code than something ancient like Pure-C, and it has also much better error checking & reporting than Pure-C (many of the optimization passes rely on code correctness, old compilers that don't do such extensive optimizations are more forgiving).

Those optimization passes make the compilation very slow though, and they take a lot of memory too. Because of this, many people do development nowadays using cross-compilation, and do most of testing on emulators. Only releases are tested on real devices.

joska
Hardware Guru
Hardware Guru
Posts: 4148
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby joska » Sun Aug 19, 2018 8:35 pm

It's a lot more fun to actually *use* the Atari though. Using cross compilers and emulators is - IMHO - not much fun. Maybe more productive, but not in my case as it would bore me to death pretty quickly.

tschak909 wrote:Particularly, the 16-bit machines all have windowing systems, adding in window borders, to an already cramped amount of screen resolution, e.g. 640x200, 640x400, etc. PLATO requires that everything fit nicely on one screen, the user interface is designed around this assumption, so the simple act of having a text area that scrolls (PLATO does not scroll, at all.) simply will not fly here, everything has to fit, and when you have various window controls taking precious screen area, this can become a problem, so ideally, the program would be a full screen application


Just a though - PLATOTerm exists for even the C64 which has a lot smaller screen than an ST. Why does it have to be fullscreen? Can't you just use a smaller font?
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Sun Aug 19, 2018 9:10 pm

Welcome!

tschak909 wrote:Particularly, the 16-bit machines all have windowing systems, adding in window borders, to an already cramped amount of screen resolution, e.g. 640x200, 640x400, etc. PLATO requires that everything fit nicely on one screen, the user interface is designed around this assumption, so the simple act of having a text area that scrolls (PLATO does not scroll, at all.) simply will not fly here, everything has to fit, and when you have various window controls taking precious screen area, this can become a problem, so ideally, the program would be a full screen application. What's the best way to do this, that works on all systems? Can I realistically take over the screen, and center my drawing into the display, if needed?


Three choices:

1) Make it scrollable. OK, you ruled that one out.
2) Put it in a GEM window with normal borders, and use a font that’s a bit smaller than the original one. You’ll achieve 80x25 within the window viewport.
3) If scrolling back is not an option at all (how do you go back in the scroll buffer then? Sorry, I’ve never seen PLATOterm), then open a GEM window with just a title bar and no scrollbar. This is not the best solution.

Why a GEM window? If you write it directly onto the screen, it’ll mess up multitasking solutions (Geneva, MagiC, MiNT, MultiGEM) and even on plain STs you’ll run into trouble with accessories.

Go for (2), and all owners of Overscan, LaceScan, Falcons, graphics cards, Milans etc.pp. will be thankful.

tschak909 wrote:I currently have PureC set up in an ST environment, but I am curious if there are other environments that can produce a fairly compatible TOS binary? (I do not consider MiNT to be a compatible solution, I want this to run on all STs)


MiNT is compatible as long as you don’t want to mess with dirty system variables or the like. But if you’re forced to do that, your program will run only on a relatively small fraction of target machines. It is advisable to do clean GEM programming, so that the software runs on MegaSTE, TT, Falcon, Milan, MagiCMac, MiNT, graphics cards, Overscan, LaceScan ... all that will be dealt with if you use clean XBIOS, GEMDOS, VDI and AES calls.

Hint: if doing a terminal program, have a look at the documentation of HSMODA (HSMOD07). It offers better, faster and bugfree serial routines, either for the built-in standard RS232 ports of each machine, or even for additional ones. Not all ST owners run this software, but a lot of these who want to go beyond 57600bps.

PureC is a good option. Perhaps exchange the standard libraries by more modern ones, and definitely the startup code by another one (the one from the Behne brothers is recommended, authors of NVDI.)

If you’re new to the ST, I can recommend three books especially:

1) AtarI ST/TT Profibuch (Jankowski/Rabich/Reschke) - www.dev-docs.org -> Out of print manuals -> ATARI Profibuch ST-STE-TT (Rev 11, Public Domain) [1992] - Good general overview (German)
2) Vom Anfänger zum GEM-Profi (Geiß/Geiß) - www.dev-docs.org-> Out of print manuals -> Vom Anfanger zum GEM-Profi (DE) [1991] - Very good introduction into clean programming with VDI and AES
3) Atari Compendium (English) - www.dev-docs.org-> Out of print manuals -> The Atari Compendium – Good general overview (English)

- renewed & improved PureC startup code by Behne&Behne

and the abovementioned&linked HSMODA.

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Mon Aug 20, 2018 12:18 am

The terminal is NOT a VT-100 or similar text terminal. Think of it something closer to a Tektronix 4014, where you have no scrolling and everything is drawn on a single screen, with the ability to clear the screen, or parts of the screen. As it is, right now, I am having to scale the original PLATO display from 512x512 to e.g. 512x384 for ST mono, 512x192 for medium res, or 320x192 for low res, and am drawing three different fonts for each (8x12, 8x6, and 5x6). I am also using an image scaling routine that I use in my other versions of the terminal to scale downloadable character sets into each of those targets.

Some examples of PLATO output:

PTERM on modern hardware: (512x512 scaled up)
Image

PLATOTerm on Commodore 64 (320x192, last 8 pix not used)
Image

PLATOTerm on Apple II (256x192, centered on X)
Image

Atari 800 (320x192)
Image

If I add in window controls to the screen, my scaling no longer is proportional, and this will have a drastic effect on the quality of the overall output.

The zview code that was pointed to earlier seems to be a good solution, at least for a first pass.

-Thom

derkom
Atari User
Atari User
Posts: 40
Joined: Fri Jul 20, 2018 10:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby derkom » Mon Aug 20, 2018 6:30 am

I notice the Atari 8-bit version is the only one that is the proper colour. :mrgreen:

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Mon Aug 20, 2018 7:46 pm

tschak909 wrote:The terminal is NOT a VT-100 or similar text terminal. Think of it something closer to a Tektronix 4014, where you have no scrolling and everything is drawn on a single screen, with the ability to clear the screen, or parts of the screen. As it is, right now, I am having to scale the original PLATO display from 512x512 to e.g. 512x384 for ST mono, 512x192 for medium res, or 320x192 for low res, and am drawing three different fonts for each (8x12, 8x6, and 5x6). I am also using an image scaling routine that I use in my other versions of the terminal to scale downloadable character sets into each of those targets.


Thanks for your explanation. That sounds like a perfect example of what VDI was built for: to output a given set of graphics to different targets. Nowadays you would call it “responsive” :-) 512x512 is available on some STs and many “newer” systems.

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Mon Aug 20, 2018 7:57 pm

My plan is:

If the display is ST High, display 8x12 font to a full screen 512x384 display, centered.
If the display is ST Medium, display 8x6 font to a full screen 512x192 display, centered.
If the display is ST Low, display 5x6 font to a full screen 320x192 display, centered.
If the display is anything bigger than 512x512 (e.g. TT Mono), display in a window at 512x512 with 8x16 font.

(I have written the necessary scaling routines to make it look correct, which is needed because of the unique nature of the PLATO display, but also, native device independent scaling only seems to be available under certain installations of GEM.)

-Thom

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Mon Aug 20, 2018 8:39 pm

tschak909 wrote:If the display is ST High, display 8x12 font to a full screen 512x384 display, centered.
If the display is ST Medium, display 8x6 font to a full screen 512x192 display, centered.
If the display is ST Low, display 5x6 font to a full screen 320x192 display, centered.
If the display is anything bigger than 512x512 (e.g. TT Mono), display in a window at 512x512 with 8x16 font.

(I have written the necessary scaling routines to make it look correct, which is needed because of the unique nature of the PLATO display, but also, native device independent scaling only seems to be available under certain installations of GEM.)


Sounds reasonable (and you’d query the VDI to get the resolution, right, not the XBIOS?), but what do you mean with your last sentence?

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Mon Aug 20, 2018 8:58 pm

Yes, VDI. sorry, :)

As for my last sentence, I am talking about the fact that only NVDI seems to have a facility to e.g. blit from an off-screen bitmap, scaling downward as needed. This is ultimately a show stopper for scaling cleanly to a window with its dials, in lower resolutions.

-Thom

User avatar
Gaiyan
Hardware Guru
Hardware Guru
Posts: 337
Joined: Tue Jun 29, 2004 3:39 pm
Contact:

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby Gaiyan » Tue Aug 21, 2018 6:20 pm

Very interesting project! PLATO was/is awesome.

derkom wrote:I notice the Atari 8-bit version is the only one that is the proper colour. :mrgreen:


Indeed :)
Image

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Tue Aug 21, 2018 7:25 pm

tschak909 wrote:Yes, VDI. sorry, :)

As for my last sentence, I am talking about the fact that only NVDI seems to have a facility to e.g. blit from an off-screen bitmap, scaling downward as needed. This is ultimately a show stopper for scaling cleanly to a window with its dials, in lower resolutions.

-Thom


Ah, yes, indeed. I have NVDI on all my Atari machines, and it has been tremendously popular in Germany, but I know that quite a few don’t like it.

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Tue Aug 21, 2018 7:28 pm

So given that off-screen bitmap VDI calls, are off the table, what approach can I use to handle the window redraw? This only really comes into play for AESes with multiple windows, but it will be an issue.

Currently, the view can't reliably be re-constituted when window rect damage occurs, because I can't just find the offending rectangle and either blit it back, or re-do the draw instructions for it...so what approach can I use?

-Thom

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Tue Aug 21, 2018 8:06 pm

tschak909 wrote: This only really comes into play for AESes with multiple windows, […]


All AES versions allow at least 7 windows.

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Tue Aug 21, 2018 8:08 pm

True, but there is currently only provision for one open terminal connection atm.

arf
Captain Atari
Captain Atari
Posts: 176
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby arf » Tue Aug 21, 2018 8:24 pm

tschak909 wrote:True, but there is currently only provision for one open terminal connection atm.


Ah, sorry, I got you wrong there.

tschak909
Atari maniac
Atari maniac
Posts: 81
Joined: Mon Mar 26, 2018 9:29 pm

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby tschak909 » Wed Aug 22, 2018 2:59 am

The first output from PLATOTerm for the Atari ST. This is in ST High mode aka Mono, (640x400). It uses the 8x12 font previously plotted, and is based on the original 8x16 PLATO font. Now onto the 8x6 font for 640x200 #irataonline #plato #atarist

The application is being cross-developed with the latest m68k-atari-mint toolchain, with GEMLIB WINDOM. The big problem that I still need to solve, is the redraw...

ptst-01.png


ptst-02.PNG


-Thom
You do not have the required permissions to view the files attached to this post.

joska
Hardware Guru
Hardware Guru
Posts: 4148
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Planning a PLATOTerm port for the Atari ST, some questions.

Postby joska » Wed Aug 22, 2018 6:52 am

tschak909 wrote:Currently, the view can't reliably be re-constituted when window rect damage occurs, because I can't just find the offending rectangle and either blit it back, or re-do the draw instructions for it...so what approach can I use?


I'm not sure if I understand - if you were able to draw an object once, why not twice? Can't you just store it, and keep a list of all object currently on screen? Whenever you need to redraw a rectangle (including the entire screen), you walk the list, intersect the rectangle with the coordinates of the object and draw any objects that's inside the rectangle. This is the usual way to redraw GEM windows.

As suggested earlier, you can also implement your own graphics routines and draw everything to an offscreen buffer and just blit rectangles to the screen.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 6 guests