home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_12_1986_Transactor_Publishing.d64 / autoload.asm < prev    next >
Assembly Source File  |  2023-02-26  |  3KB  |  129 lines

  1. ;put"@:s/kauto"
  2. .opt nosym
  3. ;*******************************
  4. ;*                             *
  5. ;*       autoload kernal       *
  6. ;*       ---------------       *
  7. ;*                             *
  8. ;*  on powerup or reset, loads *
  9. ;* the 1st file from drive 0   *
  10. ;* and then runs the program.  *
  11. ;*  however, a delay period is *
  12. ;* provided allowing the user  *
  13. ;* time to abort the load by   *
  14. ;* pressing the cmdr logo key. *
  15. ;*                             *
  16. ;*  - by tom hughes v240685 -  *
  17. ;*                             *
  18. ;*******************************
  19. .skip
  20. ;
  21. ;c64 equates
  22. ;
  23. basic  = $0801 ;basic starts here
  24. basini = $e3bf ;initialize basic
  25. basmsg = $e422 ;print powerup message
  26. clall  = $ffe7 ;close all files
  27. close  = $ffc3 ;close one file
  28. clrchn = $ffcc ;i/o to defaults
  29. dobas  = $a474 ;basic warm start
  30. keyd   = $0277 ;keyboard buffer
  31. load   = $ffd5 ;load ram from disk
  32. setlfs = $ffba ;set file parameters
  33. setnam = $ffbd ;set file name
  34. settim = $ffdb ;set jiffy clock
  35. shflag = $028d ;shift pattern register
  36. vec300 = $e453 ;set page 3 o.s. vectors
  37. time   = $a0  ;jiffy clock (3)
  38. vartab = $2d  ;basic variable start (2)
  39. ndx    = $c6  ;# of chars in kbd buff
  40. .skip
  41. ;
  42. ;constants
  43. ;
  44. eprom = 0 ;1=eprom/0=soft kernal
  45. wait  = 3 ;wait * 4 = delay in secs
  46. .page 'diversions'
  47. ;------------------------------
  48. ;cassette routine patches
  49. ;------------------------------
  50. .skip
  51. ;note: attempted use of a cassette routine
  52. ;will result in "illegal device #"
  53. .skip
  54. *=$f2ce
  55. jmp $f271 ;fix cassette close
  56. *=$f38b
  57. jmp $f713 ;fix cassette open
  58. *=$f539
  59. jmp $f713 ;fix cassette load
  60. *=$f65f
  61. jmp $f713 ;fix cassette save
  62. .skip 2
  63. *=$fcef
  64. ;------------------------------
  65. ;divert system reset
  66. ;------------------------------
  67. .skip
  68. .ifn eprom <
  69. stx $d016 ;reset vicii chip,
  70. jsr $fda3 ;initialize i/o,
  71. jsr $fd50 ;memory pointers,
  72. jsr $fd15 ;soft i/o vectors,
  73. jsr $ff5b ;screen & keyboard
  74. >
  75. cli
  76. jmp autold ;go to autoload
  77. .page 'autoload'
  78. *=$f72c
  79. ;-------------------------------
  80. ;powerup autoload
  81. ;-------------------------------
  82. .skip
  83. autold jsr vec300 ;set $0300 vectors,
  84. jsr basini ;initialize basic,
  85. jsr basmsg ;print powerup message,
  86. ldx #251   ;and reset stack
  87. txs
  88. lda #0 ;zero jiffy clock
  89. jsr settim
  90. auto10 lda shflag
  91. cmp #2     ;if cmdr key pressed,
  92. beq auto30 ;skip the load
  93. lda time+1
  94. cmp #wait  ;else wait till delay is up
  95. bne auto10
  96. jsr clall  ;then close all files
  97. lda #2
  98. ldx #8
  99. ldy #0     ;ignore file header
  100. jsr setlfs
  101. lda #3
  102. ldx #<filnam
  103. ldy #>filnam
  104. jsr setnam
  105. lda #0     ;load "0:*",8
  106. ldx #<basic
  107. ldy #>basic
  108. jsr load
  109. stx vartab ;set end-of-basic ptrs
  110. sty vartab+1
  111. lda #2     ;close load channel
  112. jsr close
  113. jsr clrchn
  114. .skip
  115. ;autorun routine
  116. ;
  117. ldy #0
  118. auto20 lda runit,y ;write "run" + cr
  119. sta keyd,y ;to keyboard buffer
  120. iny
  121. cpy #4
  122. bne auto20
  123. sty ndx    ;and set buffer size
  124. auto30 jmp dobas ;then run the program
  125. .skip
  126. filnam .byt '0:*'
  127. runit .byt 'run',13
  128. .end
  129.