A bit more clang-format

This commit is contained in:
Jasmine Iwanek
2022-11-19 08:49:04 -05:00
parent b04dd8cc8b
commit 3fe4f75108
223 changed files with 8047 additions and 7456 deletions

View File

@@ -162,10 +162,10 @@ static uint8_t key_queue[16];
static int key_queue_start = 0,
key_queue_end = 0;
static uint8_t crtc_mask[32] = {
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f,
0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f,
0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
static video_timings_t timing_pc1512 = { VIDEO_BUS, 0, 0, 0, 0, 0, 0 }; /*PC1512 video code handles waitstates itself*/
@@ -2551,7 +2551,7 @@ machine_amstrad_init(const machine_t *model, int type)
ms_read, NULL, NULL, ms_write, NULL, NULL, ams);
if (mouse_type == MOUSE_TYPE_INTERNAL) {
/* Tell mouse driver about our internal mouse. */
/* Tell mouse driver about our internal mouse. */
mouse_reset();
mouse_set_buttons(2);
mouse_set_poll(ms_poll, ams);

View File

@@ -702,7 +702,7 @@ const device_config_t compaq_plasma_config[] = {
}
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t compaq_plasma_device = {

View File

@@ -336,26 +336,25 @@ machine_xt_pravetz16_imko4_init(const machine_t *model)
ret = bios_load_linear("roms/machines/pravetz16/BIOS_IMKO4_FE00.BIN",
0x000fe000, 65536, 0);
if (ret)
{
if (ret) {
bios_load_aux_linear("roms/machines/pravetz16/BIOS_IMKO4_F400.BIN",
0x000f4000, 8192, 0);
0x000f4000, 8192, 0);
bios_load_aux_linear("roms/machines/pravetz16/BIOS_IMKO4_F600.BIN",
0x000f6000, 8192, 0);
0x000f6000, 8192, 0);
bios_load_aux_linear("roms/machines/pravetz16/BIOS_IMKO4_FA00.BIN",
0x000fa000, 8192, 0);
0x000fa000, 8192, 0);
bios_load_aux_linear("roms/machines/pravetz16/BIOS_IMKO4_F800.BIN",
0x000f8000, 8192, 0);
0x000f8000, 8192, 0);
bios_load_aux_linear("roms/machines/pravetz16/BIOS_IMKO4_FC00.BIN",
0x000fc000, 8192, 0);
0x000fc000, 8192, 0);
}
if (bios_only || !ret)
return ret;
return ret;
device_add(&keyboard_pravetz_device);
@@ -367,13 +366,13 @@ machine_xt_pravetz16_imko4_init(const machine_t *model)
int
machine_xt_micoms_xl7turbo_init(const machine_t *model)
{
int ret;
int ret;
ret = bios_load_linear("roms/machines/mxl7t/XL7_TURBO.BIN",
0x000fe000, 8192, 0);
0x000fe000, 8192, 0);
if (bios_only || !ret)
return ret;
return ret;
machine_xt_init_ex(model);
return ret;
@@ -602,14 +601,14 @@ machine_xt_v20xt_init(const machine_t *model)
int ret;
ret = bios_load_linear("roms/machines/v20xt/V20XTBios.bin",
0x000fe000, 8192, 0);
0x000fe000, 8192, 0);
if (bios_only || !ret)
return ret;
return ret;
machine_xt_clone_init(model);
return ret;
return ret;
}
int

View File

