.scan_fire LDA #&51 \ Set 6522 User VIA output register ORB (SHEILA &60) to STA VIA+&60 \ the Delta 14b joystick button in the middle column \ (upper nibble &5) and top row (lower nibble &1), which \ corresponds to the fire button LDA VIA+&40 \ Read 6522 System VIA input register IRB (SHEILA &40) AND #%00010000 \ Bit 4 of IRB (PB4) is clear if joystick 1's fire \ button is pressed, otherwise it is set, so AND'ing \ the value of IRB with %10000 extracts this bit JMP tube_put \ Send A back to the parasite and return from the \ subroutine using a tail callName: scan_fire [Show more] Type: Subroutine Category: Keyboard Summary: Implement the scan_fire command (scan the joystick's fire button)Context: See this subroutine in context in the source code References: This subroutine is called as follows: * tube_table calls scan_fire
This routine is run when the parasite sends a scan_fire command. It checks the joystick's fire button and returns a value to the parasite with bit 4 clear if the joystick's fire button is being pressed, or bit 4 set if it isn't.
Configuration variable: VIA = &FE00
Memory-mapped space for accessing internal hardware, such as the video ULA, 6845 CRTC and 6522 VIAs (also known as SHEILA)
As the I/O processor, send a byte across the Tube to the parasite