Sam-Nasty

STOS programming section.

Moderator: troed

User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Sam-Nasty

Post by exxos »

I came across this thread (don't say it) https://www.atari-forum.com/viewtopic.php?f=3&t=40966

Thought I would have a crack at it..

geese.... that code is a mess..

1.JPG
1.JPG (53.89 KiB) Viewed 1248 times
2.JPG
2.JPG (114.45 KiB) Viewed 1248 times

That's as far as I got. It errors shortly after that screen.. will do a bit more but not sure its worth spending a lot of time on it.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

:shrug:

3.JPG
3.JPG (113.45 KiB) Viewed 1244 times
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

This game is sooo badly programmed :roll: it doesn't run at 16mhz even. The demo crashes as it usages a timer to skip through a array. So when the timer runs double fast, it runs out of array and crashes.

It says it was originally a mandarin game and was updated by someone else. Can't say I remember the game . but would be interesting to see the original code. This github code is bonkers. There's no way it could have ever run in its current state.

There is a lot of invalid syntax as well. Variables containing STOS commands :roll: for example "COLINTRO" ends up "COL int ro" :roll:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
mrbombermillzy
Posts: 1441
Joined: Sun Jun 03, 2018 7:37 pm

Re: Sam-Nasty

Post by mrbombermillzy »

Yeah, I saw that.

Bit of a mess, but some brave soull over at AF managed to compile a runnable version (mlynn1974).

The interseting thing, is that there seems to be some sort of method to all the madness in there!

Glad I wasnt the one trying to reverse engineer it though :crazy: :comp:
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

mrbombermillzy wrote: Thu Sep 23, 2021 2:34 pm Bit of a mess, but some brave soull over at AF managed to compile a runnable version (mlynn1974).
Just had a look,Seems he did basically nothing. There is a LOT more wrong with that code. If they are using the earlier compiler, I assume it is just not checking the syntax as good as version 3 and not picking up on all the errors.

I remember earlier versions of stos were very bad at checking stuff. I had to fix some of the games like Zoltar IIRC because you could not even compile because of errors. I think the actual editor is even more forgiving. In any case, I don't see how they managed to compile and get it working..

There was even stuff like "If TEXT E=0 THEN" , is not valid at all. So I had to remove all the "TEXT" words.. Like I say it is a total mess. They seem to have got it to compile at the first hurdle, but I guarantee there is like a hundred more after that :roll:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
mrbombermillzy
Posts: 1441
Joined: Sun Jun 03, 2018 7:37 pm

Re: Sam-Nasty

Post by mrbombermillzy »

Theres even tales of the code being fixed by a python script! lol

Well, whatever the spaghetti code is like, the game isnt too bad.

In fact I think its quite a good effort. I like it!

EDIT: just re-read your post...You cant get it running. Im running on Hatari Mega ST4 setup with TOS 1.4. (It says somewhere TOS 2.06 wont work).

Try this:
SAMNASTY.zip
(257.64 KiB) Downloaded 37 times
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

Oddly that does compile and run.. But the ASC file does like what I found..

Capture.JPG
Capture.JPG (13.14 KiB) Viewed 1170 times

But in the actual BAS file..

2.JPG
2.JPG (14.85 KiB) Viewed 1170 times

So I don't get why the ASC behaves differently than the BAS file.

In fact you cannot even run this from the command line..

3.JPG
3.JPG (9.99 KiB) Viewed 1170 times

Which Is why I renamed them all..

4.JPG
4.JPG (4.03 KiB) Viewed 1170 times

So I don't know how they got from the ASC file and imported it with loads of invalid syntax. I went through all that one by one last night and corrected it all. So it should not even run with what they have. Again can only assume because they are using older versions of stos.

EDIT:

Seems to be some extensions causing some of these issues. So others may not see such errors.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

mrbombermillzy wrote: Thu Sep 23, 2021 3:01 pm EDIT: just re-read your post...You cant get it running. Im running on Hatari Mega ST4 setup with TOS 1.4. (It says somewhere TOS 2.06 wont work).
I had it running last night..Those screenshots were my edit of it running compiled. I use STEEM with TOS206 and compiled to TOS file.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
mrbombermillzy
Posts: 1441
Joined: Sun Jun 03, 2018 7:37 pm

Re: Sam-Nasty

Post by mrbombermillzy »

Everyone seems to be up in arms about how it manages to work or whats been done. Who knows?

It does seem to appear, however, that the original author is doing some 'black magic' work arounds for bugs/limits/extra undocumented functionality in the compiler...?

Would LOVE to find out what he did here or even his train of thought!
User avatar
exxos
Site Admin
Site Admin
Posts: 23496
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Sam-Nasty

Post by exxos »

mrbombermillzy wrote: Thu Sep 23, 2021 3:52 pm Everyone seems to be up in arms about how it manages to work or whats been done. Who knows?

It does seem to appear, however, that the original author is doing some 'black magic' work arounds for bugs/limits/extra undocumented functionality in the compiler...?

Would LOVE to find out what he did here or even his train of thought!
I assume the original author used the original STOS version. Like I said, some of the examples like Zoltar I had to fix in order to compile them later on. It was things like the colon is missing in between statements like "A=1 B=1" should be "A=1 : B=1" type of thing. Running in the editor to work fine so the problem was never discovered...Until exxos came along and try to compile it :lol: :roll: I also compiled the compiler at one point :lol:

I never heard of jumps going to a variable like that either. I think this was just a quirk of the editor. What he thought he could do " as it worked", but this is not how STOS should be used. The manual clearly states to use actual line numbers not variables for jumps. So yeah,"This work so I will continue doing it, even though it is wrong and invalid syntax" :roll:

I have not checked but I think "COL" and "INT" are probably stos commands so they should not be used in variables.. But that game code does it all over the place. So I replaced them all so the ASC file would import correctly.

As mentioned in the AF thread, the DIM statements were in the middle of the code with a gosub to it. Technically there should be nothing wrong with doing that. But the compiler moans about it. I have seen such similar problems with HISOFT basic as well. But in any case IMHO, declaring variables should be done right at the start of the code as it is what the compiler expects. No doubt this problem works in the editor as its not checking as much stuff as the compiler does. I assume the flowrate of the compiler is that it sees a variable being used which has not been declared yet so chucks up an error. If the compiler actually followed the code path itself ( probably impossible) it would not complain about it. But again IMHO, is bad programming and all variables should be declared at the start of the code.

A lot of STOS stuff is frankly horrendous programming wise. Not saying my early code was any better. But people really did not know what they were doing programming wise, it was all a bit new back in the day etc.

As to what those Python scripts are doing I have no idea. Not really that interested to be honest :P

Will see if I can upload my compiled version later..
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
Locked

Return to “STOS”