Subversion Repositories SvarDOS

Rev

Rev 1662 | Rev 1665 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1662 Rev 1664
Line 43... Line 43...
43
 
43
 
44
/* prototype of the int24hdl() function defined in int24hdl.asm */
44
/* prototype of the int24hdl() function defined in int24hdl.asm */
45
void int24hdl(void);
45
void int24hdl(void);
46
 
46
 
47
 
47
 
48
/* color scheme (color, mono) */
48
/* color scheme (preset for color) */
49
static unsigned char COLOR_TITLEBAR[2] = {0x70,0x70};
49
static unsigned char COLOR_TITLEBAR  = 0x70;
50
static unsigned char COLOR_BODY[2] = {0x07,0x17};
50
static unsigned char COLOR_BODY      = 0x17;
51
static unsigned char COLOR_SELECT[2] = {0x70,0x70};
51
static unsigned char COLOR_SELECT    = 0x70;
52
static unsigned char COLOR_SELECTCUR[2] = {0x07,0x1F};
52
static unsigned char COLOR_SELECTCUR = 0x1F;
53
 
53
 
54
/* mono flag (0=mono 1=color) */
-
 
55
static unsigned char mono = 0;
-
 
56
 
54
 
57
/* how much disk space does SvarDOS require (in MiB) */
55
/* how much disk space does SvarDOS require (in MiB) */
58
#define SVARDOS_DISK_REQ 8
56
#define SVARDOS_DISK_REQ 8
59
 
57
 
60
/* menu screens can output only one of these: */
58
/* menu screens can output only one of these: */
Line 176... Line 174...
176
  }
174
  }
177
 
175
 
178
  /* if xpos negative, means 'center out' */
176
  /* if xpos negative, means 'center out' */
179
  if (xpos < 0) xpos = 39 - (width >> 1);
177
  if (xpos < 0) xpos = 39 - (width >> 1);
180
 
178
 
181
  mdr_cout_char(ypos, xpos+width+2, 0xBF, COLOR_SELECT[mono]);         /*       \ */
179
  mdr_cout_char(ypos, xpos+width+2, 0xBF, COLOR_SELECT);         /*       \ */
182
  mdr_cout_char(ypos, xpos-1, 0xDA, COLOR_SELECT[mono]);               /*  /      */
180
  mdr_cout_char(ypos, xpos-1, 0xDA, COLOR_SELECT);               /*  /      */
183
  mdr_cout_char(ypos+height-1, xpos-1, 0xC0, COLOR_SELECT[mono]);      /*  \      */
181
  mdr_cout_char(ypos+height-1, xpos-1, 0xC0, COLOR_SELECT);      /*  \      */
184
  mdr_cout_char(ypos+height-1, xpos+width+2, 0xD9, COLOR_SELECT[mono]);/*      /  */
182
  mdr_cout_char(ypos+height-1, xpos+width+2, 0xD9, COLOR_SELECT);/*      /  */
185
  mdr_cout_char_rep(ypos, xpos, 0xC4, COLOR_SELECT[mono], width + 2);
183
  mdr_cout_char_rep(ypos, xpos, 0xC4, COLOR_SELECT, width + 2);
186
  mdr_cout_char_rep(ypos+height-1, xpos, 0xC4, COLOR_SELECT[mono], width + 2);
184
  mdr_cout_char_rep(ypos+height-1, xpos, 0xC4, COLOR_SELECT, width + 2);
187
 
185
 
188
  for (y = ypos + 1; y < (ypos + height - 1); y++) {
186
  for (y = ypos + 1; y < (ypos + height - 1); y++) {
189
    mdr_cout_char(y, xpos-1, 0xB3, COLOR_SELECT[mono]);
187
    mdr_cout_char(y, xpos-1, 0xB3, COLOR_SELECT);
190
    mdr_cout_char(y, xpos+width+2, 0xB3, COLOR_SELECT[mono]);
188
    mdr_cout_char(y, xpos+width+2, 0xB3, COLOR_SELECT);
191
  }
189
  }
