kiss 'n' tell

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
simon
Posts: 163
Joined: Wed Nov 27, 2013 8:56 pm

kiss 'n' tell

Post by simon »

I'm doing a bit of a kiss 'n' tell series on the coco FB page, so i thought i would share something with you guys too...

OVERSCAN

Image

here is some code to back that up:

org $3f00
lda #$ff
tfr a,dp
sta <$c3
sta <$c5 ;(mode)

orcc #$50 ;kill irq/firq
lda <$01
ora #5
sta <$01
lda <$00
sync


vsync lda <$03 ;poll vsync
bpl vsync
lda <$02 ;ack

main ldb #26+6+13+25 (NTSC + 50 for pal)
hsync1 lda <$00
sync
decb
bne hsync1
ldb #192 ;visible screen (192 lines)

hsync2 lda #$b0 ;2
sta <$22 ;4
lda #$f0 ;2
sta <$22 ;4 (12)
brn * ;3
brn * ;3
brn * ;3
brn * ;3
brn * ;3
brn * ;3 (18)

brn * ;3
brn * ;3
brn * ;3
brn * ;3
brn * ;3
brn * ;3 (18)

nop ;2
nop ;2
decb ;2
bne hsync2 ;3 (57 cycles)

jmp vsync
simon
Posts: 163
Joined: Wed Nov 27, 2013 8:56 pm

Re: kiss 'n' tell

Post by simon »

what this is *BASICALLY* doing is a 16/32 byte mode shift on a per line basis....

the sam/vdg *HAVE* to finish the 16 byte mode b4 shifting to the 32 byte, so the excess goes where ? (SIDEBORDER)

/Simon :-)
Last edited by simon on Sun May 24, 2015 11:16 pm, edited 1 time in total.
sorchard
Posts: 530
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: kiss 'n' tell

Post by sorchard »

Just when I thought I was beginning to understand this machine you find all these hidden effects...

How many extra pixels can you get and what happens if you push it too far on real hardware?
Stew
simon
Posts: 163
Joined: Wed Nov 27, 2013 8:56 pm

Re: kiss 'n' tell

Post by simon »

well...

you need to work px stuff out 4 yourselves.... (but if you combine the hack with 42 byte dma then its 42*8 = 336 px).....

real HW, well some monitors behave, some don't... this example was a bit *in yur face* eg-pushing quite far into the border....

if you push TOO far, yur monitor is gonna crap itself....

you can vary the timing yurself by studying whats what .asm wise... ( i know how, but not gonna tell all)...

/Simon :ugeek:
sorchard
Posts: 530
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: kiss 'n' tell

Post by sorchard »

Here are some captures of the video output at the monitor port:

Firstly normal.png is one-and-a-bit lines from a normal black pmode 4 screen. The hsync pulses are the lowest levels and the white borders are the highest levels. One hsync to the next is 64us as expected.
normal.png
normal.png (1.18 KiB) Viewed 3291 times
The next set of captures is from a screen with the overscan routine running. There's a bit of distortion at the top where the border curves for a few lines before settling down for the rest of the screen. It is stable though, meaning the same thing is happening each frame.

overscan1.png is from a line with overscan. The left border is larger and the right border is smaller. The line is still 64us long. Most of the 192 lines look like this.
overscan1.png
overscan1.png (1.18 KiB) Viewed 3291 times
overscan2.png was captured near the top of the screen where there was a bit of data from the text screen. This line is 65us long.
overscan2.png
overscan2.png (1.27 KiB) Viewed 3291 times
overscan3.png is a black line, also longer than normal. I'm guessing this must have been from near the top of the screen as that is where the distortion is. I had to press the capture button a lot of times before this one appeared, so there can't be many lines like it. The second hsync looks long as well.
overscan3.png
overscan3.png (1.17 KiB) Viewed 3291 times
overscan4.png is near the top of the screen (text screen data visible) but with normal timing. Not many of these on screen either.
overscan4.png
overscan4.png (1.24 KiB) Viewed 3291 times
It looks like it's the change from 64us to 65us lines that is messing things up, but the vdg somehow gets back to a 64us line, even with the overscan. Figure that one out :-)
Stew
simon
Posts: 163
Joined: Wed Nov 27, 2013 8:56 pm

Re: kiss 'n' tell

Post by simon »

Nice one Stew...

you tell me....

i know it works......

/Simon :-)
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: kiss 'n' tell

Post by sixxie »

XRoar's behaviour on this is pretty simplistic at the mo (working on it, though basic "overscan" behaviour has been supported for a while), but there's more to it than I thought: it's possible just through VDG mode changes to get it not fetching any data at all for a line (no DA0 transitions).

Jealous of you having a capture device you can pick out particular lines from! I inherited a waveform monitor that was a bit too "pro" and fails to give me line select if it doesn't detect the half lines of proper PAL interlace. My only analogue device is a Hantek DSO2090, and it's... basic.

Trying to resist splurging on a Logic Pro 8 or 16 from these guys: https://www.saleae.com/ - I have the old digital-only 16 channel one and it's great, but analogue on top of that is a serious temptation...
sorchard
Posts: 530
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: kiss 'n' tell

Post by sorchard »

xroar does have some impressive 'emergent' behaviour. I did at one point see the discontinuity in the overscanned screen roll up the display in a very similar way to the real thing.

'line n' capability on the scope I was using would have been nice, (and I spent quite a bit of time in the menus looking for one), I just figured out very roughly where on the screen it was from the video content and hit the acquire button a lot of times until something interesting popped up. The bit of text screen garbage at the top makes a handy signature.

I did wonder how best to figure out exactly which line was captured and had the following thoughts:
- Fill the screen with a pattern that's different on each line.
- Build a counter/comparator (cpld/fpga?) and trigger from that
- Trigger off screen address with a logic probe

I keep meaning to sort myself out a logic probe. It would probably be a Sump compatible bit of hackery (http://www.sump.org/projects/analyzer/) as I already have a Spartan 3 board. For analogue capability I would cheat and trigger a separate scope from the logic probe.

Time is limited unfortunately and I wish I went in a bit better prepared so I might have got some more useful data. Simple things like soldering on some decent ground connection points and grabbing some more IC test clips from work. Next time Gadget, next time...
Stew
Post Reply