You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dskintsf.src 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. .page 'dskint.sf'
  2. ;
  3. ; error display routine
  4. ; blinks the (error #)+1 in all three leds
  5. ;
  6. pezro ldx #0 ; error #1 for zero page
  7. .byte $2c ; skip next two bytes
  8. perr ldx temp ; get error #
  9. txs ; use stack as storage reg.
  10. pe20 tsx ; restore error #
  11. pe30 lda #led0+led1
  12. ora ledprt
  13. jmp pea7a
  14. ;turn on led !!!!patch so ddrb led is output!!!!
  15. rea7d tya ; clear inner ctr !!!!patch return!!!!
  16. pd10 clc
  17. pd20 adc #1 ; count inner ctr
  18. bne pd20
  19. dey ; done ?
  20. bne pd10 ; no
  21. ;
  22. lda ledprt
  23. and #$ff-led0-led1
  24. sta ledprt ; turn off all leds
  25. pe40 ; wait
  26. tya ; clear inner ctr
  27. pd11 clc
  28. pd21 adc #1 ; count inner ctr
  29. bne pd21
  30. dey ; done ?
  31. bne pd11 ; no
  32. ;
  33. dex ; blinked # ?
  34. bpl pe30 ; no - blink again
  35. cpx #$fc ; waited between counts ?
  36. bne pe40 ; no
  37. beq pe20 ; always - all again
  38. dskint
  39. sei
  40. cld
  41. ;---------rom05-bc---09/12/84------------
  42. ;ldx #$ff
  43. ldx #$fe ; set ddra1(pa1=photo sensor)
  44. ;----------------------------------------
  45. ;---------------------------------------
  46. jmp patch5 ; ***rom-05 8/18/83
  47. ;---------------------------------------
  48. dkit10 inx ; let .x:=0
  49. ;
  50. ;
  51. ;*********************************
  52. ;
  53. ; power up diagnostic
  54. ;
  55. ;*********************************
  56. ;
  57. ldy #0
  58. ldx #0
  59. pu10 txa ; fill z-page accend pattern
  60. sta $0,x
  61. inx
  62. bne pu10
  63. pu20 txa ; check pattern by inc...
  64. cmp $0,x ; ...back to orig #
  65. bne pezro ; bad bits
  66. pu30
  67. inc $0,x ; bump contents
  68. iny
  69. bne pu30 ; not done
  70. ;
  71. cmp $0,x ; check for good count
  72. bne pezro ; something's wrong
  73. ;
  74. sty $0,x ; leave z-page zeroed
  75. lda $0,x ; check it
  76. bne pezro ; wrong
  77. inx ; next!
  78. bne pu20 ; not all done
  79. ;
  80. ;
  81. ; test two 64k-bit roms
  82. ;
  83. ; enter x=start page
  84. ; exit if ok
  85. ;
  86. rm10 inc temp ; next error #
  87. stx ip+1 ; save page, start x=0
  88. lda #0
  89. sta ip ; zero lo indirect
  90. tay
  91. ldx #32 ; 32 pages in 8k rom
  92. clc
  93. rt10 dec ip+1 ; do it backwards
  94. rt20 adc (ip),y ; total checksum in a
  95. iny
  96. bne rt20
  97. dex
  98. bne rt10
  99. adc #0 ; add in last carry
  100. ;sta $00, adj value at $ffe5, get value $c001, chg to adc #0,
  101. ;add +28 to $ffe5, done !
  102. tax ; save lower page in x
  103. cmp ip+1 ; correct ?
  104. ;--------checksum for debug--------
  105. bne perr2 ; no - show error number
  106. ;nop ;/debug only
  107. ;nop ;
  108. ;
  109. cpx #$c0 ; done both roms ?
  110. bne rm10 ; no
  111. ;nop ;/debug only
  112. ;nop ;
  113. ;----------------------------------
  114. ; test all common ram
  115. ;
  116. cr20 lda #$01 ; start of 1st block
  117. cr30 sta ip+1 ; save page #
  118. inc temp ; bump error #
  119. ; enter x=# of pages in block
  120. ; ip ptr to first page in block
  121. ; exit if ok
  122. ;
  123. ramtst ldx #7 ; save page count
  124. ra10 tya ; fill with adr sensitive pattern
  125. clc
  126. adc ip+1
  127. sta (ip),y
  128. iny
  129. bne ra10
  130. inc ip+1
  131. dex
  132. bne ra10
  133. ldx #7 ; restore page count
  134. ra30 dec ip+1 ; check pattern backwards
  135. ra40 dey
  136. tya ; gen pattern again
  137. clc
  138. adc ip+1
  139. cmp (ip),y ; ok ?
  140. bne perr2 ; no - show error #
  141. eor #$ff ; yes - test inverse pattern
  142. sta (ip),y
  143. eor (ip),y ; ok ?
  144. sta (ip),y ; leave memory zero
  145. bne perr2 ; no - show error #
  146. tya
  147. bne ra40
  148. dex
  149. bne ra30
  150. ;
  151. beq diagok
  152. ;
  153. perr2 jmp perr
  154. ;
  155. diagok
  156. ;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  157. jmp ptch15 ; *rom ds 09/03/85*
  158. ; ldx #topwrt
  159. ; txs
  160. rtch15 ; return
  161. ;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  162. lda ledprt ; clear leds
  163. and #$ff-led0-led1
  164. sta ledprt
  165. ;
  166. lda #1 ; neg edge of atn
  167. sta pcr1
  168. lda #%10000010
  169. sta ifr1
  170. sta ier1
  171. lda pb ; compute primary addr
  172. and #%01100000 ; pb5 and pb6 are unused line
  173. asl a ; shift to lower
  174. rol a
  175. rol a
  176. rol a
  177. ora #$48 ; talk address
  178. sta tlkadr
  179. eor #$60 ; listen address
  180. sta lsnadr
  181. ;
  182. ; initialize buffer pntr table
  183. ;
  184. inttab ldx #0
  185. ldy #0
  186. intt1 lda #0
  187. sta buftab,x
  188. inx
  189. lda bufind,y
  190. sta buftab,x
  191. inx
  192. iny
  193. cpy #bfcnt
  194. bne intt1
  195. ;
  196. lda #<cmdbuf ; set pntr to cmdbuf
  197. sta buftab,x
  198. inx
  199. lda #>cmdbuf
  200. sta buftab,x
  201. inx
  202. lda #<errbuf ; set pntr to errbuf
  203. sta buftab,x
  204. inx
  205. lda #>errbuf
  206. sta buftab,x
  207. ;
  208. lda #$ff
  209. ldx #maxsa
  210. dskin1 sta lintab,x
  211. dex
  212. bpl dskin1
  213. ;
  214. ldx #mxchns-1
  215. dskin2
  216. sta buf0,x ; set buffers as unused
  217. sta buf1,x
  218. sta ss,x
  219. dex
  220. bpl dskin2
  221. ;
  222. lda #bfcnt ; set buffer pointers
  223. sta buf0+cmdchn
  224. lda #bfcnt+1
  225. sta buf0+errchn
  226. lda #$ff
  227. sta buf0+blindx
  228. sta buf1+blindx
  229. lda #errchn
  230. sta lintab+errsa
  231. lda #cmdchn+$80
  232. sta lintab+cmdsa
  233. lda #lxint ; lindx 0 to 5 free
  234. sta linuse
  235. lda #rdylst
  236. sta chnrdy+cmdchn
  237. lda #rdytlk
  238. sta chnrdy+errchn
  239. lda #$e0
  240. sta bufuse
  241. lda #$ff
  242. sta bufuse+1
  243. lda #1
  244. sta wpsw
  245. sta wpsw+1
  246. jsr usrint ; init user jmp
  247. jsr lruint
  248. ;
  249. ;**********************************
  250. ;
  251. ; controller initialization
  252. ;
  253. ;**********************************
  254. ;
  255. ;-----***rom05-bc***9/12/84----------
  256. ;jsr cntint
  257. jsr ptch10 ; bump & controller init.
  258. ;------------------------------------
  259. ; set indirect vectors
  260. lda #<diagok
  261. sta vnmi
  262. lda #>diagok
  263. sta vnmi+1
  264. ;
  265. lda #10 ; set up sector offset
  266. sta secinc
  267. lda #5
  268. sta revcnt ; set up recovery count
  269. ;*
  270. ;*******************************
  271. ;*
  272. ;* seterr
  273. ;* set up power on error msg
  274. ;*
  275. ;* cbm dos v2.0 (c)1979
  276. ;*
  277. ;*******************************
  278. ;*
  279. ;*
  280. ;
  281. seterr lda #$73
  282. jsr errts0
  283. ;
  284. ;
  285. ;must be contiguous to .file idle
  286. ;
  287. ;********************************
  288. ; init the serial bus
  289. ;
  290. ;********************************
  291. ;
  292. ;-------rom -05 8/18/83-----------------
  293. lda #$00 ; data hi, clock hi,atna hi
  294. sta pb
  295. lda #%00011010 ; atna,clkout,datout
  296. sta ddrb1
  297. ;---------------------------------------
  298. jsr boot
  299. ;
  300. ; .end