Author Topic: R3 smooth scrolling (it doesn't work on televisions myth - some truth).  (Read 4331 times)

0 Members and 1 Guest are viewing this topic.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
I got a scart cable to connect my cpc to a sony trinitron 4:3 crt television.

I played with some settings (these are the response from the television not the cable or the cpc):

- if I set hsync to less than 8 in basic then pen 0 and the border went black. Not sure if Blue disapears or if the brightness is reduced. I will find out. This means anything using R3 to improve smooth scrolling is not going to work (because it sets it to 5/6)

- if I set hsync to less than 6, the tv can't handle it. I have a picture, but there is a sine wave through the image (like it's distoring using r2 demo effect). So r3 smooth scrolling is not going to work properly.

I will try the flatscreen and I'll see if I can work out any more issues like this.

I didn't see the picture go black and white, it was always in colour but it wasn't happy with the sync.

(Interestingly on the sony CRT television, it allowed R0 to go all the way up to 66 without issue. )
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.784
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4242
  • Likes Given: 446
On an old purely analogue CRT TV, the TV should act exactly like any Amstrad monitor. The more pre-processing being done by the TV (as the Trinitron is most likely doing),  the more likely it is to have problems when messing with the hsync. LCD/Plasma TVs will always have issues with these tricks because the are using sampling to read the analogue signals, so varying the signals after the TV has "locked" on them will cause problems.

There's a Codemasters game from Ian Richards called Transmuter, which I use to grade how good a TV reacts to these effects. I'm not sure what method Ian used to do the scrolling, but it's relatively smooth on an Amstrad monitor, but barely watchable on a flatscreen TV.

Bryce.
« Last Edit: 16:18, 07 December 16 by Bryce »

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.774
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2893
  • Likes Given: 1742
Some Regza (Toshiba) LCD TV display fine the R3 smooth scrolling during around 30s to 1mn and next display a blue screen.
Switching the AV a return work again... More electronics and more (false) problems!
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 380
  • Country: fr
  • Liked: 308
  • Likes Given: 1
On an old purely analogue CRT TV, the TV should act exactly like any Amstrad monitor.

Not quite.

What happens when you shorten the HSync is that the CPC starts generating border in the "blanking" area. On Amstrad monitors, this has no effects, but TVs will use the blanking area to perform calibration of the black level. This is why the border color disappears if there is border in that zone, and it is also why plugging some devices to the CTM display result in unexpectedly light picture (for example, you get that problem with an SNES using an RGB cable).

This happens on purely analogue CRT TVs, as well as video projectors and modern LCDs.

By changing the border color (rasters) or having your HSync happen during the active display area, you can use this to generate gradients (because the black calibration is averaged over several lines). This was experimented by Longshot back in the 90s as he was using an Atari monitor, and rediscovered more recently by some spanish guys trying to shift the screen using R3 adjustment for Plus compatibility, a trick originally suggested on Grimware.

We have then confirmed this on CRT TV (owned by Eliot), video projectors (the one used at the ReSeT party, if you want to come there and repeat the experiment) as well as at least two more recent LCD TVs, including mine.

The other problem with the HSync is how well the TV or monitor deals with unexpected changes and out of range values. The CTM has some kind of PLL to synchronize itself, with the result that it will slowly catch up when the HSync suddenly changes in the middle of a frame. Some other (even CRT) displays will immediately switch to the new sync, without the slow and gradual move. This prevents the "hexagonal pixels" trick to work (ask Supersly about it, it is about changing the sync position every other line to shift the display by about half a pixel). Some other displays (usually modern LCD or projectors) will stop displaying anything for a few seconds, until they can resynchronize.

Offline Carnivius

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.493
  • Country: gb
  • Mayhem Attack Squad
    • index.php?action=treasury
  • Liked: 1075
  • Likes Given: 591
I can't recall exactly which games they were but some of the cassette games I had wouldn't load properly when I used the TV modulator in RF port on either CRT or a HDTV and yet worked fine when using the CPC monitor. 
Favorite CPC games: SwitchBlade, Stryker in the Crypts of Trogan, Turrican II, UN Squadron, Oh Mummy

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.784
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4242
  • Likes Given: 446
but TVs will use the blanking area to perform calibration of the black level.

As soon as you start talking about black level calibration it's no longer a "purely analogue" TV that you're talking about. The original analogue TVs didn't calibrate the black level, only later more modern TVs did this. The PLL circuitry was also a lot simpler back then (it wasn't even a true PLL), usually an internal oscillator would be synced to the sync signal, but it was done with a stepless, analogue method. Modern TVs do the same thing, but completely in the digital domain, by digitizing and sampling the incoming signal. The old TVs would allow you to vary the sync frequency on the fly, the digital systems will not accept any variance once the sync frequency has been locked.

The CTM is an old analogue TV with the receiver missing, nothing else.

Bryce.

