View Single Post
Old 10 January 2016, 16:17   #10
TurboCrash
Registered User
 
Join Date: Dec 2015
Location: Lisbon/Portugal
Posts: 51
I'm learning Blitz Basic 2 too. Most of the bb2 source code available out there won't compile in Amiblitz2.43, for example Leathered's FF wip code compiles but there's no characters displayed in game.

In BUI5 there's an example using the Display mode instead of Amiga mode or Blitz mode (well still blitz mode but with display library instead of slice)

Code:
; Simple fading for the AGA Amiga by

; David Worswick

; Press left mouse button to Quit  . . . ..


path$="DH1:Blitz2/Examples/BUI5/fading/jcs_watergirl.iff"   ; path to the IFF picture, you may
                                                  ; need to chnge this !!!.



  BitMap 0,320,256,7       ; Allocate a 128 colour bitmap

  InitCopList 0,44,256,$13407,8,128,0   ; setup our copper list for a lores 128 colour display

  InitPalette 1,128       ; allocate a spare 128 colour palette for fading purposes..

  LoadBitMap 0,path$      ; load in the picture

  LoadPalette 0,path$     ; and its palette

  VWait 50        ; wait for all disk activity to stop

  BLITZ           ; go in to blitz mode



;*********************** AGA Palette Fading Routines ****************************


Statement AGA_FADE_IN{clist.w,source.w,destination.w,speed.w,offset.w}

For a.q=0 To 1 Step 1/speed.w
  VWait
  FadePalette source.w,destination.w,a.q
  DisplayPalette clist.w,destination.w,offset.w
Next

End Statement



Statement AGA_FADE_OUT{clist.w,source.w,destination.w,speed.w,offset.w}

For a.q= 1 To 0 Step -1/speed.w
  VWait
  FadePalette source.w,destination.w,a.q
  DisplayPalette clist.w,destination.w,offset.w
Next
End Statement


;***********************************************************************************************


  DisplayBitMap 0,0   ; display bitmap 0 in our copperlist

  DisplayPalette 0,0  ; display palette 0

  AGA_FADE_OUT{0,0,1,0,0}  ; before we display the picture we fade the palette out.

  CreateDisplay 0     ; create a display using our copperlist

  AGA_FADE_IN{0,0,1,200,0}    ; fade in the at a speed of 200

  MouseWait           ; wait for mouse button

  AGA_FADE_OUT{0,0,1,400,0}     ; fade out the display at a speed of 400

  End



; NOTES

;   Both the fade routines take the same parameters, which are :

;   clist       :=    the copperlist where the fade is to take place.

;   source      :=    the palette number to fade.

;   destination :=    a spare palette to hold the faded colours.

;   speed       :=    the speed of the fade. Increase this for longer fade fades.

;   offset      :=    normally set to 0 but can be changed if you need to display the faded
;                     palette at a different colour offset.
As stated in the manual: For displays on non-AGA machines only #fmode0 and #loressprites are allowed

Last edited by TurboCrash; 10 January 2016 at 16:23.
TurboCrash is offline  
 
Page generated in 0.05166 seconds with 11 queries