Code/Comments cleanup

Tabs to spaces
Whitespace
Normalize clang-format comments
This commit is contained in:
Jasmine Iwanek
2022-11-13 16:38:48 -05:00
parent bd75bc141a
commit af9f1abf98
18 changed files with 117 additions and 116 deletions

View File

@@ -205,15 +205,15 @@ char exe_path[2048]; /* path (dir) of executable */
char usr_path[1024]; /* path (dir) of user data */
char cfg_path[1024]; /* full path of config file */
FILE *stdlog = NULL; /* file to log output to */
// int scrnsz_x = SCREEN_RES_X; /* current screen size, X */
// int scrnsz_y = SCREEN_RES_Y; /* current screen size, Y */
// int scrnsz_x = SCREEN_RES_X; /* current screen size, X */
// int scrnsz_y = SCREEN_RES_Y; /* current screen size, Y */
int config_changed; /* config has changed */
int title_update;
int framecountx = 0;
int hard_reset_pending = 0;
// int unscaled_size_x = SCREEN_RES_X; /* current unscaled size X */
// int unscaled_size_y = SCREEN_RES_Y; /* current unscaled size Y */
// int unscaled_size_x = SCREEN_RES_X; /* current unscaled size X */
// int unscaled_size_y = SCREEN_RES_Y; /* current unscaled size Y */
// int efscrnsz_y = SCREEN_RES_Y;
static wchar_t mouse_msg[3][200];
@@ -473,7 +473,7 @@ usage:
printf("-D or --debug - force debug output logging\n");
#endif
#if 0
printf("-E or --nographic - forces the old behavior\n");
printf("-E or --nographic - forces the old behavior\n");
#endif
printf("-F or --fullscreen - start in fullscreen mode\n");
printf("-G or --lang langid - start with specified language (e.g. en-US, or system)\n");

View File

@@ -324,8 +324,8 @@ ali1429_init(const device_t *info)
GREEN = info->local;
/* M1429 Ports:
22h Index Port
23h Data Port
22h Index Port
23h Data Port
*/
io_sethandler(0x0022, 0x0002, ali1429_read, NULL, NULL, ali1429_write, NULL, NULL, dev);

View File

@@ -59,28 +59,28 @@ ali1621_log(const char *fmt, ...)
/* Table translated to a more sensible format:
Read cycles:
SMREN SMM Mode Code Data
0 X X PCI PCI
1 0 Close PCI PCI
1 0 Lock PCI PCI
1 0 Protect PCI PCI
1 0 Open DRAM DRAM
1 1 Open DRAM DRAM
1 1 Protect DRAM DRAM
1 1 Close DRAM PCI
1 1 Lock DRAM PCI
SMREN SMM Mode Code Data
0 X X PCI PCI
1 0 Close PCI PCI
1 0 Lock PCI PCI
1 0 Protect PCI PCI
1 0 Open DRAM DRAM
1 1 Open DRAM DRAM
1 1 Protect DRAM DRAM
1 1 Close DRAM PCI
1 1 Lock DRAM PCI
Write cycles:
SMWEN SMM Mode Data
0 X X PCI
1 0 Close PCI
1 0 Lock PCI
1 0 Protect PCI
1 0 Open DRAM
1 1 Open DRAM
1 1 Protect DRAM
1 1 Close PCI
1 1 Lock PCI
SMWEN SMM Mode Data
0 X X PCI
1 0 Close PCI
1 0 Lock PCI
1 0 Protect PCI
1 0 Open DRAM
1 1 Open DRAM
1 1 Protect DRAM
1 1 Close PCI
1 1 Lock PCI
Explanation of the modes based above:
If SM*EN = 0, SMRAM is entirely disabled, otherwise:

View File

@@ -255,7 +255,7 @@ memmap_state_update(headland_t *dev)
mem_mapping_set_exec(&dev->high_mapping, ram + 0x100000);
}
} else {
/* 1 MB - 1 MB + 384k: RAM pointing to A0000-FFFFF
/* 1 MB - 1 MB + 384k: RAM pointing to A0000-FFFFF
1 MB + 384k: Any ram pointing 1 MB onwards. */
/* First, do the addresses above 1 MB. */
mem_mapping_set_addr(&dev->mid_mapping, 0x100000, mem_size > 1024 ? 0x60000 : (mem_size - 640) << 10);

View File

@@ -1023,9 +1023,9 @@ piix_write(int func, int addr, uint8_t val, void *priv)
fregs[0x07] &= 0xf7;
break;
#if 0
case 0x3c:
fregs[0x3c] = val;
break;
case 0x3c:
fregs[0x3c] = val;
break;
#endif
case 0x40:
fregs[0x40] = (val & 0xc0) | 1;
@@ -1657,9 +1657,9 @@ static void
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = 1.5x multiplier, 1 = 2x multiplier (Switch 6). */

View File

@@ -196,13 +196,13 @@ exec386(int cycs)
}
} else if (trap) {
flags_rebuild();
trap = 0;
trap = 0;
#ifndef USE_NEW_DYNAREC
oldcs = CS;
oldcs = CS;
#endif
cpu_state.oldpc = cpu_state.pc;
dr[6] |= 0x4000;
x86_int(1);
cpu_state.oldpc = cpu_state.pc;
dr[6] |= 0x4000;
x86_int(1);
}
if (smi_line)

View File

@@ -45,9 +45,9 @@ clock_end(void)
int diff = cycdiff - cycles;
/* On 808x systems, clock speed is usually crystal frequency divided by an integer. */
tsc += (uint64_t)diff * ((uint64_t)xt_cpu_multi >> 32ULL); /* Shift xt_cpu_multi by 32 bits to the right and then multiply. */
tsc += (uint64_t)diff * ((uint64_t)xt_cpu_multi >> 32ULL); /* Shift xt_cpu_multi by 32 bits to the right and then multiply. */
if (TIMER_VAL_LESS_THAN_VAL(timer_target, (uint32_t)tsc))
timer_process();
timer_process();
}
static void
@@ -55,8 +55,8 @@ i8080_wait(int c, int bus)
{
cycles -= c;
if (bus < 2) {
clock_end();
clock_start();
clock_end();
clock_start();
}
}

View File

@@ -36,9 +36,9 @@ fpu_log(const char *fmt, ...)
va_list ap;
if (fpu_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
@@ -55,9 +55,9 @@ fpu_get_type(const cpu_family_t *cpu_family, int cpu, const char *internal_name)
int c = 0;
while (fpus[c].internal_name) {
if (!strcmp(internal_name, fpus[c].internal_name))
fpu_type = fpus[c].type;
c++;
if (!strcmp(internal_name, fpus[c].internal_name))
fpu_type = fpus[c].type;
c++;
}
return fpu_type;
@@ -72,9 +72,9 @@ fpu_get_internal_name(const cpu_family_t *cpu_family, int cpu, int type)
int c = 0;
while (fpus[c].internal_name) {
if (fpus[c].type == type)
return fpus[c].internal_name;
c++;
if (fpus[c].type == type)
return fpus[c].internal_name;
c++;
}
return fpus[0].internal_name;

View File

@@ -15,8 +15,8 @@ static int opRDTSC(uint32_t fetchdat)
EDX = tsc >> 32;
CLOCK_CYCLES(1);
#ifdef USE_DYNAREC
if (cpu_use_dynarec)
update_tsc();
if (cpu_use_dynarec)
update_tsc();
#endif
return 0;
}

View File

@@ -34,7 +34,7 @@ void (*keyboard_send)(uint16_t val);
static int recv_key[512]; /* keyboard input buffer */
static int oldkey[512];
#if 0
static int keydelay[512];
static int keydelay[512];
#endif
static scancode *scan_table; /* scancode table for keyboard */

View File

@@ -52,6 +52,7 @@ static int next_inst = 0;
static serial_device_t serial_devices[SERIAL_MAX];
//#define ENABLE_SERIAL_CONSOLE 1
#ifdef ENABLE_SERIAL_LOG
int serial_do_log = ENABLE_SERIAL_LOG;

View File

