Auto Programming

C and PASCAL (or any other high-level languages) in here please

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

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Auto Programming

Postby Edward256 » Fri Feb 15, 2013 7:01 pm

Hi.
I'm trying to program a program to run another program.

I have created this front end on my computer
for almost all games that are on my computer.

However I come across a small problem
when it comes to STEem and Hatari.

To make these Atari games run as soon as the emulator started
it looked like I had to put all games onto disk images
but some I couldn't set as auto programs
and some are larger than a regular disk.

With the help of someone I programmed something in AHCC
that would load another program/game from the harddrive.

It seemed to work when running it normally
but when I put it into the C:\AUTO folder
alot of the games it tried to load (reading paths and filenames from a TXT)
did not seem to load properly.

The only hint I got was from Nishiran.
It said "Please insert disk 1 and press a key."

This sounds like it can't find its home folder
before the GEM/Desktop is loaded.

I'll post the code here: http://pastebin.com/ut9AAYVk

If anyone can help
it would be muchly appreciated.

/Edward

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

Re: Auto Programming

Postby Eero Tamminen » Fri Feb 15, 2013 10:51 pm

You can just give the program file name to Hatari and it runs it with program's directory used and C:\ root. Most newer programs work fine with that.

This of course assumes that program doesn't have paths hard-coded to A:\, but if it's a game, you may find a version that's patched to be HD compatible.

Technically Hatari does this by creating a virtual DESKTOP/NEWDESK/EMUDESK.INF file for TOS where it tells what program should be auto-started. This way GEM is initialized when the program starts (which is not the case when you try to run them from AUTO-folder).

So far I've come across only two demos which don't work this method although they start fine when double clicking on them in GEM desktop.

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Re: Auto Programming

Postby Edward256 » Fri Feb 15, 2013 11:46 pm

Ok, I tried this with Hatari 1.6.2-windows.
I did the following:

hatari_falcon --dsp emu -c hatarif.cfg "e:\Steem\AtariData\d\falcon.ext\games\TowersII\towerii.prg"

It did not work.
I got the Atari logo for a minute, then it went to GEM,
got a quick glimps of some icons,
and then all I had was a blank green Desktop with its menu.

If I ommit the \towerii.prg I get the desktop with some icons.
I open C and I am presented with the contents to the TowersII folder.
I browse down and I am able to load towerii.prg without a hitch.

Though I do see a problem with this method.
What about some games that require NVDI
or if I need to load keyset for my Swedish keyboard?

Wonder if there is some way to turn my xstart into an acc
and have it delay 3 seconds before loading something
so we properly get into GEM?

/Edward

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

Re: Auto Programming

Postby Eero Tamminen » Sat Feb 16, 2013 5:29 pm

Edward256 wrote:Ok, I tried this with Hatari 1.6.2-windows.
I did the following:

hatari_falcon --dsp emu -c hatarif.cfg "e:\Steem\AtariData\d\falcon.ext\games\TowersII\towerii.prg"

It did not work. I got the Atari logo for a minute, then it went to GEM, got a quick glimps of some icons, and then all I had was a blank green Desktop with its menu.


Did TOS show the program loading (i.e. program name at top of the screen)?

Edward256 wrote:If I ommit the \towerii.prg I get the desktop with some icons.
I open C and I am presented with the contents to the TowersII folder.
I browse down and I am able to load towerii.prg without a hitch.


If the problem is wrong path inside the emulation [1], you could try moving the program one level up (or symlinking it there), and giving that to Hatari. Then it finds its data files under TowersII subdirectory.

[1] giving Hatari "--trace gemdos" argument will trace all GEMDOS calls, including file system access so that you see what program tries to load.

Edward256 wrote:Though I do see a problem with this method.
What about some games that require NVDI
or if I need to load keyset for my Swedish keyboard?


If those can be run from the AUTO folder, you can put that AUTO folder to same directory where the program is which you run with Hatari.

Edward256 wrote:Wonder if there is some way to turn my xstart into an acc
and have it delay 3 seconds before loading something
so we properly get into GEM?


ACCs have a lot of limitations, most likely that won't work. Better to start your program from DESKTOP.INF file and let it set things needed by the program i.e. give your program name to Hatari...

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Re: Auto Programming

Postby Edward256 » Sat Feb 16, 2013 11:02 pm

Ok, I gave it the --trace gemdos and go the following: http://pastebin.com/vj7Ainwe
Btw, TOS image I'm using is tos492.img

I did not see the program name in the top of the TOS.

It said something about missing multitos and auto folder
but I did not have multitos to begin with.

I copied the auto folder over
but it didn't do a difference.

Also, NVDI complained about something.

/Edward
PS. I remember XBOOT used to have an autostart thing.
I tried that, and the exact same thing happened.
GEM started, a blink of the desktop (with all its icons),
then the desktop turned blank with its menu.

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

Re: Auto Programming

Postby Eero Tamminen » Sun Feb 17, 2013 4:09 pm

Edward256 wrote:Ok, I gave it the --trace gemdos and go the following: http://pastebin.com/vj7Ainwe
Btw, TOS image I'm using is tos492.img


I don't have that version of TOS and I'm not sure whether anytbody's tested autostarting with that TOS version.


