AppleWin/source/Log.cpp
TomCh a78f1e04da
SSC: Support for TX IRQ and other SSC updates (#552)
. Support TX IRQ for both TCP and COM modes (fixes #522)
. Support CTS/RTS (fixes #311)
. Fixed reading DIPSW registers
. Fixed TCP mode which was only generating an IRQ for first byte received
. Added UpdateCommandReg() to consolidate all updates to SSC command reg
. Updated reference URLs
2018-04-08 17:37:26 +01:00

63 lines
1.7 KiB
C++

/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 1994-1996, Michael O'Brien
Copyright (C) 1999-2001, Oliver Schmidt
Copyright (C) 2002-2005, Tom Charlesworth
Copyright (C) 2006-2007, Tom Charlesworth, Michael Pohoreski, Nick Westgate
AppleWin 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.
AppleWin 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Description: Log
*
* Author: Nick Westgate
*/
#include "StdAfx.h"
FILE* g_fh = NULL;
//---------------------------------------------------------------------------
void LogOutput(LPCTSTR format, ...)
{
TCHAR output[256];
va_list args;
va_start(args, format);
_vsntprintf(output, sizeof(output) - 1, format, args);
output[sizeof(output) - 1] = 0;
OutputDebugString(output);
}
//---------------------------------------------------------------------------
void LogFileOutput(LPCTSTR format, ...)
{
if (!g_fh)
return;
TCHAR output[256];
va_list args;
va_start(args, format);
_vsntprintf(output, sizeof(output) - 1, format, args);
output[sizeof(output) - 1] = 0;
fprintf(g_fh, "%s", output);
}