192
 
190
 
193
  for (;;) {
191
  for (;;) {
194
    int key;
192
    int key;
195
    /* list of selectable items */
193
    /* list of selectable items */
196
    for (i = 0; i < height - 2; i++) {
194
    for (i = 0; i < height - 2; i++) {
197
      if (i + offset == res) {
195
      if (i + offset == res) {
198
        mdr_cout_char(ypos + 1 + i, xpos, 16, COLOR_SELECTCUR[mono]);
196
        mdr_cout_char(ypos + 1 + i, xpos, 16, COLOR_SELECTCUR);
199
        mdr_cout_char(ypos + 1 + i, xpos+width+1, 17, COLOR_SELECTCUR[mono]);
197
        mdr_cout_char(ypos + 1 + i, xpos+width+1, 17, COLOR_SELECTCUR);
200
        mdr_cout_locate(ypos + 1 + i, xpos);
198
        mdr_cout_locate(ypos + 1 + i, xpos);
201
        video_putstringfix(ypos + 1 + i, xpos+1, COLOR_SELECTCUR[mono], list[i + offset], width);
199
        video_putstringfix(ypos + 1 + i, xpos+1, COLOR_SELECTCUR, list[i + offset], width);
202
      } else if (i + offset < count) {
200
      } else if (i + offset < count) {
203
        mdr_cout_char(ypos + 1 + i, xpos, ' ', COLOR_SELECT[mono]);
201
        mdr_cout_char(ypos + 1 + i, xpos, ' ', COLOR_SELECT);
204
        mdr_cout_char(ypos + 1 + i, xpos+width+1, ' ', COLOR_SELECT[mono]);
202
        mdr_cout_char(ypos + 1 + i, xpos+width+1, ' ', COLOR_SELECT);
205
        video_putstringfix(ypos + 1 + i, xpos+1, COLOR_SELECT[mono], list[i + offset], width);
203
        video_putstringfix(ypos + 1 + i, xpos+1, COLOR_SELECT, list[i + offset], width);
206
      } else {
204
      } else {
207
        mdr_cout_char_rep(ypos + 1 + i, xpos, ' ', COLOR_SELECT[mono], width+2);
205
        mdr_cout_char_rep(ypos + 1 + i, xpos, ' ', COLOR_SELECT, width+2);
208
      }
206
      }
209
    }
207
    }
210
    key = mdr_dos_getkey();
208
    key = mdr_dos_getkey();
211
    if (key == 0x0D) { /* ENTER */
209
    if (key == 0x0D) { /* ENTER */
212
      return(res);
210
      return(res);
Line 229... Line 227...
229
    } else if (key == 0x1B) {  /* ESC */
227
    } else if (key == 0x1B) {  /* ESC */
230
      return(-1);
228
      return(-1);
231
    }/* else {
229
    }/* else {
232
      char buf[8];
230
      char buf[8];
233
      snprintf(buf, sizeof(buf), "0x%02X ", key);
231
      snprintf(buf, sizeof(buf), "0x%02X ", key);
234
      video_putstring(1, 0, COLOR_BODY[mono], buf, -1);
232
      video_putstring(1, 0, COLOR_BODY, buf, -1);
235
    }*/
233
    }*/
236
  }
234
  }
237
}
235
}
238
 
236
 
