New, universal STOS fixer project

STOS-related stuff in here please

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

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2904
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

New, universal STOS fixer project

Postby AtariZoll » Sun Mar 09, 2014 3:19 pm

I made user input handling code for STOS, which works on all TOS versions, without TOS version tables. Main thing is proper joystick reading . All it takes not much RAM, and as I see, all versions can be fixed with it, relative simple - then will get STOS executable what works on all TOS versions, and even on TT, Falcon in most cases.
Since there are diverse Stos compiler versions, fixing SW must recognize all them, and patch properly. But there is one really stupid thing (among others) - in all compiles stays v 1.0 - and I don't see how to know with what compiler version it is made.
So, I will do it be detecting some patterns on certain locations.
So far, I saw 3 versions, all differences are in first 3KB of executables.
Version signature is always at offset $70 - there is "Stos basic compiler V 1.0 by Francois Lionet" . If you see it on different loc. in file, it is most likely packed - then must depack first for fixing.
Oldest version (before 1990) has $41FA06FA at pos $40E. There is usually only 3 TOS version table at $B0A - starts with $0102 ....

Most used is version with 7 TOS tables: there is $2239... at $40E , TOS tables start at $B2E - $0102 ....

Version with 15 TOS tables - including TOS 4.04 , 3.06 ... tables at $B7A - starting with $0100 ... - this likely don't needs fix, as all relevant TOS versions are covered. And I'm not sure is it what is made with compiler, or is fixed with some of Stos fixers ?

The questions is: are there some other versions ? To answer will need some hex viewer and patience + lot of STOS games .

Example of game fixed with this uni-fixer:
BIKER.ZIP
You do not have the required permissions to view the files attached to this post.
Negative feedback has usually positive effect.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: New, universal STOS fixer project

Postby exxos » Sun Mar 09, 2014 3:56 pm

4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2904
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New, universal STOS fixer project

Postby AtariZoll » Sun Mar 09, 2014 4:23 pm

Yes, and it is far from really good.
Best, what saw is Stos fixer 3 - it does similar thing as I do, but joystick read is still not properly made.
I can finish this really fast - and will be very short program, what will fix Stos PRGs so, that they not need more RAM. Just want to cover as much possible.
Negative feedback has usually positive effect.

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

Re: New, universal STOS fixer project

Postby Eero Tamminen » Sun Mar 09, 2014 6:41 pm

Is this project C-code that one can build & run anywhere to fix STOS binaries? Or is it an Atari binary?

I'm interested about this because there are quite a few (free/shareware) games that work fine from HD with normal TOS, but where input doesn't work with EmuTOS. I think many of them are made with STOS.

If the tool would be output something about where the input was read from before fixing, that would also be interesting to know (or it would tell STOS version and have documentation telling how that particular STOS version does input access).

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2904
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New, universal STOS fixer project

Postby AtariZoll » Sun Mar 09, 2014 7:07 pm

I code Atari SW only in assembler. And will publish source for this - then may see the concept - I already commented it well .
It will be short program what updates STOS executable's input handling code with such, what is not TOS version depending.

It is normal that STOS games work not with EmuTOS, right because input code. They work not even with TOS 2.06 - some older work only with TOS 1.00-1.02 .

I think that this my fix may not work with EmuTOS (better said fixed executables) . But we can achieve it.
I just tested with program for input test (mjtest by Exxos) . As expected mouse is OK. Keyboard is OK. Joystick not OK.
That means that Emutos has no proper code for writing joystick state - and TOS writes both joystick's state if mouse is disabled.
It looks like: there must be vector for joystick read, and it's address is readable with XBIOS 34 function. Output is address of Kbdvbase. At offset 24 , so 7th long there is joystick read vector. It points to rts in ROM. If you put there own code address, TOS will call it every time when some joystick action happens (pressing, releasing something).
Then simple code may write joystick states whereever you want:

Code: Select all


Joy_In
   move.l   a1,-(sp)
   lea      joy_Pos+1(pc),a1   * odd for joystick 1
   move.b   2(a0),(a1)
   move.b   1(a0),-1(a1)   * Joystick 0 - only if mouse off !
   move.l   (sp)+,a1
   rts   



As may see, a0 points to joystick state base in RAM, and at +1 is joy 0 state, at +2 is joy 1 state (bytes). Support for above is present in all TOS versions.
Negative feedback has usually positive effect.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: New, universal STOS fixer project

Postby exxos » Sun Mar 09, 2014 9:36 pm

sounds like a good program, STOSFIX is old now, and of course not supported for a long time.

STOS did not boot at all in EMUTOS, I tried it in Hatari, I think it just reset the machine during STOS boot.

BASIC208.PRG has fixes so the mouse etc works and allows STOS to boot on Falcon, but I don't know how good the code is in there overall.

I think there are some other problems with loading STOS on falcon, I think one of the extensions (missing link I think) it displays a raster type thing on load for a couple of seconds, this crashes STOS on the falcon. But I need to look into those problems more some other time.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

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

Re: New, universal STOS fixer project

Postby Eero Tamminen » Sun Mar 09, 2014 10:07 pm