Offline keith56

  • ちび悪魔!
  • Supporter
  • 6128 Plus
  • *
  • Posts: 572
  • Country: jp
  • Part Ma, Part Aku... All Chibi!
    • Chibi Akumas Assembly tutorials
  • Liked: 927
  • Likes Given: 211
I take it this is why I cannot play Ghosts and Goblins without my display freaking out when the screen scrolls!

I am using a RGB->VGA box, and a TFT TV - sadly I dont have a CRT of any kind anymore :-(
Chibi Akumas: Comedy-Horror 8-bit Bullet Hell shooter!
Learn ARM, 8086, Z80, 6502 or 68000 with my tutorials: www.assemblytutorial.com
My Livestreaming Channel: ChibiAkimas Live

Offline Axelay

  • 6128 Plus
  • ******
  • Posts: 584
  • Country: au
  • Liked: 383
  • Likes Given: 87

I take it this is why I cannot play Ghosts and Goblins without my display freaking out when the screen scrolls!



Yes, it is, and the same for anything else listed here with a 'Yes' in the R3 column.



There's a Codemasters game from Ian Richards called Transmuter, which I use to grade how good a TV reacts to these effects. I'm not sure what method Ian used to do the scrolling, but it's relatively smooth on an Amstrad monitor, but barely watchable on a flatscreen TV.


A bit off topic, but I checked out Transmuter to see if I'd missed something interesting, but it doesnt seem to be altering CRTC registers at all.  The scrolling is pure software, it's just using LDIR in a loop directly on the visible screen, which is why the player sprite rocks back and forth as it keeps needing to be corrected after being moved by the scroll.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.784
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4242
  • Likes Given: 446

Yes, it is, and the same for anything else listed here with a 'Yes' in the R3 column.




A bit off topic, but I checked out Transmuter to see if I'd missed something interesting, but it doesnt seem to be altering CRTC registers at all.  The scrolling is pure software, it's just using LDIR in a loop directly on the visible screen, which is why the player sprite rocks back and forth as it keeps needing to be corrected after being moved by the scroll.

So Transmuter just generally has crap scrolling? :D

Bryce.

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 380
  • Country: fr
  • Liked: 308
  • Likes Given: 1
As soon as you start talking about black level calibration it's no longer a "purely analogue" TV that you're talking about.

How do you explain the RGB output of the SNES being light grey when plugged on the CTM, and black everywhere else? Yes, really everywhere else. Old TVs, Amiga 1084s, etc.
The black calibration can be done in a pure analogue way, and must be done for some machines to work properly.

How old does the TV need to be for you to consider it "pure analogue"? 1990? 1980? 1920?

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.784
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4242
  • Likes Given: 446
How do you explain the RGB output of the SNES being light grey when plugged on the CTM, and black everywhere else? Yes, really everywhere else. Old TVs, Amiga 1084s, etc.
The black calibration can be done in a pure analogue way, and must be done for some machines to work properly.

How old does the TV need to be for you to consider it "pure analogue"? 1990? 1980? 1920?

1920? :D Colour TV's only came 30 years later.

I don't know the exact details of the SNES RGB output, but I think I know what you mean by "calibrating" now. You're just referring to the black reference voltage? This isn't really "calibrated" it's a instant voltage comparison and yes, you're correct, the CTM doesn't properly do this because it assumes that it will only ever be connected to a CPC with known signal levels, so anything else you connect might be displayed slightly dark/lighter than it should be.

Bryce.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
I take it this is why I cannot play Ghosts and Goblins without my display freaking out when the screen scrolls!
I will be doing more testing and I'll have a go at fixing it. :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.852
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1031
  • Likes Given: 1124
All this just tells me that i have to stablish a service to repair and service original screens. The service will run until I eventually die electrocuted in the most horrible way or with a tumour  :picard2:

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 910
  • Liked: 443
  • Likes Given: 73
That's one option. Another might be some sort of hardware device that "knows" about these kinds of things and fakes the "correct" output. No idea how feasible that is though....

Offline Nich

  • Supporter
  • 6128 Plus
  • *
  • Posts: 743
  • Country: gb
  • CPC Game Reviews webmaster
    • CPC Game Reviews
  • Liked: 638
  • Likes Given: 757
So Transmuter just generally has crap scrolling? :D

Transmuter just generally is crap. Full stop. :laugh:

On the other hand, I don't think I've ever played it on a real CPC, only on an emulator, so I wasn't aware until now that there were any differences in the scrolling.
« Last Edit: 22:22, 08 December 16 by Nich »

Offline CanonMan

  • CPC6128
  • ****
  • Posts: 152
  • Liked: 19
  • Likes Given: 41
Transmuter just generally is crap. Full stop. :laugh:

On the other hand, I don't think I've ever played it on a real CPC, only on an emulator, so I wasn't aware until now that there were any differences in the scrolling.


I have played it on a real CPC, it was one of the first games I bought....


....and it is crap!  :laugh:

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478

I have played it on a real CPC, it was one of the first games I bought....


....and it is crap!  :laugh:

Transmuter doesn't use double buffer, so it's drawing directly to the visible screen.
It's probably racing the beam too.
To see it smooth you probably need to have exactly a 50hz display and with the amstrad monitor's persistence.

The player sprite moves backwards and forwards - i'm guessing it's not intentional - it's a bug and it's a frame behind (OR, when it's re-drawn taking the racing the beam into account, it's actually correct!)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Axelay

  • 6128 Plus
  • ******
  • Posts: 584
  • Country: au
  • Liked: 383
  • Likes Given: 87
Transmuter doesn't use double buffer, so it's drawing directly to the visible screen.
It's probably racing the beam too.
To see it smooth you probably need to have exactly a 50hz display and with the amstrad monitor's persistence.

The player sprite moves backwards and forwards - i'm guessing it's not intentional - it's a bug and it's a frame behind (OR, when it's re-drawn taking the racing the beam into account, it's actually correct!)


I'm not convinced that it was trying to chase the beam.  See the scroll code from the game below - it's far too slow to chase the beam, it's 'lapped' by it several times!


Code: [Select]

    call #bd19
    ld hl,#c001
    ld de,#c000
    ld a,#10
.l1680
    push af
    ld a,#08
.l1683
    push af
    xor a
    ld bc,#004f
    ldir
    ld (de),a
    ld hl,#07b1
    add hl,de
    push hl
    pop de
    inc hl
    pop af
    dec a
    jp nz,l1683
    ld hl,#3fb0
    ex de,hl
    or a
    sbc hl,de
    push hl
    pop de
    inc hl
    pop af
    dec a
    jp nz,l1680

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
@Axelay maybe I thought it was winning the race, but I can see now it's far behind.
LOL.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
Testing on my CPC6128 type 1 sony trinitron tv and scart cable:

similar response for r3 except 5 is not stable so 6/5 scroll not smooth enough.
 
R2=49 (left side has ~ half char border)
R1=47 (right side has ~ half char border)
R7=34
R6=32
 
EDIT: The scrolling is actually ok on relentless. I'm going to guess because the r3 value during vsync is ok, and during scroll area it's changing.
« Last Edit: 15:05, 10 December 16 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
on the flatscreen:

 flatscreen TV: type 1
ff reduced border left side
fd larger border left, and shift screen down a little
f9 display goes a bit dull (maybe half brightness?) if colour - set border to black
f8 duller
f6/f5 works  - r3 scrolling is good.
 
 
visible area:
 
R2=50 (left side has ~ half char border
R1=47 (right side has ~ half char border
R7=34 (top border half char)
R6=33 (bottom border half char)

NOTE: R4 can go as high as you want and it will not roll the screen.
NOTE: R0 can go to about 69 before it can't sync.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
@keith56: Is the screen static if you start the game and do nothing? Does it show colour?

Ghosts n goblins starts with R3=5, so if the picture is stable and has colour, then clearly the television you have supports that.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 786
  • Country: gb
  • Liked: 288
  • Likes Given: 419
Maybe the solution is a custom CPC->HDMI convertor using an FPGA that actually understands the tricks that the CPC pulls on the signals for scrolling, etc. Obviously this wouldn't be as cheap a solution as a CPC->SCART cable ...

Offline keith56

  • ちび悪魔!
  • Supporter
  • 6128 Plus
  • *
  • Posts: 572
  • Country: jp
  • Part Ma, Part Aku... All Chibi!
    • Chibi Akumas Assembly tutorials
  • Liked: 927
  • Likes Given: 211
@keith56: Is the screen static if you start the game and do nothing? Does it show colour?

Ghosts n goblins starts with R3=5, so if the picture is stable and has colour, then clearly the television you have supports that.

The game is all looks normal and good until the screen scrolls, at which point it kind of rolls and blacks out, then after a moment it comes back and the game is playable normally again - as you say it sounds like R3=5 is ok.

Unfortunately, being unable to see the screen for so long means I'm probably dead by then!

This is what I connect my CPC with
http://www.octoate.de/wp/articles/connect-cpc-to-vga-display/
I don't know enough about the box to know if it is converting to a digital image, or if the weird syncing is "passed up" through the VGA port to the flatscreen TV
Chibi Akumas: Comedy-Horror 8-bit Bullet Hell shooter!
Learn ARM, 8086, Z80, 6502 or 68000 with my tutorials: www.assemblytutorial.com
My Livestreaming Channel: ChibiAkimas Live

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
The game is all looks normal and good until the screen scrolls, at which point it kind of rolls and blacks out, then after a moment it comes back and the game is playable normally again - as you say it sounds like R3=5 is ok.

Unfortunately, being unable to see the screen for so long means I'm probably dead by then!
I will make some test programs that use r3 for scrolling but do different things to compensate for the problem you see. Would you mind testing them?

If I can find a method that works on your television I can patch the game. The ultimate is a patch that completely removes the r3 scrolling which I know will work for all but I want to see if I can find a way to make r3 scrolling work in more situations :)


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