239
static void newscreen(unsigned char statusbartype) {
237
static void newscreen(unsigned char statusbartype) {
240
  const char *msg;
238
  const char *msg;
241
  mdr_cout_cls(COLOR_BODY[mono]);
239
  mdr_cout_cls(COLOR_BODY);
242
  msg = svarlang_strid(0x00); /* "SVARDOS INSTALLATION" */
240
  msg = svarlang_strid(0x00); /* "SVARDOS INSTALLATION" */
243
  mdr_cout_char_rep(0, 0, ' ', COLOR_TITLEBAR[mono], 80);
241
  mdr_cout_char_rep(0, 0, ' ', COLOR_TITLEBAR, 80);
244
  mdr_cout_str(0, 40 - (strlen(msg) >> 1), msg, COLOR_TITLEBAR[mono], 80);
242
  mdr_cout_str(0, 40 - (strlen(msg) >> 1), msg, COLOR_TITLEBAR, 80);
245
  switch (statusbartype) {
243
  switch (statusbartype) {
246
    case 1:
244
    case 1:
247
      msg = svarlang_strid(0x000B); /* "Up/Down = Select entry | Enter = Validate your choice | ESC = Quit to DOS" */
245
      msg = svarlang_strid(0x000B); /* "Up/Down = Select entry | Enter = Validate your choice | ESC = Quit to DOS" */
248
      break;
246
      break;
249
    case 2:
247
    case 2:
Line 254... Line 252...
254
      break;
252
      break;
255
    default:
253
    default:
256
      msg = svarlang_strid(0x000A); /* "Up/Down = Select entry | Enter = Validate your choice | ESC = Previous screen" */
254
      msg = svarlang_strid(0x000A); /* "Up/Down = Select entry | Enter = Validate your choice | ESC = Previous screen" */
257
      break;
255
      break;
258
  }
256
  }
259
  mdr_cout_char(24, 0, ' ', COLOR_TITLEBAR[mono]);
257
  mdr_cout_char(24, 0, ' ', COLOR_TITLEBAR);
260
  video_putstringfix(24, 1, COLOR_TITLEBAR[mono], msg, 79);
258
  video_putstringfix(24, 1, COLOR_TITLEBAR, msg, 79);
261
  mdr_cout_locate(25,0);
259
  mdr_cout_locate(25,0);
262
}
260
}
263
 
261
 
264
/* fills a slocales struct accordingly to the value of its keyboff member */
262
/* fills a slocales struct accordingly to the value of its keyboff member */
265
static void kblay2slocal(struct slocales *locales) {
263
static void kblay2slocal(struct slocales *locales) {
Line 294... Line 292...
294
  };
292
  };
295
 
293
 
296
  newscreen(1);
294
  newscreen(1);
297
  msg = svarlang_strid(0x0100); /* "Welcome to SvarDOS" */
295
  msg = svarlang_strid(0x0100); /* "Welcome to SvarDOS" */
298
  x = 40 - (strlen(msg) >> 1);
296
  x = 40 - (strlen(msg) >> 1);
299
  mdr_cout_str(4, x, msg, COLOR_BODY[mono], 80);
297
  mdr_cout_str(4, x, msg, COLOR_BODY, 80);
300
  mdr_cout_char_rep(5, x, '=', COLOR_BODY[mono], strlen(msg));
298
  mdr_cout_char_rep(5, x, '=', COLOR_BODY, strlen(msg));
301
 
299
 
302
  /* center out the string "Please select your language..." */
300
  /* center out the string "Please select your language..." */
303
  msg = svarlang_str(1, 1); /* "Please select your language from the list below:" */
301
  msg = svarlang_str(1, 1); /* "Please select your language from the list below:" */
304
  if (strlen(msg) > 74) {
302
  if (strlen(msg) > 74) {
305
    putstringwrap(8, 1, COLOR_BODY[mono], msg);
303
    putstringwrap(8, 1, COLOR_BODY, msg);
306
  } else {
304
  } else {
307
    mdr_cout_str(8, 40 - (strlen(msg) / 2), msg, COLOR_BODY[mono], 80);
305
    mdr_cout_str(8, 40 - (strlen(msg) / 2), msg, COLOR_BODY, 80);
308
  }
306
  }
309
 
307
 
310
  choice = menuselect(11, -1, 11, langlist, -1);
308
  choice = menuselect(11, -1, 11, langlist, -1);
311
  if (choice < 0) return(MENUPREV);
309
  if (choice < 0) return(MENUPREV);
