Subversion Repositories SvarDOS

Rev

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

Rev 1080 Rev 1081
Line 29... Line 29...
29
#define PVER "2022.3"
29
#define PVER "2022.3"
30
#define COPYRDATE "2021-2022"
30
#define COPYRDATE "2021-2022"
31
 
31
 
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
33
  char *buff = p->BUFFER;
33
  char *buff = p->BUFFER;
34
  unsigned char rc = 0, maj = 0, min = 0, truemaj = 0, truemin = 0, rev = 0, verflags = 0;
34
  unsigned char maj = 0, min = 0, truemaj = 0, truemin = 0, rev = 0, verflags = 0;
-
 
35
  unsigned short doserr = 0;
35
 
36
 
36
  /* help screen */
37
  /* help screen */
37
  if (cmd_ishlp(p)) {
38
  if (cmd_ishlp(p)) {
38
    nls_outputnl(20,0); /* "Displays the DOS version." */
39
    nls_outputnl(20,0); /* "Displays the DOS version." */
39
    outputnl("");
40
    outputnl("");
Line 114... Line 115...
114
    mov [min], ah
115
    mov [min], ah
115
 
116
 
116
    /* get the "true" DOS version, along with a couple of extra data */
117
    /* get the "true" DOS version, along with a couple of extra data */
117
    mov ax, 0x3306 /* Get true DOS version number (DOS 5+) */
118
    mov ax, 0x3306 /* Get true DOS version number (DOS 5+) */
118
    int 0x21       /* AL=return_code  BL=maj_ver_num  BH=min_ver_num */
119
    int 0x21       /* AL=return_code  BL=maj_ver_num  BH=min_ver_num */
119
    mov [rc], al   /* DL=revision  DH=kernel_memory_area */
120
    jnc GOOD       /* DL=revision  DH=kernel_memory_area */
-
 
121
    mov doserr, ax /* DR-DOS sets CF on this call (according to RBIL) */
-
 
122
    GOOD:
120
    mov [truemaj], bl
123
    mov [truemaj], bl
121
    mov [truemin], bh
124
    mov [truemin], bh
122
    mov [rev], dl
125
    mov [rev], dl
123
    mov [verflags], dh
126
    mov [verflags], dh
124
 
127
 
Line 128... Line 131...
128
    pop ax
131
    pop ax
129
  }
132
  }
130
 
133
 
131
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
134
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
132
  output(buff);
135
  output(buff);
133
  if ((maj != truemaj) || (min != truemin)) {
136
  if ((doserr == 0) && ((maj != truemaj) || (min != truemin))) {
134
    output(" (");
137
    output(" (");
135
    sprintf(buff, svarlang_str(20,10), truemaj, truemin); /* "true ver xx.xx" */
138
    sprintf(buff, svarlang_str(20,10), truemaj, truemin); /* "true ver xx.xx" */
136
    output(")");
139
    output(")");
137
  }
140
  }
138
  outputnl("");
141
  outputnl("");
139
 
142
 
140
  sprintf(buff, svarlang_str(20,5), 'A' + rev); /* "Revision %c" */
143
  sprintf(buff, svarlang_str(20,5), 'A' + rev); /* "Revision %c" */
141
  outputnl(buff);
144
  outputnl(buff);
142
 
145
 
143
  {
146
  if (doserr == 0) {
144
    const char *loc = svarlang_str(20,7);        /* "low memory" */
147
    const char *loc = svarlang_str(20,7);        /* "low memory" */
145
    if (verflags & 16) loc = svarlang_str(20,8); /* "HMA" */
148
    if (verflags & 16) loc = svarlang_str(20,8); /* "HMA" */
146
    if (verflags & 8) loc = svarlang_str(20,9);  /* "ROM" */
149
    if (verflags & 8) loc = svarlang_str(20,9);  /* "ROM" */
147
    sprintf(buff, svarlang_str(20,6), loc);      /* "DOS is in %s" */
150
    sprintf(buff, svarlang_str(20,6), loc);      /* "DOS is in %s" */
148
    outputnl(buff);
151
    outputnl(buff);