comparison level2/modules/cc3disk.asm @ 1558:4a4ff4d844ef

ccdisk.asm: this is "newdisk" found on google, replaces old ccdisk which had severe reliability problems. rbfdefs: since "newdisk" uses the same step codes as cc3disk, rbfdefs was modified to reflect this. sysgo.asm: Date changed to May 14, 2004 to reflect updated 03.02.01 release. ChangeLogs: reflect updated version info.
author boisy
date Thu, 13 May 2004 14:19:49 +0000
parents 46c68f878889
children 4f91ca7f3e6f
comparison
equal deleted inserted replaced
1557:11e689c23028 1558:4a4ff4d844ef
96 Init2 decb delay a bit... 96 Init2 decb delay a bit...
97 bmi Init2 97 bmi Init2
98 suba $0B,x read it back 98 suba $0B,x read it back
99 lbne NoHW if not zero, we didn't read what we wrote 99 lbne NoHW if not zero, we didn't read what we wrote
100 ** 100 **
101 IFEQ Level-1
102 clr <D.DskTmr flag drive motor as not running
103 ELSE
101 clr <D.MotOn flag drive motor as not running 104 clr <D.MotOn flag drive motor as not running
105 ENDC
102 leax 8,x Point to Status/Command register 106 leax 8,x Point to Status/Command register
103 lda #$D0 Force Interrupt command 107 lda #$D0 Force Interrupt command
104 sta ,x Send to FDC 108 sta ,x Send to FDC
105 lbsr L0406 Time delay for ~ 108 cycles 109 lbsr L0406 Time delay for ~ 108 cycles
106 lda ,x Eat status register 110 lda ,x Eat status register
171 ldu >sectbuf,u Get pointer to sector buffer 175 ldu >sectbuf,u Get pointer to sector buffer
172 ldd #512 Return sector buffer memory 176 ldd #512 Return sector buffer memory
173 os9 F$SRtMem 177 os9 F$SRtMem
174 puls u Restore device mem ptr 178 puls u Restore device mem ptr
175 clr >DPort+$00 shut off drive motors 179 clr >DPort+$00 shut off drive motors
180 IFEQ Level-1
181 clr <D.DskTmr Clear out drive motor timeout flag
182 ELSE
176 clr <D.MotOn Clear out drive motor timeout flag 183 clr <D.MotOn Clear out drive motor timeout flag
184 ENDC
177 L00AB rts return 185 L00AB rts return
178 186
179 * Check if 512 byte sector conversion needed 187 * Check if 512 byte sector conversion needed
180 * Entry: B:X=LSN 188 * Entry: B:X=LSN
181 * U=Static mem ptr 189 * U=Static mem ptr
866 ldd >VIRQCnt,pc Get VIRQ initial count value 874 ldd >VIRQCnt,pc Get VIRQ initial count value
867 std >u00B1,u Save it 875 std >u00B1,u Save it
868 lda >u00A9,u ?Get drive? 876 lda >u00A9,u ?Get drive?
869 ora #%00001000 Turn drive motor on for that drive 877 ora #%00001000 Turn drive motor on for that drive
870 sta >DPort+$00 Send drive motor on command to FDC 878 sta >DPort+$00 Send drive motor on command to FDC
879 IFEQ Level-1
880 lda <D.DskTmr Get VIRQ flag
881 ELSE
871 lda <D.MotOn Get VIRQ flag 882 lda <D.MotOn Get VIRQ flag
883 ENDC
872 bmi L04DE Not installed yet, try installing it 884 bmi L04DE Not installed yet, try installing it
873 bne L04E0 Drive already up to speed, exit without error 885 bne L04E0 Drive already up to speed, exit without error
874 886
875 * Drive motor speed timing loop (could be F$Sleep call now) (was over .5 sec) 887 * Drive motor speed timing loop (could be F$Sleep call now) (was over .5 sec)
876 ldx #32 wait for 32 ticks 888 ldx #32 wait for 32 ticks
879 L04DE bsr InsVIRQ Install VIRQ to wait for drive motors 891 L04DE bsr InsVIRQ Install VIRQ to wait for drive motors
880 L04E0 clrb No error & return 892 L04E0 clrb No error & return
881 puls pc,y,x,d 893 puls pc,y,x,d
882 894
883 InsVIRQ lda #$01 Flag drive motor is up to speed 895 InsVIRQ lda #$01 Flag drive motor is up to speed
896 IFEQ Level-1
897 sta <D.DskTmr
898 ELSE
884 sta <D.MotOn 899 sta <D.MotOn
900 ENDC
885 ldx #$0001 Install VIRQ entry 901 ldx #$0001 Install VIRQ entry
886 leay >u00B1,u Point to packet 902 leay >u00B1,u Point to packet
887 clr Vi.Stat,y Reset Status byte 903 clr Vi.Stat,y Reset Status byte
888 ldd >VIRQCnt,pc Get initial VIRQ count value 904 ldd >VIRQCnt,pc Get initial VIRQ count value
889 os9 F$VIRQ Install VIRQ 905 os9 F$VIRQ Install VIRQ
890 bcc VIRQOut No error, exit 906 bcc VIRQOut No error, exit
891 lda #$80 Flag that VIRQ wasn't installed 907 lda #$80 Flag that VIRQ wasn't installed
908 IFEQ Level-1
909 sta <D.DskTmr
910 ELSE
892 sta <D.MotOn 911 sta <D.MotOn
912 ENDC
893 VIRQOut clra 913 VIRQOut clra
894 rts 914 rts
895 915
896 * IRQ service routine for VIRQ (drive motor time) 916 * IRQ service routine for VIRQ (drive motor time)
897 * Entry: U=Ptr to VIRQ memory area 917 * Entry: U=Ptr to VIRQ memory area
907 lda u00B5,u 927 lda u00B5,u
908 anda #$FE 928 anda #$FE
909 sta u00B5,u 929 sta u00B5,u
910 ENDC 930 ENDC
911 * fdb u00B5 --- so changes in data size won't affect anything 931 * fdb u00B5 --- so changes in data size won't affect anything
932 IFEQ Level-1
933 clr <D.DskTmr
934 ELSE
912 clr <D.MotOn 935 clr <D.MotOn
936 ENDC
913 IRQOut puls pc,a 937 IRQOut puls pc,a
914 938
915 * Non-OS9 format goes here 939 * Non-OS9 format goes here
916 * Entry: X=LSN 940 * Entry: X=LSN
917 * Y=Path dsc. ptr 941 * Y=Path dsc. ptr