Prev: 8029 Up: Map Next: 806B
805D: PRINT and NOPRINT
PRINT (805D) switches on copying of the story window to a ZX Printer (7B15), by setting $B5E3 to 1, but only if a printer is attached: bit 6 of port $FB is 0 when one is. NOPRINT (8067) sets $B5E3 to 0.
The test for the printer has a curious slip: when no printer is attached, the JR NZ at 805F jumps to $8069, which is in the middle of the LD ($B5E3),A instruction. The bytes there are executed as EX (SP),HL and OR L before execution reaches 806B. In my tests the game carried on normally after PRINT with no printer, so the damage appears to be harmless in practice.
805D IN A,($FB) Read the ZX Printer's status port
805F BIT 6,A Is a printer actually attached (bit 6 clear means yes)?
8061 JR NZ,$806B No printer: leave printing switched off (joins the shared ending below, via the mis-jump described in the bug note)
8063 LD A,$01 PRINT: switch printing on
8065 JR $8068
8067 XOR A NOPRINT: switch it off
8068 LD ($B5E3),A
Prev: 8029 Up: Map Next: 806B