@@ -74,43 +74,43 @@
#define CGA_COMPOSITE 1
enum MM58174_ADDR {
/* Registers */
MM58174_TEST, /* TEST register, write only */
MM58174_TENTHS, /* Tenths of second, read only */
MM58174_SECOND1, /* Units of seconds, read only */
MM58174_SECOND10, /* Tens of seconds, read only */
MM58174_MINUTE1,
MM58174_MINUTE10,
MM58174_HOUR1,
MM58174_HOUR10,
MM58174_DAY1,
MM58174_DAY10,
MM58174_WEEKDAY,
MM58174_MONTH1,
MM58174_MONTH10,
MM58174_LEAPYEAR, /* Leap year status, write only */
MM58174_RESET, /* RESET register, write only */
MM58174_IRQ /* Interrupt register, read / write */
/* Registers */
MM58174_TEST, /* TEST register, write only */
MM58174_TENTHS, /* Tenths of second, read only */
MM58174_SECOND1, /* Units of seconds, read only */
MM58174_SECOND10, /* Tens of seconds, read only */
MM58174_MINUTE1,
MM58174_MINUTE10,
MM58174_HOUR1,
MM58174_HOUR10,
MM58174_DAY1,
MM58174_DAY10,
MM58174_WEEKDAY,
MM58174_MONTH1,
MM58174_MONTH10,
MM58174_LEAPYEAR, /* Leap year status, write only */
MM58174_RESET, /* RESET register, write only */
MM58174_IRQ /* Interrupt register, read / write */
};
enum MM58274_ADDR {
/* Registers */
MM58274_CONTROL, /* Control register */
MM58274_TENTHS, /* Tenths of second, read only */
MM58274_SECOND1,
MM58274_SECOND10,
MM58274_MINUTE1,
MM58274_MINUTE10,
MM58274_HOUR1,
MM58274_HOUR10,
MM58274_DAY1,
MM58274_DAY10,
MM58274_MONTH1,
MM58274_MONTH10,
MM58274_YEAR1,
MM58274_YEAR10,
MM58274_WEEKDAY,
MM58274_SETTINGS /* Settings register */
/* Registers */
MM58274_CONTROL, /* Control register */
MM58274_TENTHS, /* Tenths of second, read only */
MM58274_SECOND1,
MM58274_SECOND10,
MM58274_MINUTE1,
MM58274_MINUTE10,
MM58274_HOUR1,
MM58274_HOUR10,
MM58274_DAY1,
MM58274_DAY10,
MM58274_MONTH1,
MM58274_MONTH10,
MM58274_YEAR1,
MM58274_YEAR10,
MM58274_WEEKDAY,
MM58274_SETTINGS /* Settings register */
};
static struct tm intclk;
@@ -124,7 +124,7 @@ typedef struct {
uint8_t output_port;
uint8_t id;
int param,
param_total;
param_total;
uint8_t params[16];
uint8_t scan[7];
@@ -254,14 +254,14 @@ mm58174_start(nvr_t *nvr)
static void
mm58174_write(uint16_t addr, uint8_t val, void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
nvr_t *nvr = (nvr_t *) priv;
addr &= 0x0f;
val &= 0x0f;
/* Update non-read-only changed values if not synchronizing time to host */
if ((addr != MM58174_TENTHS) && (addr != MM58174_SECOND1) && (addr != MM58174_SECOND10))
if ((nvr->regs[addr] != val) && !(time_sync & TIME_SYNC_ENABLED))
if ((addr != MM58174_TENTHS) && (addr != MM58174_SECOND1) && (addr != MM58174_SECOND10))
if ((nvr->regs[addr] != val) && !(time_sync & TIME_SYNC_ENABLED))
nvr_dosave = 1;
if ((addr == MM58174_RESET) && (val & 0x01)) {
@@ -269,7 +269,7 @@ mm58174_write(uint16_t addr, uint8_t val, void *priv)
nvr->regs[MM58174_TENTHS] = 0;
if (!(time_sync & TIME_SYNC_ENABLED)) {
/* Only set seconds to 0 if not synchronizing time to host clock */
nvr->regs[MM58174_SECOND1] = 0;
nvr->regs[MM58174_SECOND1] = 0;
nvr->regs[MM58174_SECOND10] = 0;
}
}
@@ -285,7 +285,7 @@ mm58174_write(uint16_t addr, uint8_t val, void *priv)
static uint8_t
mm58174_read(uint16_t addr, void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
nvr_t *nvr = (nvr_t *) priv;
addr &= 0x0f;
@@ -334,12 +334,12 @@ mm58174_init(nvr_t *nvr, int size)
static void
mm58274_time_set(uint8_t *regs, struct tm *tm)
{
regs[MM58274_SECOND1] = (tm->tm_sec % 10);
regs[MM58274_SECOND10] = (tm->tm_sec / 10);
regs[MM58274_MINUTE1] = (tm->tm_min % 10);
regs[MM58274_MINUTE10] = (tm->tm_min / 10);
regs[MM58274_HOUR1] = (tm->tm_hour % 10);
regs[MM58274_HOUR10] = (tm->tm_hour / 10);
regs[MM58274_SECOND1] = (tm->tm_sec % 10);
regs[MM58274_SECOND10] = (tm->tm_sec / 10);
regs[MM58274_MINUTE1] = (tm->tm_min % 10);
regs[MM58274_MINUTE10] = (tm->tm_min / 10);
regs[MM58274_HOUR1] = (tm->tm_hour % 10);
regs[MM58274_HOUR10] = (tm->tm_hour / 10);
/* Store hour in 24-hour or 12-hour mode */
if (regs[MM58274_SETTINGS] & 0x01) {
regs[MM58274_HOUR1] = (tm->tm_hour % 10);
@@ -352,35 +352,35 @@ mm58274_time_set(uint8_t *regs, struct tm *tm)
else
regs[MM58274_SETTINGS] &= 0x0B;
}
regs[MM58274_WEEKDAY] = (tm->tm_wday + 1);
regs[MM58274_DAY1] = (tm->tm_mday % 10);
regs[MM58274_DAY10] = (tm->tm_mday / 10);
regs[MM58274_MONTH1] = ((tm->tm_mon + 1) % 10);
regs[MM58274_MONTH10] = ((tm->tm_mon + 1) / 10);
regs[MM58274_WEEKDAY] = (tm->tm_wday + 1);
regs[MM58274_DAY1] = (tm->tm_mday % 10);
regs[MM58274_DAY10] = (tm->tm_mday / 10);
regs[MM58274_MONTH1] = ((tm->tm_mon + 1) % 10);
regs[MM58274_MONTH10] = ((tm->tm_mon + 1) / 10);
/* MM58274 can store 00 to 99 years but M240 uses the YEAR1 register to count 8 years from leap year */
regs[MM58274_YEAR1] = ((tm->tm_year + 1900) % 8);
regs[MM58274_YEAR1] = ((tm->tm_year + 1900) % 8);
/* Keep bit 0 and 1 12-hour / 24-hour and AM / PM */
regs[MM58274_SETTINGS] &= 0x03;
regs[MM58274_SETTINGS] &= 0x03;
/* Set leap counter bits 2 and 3 */
regs[MM58274_SETTINGS] += (4* (regs[MM58274_YEAR1] & 0x03));
regs[MM58274_SETTINGS] += (4 * (regs[MM58274_YEAR1] & 0x03));
}
/* Get the chip time. */
static void
mm58274_time_get(uint8_t *regs, struct tm *tm)
{
tm->tm_sec = nibbles(MM58274_SECOND);
tm->tm_min = nibbles(MM58274_MINUTE);
tm->tm_sec = nibbles(MM58274_SECOND);
tm->tm_min = nibbles(MM58274_MINUTE);
/* Read hour in 24-hour or 12-hour mode */
if (regs[MM58274_SETTINGS] & 0x01)
tm->tm_hour = nibbles(MM58274_HOUR);
else
tm->tm_hour = ((nibbles(MM58274_HOUR) % 12) + (regs[MM58274_SETTINGS] & 0x04) ? 12 : 0);
tm->tm_wday = (regs[MM58274_WEEKDAY] - 1);
tm->tm_mday = nibbles(MM58274_DAY);
tm->tm_mon = (nibbles(MM58274_MONTH) - 1);
tm->tm_wday = (regs[MM58274_WEEKDAY] - 1);
tm->tm_mday = nibbles(MM58274_DAY);
tm->tm_mon = (nibbles(MM58274_MONTH) - 1);
/* MM58274 can store 00 to 99 years but M240 uses the YEAR1 register to count 8 years from leap year */
tm->tm_year = (1984 + regs[MM58274_YEAR1] - 1900);
tm->tm_year = (1984 + regs[MM58274_YEAR1] - 1900);
}
/* This is called every second through the NVR/RTC hook. */
@@ -413,14 +413,14 @@ mm58274_start(nvr_t *nvr)
static void
mm58274_write(uint16_t addr, uint8_t val, void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
nvr_t *nvr = (nvr_t *) priv;
addr &= 0x0f;
val &= 0x0f;
/* Update non-read-only changed values if not synchronizing time to host */
if ((addr != MM58274_TENTHS))
if ((nvr->regs[addr] != val) && !(time_sync & TIME_SYNC_ENABLED))
if ((nvr->regs[addr] != val) && !(time_sync & TIME_SYNC_ENABLED))
nvr_dosave = 1;
if ((addr == MM58274_CONTROL) && (val & 0x04)) {
@@ -439,7 +439,7 @@ mm58274_write(uint16_t addr, uint8_t val, void *priv)
static uint8_t
mm58274_read(uint16_t addr, void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
nvr_t *nvr = (nvr_t *) priv;
addr &= 0x0f;
@@ -517,7 +517,7 @@ m24_kbd_adddata_ex(uint16_t val)
kbd_adddata_process(val, m24_kbd_adddata);
}
/*
/*
From the Olivetti M21/M24 Theory of Operation:
Port Function
@@ -535,7 +535,7 @@ static void
m24_kbd_write(uint16_t port, uint8_t val, void *priv)
{
m24_kbd_t *m24_kbd = (m24_kbd_t *) priv;
uint8_t ret;
uint8_t ret;
xt_olivetti_log("M24: write %04X %02X\n", port, val);
@@ -1831,7 +1831,7 @@ machine_xt_m24_init(const machine_t *model)
int
machine_xt_m240_init(const machine_t *model)
{
int ret;
int ret;
m24_kbd_t *m24_kbd;
nvr_t *nvr;

View File

@@ -723,7 +723,7 @@ static const device_config_t t1000_config[] = {
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t t1000_video_device = {

View File

@@ -156,7 +156,7 @@ static const device_config_t xi8088_config[] = {
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t xi8088_device = {

View File

@@ -11969,8 +11969,8 @@ const machine_t machines[] = {
/* Saved copies - jumpers get applied to these.
We use also machine_gpio to store IBM PC/XT jumpers as they need more than one byte. */
static uint16_t machine_p1;
static uint32_t machine_gpio;
static uint16_t machine_p1;
static uint32_t machine_gpio;
uint8_t
machine_get_p1(void)
@@ -12005,97 +12005,97 @@ machine_set_gpio(uint32_t gpio)
int
machine_count(void)
{
return((sizeof(machines) / sizeof(machine_t)) - 1);
return ((sizeof(machines) / sizeof(machine_t)) - 1);
}
char *
machine_getname(void)
{
return((char *)machines[machine].name);
return ((char *) machines[machine].name);
}
char *
machine_getname_ex(int m)
{
return((char *)machines[m].name);
return ((char *) machines[m].name);
}
const device_t *
machine_getdevice(int m)
{
if (machines[m].device)
return(machines[m].device);
return (machines[m].device);
return(NULL);
return (NULL);
}
const device_t *
machine_getviddevice(int m)
{
if (machines[m].vid_device)
return(machines[m].vid_device);
return (machines[m].vid_device);
return(NULL);
return (NULL);
}
const device_t *
machine_getsnddevice(int m)
{
if (machines[m].snd_device)
return(machines[m].snd_device);
return (machines[m].snd_device);
return(NULL);
return (NULL);
}
const device_t *
machine_getnetdevice(int m)
{
if (machines[m].net_device)
return(machines[m].net_device);
return (machines[m].net_device);
return(NULL);
return (NULL);
}
char *
machine_get_internal_name(void)
{
return((char *)machines[machine].internal_name);
return ((char *) machines[machine].internal_name);
}
char *
machine_get_internal_name_ex(int m)
{
return((char *)machines[m].internal_name);
return ((char *) machines[m].internal_name);
}
int
machine_get_nvrmask(int m)
{
return(machines[m].nvrmask);
return (machines[m].nvrmask);
}
int
machine_has_flags(int m, int flags)
{
return(machines[m].flags & flags);
return (machines[m].flags & flags);
}
int
machine_has_bus(int m, int bus_flags)
{
return(machines[m].bus_flags & bus_flags);
return (machines[m].bus_flags & bus_flags);
}
int
machine_has_cartridge(int m)
{
return(machine_has_bus(m, MACHINE_CARTRIDGE) ? 1 : 0);
return (machine_has_bus(m, MACHINE_CARTRIDGE) ? 1 : 0);
}
int
machine_get_min_ram(int m)
{
return(machines[m].ram.min);
return (machines[m].ram.min);
}
int
@@ -12111,13 +12111,13 @@ machine_get_max_ram(int m)
int
machine_get_ram_granularity(int m)
{
return(machines[m].ram.step);
return (machines[m].ram.step);
}
int
machine_get_type(int m)
{
return(machines[m].type);
return (machines[m].type);
}
int
@@ -12126,16 +12126,16 @@ machine_get_machine_from_internal_name(char *s)
int c = 0;
while (machines[c].init != NULL) {
if (!strcmp(machines[c].internal_name, (const char *)s))
return(c);
if (!strcmp(machines[c].internal_name, (const char *) s))
return (c);
c++;
}
return(0);
return (0);
}
int
machine_has_mouse(void)
{
return(machines[machine].flags & MACHINE_MOUSE);
return (machines[machine].flags & MACHINE_MOUSE);
}