News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_erikarn

Lightpen details?

Started by erikarn, 09:06, 14 July 09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

erikarn

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

arnoldemu

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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Tolkin

Hy, maybe this can help. Its in German, but maybe... help.
Bye
Tolkin

TFM

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
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod