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 / CPM / BBSING / MBBS / MBYERIG.001 < prev    next >
Text File  |  2000-06-30  |  11KB  |  341 lines

  1. ; March 18, 1985, Bucky Carr, World Peace (ZBBS) RCP/M, Denver, 303-320-4822
  2. ;
  3. ; Here is a little ditty that I snitched from an old BYE routine that a
  4. ;friend had.  Have you ever found yourself looking at your CRT and wondering
  5. ;if the blinking cursor actually means that BYE is working, and waiting for
  6. ;a ring.  No need to wonder any more.  With these mods, your CRT will keep
  7. ;you informed of what BYE is doing between calls.
  8. ;
  9. ; I specifically adapted this to Kim Levitt's MBYE35, but I left enough info
  10. ;that virtually anyone should be able to make this work on any BYE that s/he
  11. ;is running (I showed a friend how to do it to BYE331, last night in 5 mins!)
  12. ;
  13. ; My changes are represented by the symbology:
  14. ;
  15. ;***************************************
  16. ;                       *
  17. ; changes and additions inside the box *
  18. ;                       *
  19. ;***************************************
  20. ;
  21. ; These changes will make the CRT flash the following message on and off the
  22. ;CRT at about 1 second intervals:  "Waiting for ring ...."
  23. ;
  24. ; First look for a label like this and the 'Await ringing' comment for the
  25. ;next label
  26. ;
  27. START2:
  28. ;
  29.     XRA    A        ;clear OPTION flag
  30.     STA    OPTION
  31. ;
  32. ; Await ringing - check local keyboard for CTL-C exit request,
  33. ; CTL-G bell toggle or CTL-Z screen clear.
  34. ;
  35. ;************************************************************************
  36. ; Need to initialize some counters that represent delay loops        *
  37. ;and do this before the RINGWT label.  MHZ should be defined above in    *
  38. ;your program already                            *
  39. ;                                    *
  40. LOOP:                ;values are for about 1 second flashing *
  41.     LXI    B,MHZ*200    ;counter for printing the 'waiting' msg *
  42.     LXI    D,(MHZ*400)-1    ;counter for erasing the 'waiting' msg    *
  43.     LXI    H,MSGWT2    ;print the 'waiting for ring ....' msg    *
  44.     CALL    LCLPRT        ;gotta use DE & BC cuz #s big        *
  45. ;                                    *
  46. ; Call the local CRT, not the modem port and not both.    In BYE331 it is *
  47. ;a routine called PRINTL, in MBYE35 it is LCLPRT.  MSGWT2 is the address*
  48. ;of the 'Waiting for ring ....' msg (see near the end)            *
  49. ;************************************************************************
  50. ;
  51. RINGWT:
  52. ;
  53. ;************************************************************************
  54. ; Actual delay for printing the message(s) occurs here.         *
  55. ;I found that the built in routine (DELAY) would not work reliably    *
  56. ;so wrote this which does work reliably.  Notice that this does not    *
  57. ;cause more than a few nanoseconds delay in the regular scanning of    *
  58. ;the console (VCONSTAT) and the modem (MDINST or MDCARCK) ports     *
  59. ;                                    *
  60.     DCX    B        ;decrement BC                *
  61.     MOV    A,B        ;put B in A, OR it with C        *
  62.     ORA    C        ;0 yet? yes=one second has elapsed    *
  63.     JZ    WAITMSG     ;erase the 'Waiting for ring ....' msg    *
  64.     DCX    D        ;decrement DE                *
  65.     MOV    A,D        ;put D in A, OR it with E        *
  66.     ORA    E        ;0 yet? yes=another second has elapsed    *
  67.     JZ    LOOP        ;re-print the 'Waiting for ring ...' msg*
  68. ;                                    *
  69. THERE:                ;need this label now (ESSENTIAL)    *
  70. ;                                    *
  71. ; the following is included for your orientation            *
  72. ;************************************************************************
  73.     CALL    VCONSTAT    ;check if console key ready
  74.     ORA    A
  75.     JZ    RNGWT1        ;nope, check for ring/carrier
  76.     CALL    VCONIN        ;yep, get console key
  77.     ANI    7FH        ;strip parity bit
  78. ;
  79.      IF    FKEYS
  80.     CPI    BELKEY        ;bell key?
  81.     CZ    TOGBEL        ;if so, toggle console bell on/off
  82.     CPI    CLRKEY        ;clear screen char?
  83.     CZ    CLRSCRN        ;if so clear the screen
  84.      ENDIF
  85. ;
  86.     CPI    'C'-40H        ;CTL-C?
  87.     JZ    USRCHK        ;check for exit
  88. ;
  89. ; Now look for the next label we need, here called RNGWT1.  We are looking
  90. ;for a spot to stick a small subroutine to which we can jump without
  91. ;having it used for anything else accidentally.  You could technically stick
  92. ;stick this little subroutine anywhere out of harm's way....
  93. ;
  94. RNGWT1:
  95. ;
  96.      IF    NORING AND NOT (SMODEM OR SM1200 OR SM2400)
  97.     CALL    MDCARCK        ;check for carrier
  98.     JNZ    ANSWER        ;we have carrier, let's say hello.
  99.     JMP    RINGWT        ;nope, loop
  100.      ENDIF    ;NORING AND NOT (SMODEM OR SM1200 OR SM2400)
  101. ;
  102.      IF    SMODEM OR SM1200 OR SM2400
  103.     CALL    MDINST        ;check for data available
  104.     JZ    RINGWT        ;nope, keep waiting
  105.     CALL    MDINP        ;yep, get data (CR)
  106.     CPI    CR        ;if CR,
  107.     JZ    RINGWT        ;ignore it
  108.     CPI    '2'        ;'RING?'
  109.     JZ    ANSWSM        ;yes, answer the phone
  110.     CPI    '3'        ;'NO CARRIER?'
  111.     JZ    START2        ;yes, clear OPTION flag, cont.
  112.     PUSH    PSW        ;no, save result code
  113.     CPI    '1'        ;'300 CONNECT?'
  114.      ENDIF    ;SMODEM OR SM1200 OR SM2400
  115. ;
  116.      IF    SMODEM OR (SM1200 AND S300) OR (SM2400 AND S300) ;300 baud?
  117.     JZ    ANSWER        ;yes, answer
  118.      ENDIF
  119. ;
  120.      IF    (SM1200 OR SM2400) AND NOT S300
  121.     JZ    HANGUP1A    ;if not, hang up on 'em
  122.      ENDIF
  123. ;
  124.      IF    SM1200 OR SM2400
  125.     CPI    '5'        ;'1200 CONNECT?'
  126.     JZ    ANSWER
  127.      ENDIF    ;SM1200 OR SM2400
  128. ;
  129.      IF    SM2400
  130.     CPI    '6'        ;'2400 CONNECT?'
  131.     JZ    ANSWER
  132.      ENDIF    ;SM2400
  133. ;
  134.      IF    SMODEM OR SM1200 OR SM2400
  135.     POP    PSW        ;not a response code
  136.     JMP    RINGWT        ;ignore it
  137. ;
  138. ANSWSM:
  139. ;
  140.      ENDIF
  141. ;
  142.      IF    (SMODEM OR SM1200 OR SM2400) AND USRLOG
  143.     LXI    H,OLDUSR    ;count this as "attempted log on"
  144.     CALL    BOPLOG
  145.      ENDIF
  146. ;
  147.      IF    SMODEM OR SM1200 OR SM2400 OR ANCHOR OR USR
  148. ANSWS2:
  149.     CALL    MDINST        ;check for data available
  150.     JZ    ANSWS2        ;nope, keep waiting
  151.     CALL    MDINP        ;yep, get data (CR)
  152. ANSWS3:
  153.     LXI    H,SMAMSG    ;send "ATA",<cr>
  154.     CALL    MDMPRT
  155.     JMP    RINGWT        ;wait for response code
  156.      ENDIF
  157. ;
  158. ;************************************************************************
  159. ; Here is a safe spot to stick our subroutine                *
  160. ; This RCP/M runs on a Heath H89, so I used the clear screen codes    *
  161. ;to accomplish the erasing of the message every other second        *
  162. ;                                    *
  163. ; If you don't know your computer's clear screen codes (see below)    *
  164. ;then change the CLRSMSG to MSGWT1, and we will do it another way    *
  165. ;                                    *
  166. WAITMSG:            ;                    *
  167.     LXI    H,CLRSMSG    ;clear local screen only        *
  168.     CALL    LCLPRT                            *
  169.     LXI    B,MHZ*400    ;delay the print msg            *
  170.     JMP    THERE                            *
  171. ;                                    *
  172. ; the following is for your orientation                 *
  173. ;************************************************************************
  174. ;
  175.      IF    NOT NORING
  176. ;
  177. RINGW2:
  178.     CALL    MDRING        ;call ring-check routine
  179.     JZ    RINGWT        ;not ringing...
  180. ;
  181. ;
  182. ; Next, I did not want the cursor flashing on the screen and cluttering
  183. ;up my pretty flashing 'Waiting ....'msg, so I added a cursor on/off routine.
  184. ;Here is off at the label in MBYE35 called CLRSCRN.  This way each call
  185. ;by BYE to the clear screen routine, will also turn off the cursor.
  186. ;
  187. CLRSCRN:
  188.     LXI    H,CLRSMSG    ;Clear screen
  189.     CALL    LCLPRT
  190. ;************************************************************************
  191. ; CURSOFFMSG is the address of the cursor off routine (see below)    *
  192. ;                                    *
  193.     LXI    H,CURSOFFMSG    ;CURSOR OFF                *
  194.     CALL    LCLPRT        ;                    *
  195. ;                                    *
  196. ; Again, only send the cursor off routine to the local console not the    *
  197. ;modem.  The RET instruction following was part of the original CLRSCRN *
  198. ;code, so don't forget it                        *
  199. ;************************************************************************
  200.     RET
  201. ;
  202. ;
  203. ; When we exit to CP/M, relieving BYE of its duties, we of course want the
  204. ;cursor back on again.    For your orientation, find the following label,
  205. ;and work down from there.
  206. ;
  207. ; Here to exit to CP/M, first reset the modem to default status
  208. ;
  209. EXCPM:
  210. ;
  211.      IF    COMFILE
  212.     LDA    OPTION
  213.     CPI    'E'        ;If not "E" option
  214.     JNZ    EXEX        ;exit direct to CP/M
  215.     CALL    LODCOM        ;else, make sure .COM file loaded
  216.      ENDIF
  217. ;
  218.      IF    MBBS AND RTC
  219.     CALL    PATCH        ;If MBBS, run with BYE patched
  220.     XRA    A        ;in so RTC will work...
  221.     STA    MDMFLG        ;(but with MDMFLG cleared)
  222.      ENDIF
  223. ;
  224.      IF    COMFILE
  225.     CALL    TPA        ;execute .COM file locally
  226.      ENDIF
  227. ;
  228. EXEX:
  229. ;
  230.      IF    SMODEM OR SM1200 OR SM2400 OR ANCHOR OR USR
  231.     LXI    H,SMQMSG    ;send "ATZ<cr>"
  232.     CALL    MDMPRT
  233.     CALL    SMDLAY        ;wait a bit...
  234.      ENDIF
  235. ;
  236.      IF    SM1200 OR SM2400 OR ANCHOR OR USR
  237.     CALL    SET1200        ;if SM1200, ATZ = 1200 baud
  238.      ENDIF
  239. ;
  240.      IF    SMODEM OR SM1200 OR SM2400 OR ANCHOR OR USR
  241.     LXI    H,SMZMSG
  242.     CALL    MDMPRT        ;send "AT S0=0"
  243.      ENDIF
  244. ;
  245.      IF    CCSDISK 
  246.     CALL    DSKON        ;turn on the drives
  247.      ENDIF            ;CCSDISK
  248. ;
  249.      IF    ZCPR2 OR NZCPR
  250.     MVI    A,OFF
  251.     STA    WHEEL        ;DO NOT restore wheel byte for SYSOP
  252.     STA    03FH        ;RIG IT SO THE SYSOP HAS TO LOG IN TOO
  253.     MVI    A,4        ;SD SCREEN WIDTH
  254.     STA    03EH        ;SD WIDTH LOCATION
  255.      ENDIF
  256. ;
  257.      IF    ZPATH
  258.     CALL    SPATH        ;set up sysop path
  259.      ENDIF    ;ZPATH
  260. ;
  261.      IF    USEZCPR
  262.     MVI    A,SMAXUSR
  263.     STA    MAXUSER        ;and MAXUSR
  264.     MVI    A,SMAXDRV
  265.     STA    MAXDRIV        ;and MAXDRIV
  266.      ENDIF
  267. ;
  268.      IF    MBBS AND RTC
  269.     CALL    UNPATCH
  270.      ENDIF
  271. ;
  272.     MVI    A,' '        ;clear
  273.     STA    YESITS        ;'B' in 'BYE' to force reload
  274. ;
  275. ;************************************************************************
  276. ; Just in front of the warm boot, turn the cursor back on        *
  277. ;                                    *
  278.     LXI    H,CURSONMSG    ;CURSOR BACK ON             *
  279.     CALL    LCLPRT        ;                    *
  280. ;************************************************************************
  281.     JMP    VWARMBT        ;warm boot to unpatched CP/M
  282. ;
  283. ;
  284. ; Near the end of the BYE and MBYE programs are a number of DB statements
  285. ;to which we will add some of our own.
  286. ;
  287. ; Program version number message.
  288. ;
  289. VMSG:    DB    CR,LF,'>>> MBYE v3.5 - 01/26/85 - Kim Levitt'
  290.     DB    CR,LF,0
  291. ;
  292. ;************************************************************************
  293. ; 'Waiting for ring' message, assuming that you can invoke the CLRSCRN    *
  294. ;abilities of your machine (Richard Conn does it in dozens of machines    *
  295. ;with his Z3TCAP and TCSELECT, so I know you can, too.    It is the    *
  296. ;preferred method.                            *
  297. ;                                    *
  298. MSGWT2:                             ;    *
  299.     DB    CR,'Waiting for ring ....',CR,0         ;    *
  300. ;                                    *
  301. ; IF AND ONLY IF, you cannot do a clear screen routine on your machine    *
  302. ;then add this, here,                            *
  303. ;                                    *
  304. MSGWT1:                             ;    *
  305.     DB    CR,'Waiting         ....',CR,0             *
  306. ;                                    *
  307. ; and be sure that you changed the CLRSMSG to MSGWT1 up in the WAITMSG    *
  308. ;above                                    *
  309. ;************************************************************************
  310. ;
  311. ; For your edification, here is the clear screen routine for the Heath
  312. ;H89 or H19.
  313. ;
  314. ; Clear screen string.
  315. ;
  316. CLRSMSG:            ;put clear screen control code or
  317.     DB    27,'E'        ;escape sequence here, end with 0
  318.     DB    0        ;(escape E)
  319. ;
  320. ;************************************************************************
  321. ; Cursor off/on messages for the Heath H89 or H19            *
  322. ;                                    *
  323. CURSOFFMSG:                            ;    *
  324.     DB    27,'x','5'    ;CURSOR OFF CONTROL CODE HERE        *
  325.     DB    0        ;END WITH ZERO (escape x5)        *
  326. ;                                    *
  327. CURSONMSG:                            ;    *
  328.     DB    27,'y','5'    ;CURSOR ON CONTROL CODE HERE        *
  329.     DB    0        ;END WITH ZERO (escape y5)        *
  330. ;                                    *
  331. ; And the following is for your orientation                *
  332. ;                                    *
  333. ; What is ZBBS, anyway?                         *
  334. ;************************************************************************
  335. ;
  336.      IF    LGONMSG
  337. LOGMSG: DB    CR,LF,LF,LF,'World Peace (ZBBS) RCP/M'
  338.     DB    CR,LF,'The World Peace Movement'
  339.     DB    CR,LF,0
  340.      ENDIF            ;LGOMSG
  341. V