English Amiga Board    


Go Back   English Amiga Board > » Coders > Coders. Language

Reply
 
Thread Tools
Old 24 July 2012, 10:31   #1
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
Blitz2: Hires laced

Guys,

how do I create a 640x512 hires laced display in Blitzmode?

ta
bippym is offline   Reply With Quote
Old 24 July 2012, 22:48   #2
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 716
I think your best shot it´s with slice function or may AmiBlitz have a new function tha supports Hi-Res screens in blitz mode..
Why you don´t post this question in www.AmiForce.de forum? There it´s the best place to inform you
AlfaRomeo is offline   Reply With Quote
Old 24 July 2012, 22:51   #3
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
I'm using the display lib which supports aga. Slice commands I'm not sure about.

Thanks
bippym is offline   Reply With Quote
Old 27 July 2012, 13:24   #4
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 716
http://www.amiforce.de/thread.php?bo...h68632a4v3qi4s

Maybe this topic could help you with some tips..
AlfaRomeo is offline   Reply With Quote
Old 27 July 2012, 14:08   #5
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
Hi Mate,

I have almost figured it out.. below is my code.. Some tweaking required as it looks like every other line is missing!!

Code:
; 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
bippym is offline   Reply With Quote
Old 27 July 2012, 15:34   #6
pmc
is long gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: London
Posts: 1,590
First a disclaimer: I know *nothing* about Blitz basic and although I know a little bit about asm, I've never created myself an interlaced display using that either.

But... having said the above, when you said this:

Quote:
Originally Posted by bippym
Some tweaking required as it looks like every other line is missing!!
Something rang a bell in my mind from reading about interlaced displays in the HRM. First, the bitplane pointers need to be set correctly for the odd / even lines of an interlaced display. Second, two copperlists are required, again, one for the odd and one for the even lines.

Have you catered for those two things? You only seem to have one custom copper list in your code, unless I'm reading it totally wrong? As I say - I know nothing about Blitz. It might be worth you checking the relevant section in the HRM if you haven't already.
pmc is offline   Reply With Quote
Old 27 July 2012, 15:35   #7
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 4,547
You need 2 copperlists, one for odd, one for even lines.

Edit: pmc was faster.
__________________
Makes me sick when I hear all the shit that you say
So much crap coming out, it must take you all day
There's a space kept in hell with your name on the seat
With a spike in the chair just to make it complete
StingRay is offline   Reply With Quote
Old 27 July 2012, 15:38   #8
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 716
I think you will need a function like 'LoadPalette 1, ".../palette"' otherwise 'DisplayPalette 3,1' will give error
AlfaRomeo is offline   Reply With Quote
Old 27 July 2012, 15:38   #9
pmc
is long gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: London
Posts: 1,590
I stung the Sting! \o/
pmc is offline   Reply With Quote
Old 27 July 2012, 15:39   #10
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
I'm not sure blitz can do that. I would basically have to display the odd frames and then the even I guess each vertical blank??
bippym is offline   Reply With Quote
Old 27 July 2012, 15:39   #11
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 4,547
Quote:
Originally Posted by pmc View Post
I stung the Sting! \o/
Haha, yes.

Quote:
Originally Posted by bippym View Post
I'm not sure blitz can do that. I would basically have to display the odd frames and then the even I guess each vertical blank??
Just build 2 copperlists and set the modulo to skip every other line. You also need to set the bplpointers to point to odd/even lines. Then just swap the copperlists each frame and you'll have your interlaced display.
__________________
Makes me sick when I hear all the shit that you say
So much crap coming out, it must take you all day
There's a space kept in hell with your name on the seat
With a spike in the chair just to make it complete
StingRay is offline   Reply With Quote
Old 27 July 2012, 15:40   #12
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
AlfaRomeo this is cut down source with most of the other stuff removed
bippym is offline   Reply With Quote
Old 27 July 2012, 16:24   #13
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
Sting. It's one thing saying it, it's another doing it in bb2.

