clang-format in src/machine/

This commit is contained in:
Jasmine Iwanek
2022-09-18 17:17:57 -04:00
parent a225c9433b
commit 3fddf4d488
6 changed files with 42 additions and 50 deletions

View File

@@ -2292,7 +2292,7 @@ machine_amstrad_init(const machine_t *model, int type)
ams = (amstrad_t *) malloc(sizeof(amstrad_t)); ams = (amstrad_t *) malloc(sizeof(amstrad_t));
memset(ams, 0x00, sizeof(amstrad_t)); memset(ams, 0x00, sizeof(amstrad_t));
ams->type = type; ams->type = type;
amstrad_latch = 0x80000000; amstrad_latch = 0x80000000;
switch (type) { switch (type) {

View File

@@ -506,7 +506,6 @@ machine_at_ap5s_init(const machine_t *model)
return ret; return ret;
} }
int int
machine_at_ms5124_init(const machine_t *model) machine_at_ms5124_init(const machine_t *model)
{ {
@@ -536,7 +535,6 @@ machine_at_ms5124_init(const machine_t *model)
return ret; return ret;
} }
int int
machine_at_vectra54_init(const machine_t *model) machine_at_vectra54_init(const machine_t *model)
{ {

View File

@@ -697,7 +697,7 @@ t1000_speed_changed(void *p)
} }
static const device_config_t t1000_config[] = { static const device_config_t t1000_config[] = {
// clang-format off // clang-format off
{ {
.name = "display_language", .name = "display_language",
.description = "Language", .description = "Language",
@@ -723,7 +723,7 @@ static const device_config_t t1000_config[] = {
.default_int = 0 .default_int = 0
}, },
{ .name = "", .description = "", .type = CONFIG_END } { .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
const device_t t1000_video_device = { const device_t t1000_video_device = {

View File

@@ -86,7 +86,7 @@ xi8088_init(const device_t *info)
} }
static const device_config_t xi8088_config[] = { static const device_config_t xi8088_config[] = {
// clang-format off // clang-format off
{ {
.name = "turbo_setting", .name = "turbo_setting",
.description = "Turbo", .description = "Turbo",
@@ -156,7 +156,7 @@ static const device_config_t xi8088_config[] = {
.default_int = 0 .default_int = 0
}, },
{ .name = "", .description = "", .type = CONFIG_END } { .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
const device_t xi8088_device = { const device_t xi8088_device = {

View File

@@ -42,80 +42,75 @@
#include <86box/machine.h> #include <86box/machine.h>
#include <86box/isamem.h> #include <86box/isamem.h>
int bios_only = 0; int bios_only = 0;
int machine; int machine;
// int AT, PCI; // int AT, PCI;
#ifdef ENABLE_MACHINE_LOG #ifdef ENABLE_MACHINE_LOG
int machine_do_log = ENABLE_MACHINE_LOG; int machine_do_log = ENABLE_MACHINE_LOG;
static void static void
machine_log(const char *fmt, ...) machine_log(const char *fmt, ...)
{ {
va_list ap; va_list ap;
if (machine_do_log) if (machine_do_log) {
{ va_start(ap, fmt);
va_start(ap, fmt); pclog_ex(fmt, ap);
pclog_ex(fmt, ap); va_end(ap);
va_end(ap); }
}
} }
#else #else
#define machine_log(fmt, ...) # define machine_log(fmt, ...)
#endif #endif
static int static int
machine_init_ex(int m) machine_init_ex(int m)
{ {
int ret = 0; int ret = 0;
if (!bios_only) { if (!bios_only) {
machine_log("Initializing as \"%s\"\n", machine_getname()); machine_log("Initializing as \"%s\"\n", machine_getname());
is_vpc = 0; is_vpc = 0;
standalone_gameport_type = NULL; standalone_gameport_type = NULL;
gameport_instance_id = 0; gameport_instance_id = 0;
/* Set up the architecture flags. */ /* Set up the architecture flags. */
// AT = IS_AT(machine); // AT = IS_AT(machine);
// PCI = IS_ARCH(machine, MACHINE_BUS_PCI); // PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
cpu_set(); cpu_set();
pc_speed_changed(); pc_speed_changed();
/* Reset the memory state. */ /* Reset the memory state. */
mem_reset(); mem_reset();
smbase = is_am486dxl ? 0x00060000 : 0x00030000; smbase = is_am486dxl ? 0x00060000 : 0x00030000;
lpt_init(); lpt_init();
if (cassette_enable) if (cassette_enable)
device_add(&cassette_device); device_add(&cassette_device);
cart_reset(); cart_reset();
/* Prepare some video-related things if we're using internal /* Prepare some video-related things if we're using internal
or no video. */ or no video. */
video_pre_reset(gfxcard); video_pre_reset(gfxcard);
/* Reset any ISA memory cards. */ /* Reset any ISA memory cards. */
isamem_reset(); isamem_reset();
/* Reset the fast off stuff. */ /* Reset the fast off stuff. */
cpu_fast_off_reset(); cpu_fast_off_reset();
} }
/* All good, boot the machine! */ /* All good, boot the machine! */
if (machines[m].init) if (machines[m].init)
ret = machines[m].init(&machines[m]); ret = machines[m].init(&machines[m]);
if (bios_only || !ret) if (bios_only || !ret)
return ret; return ret;
if (gfxcard != VID_NONE) { if (gfxcard != VID_NONE) {
if (ibm8514_enabled) { if (ibm8514_enabled) {
@@ -132,7 +127,6 @@ machine_init_ex(int m)
return ret; return ret;
} }
void void
machine_init(void) machine_init(void)
{ {
@@ -140,11 +134,10 @@ machine_init(void)
(void) machine_init_ex(machine); (void) machine_init_ex(machine);
} }
int int
machine_available(int m) machine_available(int m)
{ {
int ret; int ret;
device_t *d = (device_t *) machine_getdevice(m); device_t *d = (device_t *) machine_getdevice(m);
bios_only = 1; bios_only = 1;
@@ -160,15 +153,14 @@ machine_available(int m)
return !!ret; return !!ret;
} }
void void
pit_irq0_timer(int new_out, int old_out) pit_irq0_timer(int new_out, int old_out)
{ {
if (new_out && !old_out) if (new_out && !old_out)
picint(1); picint(1);
if (!new_out) if (!new_out)
picintc(1); picintc(1);
} }
void void

View File

@@ -201,6 +201,7 @@ const machine_filter_t machine_chipsets[] = {
const machine_t machines[] = { const machine_t machines[] = {
// clang-format off
/* 8088 Machines */ /* 8088 Machines */
{ {
.name = "[8088] IBM PC (1981)", .name = "[8088] IBM PC (1981)",
@@ -11784,6 +11785,7 @@ const machine_t machines[] = {
.snd_device = NULL, .snd_device = NULL,
.net_device = NULL .net_device = NULL
} }
// clang-format on
}; };
/* Saved copies - jumpers get applied to these. /* Saved copies - jumpers get applied to these.