@@ -27,7 +27,7 @@
unsigned int hdd_table[128][3] = {
// clang-format off
{ 306, 4, 17 }, /* 0 - 7 */
{ 306, 4, 17 }, /* 0 - 7 */
{ 615, 2, 17 },
{ 306, 4, 26 },
{ 1024, 2, 17 },
@@ -36,7 +36,7 @@ unsigned int hdd_table[128][3] = {
{ 614, 4, 17 },
{ 615, 4, 17 },
{ 670, 4, 17 }, /* 8 - 15 */
{ 670, 4, 17 }, /* 8 - 15 */
{ 697, 4, 17 },
{ 987, 3, 17 },
{ 820, 4, 17 },
@@ -45,7 +45,7 @@ unsigned int hdd_table[128][3] = {
{ 733, 5, 17 },
{ 615, 6, 17 },
{ 462, 8, 17 }, /* 016-023 */
{ 462, 8, 17 }, /* 016-023 */
{ 306, 8, 26 },
{ 615, 4, 26 },
{ 1024, 4, 17 },
@@ -54,7 +54,7 @@ unsigned int hdd_table[128][3] = {
{ 932, 5, 17 },
{ 1024, 2, 40 },
{ 809, 6, 17 }, /* 024-031 */
{ 809, 6, 17 }, /* 024-031 */
{ 976, 5, 17 },
{ 977, 5, 17 },
{ 698, 7, 17 },
@@ -63,7 +63,7 @@ unsigned int hdd_table[128][3] = {
{ 615, 8, 17 },
{ 989, 5, 17 },
{ 820, 4, 26 }, /* 032-039 */
{ 820, 4, 26 }, /* 032-039 */
{ 1024, 5, 17 },
{ 733, 7, 17 },
{ 754, 7, 17 },
@@ -72,7 +72,7 @@ unsigned int hdd_table[128][3] = {
{ 615, 6, 26 },
{ 462, 8, 26 },
{ 830, 7, 17 }, /* 040-047 */
{ 830, 7, 17 }, /* 040-047 */
{ 855, 7, 17 },
{ 751, 8, 17 },
{ 1024, 4, 26 },
@@ -81,7 +81,7 @@ unsigned int hdd_table[128][3] = {
{ 855, 5, 26 },
{ 977, 7, 17 },
{ 987, 7, 17 }, /* 048-055 */
{ 987, 7, 17 }, /* 048-055 */
{ 1024, 7, 17 },
{ 823, 4, 38 },
{ 925, 8, 17 },
@@ -90,7 +90,7 @@ unsigned int hdd_table[128][3] = {
{ 977, 5, 26 },
{ 698, 7, 26 },
{ 699, 7, 26 }, /* 056-063 */
{ 699, 7, 26 }, /* 056-063 */
{ 940, 8, 17 },
{ 615, 8, 26 },
{ 1024, 5, 26 },
@@ -99,7 +99,7 @@ unsigned int hdd_table[128][3] = {
{ 823, 10, 17 },
{ 754, 11, 17 },
{ 830, 10, 17 }, /* 064-071 */
{ 830, 10, 17 }, /* 064-071 */
{ 925, 9, 17 },
{ 1224, 7, 17 },
{ 940, 6, 26 },
@@ -108,7 +108,7 @@ unsigned int hdd_table[128][3] = {
{ 1024, 9, 17 },
{ 965, 10, 17 },
{ 969, 5, 34 }, /* 072-079 */
{ 969, 5, 34 }, /* 072-079 */
{ 980, 10, 17 },
{ 960, 5, 35 },
{ 918, 11, 17 },
@@ -117,7 +117,7 @@ unsigned int hdd_table[128][3] = {
{ 1024, 7, 26 },
{ 1024, 11, 17 },
{ 940, 8, 26 }, /* 080-087 */
{ 940, 8, 26 }, /* 080-087 */
{ 776, 8, 33 },
{ 755, 16, 17 },
{ 1024, 12, 17 },
@@ -126,7 +126,7 @@ unsigned int hdd_table[128][3] = {
{ 830, 10, 26 },
{ 925, 9, 26 },
{ 960, 9, 26 }, /* 088-095 */
{ 960, 9, 26 }, /* 088-095 */
{ 1024, 13, 17 },
{ 1224, 11, 17 },
{ 900, 15, 17 },
@@ -135,7 +135,7 @@ unsigned int hdd_table[128][3] = {
{ 918, 15, 17 },
{ 1524, 4, 39 },
{ 1024, 9, 26 }, /* 096-103 */
{ 1024, 9, 26 }, /* 096-103 */
{ 1024, 14, 17 },
{ 965, 10, 26 },
{ 980, 10, 26 },
@@ -144,7 +144,7 @@ unsigned int hdd_table[128][3] = {
{ 1024, 15, 17 },
{ 1024, 16, 17 },
{ 1224, 15, 17 }, /* 104-111 */
{ 1224, 15, 17 }, /* 104-111 */
{ 755, 16, 26 },
{ 903, 8, 46 },
{ 984, 10, 34 },
@@ -153,7 +153,7 @@ unsigned int hdd_table[128][3] = {
{ 1023, 15, 26 },
{ 684, 16, 38 },
{ 1930, 4, 62 }, /* 112-119 */
{ 1930, 4, 62 }, /* 112-119 */
{ 967, 16, 31 },
{ 1013, 10, 63 },
{ 1218, 15, 36 },
@@ -162,7 +162,7 @@ unsigned int hdd_table[128][3] = {
{ 702, 16, 63 },
{ 1002, 13, 63 },
{ 854, 16, 63 }, /* 119-127 */
{ 854, 16, 63 }, /* 119-127 */
{ 987, 16, 63 },
{ 995, 16, 63 },
{ 1024, 16, 63 },

View File

@@ -19,31 +19,31 @@
#define LSTR(s) _LSTR(s)
/* Version info. */
#define EMU_NAME "86Box"
#define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_NAME "86Box"
#define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_VERSION "3.8"
#define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
#define EMU_VERSION_MAJ 3
#define EMU_VERSION_MIN 8
#define EMU_VERSION "3.8"
#define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
#define EMU_VERSION_MAJ 3
#define EMU_VERSION_MIN 8
#define EMU_VERSION_PATCH 0
#define EMU_BUILD_NUM 0
#define EMU_BUILD_NUM 0
#define EMU_VERSION_FULL EMU_VERSION
#define EMU_VERSION_FULL_W EMU_VERSION_W
#define EMU_VERSION_FULL EMU_VERSION
#define EMU_VERSION_FULL_W EMU_VERSION_W
#define COPYRIGHT_YEAR "2022"
#define COPYRIGHT_YEAR "2022"
/* Web URL info. */
#define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#ifdef RELEASE_BUILD
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.8/"
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.8/"
#else
# define EMU_DOCS_URL "https://86box.readthedocs.io"
# define EMU_DOCS_URL "https://86box.readthedocs.io"
#endif
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)

View File

@@ -40,7 +40,7 @@ static const struct {
{"dot_matrix", &lpt_prt_escp_device },
{"postscript", &lpt_prt_ps_device },
{"plip", &lpt_plip_device },
{"dongle_savquest", &lpt_hasp_savquest_device },
{"dongle_savquest", &lpt_hasp_savquest_device },
{"", NULL }
// clang-format on
};

View File

@@ -54,9 +54,9 @@ rdtsc(void)
unsigned hi, lo;
# ifdef _MSC_VER
__asm {
rdtsc
mov hi, edx ; EDX:EAX is already standard return!!
mov lo, eax
rdtsc
mov hi, edx ; EDX:EAX is already standard return!!
mov lo, eax
}
# else
__asm__ __volatile__("rdtsc"

View File

@@ -73,9 +73,9 @@ static const device_t vid_internal_device = {
.config = NULL
};
// clang-format off
static const VIDEO_CARD
video_cards[] = {
// clang-format off
{ &vid_none_device },
{ &vid_internal_device },
{ &atiega_device },
@@ -261,8 +261,8 @@ video_cards[] = {
{ &voodoo_3_3500_se_agp_device },
{ &voodoo_3_3500_si_agp_device },
{ NULL }
};
// clang-format on
};
#ifdef ENABLE_VID_TABLE_LOG
int vid_table_do_log = ENABLE_VID_TABLE_LOG;

View File

@@ -192,12 +192,12 @@ vnc_init(UNUSED(void *arg))
rfbPixelFormat rpf = {
/*
* Screen format:
* 32bpp; 32 depth;
* little endian;
* true color;
* max 255 R/G/B;
* red shift 16; green shift 8; blue shift 0;
* padding
* 32bpp; 32 depth;
* little endian;
* true color;
* max 255 R/G/B;
* red shift 16; green shift 8; blue shift 0;
* padding
*/
32, 32, 0, 1, 255, 255, 255, 16, 8, 0, 0, 0
};

View File

@@ -36,9 +36,9 @@ dynld_log(const char *fmt, ...)
va_list ap;
if (dynld_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
@@ -55,22 +55,22 @@ dynld_module(const char *name, dllimp_t *table)
/* See if we can load the desired module. */
if ((h = LoadLibrary(name)) == NULL) {
dynld_log("DynLd(\"%s\"): library not found! (%08X)\n", name, GetLastError());
return(NULL);
dynld_log("DynLd(\"%s\"): library not found! (%08X)\n", name, GetLastError());
return(NULL);
}
/* Now load the desired function pointers. */
for (imp=table; imp->name!=NULL; imp++) {
func = GetProcAddress(h, imp->name);
if (func == NULL) {
dynld_log("DynLd(\"%s\"): function '%s' not found! (%08X)\n",
name, imp->name, GetLastError());
FreeLibrary(h);
return(NULL);
}
func = GetProcAddress(h, imp->name);
if (func == NULL) {
dynld_log("DynLd(\"%s\"): function '%s' not found! (%08X)\n",
name, imp->name, GetLastError());
FreeLibrary(h);
return(NULL);
}
/* To overcome typing issues.. */
*(char **)imp->func = (char *)func;
/* To overcome typing issues.. */
*(char **)imp->func = (char *)func;
}
/* All good. */
@@ -83,5 +83,5 @@ void
dynld_close(void *handle)
{
if (handle != NULL)
FreeLibrary((HMODULE)handle);
FreeLibrary((HMODULE)handle);
}