New STOS editor

STOS-related stuff in here please

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

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

New STOS editor

Postby darklight » Fri Feb 15, 2008 11:34 pm

I've been working on a PC only STOS editor - one that looks like Visual Studio, and your lovely STOS code will look something like VB. Its not finished, the editor needs quite a bit of work still, but the main part - the loading & saving of .BAS files - is almost done. I'm going to need some testers to help me finish it though.

FIrst off though - there are a load of extensions I have to cater for - what are the most popular ones? I need to write an xml definition file for each one. Please include version numbers if you can, as some extensions reorder all their instructions / functions in different versions. I've already finished Blitter, Compact, Extra 3.26, Misty 1.7, Ste - what other ones do you use heavily?

It'll take me a couple of weeks* to complete, then I'll be looking for a couple of people to give a 'beta' version to, to try and load their programs. This will probably not work at first - so a bit of cooperation will be required where you try and narrow down the problem area, send code to me and I try to fix it. Hopefully any problems can be ironed out in this phase.

So, let me know about any extensions you know you use, and also if you are interested in this beta business. :)

(* - timeframes are totally made up on the spot, dont expect me to stick to them!)

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Fri Feb 15, 2008 11:40 pm

Oh and just to whet your appetite, I've attached a screenshot. You can see I am editing a subroutine in a game I wrote.

One more thing - this program works best with well structured code - i.e. if you have loads of gosubs, which exit nicely with returns (i.e. dont let control flow into other subroutines), and dont have gotos jumping all over your programs, then it is more likely to work. I cant guarantee how it will work with badly formed code, it does try though.
You do not have the required permissions to view the files attached to this post.
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2000
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: New STOS editor

Postby charles » Sat Feb 16, 2008 12:26 am

darklight , i for one would love to help you but with my own programming creativity, i could never find enough time,
i however can highily reccomend that you scour
the stformat coverdisks and use the extensions from them ,
the one i find really of interest is for midi .
thanks charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Desty
Atari God
Atari God
Posts: 1948
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: New STOS editor

Postby Desty » Sat Feb 16, 2008 1:36 am

