Jump to content
IGNORED

Help for a loader screen in GFA Basic


hlabrand

Recommended Posts

Hi all,

My game "Tristam Island" is due to be released for the Atari ST on Friday. If possible, I'd like to have a "splash screen" program that displays an image (.PI1), waits for a key, then starts my game.

I thought I could write a little screen loader program in GFA Basic using this program: https://www.atari-forum.com/viewtopic.php?t=3754

It works, but then I'm stuck on the "start my game" part... How do I finish this script so it works?

 

(I thought I could do

EVNT_BUTTON(1)

EXEC 0, "JZIP.TTP TRISTAM.Z3", "", ""

but 1/ the exec doesn't work, 2/ should I clear the screen before that? how? 3/ I can't find the underscore on my virtual keyboard :D I'm thinking this is for a different version of GFA-Basic that's not for the ST?)

 

Of course, feel free to tell me I'm doing it all wrong and give me another solution :) Thanks in advance!

Link to comment
Share on other sites

1) Try:

 

VOID EXEC(0,"JZIP.TTP"," TRISTAM.Z3","")

So the parameter(s) you want to pass to the executable should be placed in the second argument of EXEC. You might have to add a leading space to the parameters - if you notice carefully what I typed above there is a space between the opening quote and TRISTAM.Z3. I'm not 100% sure it's needed - my memory is hazy but try it with and without a leading space and see what happens!

2)

CLS

should clear the screen

 

3) The underscore could be in many places depending on your TOS nationality. For the UK version at least you should be able to produce it by hitting shift+whatever key is next to zero on your keyboard

Edited by ggn
Link to comment
Share on other sites

Thank you!

I tried just the first line in GFA Basic and it didn't work - I mean, maybe it executed something, but the program ended immediately.

(Maybe you want more information on the program: when I click on JZIP.TTP from TOS, it asks for a parameter, which is 'tristam.z3', then it starts a terminal and loads the game file. Do I need to tell the script to open a terminal?)

 

Also, another slight problem with the code: the colors of the OS are all wrong after I execute it... Probably because of the line ~XBIOS(6,L:VARPTR(palette$) in the original script. Any way to restore the palette to its default value (or to whatever the user had before) after displaying that image?

 

If it's easier to post my .st file here, tell me... Thank you for your help :)

Link to comment
Share on other sites

1 hour ago, hlabrand said:

Thank you!

I tried just the first line in GFA Basic and it didn't work - I mean, maybe it executed something, but the program ended immediately.

(Maybe you want more information on the program: when I click on JZIP.TTP from TOS, it asks for a parameter, which is 'tristam.z3', then it starts a terminal and loads the game file. Do I need to tell the script to open a terminal?)

Ok, information is coming back to my head bit by bit. Before you EXEC you need to tell TOS to free as much available memory as it can. So try adding this before EXEC:

RESERVE 100

Then you might see something happening!

Quote

 

Also, another slight problem with the code: the colors of the OS are all wrong after I execute it... Probably because of the line ~XBIOS(6,L:VARPTR(palette$) in the original script. Any way to restore the palette to its default value (or to whatever the user had before) after displaying that image?

Okay, you're setting the palette to your pic but you never restore it. So your set palette code is going to also read the old palette before doing anything. So, the following should work:

dim oldpal&(16)

for i&=0 to 15

oldpal&(i&)=xbios(7,i&,palette(i&))

next i&

Then when exiting you can restore the old palette using

void xbios(6,l:v:oldpal&(0)

Of course this triggers yet another change, i.e. the way you read the palette into a string. Let's change that too, from BGET #1,VARPTR(palette$),32 to

dim palette&(16)

bget #1,varptr(palette&(0))

 

Hopefully you get the idea, if not just say so :). Also, the code above is untested, so apologies if I got it wrong....

Quote

If it's easier to post my .st file here, tell me... Thank you for your help :)

If my suggestions don't work out then sure. And no worries :).

Edited by ggn
Link to comment
Share on other sites

Thank you for your help!

I have hope, because a simple program "RESERVE 100" then "VOID EXEC" started JZIP.TTP with the right arguments. Thank you!!

I typed the program, but I have an error of "array not dimensioned". I also had to add a ",32" to your bget, like "bget #1,varptr(palette&(0)),32" (but maybe I shouldn't have?)

 

Attached is the listing of the script, and the disk image (current script is TRISTAM2.GFA). We should be close... Thank you so much :)

Capture d’écran_2020-11-18_13-26-39.png

 

Edited by hlabrand
Link to comment
Share on other sites

Okay, here we go, now it displays the pic, saves/restores/sets palette, runs the interpreter etc etc! I also added a 5 second pause so people can appreciate the title pic :).

 

I restrained myself to make a palette fade in/out routine, at least this works as intended!

 

Edited by ggn
  • Like 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...