Display INLINE Degas pic

GFA BASIC-related articles in here please

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

attle
Atari User
Atari User
Posts: 36
Joined: Thu May 15, 2014 3:40 pm

Display INLINE Degas pic

Postby attle » Fri Jul 11, 2014 5:56 am

Hi,
I'm trying to get a simple INLINE with a Degas pic working. I found this procedure, but gradually animates the picture into view which I don't want.

http://www.stcarchiv.de/ace/50/using-gfa-basic

Since I use monochrome/ST-High the SETCOLOR 0,0,0,0 trick doesn't seem to work either. It just inverts the image.

Help a GFA noob out? :cheers:

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Display INLINE Degas pic

Postby lp » Fri Jul 11, 2014 12:55 pm

That's because ST High does not really have color registers, its always black and white. Later models like the TT030 had what was called duo-chrome which would allow you pick the 2 colors. Basically, that trick won't work on a regular ST.

You could try speeding up the copy to the screen. I'm not sure why the example moves it in 80 byte chunks when the screen ram is a linear block of ram. One line of code should suffice. The loop can be removed.

Try this instead:

Code: Select all

PROCEDURE do_inline
  INLINE x%,32066
  adr%=XBIOS(2)           ! Start of screen memory
  BMOVE x%+34,adr%,32000  ! Move data to screen (in one go)
RETURN

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4774
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Display INLINE Degas pic

Postby simonsunnyboy » Fri Jul 11, 2014 3:48 pm

Another important issue: if you place the INLINE deep inside your code, take into account that its contents are erased as soon as you enter code lines ABOVE the INLINE statement.

To keep its contents, it is good practice to make the INLINE chunks the topmost lines of your GFA code, maybe only preceeded by comments and/or small exit code.

Otherwise, lp is ofcourse right, that loop only makes sense with an added VSYNC for real desired slow displaying of the picture.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

attle
Atari User
Atari User
Posts: 36
Joined: Thu May 15, 2014 3:40 pm

Re: Display INLINE Degas pic

Postby attle » Sun Jul 13, 2014 1:43 pm

@lp: Thanks, it works nicely. But why omit the last 32 bytes? Or was the size in first example incorrect? :)

@simonsunnyboy: Good to know, I moved my inlines to the top.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Display INLINE Degas pic

Postby lp » Sun Jul 13, 2014 1:48 pm

The bitmap is 32000 bytes. The header of the file contains space for a palette, so you have to skip it since its not used in mono. After the bitmap is some space for some color animation information degas elite added.

See here: http://phoenix.inf.upol.cz/~opichals/li ... p&index=18

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4774
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Display INLINE Degas pic

Postby simonsunnyboy » Sun Jul 13, 2014 2:08 pm

It is also advisable to use good variable names for inline data pointers, music%, musicreplay%, rasterrout%,titlepic% and highscorelistpic% do say a lot more than x% ;)
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 2 guests