312
  /* populate locales with default values */
310
  /* populate locales with default values */
Line 372... Line 370...
372
 
370
 
373
static int selectkeyb(struct slocales *locales) {
371
static int selectkeyb(struct slocales *locales) {
374
  int menuheight, choice;
372
  int menuheight, choice;
375
  if (locales->keyblen == 1) return(MENUNEXT); /* do not ask for keyboard layout if only one is available for given language */
373
  if (locales->keyblen == 1) return(MENUNEXT); /* do not ask for keyboard layout if only one is available for given language */
376
  newscreen(0);
374
  newscreen(0);
377
  putstringnls(5, 1, COLOR_BODY[mono], 1, 5); /* "SvarDOS supports different keyboard layouts */
375
  putstringnls(5, 1, COLOR_BODY, 1, 5); /* "SvarDOS supports different keyboard layouts */
378
  menuheight = locales->keyblen + 2;
376
  menuheight = locales->keyblen + 2;
379
  if (menuheight > 13) menuheight = 13;
377
  if (menuheight > 13) menuheight = 13;
380
  choice = menuselect(10, -1, menuheight, &(kblayouts[locales->keyboff]), locales->keyblen);
378
  choice = menuselect(10, -1, menuheight, &(kblayouts[locales->keyboff]), locales->keyblen);
381
  if (choice < 0) return(MENUPREV);
379
  if (choice < 0) return(MENUPREV);
382
  /* (re)load the keyboard layout & codepage setup */
380
  /* (re)load the keyboard layout & codepage setup */
Line 392... Line 390...
392
  const char *choice[3];
390
  const char *choice[3];
393
  choice[0] = svarlang_strid(0x0001);
391
  choice[0] = svarlang_strid(0x0001);
394
  choice[1] = svarlang_strid(0x0002);
392
  choice[1] = svarlang_strid(0x0002);
395
  choice[2] = NULL;
393
  choice[2] = NULL;
396
  newscreen(0);
394
  newscreen(0);
397
  putstringnls(4, 1, COLOR_BODY[mono], 2, 0); /* "You are about to install SvarDOS */
395
  putstringnls(4, 1, COLOR_BODY, 2, 0); /* "You are about to install SvarDOS */
398
  c = menuselect(13, -1, 4, choice, -1);
396
  c = menuselect(13, -1, 4, choice, -1);
399
  if (c < 0) return(MENUPREV);
397
  if (c < 0) return(MENUPREV);
400
  if (c == 0) return(MENUNEXT);
398
  if (c == 0) return(MENUNEXT);
401
  return(MENUQUIT);
399
  return(MENUQUIT);
402
}
400
}
Line 547... Line 545...
547
      list[0] = svarlang_str(0, 3); /* Create a partition automatically */
545
      list[0] = svarlang_str(0, 3); /* Create a partition automatically */
548
      list[1] = svarlang_str(0, 4); /* Run the FDISK tool */
546
      list[1] = svarlang_str(0, 4); /* Run the FDISK tool */
549
      list[2] = svarlang_str(0, 2); /* Quit to DOS */
547
      list[2] = svarlang_str(0, 2); /* Quit to DOS */
550
      list[3] = NULL;
548
      list[3] = NULL;
551
      snprintf(buff, sizeof(buff), svarlang_strid(0x0300), cselecteddrive, SVARDOS_DISK_REQ); /* "ERROR: Drive %c: could not be found. Note, that SvarDOS requires at least %d MiB of available disk space */
549
      snprintf(buff, sizeof(buff), svarlang_strid(0x0300), cselecteddrive, SVARDOS_DISK_REQ); /* "ERROR: Drive %c: could not be found. Note, that SvarDOS requires at least %d MiB of available disk space */
