English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 15 November 2019, 16:54   #1
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,385
Question Correctly setting up an interlace screen

I have a small question: how do you correctly set up an interlaced screen in a HW banging no OS present situation?

That is, I know which bits to set in BPLCON0 and I do get an interlaced screen, but when testing sometimes it appears the 'order' of the fields is wrong and other times it's correct (meaning sometimes WinUAE shows a distorted screen where the odd and even lines seem to be mixed up, other times running the very same code it shows correctly). This leads me to suspect I'm missing something about how to correctly initialize an interlaced screen.

My code always shows the bitmap containing the even lines on the first frame (0,2,4, etc), the bitmap containing the odd lines on the second - and then repeats this forever. Is there something else I should be doing? Am I supposed to check what kind of field the Amiga is "in" first? If so, how do I do this?

As I'm not at my development PC I don't have the code on hand so I'm first asking for the correct procedure
roondar is offline  
Old 15 November 2019, 17:10   #2
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,002
Yes, to get the field sync correct, you need to set your bpl pointers according to if you're currently in the long or short field.

IIRC, you can read bit 15 of VPOSR to check for long frame (LOF).
hooverphonique is offline  
Old 15 November 2019, 17:13   #3
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 147
I've only ever done it once in a demo when I was 16, but looks like I setup two copperlists for long and short frames and then before starting it for the first time I found this snippet of code which looks to be what hooverphonique says

Code:
.ll	move.w	vposr(a5),d0
	btst	#15,d0
	beq	.ll

	Move.l 	#titleCopperlist1,Cop1lch(a5)
	Move.w	#0,Copjmp1(a5)		;Start copper1
I doubt I got it right at the time but it looks ok when I play the demo. There's _zero_ comments in this code, wtf was I thinking. I was going "bit 15 eh" before read previous reply
Antiriad_UK is offline  
Old 15 November 2019, 17:30   #4
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,385
Thanks for the info, I'll make the required changes to do this

One follow-up question: do either of you know where this is documented (I assume it's in the HRM and I just missed it), as I'd like to know where to find stuff
roondar is offline  
Old 15 November 2019, 17:32   #5
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,002
Check the HRM for VPOSR

Edit: http://amigadev.elowar.com/read/ADCD.../node0045.html

Last edited by hooverphonique; 15 November 2019 at 17:51. Reason: add link to HRM
hooverphonique is offline  
Old 15 November 2019, 17:48   #6
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 147
Looks like I found it on page 110 of Amiga System Programmers Guide. Doesn't seem explicitly spelled out in HKRM 1.3.
Antiriad_UK is offline  
Old 15 November 2019, 18:26   #7
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,241
A little warning: the messed up display could be from a previous frame ended-up in a last short frame.
Remember that the LACE bit in BPLCON0 is a toggle (if 1, change LOF bit on next frame).

So the better and most effective way is to force the very first laced long frame with a write to VPOSW.
A
move.w #$8000,$dff02a
do the job.
ross is offline  
Old 15 November 2019, 19:00   #8
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,241
This:
Quote:
Originally Posted by Antiriad_UK View Post
Code:
.ll	move.w	vposr(a5),d0
	btst	#15,d0
	beq	.ll

	Move.l 	#titleCopperlist1,Cop1lch(a5)
	Move.w	#0,Copjmp1(a5)		;Start copper1
can end in a infinite loop

If you start on progressive (default LOF) then someone setup an interlace screen and badly exit to progressive on short frame..
ross is offline  
Old 15 November 2019, 22:45   #9
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 147
I blame my younger self noted

Edit: And from reading the recent threads from Toni about using copjmp from CPU I'd be scared
Antiriad_UK is offline  
Old 18 November 2019, 15:54   #10
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,660
Quote:
Originally Posted by ross View Post
A little warning: the messed up display could be from a previous frame ended-up in a last short frame.
Remember that the LACE bit in BPLCON0 is a toggle (if 1, change LOF bit on next frame).

So the better and most effective way is to force the very first laced long frame with a write to VPOSW.
A
move.w #$8000,$dff02a
do the job.
This setting must be done every frames, or just the first time, before entering the main loop?
sandruzzo is offline  
Old 18 November 2019, 18:03   #11
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,241
Quote:
Originally Posted by sandruzzo View Post
This setting must be done every frames, or just the first time, before entering the main loop?
Just in very first frame (to set up a definite start for successive frames).
Then the LACE auto-toggle bit do the work for you.
ross is offline  
Old 18 November 2019, 19:07   #12
dodke
Registered User

 
Join Date: Feb 2018
Location: London / UK
Posts: 73
I think it might also be safest to reset the long frame bit and set the primary and secondary copperlists in the vblank to make sure the bit is not toggled before your copperlist starts. Also remember to test that it works from both an interlaced and non-interlaced WB screens.
dodke is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting screen resolution mcgeezer Coders. General 4 13 May 2019 23:09
Setting application screen positions? Sinphaltimus support.Other 2 22 January 2018 03:26
skweek doesn't display the screen correctly ldaneels support.WinUAE 5 04 April 2014 21:10
Problem with Interlace Boot Screen R-TEAM support.FS-UAE 2 25 March 2014 06:58
How to get T2: Arcade Game loading screen to display correctly? MethodGit Coders. General 15 30 July 2012 18:37

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 14:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07518 seconds with 13 queries