
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 -
Содержание Amiga A1000
Страница 1: ...AMIGA HARDWARE REFERENCE MANUAL 1992 Commodore Business Machines Amiga 1200 PAL...
Страница 20: ...Figure 1 1 Block Diagram for the Amiga Computer Family Introduction 11...
Страница 21: ...12 Introduction...
Страница 72: ...Figure 3 12 A dual Playfield display Playfield Hardware 63...
Страница 87: ...Figure 3 24 Horizontal Scrolling 78 playfield hardware...
Страница 101: ...92 Playfield Hardware...
Страница 199: ...Figure 6 9 DMA time slot allocation 190 Blitter hardware...
Страница 203: ...Figure 6 13 Blitter Block Diagram 194 Blitter Hardware...
Страница 229: ...220 System Control Hardware...
Страница 246: ...Figure 8 8 Chinon Timing diagram cont Interface Hardware 237...
Страница 265: ...256 Interface Hardware...
Страница 289: ...280 Appendix A...
Страница 297: ...288 Appendix B...
Страница 298: ...APPENDIX C CUSTOM CHIP PIN ALLOCATION LIST NOTE Means an active low signal Appendix C 289...
Страница 302: ...APPENDIX D SYSTEM MEMORY MAP Appendix D 293...
Страница 343: ...334 Appendix F...
Страница 351: ...342 Appendix G...
Страница 361: ...352 Appendix H...
Страница 367: ...358 Appendix I...