That looks absolutely amazing. Is the editor automatically hiding some of the lower level (ugly) STOS stuff (I don't see normal STOS line numbers or GOTO x, rather, GOSUB label, which is much nicer) or does STOS already allow users to code like this?
tá'n poc ar buile!

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Sat Feb 16, 2008 1:46 am

Desty wrote:That looks absolutely amazing. Is the editor automatically hiding some of the lower level (ugly) STOS stuff (I don't see normal STOS line numbers or GOTO x, rather, GOSUB label, which is much nicer) or does STOS already allow users to code like this?


STOS does require line numbers, but this program (StosDEV) hides them, and instead lets you deal with subroutine names (for gosub commands) and label names (for goto commands). When it saves to a .bas file, it converts subroutine & label names to line numbers.

Apart from that, the commands look the same, just you no longer seperate commands by ":" - each command goes on its own line now.

If & else statements which normally take up one line are now split over multiple lines, with a matching "end if" statement. Then StosDEV packs it all onto one line when savine to .bas. There is a limitation here with what you can put into an if / else block. (no nesting - maybe? Havent tested this yet, also a fininte number of statements)

For the record - the STOS editor is a very basic (haha) affair - it isnt a text editor as such, more like a command prompt, and lines can be listed, entered one at a time, etc. AMOS apparently went down the structured programming / text editor route - its a shame STOS was basically abandoned by the authors when they wrote AMOS.
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games

User avatar
Desty
Atari God
Atari God
Posts: 1948
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: New STOS editor

Postby Desty » Sat Feb 16, 2008 2:01 am

darklight wrote:STOS does require line numbers, but this program (StosDEV) hides them, and instead lets you deal with subroutine names (for gosub commands) and label names (for goto commands). When it saves to a .bas file, it converts subroutine & label names to line numbers.

That's what I suspected... so basically, your editor acts as a kind of preprocessor, so we can work with modern structured coding style. This is brilliant, as the impressions I had about STOS being a big GOTO-fest and having to manage line numbers held me back from the language and drove me to the better GFA.

However, since STOS seems to have a way to re-use code via some kind of libraries (I saw lots of different modules on the right of your screenshot?), then it's more powerful than GFA in that sense. :) (Vanilla GFA has no include/import directive to allow you to re-use your existing libraries of code; the best you can do is to use the MERGE menu option to literally append your library files, one-by-one, to the current file. Then what happens if you update your library? Nothing! You have to delete the text and re-merge. Even assembly language is much more flexible than that, with most assemlbers allowing you to include another source file into this one via a preprocessor directive in the file)

darklight wrote:If & else statements which normally take up one line are now split over multiple lines, with a matching "end if" statement. Then StosDEV packs it all onto one line when savine to .bas. There is a limitation here with what you can put into an if / else block. (no nesting - maybe? Havent tested this yet, also a fininte number of statements)

I'm not sure how STOS handles it, but the general approach in other language parsers is to match an ELSE or ENDIF to the closest unmatched IF. So:

Code: Select all

If cond1
  code1()
  If cond2
    code2()
  Endif
Endif

The first Endif would match to the closest If block started 2 lines earlier. Not sure if that's what you were after...

darklight wrote:For the record - the STOS editor is a very basic (haha) affair - it isnt a text editor as such, more like a command prompt, and lines can be listed, entered one at a time, etc. AMOS apprently went down the structured programming / text editor route - its a shame STOS was basically abandoned by the authors when they wrote STOS.

This is very promising... I'll have to get my hands on a copy of STOS now! :cheers:
tá'n poc ar buile!

User avatar
SkylineDave
Atari Super Hero
Atari Super Hero
Posts: 591
Joined: Tue Sep 20, 2005 2:18 pm
Location: Leicester
Contact:

Re: New STOS editor

Postby SkylineDave » Sat Feb 16, 2008 7:58 am

thats excellent work - congratulations! i never thought id see something like this happen :cheers:
AKA Megadaz / Black Eagle --- STOS, Dungeon Master and Captive fan!

Proud member of the GameBaseST team.
Founder of the one-man DemoBaseST team!

User avatar
Mug UK
Administrator
Administrator
Posts: 11179
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: New STOS editor

Postby Mug UK » Sat Feb 16, 2008 10:45 am

Modern coding editor but for STOS - I'm gobsmacked at the simplicity and ingenuity :)
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Sat Feb 16, 2008 11:15 am

:lol: Thanks guys!

So, anyone want to mention what extensions they use?
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Re: New STOS editor

Postby PaulB » Sat Feb 16, 2008 12:15 pm

Bit of a Godsend this. I never liked coding in STOS because of it's crappy editor that forced you to use line numbers and as you mentioned, the ridiculous way it allowed a goto command to cross subroutines/functions. When your program is released I may just have to get my STOS manual out again and give it another go because I always liked the potential power of STOS, just not the programming structure. Well done!

User avatar
aktiv8
Atari God
Atari God
Posts: 1478
Joined: Tue Mar 04, 2003 4:31 pm
Location: Cardiff, South Wales

Re: New STOS editor

Postby aktiv8 » Sat Feb 16, 2008 12:22 pm

This looks great plus it looks pure and simple - like IMHO any good code IDE should be like

I look forward to seeing this and maybe trying my hand a STOS again. There were so many great games (and mnay potentially good games) done in STOS, so would be great to see peple like PaulB who were put of by the STOS shell maybe taking up the chanllenge and coding once more or at least finishing projects

Keep up the excellent work!
>>> Trust me, I'm a Research Chemist.... <<<

User avatar
sh3-rg
Captain Atari
Captain Atari
Posts: 435
Joined: Thu May 08, 2003 1:33 pm
Location: bolton - england
Contact:

Re: New STOS editor

Postby sh3-rg » Sat Feb 16, 2008 1:36 pm

This is great work, it would help me a lot. I find line numbers & other features of the stos environment a bit of a pain. Currently the only extension I'm using is Missing Link. I'd love to test this out when you are ready, it might help me make sure my puzzle/logic game is finished in time for Outline :D The game & intro are practically finished apart from some little touches, working on the menu, hiscores & player management stuff now.
fxXxings to disco mobile
Image

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2000
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: New STOS editor

Postby charles » Sat Feb 16, 2008 2:29 pm

i'm sure if you check this site dark light you'll find any extensions you need.
http://stos.atari.st/

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
sh3-rg
Captain Atari
Captain Atari
Posts: 435
Joined: Thu May 08, 2003 1:33 pm
Location: bolton - england
Contact:

Re: New STOS editor

Postby sh3-rg » Sat Feb 16, 2008 2:45 pm

charles wrote:i'm sure if you check this site dark light you'll find any extensions you need.
http://stos.atari.st/

charles


I think for now he's just after the ones people are actually using rather than each & every one of them.
fxXxings to disco mobile
Image

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2000
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: New STOS editor

Postby charles » Sat Feb 16, 2008 3:09 pm

i'm sure he can find them now after people have told him which one they want or use.
he is enabled to download himself.
do you need any further help dieklighk?

charles
these type of misprints always ensure quick responces.
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Desty
Atari God
Atari God
Posts: 1948
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: New STOS editor

Postby Desty » Sat Feb 16, 2008 3:36 pm

charles wrote:i'm sure if you check this site dark light you'll find any extensions you need.
http://stos.atari.st/

Thanks for that link Charles, now I have STOS :)
tá'n poc ar buile!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: New STOS editor

Postby lp » Sat Feb 16, 2008 6:55 pm

Nice work indeed.
Will it be open source? Any chance of a native GEM version?
Some of us do not use windows or emulators. :)

