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
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue