WBStartup DEFTYPE .w ;The interlaced bitmap BitMap 0,640,512,8 ;The original bitmap BitMap 1,640,512,8 LoadBitMap 1,"image.iff",0 ;Convert the original bitmap to interlaced Use BitMap 0 for i = 0 to 255 BlockScroll 0,i*2,640,1,0,i,1 BlockScroll 0,1+i*2,640,1,0,i+256,1 next ;Configure two copper lists for i = 0 to 1 InitCopList i,44,DispHeight,$10000 + $1000 + $100 + $8,8,256,0 DisplayBitMap i,0,0,i*256 DisplayPalette i,0 next BLITZ ;Repeatedly recreate the display and toggle the LOF bit SetInt 5 VP = Peek.w($DFF004) X=1-X if X=0 CreateDisplay 0 VP = VP BITSET 15 else CreateDisplay 1 VP = VP BITCLR 15 endif Poke.w $DFF02A,VP End SetInt While Joyb(0)+Joyb(1) = 0 Wend End
; Setup the screen for a hires laced display. This is used for the credits screens #BPLCON0=$100 ; Bitplane control register #BPLMOD1=$108 ; Bitplane modulo #BPLMOD2=$10A ; Bitplane modulo #bitmapsize=768 #Modulo=(((#bitmapsize-320)/8)-2)*2 BitMap 0,320,256,5 ; Game screen. Lowres 32 colour BitMap 1,320,256,5 ; Intro screens BitMap 2,640,256,4 ; Title Screen BitMap 3,#bitmapsize,512,3 ; Custom copper controlled hires-laced display for credits ; Lets build our own copperlist cop$=Mki$(#BPLMOD1)+Mki$(#Modulo) cop$+Mki$(#BPLMOD2)+Mki$(#Modulo) cop$+Mki$(#BPLCON0)+Mki$($b004) ; BPLCON0 : Bit number: ; 15 - Hires ; 14, $13, $12 bitplanes set (011 here for 3 bitplanes) ; 11 - Ham mode Off ; 10 - Dual playfield Off ; 09 - Composite colour mode off ; 08 - Genlock Audio Enable off ; 07 to bit 4 - Unused, set to 0 ; 03 - Lightpen off ; 02 - Interlace ON ; 01 - External Synchronization Enable off ; 00 - Unused ; Buffer for animation InitCopList 3,41,256,$513,8,8,-3 ; $11903 ; 8 colour hires laced display DisplayUser 3,0,cop$ ; Set our copperlist DisplayAdjust 3,768,-8,-8,-32,32 ; and adjust the display accordingly CreateDisplay 3 Use BitMap 3 DisplayPalette 3,1 SetInt 5 If Peek($df004) <0 DisplayBitMap 3,3,3,0 Else DisplayBitMap 3,3,3,1 EndIf End SetInt Blit 1,0,20 DisplayBitMap 3,3 End
@mateusz_s, post #1
@Solo Kazuki, post #2
@mateusz_s, post #3
@cholok, post #6
@cholok, post #8
@cholok, post #10
WBStartup #BPLCON0 = $100 #BPLMOD1 = $108 #BPLMOD2 = $10A #BPLCON0_MASK = %1000000000010100 ; binary #MODULO = 80 ; line modulo for hires laced 256 ; init bitmap space BitMap 0,640,512,8 ; loading 640x512 x 256 colors image LoadBitMap 0,"dh1:test-hires-256.iff",0 BLITZ ; configure two copper lists ; custom set to -3, because 3 instructions $100+$108+$10A cop$ = Mki$(#BPLCON0) + Mki$(#BPLCON0_MASK) cop$ + Mki$(#BPLMOD1) + Mki$(#MODULO) cop$ + Mki$(#BPLMOD2) + Mki$(#MODULO) ; copper nr 0 for displaying only odd lines InitCopList 0, 44, DispHeight, $10000 + $1000 + $100 + $8, 8, 256, -3 DisplayUser 0, 0, cop$ DisplayBitMap 0,0,0,0 DisplayPalette 0,0 ; copper nr 1 for displaying only even lines InitCopList 1, 44, DispHeight, $10000 + $1000 + $100 + $8, 8, 256, -3 DisplayUser 1, 0, cop$ DisplayBitMap 1,0,0,1 DisplayPalette 1,0 ; using interupt 5 to display and toggle two copper lists counter.w = 0 SetInt 5 counter = 1 - counter If counter = 0 CreateDisplay 0 Else CreateDisplay 1 EndIf End SetInt MouseWait End
SetInt 5 counter = 1 - counter VP = Peek.w($DFF004) If counter = 0 CreateDisplay 0 VP BitSet 15 Else CreateDisplay 1 VP BitClr 15 EndIf Poke.w $DFF02A, VP End SetInt
@mateusz_s, post #11
@cholok, post #12
Screen 0,0,0,640,512,8,-28668,"TEST",0,1 BitMap 0,640,512,8 LoadBitMap 0,"dh1:test-hires-256-info.iff",0 Use Palette 0 ShowBitMap 0 MouseWait
@mateusz_s, post #13
Statement ResizeWidth{index.l,amount.l,xadjust.l} diwstrt.l = xadjust*8 diwstop.l = diwstrt + amount*8 dUfstrt.l = Int(diwstrt/2) dUfstop.l = Int(diwstop/2) DisplayAdjust index,amount,dUfstrt,dUfstop,diwstrt,diwstop End Statement Where: - Index is the copper list - Amount is the amount of pixels to increase or decrease the width by (multiples of 8) - XAdjust is the amount to move it left or right by (multiples of 8)
@cholok, post #15
@cholok, post #15