Edward256 wrote:I did not see the program name in the top of the TOS.

It said something about missing multitos and auto folder
but I did not have multitos to begin with.


From the trace it's visible that TOS is trying to load KEYBD.TBL, GEM.CNF and GEM.RSC from MULTITOS sub-directory which doesn't exist. That explains those errors.

At line 76 Hatari-generated virtual NEWDESK.INF is opened by TOS. Then TOS checks for ACC and again for MULITOS stuff. Then it fails to find DESKICON.RSC from the Towers directory, that may explain missing icons on desktop.

At line 320 TOS starts to look for Towers program, but it seems that you didn't include the whole output so that I could see what happened when TOS tried to run it... Can you provide full trace?


Edward256 wrote:I copied the auto folder over
but it didn't do a difference.

Also, NVDI complained about something.


Does Towers need NVDI? You can use Pause/Break key to pause emulation if you wish to see something on screen before it's gone.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12723
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Auto Programming

Postby wongck » Mon Feb 18, 2013 1:11 am

Doesn't making a PRG auto start at the desktop work?
Sure you have to have a different newdesk.inf file for each.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Re: Auto Programming

Postby Edward256 » Tue Feb 19, 2013 5:02 pm

Eero Tamminen wrote:At line 320 TOS starts to look for Towers program, but it seems that you didn't include the whole output so that I could see what happened when TOS tried to run it... Can you provide full trace?


That was the whole thing. Done it 3 times and it's the same.
Ends after GEMDOS: \ -> host: e:\Steem\AtariData\d\falcon.ext\games\TowersII and a couple of MiNT? questions.

However, I managed to get my code to work properly.
I had to swap lines 26 and 27 and got alot more working.

On STEem I got about 57 games to run from their folders using this program of mine,
another 29 needed to be started form a newdesk.inf file,
and 3 others I found need to be started manually (desktop icon, haven't tested yet).

For the Hatari Falcon games, well, that which could be emulated
I got 10 games to run from their folders with this program (inc Towers II),
but none of the others (3) seemed to want to run from my program or a newdesk.inf file.

By doing this I got almost the same problem as with
sending the program directly to Hatari
except for the desktop color was my chosen color
and the quick glimps of the desktop icons looked fine.

I followed instructions from this little page.

/Edward

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

Re: Auto Programming

Postby Eero Tamminen » Tue Feb 19, 2013 10:05 pm

Edward256 wrote:another 29 needed to be started form a newdesk.inf file, and 3 others I found need to be started manually (desktop icon, haven't tested yet).


There may be some differences between different TOS versions on what things are set up only after INF file is processed. What were the programs that needed to be started manually from desktop instead of them being startable from newdesk.inf? And what TOS version you used?

The reason why I'm interested is that I want to debug this a bit, and document what exactly fails (as Hatari is using INF method for autostarting).

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Re: Auto Programming

Postby Edward256 » Wed Feb 20, 2013 1:26 am

Ok, here are the ones that I could run by browsing to their folder:

STEem: 128mhz, 14mb ram, tos206
Hatari Falcon, 68060, 32mhz, Full DSP, tos492, 14mb ram
Last edited by Edward256 on Thu Feb 21, 2013 12:49 am, edited 2 times in total.

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

Re: Auto Programming

Postby Eero Tamminen » Wed Feb 20, 2013 5:33 pm

Edward256 wrote:Ok, here are the ones that I could run by browsing to their folder:
...
Hatari Falcon, 68060, 32mhz, Full DSP, tos492, 14mb ram


Problem with Capy is that it requires specific video mode at startup, it doesn't set that by itself. In theory it would be possible to set that in INF file and have some Hatari option for selecting the correct video mode (for NVRAM and INF file).

However, many games which have these kind of problems are cleanly programmed and work also with similar video modes. In case of Hatari, you can use suitable VDI mode for Capy:

Code: Select all

  --vdi-planes 4 --vdi-width 640 --vdi-height 480


Note: Hatari VDI mode doesn't work with TOS 4.x, with everything else it should work, and Capy seems to work with them too.

Edward256
Retro freak
Retro freak
Posts: 15
Joined: Tue Aug 31, 2010 12:51 am

Re: Auto Programming

Postby Edward256 » Thu Feb 21, 2013 12:47 am

Well, I tried the extra switches to Hatari,
I put Capy as the #Z startup program in the inf
(this inf also had the set resolution of 640x480 16),
and still didn't work.

However, it did start ok with the xstart program.
But NOBI and Shocker 2 still complained about wrong resolution,
and passing them in the inf or Hatari gives me blank desktop.

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

Re: Auto Programming

Postby Eero Tamminen » Thu Feb 21, 2013 9:49 am

Edward256 wrote:Well, I tried the extra switches to Hatari,
I put Capy as the #Z startup program in the inf
(this inf also had the set resolution of 640x480 16),
and still didn't work.


It starts fine for me, even with ST emulation and ST TOS:

Code: Select all

hatari --vdi-planes 4 --vdi-width 640 --vdi-height 480 capy/game/capy.prg


As to things that didn't autostart with Steem, at least the two I tried, Flip Side and Jitterbug, auto-start just fine with Hatari (Flip Side naturally needs "-m" option for monochrome monitor).


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 4 guests