English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 01 February 2020, 03:01   #1
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 19
double Copper trick question..

I was testing that Interlaced code from Earok:
https://github.com/earok/BlitzBasicDemos

Is it possible to blit something into? I tried to blit a shape but its streched.
Lets say that I would like to use this hires laced display to show tittle screen but also make a menu options..

I was also thinking about using Screen 0,27 but its said that it only supports 4 bitplanes in hires mode, I would like to use 8.

Code:
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
mateusz_s is offline  
Old 04 February 2020, 03:50   #2
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 19
OK, I found that code that works well with blitting objects, I think it is also more simply.. the result image was almost the same:
- both solution shifts image outside the screen - the firts more to right the second more to left
- and also both images were not sharp

I load reference image in filemaster and picviewer and the image was very sharp and centered.. but for now I only tested on winUAE, or

The original code is for 8 colors, I tried to change values to 256 and 8 bit depth but for now something is wrong it displays just garbage

code source: http://eab.abime.net/showthread.php?t=65184


; 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 is offline  
Old 04 February 2020, 22:38   #3
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 921
Shiny!
E-Penguin is online now  
Old 04 February 2020, 23:49   #4
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 19
Ok, I found the solution.. everything is OK if I create executable and run it from the OS not from Blitz2, the image is sharp and also I managed to use HAM8 with over 16 000 colours: https://i.imgur.com/xBnc0eb.jpg


mateusz_s is offline  
Old 06 February 2020, 01:05   #5
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 19
Ok, I managed to make my own alternative to Earoks code,
using only 1 bitmap and copper instruction for displaying every second line instead of BlockScroll.
And there is no problems with blitting objects:

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


The one thing that need to be checked is the SetInt routine. In above case the image flickers like normal interlace but in WinUAE (I can't check right now on real Amiga),
But if we use Earoks routine the image is not shaking anymore but the code throws Overflow at the end of program:

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 is offline  
Old 06 February 2020, 20:46   #6
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 19
Additional simple hires laced bitmap load as Screen:

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 is offline  
Old 09 February 2020, 16:52   #7
E-Penguin
Banana

E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 921
Can you mix Screen with Display?
E-Penguin is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
noob copper question jotd Coders. Asm / Hardware 4 10 January 2020 15:37
Copper question leonard Coders. Asm / Hardware 7 17 September 2017 14:14
double copper colours turrican3 support.WinUAE 12 19 January 2016 11:20
Double buffer copper?? h0ffman Coders. General 8 19 July 2011 19:10
Copper speed question FrenchShark Coders. General 18 14 August 2009 21:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.08715 seconds with 15 queries