home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / MBUG / MBUG013.ARC / COLINIT2.PRO < prev    next >
Text File  |  1979-12-31  |  3KB  |  60 lines

  1. procedure INIT;
  2.  
  3. { Procedure  to  intercept the  CONOUT routine
  4.   and allow the colour byte to be saved in RAM
  5.   so that the  color procedure  will allow the
  6.   colours set to operate for each character as
  7.   it is printed to screen.
  8.  
  9.   Developed by  Bob and Alan Burt to allow the
  10.   creation of colour commands in  Turbo Pascal
  11.   for the MicroBee.                           }
  12.  
  13.  
  14.                           {    ORG     1FE7H
  15.                                ;
  16.                                DEFR    16
  17.                                ;
  18.                                PORT8   EQU    8      ;col_port control
  19.                                PORT9   EQU    9      ;colour PIO wait
  20.                                COPTR   EQU    0A7H   ;ConOutPtr addr
  21.                                CURSOR  EQU    0DF5BH ;curs pos 64k
  22.                                ;                                          }
  23. begin
  24.   inline ($E5/        {INIT    PUSH    HL                                 }
  25.           $2A/$A7/0/  {        LD      HL,(COPTR)                         }
  26.           $22/*+38/   {        LD      (JMP+1),HL                         }
  27.           $21/*+7/    {        LD      HL,CHR                             }
  28.           $22/$A7/0/  {        LD      (COPTR),HL                         }
  29.           $E1/        {        POP     HL                                 }
  30.           $C9/        {        RET                                        }
  31.                       {        ;                                          }
  32.                       {        ;Routine to save colour byte to RAM        }
  33.                       {        ;                                          }
  34.           $F5/        {CHR     PUSH    AF                                 }
  35.           $E5/        {        PUSH    HL                                 }
  36.           $2A/$5B/$DF/{CURS    LD      HL,(CURSOR)   ;get screen curs pos }
  37.           $7C/        {        LD      A,H                                }
  38.           $C6/8/      {        ADD     A,8           ;col_RAM offset      }
  39.           $67/        {        LD      H,A           ;msb cursor position }
  40.           $AF/        {        XOR     A                                  }
  41.           $D3/9/      {        OUT     (PORT9),A     ;wait Z80            }
  42.           $3E/$40/    {        LD      A,40H                              }
  43.           $D3/8/      {        OUT     (PORT8),A                          }
  44.           $3A/*+13/   {        LD      A,(SCRTCH)    ;colour byte         }
  45.           $77/        {        LD      (HL),A        ;save in RAM         }
  46.           $3A/*+10/   {        LD      A,(SCRTCH+1)  ;intensity byte      }
  47.           $D3/8/      {        OUT     (PORT8),A     ;reset PCG RAM       }
  48.           $E1/        {        POP     HL                                 }
  49.           $F1/        {        POP     AF                                 }
  50.           $C3/0/0/    {JMP     JP      0             ;CONOUT vector here  }
  51.                       {        ;                                          }
  52.           2/          {SCRTCH  DEFB    2             ;default colour byte }
  53.                       {                              ; green/black        }
  54.           $0E)        {        DEFB    0EH           ;intensity byte      }
  55. end; {procedure init}
  56.  
  57.  
  58.  
  59.  
  60.