Author Topic: Question about GateArray  (Read 5250 times)

0 Members and 1 Guest are viewing this topic.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Question about GateArray
« on: 15:09, 01 July 12 »
Grim means, that in a GateArray type 40010 the pixels between MODE 0 and 2 are shifted.

http://www.grimware.org/doku.php/documentations/devices/gatearray#iivram.rasterization.timings

Now my question:
- Does it also affect the border? (It should, I think)
- Does this only happen between MODE 0 and 2? Or also between MODE 1 and 0 / 1 and 2?
- If it affects the border, is the right border not affected?

Screenshot:


When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 275
  • Likes Given: 610
Re: Question about GateArray
« Reply #1 on: 15:39, 01 July 12 »
Interesting question , that hurts my interest.
Checked on my 6128 with 40010 and the reply is yes.That affects the border on left and right.
I may try on my 664 (40008?) if really needed (i must out it of the boxes before!)
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #2 on: 17:21, 01 July 12 »
Also would be interesting to know, what happens in a "normal" mode split?
(Like in Mircolor)
Are the mode 2 pixels here shifted, too? (They should, I think)

And more important:
When you run a demo like "Batman Forever" (the flip screen part)
What causes the GA to dither the 2 half images with different offsets? (We also see here a pixel shift between both images)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #3 on: 17:57, 01 July 12 »
Ok, seems, that Batman Forever uses a register 2 trick here:
(Deinterlaced screenshot)

Edit: Question is now: Does it shift about 2 or 1 MODE 2 pixels?
« Last Edit: 18:34, 01 July 12 by Devilmarkus »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #4 on: 19:51, 01 July 12 »
I remember having looked at it a while ago. I wasn't able to see any shift at all between lines in this Batman Forever picture on a real CPC.

I'm still wondering if Rhino has put that stuff with the goal of enhancing the picture, or if it was simply a very clever anti-emulator trick. ;)
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #5 on: 20:03, 01 July 12 »
Fact: between both images CRTC register 2 toggles between 0x032 and 0x031.
This wouldnt be necessary if you don't want to add "wobbling pixels" ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #6 on: 20:14, 01 July 12 »
Fact: the picture looks worse with shift (even with only 1 pixel mode2 shift), than without any shift at all. :P
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #7 on: 20:16, 01 July 12 »
Sure, but its important to emulate this thing, too...
In WinApe we have 2 mode 2 pixelshift
In WinCPC we have 3
In CPCe we have 4 :D

Edit: I forgot CPCBox: here we also have 3 pixels... But the right border is missing...
« Last Edit: 20:25, 01 July 12 by Devilmarkus »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #8 on: 20:41, 01 July 12 »
Sure, but its important to emulate this thing, too...
In WinApe we have 2 mode 2 pixelshift
In WinCPC we have 3
In CPCe we have 4 :D

Edit: I forgot CPCBox: here we also have 3 pixels... But the right border is missing...
Oh! Bad boy! :P
There's one of the 2 alternating images of this picture that look worse than the other one on emulators. I'm sure you know that since you've looked at it closely.
You showed the worst one with CPCBox and the best one with JavaCPC...

CPCBox is only 1 pixel mode2 worse than JavaCPC and 2 pixels mode2 worse than a real CPC. And I have the exact same rendering as WinApe on this picture.
Spreading bullshit is not useful you know. ;)
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #9 on: 20:55, 01 July 12 »
Humm that wasnt my goal ;)
In JavaCPC there did not exist any pixelshifting... (I am actually coding on it)

Also it's boring to view the complete 9 minutes again in CPCBox to get 2 proper screenshots ;)
You should add SNA support :P

Sure a half-image looks more weird:
 [ Invalid Attachment ]

But my question is:
How much pixelshift is accurate here?
« Last Edit: 20:58, 01 July 12 by Devilmarkus »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #10 on: 21:08, 01 July 12 »
Just to be fair, a comparison between JavaCPC and CPCBox on the same picture:

[attachimg=1]

People will judge for themselves. 8)
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #11 on: 21:24, 01 July 12 »
People will judge for themselves. 8)

Sure... ;) (If its important)
But back to my question please :D
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2261
  • Likes Given: 3478
Re: Question about GateArray
« Reply #12 on: 11:55, 02 July 12 »
I remember having looked at it a while ago. I wasn't able to see any shift at all between lines in this Batman Forever picture on a real CPC.

I'm still wondering if Rhino has put that stuff with the goal of enhancing the picture, or if it was simply a very clever anti-emulator trick. ;)
it was an intentional trick to increase horizontal resolution.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.578
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2704
  • Likes Given: 1606
Re: Question about GateArray
« Reply #13 on: 12:32, 02 July 12 »
it was an intentional trick to increase horizontal resolution.
I don't realy understand.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #14 on: 12:41, 02 July 12 »
it was an intentional trick to increase horizontal resolution.
Do you have any elements to back this up?
I took photos of that picture running on a real CPC, there wasn't any shift at all between lines and I didn't see any horizontal resolution increase.
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline ralferoo

  • Supporter
  • 6128 Plus
  • *
  • Posts: 969
  • Country: gb
  • Liked: 581
  • Likes Given: 222
Re: Question about GateArray
« Reply #15 on: 13:11, 02 July 12 »
I'm joining this discussion late and to be honest, I haven't really paid all that much attention to the discussion, but certainly I agree with arnoldemu that shifting the screen on alternate lines does appear to increase apparent horizontal resolution.

If you're doing a diagonal line, it'll be smoother along the edge and if you're doing a vertical line, it'll appear to wobble on a crisp emulator, but that'll just look a bit fuzzy on a real screen. So, like everything, it's a trade off, but IMHO will probably make most art look smoother.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #16 on: 13:21, 02 July 12 »
Do you have any elements to back this up?
I took photos of that picture running on a real CPC, there wasn't any shift at all between lines and I didn't see any horizontal resolution increase.

