[COMMAND.COM]

Surround welcome & debugging messages in #ifndef NDEBUG blocks, that should be compiled in trunk but will be disabled in the release.
This is to "cure" the bad-looking problem described in http://www.reactos.org/forum/viewtopic.php?f=25&t=14620 .

svn path=/trunk/; revision=70365
This commit is contained in:
Hermès Bélusca-Maïto 2015-12-16 17:28:59 +00:00
parent 0a97bf2ccf
commit 7b6be00fcc

View file

@ -17,6 +17,8 @@
#include "asmxtras.inc" #include "asmxtras.inc"
#include <isvbop.inc> #include <isvbop.inc>
// #define NDEBUG
/* DEFINES ********************************************************************/ /* DEFINES ********************************************************************/
#define MAX_PATH 260 #define MAX_PATH 260
@ -124,11 +126,15 @@ ResidentMain:
jz Run jz Run
cmp word ptr OldParentPsp, SYSTEM_PSP // Check whether our parent is SYSTEM cmp word ptr OldParentPsp, SYSTEM_PSP // Check whether our parent is SYSTEM
je Run je Run
#ifndef NDEBUG
/********************************/ /********************************/
mov dx, offset Msg1 mov dx, offset Msg1
mov ah, HEX(09) mov ah, HEX(09)
int HEX(21) int HEX(21)
/********************************/ /********************************/
#endif
BOP BOP_CMD, HEX(0A) // Start 32-bit COMSPEC BOP BOP_CMD, HEX(0A) // Start 32-bit COMSPEC
jnc Quit jnc Quit
@ -143,11 +149,14 @@ Run:
mov word ptr FIELD(NextCmd, AppNameOff), offset PgmName mov word ptr FIELD(NextCmd, AppNameOff), offset PgmName
/* Wait for the next command */ /* Wait for the next command */
#ifndef NDEBUG
/********************************/ /********************************/
mov dx, offset Msg2 mov dx, offset Msg2
mov ah, HEX(09) mov ah, HEX(09)
int HEX(21) int HEX(21)
/********************************/ /********************************/
#endif
// FIXME: Initialize memory with structure for holding CmdLine etc... // FIXME: Initialize memory with structure for holding CmdLine etc...
// mov ds, seg NextCmd // mov ds, seg NextCmd
mov dx, offset NextCmd mov dx, offset NextCmd
@ -190,6 +199,8 @@ Run:
Quit: Quit:
mov bl, al // Save AL in BL mov bl, al // Save AL in BL
#ifndef NDEBUG
/********************************/ /********************************/
cmp al, HEX(0A) cmp al, HEX(0A)
jne XXXX jne XXXX
@ -198,11 +209,15 @@ Quit:
int HEX(21) int HEX(21)
XXXX: XXXX:
/********************************/ /********************************/
#endif
#ifndef NDEBUG
/* Say bye-bye */ /* Say bye-bye */
// mov ds, seg QuitMsg // mov ds, seg QuitMsg
mov dx, offset QuitMsg mov dx, offset QuitMsg
mov ah, HEX(09) mov ah, HEX(09)
int HEX(21) int HEX(21)
#endif
/* Restore our old parent PSP */ /* Restore our old parent PSP */
mov ax, word ptr OldParentPsp mov ax, word ptr OldParentPsp
@ -220,6 +235,7 @@ Exit:
/* DATA *******************************/ /* DATA *******************************/
#ifndef NDEBUG
QuitMsg: QuitMsg:
.ascii "Bye bye!", CR, LF, "$" .ascii "Bye bye!", CR, LF, "$"
@ -228,6 +244,7 @@ Msg1: .ascii "Starting COMSPEC...", CR, LF, "$"
Msg2: .ascii "Waiting for new command...", CR, LF, "$" Msg2: .ascii "Waiting for new command...", CR, LF, "$"
Msg3: .ascii "Bad environment!", CR, LF, "$" Msg3: .ascii "Bad environment!", CR, LF, "$"
/********************************/ /********************************/
#endif
OldParentPsp: .word 0 OldParentPsp: .word 0
CurrentPsp: .word 0 CurrentPsp: .word 0
@ -257,9 +274,12 @@ BaseStack:
/* DATA *******************************/ /* DATA *******************************/
#ifndef NDEBUG
WelcomeMsg: WelcomeMsg:
.ascii "ReactOS DOS32 Command", CR, LF, \ .ascii "ReactOS DOS32 Command", CR, LF, \
"Copyright (C) ReactOS Team 2015" , CR, LF, "$" "Copyright (C) ReactOS Team 2015" , CR, LF, "$"
#endif
VerErrMsg: VerErrMsg:
.ascii "Incorrect DOS version", CR, LF, "$" .ascii "Incorrect DOS version", CR, LF, "$"
@ -320,11 +340,13 @@ Continue:
mov ax, word ptr CurrentPsp mov ax, word ptr CurrentPsp
mov PSP_VAR(ParentPsp), ax mov PSP_VAR(ParentPsp), ax
#ifndef NDEBUG
/* Say hello */ /* Say hello */
// mov ds, seg WelcomeMsg // mov ds, seg WelcomeMsg
mov dx, offset WelcomeMsg mov dx, offset WelcomeMsg
mov ah, HEX(09) mov ah, HEX(09)
int HEX(21) int HEX(21)
#endif
/* Jump to resident code */ /* Jump to resident code */
jmp ResidentMain jmp ResidentMain