Jump to content
Sign in to follow this  
Ciastek3214

Problem with running game from .ST image

Recommended Posts

Hello,

I'm developing a game for Atari ST, and I'm using Hatari for test purposes. The game itself plays and runs just fine when I run it from the OS, however, some issues appear when I try to pack it into a .ST image file, and run it from either the emulator, or real ST. I downloaded MSA Converter, and created an image to which i copied my game's .TOS file, and my data folder, from which it loads stuff.When I try to load the image, and play the game from the OS the screen turns white, with a blinking cursor, like a console window, and after 2 seconds it turns black, and nothing happens. Are there any extra steps to make a game .ST friendly? Additional info: I'm using GCC, with m68k-atari-mint tools for it, to build the game.

Share this post


Link to post
Share on other sites

Running from floppy is usual way for Atari ST games. Emulators like Hatari and Steem emulate that very well.  "Running from OS" - as you say is specific for emulators - then file access goes not via TOS but emulator takes over that task - replacing regular TOS code in Trap #1 file functions.

Maybe path is not same in 'OS' case and in ST image case ?  You should use relative path, so TOS (exec) file in root of current DIR, and in it should be subdir DATA (or whatever is it's name), and files in it. Then access them with name \DATA\FILEX ... Or change current dir to dir DATA (again with relative path), and access files with simple FILEX ...

Share this post


Link to post
Share on other sites
6 hours ago, ParanoidLittleMan said:

Running from floppy is usual way for Atari ST games. Emulators like Hatari and Steem emulate that very well.  "Running from OS" - as you say is specific for emulators - then file access goes not via TOS but emulator takes over that task - replacing regular TOS code in Trap #1 file functions.

Maybe path is not same in 'OS' case and in ST image case ?  You should use relative path, so TOS (exec) file in root of current DIR, and in it should be subdir DATA (or whatever is it's name), and files in it. Then access them with name \DATA\FILEX ... Or change current dir to dir DATA (again with relative path), and access files with simple FILEX ...

I do use relative paths, precisely for that reason. The .st image layout is like this:

->game.tos
->data/
------->art assets
------->music
------->other stuff

and each of the file I open through Fopen function, e.g. Fopen("data/bitmap1",0). It works just fine running it from a hard drive in emulator, but running it from .st image from a floppy drive, also in emulator, gives me a black screen.

Share this post


Link to post
Share on other sites

After this should be obvious where the problem is 🙂

But I made tests, to be sure. And yes, you need to use backslash and not slash, since TOS needs it.

Emulator Hatari is just not realistic in this, but that's not surprise - they like to do it better than TOS, and in cases like this it makes confusion.

I would recommend to use Steem Debugger (aka Steem Boiler) for testing purposes. For instance it will not work with slash even when accessing files in so called GEMDOS emulation mode (so from host OS some DIR) . And more useful: you can trace with it very well your SW - can set breakpoints wherever you want, memory monitoring etc.

And of course critic goes to  m68k-atari-mint tools too - should give at least warning in case like this - that slash will not work with TOS .

 

Share this post


Link to post
Share on other sites
10 hours ago, ParanoidLittleMan said:

After this should be obvious where the problem is 🙂

But I made tests, to be sure. And yes, you need to use backslash and not slash, since TOS needs it.

Emulator Hatari is just not realistic in this, but that's not surprise - they like to do it better than TOS, and in cases like this it makes confusion.

I would recommend to use Steem Debugger (aka Steem Boiler) for testing purposes. For instance it will not work with slash even when accessing files in so called GEMDOS emulation mode (so from host OS some DIR) . And more useful: you can trace with it very well your SW - can set breakpoints wherever you want, memory monitoring etc.

And of course critic goes to  m68k-atari-mint tools too - should give at least warning in case like this - that slash will not work with TOS .

 

It worked! Thanks a lot! One quick question if you don't mind: what is the least painful way to make an st image self-bootable?

Share this post


Link to post
Share on other sites

AUTO folder run is what is easiest - you create folder AUTO in root of floppy, and copy there program what want to start automatically. Need to use extension PRG instead TOS. So GAME.TOS . Other files and DIRs remain same, so at root of floppy (A:) DATA\FILEX ....

Condition for work is that program have no AES calls, and if use mouse need to init it.

Other way is floppy autoboot, it needs setting checksum of bootsector, running code in it - what loads/starts main PRG, so harder.

If there are AES calls ( trap #2 with value 200 ($C8) can use Desktop automatic start - only later TOS versions.

Share this post


Link to post
Share on other sites
4 minutes ago, ParanoidLittleMan said:

AUTO folder run is what is easiest - you create folder AUTO in root of floppy, and copy there program what want to start automatically. Need to use extension PRG instead TOS. So GAME.TOS . Other files and DIRs remain same, so at root of floppy (A:) DATA\FILEX ....

Condition for work is that program have no AES calls, and if use mouse need to init it.

Other way is floppy autoboot, it needs setting checksum of bootsector, running code in it - what loads/starts main PRG, so harder.

If there are AES calls ( trap #2 with value 200 ($C8) can use Desktop automatic start - only later TOS versions.

Do I keep all the directory strings for loading assets the same or should I change them to \..\DATA\STUFF ?

Share this post


Link to post
Share on other sites

No need to change anything. PRG starts from AUTO folder, but path is not changed, it stays in root of A:

And using backslash at start will make it not running in case of usual hard drive usage - from some subDIR.

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...