Perhaps this is also one of these 40007/8 - 40010 differences?
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.578
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2704
  • Likes Given: 1606
Re: Question about GateArray
« Reply #17 on: 13:35, 02 July 12 »
On increased by... 1 pixel wide?  ???
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2261
  • Likes Given: 3478
Re: Question about GateArray
« Reply #18 on: 15:51, 02 July 12 »
Do you have any elements to back this up?
I took photos of that picture running on a real CPC, there wasn't any shift at all between lines and I didn't see any horizontal resolution increase.
I talked with Rhino about it. He wrote a doc. I may still have it.
The effect is a mixture of the result of the gate-array (40007/8/9/10 differences AND the monitor's response).

EDIT: This thread is another one of those my emu is better than yours isn't it?
Well I can safely say, my emu is *NOT* better than javacpc or cpcbox in this respect.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #19 on: 16:03, 02 July 12 »
I talked with Rhino about it. He wrote a doc. I may still have it.
The effect is a mixture of the result of the gate-array (40007/8/9/10 differences AND the monitor's response).
Good to know!

Quote
EDIT: This thread is another one of those my emu is better than yours isn't it?
Well I can safely say, my emu is *NOT* better than javacpc or cpcbox in this respect.
No, I didnt start this topic because this reason...
I just wanted to know CRTC and GateArray behaviours with "special" values...
But I still got no reply yet, why and how this happens.... :(

(Register 2 I mean, in which cases does it this 3 pixels width (or 2 or 1 or however) pixelshift?)

And perhaps the "my di** is larger than yours"-people one day understand: Not the size matters :D
Really, every emulator has it's pro's and con's.

I am developping JavaCPC just for pure fun and not because I wanna be a CPC-god!!!
Arnold has many pro's and is a powerful emulator, and I am sure, your next release will blame the others ;)
« Last Edit: 16:05, 02 July 12 by Devilmarkus »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 469
  • Country: fr
    • CPCBox - CPC emulator in JavaScript
  • Liked: 163
  • Likes Given: 187
Re: Question about GateArray
« Reply #20 on: 17:53, 02 July 12 »
And perhaps the "my di** is larger than yours"-people one day understand: Not the size matters :D
That's a lie you keep telling to yourself to reassure you about THAT problem :P

Really, every emulator has it's pro's and con's.
+1. I hate the vision that some users expressed about their dreams of a one-size-fits-all emulator where every emu author is forced to contribute to an hypothetic only one ubermaster CPC emulator of existence.
The world is better when users have choice.

I am developping JavaCPC just for pure fun and not because I wanna be a CPC-god!!!
Arnold has many pro's and is a powerful emulator, and I am sure, your next release will blame the others ;)
@arnoldemu: Do you have any plan about when it will come out? The last version was released so long ago :(
« Last Edit: 18:00, 02 July 12 by phi2x »
Atwood's law (2007): "Any application that can be written in JavaScript, will eventually be written in JavaScript."

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: Question about GateArray
« Reply #21 on: 07:12, 03 July 12 »
Having not delved into the source code to Batman Forever, I would presume the effect is caused by changing the value of register 2 on every scan line. Totally independent of the Gate Array type, this will cause the CTM or GT monitor to adjust the internall PLL frequency to suit the new HSYNC position, but it won't have enough time to adjust it by the entire 16 Mode 2 pixels in one scan line, so it will only move a bit (1 or 2 MODE 2 pixels perhaps), then back again when the value is changed back. Modern LCD monitors and even TVs probably don't have any such analogue phase locked loop circuitry and will respond to the change in various ways.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Question about GateArray
« Reply #22 on: 12:57, 03 July 12 »
Yes, register 2 toggles between &31 and &32 every scanline.

Should cause a 8 pixel shift, but it moves less. 2-3 or so.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2261
  • Likes Given: 3478
Re: Question about GateArray
« Reply #23 on: 15:05, 03 July 12 »
Yes, register 2 toggles between &31 and &32 every scanline.

Should cause a 8 pixel shift, but it moves less. 2-3 or so.
well, some things here:
1. the shift is a monitor response. you need to give it more than 1 line to perform the full response, perhaps 8 lines?
if not, it moves a smaller amount.

2. the shift is 16 pixels in mode 2 using r2 which is 1 crtc char. R3 is used to make smaller shifts. both together can be used.
r2 defines the position of the hsync, r3 defines the length of the hsync. monitor response is based on the end of the hsync. So if the position is changed AND/OR length is changed you have differing results.

3. the movement by a small amount using r2 is not new, I have seen it before but I didn't think to use it to make a screen like this.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2261
  • Likes Given: 3478
Re: Question about GateArray
« Reply #24 on: 15:09, 03 July 12 »
@arnoldemu: Do you have any plan about when it will come out? The last version was released so long ago :(
No plan yet no.

The monitor emulation doesn't exist, and some things are broken because I re-worked the code.

The new UI is working well including the nice new and more powerful debugger. The emulation is more accurate after the many tests I have written and tested on real cpcs. I also now support using inkz80 emulation core that a friend wrote.

Last weekend I tested R1/R6 on type 0,1 and 2. I wanted to confirm the R6=0 value on type 1 and to see if other values made border. The result was that only R6=0 makes border, or when VCC (internal counter)==R6. I wondered if the result was R6<VCC but that is not the case on type 1. Perhaps it is a sideeffect of the internal comparison.. I don't really know.

Then I found something else with changing R1, where type 0, 1 and 2 are different. The testing continues...


I also plan to make arnold run on the raspberry pi when mine arrives.
Raspberry Pi | An ARM GNU/Linux box for . Take a byte!
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource