updates for new logging system
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@695
This commit is contained in:
parent
dff67638e9
commit
f79eaaba75
57 changed files with 405 additions and 416 deletions
113
include/dosbox.h
113
include/dosbox.h
|
@ -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
|
||||
|
@ -52,7 +52,6 @@ typedef signed int Bits;
|
|||
|
||||
class Section;
|
||||
|
||||
|
||||
typedef Bitu (LoopHandler)(void);
|
||||
|
||||
void DOSBOX_RunMachine();
|
||||
|
@ -65,101 +64,25 @@ class Config;
|
|||
extern Config * control;
|
||||
extern Bitu errorlevel;
|
||||
|
||||
inline void LOG_MSG(char* message)
|
||||
{
|
||||
if(errorlevel>=0) S_Warn(message);
|
||||
}
|
||||
#define LOG_MSG S_Warn
|
||||
|
||||
template <class type1>
|
||||
inline void LOG_MSG(char* message,type1 arg1)
|
||||
{
|
||||
|
||||
if(errorlevel>=0) S_Warn(message,arg1);
|
||||
}
|
||||
|
||||
template <class type1,class type2>
|
||||
inline void LOG_MSG(char* message,type1 arg1,type2 arg2)
|
||||
{
|
||||
|
||||
if(errorlevel>=0) S_Warn(message,arg1,arg2);
|
||||
}
|
||||
|
||||
template <class type1,class type2, class type3>
|
||||
inline void LOG_MSG(char* message,type1 arg1,type2 arg2,type3 arg3)
|
||||
{
|
||||
|
||||
if (errorlevel>=0)S_Warn(message,arg1,arg2,arg3);
|
||||
}
|
||||
|
||||
#if C_LOGGING
|
||||
inline void LOG_DEBUG(char * message)
|
||||
{
|
||||
|
||||
if(errorlevel>=2) S_Warn(message);
|
||||
}
|
||||
|
||||
template <class type>
|
||||
inline void LOG_DEBUG(char * message, type type1)
|
||||
{
|
||||
|
||||
if(errorlevel>=2) S_Warn(message,type1);
|
||||
}
|
||||
|
||||
template <class type>
|
||||
inline void LOG_WARN(char * message, type type1)
|
||||
{
|
||||
|
||||
if(errorlevel>=1) S_Warn(message,type1);
|
||||
}
|
||||
|
||||
inline void LOG_WARN(char* message)
|
||||
{
|
||||
|
||||
if(errorlevel>=1) S_Warn(message);
|
||||
}
|
||||
|
||||
inline void LOG_ERROR(char * message)
|
||||
{
|
||||
|
||||
if(errorlevel>=0) S_Warn(message);
|
||||
}
|
||||
|
||||
template <class type>
|
||||
inline void LOG_ERROR(char * message, type type1)
|
||||
{
|
||||
|
||||
if(errorlevel>=0) S_Warn(message,type1);
|
||||
}
|
||||
|
||||
template <class type1, class type2>
|
||||
inline void LOG_ERROR(char * message, type1 arg1,type2 arg2)
|
||||
{
|
||||
|
||||
if(errorlevel>=0) S_Warn(message,arg1,arg2);
|
||||
}
|
||||
|
||||
template <class type1, class type2>
|
||||
inline void LOG_WARN(char * message, type1 arg1,type2 arg2)
|
||||
{
|
||||
|
||||
if(errorlevel>=1) S_Warn(message,arg1,arg2);
|
||||
}
|
||||
|
||||
template <class type1, class type2>
|
||||
inline void LOG_DEBUG(char * message, type1 arg1,type2 arg2)
|
||||
{
|
||||
|
||||
if(errorlevel>=2) S_Warn(message,arg1,arg2);
|
||||
}
|
||||
enum LOG_TYPES {
|
||||
LOG_ALL,
|
||||
LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10,
|
||||
LOG_SB,LOG_DMA,
|
||||
LOG_FPU,LOG_CPU,
|
||||
LOG_FCB,LOG_FILES,LOG_IOCTL,LOG_EXEC,LOG_DOSMISC,
|
||||
LOG_PIT,LOG_KEYBOARD,LOG_PIC,
|
||||
LOG_MOUSE,LOG_BIOS,LOG_GUI,LOG_MISC,
|
||||
LOG_MAX,LOG_ERROR=0x80
|
||||
};
|
||||
|
||||
#if C_DEBUG
|
||||
extern void DEBUG_ShowMsg(Bit32u msgmask, char * msg,...);
|
||||
#define LOG DEBUG_ShowMsg
|
||||
#else
|
||||
#define LOG_DEBUG
|
||||
#define LOG_WARN
|
||||
#define LOG_ERROR
|
||||
#endif
|
||||
#define LOG
|
||||
#endif /* C_DEBUG */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* __DOSBOX_H */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -23,9 +23,6 @@
|
|||
#define C_DEBUG 0
|
||||
#define C_HEAVY_DEBUG 0
|
||||
|
||||
/* Enable the logging of extra information for debugging to the console */
|
||||
#define C_LOGGING 0
|
||||
|
||||
/* Enable some big compile-time increasing inlines, great for speed though */
|
||||
#define C_EXTRAINLINE 0
|
||||
|
||||
|
@ -35,9 +32,4 @@
|
|||
/* Maximum memory range in megabytes */
|
||||
#define C_MEM_MAX_SIZE 12
|
||||
|
||||
/* Enable debug messages for several modules, requires C_LOGGING */
|
||||
#define DEBUG_SBLASTER 0 /* SoundBlaster Debugging*/
|
||||
#define DEBUG_DMA 0 /* DMA Debugging */
|
||||
#define DEBUG_DOS 0 /* DOS Debugging */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
@ -67,7 +67,7 @@ void CALLBACK_Idle(void) {
|
|||
}
|
||||
|
||||
static Bitu default_handler(void) {
|
||||
LOG_WARN("Illegal Unhandled Interrupt Called %X",lastint);
|
||||
LOG(LOG_ERROR|LOG_CPU,"Illegal Unhandled Interrupt Called %X",lastint);
|
||||
return CBRET_NONE;
|
||||
};
|
||||
|
||||
|
|
|
@ -961,7 +961,7 @@ restart:
|
|||
case 0xde: /* FPU ESC 6 */
|
||||
case 0xdf: /* FPU ESC 7 */
|
||||
{
|
||||
LOG_WARN("FPU used");
|
||||
LOG(LOG_CPU,"FPU used");
|
||||
Bit8u rm=Fetchb();
|
||||
if (rm<0xc0) GetEAa;
|
||||
}
|
||||
|
@ -1037,7 +1037,7 @@ restart:
|
|||
IO_Write(reg_dx+1,reg_ah);
|
||||
break;
|
||||
case 0xf0: /* LOCK */
|
||||
LOG_ERROR("CPU:LOCK");
|
||||
LOG(LOG_CPU,"CPU:LOCK");
|
||||
break;
|
||||
case 0xf1: /* Weird call undocumented */
|
||||
// INTERRUPT(1);
|
||||
|
|
|
@ -276,7 +276,7 @@ switch(Fetchb()) {
|
|||
break;
|
||||
}
|
||||
case 0x8c:
|
||||
LOG_WARN("CPU:66:8c looped back");
|
||||
LOG(LOG_CPU,"CPU:66:8c looped back");
|
||||
break;
|
||||
case 0x8d: /* LEA */
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ switch(Fetchb()) {
|
|||
case 0x23: /* MOV DRx,Rd */
|
||||
{
|
||||
GetRM;
|
||||
LOG_DEBUG("CPU:0F:23 does nothing");
|
||||
LOG(LOG_CPU,"CPU:0F:23 does nothing");
|
||||
}
|
||||
break;
|
||||
/* 0x24 MOV Rd,TRx (386) */
|
||||
|
|
|
@ -353,7 +353,7 @@ rep_again:
|
|||
break;
|
||||
default:
|
||||
IPPoint--;
|
||||
LOG_DEBUG("Unhandled REP Prefix %X",Fetchb());
|
||||
LOG(LOG_CPU|LOG_ERROR,"Unhandled REP Prefix %X",Fetchb());
|
||||
goto normalexit;
|
||||
}
|
||||
/* If we end up here it's because the CPU_Cycles counter is 0, so restart instruction */
|
||||
|
|
|
@ -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
|
||||
|
@ -59,12 +59,12 @@ void Interrupt(Bit8u num) {
|
|||
|
||||
switch (num) {
|
||||
case 0x00:
|
||||
LOG_WARN("Divide Error");
|
||||
LOG(LOG_CPU,"Divide Error");
|
||||
break;
|
||||
case 0x06:
|
||||
break;
|
||||
case 0x07:
|
||||
LOG_WARN("Co Processor Exception");
|
||||
LOG(LOG_FPU,"Co Processor Exception");
|
||||
break;
|
||||
case 0x08:
|
||||
case 0x09:
|
||||
|
@ -86,7 +86,7 @@ void Interrupt(Bit8u num) {
|
|||
break;
|
||||
case 0xcd:
|
||||
#if C_HEAVY_DEBUG
|
||||
LOG_DEBUG("Call to interrupt 0xCD this is BAD");
|
||||
LOG(LOG_CPU|LOG_ERROR,"Call to interrupt 0xCD this is BAD");
|
||||
DEBUG_HeavyWriteLogInstruction();
|
||||
#endif
|
||||
E_Exit("Call to interrupt 0xCD this is BAD");
|
||||
|
@ -96,7 +96,7 @@ void Interrupt(Bit8u num) {
|
|||
#endif
|
||||
break;
|
||||
case 0x05:
|
||||
LOG_MSG("CPU:Out Of Bounds interrupt");
|
||||
LOG(LOG_CPU,"CPU:Out Of Bounds interrupt");
|
||||
break;
|
||||
default:
|
||||
// LOG_WARN("Call to unsupported INT %02X call %02X",num,reg_ah);
|
||||
|
|
|
@ -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
|
||||
|
@ -134,7 +134,7 @@ bool get_CF(void) {
|
|||
case t_DIV:
|
||||
return false; /* Unkown */
|
||||
default:
|
||||
LOG_WARN("get_CF Unknown %d",flags.type);
|
||||
LOG(LOG_ERROR|LOG_CPU,"get_CF Unknown %d",flags.type);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ again:
|
|||
case t_MUL:
|
||||
return false; /* Unkown */
|
||||
default:
|
||||
LOG_WARN("get_AF Unknown %d",flags.type);
|
||||
LOG(LOG_ERROR|LOG_CPU,"get_AF Unknown %d",flags.type);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ again:
|
|||
case t_MUL:
|
||||
return false; /* Unkown */
|
||||
default:
|
||||
LOG_WARN("get_ZF Unknown %d",flags.type);
|
||||
LOG(LOG_ERROR|LOG_CPU,"get_ZF Unknown %d",flags.type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ again:
|
|||
case t_MUL:
|
||||
return false; /* Unkown */
|
||||
default:
|
||||
LOG_WARN("get_SF Unkown %d",flags.type);
|
||||
LOG(LOG_ERROR|LOG_CPU,"get_SF Unkown %d",flags.type);
|
||||
}
|
||||
return false;
|
||||
|
||||
|
@ -539,7 +539,7 @@ again:
|
|||
case t_DIV:
|
||||
return false; /* Unkown */
|
||||
default:
|
||||
LOG_WARN("get_OF Unkown %d",flags.type);
|
||||
LOG(LOG_ERROR|LOG_CPU,"get_OF Unkown %d",flags.type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -81,7 +81,7 @@ static Bitu CPU_Real_16_Slow_Decode(void) {
|
|||
if (prefix.count) {
|
||||
PrefixReset;
|
||||
//DEBUG_HeavyWriteLogInstruction();
|
||||
LOG_DEBUG("Prefix for non prefixed instruction");
|
||||
LOG(LOG_CPU,"Prefix for non prefixed instruction");
|
||||
}
|
||||
CPU_Cycles--;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002 - 2003 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
|
||||
|
@ -292,9 +292,8 @@ bool CBreakpoint::CheckBreakpoint(PhysPt adr)
|
|||
Bit8u value = mem_readb(bp->GetLocation());
|
||||
if (bp->GetValue() != value) {
|
||||
// Yup, memory value changed
|
||||
char buffer[200];
|
||||
sprintf(buffer,"DEBUG: Memory breakpoint: %04X:%04X - %02X -> %02X",bp->GetSegment(),bp->GetOffset(),bp->GetValue(),value);
|
||||
LOG_DEBUG(buffer);
|
||||
|
||||
DEBUG_ShowMsg(0,"DEBUG: Memory breakpoint: %04X:%04X - %02X -> %02X",bp->GetSegment(),bp->GetOffset(),bp->GetValue(),value);
|
||||
bp->SetValue(value);
|
||||
return true;
|
||||
};
|
||||
|
@ -745,9 +744,7 @@ bool ParseCommand(char* str)
|
|||
};
|
||||
name[15] = 0;
|
||||
|
||||
char buffer[128];
|
||||
sprintf(buffer,"DEBUG: Created debug var %s at %04X:%04X",name,seg,ofs);
|
||||
LOG_DEBUG(buffer);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Created debug var %s at %04X:%04X",name,seg,ofs);
|
||||
CDebugVar::InsertVariable(name,PhysMake(seg,ofs));
|
||||
return true;
|
||||
}
|
||||
|
@ -761,8 +758,8 @@ bool ParseCommand(char* str)
|
|||
else { name[i] = 0; break; };
|
||||
};
|
||||
name[12] = 0;
|
||||
if (CDebugVar::SaveVars(name)) LOG_DEBUG("DEBUG: Variable list save (%s) : ok.",name);
|
||||
else LOG_DEBUG("DEBUG: Variable list save (%s) : failure",name);
|
||||
if (CDebugVar::SaveVars(name)) DEBUG_ShowMsg(0,"DEBUG: Variable list save (%s) : ok.",name);
|
||||
else DEBUG_ShowMsg(0,"DEBUG: Variable list save (%s) : failure",name);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -775,8 +772,8 @@ bool ParseCommand(char* str)
|
|||
else { name[i] = 0; break; };
|
||||
};
|
||||
name[12] = 0;
|
||||
if (CDebugVar::LoadVars(name)) LOG_DEBUG("DEBUG: Variable list load (%s) : ok.",name);
|
||||
else LOG_DEBUG("DEBUG: Variable list load (%s) : failure",name);
|
||||
if (CDebugVar::LoadVars(name)) DEBUG_ShowMsg(0,"DEBUG: Variable list load (%s) : ok.",name);
|
||||
else DEBUG_ShowMsg(0,"DEBUG: Variable list load (%s) : failure",name);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -786,7 +783,7 @@ bool ParseCommand(char* str)
|
|||
Bit16u seg = GetHexValue(found,found);found++; // skip ":"
|
||||
Bit32u ofs = GetHexValue(found,found);
|
||||
CBreakpoint::AddBreakpoint(seg,ofs,false);
|
||||
LOG_DEBUG("DEBUG: Set breakpoint at %04X:%04X",seg,ofs);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set breakpoint at %04X:%04X",seg,ofs);
|
||||
return true;
|
||||
}
|
||||
#if C_HEAVY_DEBUG
|
||||
|
@ -796,7 +793,7 @@ bool ParseCommand(char* str)
|
|||
Bit16u seg = GetHexValue(found,found);found++; // skip ":"
|
||||
Bit32u ofs = GetHexValue(found,found);
|
||||
CBreakpoint::AddMemBreakpoint(seg,ofs);
|
||||
LOG_DEBUG("DEBUG: Set memory breakpoint at %04X:%04X",seg,ofs);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set memory breakpoint at %04X:%04X",seg,ofs);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -807,10 +804,10 @@ bool ParseCommand(char* str)
|
|||
Bit8u valAH = GetHexValue(found,found);
|
||||
if ((valAH==0x00) && (*found=='*')) {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,BPINT_ALL,false);
|
||||
LOG_DEBUG("DEBUG: Set interrupt breakpoint at INT %02X",intNr);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set interrupt breakpoint at INT %02X",intNr);
|
||||
} else {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,valAH,false);
|
||||
LOG_DEBUG("DEBUG: Set interrupt breakpoint at INT %02X AH=%02X",intNr,valAH);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set interrupt breakpoint at INT %02X AH=%02X",intNr,valAH);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -829,7 +826,7 @@ bool ParseCommand(char* str)
|
|||
Bit8u bpNr = GetHexValue(found,found);
|
||||
if ((bpNr==0x00) && (*found=='*')) { // Delete all
|
||||
CBreakpoint::DeleteAll();
|
||||
LOG_DEBUG("DEBUG: Breakpoints deleted.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Breakpoints deleted.");
|
||||
} else {
|
||||
// delete single breakpoint
|
||||
CBreakpoint::DeleteByIndex(bpNr);
|
||||
|
@ -841,7 +838,7 @@ bool ParseCommand(char* str)
|
|||
found++;
|
||||
Bit16u codeSeg = GetHexValue(found,found); found++;
|
||||
Bit32u codeOfs = GetHexValue(found,found);
|
||||
LOG_DEBUG("DEBUG: Set code overview to %04X:%04X",codeSeg,codeOfs);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set code overview to %04X:%04X",codeSeg,codeOfs);
|
||||
codeViewData.useCS = codeSeg;
|
||||
codeViewData.useEIP = codeOfs;
|
||||
return true;
|
||||
|
@ -851,22 +848,22 @@ bool ParseCommand(char* str)
|
|||
found++;
|
||||
dataSeg = GetHexValue(found,found); found++;
|
||||
dataOfs = GetHexValue(found,found);
|
||||
LOG_DEBUG("DEBUG: Set data overview to %04X:%04X",dataSeg,dataOfs);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Set data overview to %04X:%04X",dataSeg,dataOfs);
|
||||
return true;
|
||||
}
|
||||
found = strstr(str,"LOG ");
|
||||
if (found) { // Create Cpu log file
|
||||
found+=4;
|
||||
LOG_DEBUG("DEBUG: Starting log");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Starting log");
|
||||
DEBUG_Log_Loop(GetHexValue(found,found));
|
||||
LOG_DEBUG("DEBUG: Logfile LOGCPU.TXT created.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Logfile LOGCPU.TXT created.");
|
||||
return true;
|
||||
}
|
||||
found = strstr(str,"SR ");
|
||||
if (found) { // Set register value
|
||||
found+=2;
|
||||
if (ChangeRegister(found)) LOG_DEBUG("DEBUG: Set Register success.");
|
||||
else LOG_DEBUG("DEBUG: Set Register failure.");
|
||||
if (ChangeRegister(found)) DEBUG_ShowMsg(0,"DEBUG: Set Register success.");
|
||||
else DEBUG_ShowMsg(0,"DEBUG: Set Register failure.");
|
||||
return true;
|
||||
}
|
||||
found = strstr(str,"SM ");
|
||||
|
@ -883,14 +880,14 @@ bool ParseCommand(char* str)
|
|||
count++;
|
||||
}
|
||||
};
|
||||
LOG_DEBUG("DEBUG: Memory changed.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Memory changed.");
|
||||
return true;
|
||||
}
|
||||
found = strstr(str,"INTT ");
|
||||
if (found) { // Create Cpu log file
|
||||
found+=4;
|
||||
Bit8u intNr = GetHexValue(found,found);
|
||||
LOG_DEBUG("DEBUG: Tracing INT %02X",intNr);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Tracing INT %02X",intNr);
|
||||
Interrupt(intNr);
|
||||
SetCodeWinStart();
|
||||
return true;
|
||||
|
@ -899,7 +896,7 @@ bool ParseCommand(char* str)
|
|||
if (found) { // Create Cpu log file
|
||||
found+=4;
|
||||
Bit8u intNr = GetHexValue(found,found);
|
||||
LOG_DEBUG("DEBUG: Starting INT %02X",intNr);
|
||||
DEBUG_ShowMsg(0,"DEBUG: Starting INT %02X",intNr);
|
||||
CBreakpoint::AddBreakpoint (SegValue(cs),reg_eip, true);
|
||||
CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip-1,true);
|
||||
debugging=false;
|
||||
|
@ -913,8 +910,8 @@ bool ParseCommand(char* str)
|
|||
found = strstr(str,"HEAVYLOG");
|
||||
if (found) { // Create Cpu log file
|
||||
logHeavy = !logHeavy;
|
||||
if (logHeavy) LOG_DEBUG("DEBUG: Heavy cpu logging on.");
|
||||
else LOG_DEBUG("DEBUG: Heavy cpu logging off.");
|
||||
if (logHeavy) DEBUG_ShowMsg(0,"DEBUG: Heavy cpu logging on.");
|
||||
else DEBUG_ShowMsg(0,"DEBUG: Heavy cpu logging off.");
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -1109,7 +1106,7 @@ Bit32u DEBUG_CheckKeys(void) {
|
|||
ParseCommand(codeViewData.inputStr);
|
||||
break;
|
||||
case 'T' : DEBUG_RaiseTimerIrq();
|
||||
LOG_DEBUG("Debug: Timer Int started.");
|
||||
DEBUG_ShowMsg(0,"Debug: Timer Int started.");
|
||||
break;
|
||||
case 'V' : showExtend = !showExtend;
|
||||
break;
|
||||
|
@ -1444,7 +1441,7 @@ void SaveMemory(Bit16u seg, Bit16u ofs1, Bit32s num)
|
|||
{
|
||||
FILE* f = fopen("MEMDUMP.TXT","wt");
|
||||
if (!f) {
|
||||
LOG_DEBUG("DEBUG: Memory dump failed.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Memory dump failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1464,7 +1461,7 @@ void SaveMemory(Bit16u seg, Bit16u ofs1, Bit32s num)
|
|||
fprintf(f,"%s\n",buffer);
|
||||
};
|
||||
fclose(f);
|
||||
LOG_DEBUG("DEBUG: Memory dump success.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Memory dump success.");
|
||||
};
|
||||
|
||||
// HEAVY DEBUGGING STUFF
|
||||
|
@ -1497,11 +1494,11 @@ void DEBUG_HeavyWriteLogInstruction(void)
|
|||
|
||||
logHeavy = false;
|
||||
|
||||
LOG_DEBUG("DEBUG: Creating cpu log LOGCPU_INT_CD.TXT");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Creating cpu log LOGCPU_INT_CD.TXT");
|
||||
|
||||
FILE* f = fopen("LOGCPU_INT_CD.TXT","wt");
|
||||
if (!f) {
|
||||
LOG_DEBUG("DEBUG: Failed.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1514,7 +1511,7 @@ void DEBUG_HeavyWriteLogInstruction(void)
|
|||
|
||||
fclose(f);
|
||||
|
||||
LOG_DEBUG("DEBUG: Done.");
|
||||
DEBUG_ShowMsg(0,"DEBUG: Done.");
|
||||
};
|
||||
|
||||
bool DEBUG_HeavyIsBreakpoint(void)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002 - 2003 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
|
||||
|
@ -20,25 +20,43 @@
|
|||
|
||||
#include "dosbox.h"
|
||||
#if C_DEBUG
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <curses.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "support.h"
|
||||
#include "regs.h"
|
||||
#include "debug.h"
|
||||
#include "debug_inc.h"
|
||||
|
||||
extern int old_cursor_state;
|
||||
void DEBUG_ShowMsg(char * msg) {
|
||||
char buf[1024];
|
||||
strcpy(buf,msg);
|
||||
struct _LogGroup {
|
||||
char * front;
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
waddstr(dbg.win_out,buf);
|
||||
wprintw(dbg.win_out," %d\n",cycle_count);
|
||||
namespace {
|
||||
_LogGroup loggrp[LOG_MAX]={"",true,0};
|
||||
|
||||
FILE* debuglog;
|
||||
};
|
||||
|
||||
extern int old_cursor_state;
|
||||
void DEBUG_ShowMsg(Bit32u entry, char * format,...) {
|
||||
|
||||
if (!(entry & LOG_ERROR) && entry && !loggrp[entry].enabled) return;
|
||||
|
||||
char buf[1024];
|
||||
strcpy(buf,loggrp[entry&127].front);
|
||||
va_list msg;
|
||||
va_start(msg,format);
|
||||
vsprintf(&buf[strlen(buf)],format,msg);
|
||||
va_end(msg);
|
||||
wprintw(dbg.win_out,"%10d: %s\n",cycle_count,buf);
|
||||
wrefresh(dbg.win_out);
|
||||
if(debuglog) fprintf(debuglog,"%10d: %s\n",cycle_count,buf);
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,6 +132,68 @@ static void MakePairs(void) {
|
|||
init_pair(PAIR_BLACK_GREY, COLOR_BLACK /*| FOREGROUND_INTENSITY */, COLOR_WHITE);
|
||||
init_pair(PAIR_GREY_RED, COLOR_WHITE/*| FOREGROUND_INTENSITY */, COLOR_RED);
|
||||
}
|
||||
static void LOG_Destroy(Section* sec) {
|
||||
|
||||
if(debuglog) fclose(debuglog);
|
||||
}
|
||||
|
||||
static void LOG_Init(Section * sec) {
|
||||
Section_prop * sect=static_cast<Section_prop *>(sec);
|
||||
const char * blah=sect->Get_string("logfile");
|
||||
if(blah && (debuglog = fopen(blah,"wt+"))){
|
||||
}else{
|
||||
debuglog=0;
|
||||
}
|
||||
sect->AddDestroyFunction(LOG_Destroy);
|
||||
char buf[1024];
|
||||
for (Bitu i=1;i<LOG_MAX;i++) {
|
||||
strcpy(buf,loggrp[i].front);
|
||||
buf[strlen(buf)-1]=0;
|
||||
loggrp[i].enabled=sect->Get_bool(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LOG_StartUp(void) {
|
||||
/* Setup logging groups */
|
||||
loggrp[LOG_VGA].front="VGA:";
|
||||
loggrp[LOG_VGAGFX].front="VGAGFX:";
|
||||
loggrp[LOG_VGAMISC].front="VGAMISC:";
|
||||
loggrp[LOG_INT10].front="INT10:";
|
||||
loggrp[LOG_SB].front="SBLASTER:";
|
||||
loggrp[LOG_DMA].front="DMA:";
|
||||
|
||||
loggrp[LOG_FPU].front="FPU:";
|
||||
loggrp[LOG_CPU].front="CPU:";
|
||||
|
||||
loggrp[LOG_FCB].front="FCB:";
|
||||
loggrp[LOG_FILES].front="FILES:";
|
||||
loggrp[LOG_IOCTL].front="IOCTL:";
|
||||
loggrp[LOG_EXEC].front="EXEC";
|
||||
loggrp[LOG_DOSMISC].front="DOSMISC:";
|
||||
|
||||
loggrp[LOG_PIT].front="PIT:";
|
||||
loggrp[LOG_KEYBOARD].front="KEYBOARD:";
|
||||
loggrp[LOG_PIC].front="PIC:";
|
||||
|
||||
loggrp[LOG_MOUSE].front="MOUSE:";
|
||||
loggrp[LOG_BIOS].front="BIOS:";
|
||||
loggrp[LOG_GUI].front="GUI:";
|
||||
loggrp[LOG_MISC].front="MISC:";
|
||||
|
||||
/* Register the log section */
|
||||
Section_prop * sect=control->AddSection_prop("log",LOG_Init);
|
||||
sect->Add_string("logfile","");
|
||||
char buf[1024];
|
||||
for (Bitu i=1;i<LOG_MAX;i++) {
|
||||
strcpy(buf,loggrp[i].front);
|
||||
buf[strlen(buf)-1]=0;
|
||||
lowcase(buf);
|
||||
sect->Add_bool(buf,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DBGUI_StartUp(void) {
|
||||
|
@ -133,7 +213,6 @@ void DBGUI_StartUp(void) {
|
|||
MakePairs();
|
||||
MakeSubWindows();
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -37,6 +37,7 @@ struct DBGBlock {
|
|||
WINDOW * win_out; /* Text Output Window */
|
||||
Bit32u active_win; /* Current active window */
|
||||
Bit32u input_y;
|
||||
Bit32u global_mask; /* Current msgmask */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -120,7 +120,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
ansi.esc=true;
|
||||
count++;
|
||||
if(!ansiwarned) {
|
||||
LOG_WARN("ANSI sequences detected. enabling ansi support"); /* maybe LOG_MSG */
|
||||
LOG(LOG_IOCTL,"ANSI sequences detected. enabling ansi support"); /* maybe LOG_MSG */
|
||||
ansiwarned=true;
|
||||
}
|
||||
continue;
|
||||
|
@ -143,7 +143,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
case 'D':/* scrolling DOWN*/
|
||||
case 'M':/* scrolling UP*/
|
||||
default:
|
||||
LOG_DEBUG("ANSI: unknown char %c after a esc",data[count]); /*prob () */
|
||||
LOG(LOG_IOCTL,"ANSI: unknown char %c after a esc",data[count]); /*prob () */
|
||||
ClearAnsi();
|
||||
break;
|
||||
}
|
||||
|
@ -179,13 +179,13 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
ansi.attr|=0x8;
|
||||
break;
|
||||
case 4: /* underline */
|
||||
LOG_DEBUG("ANSI:no support for underline yet");
|
||||
LOG(LOG_IOCTL,"ANSI:no support for underline yet");
|
||||
break;
|
||||
case 5: /* blinking */
|
||||
LOG_DEBUG("ANSI:no support for blinking yet");
|
||||
LOG(LOG_IOCTL,"ANSI:no support for blinking yet");
|
||||
break;
|
||||
case 7: /* reverse */
|
||||
LOG_DEBUG("ANSI:no support for reverse yet");
|
||||
LOG(LOG_IOCTL,"ANSI:no support for reverse yet");
|
||||
break;
|
||||
case 30: /* fg color black */
|
||||
ansi.attr&=0xf8;
|
||||
|
@ -284,7 +284,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
case 'J': /*erase screen and move cursor home*/
|
||||
if(ansi.data[0]==0) ansi.data[0]=2;
|
||||
if(ansi.data[0]!=2) {/* only number 2 (the standard one supported) */
|
||||
LOG_DEBUG("ANSI: esc[%dJ called : not supported",ansi.data[0]);
|
||||
LOG(LOG_IOCTL,"ANSI: esc[%dJ called : not supported",ansi.data[0]);
|
||||
break;
|
||||
}
|
||||
for(i=0;i<(Bitu)ansi.ncols*ansi.nrows;i++) INT10_TeletypeOutput(' ',ansi.attr,true,0);
|
||||
|
@ -293,7 +293,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
break;
|
||||
case 'h': /* set MODE (if code =7 enable linewrap) */
|
||||
case 'I': /*RESET MODE */
|
||||
LOG_DEBUG("ANSI: set/reset mode called(not supported)");
|
||||
LOG(LOG_IOCTL,"ANSI: set/reset mode called(not supported)");
|
||||
ClearAnsi();
|
||||
break;
|
||||
case 'D': /*Cursor Backward */
|
||||
|
@ -320,7 +320,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) {
|
|||
case 'p':/* reassign keys (needs strings) */
|
||||
case 'i':/* printer stuff */
|
||||
default:
|
||||
LOG_DEBUG("ANSI: unhandled char %c in esc[",data[count]);
|
||||
LOG(LOG_IOCTL,"ANSI: unhandled char %c in esc[",data[count]);
|
||||
ClearAnsi();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -284,12 +284,12 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
|
|||
pos=headersize;DOS_SeekFile(fhandle,&pos,DOS_SEEK_SET);
|
||||
while (imagesize>0x7FFF) {
|
||||
readsize=0x8000;DOS_ReadFile(fhandle,loadaddress,&readsize);
|
||||
if (readsize!=0x8000) LOG_WARN("Illegal header");
|
||||
if (readsize!=0x8000) LOG(LOG_EXEC,"Illegal header");
|
||||
loadaddress+=0x8000;imagesize-=0x8000;
|
||||
}
|
||||
if (imagesize>0) {
|
||||
readsize=(Bit16u)imagesize;DOS_ReadFile(fhandle,loadaddress,&readsize);
|
||||
if (readsize!=imagesize) LOG_WARN("Illegal header");
|
||||
if (readsize!=imagesize) LOG(LOG_EXEC,"Illegal header");
|
||||
}
|
||||
/* Relocate the exe image */
|
||||
Bit16u relocate;
|
||||
|
|
|
@ -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
|
||||
|
@ -333,7 +333,8 @@ bool DOS_CreateFile(char * name,Bit16u attributes,Bit16u * entry) {
|
|||
|
||||
bool DOS_OpenFile(char * name,Bit8u flags,Bit16u * entry) {
|
||||
/* First check for devices */
|
||||
if (flags>2) LOG_DEBUG("Special file open command %X file %s",flags,name);
|
||||
if (flags>2) LOG(LOG_FILES|LOG_ERROR,"Special file open command %X file %s",flags,name);
|
||||
else LOG(LOG_FILES,"file open command %X file %s",flags,name);
|
||||
flags&=3;
|
||||
DOS_PSP psp(dos.psp);
|
||||
Bit8u handle=DOS_FindDevice((char *)name);
|
||||
|
@ -344,19 +345,6 @@ bool DOS_OpenFile(char * name,Bit8u flags,Bit16u * entry) {
|
|||
/* First check if the name is correct */
|
||||
if (!DOS_MakeName(name,fullname,&drive)) return false;
|
||||
|
||||
/* Check, if file is already opened */
|
||||
/* for (i=0;i<DOS_FILES;i++) {
|
||||
if (Files[i] && Files[i]->IsOpen() && Files[i]->IsName(fullname)) {
|
||||
*entry = psp.FindEntryByHandle(i);
|
||||
if (*entry==0xFF) {
|
||||
// This shouldnt happen
|
||||
LOG_ERROR("DOS: File %s is opened but has no psp entry.",name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* Check for a free file handle */
|
||||
for (i=0;i<DOS_FILES;i++) {
|
||||
if (!Files[i]) {
|
||||
|
@ -669,7 +657,7 @@ bool DOS_FCBOpen(Bit16u seg,Bit16u offset) {
|
|||
handle = psp.FindEntryByHandle(i);
|
||||
if (handle==0xFF) {
|
||||
// This shouldnt happen
|
||||
LOG_ERROR("DOS: File %s is opened but has no psp entry.",shortname);
|
||||
LOG(LOG_FILES|LOG_ERROR,"DOS: File %s is opened but has no psp entry.",shortname);
|
||||
return false;
|
||||
}
|
||||
fcb.FileOpen((Bit8u)handle);
|
||||
|
|
|
@ -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
|
||||
|
@ -45,7 +45,7 @@ bool DOS_IOCTL(void) {
|
|||
reg_dx=Files[handle]->GetInformation();
|
||||
return true;
|
||||
case 0x07: /* Get Output Status */
|
||||
LOG_DEBUG("DOS:IOCTL:07:Fakes output status is ready for handle %d",handle);
|
||||
LOG(LOG_IOCTL,"DOS:IOCTL:07:Fakes output status is ready for handle %d",handle);
|
||||
reg_al=0xff;
|
||||
return true;
|
||||
case 0x08: /* Check if block device removable */
|
||||
|
@ -71,7 +71,7 @@ bool DOS_IOCTL(void) {
|
|||
mem_writeb(ptr+6,0x00); // media type (00=other type)
|
||||
break;
|
||||
default :
|
||||
LOG_ERROR("DOS:IOCTL Call 0D:%2X Drive %2X unhandled",reg_cl,drive);
|
||||
LOG(LOG_IOCTL|LOG_ERROR,"DOS:IOCTL Call 0D:%2X Drive %2X unhandled",reg_cl,drive);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -94,7 +94,7 @@ bool DOS_IOCTL(void) {
|
|||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("DOS:IOCTL Call %2X unhandled",reg_al);
|
||||
LOG(LOG_DOSMISC|LOG_ERROR,"DOS:IOCTL Call %2X unhandled",reg_al);
|
||||
return false;
|
||||
};
|
||||
return false;
|
||||
|
|
|
@ -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
|
||||
|
@ -44,7 +44,7 @@ static Bitu INT2F_Handler(void) {
|
|||
if ((*loop_multiplex->handler)()) return CBRET_NONE;
|
||||
loop_multiplex=loop_multiplex->next;
|
||||
}
|
||||
LOG_WARN("DOS:Multiplex Unhandled call %4X",reg_ax);
|
||||
LOG(LOG_ERROR,"DOS:Multiplex Unhandled call %4X",reg_ax);
|
||||
return CBRET_NONE;
|
||||
};
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ DOS_Drive_Cache::~DOS_Drive_Cache(void)
|
|||
Bit16u DOS_Drive_Cache::GetFreeID(CFileInfo* dir)
|
||||
{
|
||||
for (Bit32u i=0; i<MAX_OPENDIRS; i++) if (free[i] || (dir==dirSearch[i])) return i;
|
||||
LOG_ERROR("DIRCACHE: Too many open directorys!");
|
||||
LOG(LOG_FILES,"DIRCACHE: Too many open directories!");
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ Bitu errorlevel=1;
|
|||
|
||||
/* The whole load of startups for all the subfunctions */
|
||||
void MSG_Init(Section_prop *);
|
||||
void LOG_StartUp(void);
|
||||
void MEM_Init(Section *);
|
||||
void IO_Init(Section * );
|
||||
void CALLBACK_Init(Section*);
|
||||
|
@ -158,6 +159,7 @@ void DOSBOX_Init(void) {
|
|||
secprop->Add_string("language","");
|
||||
#if C_DEBUG
|
||||
secprop->Add_int("warnings",4);
|
||||
LOG_StartUp();
|
||||
#else
|
||||
secprop->Add_int("warnings",0);
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
@ -111,7 +111,7 @@ static void TakeScreenShot(Bit8u * bitmap) {
|
|||
/* Find a filename to open */
|
||||
dir=opendir(snapshots_dir);
|
||||
if (!dir) {
|
||||
LOG_WARN("Can't open snapshot dir %s",snapshots_dir);
|
||||
LOG_MSG("Can't open snapshot dir %s",snapshots_dir);
|
||||
return;
|
||||
}
|
||||
while (dir_ent=readdir(dir)) {
|
||||
|
@ -130,7 +130,7 @@ static void TakeScreenShot(Bit8u * bitmap) {
|
|||
/* Open the actual file */
|
||||
FILE * fp=fopen(file_name,"wb");
|
||||
if (!fp) {
|
||||
LOG_WARN("Can't open snapshot file %s",file_name);
|
||||
LOG_MSG("Can't open snapshot file %s",file_name);
|
||||
return;
|
||||
}
|
||||
/* Finalize the initing of png library */
|
||||
|
|
|
@ -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
|
||||
|
@ -43,6 +43,7 @@ struct SDL_Block {
|
|||
Bitu flags;
|
||||
GFX_ModeCallBack mode_callback;
|
||||
bool full_screen;
|
||||
bool nowait;
|
||||
SDL_Surface * surface;
|
||||
SDL_Joystick * joy;
|
||||
SDL_cond *cond;
|
||||
|
@ -234,6 +235,7 @@ static void GUI_StartUp(Section * sec) {
|
|||
Section_prop * section=static_cast<Section_prop *>(sec);
|
||||
sdl.active=false;
|
||||
sdl.full_screen=false;
|
||||
sdl.nowait=section->Get_bool("nowait");
|
||||
sdl.mouse.locked=false;
|
||||
sdl.mouse.requestlock=false;
|
||||
sdl.mouse.autoenable=section->Get_bool("autolock");
|
||||
|
@ -498,7 +500,7 @@ void GFX_Events() {
|
|||
HandleVideoResize(&event.resize);
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
E_Exit("Closed the SDL Window");
|
||||
throw(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -512,15 +514,17 @@ void GFX_ShowMsg(char * msg) {
|
|||
};
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
|
||||
#if C_DEBUG
|
||||
DEBUG_SetupConsole();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
try {
|
||||
CommandLine com_line(argc,argv);
|
||||
Config myconf(&com_line);
|
||||
control=&myconf;
|
||||
|
||||
#if C_DEBUG
|
||||
DEBUG_SetupConsole();
|
||||
#endif
|
||||
|
||||
if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER
|
||||
#ifndef DISABLE_JOYSTICK
|
||||
|
@ -532,7 +536,7 @@ int main(int argc, char* argv[]) {
|
|||
sdl_sec->Add_bool("fullscreen",false);
|
||||
sdl_sec->Add_bool("autolock",true);
|
||||
sdl_sec->Add_int("sensitivity",100);
|
||||
|
||||
sdl_sec->Add_bool("nowait",false);
|
||||
/* Init all the dosbox subsystems */
|
||||
DOSBOX_Init();
|
||||
std::string config_file;
|
||||
|
@ -564,7 +568,11 @@ int main(int argc, char* argv[]) {
|
|||
if (sdl.full_screen) SwitchFullScreen();
|
||||
if (sdl.mouse.locked) CaptureMouse();
|
||||
LOG_MSG("Exit to error: %sPress enter to continue.",error);
|
||||
fgetc(stdin);
|
||||
if(!sdl.nowait) fgetc(stdin);
|
||||
}
|
||||
catch (...){
|
||||
if (sdl.full_screen) SwitchFullScreen();
|
||||
if (sdl.mouse.locked) CaptureMouse();
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -52,7 +52,7 @@ static void cmos_checktimer(void) {
|
|||
if (!cmos.timer.div && !cmos.timer.enabled) return;
|
||||
if (cmos.timer.div<=2) cmos.timer.div+=7;
|
||||
cmos.timer.micro=(Bitu) (10000000.0/(32768.0 / (1 << (cmos.timer.div - 1))));
|
||||
LOG_DEBUG("RTC Timer at %f hz",1000000.0/cmos.timer.micro);
|
||||
LOG(LOG_PIT,"RTC Timer at %f hz",1000000.0/cmos.timer.micro);
|
||||
PIC_AddEvent(cmos_timerevent,cmos.timer.micro);
|
||||
}
|
||||
|
||||
|
@ -77,25 +77,25 @@ static void cmos_writereg(Bit32u port,Bit8u val) {
|
|||
break;
|
||||
case 0x0a: /* Status reg A */
|
||||
cmos.regs[cmos.reg]=val & 0x7f;
|
||||
if (val & 0x70!=0x20) LOG_DEBUG("CMOS Illegal 22 stage divider value");
|
||||
if (val & 0x70!=0x20) LOG(LOG_ERROR|LOG_BIOS,"CMOS Illegal 22 stage divider value");
|
||||
cmos.timer.div=(val & 0xf);
|
||||
cmos_checktimer();
|
||||
break;
|
||||
case 0x0b: /* Status reg B */
|
||||
cmos.regs[cmos.reg]=val & 0x7f;
|
||||
cmos.timer.enabled=(val & 0x40)>0;
|
||||
if (val&0x10) LOG_DEBUG("CMOS:Updated ended interrupt not supported yet");
|
||||
if (val&0x10) LOG(LOG_ERROR|LOG_BIOS,"CMOS:Updated ended interrupt not supported yet");
|
||||
cmos_checktimer();
|
||||
break;
|
||||
default:
|
||||
cmos.regs[cmos.reg]=val & 0x7f;
|
||||
LOG_DEBUG("CMOS:Unhandled register %x",cmos.reg);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"CMOS:Unhandled register %x",cmos.reg);
|
||||
}
|
||||
}
|
||||
|
||||
static Bit8u cmos_readreg(Bit32u port) {
|
||||
if (cmos.reg>0x3f) {
|
||||
LOG_DEBUG("CMOS:Read from illegal register %x",cmos.reg);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"CMOS:Read from illegal register %x",cmos.reg);
|
||||
return 0xff;
|
||||
}
|
||||
switch (cmos.reg) {
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "dosbox.h"
|
||||
#include "inout.h"
|
||||
|
@ -29,7 +47,7 @@ static void disney_write(Bit32u port,Bit8u val) {
|
|||
disney.data=val;
|
||||
break;
|
||||
case 1: /* Status Port */
|
||||
LOG_WARN("DISNEY:Status write %x",val);
|
||||
LOG(LOG_MISC,"DISNEY:Status write %x",val);
|
||||
break;
|
||||
case 2: /* Control Port */
|
||||
// LOG_WARN("DISNEY:Control write %x",val);
|
||||
|
@ -38,7 +56,7 @@ static void disney_write(Bit32u port,Bit8u val) {
|
|||
disney.buffer[disney.used++]=disney.data;
|
||||
}
|
||||
}
|
||||
if (val&0x10) LOG_DEBUG("DISNEY:Parallel IRQ Enabled");
|
||||
if (val&0x10) LOG(LOG_ERROR,"DISNEY:Parallel IRQ Enabled");
|
||||
disney.control=val;
|
||||
break;
|
||||
}
|
||||
|
@ -48,16 +66,16 @@ static Bit8u disney_read(Bit32u port) {
|
|||
|
||||
switch (port-DISNEY_BASE) {
|
||||
case 0: /* Data Port */
|
||||
LOG_WARN("DISNEY:Read from data port");
|
||||
// LOG(LOG_MISC,"DISNEY:Read from data port");
|
||||
return disney.data;
|
||||
break;
|
||||
case 1: /* Status Port */
|
||||
// LOG_WARN("DISNEY:Read from status port %X",disney.status);
|
||||
// LOG(LOG_MISC,"DISNEY:Read from status port %X",disney.status);
|
||||
if (disney.used>=16) return 0x40;
|
||||
else return 0x0;
|
||||
break;
|
||||
case 2: /* Control Port */
|
||||
LOG_WARN("DISNEY:Read from control port");
|
||||
LOG(LOG_MISC,"DISNEY:Read from control port");
|
||||
return disney.control;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -98,7 +98,7 @@ static Bit8u read_dma(Bit32u port) {
|
|||
break;
|
||||
|
||||
default:
|
||||
LOG_WARN("DMA:Unhandled read from %d",port);
|
||||
LOG(LOG_ERROR,"DMA:Unhandled read from %d",port);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ static void write_dma(Bit32u port,Bit8u val) {
|
|||
chan->addr_changed=true;
|
||||
break;
|
||||
case 0x08: /* Command Register */
|
||||
if (val != 4) LOG_WARN("DMA1:Illegal command %2X",val);
|
||||
if (val != 4) LOG(LOG_ERROR,"DMA1:Illegal command %2X",val);
|
||||
cont->command_reg=val;
|
||||
break;
|
||||
case 0x09: /* Request Register */
|
||||
|
@ -155,7 +155,7 @@ static void write_dma(Bit32u port,Bit8u val) {
|
|||
chan->mode.autoinit_enable = (val & 0x10) > 0;
|
||||
chan->mode.transfer_type = (val >> 2) & 0x03;
|
||||
if (chan->mode.address_decrement) {
|
||||
LOG_WARN("DMA:Address Decrease not supported yet");
|
||||
LOG(LOG_ERROR,"DMA:Address Decrease not supported yet");
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -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
|
||||
|
@ -110,7 +110,7 @@ static void write_cms(Bit32u port,Bit8u val) {
|
|||
cms->noise[1].freq_add=noise_freq[(val>>4) & 3];
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("CMS %d:Illegal register %X2 Selected for write",sel,cms->reg);
|
||||
LOG(LOG_ERROR,"CMS %d:Illegal register %X2 Selected for write",sel,cms->reg);
|
||||
break;
|
||||
};
|
||||
break;
|
||||
|
|
|
@ -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
|
||||
|
@ -24,12 +24,12 @@ IO_WriteBlock IO_WriteTable[IO_MAX];
|
|||
|
||||
void IO_Write(Bitu num,Bit8u val) {
|
||||
if (num<IO_MAX) IO_WriteTable[num].handler(num,val);
|
||||
else LOG_ERROR("IO:Out or range write %X2 to port %4X",val,num);
|
||||
else LOG(LOG_ERROR,"IO:Out or range write %X2 to port %4X",val,num);
|
||||
}
|
||||
|
||||
Bit8u IO_Read(Bitu num) {
|
||||
if (num<IO_MAX) return IO_ReadTable[num].handler(num);
|
||||
else LOG_ERROR("IO:Out or range read from port %4X",num);
|
||||
else LOG(LOG_ERROR,"IO:Out or range read from port %4X",num);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
|
@ -42,13 +42,13 @@ static void IO_WriteBlocked(Bit32u port,Bit8u val) {
|
|||
}
|
||||
|
||||
static Bit8u IO_ReadDefault(Bit32u port) {
|
||||
LOG_WARN("Reading from undefined port %04X",port);
|
||||
LOG(LOG_ERROR,"Reading from undefined port %04X",port);
|
||||
IO_RegisterReadHandler(port,&IO_ReadBlocked,"Blocked Read");
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void IO_WriteDefault(Bit32u port,Bit8u val) {
|
||||
LOG_WARN("Writing %02X to undefined port %04X",val,port);
|
||||
LOG(LOG_ERROR,"Writing %02X to undefined port %04X",val,port);
|
||||
IO_RegisterWriteHandler(port,&IO_WriteBlocked,"Blocked Write");
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -119,7 +119,7 @@ static void write_p60(Bit32u port,Bit8u val) {
|
|||
KEYBOARD_AddCode(0xfa); /* Acknowledge */
|
||||
break;
|
||||
default:
|
||||
LOG_DEBUG("KEYB:60:Unhandled command %X",val);
|
||||
LOG(LOG_ERROR|LOG_KEYBOARD,"60:Unhandled command %X",val);
|
||||
}
|
||||
return;
|
||||
case CMD_SETTYPERATE:
|
||||
|
@ -159,7 +159,7 @@ static void write_p64(Bit32u port,Bit8u val) {
|
|||
keyb.active=false;
|
||||
break;
|
||||
default:
|
||||
LOG_DEBUG("Port 64 write with val %d",val);
|
||||
LOG(LOG_ERROR|LOG_KEYBOARD,"Port 64 write with val %d",val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ void KEYBOARD_AddEvent(Bitu keytype,Bitu state,KEYBOARD_EventHandler * handler)
|
|||
KeyEvent * newevent=new KeyEvent;
|
||||
/* Add the event in the correct key structure */
|
||||
if (keytype>=KBD_LAST) {
|
||||
LOG_ERROR("KEYBOARD:Illegal key %d for handler",keytype);
|
||||
LOG(LOG_ERROR|LOG_KEYBOARD,"Illegal key %d for handler",keytype);
|
||||
}
|
||||
newevent->next=event_handlers[keytype];
|
||||
event_handlers[keytype]=newevent;
|
||||
|
|
|
@ -89,11 +89,11 @@ void MEM_StrCopy(PhysPt off,char * data,Bitu size) {
|
|||
}
|
||||
|
||||
static Bit8u Illegal_ReadHandler(PhysPt pt) {
|
||||
LOG_ERROR("Illegal read from address %4X",pt);
|
||||
LOG(LOG_ERROR,"MEM:Illegal read from address %4X",pt);
|
||||
return 0;
|
||||
}
|
||||
static void Illegal_WriteHandler(PhysPt pt,Bit8u val) {
|
||||
LOG_ERROR("Illegal write val %2X to address %4X",val,pt);
|
||||
LOG(LOG_ERROR,"Illegal write val %2X to address %4X",val,pt);
|
||||
}
|
||||
|
||||
/* Could only be called when the pt host entry is 0 ah well :) */
|
||||
|
@ -129,7 +129,7 @@ void MEM_ClearPageHandlers(Bitu startpage,Bitu pages) {
|
|||
void MEM_SetupMapping(Bitu startpage,Bitu pages,void * data) {
|
||||
if (startpage+pages>=MAX_PAGE_LIMIT) E_Exit("Memory:Illegal page for handler");
|
||||
HostPt base=(HostPt)(data)-startpage*PAGE_SIZE;
|
||||
if (!base) LOG_DEBUG("MEMORY:Unlucky memory allocation");
|
||||
if (!base) LOG_MSG("MEMORY:Unlucky memory allocation");
|
||||
for (Bitu i=startpage;i<startpage+pages;i++) {
|
||||
ReadHostTable[i]=base;
|
||||
WriteHostTable[i]=base;
|
||||
|
|
|
@ -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
|
||||
|
@ -141,7 +141,7 @@ static void write_p21(Bit32u port,Bit8u val) {
|
|||
};
|
||||
break;
|
||||
case 1: /* icw2 */
|
||||
LOG_DEBUG("PIC0:Base vector %X",val);
|
||||
LOG(LOG_PIC,"PIC0:Base vector %X",val);
|
||||
for (i=0;i<=7;i++) {
|
||||
irqs[i].vector=(val&0xf8)+i;
|
||||
};
|
||||
|
@ -377,7 +377,7 @@ static void AddEntry(PICEntry * entry) {
|
|||
|
||||
void PIC_AddEvent(PIC_EventHandler handler,Bitu delay) {
|
||||
if (!pic.free_entry) {
|
||||
LOG_WARN("PIC:No free queue entries");
|
||||
LOG(LOG_ERROR|LOG_PIC,"Event queue full");
|
||||
return;
|
||||
}
|
||||
PICEntry * entry=pic.free_entry;
|
||||
|
@ -392,7 +392,7 @@ void PIC_AddEvent(PIC_EventHandler handler,Bitu delay) {
|
|||
void PIC_AddIRQ(Bitu irq,Bitu delay) {
|
||||
if (irq>15) E_Exit("PIC:Illegal IRQ");
|
||||
if (!pic.free_entry) {
|
||||
LOG_WARN("PIC:No free queue entries");
|
||||
LOG(LOG_ERROR|LOG_PIC,"Event queue full");
|
||||
return;
|
||||
}
|
||||
PICEntry * entry=pic.free_entry;
|
||||
|
|
|
@ -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
|
||||
|
@ -29,12 +29,6 @@
|
|||
|
||||
#define SB_PIC_EVENTS 0
|
||||
|
||||
#if DEBUG_SBLASTER
|
||||
#define SB_DEBUG S_Warn
|
||||
#else
|
||||
#define SB_DEBUG
|
||||
#endif
|
||||
|
||||
#define DSP_MAJOR 2
|
||||
#define DSP_MINOR 0
|
||||
|
||||
|
@ -349,9 +343,8 @@ static void GenerateSound(Bitu size) {
|
|||
}
|
||||
}
|
||||
if (sb.out.pos>SB_BUF_SIZE) {
|
||||
LOG_WARN("Buffer full?");
|
||||
LOG(LOG_ERROR|LOG_SB,"Generation Buffer Full!!!!");
|
||||
sb.out.pos=0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,7 +407,7 @@ static void DSP_StartDMATranfser(DMA_MODES mode) {
|
|||
sb.tmp.add_index=(sb.dma.rate<<16)/sb.hw.rate;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("DSP:Illegal transfer mode %d",mode);
|
||||
LOG(LOG_ERROR|LOG_SB,"DSP:Illegal transfer mode %d",mode);
|
||||
return;
|
||||
}
|
||||
//TODO Use the 16-bit dma for 16-bit transfers
|
||||
|
@ -422,7 +415,7 @@ static void DSP_StartDMATranfser(DMA_MODES mode) {
|
|||
sb.dma.mode=mode;
|
||||
DMA_SetEnableCallBack(sb.hw.dma8,DMA_Enable);
|
||||
//TODO with stereo divide add_index
|
||||
SB_DEBUG("SB:DMA Transfer:%s rate %d size %d",type,sb.dma.rate,sb.dma.total);
|
||||
LOG(LOG_SB,"DMA Transfer:%s rate %d size %d",type,sb.dma.rate,sb.dma.total);
|
||||
}
|
||||
|
||||
static void DSP_AddData(Bit8u val) {
|
||||
|
@ -432,7 +425,7 @@ static void DSP_AddData(Bit8u val) {
|
|||
sb.dsp.out.data[start]=val;
|
||||
sb.dsp.out.used++;
|
||||
} else {
|
||||
LOG_ERROR("SB:DSP:Data Output buffer full this is weird");
|
||||
LOG(LOG_ERROR|LOG_SB,"DSP:Data Output buffer full");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -539,7 +532,7 @@ static void DSP_DoCommand(void) {
|
|||
break;
|
||||
case 0xe2: /* Weird DMA identification write routine */
|
||||
{
|
||||
LOG_WARN("Call 0xe2");
|
||||
LOG(LOG_SB,"DSP Function 0xe2");
|
||||
for (Bitu i = 0; i < 8; i++)
|
||||
if ((sb.dsp.in.data[0] >> i) & 0x01) sb.e2.value += E2_incr_table[sb.e2.count % 4][i];
|
||||
sb.e2.value += E2_incr_table[sb.e2.count % 4][8];
|
||||
|
@ -568,7 +561,7 @@ static void DSP_DoCommand(void) {
|
|||
PIC_AddIRQ(sb.hw.irq,0);
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("SB:DSP:Unhandled command %2X",sb.dsp.cmd);
|
||||
LOG(LOG_ERROR|LOG_SB,"DSP:Unhandled command %2X",sb.dsp.cmd);
|
||||
break;
|
||||
}
|
||||
sb.dsp.cmd=DSP_NO_COMMAND;
|
||||
|
@ -611,7 +604,7 @@ static void MIXER_Write(Bit8u val) {
|
|||
sb.mixer.master=val;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("SB:MIXER:Write to unhandled index %X",sb.mixer.index);
|
||||
LOG(LOG_ERROR|LOG_SB,"MIXER:Write to unhandled index %X",sb.mixer.index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -624,7 +617,7 @@ static Bit8u MIXER_Read(void) {
|
|||
ret=sb.mixer.master;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("SB:MIXER:Read from unhandled index %X",sb.mixer.index);
|
||||
LOG(LOG_ERROR|LOG_SB,"MIXER:Read from unhandled index %X",sb.mixer.index);
|
||||
ret=0xff;
|
||||
}
|
||||
return ret;
|
||||
|
@ -658,7 +651,7 @@ static Bit8u read_sb(Bit32u port) {
|
|||
case DSP_RESET:
|
||||
return 0xff;
|
||||
default:
|
||||
LOG_WARN("SB:Unhandled read from SB Port %4X",port);
|
||||
LOG(LOG_SB,"Unhandled read from SB Port %4X",port);
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
|
@ -687,13 +680,12 @@ static void write_sb(Bit32u port,Bit8u val) {
|
|||
break;
|
||||
|
||||
default:
|
||||
LOG_WARN("SB:Unhandled write to SB Port %4X",port);
|
||||
LOG(LOG_SB,"Unhandled write to SB Port %4X",port);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void SBLASTER_CallBack(Bit8u * stream,Bit32u len) {
|
||||
unsigned char tmpbuf[65536];
|
||||
if (!len) return;
|
||||
GenerateSound(len);
|
||||
memcpy(stream,sb.out.buf,len*4);
|
||||
|
@ -702,7 +694,6 @@ static void SBLASTER_CallBack(Bit8u * stream,Bit32u len) {
|
|||
sb.out.pos-=len;
|
||||
}
|
||||
else sb.out.pos=0;
|
||||
//TODO Copy remainder
|
||||
if (sb.mode==MODE_NONE) DSP_SetSpeaker(false);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -99,7 +99,7 @@ static void write_pc0(Bit32u port,Bit8u val) {
|
|||
// tandy.chan[tandy.reg>>1].freq_pos=0;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("TANDY:Illegal dual byte reg %d",tandy.reg);
|
||||
LOG(0,"TANDY:Illegal dual byte reg %d",tandy.reg);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ static void counter_latch(Bitu counter) {
|
|||
p->read_latch=(Bit16u)(p->cntr-(((float)micro/(float)p->micro)*(float)p->cntr));
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("PIT:Illegal Mode %d for reading counter %d",p->mode,counter);
|
||||
LOG(LOG_ERROR|LOG_PIT,"Illegal Mode %d for reading counter %d",p->mode,counter);
|
||||
micro%=p->micro;
|
||||
p->read_latch=(Bit16u)(p->cntr-(((float)micro/(float)p->micro)*(float)p->cntr));
|
||||
break;
|
||||
|
@ -109,14 +109,14 @@ static void write_latch(Bit32u port,Bit8u val) {
|
|||
case 0x00: /* Timer hooked to IRQ 0 */
|
||||
PIC_RemoveEvents(PIT0_Event);
|
||||
PIC_AddEvent(PIT0_Event,p->micro);
|
||||
LOG_DEBUG("PIT 0 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,p->mode);
|
||||
LOG(LOG_PIT,"PIT 0 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,p->mode);
|
||||
break;
|
||||
case 0x02: /* Timer hooked to PC-Speaker */
|
||||
// LOG_DEBUG("PIT 2 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,p->mode);
|
||||
PCSPEAKER_SetCounter(p->cntr,p->mode);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("PIT:Illegal timer selected for writing");
|
||||
LOG(LOG_ERROR|LOG_PIT,"PIT:Illegal timer selected for writing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -56,7 +56,7 @@ static void VGA_DrawHandler(RENDER_Part_Handler part_handler) {
|
|||
Bitu stop=vga.config.line_compare;
|
||||
if (vga.draw.double_height) stop/=2;
|
||||
if (stop>=vga.draw.height){
|
||||
LOG_VGA("Split at %d",stop);
|
||||
LOG(LOG_VGAGFX,"Split at %d",stop);
|
||||
goto drawnormal;
|
||||
}
|
||||
switch (vga.mode) {
|
||||
|
@ -73,7 +73,7 @@ static void VGA_DrawHandler(RENDER_Part_Handler part_handler) {
|
|||
bufsplit=memory+0xa0000;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("VGA:Unhandled split screen mode %d",vga.mode);
|
||||
LOG(LOG_VGAGFX,"VGA:Unhandled split screen mode %d",vga.mode);
|
||||
goto norender;
|
||||
}
|
||||
part_handler(buf,0,0,vga.draw.width,stop);
|
||||
|
@ -161,8 +161,8 @@ static void VGA_DoResize(void) {
|
|||
/* Check for pixel doubling, master clock/2 */
|
||||
if (vga.seq.clocking_mode & 0x8) clock/=2;
|
||||
|
||||
LOG_VGA("H total %d, V Total %d",htotal,vtotal);
|
||||
LOG_VGA("H D End %d, V D End %d",hdispend,vdispend);
|
||||
LOG(LOG_VGA,"H total %d, V Total %d",htotal,vtotal);
|
||||
LOG(LOG_VGA,"H D End %d, V D End %d",hdispend,vdispend);
|
||||
fps=clock/(vtotal*htotal);
|
||||
|
||||
vga.draw.resizing=false;
|
||||
|
@ -221,8 +221,8 @@ static void VGA_DoResize(void) {
|
|||
vga.draw.height=height;
|
||||
vga.draw.pitch=pitch;
|
||||
|
||||
LOG_VGA("Width %d, Height %d",width,height);
|
||||
LOG_VGA("Flags %X, fps %f",flags,fps);
|
||||
LOG(LOG_VGA,"Width %d, Height %d",width,height);
|
||||
LOG(LOG_VGA,"Flags %X, fps %f",flags,fps);
|
||||
RENDER_SetSize(width,height,8,pitch,((float)width/(float)height),flags,&VGA_DrawHandler);
|
||||
vga.draw.blank=(Bitu)(1000000/fps);
|
||||
PIC_AddEvent(VGA_BlankTimer,vga.draw.blank);
|
||||
|
|
|
@ -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
|
||||
|
@ -266,11 +266,6 @@ extern Bit32u CGAWriteTable[256];
|
|||
extern Bit32u Expand16Table[4][16];
|
||||
extern Bit32u Expand16BigTable[0x10000];
|
||||
|
||||
#if DEBUG_VGA
|
||||
#define LOG_VGA LOG_DEBUG
|
||||
#else
|
||||
#define LOG_VGA
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -122,10 +122,10 @@ void write_p3c0(Bit32u port,Bit8u val) {
|
|||
except in 256 color mode.
|
||||
Note: this register does not affect 256 color modes.
|
||||
*/
|
||||
if (val) LOG_DEBUG("VGA:ATTR:DAC index set to %d",val);
|
||||
if (val) LOG(LOG_VGAGFX,"VGA:ATTR:DAC index set to %d",val);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:ATTR:Write to unkown Index %2X",attr(index));
|
||||
LOG(LOG_VGAMISC,"VGA:ATTR:Write to unkown Index %2X",attr(index));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ Bit8u read_p3c1(Bit32u port) {
|
|||
case 0x14: /* Color Select Register */
|
||||
return attr(color_select);
|
||||
default:
|
||||
LOG_ERROR("VGA:ATTR:Read from unkown Index %2X",attr(index));
|
||||
LOG(LOG_VGAMISC,"VGA:ATTR:Read from unkown Index %2X",attr(index));
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -274,7 +274,7 @@ void write_p3d5(Bit32u port,Bit8u val) {
|
|||
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:CRTC:Write to unknown index %2X",val,crtc(index));
|
||||
LOG(LOG_VGAMISC,"VGA:CRTC:Write to unknown index %2X",val,crtc(index));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ Bit8u read_p3d5(Bit32u port) {
|
|||
case 0x18: /* Line Compare Register */
|
||||
return crtc(line_compare);
|
||||
default:
|
||||
LOG_ERROR("VGA:CRTC:Read from unknown index %X",crtc(index));
|
||||
LOG(LOG_VGAMISC,"VGA:CRTC:Read from unknown index %X",crtc(index));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -54,7 +54,7 @@ enum {DAC_READ,DAC_WRITE};
|
|||
|
||||
|
||||
static void write_p3c6(Bit32u port,Bit8u val) {
|
||||
if (val!=0xff) LOG_ERROR("VGA:Pel Mask not 0xff");
|
||||
if (val!=0xff) LOG(LOG_VGAGFX,"VGA:Pel Mask not 0xff");
|
||||
vga.dac.pel_mask=val;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ static void write_p3c9(Bit32u port,Bit8u val) {
|
|||
vga.dac.pel_index=0;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
|
||||
LOG(LOG_VGAGFX,"VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ static Bit8u read_p3c9(Bit32u port) {
|
|||
vga.dac.pel_index=0;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
|
||||
LOG(LOG_VGAMISC,"VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -70,7 +70,7 @@ void write_p3cf(Bit32u port,Bit8u val) {
|
|||
case 3: /* Data Rotate */
|
||||
gfx(data_rotate)=val;
|
||||
vga.config.data_rotate=val & 7;
|
||||
if (vga.config.data_rotate) LOG_WARN("VGA:Data Rotate used %d",val &7);
|
||||
if (vga.config.data_rotate) LOG(LOG_VGAGFX,"VGA:Data Rotate used %d",val &7);
|
||||
vga.config.raster_op=(val>>3) & 3;
|
||||
/*
|
||||
0-2 Number of positions to rotate data right before it is written to
|
||||
|
@ -171,12 +171,12 @@ void write_p3cf(Bit32u port,Bit8u val) {
|
|||
case 9: /* Unknown */
|
||||
/* Crystal Dreams seems to like to write tothis register very weird */
|
||||
if (!index9warned) {
|
||||
LOG_WARN("VGA:3CF:Write %2X to illegal index 9",val);
|
||||
LOG(LOG_VGAMISC,"VGA:3CF:Write %2X to illegal index 9",val);
|
||||
index9warned=true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("VGA:3CF:Write %2X to illegal index %2X",val,gfx(index));
|
||||
LOG(LOG_VGAMISC,"VGA:3CF:Write %2X to illegal index %2X",val,gfx(index));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ switch (gfx(index)) {
|
|||
case 8: /* Bit Mask Register */
|
||||
return gfx(bit_mask);
|
||||
default:
|
||||
LOG_WARN("Reading from illegal index %2X in port %4X",gfx(index),port);
|
||||
LOG(LOG_VGAMISC,"Reading from illegal index %2X in port %4X",gfx(index),port);
|
||||
}
|
||||
return 0; /* Compiler happy */
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -86,7 +86,7 @@ INLINE static Bit32u ModeOperation(Bit8u val) {
|
|||
full=RasterOp(vga.config.full_set_reset,ExpandTable[val] & vga.config.full_bit_mask);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:Unsupported write mode %d",vga.config.write_mode);
|
||||
LOG(LOG_VGAMISC,"VGA:Unsupported write mode %d",vga.config.write_mode);
|
||||
}
|
||||
return full;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -48,7 +48,7 @@ static Bit8u read_p3da(Bit32u port) {
|
|||
|
||||
|
||||
static void write_p3d8(Bit32u port,Bit8u val) {
|
||||
LOG_DEBUG("Write %2X to 3da",val);
|
||||
LOG(LOG_VGAMISC,"Write %2X to 3da",val);
|
||||
/*
|
||||
3 Vertical Sync Select. If set Vertical Sync to the monitor is the
|
||||
logical OR of the vertical sync and the vertical display enable.
|
||||
|
|
|
@ -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
|
||||
|
@ -91,7 +91,7 @@ void write_p3c5(Bit32u port,Bit8u val) {
|
|||
VGA_FindSettings();
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("VGA:SEQ:Write to illegal index %2X",seq(index));
|
||||
LOG(LOG_VGAMISC,"VGA:SEQ:Write to illegal index %2X",seq(index));
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -113,7 +113,7 @@ Bit8u read_p3c5(Bit32u port) {
|
|||
case 4: /* Memory Mode */
|
||||
return seq(memory_mode);
|
||||
default:
|
||||
LOG_ERROR("VGA:SEQ:Read from illegal index %2X",seq(index));
|
||||
LOG(LOG_VGAMISC,"VGA:SEQ:Read from illegal index %2X",seq(index));
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -44,18 +44,18 @@ static Bitu INT1A_Handler(void) {
|
|||
case 0x02: /* GET REAL-TIME CLOCK TIME (AT,XT286,PS) */
|
||||
reg_dx=reg_cx=0;
|
||||
CALLBACK_SCF(false);
|
||||
LOG_WARN("INT1A:02:Faked RTC get time call");
|
||||
LOG(LOG_BIOS,"INT1A:02:Faked RTC get time call");
|
||||
break;
|
||||
case 0x04: /* GET REAL-TIME ClOCK DATA (AT,XT286,PS) */
|
||||
reg_dx=reg_cx=0;
|
||||
CALLBACK_SCF(false);
|
||||
LOG_WARN("INT1A:04:Faked RTC get date call");
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT1A:04:Faked RTC get date call");
|
||||
break;
|
||||
case 0x80: /* Pcjr Setup Sound Multiplexer */
|
||||
LOG_WARN("INT1A:80:Setup tandy sound multiplexer to %d",reg_al);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT1A:80:Setup tandy sound multiplexer to %d",reg_al);
|
||||
break;
|
||||
case 0x81: /* Tandy sound system checks */
|
||||
LOG_WARN("INT1A:81:Tandy DAC Check failing");
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT1A:81:Tandy DAC Check failing");
|
||||
break;
|
||||
/*
|
||||
INT 1A - Tandy 2500, Tandy 1000L series - DIGITAL SOUND - INSTALLATION CHECK
|
||||
|
@ -68,7 +68,7 @@ static Bitu INT1A_Handler(void) {
|
|||
clear on return, then call AH=84h"Tandy"
|
||||
*/
|
||||
default:
|
||||
LOG_WARN("INT1A:Undefined call %2X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT1A:Undefined call %2X",reg_ah);
|
||||
}
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ static Bitu INT11_Handler(void) {
|
|||
internal modem installed (PC/Convertible)
|
||||
14-15 number of parallel ports installed
|
||||
*/
|
||||
reg_eax=0x104D;
|
||||
reg_ax=0x104D;
|
||||
LOG(LOG_BIOS,"INT11:Equipment list returned %X",reg_ax);
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
|
@ -132,7 +133,7 @@ static Bitu INT12_Handler(void) {
|
|||
};
|
||||
|
||||
static Bitu INT17_Handler(void) {
|
||||
LOG_ERROR("INT17:Not supported call for bios printer support");
|
||||
LOG(LOG_BIOS,"INT17:Function %X",reg_ah);
|
||||
switch(reg_ah) {
|
||||
case 0x00: /* PRINTER: Write Character */
|
||||
reg_ah=1; /* Report a timeout */
|
||||
|
@ -146,7 +147,7 @@ static Bitu INT17_Handler(void) {
|
|||
E_Exit("Unhandled INT 17 call %2X",reg_ah);
|
||||
};
|
||||
return CBRET_NONE;
|
||||
};
|
||||
}
|
||||
|
||||
static void WaitFlagEvent(void) {
|
||||
PhysPt where=Real2Phys(mem_readd(BIOS_WAIT_FLAG_POINTER));
|
||||
|
@ -157,10 +158,10 @@ static void WaitFlagEvent(void) {
|
|||
static Bitu INT15_Handler(void) {
|
||||
switch (reg_ah) {
|
||||
case 0x06:
|
||||
LOG_WARN("Calling unkown int15 function 6");
|
||||
LOG(LOG_BIOS,"INT15 Unkown Function 6");
|
||||
break;
|
||||
case 0xC0: /* Get Configuration*/
|
||||
LOG_WARN("Request BIOS Configuration INT 15 C0");
|
||||
LOG(LOG_ERROR|LOG_BIOS,"Request BIOS Configuration INT 15 C0");
|
||||
CALLBACK_SCF(true);
|
||||
break;
|
||||
case 0x4f: /* BIOS - Keyboard intercept */
|
||||
|
@ -198,7 +199,7 @@ static Bitu INT15_Handler(void) {
|
|||
CALLBACK_SCF(true);
|
||||
}
|
||||
} else {
|
||||
LOG_WARN("INT15:84: Unknown Bios Joystick functionality.");
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT15:84:Unknown Bios Joystick functionality.");
|
||||
}
|
||||
break;
|
||||
case 0x86: /* BIOS - WAIT (AT,PS) */
|
||||
|
@ -220,18 +221,16 @@ static Bitu INT15_Handler(void) {
|
|||
reg_ah=0;
|
||||
break;
|
||||
case 0xc2: /* BIOS PS2 Pointing Device Support */
|
||||
case 0xc4: /* BIOS POS Programma option Select */
|
||||
/*
|
||||
Damn programs should use the mouse drivers
|
||||
So let's fail these calls
|
||||
*/
|
||||
CALLBACK_SCF(true);
|
||||
break;
|
||||
case 0xc4: /* BIOS POS Programma option Select */
|
||||
LOG_WARN("INT15:C4:Call for POS Function %2x",reg_al);
|
||||
LOG(LOG_BIOS,"INT15:Function %X called,bios mouse not supported",reg_ah);
|
||||
CALLBACK_SCF(true);
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("INT15:Unknown call %2X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT15:Unknown call %2X",reg_ah);
|
||||
reg_ah=0x86;
|
||||
CALLBACK_SCF(false);
|
||||
}
|
||||
|
@ -242,7 +241,7 @@ static Bitu INT1_Single_Step(void) {
|
|||
static bool warned=false;
|
||||
if (!warned) {
|
||||
warned=true;
|
||||
LOG_WARN("INT 1:Single Step called");
|
||||
LOG(LOG_CPU,"INT 1:Single Step called");
|
||||
}
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -34,10 +34,10 @@ static Bitu INT13_SmallHandler(void) {
|
|||
case 0x0:
|
||||
reg_ah=0x00;
|
||||
CALLBACK_SCF(false);
|
||||
LOG_DEBUG("reset disk return succesfull");
|
||||
LOG(LOG_BIOS,"reset disk return succesfull");
|
||||
break;
|
||||
case 0x02: /* Read Disk Sectors */
|
||||
LOG_DEBUG("INT13:02:Read Disk Sectors not supported failing");
|
||||
LOG(LOG_BIOS,"INT13:02:Read Disk Sectors not supported failing");
|
||||
reg_ah=0x80;
|
||||
CALLBACK_SCF(true);
|
||||
break;
|
||||
|
@ -50,17 +50,17 @@ static Bitu INT13_SmallHandler(void) {
|
|||
reg_ah=0x80;
|
||||
CALLBACK_SCF(true);
|
||||
}
|
||||
LOG_DEBUG("INT 13:04 Verify sector used on %d, with result %d",reg_dl,reg_ah);
|
||||
LOG(LOG_BIOS,"INT 13:04 Verify sector used on %d, with result %d",reg_dl,reg_ah);
|
||||
break;
|
||||
|
||||
case 0x08: /* Get Drive Parameters */
|
||||
LOG_DEBUG("INT13:08:Get Drive parameters not supported failing");
|
||||
LOG(LOG_BIOS,"INT13:08:Get Drive parameters not supported failing");
|
||||
reg_ah=0xff;
|
||||
CALLBACK_SCF(true);
|
||||
break;
|
||||
case 0xff:
|
||||
default:
|
||||
LOG_WARN("Illegal int 13h call %2X Fail it",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"Illegal int 13h call %2X Fail it",reg_ah);
|
||||
reg_ah=0xff;
|
||||
CALLBACK_SCF(true);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -312,8 +312,7 @@ static Bitu INT16_Handler(void) {
|
|||
reg_al=mem_readb(BIOS_KEYBOARD_FLAGS1);
|
||||
break;
|
||||
case 0x03: /* SET TYPEMATIC RATE AND DELAY */
|
||||
//Have to implement this trhough SDL
|
||||
LOG_DEBUG("INT16:Unhandled Typematic Rate Call %2X",reg_al);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT16:Unhandled Typematic Rate Call %2X",reg_al);
|
||||
break;
|
||||
case 0x05: /* STORE KEYSTROKE IN KEYBOARD BUFFER */
|
||||
//TODO make add_key bool :)
|
||||
|
@ -326,10 +325,10 @@ static Bitu INT16_Handler(void) {
|
|||
break;
|
||||
case 0x55:
|
||||
/* Weird call used by some dos apps */
|
||||
LOG_DEBUG("INT16:55:Word TSR compatible call");
|
||||
LOG(LOG_BIOS,"INT16:55:Word TSR compatible call");
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("INT16:Unhandled call %02X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_BIOS,"INT16:Unhandled call %02X",reg_ah);
|
||||
break;
|
||||
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
device_EMM(){name="EMMXXXX0";}
|
||||
bool Read(Bit8u * data,Bit16u * size) { return false;}
|
||||
bool Write(Bit8u * data,Bit16u * size){
|
||||
LOG_DEBUG("Write to ems device");
|
||||
LOG(LOG_IOCTL,"EMS:Write to device");
|
||||
return false;
|
||||
}
|
||||
bool Seek(Bit32u * pos,Bit32u type){return false;}
|
||||
|
@ -367,7 +367,7 @@ static Bit8u EMM_PartialPageMapping(void) {
|
|||
reg_al=2+reg_bx*(2+sizeof(EMM_Mapping));
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
return EMM_FUNC_NOSUP;
|
||||
}
|
||||
return EMM_NO_ERROR;
|
||||
|
@ -391,7 +391,7 @@ static Bit8u HandleNameSearch(void) {
|
|||
reg_bx=EMM_MAX_HANDLES;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
return EMM_FUNC_NOSUP;
|
||||
}
|
||||
return EMM_NO_ERROR;
|
||||
|
@ -417,7 +417,7 @@ static Bit8u MemoryRegion(void) {
|
|||
Bit8u buf_src[EMM_PAGE_SIZE];
|
||||
Bit8u buf_dest[EMM_PAGE_SIZE];
|
||||
if (reg_al>1) {
|
||||
LOG_ERROR("EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
return EMM_FUNC_NOSUP;
|
||||
}
|
||||
LoadMoveRegion(SegPhys(ds)+reg_si,region);
|
||||
|
@ -578,7 +578,7 @@ static Bitu INT67_Handler(void) {
|
|||
reg_ah=EMM_NO_ERROR;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Call %2X Subfunction %2X not supported",reg_ah,reg_al);
|
||||
reg_ah=EMM_FUNC_NOSUP;
|
||||
break;
|
||||
}
|
||||
|
@ -615,7 +615,7 @@ static Bitu INT67_Handler(void) {
|
|||
break;
|
||||
case 0x53: // Set/Get Handlename
|
||||
if (reg_al==0x00) { // Get Name not supported
|
||||
LOG_ERROR("EMS:Get handle name not supported",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Get handle name not supported",reg_ah);
|
||||
reg_ah=EMM_FUNC_NOSUP;
|
||||
} else { // Set name, not supported but faked
|
||||
reg_ah=EMM_NO_ERROR;
|
||||
|
@ -626,7 +626,7 @@ static Bitu INT67_Handler(void) {
|
|||
break;
|
||||
case 0x57: /* Memory region */
|
||||
reg_ah=MemoryRegion();
|
||||
if (reg_ah) LOG_WARN("ems 57 move failed");
|
||||
if (reg_ah) LOG(LOG_ERROR,"EMS:Function 57 move failed");
|
||||
break;
|
||||
case 0x58: // Get mappable physical array address array
|
||||
if (reg_al==0x00) {
|
||||
|
@ -642,11 +642,12 @@ static Bitu INT67_Handler(void) {
|
|||
reg_ah = EMM_NO_ERROR;
|
||||
break;
|
||||
case 0xDE: /* VCPI Functions */
|
||||
LOG_ERROR("VCPI Functions %X not supported",reg_al);
|
||||
errorlevel=1;
|
||||
E_Exit("Protected mode not supported");
|
||||
reg_ah=EMM_FUNC_NOSUP;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("EMS:Call %2X not supported",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_MISC,"EMS:Call %2X not supported",reg_ah);
|
||||
reg_ah=EMM_FUNC_NOSUP;
|
||||
break;
|
||||
}
|
||||
|
@ -660,7 +661,7 @@ void EMS_Init(Section* sec) {
|
|||
Bitu size=section->Get_int("emssize");
|
||||
if (!size) return;
|
||||
if ((size*(1024/16))>EMM_MAX_PAGES) {
|
||||
LOG_DEBUG("EMS Max size is %d",EMM_MAX_PAGES/(1024/16));
|
||||
LOG_MSG("EMS Max size is %d",EMM_MAX_PAGES/(1024/16));
|
||||
emm_page_count=EMM_MAX_PAGES;
|
||||
} else {
|
||||
emm_page_count=size*(1024/16);
|
||||
|
|
|
@ -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
|
||||
|
@ -42,7 +42,7 @@ static Bitu INT10_Handler(void) {
|
|||
break;
|
||||
case 0x01: /* Set TextMode Cursor Shape */
|
||||
vga.internal.cursor=reg_cx; // maybe write some memory somewhere
|
||||
LOG_DEBUG("INT10:01:Set textmode cursor shape partially supported: %X",reg_cx);
|
||||
LOG(LOG_INT10,"INT10:01:Set textmode cursor shape partially supported: %X",reg_cx);
|
||||
break;
|
||||
case 0x02: /* Set Cursor Pos */
|
||||
//TODO Check some shit but not really usefull
|
||||
|
@ -54,11 +54,11 @@ static Bitu INT10_Handler(void) {
|
|||
reg_dh=CURSOR_POS_ROW(reg_bh);
|
||||
break;
|
||||
case 0x04: /* read light pen pos YEAH RIGHT */
|
||||
LOG_WARN("INT10:04:Ligthpen not supported");
|
||||
/* Light pen is not supported */
|
||||
reg_ah=0;
|
||||
break;
|
||||
case 0x05: /* Set Active Page */
|
||||
if (reg_al & 0x80) LOG_DEBUG("Func %x",reg_al);
|
||||
if (reg_al & 0x80) LOG(LOG_INT10,"Func %x",reg_al);
|
||||
else INT10_SetActivePage(reg_al);
|
||||
break;
|
||||
case 0x06: /* Scroll Up */
|
||||
|
@ -81,12 +81,10 @@ static Bitu INT10_Handler(void) {
|
|||
break;
|
||||
case 0x0B: /* Set Background/Border Colour & Set Palette*/
|
||||
if(!warned_int10_0b) {
|
||||
LOG_WARN("INT 10:0B Unsupported: Set Background/border colour & Set Pallete");
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function 0B Unsupported: Set Background/border colour & Set Pallete");
|
||||
warned_int10_0b=true;
|
||||
}
|
||||
break;
|
||||
E_Exit("Unsupported int 10 call %02X" ,reg_ah);
|
||||
break;
|
||||
case 0x0C: /* Write Graphics Pixel */
|
||||
INT10_PutPixel(reg_cx,reg_dx,reg_bh,reg_al);
|
||||
break;
|
||||
|
@ -137,7 +135,7 @@ static Bitu INT10_Handler(void) {
|
|||
INT10_GetDACBlock(reg_bx,reg_cx,SegPhys(es)+reg_dx);
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("INT10:10:Unhandled EGA/VGA Palette Function %2X",reg_al);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function 10:Unhandled EGA/VGA Palette Function %2X",reg_al);
|
||||
}
|
||||
break;
|
||||
case 0x11: /* Character generator functions */
|
||||
|
@ -182,12 +180,12 @@ static Bitu INT10_Handler(void) {
|
|||
break;
|
||||
default:
|
||||
reg_cx=16;
|
||||
LOG_DEBUG("INT10:11:30 Request for font %2X",reg_bh);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Fucntion 11:30 Request for font %2X",reg_bh);
|
||||
}
|
||||
reg_dl=real_readb(BIOSMEM_SEG,BIOSMEM_NB_ROWS);
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("INT10:11:Unsupported character generator call %2X",reg_al);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function 11:Unsupported character generator call %2X",reg_al);
|
||||
}
|
||||
break;
|
||||
case 0x12: /* alternate function select */
|
||||
|
@ -200,7 +198,7 @@ static Bitu INT10_Handler(void) {
|
|||
break;
|
||||
}
|
||||
default:
|
||||
LOG_WARN("Alternate functions select %2X not handled",reg_bl);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function 12:Call %2X not handled",reg_bl);
|
||||
}
|
||||
break;
|
||||
case 0x13: /* Write String */
|
||||
|
@ -217,7 +215,6 @@ static Bitu INT10_Handler(void) {
|
|||
reg_al=0x1A;
|
||||
break;
|
||||
}
|
||||
LOG_DEBUG("INT10:1A:Display Combination call %2X",reg_al);
|
||||
break;
|
||||
case 0x1B: /* functionality State Information */
|
||||
switch (reg_bx) {
|
||||
|
@ -226,15 +223,15 @@ static Bitu INT10_Handler(void) {
|
|||
reg_al=0x1B;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("INT10:1B:Unhandled call BX %2X",reg_bx);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function 1B:Unhandled call BX %2X",reg_bx);
|
||||
}
|
||||
break;
|
||||
case 0xff:
|
||||
if (!warned_ff) LOG_WARN("INT10:FF:Weird NC call");
|
||||
if (!warned_ff) LOG(LOG_INT10,"INT10:FF:Weird NC call");
|
||||
warned_ff=true;
|
||||
break;
|
||||
default:
|
||||
LOG_WARN("Unhandled INT 10 call %2X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_INT10,"Function %2X not supported",reg_ah);
|
||||
};
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
@ -273,8 +270,6 @@ void INT10_Init(Section* sec) {
|
|||
INT10_InitVGA();
|
||||
/* Setup the INT 10 vector */
|
||||
call_10=CALLBACK_Allocate();
|
||||
//TODO ERRORS ERRORS ERRORS
|
||||
if (call_10==-1) E_Exit("Error can't allocate Video Int 10 CallBack\n");
|
||||
CALLBACK_Setup(call_10,&INT10_Handler,CB_IRET);
|
||||
RealSetVec(0x10,CALLBACK_RealPointer(call_10));
|
||||
//Init the 0x40 segment and init the datastructures in the the video rom area
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -266,7 +266,7 @@ INLINE static void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u at
|
|||
fontdata=&int10_font_16[chr*16];
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("INT10:Teletype Illegal Font Height");
|
||||
LOG(LOG_ERROR|LOG_INT10,"Teletype Illegal Font Height");
|
||||
return;
|
||||
}
|
||||
x=8*col;
|
||||
|
|
|
@ -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
|
||||
|
@ -259,7 +259,7 @@ void INT10_SetVideoMode(Bit8u mode) {
|
|||
mode&=mode & 127;
|
||||
line=FindVideoMode(mode);
|
||||
if (line==0xff) {
|
||||
LOG_ERROR("INT10:Trying to set non supported video mode %X",mode);
|
||||
LOG(LOG_ERROR|LOG_INT10,"INT10:Trying to set non supported video mode %X",mode);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ void INT10_SetVideoMode(Bit8u mode) {
|
|||
IO_Read(VGAREG_ACTL_RESET);
|
||||
|
||||
//Set the palette
|
||||
if ((modeset_ctl&0x08)==0x8) LOG_DEBUG("INT10:Mode set without palette");
|
||||
if ((modeset_ctl&0x08)==0x8) LOG(LOG_INT10,"Mode set without palette");
|
||||
if((modeset_ctl&0x08)==0) {
|
||||
// Set the PEL mask
|
||||
IO_Write(VGAREG_PEL_MASK,vga_modes[line].pelmask);
|
||||
|
|
|
@ -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
|
||||
|
@ -86,7 +86,7 @@ void INT10_PutPixel(Bit16u x,Bit16u y,Bit8u page,Bit8u color) {
|
|||
case CTEXT:
|
||||
case MTEXT:
|
||||
default:
|
||||
LOG_WARN("INT10:PutPixel Unhandled memory model %d",curmode->memmodel);
|
||||
LOG(LOG_ERROR|LOG_INT10,"PutPixel Unhandled memory model %d",curmode->memmodel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ void INT10_GetPixel(Bit16u x,Bit16u y,Bit8u page,Bit8u * color) {
|
|||
case CTEXT:
|
||||
case MTEXT:
|
||||
default:
|
||||
LOG_WARN("INT10:GetPixel Unhanled memory model");
|
||||
LOG(LOG_ERROR|LOG_INT10,"GetPixel Unhandled memory model %d",curmode->memmodel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -567,7 +567,7 @@ static Bitu INT33_Handler(void) {
|
|||
reg_cl=0; /* Hmm ps2 irq dunno */
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Mouse Function %2X",reg_ax);
|
||||
LOG(LOG_ERROR|LOG_MOUSE,"Mouse Function %2X",reg_ax);
|
||||
}
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -118,7 +118,7 @@ Bitu XMS_Handler(void) {
|
|||
case XMS_LOCAL_ENABLE_A20: /* 05 */
|
||||
case XMS_LOCAL_DISABLE_A20: /* 06 */
|
||||
case XMS_QUERY_A20: /* 07 */
|
||||
LOG_WARN("XMS:Unhandled call %2X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_MISC,"XMS:Unhandled call %2X",reg_ah);
|
||||
break;
|
||||
case XMS_QUERY_FREE_EXTENDED_MEMORY: /* 08 */
|
||||
/* Scan the tree for free memory and find largest free block */
|
||||
|
@ -316,7 +316,7 @@ foundnew:
|
|||
reg_dx=xms_handles[reg_dx].size;
|
||||
break;
|
||||
case XMS_RESIZE_EXTENDED_MEMORY_BLOCK: /* 0f */
|
||||
LOG_WARN("XMS:Unhandled call %2X",reg_ah);
|
||||
LOG(LOG_ERROR|LOG_MISC,"XMS:Unhandled call %2X",reg_ah);
|
||||
break;
|
||||
case XMS_ALLOCATE_UMB: /* 10 */
|
||||
reg_ax=0;
|
||||
|
@ -325,7 +325,8 @@ foundnew:
|
|||
break;
|
||||
case XMS_DEALLOCATE_UMB: /* 11 */
|
||||
default:
|
||||
LOG_WARN("XMS:Unhandled call %2X",reg_ah);break;
|
||||
LOG(LOG_ERROR|LOG_MISC,"XMS:Unhandled call %2X",reg_ah);
|
||||
break;
|
||||
|
||||
}
|
||||
return CBRET_NONE;
|
||||
|
|
|
@ -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
|
||||
|
@ -156,7 +156,6 @@ char * StripWord(char * cmd) {
|
|||
}
|
||||
|
||||
void GFX_ShowMsg(char * msg);
|
||||
void DEBUG_ShowMsg(char * msg);
|
||||
|
||||
void S_Warn(char * format,...) {
|
||||
char buf[1024];
|
||||
|
@ -166,7 +165,7 @@ void S_Warn(char * format,...) {
|
|||
vsprintf(buf,format,msg);
|
||||
va_end(msg);
|
||||
#if C_DEBUG
|
||||
DEBUG_ShowMsg(buf);
|
||||
DEBUG_ShowMsg(0,buf);
|
||||
#else
|
||||
GFX_ShowMsg(buf);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue