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 @@
*
* Common code to handle all sorts of disk controllers.
*
* Version: @(#)hdc.c 1.0.15 2018/04/29
* Version: @(#)hdc.c 1.0.16 2018/10/17
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -36,13 +36,11 @@ int hdc_current;
#ifdef ENABLE_HDC_LOG
int hdc_do_log = ENABLE_HDC_LOG;
#endif
static void
hdc_log(const char *fmt, ...)
{
#ifdef ENABLE_HDC_LOG
va_list ap;
if (hdc_do_log) {
@@ -50,8 +48,10 @@ hdc_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define hdc_log(fmt, ...)
#endif
static void *

View File

@@ -8,7 +8,7 @@
*
* Driver for the ESDI controller (WD1007-vse1) for PC/AT.
*
* Version: @(#)hdc_esdi_at.c 1.0.13 2018/05/02
* Version: @(#)hdc_esdi_at.c 1.0.14 2018/10/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -108,13 +108,11 @@ typedef struct {
#ifdef ENABLE_ESDI_AT_LOG
int esdi_at_do_log = ENABLE_ESDI_AT_LOG;
#endif
static void
esdi_at_log(const char *fmt, ...)
{
#ifdef ENABLE_ESDI_AT_LOG
va_list ap;
if (esdi_at_do_log) {
@@ -122,8 +120,10 @@ esdi_at_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define esdi_at_log(fmt, ...)
#endif
static inline void

View File

@@ -52,7 +52,7 @@
* however, are auto-configured by the system software as
* shown above.
*
* Version: @(#)hdc_esdi_mca.c 1.0.13 2018/04/29
* Version: @(#)hdc_esdi_mca.c 1.0.14 2018/10/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -196,13 +196,11 @@ typedef struct esdi {
#ifdef ENABLE_ESDI_MCA_LOG
int esdi_mca_do_log = ENABLE_ESDI_MCA_LOG;
#endif
static void
esdi_mca_log(const char *fmt, ...)
{
#ifdef ENABLE_ESDI_MCA_LOG
va_list ap;
if (esdi_mca_do_log) {
@@ -210,8 +208,10 @@ esdi_mca_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define esdi_mca_log(fmt, ...)
#endif
static __inline void

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.)
*
* Version: @(#)hdc_mfm_at.c 1.0.17 2018/05/02
* Version: @(#)hdc_mfm_at.c 1.0.18 2018/10/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -114,13 +114,11 @@ typedef struct {
#ifdef ENABLE_MFM_AT_LOG
int mfm_at_do_log = ENABLE_MFM_AT_LOG;
#endif
static void
mfm_at_log(const char *fmt, ...)
{
#ifdef ENABLE_MFM_AT_LOG
va_list ap;
if (mfm_at_do_log) {
@@ -128,8 +126,10 @@ mfm_at_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define mfm_at_log(fmt, ...)
#endif
static inline void

View File

@@ -41,7 +41,7 @@
* Since all controllers (including the ones made by DTC) use
* (mostly) the same API, we keep them all in this module.
*
* Version: @(#)hdc_mfm_xt.c 1.0.17 2018/04/29
* Version: @(#)hdc_mfm_xt.c 1.0.18 2018/10/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -157,13 +157,11 @@ typedef struct {
#ifdef ENABLE_MFM_XT_LOG
int mfm_xt_do_log = ENABLE_MFM_XT_LOG;
#endif
static void
mfm_xt_log(const char *fmt, ...)
{
#ifdef ENABLE_MFM_XT_LOG
va_list ap;
if (mfm_xt_do_log) {
@@ -171,8 +169,10 @@ mfm_xt_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define mfm_xt_log(fmt, ...)
#endif
static uint8_t

View File

@@ -46,7 +46,7 @@
*
* NOTE: The XTA interface is 0-based for sector numbers !!
*
* Version: @(#)hdc_ide_xta.c 1.0.8 2018/04/29
* Version: @(#)hdc_ide_xta.c 1.0.9 2018/10/17
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -281,13 +281,11 @@ typedef struct {
#ifdef ENABLE_XTA_LOG
int xta_do_log = ENABLE_XTA_LOG;
#endif
static void
xta_log(const char *fmt, ...)
{
#ifdef ENABLE_XTA_LOG
va_list ap;
if (xta_do_log) {
@@ -295,8 +293,10 @@ xta_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define xta_log(fmt, ...)
#endif
static void

View File

@@ -8,7 +8,7 @@
*
* Handling of hard disk image files.
*
* Version: @(#)hdd_image.c 1.0.18 2018/10/08
* Version: @(#)hdd_image.c 1.0.19 2018/10/17
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -72,13 +72,11 @@ static char *empty_sector_1mb;
#ifdef ENABLE_HDD_IMAGE_LOG
int hdd_image_do_log = ENABLE_HDD_IMAGE_LOG;
#endif
static void
hdd_image_log(const char *fmt, ...)
{
#ifdef ENABLE_HDD_IMAGE_LOG
va_list ap;
if (hdd_image_do_log) {
@@ -86,8 +84,10 @@ hdd_image_log(const char *fmt, ...)
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define hdd_image_log(fmt, ...)
#endif
int

View File

@@ -9,7 +9,7 @@
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)zip.c 1.0.26 2018/10/09
* Version: @(#)zip.c 1.0.27 2018/10/17
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -458,22 +458,22 @@ static void zip_callback(void *p);
#ifdef ENABLE_ZIP_LOG
int zip_do_log = ENABLE_ZIP_LOG;
#endif
static void
zip_log(const char *format, ...)
zip_log(const char *fmt, ...)
{
#ifdef ENABLE_ZIP_LOG
va_list ap;
if (zip_do_log) {
va_start(ap, format);
pclog_ex(format, ap);
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define zip_log(fmt, ...)
#endif
int
@@ -2347,7 +2347,9 @@ zip_irq_raise(zip_t *dev)
static int
zip_read_from_dma(zip_t *dev)
{
#ifdef ENABLE_ZIP_LOG
int32_t *BufLen = &scsi_devices[dev->drv->scsi_device_id].buffer_length;
#endif
int ret = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI)
@@ -2417,7 +2419,9 @@ zip_write_to_scsi_dma(uint8_t scsi_id)
static int
zip_write_to_dma(zip_t *dev)
{
#ifdef ENABLE_ZIP_LOG
int32_t *BufLen = &scsi_devices[dev->drv->scsi_device_id].buffer_length;
#endif
int ret = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI) {