Would the second coplist be the same as the first?
bippym is offline   Reply With Quote
Old 27 July 2012, 16:38   #14
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 4,547
Yes, except that the bitplane pointers point to the 2nd line of your picture (1st copperlist: 1st line of the picture).
__________________
Makes me sick when I hear all the shit that you say
So much crap coming out, it must take you all day
There's a space kept in hell with your name on the seat
With a spike in the chair just to make it complete
StingRay is offline   Reply With Quote
Old 27 July 2012, 16:41   #15
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
Would that be the modulo+40
bippym is offline   Reply With Quote
Old 27 July 2012, 17:20   #16
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 4,547
Yes, the modulo is 40 (so every other line will be skipped) and your bitplane pointers in the first copperlist point to your picture/screen+0 and in your 2nd copperlist to picture/screen+40. That way every other line is skipped and because the copperlists are swapped each frame you'll have a correct interlaced display.
__________________
Makes me sick when I hear all the shit that you say
So much crap coming out, it must take you all day
There's a space kept in hell with your name on the seat
With a spike in the chair just to make it complete
StingRay is offline   Reply With Quote
Old 27 July 2012, 20:27   #17
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
okay I believe I have the address of the bitmap in memory, so next is to rewrite the copperlists to take that into account. I feel some inline assembler is going to happen here!
bippym is offline   Reply With Quote
Old 27 July 2012, 21:59   #18
pmc
is long gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: London
Posts: 1,590
As a test I just knocked together some asm to display a hires laced screen - all very straighforward.

One thing to remember: as you wanted a hires laced screen you'll need to regard 80 bytes, not 40, as your line width!
pmc is offline   Reply With Quote
Old 28 July 2012, 07:34   #19
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
pmc not so straightfo ward in a programme that doesn't support it properly
bippym is offline   Reply With Quote
Old 28 July 2012, 21:04   #20
pmc
is long gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: London
Posts: 1,590
I had a quick scan through a Blitz2 Manual. It looks to support inline assembly language and also custom copper lists / instructions.

Supporting both of those would mean it also supports creating a hires interlaced display I would think, although obviously I don't know enough about Blitz2 to say for certain.

A couple of custom copper lists, one with bitplane pointers set to point at the start of your bitplane and another with bitplane pointers set to point at the start of your bitplane+80 and then some code to swap which one of these copper lists is active at each vertical blank and job done.

And of course set the required display regs (bplcon0 / ddfstsrt / ddfstop / bpl1mod / bpl2mod) as per the requirements for hires interlaced.
pmc is offline   Reply With Quote
Old 28 July 2012, 21:46   #21
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 297
bippym - This works on A500 but not A1200 (both WinUAE). $DFF004 register is not behaving as expected with AGA. With ECS it rapidly switches between $A000 & $2000. AGA is stuck on $A300. Since your program is using that register*, that may be why the display isn't switching properly.
* assumed typo in listing

Code:
BLITZ
BitMap 0,640,512,3
SetBPLCON0 4
Slice 0,44,640,256,$fffb,3,8,8,1280,1280
RGB 0,5,5,5
RGB 1,15,15,15

SetInt 5
  x=0
  TST.w $dff004
  BMI skip
  x=1
skip:  Show 0,0,x
End SetInt

BitMapOutput 0
Locate 10,10
Print "As soon as their guard is down"
MouseWait

Last edited by clenched; 28 July 2012 at 22:41.
clenched is offline   Reply With Quote
Old 28 July 2012, 23:20   #22
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
I am using aga and the display libs. Ill figure it out next week. I move house Monday!!
bippym is offline   Reply With Quote
Old 29 July 2012, 08:26   #23
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,945
Did you take over the system? ROM vblank routine, especially if KS3.1, will set LOF bit if it isn't already set and current system screen is not interlaced.
Toni Wilen is offline   Reply With Quote
Old 29 July 2012, 08:30   #24
bippym
Global Moderator
 
bippym's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 37
Posts: 8,140
I use "blitz" mode which apparently takes over the system for you. My asm knowledge isn't enough to do this project in pure asm so am using blitz to kind of allow me to mess about and have instant results.

I feel it's one of those things they never assumed we would need!
bippym is offline   Reply With Quote
Old 29 July 2012, 20:18   #25
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 297
At least Toni's crystal ball still works. With the A3000 quickstart, the sample works with 2.04 ROM and flounders with 3.1 ROM . A compiled sample is in the Zone. It shows what bippym is talking about.

EDIT: Actually bippym's example works with A1200 & this ROM so the margin is even closer than before.
KS ROM v3.0 (A1200) rev 39.106 (512k) [391523-01/391524-01]

Last edited by clenched; 02 August 2012 at 23:25.
clenched is offline   Reply With Quote
Reply


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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blitz2 Newcommandset bippym Coders. Language 0 21 July 2012 23:59
Laced mode problem Hobbe support.WinUAE 7 23 June 2009 04:27
Blitz2 Manual AlfaRomeo Amiga scene 18 01 May 2009 10:53
Games in laced mode? killergorilla Amiga scene 38 19 October 2007 15:24
That laced mode prob VermillioN support.WinUAE 3 16 November 2002 15:22


All times are GMT +2. The time now is 09:20.

-->

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Page generated in 0.26391 seconds with 11 queries