552
      switch (menuselect(6 + putstringwrap(4, 1, COLOR_BODY[mono], buff), -1, 5, list, -1)) {
550
      switch (menuselect(6 + putstringwrap(4, 1, COLOR_BODY, buff), -1, 5, list, -1)) {
553
        case 0:
551
        case 0:
554
          sprintf(buff, "FDISK /PRI:MAX %d", driveid);
552
          sprintf(buff, "FDISK /PRI:MAX %d", driveid);
555
          system(buff);
553
          system(buff);
556
          break;
554
          break;
557
        case 1:
555
        case 1:
Line 568... Line 566...
568
      /* write a temporary MBR which only skips the drive (in case BIOS would
566
      /* write a temporary MBR which only skips the drive (in case BIOS would
569
       * try to boot off the not-yet-ready C: disk) */
567
       * try to boot off the not-yet-ready C: disk) */
570
      sprintf(buff, "FDISK /LOADIPL %d", driveid);
568
      sprintf(buff, "FDISK /LOADIPL %d", driveid);
571
      system(buff); /* writes BOOT.MBR into actual MBR */
569
      system(buff); /* writes BOOT.MBR into actual MBR */
572
      newscreen(2);
570
      newscreen(2);
573
      putstringnls(10, 10, COLOR_BODY[mono], 3, 1); /* "Your computer will reboot now." */
571
      putstringnls(10, 10, COLOR_BODY, 3, 1); /* "Your computer will reboot now." */
574
      putstringnls(12, 10, COLOR_BODY[mono], 0, 5); /* "Press any key..." */
572
      putstringnls(12, 10, COLOR_BODY, 0, 5); /* "Press any key..." */
575
      mdr_dos_getkey();
573
      mdr_dos_getkey();
576
      reboot();
574
      reboot();
577
      return(MENUQUIT);
575
      return(MENUQUIT);
578
    } else if (driveremovable > 0) {
576
    } else if (driveremovable > 0) {
579
      newscreen(2);
577
      newscreen(2);
580
      snprintf(buff, sizeof(buff), svarlang_strid(0x0302), cselecteddrive); /* "ERROR: Drive %c: is a removable device */
578
      snprintf(buff, sizeof(buff), svarlang_strid(0x0302), cselecteddrive); /* "ERROR: Drive %c: is a removable device */
581
      mdr_cout_str(9, 1, buff, COLOR_BODY[mono], 80);
579
      mdr_cout_str(9, 1, buff, COLOR_BODY, 80);
582
      putstringnls(11, 2, COLOR_BODY[mono], 0, 5); /* "Press any key..." */
580
      putstringnls(11, 2, COLOR_BODY, 0, 5); /* "Press any key..." */
583
      return(MENUQUIT);
581
      return(MENUQUIT);
584
    }
582
    }
585
    /* if not formatted, propose to format it right away (try to create a directory) */
583
    /* if not formatted, propose to format it right away (try to create a directory) */
