Skip to content

Commit 56121e2

Browse files
committed
translation support continued
1 parent 4a6cf17 commit 56121e2

7 files changed

Lines changed: 812 additions & 711 deletions

File tree

driveio.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void Exit(int mserror, int fderror)
5252
if (debug_prog)
5353
exit(fderror); /* use the "verbose errorlevel" */
5454
if (mserror==4) /* "fatal error"? */
55-
printf(" [Error %d]\n", fderror);
55+
printf(catgets(catalog, 19, 0, " [Error %d]\n"), fderror);
5656
exit(mserror); /* use the "normal errorlevel" */
5757
} /* Exit */
5858

@@ -136,17 +136,18 @@ void Lock_Unlock_Drive(int lock)
136136
if (lockerrno == 0x0f) /* invalid drive */
137137
{
138138
/* locking_invalid_drive: */
139-
printf(" Invalid drive! Aborting.\n");
139+
printf(catgets(catalog, 19, 1, " Invalid drive! Aborting.\n"));
140140
Exit(4,29);
141141
}
142142

143143
regs.x.ax = 0x3000; /* get full DOS version and OEM ID */
144144
intdos(&regs, &regs);
145145
if (regs.h.bh == 0xfd)
146-
printf(" FreeDOS l. lock error 0x%x ignored.\n",lockerrno);
146+
printf(catgets(catalog, 19, 2, " FreeDOS l. lock error 0x%x ignored.\n"),
147+
lockerrno);
147148
else
148149
{
149-
printf(" Could not lock logical drive (error 0x%x)! Aborting.\n",
150+
printf(catgets(catalog, 19, 3, " Could not lock logical drive (error 0x%x)! Aborting.\n"),
150151
lockerrno);
151152
Exit(4,25);
152153
}
@@ -171,9 +172,9 @@ void Lock_Unlock_Drive(int lock)
171172
if (debug_prog==TRUE) /* error 5, "access denied", is "normal", */
172173
{ /* so limit warning to /d mode - 0.91v */
173174
if (regs.h.bh == 0xfd)
174-
printf(" FreeDOS p. lock error 0x%x ignored.\n", lockerrno);
175+
printf(catgets(catalog, 19, 4, " FreeDOS p. lock error 0x%x ignored.\n"), lockerrno);
175176
else
176-
printf(" Could not lock physical floppy drive (error 0x%x)!?\n",
177+
printf(catgets(catalog, 19, 5, " Could not lock physical floppy drive (error 0x%x)!?\n"),
177178
lockerrno);
178179
}
179180
/* could { ... exit(1); } here, but MSDN does not even */
@@ -195,7 +196,7 @@ int Drive_IO(int command,unsigned long sector_number,int number_of_sectors)
195196
if (allowfail) number_of_sectors = -number_of_sectors;
196197
if (!number_of_sectors)
197198
{
198-
printf("Drive_IO(x,y,0)?\n");
199+
printf(catgets(catalog, 19, 6, "Drive_IO(x,y,0)?\n"));
199200
return -1;
200201
}
201202

@@ -253,16 +254,16 @@ int Drive_IO(int command,unsigned long sector_number,int number_of_sectors)
253254
if (allowfail)
254255
{
255256
if (debug_prog==TRUE)
256-
printf("* bad sector(s): %ld (code 0x%x) on %s *\n",
257-
sector_number, return_code, (command==WRITE) ? "WRITE" : "READ");
257+
printf(catgets(catalog, 19, 7, "* bad sector(s): %ld (code 0x%x) on %s *\n"),
258+
sector_number, return_code, (command==WRITE) ? catgets(catalog, 19, 9, "WRITE") : catgets(catalog, 19, 10, "READ"));
258259
else
259260
printf("#");
260261
}
261262
else
262263
{
263264
/* Added more details -ea */
264-
printf("Drive_IO(%s %ld, count %d ) [%s] [drive %c%c]\n",
265-
(command==WRITE) ? "WRITE" : "READ", sector_number, number_of_sectors,
265+
printf(catgets(catalog, 19, 8, "Drive_IO(%s %ld, count %d ) [%s] [drive %c%c]\n"),
266+
(command==WRITE) ? catgets(catalog, 19, 9, "WRITE") : catgets(catalog, 19, 10, "READ"), sector_number, number_of_sectors,
266267
(param.fat_type==FAT32) ? "FAT32" : "FAT12/16",
267268
'A' + (param.drive_number & 0x7f),
268269
(param.drive_number & 0x80) ? '*' : ':' );
@@ -319,7 +320,7 @@ void Enable_Disk_Access(void) /* DOS 4.0+ drive access flag / locking */
319320
}
320321

321322
/* Add error trapping here */
322-
printf("\nCannot get access flags (error %02x). Aborting.\n",
323+
printf(catgets(catalog, 19, 11, "\nCannot get access flags (error %02x). Aborting.\n"),
323324
error_code);
324325
Exit(4,26);
325326
}
@@ -343,7 +344,7 @@ void Enable_Disk_Access(void) /* DOS 4.0+ drive access flag / locking */
343344
if (regs.x.cflag)
344345
{
345346
/* Add error trapping here */
346-
printf("\nCannot enable access flags (error %02x). Aborting.\n",
347+
printf(catgets(catalog, 19, 12, "\nCannot enable access flags (error %02x). Aborting.\n"),
347348
error_code);
348349
Exit(4,27);
349350
}

floppy.c

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ int Format_Floppy_Cylinder(int cylinder,int head)
222222
if (debug_prog==TRUE) printf("[DEBUG] New disk found...\n");
223223
goto track0again;
224224
}
225-
printf("Format_Floppy_Cylinder( head=%d cylinder=%d ) sectors=%d [int 13.5]\n",
225+
printf(catgets(catalog, 22, 0, "Format_Floppy_Cylinder( head=%d cylinder=%d ) sectors=%d [int 13.5]\n"),
226226
head, cylinder, secPerTrack );
227227
Critical_Error_Handler(BIOS, result); /* this would abort, no? */
228228
}
@@ -243,7 +243,7 @@ int Format_Floppy_Cylinder(int cylinder,int head)
243243
if ( regs.h.al > (sizeof(huge_sector_buffer_0)>>9) )
244244
{
245245
regs.h.al = sizeof(huge_sector_buffer_0) >> 9;
246-
printf("Only checking first %d sectors per track\n", regs.h.al);
246+
printf(catgets(catalog, 22, 1, "Only checking first %d sectors per track\n"), regs.h.al);
247247
/* could read 2 half-tracks or use pinpointing below here */
248248
/* instead... however, only 2.88MB disks have > 18 sect/track */
249249
}
@@ -322,7 +322,7 @@ if (cylinder==2 && head==1) {sector_index = 6; goto fakebad; }
322322
if ((cylinder == 0) && (head == 0) && (sector_index <= 7))
323323
{
324324
/* 7: boot sect + 2 fat sect + 4 root dir sect on 160k disk */
325-
printf("\nFormat failed, error in first 7 sectors!\n");
325+
printf(catgets(catalog, 22, 2, "\nFormat failed, error in first 7 sectors!\n"));
326326
return secPerTrack; /* pretend whole track bad - 0.91n */
327327
}
328328

@@ -334,7 +334,7 @@ if (cylinder==2 && head==1) {sector_index = 6; goto fakebad; }
334334
}
335335
else
336336
{
337-
printf("Sector %4ld CHS=[%2d:%d:%2d] bad\n",
337+
printf(catgets(catalog, 22, 3, "Sector %4ld CHS=[%2d:%d:%2d] bad\n"),
338338
bad_sector_map[(bad_sector_map_pointer-1)],
339339
cylinder, head, sector_index);
340340
}
@@ -429,7 +429,7 @@ void Set_Floppy_Media_Type()
429429

430430
if ((drive_number & 0x80) != 0)
431431
{
432-
printf("Harddisk drive number! Aborting.\n");
432+
printf(catgets(catalog, 22, 4, "Harddisk drive number! Aborting.\n"));
433433
Exit(4,40);
434434
}
435435

@@ -513,7 +513,7 @@ void Set_Floppy_Media_Type()
513513
param.sides = drive_specs[index].number_of_heads;
514514
}
515515

516-
printf("Formatting to %ldk (Cyl=%ld Head=%ld Sec=%2ld)\n",
516+
printf(catgets(catalog, 22, 5, "Formatting to %ldk (Cyl=%ld Head=%ld Sec=%2ld)\n"),
517517
param.size, param.cylinders, param.sides, param.sectors);
518518
index = -10; /* break out of the loop */
519519
} /* end "if match" */
@@ -530,12 +530,12 @@ void Set_Floppy_Media_Type()
530530
{
531531
if (param.f==TRUE) /* only size given */
532532
{
533-
printf("No media type known for %ldk format\n", param.size);
533+
printf(catgets(catalog, 22, 6, "No media type known for %ldk format\n"), param.size);
534534
}
535535
else /* geometry given */
536536
{
537537
param.size = (param.cylinders * param.sides * param.sectors) >> 1;
538-
printf("No media type known for %ldk format (Cyl=%ld Head=%ld Sec=%2ld)\n",
538+
printf(catgets(catalog, 22, 7, "No media type known for %ldk format (Cyl=%ld Head=%ld Sec=%2ld)\n"),
539539
param.size, param.cylinders, param.sides, param.sectors);
540540
}
541541
Exit(4,41); /* cannot continue anyway, media type needed later! */
@@ -581,7 +581,7 @@ void Set_Floppy_Media_Type()
581581
case 6: preferredsize = 2880;
582582
break;
583583
default: preferredsize = 1440; /* USB floppy is type 0x10, atapi!? */
584-
printf("Treating int 13.8 drive type 0x%x as 1440k.\n", /* 0.91t */
584+
printf(catgets(catalog, 22, 8, "Treating int 13.8 drive type 0x%x as 1440k.\n"), /* 0.91t */
585585
drive_type);
586586
/* Type 5 is originally for floppy tape drives */
587587
/* int 21.440d.860 would use: 0 360k, 1 1200k, 2 720k, 7 1440k, 5 harddisk */
@@ -604,7 +604,7 @@ void Set_Floppy_Media_Type()
604604
param.sectors = drive_specs[index].sectors_per_cylinder;
605605
param.sides = drive_specs[index].number_of_heads;
606606

607-
printf("Using drive default: %ldk (Cyl=%ld Head=%ld Sec=%2ld)\n",
607+
printf(catgets(catalog, 22, 9, "Using drive default: %ldk (Cyl=%ld Head=%ld Sec=%2ld)\n"),
608608
param.size, param.cylinders, param.sides, param.sectors);
609609
index = -10;
610610
}
@@ -619,7 +619,7 @@ void Set_Floppy_Media_Type()
619619

620620
if (index >= 0)
621621
{
622-
printf("Size %ldk undefined!??\n", param.size);
622+
printf(catgets(catalog, 22, 10, "Size %ldk undefined!??\n"), param.size);
623623
Exit(4,42); /* should not happen: no default geometry known */
624624
}
625625
}
@@ -629,11 +629,11 @@ void Set_Floppy_Media_Type()
629629
{
630630
if (param.size > (preferredsize + (preferredsize >> 2)))
631631
{
632-
printf("Want %ldk in %dk drive? Too much. Aborting.\n",
632+
printf(catgets(catalog, 22, 11, "Want %ldk in %dk drive? Too much. Aborting.\n"),
633633
param.size, preferredsize);
634634
Exit(4,43);
635635
}
636-
printf("OVERFORMAT: %ldk in %dk drive. Good luck!\n",
636+
printf(catgets(catalog, 22, 12, "OVERFORMAT: %ldk in %dk drive. Good luck!\n"),
637637
param.size, preferredsize);
638638
}
639639
}
@@ -674,12 +674,12 @@ void Set_Floppy_Media_Type()
674674
/* (bonus: mode 2 should allow 360k format in 720k drive) */
675675
if (param.four || param.one || param.eight)
676676
{
677-
printf("This is a 720k drive: No /1, /4 or /8 possible.\n");
677+
printf(catgets(catalog, 22, 13, "This is a 720k drive: No /1, /4 or /8 possible.\n"));
678678
Exit(4,44);
679679
}
680680
if (param.size < 720)
681681
{
682-
printf("Minimum size for this drive type is 720k\n");
682+
printf(catgets(catalog, 22, 14, "Minimum size for this drive type is 720k\n"));
683683
Exit(4,45);
684684
}
685685
break;
@@ -700,17 +700,17 @@ void Set_Floppy_Media_Type()
700700
sizecheck_3inch:
701701
if (param.four || param.one || param.eight)
702702
{
703-
printf("This is a 3.25 inch drive: No /1, /4 or /8 possible.\n");
703+
printf(catgets(catalog, 22, 15, "This is a 3.25 inch drive: No /1, /4 or /8 possible.\n"));
704704
Exit(4,46);
705705
}
706706
if (param.size < 720)
707707
{
708-
printf("Minimum size for this drive type is 720k.\n");
708+
printf(catgets(catalog, 22, 16, "Minimum size for this drive type is 720k.\n"));
709709
Exit(4,47);
710710
}
711711
if (param.size == 1200)
712712
{
713-
printf("This is a 3.25 inch drive: No 1200k format.\n");
713+
printf(catgets(catalog, 22, 17, "This is a 3.25 inch drive: No 1200k format.\n"));
714714
Exit(4,47);
715715
}
716716
break;
@@ -742,15 +742,15 @@ void Set_Floppy_Media_Type()
742742

743743
if (regs.x.cflag != 0)
744744
{
745-
printf("Drive mode (size class %d) setting failed, error %02x hex\n",
745+
printf(catgets(catalog, 22, 18, "Drive mode (size class %d) setting failed, error %02x hex\n"),
746746
sizeclass, regs.h.ah);
747747
if (regs.h.ah == 0x80)
748748
{
749-
printf("No disk in drive!\n");
749+
printf(catgets(catalog, 22, 19, "No disk in drive!\n"));
750750
Exit(4,48);
751751
}
752752
else
753-
printf("Continuing anyway.\n");
753+
printf(catgets(catalog, 22, 20, "Continuing anyway.\n"));
754754
}
755755
}
756756

@@ -837,7 +837,7 @@ void Set_Floppy_Media_Type()
837837

838838
if (regs.h.ah==0x80)
839839
{
840-
printf("No disk in drive (timeout)!\n");
840+
printf(catgets(catalog, 22, 21, "No disk in drive (timeout)!\n"));
841841
Exit(4,49);
842842
}
843843

@@ -850,18 +850,18 @@ void Set_Floppy_Media_Type()
850850
}
851851
else /* ... if AH is 0x0ch, that is */
852852
{
853-
printf("Media type %ldk (%d x %ld x %2d) not supported by this drive!?\n",
853+
printf(catgets(catalog, 22, 22, "Media type %ldk (%d x %ld x %2d) not supported by this drive!?\n"),
854854
param.size, number_of_cylinders, param.sides, sectors_per_cylinder);
855-
printf("Geometry set (int 13.18) error (%02x). ", regs.h.ah);
855+
printf(catgets(catalog, 22, 23, "Geometry set (int 13.18) error (%02x). "), regs.h.ah);
856856
if ( (_osmajor < 7) ||
857857
(sectors_per_cylinder > ddpt->sectors_per_cylinder) )
858858
{ /* 0.91q: Win9x DOS box uses *63 geometry all the time */
859-
printf("Giving up.\n"); /* old DOS - or ddpt geo too small */
859+
printf(catgets(catalog, 22, 24, "Giving up.\n")); /* old DOS - or ddpt geo too small */
860860
Exit(4,50);
861861
}
862862
else /* ability to ignore added 0.91q */
863863
{
864-
printf("Ignored.\n");
864+
printf(catgets(catalog, 22, 25, "Ignored.\n"));
865865
regs.x.di = 0xffff; /* "NO NEW DDPT DATA" */
866866
}
867867
}
@@ -909,7 +909,7 @@ void Set_Floppy_Media_Type()
909909
sregs.ds = FP_SEG(ddpt); /* segment DS */
910910
intdosx(&regs,&regs,&sregs);
911911

912-
printf("DDPT is in ROM - only standard sizes possible.\n");
912+
printf(catgets(catalog, 22, 26, "DDPT is in ROM - only standard sizes possible.\n"));
913913

914914
if (debug_prog==TRUE)
915915
printf("[DEBUG] New INT 1E (DDPT) vector: %04x:%04x.\n",
@@ -928,7 +928,7 @@ void Set_Floppy_Media_Type()
928928
/* update geometry even if the ddpt pointer or contents did not change. */
929929

930930
if (ddpt->sectors_per_cylinder != sectors_per_cylinder) /* DDPT is in ROM */
931-
printf("SECTORS PER TRACK stuck to %d, wanted %d. Continuing anyway.\n",
931+
printf(catgets(catalog, 22, 27, "SECTORS PER TRACK stuck to %d, wanted %d. Continuing anyway.\n"),
932932
ddpt->sectors_per_cylinder, sectors_per_cylinder);
933933

934934

@@ -945,7 +945,7 @@ void Set_Floppy_Media_Type()
945945

946946
if ( (FP_SEG(ddpt) > 0xa000) && ((FP_SEG(ddpt) & 0x3ff) == 0) )
947947
{
948-
printf("DDPT tweaking impossible: DDPT in ROM\n");
948+
printf(catgets(catalog, 22, 28, "DDPT tweaking impossible: DDPT in ROM\n"));
949949
Exit(4,51);
950950
}
951951

@@ -972,14 +972,14 @@ void Set_Floppy_Media_Type()
972972

973973
if (gap_len == 0)
974974
{
975-
printf("No gap length known for %d sec/cyl. Good luck with BIOS value!\n",
975+
printf(catgets(catalog, 22, 29, "No gap length known for %d sec/cyl. Good luck with BIOS value!\n"),
976976
sectors_per_cylinder); /* (we will display BIOS value in DEBUG mode) */
977-
printf("TWEAK: Sectors per cylinder in DDPT set to %d\n",
977+
printf(catgets(catalog, 22, 30, "TWEAK: Sectors per cylinder in DDPT set to %d\n"),
978978
sectors_per_cylinder);
979979
}
980980
else
981981
{
982-
printf("TWEAK: %d Sectors per cylinder, Format gap length %d!\n",
982+
printf(catgets(catalog, 22, 31, "TWEAK: %d Sectors per cylinder, Format gap length %d!\n"),
983983
sectors_per_cylinder, gap_len);
984984
RestoreDDPT();
985985
ddpt->gap3_length_xmat = gap_len; /* (gap3_length_rw needs no change) */
@@ -1025,7 +1025,7 @@ void Set_Floppy_Media_Type()
10251025
int86(0x13,&regs,&regs); /* reset floppy controller */
10261026
if (regs.x.cflag && (regs.h.ah != 0)) {
10271027
regs.x.ax = regs.h.ah;
1028-
printf("Floppy controller reset failed (code %x) - DDPT rejected?\n",
1028+
printf(catgets(catalog, 22, 32, "Floppy controller reset failed (code %x) - DDPT rejected?\n"),
10291029
regs.x.ax);
10301030
}
10311031

@@ -1055,24 +1055,25 @@ void Set_Floppy_Media_Type()
10551055
#endif
10561056

10571057
printf("[DEBUG] Controller setup %2hx: ", control); /* %hx: short hex */
1058-
if (control & 0x20) printf("[doublestepping] ");
1059-
if (control & 0x10) printf("[configured type %hu] ", (control & 0x0f));
1058+
if (control & 0x20) printf(catgets(catalog, 22, 34, "[doublestepping] "));
1059+
if (control & 0x10) printf(catgets(catalog, 22, 35, "[configured type %hu] "), (control & 0x0f));
10601060
/* only if configured is true int 13.5 will work!? */
10611061
control >>= 6; /* keep only baud rate bits */
10621062
switch (control)
10631063
{
1064-
case 0: printf(" 500 kbps (HD 1xx0k)\n"); break;
1065-
case 1: printf(" 300 kbps (DD 360k)\n"); break;
1066-
case 2: printf(" 250 kbps (DD 720k)\n"); break;
1067-
default: printf("1000 kbps (ED 2880k)\n"); break;
1064+
case 0: printf(catgets(catalog, 22, 36, " 500 kbps (HD 1xx0k)\n")); break;
1065+
case 1: printf(catgets(catalog, 22, 37, " 300 kbps (DD 360k)\n"); break;
1066+
case 2: printf(catgets(catalog, 22, 38, " 250 kbps (DD 720k)\n")); break;
1067+
default: printf(catgets(catalog, 22, 39, "1000 kbps (ED 2880k)\n")); break;
10681068
}
10691069
} /* controller settings display */
10701070

10711071
if ( (debug_prog==TRUE) && (!param.force_yes) ) /* added /Y check 0.91o */
10721072
{
10731073
char ch;
10741074
write(isatty(1) ? 1 : 2,
1075-
"-- press ENTER to format disk (ESCAPE to abort) --\n", 51);
1075+
catgets(catalog, 22, 33, "-- press ENTER to format disk (ESCAPE to abort) --\n"),
1076+
strlen(catgets(catalog, 22, 33, "-- press ENTER to format disk (ESCAPE to abort) --\n")));
10761077
/* writes to stderr to stay visible if redirecting */
10771078

10781079
do

0 commit comments

Comments
 (0)