15 December 2014, 19:43 | #1 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,336
|
VPOSW LOF bit
How does the VPOSW LOF bit work? I know that when the BPLCON0 LACE bit is set, it toggles on/off for successive frames/fields. But what about setting the bit manually, when using a non-interlaced display mode?
I did some testing with WinUAE. I booted to a non-interlaced Workbench and dumped the system copperlist. There were no writes to VPOSW, so I thought that if I write VPOSW once, the LOF bit state would remain at 0 or 1 (depending on the value written). A single write to VPOSW with LOF=1 seemingly does nothing. Busy-looping setting LOF=1 also seems to do nothing. A single write to VPOSW with LOF=0 causes some log output: NTSC mode V=53.6424Hz H=21760.0920Hz (163x405+0) IDX=11 (NTSC) D=0 RTG=0/0 NTSC mode V=53.8143Hz H=21760.0920Hz (163x405+1) IDX=11 (NTSC) D=0 RTG=0/0 (that example done while using a non-interlaced HighGfx mode Workbench) Looping setting LOF=0 causes this log output: NTSC mode V=53.6424Hz H=21760.0920Hz (163x405+0) IDX=11 (NTSC) D=0 RTG=0/0 NTSC mode V=53.6424Hz H=21760.0920Hz (163x405+0) IDX=11 (NTSC) D=0 RTG=0/0 NTSC mode loflace V=53.6424Hz H=21760.0920Hz (163x405+0) IDX=11 (NTSC) D=0 RTG=0/0 and the output image becomes one scanline shorter. (And from the "loflace" text, WinUAE thinks the video signal is interlaced.) Next I tested using an interlaced Workbench: - Looping setting LOF=1 causes one field to be displayed in both odd and even output scanlines. (So the opposite field is never shown) - Looping setting LOF=0 does the same for the opposite field. That happens even when WinUAE's interlaced line mode is set to "double, fields+"... The effect on real hardware must be noticeably different. Perhaps running one of the test programs will show similar output to WinUAE's "single" interlaced line mode: output image non-interlaced, frames alternating between the odd and even scanlines of WB screen? |
15 December 2014, 19:58 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
My crystal ball says you use KS 3.1. It resets LOF in vblank interrupt. (EDIT: Which actually broke some games that partially take over the system and tries to enable interlace or switch it off)
Last edited by Toni Wilen; 15 December 2014 at 20:05. |
15 December 2014, 20:45 | #3 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,336
|
You're right.
I did some more testing (with Kickstart 2.05 this time). Running the loop to set (or clear) the LOF bit causes the display to become non-interlaced, with only odd (or only even) field lines showing. Does that match real hardware? I guess it could, if the system vertical blank interrupt routine reads VPOSR and sets the copperlist pointer based on that. |
16 December 2014, 14:01 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Small correction to my previous post: graphics.library vblank routine only sets LOF bit if current mode (by checking its internal bplcon0 mirror register) is not interlace and LOF is not already set.
I guess it is workaround for interlace to non-lace mode switch that could leave field mode to short fields if interlace was switched off during short field. |
13 February 2015, 17:57 | #5 |
Registered User
Join Date: Nov 2007
Location: Spain
Posts: 29
|
Then, if I'm using KS 3.1, ¿how can I set up an interlaced screen if I can't use LOF to check odd and even scanlines?.
|
13 February 2015, 18:08 | #6 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Quote:
b) Properly take over the system and hit the hardware normally. If you don't want to take over the system but still want to directly use (display) hardware: c) Use OS routines to open interlaced screen first. This way OS knows mode really is interlaced and it does not try to fix it. |
|
13 February 2015, 18:46 | #7 |
Registered User
Join Date: Nov 2007
Location: Spain
Posts: 29
|
Thanks Toni.
Can anyone give me an example in assembler to set up an interlaced screen in a OS friendly way? |
15 February 2015, 22:21 | #8 |
Registered User
Join Date: Dec 2007
Location: Aarhus / Denmark
Posts: 40
|
So THIS is why the sound in my demos sometimes crackles!
I always thought non-interlaced frames were always long. Based on this assumption, I write 573 samples each frame to my circular sound buffer and play it with period 124. 573*124 = 71052 is so close to a long frame, 227*313 = 71051, as to make no difference in practice, and when the frames are indeed long, this works perfectly. However, if the frames are short (which they can be for instance if the demo is started from an interlaced screenmode), this of course breaks horribly... |
25 February 2015, 23:53 | #9 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
i did wonder if it would be possible to achieve sub-pixel vertical scrolling by writing to this bit
|
26 February 2015, 13:45 | #10 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
Quote:
edit: I think it was in the end scroller of this one I used it: http://janeway.exotica.org.uk/release.php?id=185 Last edited by hooverphonique; 26 February 2015 at 13:52. |
|
26 February 2015, 14:21 | #11 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Quote:
Quote:
It still would be normal interlace mode, no need for manual VPOSW writes. It is display device that decides vertical start position and it is decided during early part of vertical blanking. Modifying VPOSW during visible portition of display does nothing. |
||
26 February 2015, 15:02 | #12 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
Quote:
you are right about the interlace part, of course - it's just interlace mode, but using the same bitplane pointers for both fields, and then scrolling the buffer one line every other field (i.e. no manual writes to VPOSW). Last edited by hooverphonique; 26 February 2015 at 15:21. |
|
26 February 2015, 15:07 | #13 | |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,336
|
Quote:
Quote from that: ** The following example creates a View consisting of one ViewPort set ** to an NTSC, high-resolution, interlaced display mode of nominal ** dimensions. This example shows both the old 1.3 way of setting up ** the ViewPort and the new method used in Release 2. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Best Way to Convert 32-bit Signed Value to 16 Bit? | AGS | Coders. Asm / Hardware | 31 | 29 December 2013 13:58 |
32-bit access on 16-bit bus? | NorthWay | Coders. Asm / Hardware | 7 | 04 September 2013 00:46 |
REQ: 17-Bit Artwork 2 (1988-04)(17-Bit Software) | Sea7 | request.Demos | 5 | 13 May 2011 01:07 |
8 bit to optimized 6 bit palette histogram improvements needed | NovaCoder | Coders. General | 0 | 14 April 2011 02:13 |
My A500 is dying bit by bit :( | Old Fool | support.Hardware | 3 | 03 July 2009 17:12 |
|
|