Changes

Amstrad Magnum Phaser

549 bytes added, 15:56, 19 July 2013
/* Technical */
Trigger Button ---> Request via output to Port FBFEh, then check CRTC input
Light Sensor ---> CRTC Light Pen Input
 
When the Trigger button is not pressed, D7 is connected to LPEN. As D7 is always evolving, it generates edges to the LPEN input of the CRTC. So the CRTC is constantly refreshing its registers R16 and R17.
 
When the Trigger button is pressed, LPEN is connected to the photo-diode of the lightgun. That means that an edge is produced only once per frame in this case.
 
Retreving the status of the Trigger button is done by changing the D7 value, trying to generate an edge on LPEN, and then checking if the CRTC has refreshed its R16/R17 registers.
 
To read the Trigger button (to be done during vblank):
Port[BCxxh]=11h ;select CRTC register 11h
8,326
edits