exxos wrote:STOS did not boot at all in EMUTOS, I tried it in Hatari, I think it just reset the machine during STOS boot.


Starting STOS in Hatari with:
hatari --trace os_all --conout 2 <STOS program>

Might give some useful info. I guess you're using latest EmuTOS and Hatari releases?

(There was just a while ago new EmuTOS release.)

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: New, universal STOS fixer project

Postby exxos » Sun Mar 09, 2014 10:13 pm

I have no idea what version it was, It just came with hatari when I downloaded it a few days ago. I don't much much about EMUTOS or even where to find versions of it ?

EDIT1:

I have version 0.9.0. STOS boots up, but beyond that the video goes really screwy.

1.png
You do not have the required permissions to view the files attached to this post.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2904
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New, universal STOS fixer project

Postby AtariZoll » Mon Mar 10, 2014 7:37 am

STOS is pretty messy, so no wonder that works not under EmuTOS. But games compiled with should work.
I just checked - joysticks are disabled in EmuTOS. That would mean that there is no any code for supporting them too ??
Should add it, and there are some games using TOS for joystick read too.
What happens with old compiles under EmuTOS ? Panic: Bus error - because reading address $FC0002. Fix removes that, among other things.
Negative feedback has usually positive effect.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2904
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New, universal STOS fixer project

Postby AtariZoll » Mon Mar 10, 2014 10:53 am

Here is Beta 1 . Asm. source included.

STOS fixer Petari beta 1

This is small TOS executable, written in ASM. Filename is STOSFP1.TOS .
If using older TOS version, below TOS 2.0X need to rename to TTP, so can
enter filename what want to fix. In TOS 2.06 and later use drag and drop.
Of course, may use it as TTP too in higher TOS versions.

There is plan for GUI version too - where can select file(s) with GEM
fileselector.

Purpose is to make those by STOS created nasty games to work on
any TOS version, Falcon, TT .
Why reinventing hot water ? Because while I updated STOS Compiler
did STOS input code replacement, what needs not TOS version tables.
Actually, it was idea of STOS coder self, but was not done properly, so
such compiler was never released.
All new input code can be placed in space of old code and tables, together
with additional code for restoring entry state at exitting game.
Both ST joysticks are supported, so games like Multi Pakman will work fine.

Usage:

In TOS 2.06 and higher use simply drag & drop of STOS executable file.
In earlier TOS versions must use program as TTP, so rename to.
Then need to enter STOS program file name. If not in same DIR as fixer,
then must enter path too.
If program detects that it is STOS executable will patch it. Before it will save
original file with extension ORG - only if there is enough space on drive where
original file is. There will be no warning in case of some error, so user must take
care about free space and floppy reliability before running fixer.

There are packed STOS executables (SFX), with diverse packing systems.
User needs to depack them first, otherwise will be not updated. May find SW
for that purpose, and repacking after done fixing. Experienced ones can depack
with some debugger.

If STOS exec is already fixed with some fixer, will be not updated most likely.

ASM source included

PP, March 2014

STOSFP1.ZIP
You do not have the required permissions to view the files attached to this post.
Negative feedback has usually positive effect.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: New, universal STOS fixer project

Postby exxos » Mon Mar 10, 2014 7:24 pm

Good work! I am sorting out a lot of STOS files at the moment, there is a few PRG's so when I get finished sorting, I will patch them all and see if they all work after ;)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: New, universal STOS fixer project

Postby exxos » Mon Mar 10, 2014 8:58 pm

I tested the original virus.prg with your patcher and it works on TOS206 :) I tried the drag and drop ;)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

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

Re: New, universal STOS fixer project

Postby Eero Tamminen » Mon Mar 10, 2014 9:35 pm

exxos wrote:I have no idea what version it was, It just came with hatari when I downloaded it a few days ago. I don't much much about EMUTOS or even where to find versions of it ?


EmuTOS releases are available from here:
http://sourceforge.net/projects/emutos/files/emutos/

EDIT: there was just a new CVS snapshot too:
http://sourceforge.net/projects/emutos/ ... -20140309/

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

Re: New, universal STOS fixer project

Postby bullis1 » Wed Apr 02, 2014 5:14 pm

Thank you for this Zoll!
Member of the Atari Legend team

BlankVector
Captain Atari
Captain Atari
Posts: 400
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Re: New, universal STOS fixer project

Postby BlankVector » Sun May 04, 2014 6:48 pm

AtariZoll wrote:I just checked - joysticks are disabled in EmuTOS.

Indeed, this was a mistake.

AtariZoll wrote:That would mean that there is no any code for supporting them too ??

No, the support for joystick was present, but you had to explicitly enable joystick reporting by sending the appropriate IKBD command.

Anyway, this was a bug in EmuTOS, and is has just been fixed. Regarding to IKBD, EmuTOS behaves exactly like Atari TOS now.
You can download a fixed binary there. The fix will be included in next release.
http://sourceforge.net/projects/emutos/ ... -20140503/

If your STOS fixer works on STe, then it should work with EmuTOS, too.
If you encounter any difficulty, please report it, we will fix the problems at the right places.


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 1 guest