I'm curious how it handles the loading of a stos file for the first time. Does it convert all the line number references to something like:
goto Line100 ?
Then you have to edit them all by hand?

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Sat Feb 16, 2008 9:31 pm

lp wrote:Nice work indeed.
Will it be open source? Any chance of a native GEM version?
Some of us do not use windows or emulators. :)

I'm curious how it handles the loading of a stos file for the first time. Does it convert all the line number references to something like:
goto Line100 ?
Then you have to edit them all by hand?


Ah ha here come the tough questions! :D

Open source - dont know, I'm almost too embarrased to release my code, but if there are calls for it then I dont see why not. I'd like to finish version 1.0 before I release it though.

Native GEM version - I know this is probably a big sticking point for some people - why PC only? Well for the last 13 years or so I've been PC only, its been that long since I've programmed something on the ST. The tools available (controls, APIs) make programming this sort of thing on the PC easy for me, the Atari not so. So - I'm not really interested in starting such a big project on the ST. If someone else wants to, then I'd happily give them the neccesary C# code to give them a start, or maybe it could be an official port as part of an open source project?

Line numbers - it scans the program for all goto & gosub references, and takes a note of line numbers. Then it looks at those lines of code, and if it finds a comment, it converts the comment into a camel-case subroutine / label name. I always start my subroutines with a comment about what it does. If it does not find a comment, then it uses the line number as the subroutine / label name, and yes, you'd have to rename them yourself. I'll put in some simple refactoring tools into StosDEV before its finished.

Two things I find interesting about this project:

- It gives scope to extend the STOS langage - not just with new code libraries, but new semantics - i.e. local variables, subroutine arguments, function return values, case statements, someone (not me) could even take STOS down a object-oriented route! These are all possible. I havent changed the language too much yet (just added end ifs, and sub / end subs) but what do people think about that?

- STOS code ends up looking a little like VB. If all the core instructions, and also extension instructions could be converted into a VB API, then a program to convert STOS -> VB code would be possible, i.e. run your programs on a PC. Not sure if that has the STs best interests at heart, but its a possbility.
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Sat Feb 16, 2008 9:42 pm

