
READING THE LIGHT PEN REGISTERS
The light pen register is at the same address as the beam counters. The bits are as
follows:
VPOSR: Bit 15 Long frame/short frame. 0=short frame
Bits 14-1 Chip ID code. Do not depend on value!
Bit 0 V8 (most significant bit of vertical position)
VHPOSR: Bits 15-8 V7-V0 (vertical position)
Bits 7-0 H8-H1 (horizontal position)
The software can refer to this register set as a long word whose address is VPOSR.
The positional resolution of these registers is as follows:
Vertical
1 scan line in non-interlaced mode
2 scan lines in interlaced mode (However, if you know which interlaced frame is under
display, you can determine the correct position)
Horizontal
2 low-resolution pixels in either high- or low-resolution
The quality of the light pen will determine the amount of short-term jitter. For most
applications, you should average several readings together.
To enable the light pen input, write a 1 into bit 3 of BPLCON0. Once the light pen input is
enabled and the light pen issues a trigger signal, the value in VPOSR is frozen. If no
trigger is seen, the counters latch at the end of the display field. It is impossible to read
the current beam location while the VPOSR register is latched. This freeze is released at
the end of internal vertical blanking (vertical position 20). There is no single bit in the
system that indicates a light pen trigger. To determine if a trigger has occurred, use one
of these methods:
1. Read (long) VPOSR twice.
2. If both values are not the same, the light pen has not triggered since the last top-of-
screen (V = 20).
3. If both values are the same, mask off the upper 15 bits of the 32-bit word and compare
it with the hex value of $10500 (V=261).
4. If the VPOSR value is greater than $10500, the light pen has not triggered since the
last top-of-screen. If the value is less, the light pen has triggered and the value read is
the screen position of the light pen.
- Interface Hardware 233 -
Summary of Contents for Amiga A1000
Page 1: ...AMIGA HARDWARE REFERENCE MANUAL 1992 Commodore Business Machines Amiga 1200 PAL...
Page 20: ...Figure 1 1 Block Diagram for the Amiga Computer Family Introduction 11...
Page 21: ...12 Introduction...
Page 72: ...Figure 3 12 A dual Playfield display Playfield Hardware 63...
Page 87: ...Figure 3 24 Horizontal Scrolling 78 playfield hardware...
Page 101: ...92 Playfield Hardware...
Page 199: ...Figure 6 9 DMA time slot allocation 190 Blitter hardware...
Page 203: ...Figure 6 13 Blitter Block Diagram 194 Blitter Hardware...
Page 229: ...220 System Control Hardware...
Page 246: ...Figure 8 8 Chinon Timing diagram cont Interface Hardware 237...
Page 265: ...256 Interface Hardware...
Page 289: ...280 Appendix A...
Page 297: ...288 Appendix B...
Page 298: ...APPENDIX C CUSTOM CHIP PIN ALLOCATION LIST NOTE Means an active low signal Appendix C 289...
Page 302: ...APPENDIX D SYSTEM MEMORY MAP Appendix D 293...
Page 343: ...334 Appendix F...
Page 351: ...342 Appendix G...
Page 361: ...352 Appendix H...
Page 367: ...358 Appendix I...