home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_27_1988_Transactor_Publishing.d64 / devpres.src (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  737b  |  36 lines

  1. 100 sys 700
  2. 110 ;paul g. sawyer
  3. 120 ;
  4. 130 ;orangeville, on
  5. 140 ;
  6. 150 ;
  7. 160 ;device presence checker
  8. 170 ;-----(relocatable)-----
  9. 180 ;put device # in location 252
  10. 190 ;after calling routine, read
  11. 200 ;location 251. if its value is
  12. 210 ;0 then the device is off, or
  13. 220 ;1 then the device is on.
  14. 230 ;
  15. 240 ;note- if using device 8 or 9
  16. 250 ;and drive is on, the error light
  17. 260 ;will be flashing, but just
  18. 270 ;initialize the drive and all
  19. 280 ;will be ok.
  20. 290 ;
  21. 300 *=$c000
  22. 310 .opt oo
  23. 320 device = $fc
  24. 330 onflag = $fb
  25. 340 lda #0: sta onflag
  26. 350 lda device: tax: ldy #0
  27. 360 jsr $ffba   ;setlfs
  28. 370 lda #1: ldx onflag: ldy #0
  29. 380 jsr $ffbd   ;setnam
  30. 390 jsr $ffc0   ;open
  31. 400 lda $90: pha
  32. 410 lda device: jsr $ffc3 ;close
  33. 420 pla: bmi off
  34. 430 on lda #1: sta onflag
  35. 440 off rts
  36.