charles wrote:i'm sure he can find them now after people have told him which one they want or use.
he is enabled to download himself.
do you need any further help dieklighk?

charles
these type of misprints always ensure quick responces.


Hi Charles - thanks for your help. I am a big fan of the STOS site - it has pretty much everything you need as far as STOS goes. I have already downloaded every extensions they have for STOS (is this every one ever released?). Because it takes quite a bit of effort to go through each extension and convert it into a xml file readable by my program, I want to know which extensions I should do first. I've already done the ones I use, now I need to know who else (preferably potential beta testers) uses what.

I see sh3-rg uses missing link - I'll do that one next. I'll let you know when it is ready for testing!
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games

User avatar
sh3-rg
Captain Atari
Captain Atari
Posts: 435
Joined: Thu May 08, 2003 1:33 pm
Location: bolton - england
Contact:

Re: New STOS editor

Postby sh3-rg » Sat Feb 16, 2008 11:11 pm

yay, I'm really looking forward to this!
fxXxings to disco mobile
Image

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2000
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: New STOS editor

Postby charles » Sun Feb 17, 2008 12:59 am

here is a little code i found a while a go.
its for stos ,
blitter grafics of the now famous charactrers 12,13,14,15

charles
how about midi , is it enabled to utilize the pc's midi sound card through stos?

Code: Select all

36500 rem Routine to display a single image bob in the correct place on the
36505 rem logical (background) screen, ready for the screen swap later in the
36510 rem program. STOS sprites could be used instead of bobs. The routine assumes
36515 rem a 24 pixel status bar exists at the top of the screen. MR(N) is an array
36520 rem of bob numbers, S14 is the address of the work screen, S7 is the address
36525 rem of the bob bank. MX2 and MY2 are arrays of x and y co-ords. You'll need
36530 rem the STE Blitter extension and the missing link extension, of course, and
36535 rem it'll only work with machines with blitters, (obviously). The sprites to
36537 rem be displayed are 32x32 pixels in size.
36540 rem
36555 rem          *****  display sprite *****
36560 if blitter=1 then goto 36566 : rem   Use blitter if one exists
36561 rem    No blitter
36563 bob logic,S7,MR(N),MX2(N),MY2(N),0 : rem   display pre-shifted sprite
36564 return
36565 rem          ***** use blitter *****
36566 BLL=boundary(MX2(N)) : if MX2(N)<0 then SCL=MX2(N) else SCL=MX2(N)-BLL : rem    find how far to pre-shift the b/g
36567 BLL=max(0,BLL) : BLL=min(319,BLL) : rem     keep l/h co-ords on-screen
36568 BLR=BLL+48 : BLR=min(319,BLR) : BLR=max(0,BLR) : rem  same for r/h co-ords.
36570 BLT=max(24,MY2(N)) : BLT=min(199,BLT) : rem   same for top
36572 if MY2(N)<24 then SCL2=MY2(N)-24 else SCL2=0
36574 BLB=BLT+48 : BLB=min(199,BLB) : BLB=max(BLB,24) : rem    same for bottom
36575 rem     ***** copy pre-shifted background to spare bit of work screen. (bottom right in this case) *****
36576 blit copy logic,BLL,BLT,BLR,BLB,S14,(192-SCL),(136-SCL2),3
36578 BLX=min(319,MX2(N)) : BLX=max(0,BLX) : BLY=min(199,MY2(N)) : BLY=max(24,BLY)
36584 bob S14,S7,MR(N),192,136,0 : rem      display bob on 16 pixel boundary
36585 rem     ***** copy sprite/background to logical screen *****
36587 if MX2(N)<0 then SCL=0-MX2(N) else SCL=0 : rem   left clip co-ords
36588 if MY2(N)<24 then SCL2=24-MY2(N) else SCL2=0 : rem   top clip co-ords
36590 if SCL>0 or SCL2>0 then blit copy S14,192,136,192+32,136+32,S14,192-SCL,136-SCL2,3
36592 rem BLR=BLX+32 : if BLR>319 then SCL=BLR-319 : rem right clip sprite (if nec.)
36594 blit copy S14,192,136,224-SCL,168-SCL2,logic,BLX,BLY,3 : rem    finally copy to logical screen
36599 return
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Desty
Atari God
Atari God
Posts: 1948
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: New STOS editor

Postby Desty » Sun Feb 17, 2008 1:22 am

Some ugly gotoing there. Are normal if-expressions in STOS only able to execute one statement? As it is, to parse this, the editor would probably have to do some funny rearrangement.
e.g.:

Code: Select all

100 if cond1 then goto 130
110 print "cond1 = false"
120 return
130 print "cond2 = false"
140 return

Might ideally become:

Code: Select all

If cond1 then
  print "cond1 = false"
  return
Else
  print "cond2 = false"
  return
Endif

Or the common return could be moved out... But it could be much worse than this. There could be other ways to get to line 130, which would obviously screw that up. Maybe you could use basic blocks and traces as compilers themselves do, to force the code to adhere to certain constraints, before doing further parsing of the code. I'd be very interested to hear what approaches you're using at the moment!
tá'n poc ar buile!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2000
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: New STOS editor

Postby charles » Sun Feb 17, 2008 3:35 am

well
as you can see programming has gotten easier ,
not one step at a time,
i recall using it,the bobs or blit as called.
it works ,monochrome ,stos, 1040stf,
but only for stos version 1,if memory serves correct.

like i said its getting easier.
thats what happened ..
i stopped using all the demos and available free source
then began my own journey into programming..
so do with it what you will,
its there for you.

as i remember it as,
it does whatever comes after conditional expectation
so multiple commands on one line are divided by semicolons ::::::::::and
multiple lines can go on until RETURN is read or another condition is met.
more like a script than a routine.
didn't use stos ..too too much ,
went with gfa and omikron after finding my limitations
were far from graspable in the beginiing..!!!

goto -ing
for my application of programming
is basically a no if
applied under "real-time" circumstances,
but if just checking a condition or resonding to button ,action etc etc
nothing heavilly required in main part of program ,
just set up ,
then its allright.

its allways been there!!!

kinda like finding out your dollars are now worth cents???
hey who blew a hole in that theory?????

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
bullis1
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2301
Joined: Tue Dec 12, 2006 2:32 pm
Location: Canada
Contact:

Re: New STOS editor

Postby bullis1 » Tue Feb 19, 2008 4:06 pm

darklight wrote::lol: Thanks guys!

So, anyone want to mention what extensions they use?


I use the starfield extension, STOS 3D (it blows, I know), STOS Compiler, and sometimes Misty and Missing Link. I use some others occasionally, but can't remember them now.

Also, this is looking really nice and I can't wait to try it out. However, what version of Windows does it require? I'm hoping I won't be needing a beefy, new machine to edit STOS code.

User avatar
darklight
Captain Atari
Captain Atari
Posts: 250
Joined: Mon May 08, 2006 7:53 pm
Location: Brisbane
Contact:

Re: New STOS editor

Postby darklight » Tue Feb 19, 2008 10:16 pm

bullis1 wrote:
darklight wrote::lol: Thanks guys!

So, anyone want to mention what extensions they use?


I use the starfield extension, STOS 3D (it blows, I know), STOS Compiler, and sometimes Misty and Missing Link. I use some others occasionally, but can't remember them now.

Also, this is looking really nice and I can't wait to try it out. However, what version of Windows does it require? I'm hoping I won't be needing a beefy, new machine to edit STOS code.


mmmm, good question. Its written using .Net 2.0, so you'll need XP at a minimum. Any XP machine should be capable of running it, as long as I distribute the .Net 2.0 framework with it, I believe. If anyone knows different please say so.

I'll have a go at converting the Starfield & 3D extensions, and ML & MIsty are done. Are you interested in helping out with beta (alpha?) testing bullis1?
Storm Clouds over the Western Front - my WW1 2D dogfighting game for windows
2D Flight Sims - side scrolling aerial combat games


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 1 guest