CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: erikarn on 09:06, 14 July 09

Title: Lightpen details?
Post by: erikarn on 09:06, 14 July 09
G'day,
I've been tinkering with a lightpen circuit on my CPC6128. I've been just grabbing the lightpen address high/low addresses from the CRTC and displaying those.
Now, that seems to work bar some "jumping around" which will most likely be fixed by the construction of a real "pen" for it. I'm curious though - is the CPC lightpen meant to be pixel accurate or character accurate? I can't seem to find any source or manuals which explain which it is. If I understand the CRTC workings right the lightpen address will be character accurate only - the CRTC is programmed for a 40x25 character screen and the bitmap is rendered using the character ROM driver lines MUXed into the eventual screen address.
Thanks,


Adrian
Title: Re: Lightpen details?
Post by: arnoldemu on 12:05, 14 July 09
Technically speaking it is CRTC character accurate.

The X resolution is accurate to 2 bytes. The Y resolution is dependant on the setting of CRTC register 9. If this is set to 7, then it is accurate to 8 scanlines.

So in terms of CPC modes, it is accurate to half a mode 0 character, a full mode 1 character, or 2 mode 2 characters in X, and effectively 1 char height in Y.

From what I have seen, most programs use a trigger button on the lightpen/gun which is readable either through joystick or through an I/O port.

Then when the trigger is pressed, the game detects this and turns "hotspots" white for the duration of a couple of frames.
Title: Re: Lightpen details?
Post by: Tolkin on 00:36, 17 July 09
Hy, maybe this can help. Its in German, but maybe... help.
Bye
Tolkin
Title: Re: Lightpen details?
Post by: TFM on 23:01, 24 July 09
Quote from: arnoldemu on 12:05, 14 July 09
So in terms of CPC modes, it is accurate to half a mode 0 character, a full mode 1 character, or 2 mode 2 characters in X, and effectively 1 char height in Y.

Yes it's accurate to one Mode 1 char, but I thought it is accurate to every scan line. I have to look at my routines again...

Well, with the nomal CPC it depends also on the type of CRTC if a Lightpen can be used (properly/at all). With the CPC Plus I had never problems.

Bye,
TFM/FS
Powered by SMFPacks Menu Editor Mod