BITBLT destroys palette?

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

BITBLT destroys palette?

Postby attle » Sun Aug 24, 2014 4:45 pm

Hi!

Some time ago I found this pretty nice scroller example in GFA which I'm trying to modify. It has a custom font, doesn't use the builtin TEXT commands.

viewtopic.php?p=27874#p27874

What I'm trying to do is to display a inlined Degas picture:

Code: Select all

  adr=XBIOS(2)
  ' Set palette from image
  ~XBIOS(6,L:pic+2)
  ' Display image
  BMOVE pic+34,adr,32000


Later, the scroller uses a BITBLT to copy the scroller text to screen:

Code: Select all

 BITBLT small_font()


When the BITBLT is executed it destroys the palette of one of my colors? You can easily see this because initially the background is blue as intended, then changes color when the scroller starts. The scroller text is a dark green which I don't understand where it is even defined.. I don't think the inlined font file contains any kind of palette.

I think the problem maybe lies in the small_font() procedure where it defines a struct for BITBLT. Btw, I can't see any documentation for this struct in the manual.

Code: Select all

PROCEDURE small_font
  DIM small_font(40)
  small_font(3)=1               ! Foreground Colour
  small_font(4)=1               ! Background Colour
  small_font(9)=8               ! Offset to the next word of the same bitplane
  small_font(10)=160            ! Offset to the next line of the source screen
  small_font(11)=2              ! Offset to the next bitplane (always 2)
  small_font(15)=8              ! Offset to the next word of the same bitplane
  small_font(16)=160            ! Offset to the next line of the destination screen
  small_font(17)=2              ! Offset to the next bitplane (always 2)
  small_font(2)=1               ! No of Bitplanes
  small_font(5)=3               ! Logical 'Put' Mode 0 to 15
  small_font(8)=small_font        ! Address of source screen
  small_font(14)=XBIOS(2)       ! Address of the Destination screen
  small_font(0)=1               ! Screen Width in Pixels
  small_font(1)=8               ! Screen Height in Pixels
  small_font(12)=318                  ! X Offset for Destination
  small_font(13)=191                  ! Y Offset for Destination
RETURN


I'm attaching my source with the slightly modified scroller.
You do not have the required permissions to view the files attached to this post.

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

Re: BITBLT destroys palette?

Postby simonsunnyboy » Sun Aug 24, 2014 4:55 pm

Well the raster bar routine (which crashes for me here) is the culprit, it changes the colors. If you remove the rasters_on and rasters_off procedure calls (or their contents), the picture stays blue.

It is NOT done by the BITBLT used.
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: BITBLT destroys palette?

Postby attle » Sun Aug 24, 2014 6:00 pm

Thanks simonsunnyboy! That was it! :D

Now the scroller text is blue as the background. Any ideas how to change the text color? If I try changing this in small_font procedure:

Code: Select all

small_font(3)=1


.. the text just disappears.

User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: BITBLT destroys palette?

Postby Mikefulton » Tue Jan 12, 2016 12:00 am

What version of GFA Basic is this?

User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: BITBLT destroys palette?

Postby Mikefulton » Tue Jan 12, 2016 12:19 am

Never mind, I realized I was trying with 3.0 instead of 3.5.


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 1 guest