News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

fake vsync?

Started by arnoldemu, 07:59, 28 October 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

Try this on a *REAL* CPC. It doesn't work on emulators and likely doesn't work on the Plus.

It *should*, but not yet tested, work on the costdown cpc.

What you *should* see: a black bar across the screen.

What am I doing? I've set PPI port B to output, and I've poked the vsync bit.
I can force it on and off as I want, and the display shows that.

in my test I tried turning it on and off, but it seems the monitor just accepts the vsync and does it, producing a think horizontal black bar.

I will do more tests...

it doesn't seem useful at the moment, just interesting.

So there you go, I can send the gate-array a fake vsync. The CRTC hasn't sent it, I did XD


org &4000

km_read_key equ &bb1b
mc_wait_flyback equ &bd19
scr_set_mode equ &bc0e
txt_output    equ &bb5a

start:
;; set the screen mode
ld a,1
call scr_set_mode

ld bc,24*40
ld d,' '
l1:
inc d
ld a,d
cp &7f
jr nz,no_char_reset
ld d,' '
no_char_reset:
ld a,d
call txt_output
dec bc
ld a,b
or c
jr nz,l1

di
ld hl,&c9fb
ld (&0038),hl
ei



loop:
ld b,&f5
l2:
in a,(c)
rra
jr nc,l2

halt

halt

halt

ld bc,&f700+%10000000
out (c),c
ld b,&f5
ld d,1
ld e,0

;; need a better test to see if it can be turned off mid-line
rept 16
out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]

out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]
out (c),d        ;; [4]
out (c),e        ;; [4]
endm
ld bc,&f782
out (c),c

halt

jp loop

end start


EDIT: You can get a bin file here: http://www.cpctech.org.uk/vsync_o.bin
or a CDT http://www.cpctech.org.uk/vsync_o.cdt
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

Yup, that should work no problem, and it shouldn't have any negative effects on the hardware either by the way. It may not be as useless as you think. If you monitor the real vsync, then swap to output and add your own vsync at the correct moment, you could possibly make some cool effects in a Demo?
This effect won't work properly on an LCD / S-Video / VGA Modulator system though. Only on Analogue SCART or original CPC Monitors.

Bryce.

arnoldemu

Quote from: Bryce on 08:30, 28 October 11
Yup, that should work no problem, and it shouldn't have any negative effects on the hardware either by the way. It may not be as useless as you think. If you monitor the real vsync, then swap to output and add your own vsync at the correct moment, you could possibly make some cool effects in a Demo?
This effect won't work properly on an LCD / S-Video / VGA Modulator system though. Only on Analogue SCART or original CPC Monitors.

Bryce.
I agree.  I will need to do a bit more testing, because the black bar is about 20 lines tall and across the whole screen.
It may be possible to turn the vsync on/off momentarily for the effect wanted.

The other side effect is that if I leave my vsync active for at least 2 lines, I can force an interrupt to occur 2 lines after I started it.

So start my vsync, and then an interrupt will trigger and I can turn it back off again.
not quite as good as real programmable interrupts...

I will do more testing, but time is running out, the wife and daughter return on sunday.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

The black line is most likely the blanking gap that is used to return the scanline back to the top left corner. Because the CRTC doesn't know that a vsync is being performed, the blank signal is produced somewhere in the middle of the screen. You will be able to move its position by timing your vsync signal. You might also be able to change its height by playing around with CRTC Registers 0 to 8. Can you make a small program that displays the black bar in the centre and allows you to manually vary these register values while it's running? That might create some crazy effects :)

Bryce.

TFM

You can use this cool finding for overscan/fullscreen screens when using more that one split blocks!!! That provides a bunch of new possibilities for games :-)))
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

Quote from: TFM/FS on 05:09, 29 October 11
You can use this cool finding for overscan/fullscreen screens when using more that one split blocks!!! That provides a bunch of new possibilities for games :-)))
I am not sure it is so useful.

The monitor sees the vsync, and it makes a horizontal bar approx 20 lines tall, even if I turn my vsync on/off quickly. I can choose the length of the vsync by the time I leave bit 0 as 1. So the length defined by the CRTC R3 doesn't make any difference here because I have control.
:( I don't think there is much use for it at this time :(

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Gryzor

So... maybe design a game that actually uses the bar as a setting element? :)

TFM

Right, it seperates Player 1 and 2.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Gryzor

Ooh, nice idea...

arnoldemu

Quote from: Gryzor on 19:49, 31 October 11
Ooh, nice idea...
it doesn't work on all crtc types or 8255 versions.
I can't say if the result is dependent on crtc, 8255 or both.

It does work on my  6128 with type 0, but doesn't work on 6128 with type 1 or 6128 with type 2.
I don't know which 8255 they use, but from other testing they are not all the same.

I know that there are differences in the 8255 models (reading their control port register gives different results).

In addition, on the type 0, where it works, the vsync seen on the monitor starts when I signal it, so it seems gate-array passes it directly, so it can start in the middle of the line, or where you want.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

Different versions of 8255?.This is new for me.


How many version are there?.


Have you tried it in the cost-down?


arnoldemu

Quote from: dragon on 13:23, 12 November 11
Different versions of 8255?.This is new for me.


How many version are there?.


Have you tried it in the cost-down?
Looking at the schematics pictures:

The following z80's were used:
SGS Z840?APS
zilog z8400aps
sgs z8400ab1
z0840004psc
Z8400AB1

The following 8255's:
D8255AC-2
D8255AC-5
tmp8255ap-5
(also 8255 "emulation" in plus)

The following crtcs:
mc6845p
hd6845sp
um6845
um6845r
plus asic
costdown asic


No i didn't try it on plus or cost down yet.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

QuoteNo i didn't try it on plus or cost down yet.


Then i prove it and tell you.

dragon

#13
It not work in the cost down.Instead of black bar I think He displayed The entire ascii code of cpc:

And not work in the plus,and not work in my two cpc 464,with 40007 and 40010 gate array.And two thosiba 8255AP-5.

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]UP `abcdefghijklmnopqrstuvwxyz{|}ñ simbol.


And repeat the string.....
..

arnoldemu

Quote from: dragon on 21:01, 15 November 11
It not work in the cost down.Instead of black bar I think He displayed The entire ascii code of cpc:

And not work in the plus,and not work in my two cpc 464,with 40007 and 40010 gate array.And two thosiba 8255AP-5.

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]UP `abcdefghijklmnopqrstuvwxyz{|}ñ simbol.


And repeat the string.....
..
which crtc model does your cpc464 have?

thankyou for testing on your computers ! :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

#15
The UM6845(in the 40007) and the UM6845R in the 40010

Whats is the combination that works?

Quotethankyou for testing on your computers ! :)

No problem,if you need test a feature in the cost-down or other just say :).


Powered by SMFPacks Menu Editor Mod