Change to logging - when logging is disabled, the logging functions are now #define'd to nothing, so the compiler ignores the lines that call them completely, seems to slightly speed up the emulator; note that the logging in vid_table.c has not been changed yet, because this file on my local tree currently contains other WIP changes.

This commit is contained in:
OBattler
2018-10-19 00:39:32 +02:00
parent d56df03a53
commit cfc626f111
78 changed files with 658 additions and 590 deletions

View File

@@ -8,7 +8,7 @@
#
# Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.130 2018/10/17
# Version: @(#)Makefile.mingw 1.0.131 2018/10/17
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -543,6 +543,7 @@ VIDOBJ := video.o \
vid_ti_cf62011.o \
vid_tvga.o \
vid_tgui9440.o vid_tkd8001_ramdac.o \
vid_v7vga.o \
vid_s3.o vid_s3_virge.o \
vid_sdac_ramdac.o \
vid_voodoo.o

View File

@@ -8,7 +8,7 @@
*
* Platform main support module for Windows.
*
* Version: @(#)win.c 1.0.53 2018/10/12
* Version: @(#)win.c 1.0.54 2018/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -107,13 +107,11 @@ static struct {
#ifdef ENABLE_WIN_LOG
int win_do_log = ENABLE_WIN_LOG;
#endif
static void
win_log(const char *fmt, ...)
{
#ifdef ENABLE_WIN_LOG
va_list ap;
if (win_do_log) {
@@ -121,8 +119,10 @@ win_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define win_log(fmt, ...)
#endif
static void

View File

@@ -1,4 +1,4 @@
/*
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
@@ -8,7 +8,7 @@
*
* Rendering module for Microsoft Direct2D.
*
* Version: @(#)win_d2d.cpp 1.0.1 2018/07/28
* Version: @(#)win_d2d.cpp 1.0.2 2018/10/18
*
* Authors: David Hrdlička, <hrdlickadavid@outlook.com>
*
@@ -52,13 +52,11 @@ static int d2d_width, d2d_height, d2d_screen_width, d2d_screen_height, d2d_fs;
#ifdef ENABLE_D2D_LOG
int d2d_do_log = ENABLE_D2D_LOG;
#endif
static void
d2d_log(const char *fmt, ...)
{
#ifdef ENABLE_D2D_LOG
va_list ap;
if (d2d_do_log) {
@@ -66,8 +64,10 @@ d2d_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define d2d_log(fmt, ...)
#endif
#ifdef USE_D2D

View File

@@ -11,7 +11,7 @@
* NOTES: This code should be re-merged into a single init() with a
* 'fullscreen' argument, indicating FS mode is requested.
*
* Version: @(#)win_ddraw.cpp 1.0.11 2018/10/10
* Version: @(#)win_ddraw.cpp 1.0.12 2018/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -60,13 +60,11 @@ static png_infop info_ptr;
#ifdef ENABLE_DDRAW_LOG
int ddraw_do_log = ENABLE_DDRAW_LOG;
#endif
static void
ddraw_log(const char *fmt, ...)
{
#ifdef ENABLE_DDRAW_LOG
va_list ap;
if (ddraw_do_log) {
@@ -74,8 +72,10 @@ ddraw_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define ddraw_log(fmt, ...)
#endif
static void

View File

@@ -8,7 +8,7 @@
*
* Try to load a support DLL.
*
* Version: @(#)win_dynld.c 1.0.7 2018/04/29
* Version: @(#)win_dynld.c 1.0.8 2018/10/18
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -28,13 +28,11 @@
#ifdef ENABLE_DYNLD_LOG
int dynld_do_log = ENABLE_DYNLD_LOG;
#endif
static void
dynld_log(const char *fmt, ...)
{
#ifdef ENABLE_DYNLD_LOG
va_list ap;
if (dynld_do_log) {
@@ -42,8 +40,10 @@ dynld_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define dynld_log(fmt, ...)
#endif
void *

View File

@@ -8,7 +8,7 @@
*
* Joystick interface to host device.
*
* Version: @(#)win_joystick.cpp 1.0.9 2018/04/29
* Version: @(#)win_joystick.cpp 1.0.10 2018/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -42,13 +42,11 @@ static GUID joystick_guids[MAX_JOYSTICKS];
#ifdef ENABLE_JOYSTICK_LOG
int joystick_do_log = ENABLE_JOYSTICK_LOG;
#endif
static void
joystick_log(const char *fmt, ...)
{
#ifdef ENABLE_JOYSTICK_LOG
va_list ap;
if (joystick_do_log) {
@@ -56,8 +54,10 @@ joystick_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define joystick_log(fmt, ...)
#endif
static BOOL CALLBACK joystick_enum_callback(LPCDIDEVICEINSTANCE lpddi, UNUSED(LPVOID data))

View File

@@ -12,7 +12,7 @@
* we will not use that, but, instead, use a new window which
* coverrs the entire desktop.
*
* Version: @(#)win_sdl.c 1.0.1 2018/10/10
* Version: @(#)win_sdl.c 1.0.2 2018/10/18
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Michael Dr<44>ing, <michael@drueing.de>
@@ -146,13 +146,11 @@ static dllimp_t sdl_imports[] = {
#ifdef ENABLE_SDL_LOG
int sdl_do_log = ENABLE_SDL_LOG;
#endif
static void
sdl_log(const char *fmt, ...)
{
#ifdef ENABLE_SDL_LOG
va_list ap;
if (sdl_do_log) {
@@ -160,8 +158,10 @@ sdl_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define sdl_log(fmt, ...)
#endif
static void