1
0
Fork 0

updates for new logging system

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@695
This commit is contained in:
Peter Veenstra 2003-02-27 19:56:22 +00:00
parent dff67638e9
commit f79eaaba75
57 changed files with 405 additions and 416 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 The DOSBox Team
* Copyright (C) 2002-2003 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -131,8 +131,8 @@ static Bitu DOS_21Handler(void) {
break;
};
case 0x0b: /* Get STDIN Status */
if (DOS_GetSTDINStatus()) reg_al=0xff;
else reg_al=0;
if (!DOS_GetSTDINStatus()) {reg_al=0x00;}
else {reg_al=0xFF;}
break;
case 0x0c: /* Flush Buffer and read STDIN call */
{
@ -170,7 +170,7 @@ static Bitu DOS_21Handler(void) {
}else{
reg_al=0xff;
}
LOG_DEBUG("DOS:0x0f FCB-fileopen used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x0f FCB-fileopen used, result:al=%d",reg_al);
break;
case 0x10: /* Close File using FCB */
if(DOS_FCBClose(SegValue(ds),reg_dx)){
@ -178,7 +178,7 @@ static Bitu DOS_21Handler(void) {
}else{
reg_al=0xff;
}
LOG_DEBUG("DOS:0x10 FCB-fileclose used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x10 FCB-fileclose used, result:al=%d",reg_al);
break;
case 0x11: /* Find First Matching File using FCB */
if(DOS_FCBFindFirst(SegValue(ds),reg_dx)){
@ -186,7 +186,7 @@ static Bitu DOS_21Handler(void) {
}else{
reg_al=0xff;
}
LOG_DEBUG("DOS:0x11 FCB-FindFirst used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x11 FCB-FindFirst used, result:al=%d",reg_al);
break;
case 0x12: /* Find Next Matching File using FCB */
if(DOS_FCBFindNext(SegValue(ds),reg_dx)){
@ -194,7 +194,7 @@ static Bitu DOS_21Handler(void) {
}else{
reg_al=0xff;
}
LOG_DEBUG("DOS:0x12 FCB-FindNext used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x12 FCB-FindNext used, result:al=%d",reg_al);
break;
case 0x13: /* Delete File using FCB */
if (DOS_FCBDeleteFile(SegValue(ds),reg_dx)) reg_al = 0x00;
@ -202,16 +202,16 @@ static Bitu DOS_21Handler(void) {
break;
case 0x14: /* Sequential read from FCB */
reg_al = DOS_FCBRead(SegValue(ds),reg_dx,0);
LOG_DEBUG("DOS:0x14 FCB-Read used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x14 FCB-Read used, result:al=%d",reg_al);
break;
case 0x15: /* Sequential write to FCB */
reg_al=DOS_FCBWrite(SegValue(ds),reg_dx,0);
LOG_DEBUG("DOS:0x15 FCB-Write used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x15 FCB-Write used, result:al=%d",reg_al);
break;
case 0x16: /* Create or truncate file using FCB */
if (DOS_FCBCreate(SegValue(ds),reg_dx)) reg_al = 0x00;
else reg_al = 0xFF;
LOG_DEBUG("DOS:0x16 FCB-Create used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x16 FCB-Create used, result:al=%d",reg_al);
break;
case 0x17: /* Rename file using FCB */
if (DOS_FCBRenameFile(SegValue(ds),reg_dx)) reg_al = 0x00;
@ -225,11 +225,11 @@ static Bitu DOS_21Handler(void) {
break;
case 0x21: /* Read random record from FCB */
reg_al = DOS_FCBRandomRead(SegValue(ds),reg_dx,1,true);
LOG_DEBUG("DOS:0x21 FCB-Random read used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x21 FCB-Random read used, result:al=%d",reg_al);
break;
case 0x22: /* Write random record to FCB */
reg_al=DOS_FCBRandomWrite(SegValue(ds),reg_dx,1,true);
LOG_DEBUG("DOS:0x22 FCB-Random write used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x22 FCB-Random write used, result:al=%d",reg_al);
break;
case 0x23: /* Get file size for FCB */
if (DOS_FCBGetFileSize(SegValue(ds),reg_dx,reg_cx)) reg_al = 0x00;
@ -240,11 +240,11 @@ static Bitu DOS_21Handler(void) {
break;
case 0x27: /* Random block read from FCB */
reg_al = DOS_FCBRandomRead(SegValue(ds),reg_dx,reg_cx,false);
LOG_DEBUG("DOS:0x27 FCB-Random(block) read used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x27 FCB-Random(block) read used, result:al=%d",reg_al);
break;
case 0x28: /* Random Block write to FCB */
reg_al=DOS_FCBRandomWrite(SegValue(ds),reg_dx,reg_cx,false);
LOG_DEBUG("DOS:0x28 FCB-Random(block) write used, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:0x28 FCB-Random(block) write used, result:al=%d",reg_al);
break;
case 0x29: /* Parse filename into FCB */
{ Bit8u difference;
@ -253,7 +253,7 @@ static Bitu DOS_21Handler(void) {
reg_al=FCB_Parsename(SegValue(es),reg_di,reg_al ,string, &difference);
reg_si+=difference;
}
LOG_DEBUG("DOS:29:FCB Parse Filename, result:al=%d",reg_al);
LOG(LOG_FCB,"DOS:29:FCB Parse Filename, result:al=%d",reg_al);
break;
case 0x19: /* Get current default drive */
reg_al=DOS_GetDefaultDrive();
@ -308,7 +308,7 @@ static Bitu DOS_21Handler(void) {
}
break;
case 0x2d: /* Set System Time */
LOG_DEBUG("DOS:Set System Time not supported");
LOG(LOG_ERROR,"DOS:Set System Time not supported");
reg_al=0; /* Noone is changing system time */
break;
case 0x2e: /* Set Verify flag */
@ -386,10 +386,10 @@ static Bitu DOS_21Handler(void) {
case 3:
reg_al=0;break;
};
LOG_DEBUG("DOS:0x37:Call for not supported switchchar");
LOG(LOG_ERROR|LOG_MISC,"DOS:0x37:Call for not supported switchchar");
break;
case 0x38: /* Set Country Code */
LOG_DEBUG("DOS:Setting country code not supported");
LOG(LOG_ERROR|LOG_MISC,"DOS:Setting country code not supported");
CALLBACK_SCF(true);
break;
if (reg_al==0) { /* Get country specidic information */
@ -515,7 +515,7 @@ static Bitu DOS_21Handler(void) {
}
break;
case 0x01: /* Set */
LOG_DEBUG("DOS:Set File Attributes for %s not supported",name1);
LOG(LOG_ERROR|LOG_MISC,"DOS:Set File Attributes for %s not supported",name1);
CALLBACK_SCF(false);
break;
default:
@ -592,7 +592,7 @@ static Bitu DOS_21Handler(void) {
case 0x4b: /* EXEC Load and/or execute program */
{
MEM_StrCopy(SegPhys(ds)+reg_dx,name1,DOSNAMEBUF);
LOG_DEBUG("Execute %s %d",name1,reg_al);
LOG(LOG_ERROR|LOG_MISC,"Execute %s %d",name1,reg_al);
if (!DOS_Execute(name1,SegPhys(es)+reg_bx,reg_al)) {
reg_ax=dos.errorcode;
CALLBACK_SCF(true);
@ -646,7 +646,7 @@ static Bitu DOS_21Handler(void) {
RealPt addr=dos_infoblock.GetPointer();
SegSet16(es,RealSeg(addr));
reg_bx=RealOff(addr);
LOG_DEBUG("Call is made for list of lists - let's hope for the best");
LOG(LOG_MISC,"Call is made for list of lists - let's hope for the best");
break; }
//TODO Think hard how shit this is gonna be
//And will any game ever use this :)
@ -680,7 +680,7 @@ static Bitu DOS_21Handler(void) {
} else {
reg_cx=0;
reg_dx=0;
LOG_DEBUG("DOS:57:Setting File Date is faked",reg_ah);
LOG(LOG_ERROR|LOG_MISC,"DOS:57:Setting File Date is faked",reg_ah);
}
break;
case 0x58: /* Get/Set Memory allocation strategy */
@ -700,7 +700,7 @@ static Bitu DOS_21Handler(void) {
CALLBACK_SCF(true);
break;
default:
LOG_DEBUG("DOS:58:Not Supported Set//Get memory allocation call %X",reg_al);
LOG(LOG_ERROR|LOG_MISC,"DOS:58:Not Supported Set//Get memory allocation call %X",reg_al);
}
break;
case 0x59: /* Get Extended error information */
@ -767,7 +767,7 @@ static Bitu DOS_21Handler(void) {
case 0x65: /* Get extented country information and a lot of other useless shit*/
/* Todo maybe fully support this for now we set it standard for USA */
{
LOG_DEBUG("DOS:65:Extended country information call");
LOG(LOG_ERROR|LOG_MISC,"DOS:65:Extended country information call");
PhysPt data=SegPhys(es)+reg_di;
switch (reg_al) {
case 1:
@ -785,12 +785,12 @@ static Bitu DOS_21Handler(void) {
}
case 0x66: /* Get/Set global code page table */
if (reg_al==1) {
LOG_DEBUG("Getting global code page table");
LOG(LOG_ERROR|LOG_MISC,"Getting global code page table");
reg_bx=reg_dx=437;
CALLBACK_SCF(false);
break;
}
LOG_ERROR("DOS:Setting code page table is not supported");
LOG(LOG_DOSMISC,"DOS:Setting code page table is not supported");
break;
case 0x67: /* Set handle count */
/* Weird call to increase amount of file handles needs to allocate memory if >20 */
@ -804,11 +804,11 @@ static Bitu DOS_21Handler(void) {
{
switch(reg_al) {
case 0x00: /* Get */
LOG_DEBUG("DOS:Get Disk serial number");
LOG(LOG_ERROR|LOG_MISC,"DOS:Get Disk serial number");
CALLBACK_SCF(true);
break;
case 0x01:
LOG_DEBUG("DOS:Set Disk serial number");
LOG(LOG_ERROR|LOG_MISC,"DOS:Set Disk serial number");
default:
E_Exit("DOS:Illegal Get Serial Number call %2X",reg_al);
}
@ -820,7 +820,7 @@ static Bitu DOS_21Handler(void) {
case 0x71: /* Unknown probably 4dos detection */
reg_ax=0x7100;
CALLBACK_SCF(true);
LOG_WARN("DOS:Windows long file name support call %2X",reg_al);
LOG(LOG_DOSMISC,"DOS:Windows long file name support call %2X",reg_al);
break;
case 0x68: /* FFLUSH Commit file */
case 0x63: /* Weirdo double byte stuff (fails but say it succeeded) available only in MSDOS 2.25 */
@ -833,9 +833,10 @@ static Bitu DOS_21Handler(void) {
case 0x6b: /* NULL Function */
case 0x61: /* UNUSED */
case 0xEF: /* Used in Ancient Art Of War CGA */
case 0x5d: /* Network Functions */
default:
LOG_DEBUG("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al);
case 0x5d: /* Network Functions ||HMMM seems to critical error info and return 1!! Maybe implement it.??*/
/* al=06 clears cf and leaves al=6 and returns crit error flag location*/
default:
LOG(LOG_ERROR|LOG_MISC,"DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al);
reg_al=0x00; /* default value */
break;
};
@ -865,7 +866,7 @@ static Bitu DOS_28Handler(void) {
}
static Bitu DOS_29Handler(void) {
LOG_DEBUG("int 29 called");
LOG(LOG_ERROR|LOG_MISC,"int 29 called");
return CBRET_NONE;
}