Changeset 4 in HXC_thomson_filesel
Legend:
- Unmodified
- Added
- Removed
-
loader.c
r3 r4 95 95 ret=go_trk255(); 96 96 border(1); 97 /* dump16b(1,16,ret); */98 97 border(2); 98 99 ret=string(0,0,"Checking Host mode...",21); 100 ret=rd_sec(0); 101 ret=dump16b(22,0,ret); 102 103 if (buf[0]!='H') { 104 string(0,2,"Fatal cannot setup Host mode...",31); 105 while (1==1) ; 106 } 107 108 string(0,1,buf,8); 109 string(8,1,buf+8,12); 110 99 111 ret=rd_lba(0,0); 100 112 lbaBeg_l=mk_16(buf[446+9],buf[446+8]); … … 245 257 hi_line(select+4,0xC7); 246 258 247 irq();248 259 while (1) { 249 260 i=getc(); … … 296 307 if (cfgnum==-1) { 297 308 cls(); 298 string(0,2," Sorry, no HXCSDFE.CFG found. read only..",40);309 string(0,2,"fatal missing CFG",17); 299 310 k=getc(); 300 311 cls(); … … 306 317 if (f_clusz<2) { 307 318 cls(); 308 string(0,2," Sorry, cluster size 1 is unsupported..",38);319 string(0,2,"cluster size 1 is unsupported..",33); 309 320 k=getc(); 310 321 cls(); … … 413 424 dump16b(0,24,ret); 414 425 415 string(0,13,"Press a key...",14);426 /* string(0,13,"Press a key...",14); 416 427 417 428 k=getc(); 418 429 */ 430 string(0,14,"Leaving host...",15); 419 431 420 /* leave LBA (need 3 times) */ 432 leave_lba(); 433 /* also seek just in case... () */ 421 434 go_track(0); 422 go_track(0); 423 go_track(0); 424 425 string(0,14,"... REBOOT ...",10); 435 436 437 string(0,15,"... REBOOT ...",10); 426 438 /* and reset */ 427 439 { … … 456 468 banner() 457 469 { 458 string(0,0,"HxC TO 8 File selector by VitalMotion",38);470 string(0,0,"HxC TO File selector by VitalMotion",37); 459 471 string(0,2,"Select your File:\0",17); 460 472 return 0; … … 641 653 { 642 654 #asm 655 LDA $E000 656 CMPA #$44 | for WD floppy (ie TO9) 657 BNE go_norm 658 659 LDA #$FF 660 STA $6051 661 LDA #127 | try to go -128 tracks... 662 STA _DKVAL 663 CLR _DKTRK 664 LDA #$40 665 JSR $E004 666 667 go_norm 643 668 LDA #$20 | rech piste 0 644 669 STA _DKOPC … … 684 709 p[13]=0xA5; 685 710 p[14]=0x08; 711 712 /* init fields with a read */ 713 wt_sec(0); 714 i=rd_sec(1); 715 return i; 716 } 717 718 leave_lba(v) 719 int v; 720 { 721 int i; 722 char *p; 723 724 for (i=0x6300;i<0x6500;i++) { 725 p=i; 726 *p=0x00; 727 } 728 i=0x6300;p=i; 729 p[0]='H'; 730 p[1]='x'; 731 p[2]='C'; 732 p[3]='F'; 733 p[4]='E'; 734 p[5]='D'; 735 p[6]='A'; 736 p[7]=0; 737 738 p[8]=0x02; 739 p[9]=0x00; 740 p[10]=0x00; 686 741 687 742 /* init fields with a read */ … … 833 888 } 834 889 890 /* 891 * Physical read/write in 9sect/512byte 892 */ 893 835 894 rd_sec(sect) 836 895 char sect; … … 844 903 PSHS U,DP 845 904 LDX #$6300 846 STX $604F | sector buffer 905 STX $604F | sector buffer 906 907 LDA $E000 908 CMPA #$44 | for WD floppy (ie TO9) 909 BNE rd_TO8 910 CLR $6051 911 LDA #$FF 912 STA $E7D1 913 LDA #$02 914 STA _DKOPC 915 JSR $E004 916 BRA rd_sect_end 917 918 rd_TO8 919 LDA #$02 | read sector (monitor) 847 920 JSR $789D 848 921 JSR $78A7 … … 856 929 PULS A | E0EE 857 930 JSR $78B9 | motor off 931 rd_sect_end 858 932 PULS DP,U 859 933 LDA #$00 860 934 LDB _DKERR 935 861 936 TFR D,X | return in X 862 937 #endasm … … 876 951 LDX #$6300 877 952 STX $604F | sector buffer 953 954 LDA $E000 955 CMPA #$44 | for WD floppy (ie TO9) 956 BNE wt_TO8 957 CLR $6051 958 LDA #$FF 959 STA $E7D1 960 LDA #$08 961 STA _DKOPC 962 JSR $E004 963 BRA wt_sect_end 964 965 wt_TO8 966 967 LDA #$08 | read sector (monitor) 878 968 JSR $789D 879 969 JSR $78A7 … … 887 977 PULS A | E0EE 888 978 JSR $78B9 | motor off 979 wt_sect_end 889 980 PULS DP,U 890 981 LDA #$00 … … 895 986 } 896 987 897 irq()898 {899 {900 #asm901 902 #endasm903 }904 }905 906 noirq()907 {908 {909 #asm910 911 #endasm912 }913 }914 988 915 989 getc() … … 1085 1159 PULS U,PC ; retour de fonction compatible mini C 1086 1160 1161 * MC09 internal functions/lib 1162 1163 _00001 PSHS D,X,Y multiply 1164 1165 LDA ,S 1166 LDB 3,S 1167 MUL 1168 STB 4,S 1169 1170 LDD 1,S 1171 MUL 1172 STB 5,S 1173 1174 LDA 1,S 1175 LDB 3,S 1176 MUL 1177 ADDA 4,S 1178 ADDA 5,S 1179 1180 LEAS 6,S 1181 RTS 1182 1183 _00006 CMPX #0 signed left shift 1184 BMI _06001 1185 1186 _06000 BEQ _06009 1187 LSLB 1188 ROLA 1189 LEAX -1,X 1190 BRA _06000 1191 1192 _06001 BEQ _06009 1193 ASRA 1194 RORB 1195 LEAX 1,X 1196 BRA _06001 1197 1198 _06009 RTS 1199 _00008 CMPX #0 sined right shift 1200 BMI _08001 1201 1202 _08000 BEQ _08009 1203 ASRA 1204 RORB 1205 LEAX -1,X 1206 BRA _08000 1207 1208 _08001 BEQ _08009 1209 LSLB 1210 ROLA 1211 LEAX 1,X 1212 BRA _08001 1213 1214 _08009 RTS 1215 _00009 CMPX #0 unsined right shift 1216 BMI _09001 1217 1218 _09000 BEQ _09009 1219 LSRA 1220 RORB 1221 LEAX -1,X 1222 BRA _09000 1223 1224 _09001 BEQ _09009 1225 LSLB 1226 ROLA 1227 LEAX 1,X 1228 BRA _09001 1229 1230 _09009 RTS 1087 1231 1088 1232 BASE_TXT_ADR … … 1243 1387 FCB $0,$8,$14,$22,$41,$41,$7F,$0 1244 1388 1245 * MC09 internal functions/lib 1246 1247 _00001 PSHS D,X,Y multiply 1248 1249 LDA ,S 1250 LDB 3,S 1251 MUL 1252 STB 4,S 1253 1254 LDD 1,S 1255 MUL 1256 STB 5,S 1257 1258 LDA 1,S 1259 LDB 3,S 1260 MUL 1261 ADDA 4,S 1262 ADDA 5,S 1263 1264 LEAS 6,S 1265 RTS 1266 1267 _00006 CMPX #0 signed left shift 1268 BMI _06001 1269 1270 _06000 BEQ _06009 1271 LSLB 1272 ROLA 1273 LEAX -1,X 1274 BRA _06000 1275 1276 _06001 BEQ _06009 1277 ASRA 1278 RORB 1279 LEAX 1,X 1280 BRA _06001 1281 1282 _06009 RTS 1283 _00008 CMPX #0 sined right shift 1284 BMI _08001 1285 1286 _08000 BEQ _08009 1287 ASRA 1288 RORB 1289 LEAX -1,X 1290 BRA _08000 1291 1292 _08001 BEQ _08009 1293 LSLB 1294 ROLA 1295 LEAX 1,X 1296 BRA _08001 1297 1298 _08009 RTS 1299 _00009 CMPX #0 unsined right shift 1300 BMI _09001 1301 1302 _09000 BEQ _09009 1303 LSRA 1304 RORB 1305 LEAX -1,X 1306 BRA _09000 1307 1308 _09001 BEQ _09009 1309 LSLB 1310 ROLA 1311 LEAX 1,X 1312 BRA _09001 1313 1314 _09009 RTS 1389 1315 1390 #endasm 1316 1391 }
Note: See TracChangeset
for help on using the changeset viewer.