********************************************************************
* AskMonType - Query based monitor type utility
*
* $Id: askmontype.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $
*
* Ed.    Comments                                       Who YY/MM/DD
* ------------------------------------------------------------------
* 1      Created                                        BG  97/??/??

         nam   AskMonType
         ttl   Query based monitor type utility

         ifp1
         use   defsfile
         endc

tylg     set   Prgrm+Objct
atrv     set   ReEnt+rev
rev      set   $01
edition  set   1

         mod   eom,name,tylg,atrv,start,size

key      rmb   1
orgopts  rmb   32
modopts  rmb   32
stack    rmb   200
size     equ   .

name     fcs   /AskMonType/
         fcb   edition

start    leax  >CurOff,pcr
         ldy   #CurOffL
         lbsr  WriteMsg
         clra
         clrb
         leax  orgopts,u
         os9   I$GetStt
         leax  modopts,u
         os9   I$GetStt
         clr   4,x
         clr   16,x
         clr   17,x
         clrb
         os9   I$SetStt
AskMon   leax  >MonSelct,pcr
         ldy   #MonSelL
         lbsr  WriteMsg
AskMon2  lbsr  ReadKey
         cmpa  #'1
         beq   DoTV
         cmpa  #'2
         beq   DoMono
         cmpa  #'3
         beq   DoRGB
         leax  >Bell,pcr
         ldy   #BellL
         lbsr  WriteMsg
         bra   AskMon2
DoTV     ldx   #$0000                  TV/composite monitor
         bra   ChgMon
DoMono   ldx   #$0002                  monochrome monitor
         bra   ChgMon
DoRGB    ldx   #$0001                  RGB monitor
ChgMon   ldd   #$01*256+SS.Montr
         os9   I$SetStt                make the monitor setting
         leax  >CurOn,pcr
         ldy   #CurOnL
         lbsr  WriteMsg
         leax  orgopts,u
         clra
         clrb
         os9   I$SetStt
         clrb
         os9   F$Exit

ReadKey  pshs  y,x,b
         clra                          stdin
         leax  key,u
         ldy   #1
         os9   I$Read
         lda   key,u
         puls  pc,y,x,b

WriteMsg pshs  y,x,b,a
         lda   #1                      stdout
         os9   I$Write
         puls  pc,y,x,b,a


CurOff   fdb   $0520
CurOffL  equ   *-CurOff
CurOn    fdb   $0521
CurOnL   equ   *-CurOn

MonSelct fcb   C$FORM
         fcb   $02,$20,$22
         fcc   /    SELECT YOUR DISPLAY TYPE/
         fcb   C$LF,C$CR,C$LF,C$CR,C$LF,C$CR
         fcc   "    (1) TV/Composite Monitor"
         fcb   C$LF,C$CR,C$LF,C$CR
         fcc   /    (2) Monochrome Monitor/
         fcb   C$LF,C$CR,C$LF,C$CR
         fcc   /    (3) RGB Monitor/
         fcb   C$LF,C$CR
MonSelL  equ   *-MonSelct

Bell     fcb   C$BELL
BellL    equ   *-Bell

         emod
eom      equ   *
         end
