mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 04:45:31 -07:00
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:
@@ -9,7 +9,7 @@
|
||||
* Implementation of the NEC uPD-765 and compatible floppy disk
|
||||
* controller.
|
||||
*
|
||||
* Version: @(#)fdc.c 1.0.11 2018/09/22
|
||||
* Version: @(#)fdc.c 1.0.12 2018/10/18
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
@@ -111,13 +111,11 @@ int floppyrate[4];
|
||||
|
||||
#ifdef ENABLE_FDC_LOG
|
||||
int fdc_do_log = ENABLE_FDC_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
fdc_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_FDC_LOG
|
||||
va_list ap;
|
||||
|
||||
if (fdc_do_log)
|
||||
@@ -126,8 +124,10 @@ fdc_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define fdc_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
uint8_t
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the floppy drive emulation.
|
||||
*
|
||||
* Version: @(#)fdd.c 1.0.11 2018/10/02
|
||||
* Version: @(#)fdd.c 1.0.12 2018/10/18
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -227,13 +227,11 @@ static const struct
|
||||
|
||||
#ifdef ENABLE_FDD_LOG
|
||||
int fdd_do_log = ENABLE_FDD_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
fdd_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_FDD_LOG
|
||||
va_list ap;
|
||||
|
||||
if (fdd_do_log)
|
||||
@@ -242,8 +240,10 @@ fdd_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define fdd_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
char *fdd_getname(int type)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* data in the form of FM/MFM-encoded transitions) which also
|
||||
* forms the core of the emulator's floppy disk emulation.
|
||||
*
|
||||
* Version: @(#)fdd_86f.c 1.0.15 2018/10/02
|
||||
* Version: @(#)fdd_86f.c 1.0.16 2018/10/17
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -239,11 +239,6 @@ typedef struct {
|
||||
} d86f_t;
|
||||
|
||||
|
||||
#ifdef ENABLE_D86F_LOG
|
||||
int d86f_do_log = ENABLE_D86F_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static const uint8_t encoded_fm[64] = {
|
||||
0xaa, 0xab, 0xae, 0xaf, 0xba, 0xbb, 0xbe, 0xbf,
|
||||
0xea, 0xeb, 0xee, 0xef, 0xfa, 0xfb, 0xfe, 0xff,
|
||||
@@ -280,19 +275,24 @@ void d86f_poll_write_data(int drive, int side, uint16_t pos, uint8_t data);
|
||||
int d86f_format_conditions(int drive);
|
||||
|
||||
|
||||
static void
|
||||
d86f_log(const char *format, ...)
|
||||
{
|
||||
#ifdef ENABLE_D86F_LOG
|
||||
int d86f_do_log = ENABLE_D86F_LOG;
|
||||
|
||||
|
||||
static void
|
||||
d86f_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (d86f_do_log) {
|
||||
va_start(ap, format);
|
||||
pclog_ex(format, ap);
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define d86f_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Implementation of the FDI floppy stream image format
|
||||
* interface to the FDI2RAW module.
|
||||
*
|
||||
* Version: @(#)fdd_fdi.c 1.0.3 2018/04/29
|
||||
* Version: @(#)fdd_fdi.c 1.0.4 2018/10/18
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -75,13 +75,11 @@ static fdc_t *fdi_fdc;
|
||||
|
||||
#ifdef ENABLE_FDI_LOG
|
||||
int fdi_do_log = ENABLE_FDI_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
fdi_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_FDI_LOG
|
||||
va_list ap;
|
||||
|
||||
if (fdi_do_log)
|
||||
@@ -90,8 +88,10 @@ fdi_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define fdi_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static uint16_t
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the IMD floppy image format.
|
||||
*
|
||||
* Version: @(#)fdd_imd.c 1.0.7 2018/04/29
|
||||
* Version: @(#)fdd_imd.c 1.0.8 2018/10/18
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -86,13 +86,11 @@ static fdc_t *imd_fdc;
|
||||
|
||||
#ifdef ENABLE_IMD_LOG
|
||||
int imd_do_log = ENABLE_IMD_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
imd_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_IMD_LOG
|
||||
va_list ap;
|
||||
|
||||
if (imd_do_log)
|
||||
@@ -101,8 +99,10 @@ imd_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define imd_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static uint32_t
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* re-merged with the other files. Much of it is generic to
|
||||
* all formats.
|
||||
*
|
||||
* Version: @(#)fdd_img.c 1.0.8 2018/05/09
|
||||
* Version: @(#)fdd_img.c 1.0.9 2018/10/18
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -301,13 +301,11 @@ const int gap3_sizes[5][8][48] = { { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
#ifdef ENABLE_IMG_LOG
|
||||
int img_do_log = ENABLE_IMG_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
img_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_IMG_LOG
|
||||
va_list ap;
|
||||
|
||||
if (img_do_log)
|
||||
@@ -316,8 +314,10 @@ img_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define img_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
/* Generic */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the PCjs JSON floppy image format.
|
||||
*
|
||||
* Version: @(#)fdd_json.c 1.0.5 2018/04/29
|
||||
* Version: @(#)fdd_json.c 1.0.6 2018/10/18
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -108,13 +108,11 @@ static json_t *images[FDD_NUM];
|
||||
|
||||
#ifdef ENABLE_JSON_LOG
|
||||
int json_do_log = ENABLE_JSON_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
json_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_JSON_LOG
|
||||
va_list ap;
|
||||
|
||||
if (json_do_log)
|
||||
@@ -123,8 +121,10 @@ json_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define json_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Teledisk floppy image format.
|
||||
*
|
||||
* Version: @(#)fdd_td0.c 1.0.6 2018/04/29
|
||||
* Version: @(#)fdd_td0.c 1.0.7 2018/10/18
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -222,13 +222,11 @@ static td0_t *td0[FDD_NUM];
|
||||
|
||||
#ifdef ENABLE_TD0_LOG
|
||||
int td0_do_log = ENABLE_TD0_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
td0_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_TD0_LOG
|
||||
va_list ap;
|
||||
|
||||
if (td0_do_log)
|
||||
@@ -237,8 +235,10 @@ td0_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define td0_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* addition of get_last_head and C++ callability by Thomas
|
||||
* Harte.
|
||||
*
|
||||
* Version: @(#)fdi2raw.c 1.0.3 2018/04/29
|
||||
* Version: @(#)fdi2raw.c 1.0.4 2018/10/18
|
||||
*
|
||||
* Authors: Toni Wilen, <twilen@arabuusimiehet.com>
|
||||
* and Vincent Joguin,
|
||||
@@ -66,13 +66,11 @@
|
||||
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
int fdi2raw_do_log = ENABLE_FDI2RAW_LOG;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
fdi2raw_log(const char *fmt, ...)
|
||||
{
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
va_list ap;
|
||||
|
||||
if (fdi2raw_do_log)
|
||||
@@ -81,10 +79,13 @@ fdi2raw_log(const char *fmt, ...)
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define fdi2raw_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
#ifdef DEBUG
|
||||
static char *datalog(uae_u8 *src, int len)
|
||||
{
|
||||
@@ -110,6 +111,8 @@ static char *datalog(uae_u8 *src, int len) { return ""; }
|
||||
#endif
|
||||
|
||||
static int fdi_allocated;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
static void fdi_free (void *p)
|
||||
{
|
||||
@@ -1329,8 +1332,10 @@ static void fix_mfm_sync (FDI *fdi)
|
||||
|
||||
static int handle_sectors_described_track (FDI *fdi)
|
||||
{
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
int oldout;
|
||||
uae_u8 *start_src = fdi->track_src ;
|
||||
#endif
|
||||
fdi->encoding_type = *fdi->track_src++;
|
||||
fdi->index_offset = get_u32(fdi->track_src);
|
||||
fdi->index_offset >>= 8;
|
||||
@@ -1340,10 +1345,14 @@ static int handle_sectors_described_track (FDI *fdi)
|
||||
do {
|
||||
fdi->track_type = *fdi->track_src++;
|
||||
fdi2raw_log("%06.6X %06.6X %02.2X:",fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type);
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
oldout = fdi->out;
|
||||
#endif
|
||||
decode_sectors_described_track[fdi->track_type](fdi);
|
||||
fdi2raw_log(" %d\n", fdi->out - oldout);
|
||||
#ifdef ENABLE_FDI2RAW_LOG
|
||||
oldout = fdi->out;
|
||||
#endif
|
||||
if (fdi->out < 0 || fdi->err) {
|
||||
fdi2raw_log("\nin %d bytes, out %d bits\n", fdi->track_src - fdi->track_src_buffer, fdi->out);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user