Mercurial > hg > Members > kono > nitros9-code
comparison level1/modules/ddisk.asm @ 1822:c074e97abf3d
Removed debugging code/messages, tested successfully on real Dragons
author | afra |
---|---|
date | Sun, 24 Apr 2005 14:37:34 +0000 |
parents | 82e134e51305 |
children | 4ea2e417a48e |
comparison
equal
deleted
inserted
replaced
1821:82e134e51305 | 1822:c074e97abf3d |
---|---|
52 * around. Still has a problem doing lots of retries. | 52 * around. Still has a problem doing lots of retries. |
53 * | 53 * |
54 * 2005-04-24, P.Harvey-Smith. | 54 * 2005-04-24, P.Harvey-Smith. |
55 * Fixed constant lost data errors reading disks, again by slightly | 55 * Fixed constant lost data errors reading disks, again by slightly |
56 * re-ordering the instructions in the read data loop. | 56 * re-ordering the instructions in the read data loop. |
57 * | 57 * |
58 * 2005-04-24, P.Harvey-Smith. | |
59 * Removed debugging code/messages. | |
58 | 60 |
59 nam DDisk | 61 nam DDisk |
60 ttl Dragon Floppy driver | 62 ttl Dragon Floppy driver |
61 | 63 |
62 * Disassembled 02/04/21 22:37:46 by Disasm v1.6 (C) 1988 by RML | 64 * Disassembled 02/04/21 22:37:46 by Disasm v1.6 (C) 1988 by RML |
152 SaveACIACmd rmb 1 ; Saved copy of ACIA command reg | 154 SaveACIACmd rmb 1 ; Saved copy of ACIA command reg |
153 BuffPtr rmb 2 ; Buffer pointer | 155 BuffPtr rmb 2 ; Buffer pointer |
154 SideSel rmb 1 ; Side select. | 156 SideSel rmb 1 ; Side select. |
155 NMIFlag rmb 1 ; Flag for Alpha, should this NMI do an RTI ? | 157 NMIFlag rmb 1 ; Flag for Alpha, should this NMI do an RTI ? |
156 | 158 |
157 DskError rmb 1 | 159 DskError rmb 1 ; hardware disk error |
158 | 160 |
159 VIRQPak rmb 2 ; Vi.Cnt word for VIRQ | 161 VIRQPak rmb 2 ; Vi.Cnt word for VIRQ |
160 u00B3 rmb 2 ; Vi.Rst word for VIRQ | 162 u00B3 rmb 2 ; Vi.Rst word for VIRQ |
161 u00B5 rmb 1 ; Vi.Stat byte for VIRQ (drive motor timeout) | 163 u00B5 rmb 1 ; Vi.Stat byte for VIRQ (drive motor timeout) |
162 | 164 |
190 * | 192 * |
191 * Exit: | 193 * Exit: |
192 * CC = carry set on error | 194 * CC = carry set on error |
193 * B = error code | 195 * B = error code |
194 * | 196 * |
195 DragonDebug EQU 1 | 197 DragonDebug EQU 0 |
196 Init | 198 Init |
197 IFNE DragonDebug | 199 IFNE DragonDebug |
198 pshs x ; This is here so I can find disk driver in mess | 200 pshs x ; This is here so I can find disk driver in mess |
199 ldx #$AA55 ; by setting register breakpoint to X=$AA55 ! | 201 ldx #$AA55 ; by setting register breakpoint to X=$AA55 ! |
200 puls x | 202 puls x |
308 rts | 310 rts |
309 | 311 |
310 ; Read Retry | 312 ; Read Retry |
311 | 313 |
312 ReadDataRetry | 314 ReadDataRetry |
313 | |
314 lbsr RetryErrorDisplay | |
315 | |
316 bcc ReadDataWithRetry ; Retry entry point | 315 bcc ReadDataWithRetry ; Retry entry point |
317 pshs x,b,a | 316 pshs x,b,a |
318 lbsr ResetTrack0 ; Reset track 0 | 317 lbsr ResetTrack0 ; Reset track 0 |
319 puls x,b,a | 318 puls x,b,a |
320 | 319 |
972 RTS | 971 RTS |
973 | 972 |
974 ENDC | 973 ENDC |
975 | 974 |
976 | 975 |
977 ShowReg | |
978 pshs d,x,y,cc,dp,u | |
979 pshs x | |
980 leax RegBuffD,pcr | |
981 bsr RegDToHex | |
982 | |
983 puls d | |
984 leax RegBuffX,pcr | |
985 bsr RegDToHex | |
986 | |
987 tfr Y,D | |
988 leax RegBuffY,pcr | |
989 bsr RegDToHex | |
990 | |
991 tfr u,d | |
992 leax RegBuffU,pcr | |
993 bsr RegDToHex | |
994 | |
995 tfr s,d | |
996 leax RegBuffS,pcr | |
997 bsr RegDToHex | |
998 | |
999 tfr cc,a | |
1000 leax RegBuffCC,pcr | |
1001 bsr RegAToHex | |
1002 | |
1003 tfr dp,a | |
1004 leax RegBuffDP,pcr | |
1005 bsr RegAToHex | |
1006 | |
1007 lda #1 * stdout | |
1008 leax RegBuff,pcr | |
1009 ldy #RegBuffEnd-RegBuff | |
1010 os9 I$write | |
1011 | |
1012 ShowRegEnd | |
1013 puls d,x,y,cc,dp,u | |
1014 rts | |
1015 | |
1016 RegDtoHex | |
1017 pshs d | |
1018 bsr RegAToHex | |
1019 tfr b,a | |
1020 bsr RegAToHex | |
1021 puls d | |
1022 rts | |
1023 | |
1024 RegAToHex | |
1025 pshs d,y | |
1026 | |
1027 leay HexTable,pcr | |
1028 tfr a,b | |
1029 anda #$f0 | |
1030 lsra | |
1031 lsra | |
1032 lsra | |
1033 lsra | |
1034 lda a,y | |
1035 sta ,x+ | |
1036 tfr b,a | |
1037 anda #$0f | |
1038 lda a,y | |
1039 sta ,x+ | |
1040 | |
1041 puls d,y | |
1042 rts | |
1043 | |
1044 RetryErrorDisplay | |
1045 pshs a,x,cc | |
1046 | |
1047 lda DskError,u | |
1048 leax ErrCode,pcr | |
1049 bsr RegAToHex | |
1050 | |
1051 leax RetryMess,pcr | |
1052 bsr PrintStdOut | |
1053 puls a,x,cc,pc | |
1054 | |
1055 | |
1056 PrintDot | |
1057 pshs x,cc | |
1058 leax DotMess,pcr | |
1059 bsr PrintStdOut | |
1060 puls x,cc,pc | |
1061 | |
1062 | |
1063 PrintReadDone | |
1064 pshs x,cc | |
1065 leax ReadDoneMess,pcr | |
1066 bsr PrintStdOut | |
1067 puls x,cc,pc | |
1068 | |
1069 PrintReadDoneFail | |
1070 pshs x,cc | |
1071 leax ReadDoneFailMess,pcr | |
1072 bsr PrintStdOut | |
1073 puls x,cc,pc | |
1074 | |
1075 | |
1076 PrintStdOut | |
1077 pshs d,x,y,u,cc,dp | |
1078 leax -2,x | |
1079 ldy ,x++ | |
1080 lda #1 | |
1081 os9 I$write | |
1082 puls d,x,y,u,cc,dp,pc | |
1083 | |
1084 PrintCtrlByte | |
1085 pshs a,cc,x | |
1086 | |
1087 leax CtrlCode,pcr | |
1088 bsr RegAToHex | |
1089 | |
1090 leax CtrlMess,pcr | |
1091 ldy #CtrlMessLen | |
1092 bsr PrintStdOut | |
1093 puls a,cc,x,pc | |
1094 | |
1095 PrintCmdByte | |
1096 pshs a,cc,x | |
1097 | |
1098 leax CmdCode,pcr | |
1099 bsr RegAToHex | |
1100 | |
1101 leax CmdMess,pcr | |
1102 bsr PrintStdOut | |
1103 puls a,cc,x,pc | |
1104 | |
1105 PrintNMIMess | |
1106 pshs x,cc | |
1107 leax NMIMess,pcr | |
1108 bsr PrintStdOut | |
1109 puls x,cc,pc | |
1110 | |
1111 | |
1112 PrintTimeout | |
1113 pshs x,cc | |
1114 leax TimeoutMess,pcr | |
1115 bsr PrintStdOut | |
1116 puls x,cc,pc | |
1117 | |
1118 RegBuff | |
1119 fcc "A B X Y U " | |
1120 fcb C$CR,C$LF | |
1121 RegBuffD | |
1122 fcc "0000 " | |
1123 RegBuffX | |
1124 fcc "0000 " | |
1125 RegBuffY | |
1126 fcc "0000 " | |
1127 RegBuffU | |
1128 fcc "0000 " | |
1129 RegBuffS | |
1130 fcc "0000 " | |
1131 RegBuffCC | |
1132 fcc "00 " | |
1133 RegBuffDP | |
1134 fcc "00 " | |
1135 | |
1136 fcb C$CR,C$LF,0 | |
1137 RegBuffEnd | |
1138 | |
1139 HexTable | |
1140 fcc "0123456789ABCDEF" | |
1141 | |
1142 | |
1143 fdb RetryMessLen | |
1144 RetryMess | |
1145 fcc "Read error: retry (" | |
1146 ErrCode fcc "00)" | |
1147 fcb C$CR,C$LF,0 | |
1148 | |
1149 RetryMessLen EQU *-RetryMess | |
1150 | |
1151 | |
1152 fdb CtrlMessLen | |
1153 CtrlMess | |
1154 fcc "Control byte (" | |
1155 CtrlCode fcc "00)" | |
1156 fcb C$CR,C$LF,0 | |
1157 CtrlMessLen EQU *-CtrlMess | |
1158 | |
1159 | |
1160 | |
1161 fdb CtrlMessLen | |
1162 CmdMess | |
1163 fcc "Command byte (" | |
1164 CmdCode fcc "00)" | |
1165 fcb C$CR,C$LF,0 | |
1166 CmdMessLen EQU *-CmdMess | |
1167 | |
1168 fdb 1 | |
1169 DotMess fcc "." | |
1170 fcb 0 | |
1171 | |
1172 | |
1173 fdb ReadDoneMessLen | |
1174 ReadDoneMess | |
1175 fcc "Read Succeded" | |
1176 fcb C$CR,C$LF,0 | |
1177 ReadDoneMessLen EQU *-ReadDoneMess | |
1178 | |
1179 fdb ReadDoneFailMessLen | |
1180 ReadDoneFailMess | |
1181 fcc "Read Failed" | |
1182 fcb C$CR,C$LF,0 | |
1183 ReadDoneFailMessLen EQU *-ReadDoneFailMess | |
1184 | |
1185 | |
1186 fdb NMIMessLen | |
1187 NMIMess | |
1188 fcc "In NMI" | |
1189 fcb C$CR,C$LF,0 | |
1190 NMIMessLen EQU *-NMIMess | |
1191 | |
1192 fdb TimeoutMessLen | |
1193 TimeoutMess | |
1194 fcc "Timout !" | |
1195 fcb C$CR,C$LF,0 | |
1196 TimeoutMessLen EQU *-TimeoutMess | |
1197 | |
1198 emod | 976 emod |
1199 eom equ * | 977 eom equ * |
1200 end | 978 end |