586
    if (test_drive_write(cselecteddrive, buff) != 0) {
584
    if (test_drive_write(cselecteddrive, buff) != 0) {
587
      const char *list[3];
585
      const char *list[3];
588
      newscreen(0);
586
      newscreen(0);
589
      snprintf(buff, sizeof(buff), svarlang_str(3, 3), cselecteddrive); /* "ERROR: Drive %c: seems to be unformated. Do you wish to format it?") */
587
      snprintf(buff, sizeof(buff), svarlang_str(3, 3), cselecteddrive); /* "ERROR: Drive %c: seems to be unformated. Do you wish to format it?") */
590
      mdr_cout_str(7, 1, buff, COLOR_BODY[mono], 80);
588
      mdr_cout_str(7, 1, buff, COLOR_BODY, 80);
591
 
589
 
592
      snprintf(buff, sizeof(buff), svarlang_strid(0x0007), cselecteddrive); /* "Format drive %c:" */
590
      snprintf(buff, sizeof(buff), svarlang_strid(0x0007), cselecteddrive); /* "Format drive %c:" */
593
      list[0] = buff;
591
      list[0] = buff;
594
      list[1] = svarlang_strid(0x0002); /* "Quit to DOS" */
592
      list[1] = svarlang_strid(0x0002); /* "Quit to DOS" */
595
      list[2] = NULL;
593
      list[2] = NULL;
Line 607... Line 605...
607
    ds = disksize(selecteddrive);
605
    ds = disksize(selecteddrive);
608
    if (ds < SVARDOS_DISK_REQ) {
606
    if (ds < SVARDOS_DISK_REQ) {
609
      int y = 9;
607
      int y = 9;
610
      newscreen(2);
608
      newscreen(2);
611
      snprintf(buff, sizeof(buff), svarlang_strid(0x0304), cselecteddrive, SVARDOS_DISK_REQ); /* "ERROR: Drive %c: is not big enough! SvarDOS requires a disk of at least %d MiB." */
609
      snprintf(buff, sizeof(buff), svarlang_strid(0x0304), cselecteddrive, SVARDOS_DISK_REQ); /* "ERROR: Drive %c: is not big enough! SvarDOS requires a disk of at least %d MiB." */
612
      y += putstringwrap(y, 1, COLOR_BODY[mono], buff);
610
      y += putstringwrap(y, 1, COLOR_BODY, buff);
613
      putstringnls(++y, 1, COLOR_BODY[mono], 0, 5); /* "Press any key..." */
611
      putstringnls(++y, 1, COLOR_BODY, 0, 5); /* "Press any key..." */
614
      mdr_dos_getkey();
612
      mdr_dos_getkey();
615
      return(MENUQUIT);
613
      return(MENUQUIT);
616
    }
614
    }
617
    /* is the disk empty? */
615
    /* is the disk empty? */
618
    newscreen(0);
616
    newscreen(0);
619
    if (diskempty(selecteddrive) != 0) {
617
    if (diskempty(selecteddrive) != 0) {
620
      const char *list[3];
618
      const char *list[3];
621
      int y = 6;
619
      int y = 6;
622
      snprintf(buff, sizeof(buff), svarlang_strid(0x0305), cselecteddrive); /* "ERROR: Drive %c: not empty" */
620
      snprintf(buff, sizeof(buff), svarlang_strid(0x0305), cselecteddrive); /* "ERROR: Drive %c: not empty" */
623
      y += putstringwrap(y, 1, COLOR_BODY[mono], buff);
621
      y += putstringwrap(y, 1, COLOR_BODY, buff);
624
 
622
 
625
      snprintf(buff, sizeof(buff), svarlang_strid(0x0007), cselecteddrive); /* "Format drive %c:" */
623
      snprintf(buff, sizeof(buff), svarlang_strid(0x0007), cselecteddrive); /* "Format drive %c:" */
626
      list[0] = buff;
624
      list[0] = buff;
627
      list[1] = svarlang_strid(0x0002); /* "Quit to DOS" */
625
      list[1] = svarlang_strid(0x0002); /* "Quit to DOS" */
628
      list[2] = NULL;
626
      list[2] = NULL;
Line 640... Line 638...
640
      const char *list[3];
638
      const char *list[3];
641
      list[0] = svarlang_strid(0x0001); /* Install SvarDOS */
639
      list[0] = svarlang_strid(0x0001); /* Install SvarDOS */
642
      list[1] = svarlang_strid(0x0002); /* Quit to DOS */
640
      list[1] = svarlang_strid(0x0002); /* Quit to DOS */
643
      list[2] = NULL;
641
      list[2] = NULL;
644
      snprintf(buff, sizeof(buff), svarlang_strid(0x0306), cselecteddrive); /* "The installation of SvarDOS to %c: is about to begin." */
642
      snprintf(buff, sizeof(buff), svarlang_strid(0x0306), cselecteddrive); /* "The installation of SvarDOS to %c: is about to begin." */
645
      mdr_cout_str(7, 40 - strlen(buff), buff, COLOR_BODY[mono], 80);
643
      mdr_cout_str(7, 40 - strlen(buff), buff, COLOR_BODY, 80);
646
      choice = menuselect(10, -1, 4, list, -1);
644
      choice = menuselect(10, -1, 4, list, -1);
647
      if (choice < 0) return(MENUPREV);
645
      if (choice < 0) return(MENUPREV);
648
      if (choice == 1) return(MENUQUIT);
646
      if (choice == 1) return(MENUQUIT);
649
      snprintf(buff, sizeof(buff), "SYS %c: %c: > NUL", sourcedrv, cselecteddrive);
647
      snprintf(buff, sizeof(buff), "SYS %c: %c: > NUL", sourcedrv, cselecteddrive);
650
      system(buff);
648
      system(buff);
Line 776... Line 774...
776
  char *pkgptr;
774
  char *pkgptr;
777
  newscreen(3);
775
  newscreen(3);
778
  /* load pkg list */
776
  /* load pkg list */
779
  fd = fopen("install.lst", "rb");
777
  fd = fopen("install.lst", "rb");
780
  if (fd == NULL) {
778
  if (fd == NULL) {
781
    mdr_cout_str(10, 30, "ERROR: INSTALL.LST NOT FOUND", COLOR_BODY[mono], 80);
779
    mdr_cout_str(10, 30, "ERROR: INSTALL.LST NOT FOUND", COLOR_BODY, 80);
782
    mdr_dos_getkey();
780
    mdr_dos_getkey();
783
    return(-1);
781
    return(-1);
784
  }
782
  }
785
  pkglistflen = fread(pkglist, 1, sizeof(pkglist) - 2, fd);
783
  pkglistflen = fread(pkglist, 1, sizeof(pkglist) - 2, fd);
786
  fclose(fd);
784
  fclose(fd);
787
  if (pkglistflen == sizeof(pkglist) - 2) {
785
  if (pkglistflen == sizeof(pkglist) - 2) {
788
    mdr_cout_str(10, 30, "ERROR: INSTALL.LST TOO LARGE", COLOR_BODY[mono], 80);
786
    mdr_cout_str(10, 30, "ERROR: INSTALL.LST TOO LARGE", COLOR_BODY, 80);
789
    mdr_dos_getkey();
787
    mdr_dos_getkey();
790
    return(-1);
788
    return(-1);
791
  }
789
  }
792
  /* mark the end of list */
790
  /* mark the end of list */
793
  pkglist[pkglistflen] = 0;
791
  pkglist[pkglistflen] = 0;
Line 834... Line 832...
834
    if (fileexists(buff) != 0) {
832
    if (fileexists(buff) != 0) {
835
      while (*pkgptr != 0) pkgptr++;
833
      while (*pkgptr != 0) pkgptr++;
836
      while (*pkgptr == 0) pkgptr++;
834
      while (*pkgptr == 0) pkgptr++;
837
      /* end of list? ask for next floppy, there's nothing interesting left on this one */
835
      /* end of list? ask for next floppy, there's nothing interesting left on this one */
838
      if (*pkgptr == 0xff) {
836
      if (*pkgptr == 0xff) {
839
        putstringnls(12, 1, COLOR_BODY[mono], 4, 1); /* "INSERT THE DISK THAT CONTAINS THE REQUIRED FILE AND PRESS ANY KEY" */
837
        putstringnls(12, 1, COLOR_BODY, 4, 1); /* "INSERT THE DISK THAT CONTAINS THE REQUIRED FILE AND PRESS ANY KEY" */
840
        mdr_dos_getkey();
838
        mdr_dos_getkey();
841
        video_putstringfix(12, 1, COLOR_BODY[mono], "", 80); /* erase the 'insert disk' message */
839
        video_putstringfix(12, 1, COLOR_BODY, "", 80); /* erase the 'insert disk' message */
842
        goto RETRY_ENTIRE_LIST;
840
        goto RETRY_ENTIRE_LIST;
843
      }
841
      }
844
      goto TRY_NEXTPKG;
842
      goto TRY_NEXTPKG;
845
    }
843
    }
846
 
844
 
847
    /* install the package */
845
    /* install the package */
848
    snprintf(buff, sizeof(buff), svarlang_strid(0x0400), i+1, pkglistlen, pkgptr); /* "Installing package %d/%d: %s" */
846
    snprintf(buff, sizeof(buff), svarlang_strid(0x0400), i+1, pkglistlen, pkgptr); /* "Installing package %d/%d: %s" */
849
    strcat(buff, "       ");
847
    strcat(buff, "       ");
850
    mdr_cout_str(10, 1, buff, COLOR_BODY[mono], 40);
848
    mdr_cout_str(10, 1, buff, COLOR_BODY, 40);
851
 
849
 
852
    /* proceed with package copy */
850
    /* proceed with package copy */
853
    sprintf(buff, "%c:\\temp\\%s.svp", targetdrv, pkgptr);
851
    sprintf(buff, "%c:\\temp\\%s.svp", targetdrv, pkgptr);
854
    if (fcopy(buff, buff + 7, buff, sizeof(buff)) != 0) {
852
    if (fcopy(buff, buff + 7, buff, sizeof(buff)) != 0) {
855
      mdr_cout_str(10, 30, "READ ERROR", COLOR_BODY[mono], 80);
853
      mdr_cout_str(10, 30, "READ ERROR", COLOR_BODY, 80);
856
      mdr_dos_getkey();
854
      mdr_dos_getkey();
857
      fclose(fd);
855
      fclose(fd);
858
      return(-1);
856
      return(-1);
859
    }
857
    }
860
    /* write install instruction to post-install script */
858
    /* write install instruction to post-install script */
Line 901... Line 899...
901
 
899
 
902
 
900
 
903
static void finalreboot(void) {
901
static void finalreboot(void) {
904
  int y = 9;
902
  int y = 9;
905
  newscreen(2);
903
  newscreen(2);
906
  y += putstringnls(y, 1, COLOR_BODY[mono], 5, 0); /* "Your computer will reboot now.\nPlease remove the installation disk from your drive" */
904
  y += putstringnls(y, 1, COLOR_BODY, 5, 0); /* "Your computer will reboot now.\nPlease remove the installation disk from your drive" */
907
  putstringnls(++y, 1, COLOR_BODY[mono], 0, 5); /* "Press any key..." */
905
  putstringnls(++y, 1, COLOR_BODY, 0, 5); /* "Press any key..." */
908
  mdr_dos_getkey();
906
  mdr_dos_getkey();
909
  reboot();
907
  reboot();
910
}
908
}
911
 
909
 
912
 
910
 
Line 959... Line 957...
959
 
957
 
960
  if (argc != 1) buildstring = argv[1];
958
  if (argc != 1) buildstring = argv[1];
961
 
959
 
962
  sourcedrv = get_cur_drive() + 'A';
960
  sourcedrv = get_cur_drive() + 'A';
963
 
961
 
964
  /* init screen and detect mono status */
962
  /* init screen and detect mono adapters */
965
  mono = mdr_cout_init(NULL, NULL);
963
  if (mdr_cout_init(NULL, NULL) == 0) {
-
 
964
    /* overload color scheme with mono settings */
-
 
965
    COLOR_TITLEBAR = 0x70;
-
 
966
    COLOR_BODY = 0x07;
-
 
967
    COLOR_SELECT = 0x70;
-
 
968
    COLOR_SELECTCUR = 0x07;
-
 
969
  }
966
 
970
 
967
 SelectLang:
971
 SelectLang:
968
  action = selectlang(&locales); /* welcome to svardos, select your language */
972
  action = selectlang(&locales); /* welcome to svardos, select your language */
969
  if (action != MENUNEXT) goto Quit;
973
  if (action != MENUNEXT) goto Quit;
970
  loadcp(&locales);
974
  loadcp(&locales);