10 INPUT "Filename: "F$
   20 F%=OPENIN F$
   30 IF F%=0 PRINT "File not found!": END
   40 MODE 2
   50 REM How many colours in the palette?
   60 C%=BGET#F%
   70 REM How many bitplanes are there?
   80 P%=0
   90 REPEAT P%=P%+1:UNTIL 2^P%>=C%
  100 REM Set up each palette entry with RGB values read from the file.
  110 FOR I%=0 TO C%-1
  120   VDU 19,I%,16,BGET#F%,BGET#F%,BGET#F%
  130 NEXT I%
  140 REM Draw text at graphics cursor position.
  150 VDU 5
  160 REM Width and height in 8x8 character blocks
  170 W%=BGET#F%:H%=BGET#F%
  180 REM For each block+plane, move graphics cursor to appropriate position, set bitplane's colour (2^I%) in OR mode,
  190 REM read in 8x8 bitmap for the plane, set as character 224, then draw at graphics cursor position.
  200 FOR Y%=0 TO H%-1
  210   FOR X%=0 TO W%-1
  220     FOR I%=0 TO P%-1
  230       MOVE X%*64,1016-Y%*64
  240       VDU 18,1,2^I%,23,224,BGET#F%,BGET#F%,BGET#F%,BGET#F%,BGET#F%,BGET#F%,BGET#F%,BGET#F%,224
  250     NEXT I%
  260   NEXT X%
  270 NEXT Y%
  280 CLOSE#F%
  290 REM Wait for a key.
  300 REPEAT UNTIL INKEY(0)=-1:K%=GET
  310 REM Draw text using console I/O instead of graphics cursor.
  320 VDU 4