diff --git a/src/86box.c b/src/86box.c index 1f6d029a3..f52b0869d 100644 --- a/src/86box.c +++ b/src/86box.c @@ -293,7 +293,7 @@ void pclog_ensure_stdlog_open(void) * being logged, and catch repeating entries. */ void -pclog_ex(const char *fmt, va_list ap) +pclog_ex(UNUSED(const char *fmt), UNUSED(va_list ap)) { #ifndef RELEASE_BUILD char temp[LOG_SIZE_BUFFER]; @@ -330,7 +330,7 @@ pclog_toggle_suppr(void) /* Log something. We only do this in non-release builds. */ void -pclog(const char *fmt, ...) +pclog(UNUSED(const char *fmt), ...) { #ifndef RELEASE_BUILD va_list ap; diff --git a/src/acpi.c b/src/acpi.c index 0d5c1fe00..2850a340d 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -89,7 +89,7 @@ acpi_timer_get(acpi_t *dev) } static uint8_t -acpi_gp_timer_get(acpi_t *dev) +acpi_gp_timer_get(UNUSED(acpi_t *dev)) { uint64_t clock = acpi_clock_get(); clock -= acpi_last_clock; diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 595d89f70..2cdcc5a22 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -593,7 +593,7 @@ read_toc_raw(const cdrom_t *dev, unsigned char *b, const unsigned char start_tra } static int -track_type_is_valid(const cdrom_t *dev, const int type, const int flags, const int audio, +track_type_is_valid(UNUSED(const cdrom_t *dev), const int type, const int flags, const int audio, const int mode2) { if (!(flags & 0x70) && (flags & 0xf8)) { /* 0x08/0x80/0x88 are illegal modes */ @@ -1968,7 +1968,7 @@ cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf) /* TODO: Actually implement this properly. */ void -cdrom_get_q(cdrom_t *dev, uint8_t *buf, int *curtoctrk, uint8_t mode) +cdrom_get_q(UNUSED(cdrom_t *dev), uint8_t *buf, UNUSED(int *curtoctrk), UNUSED(uint8_t mode)) { memset(buf, 0x00, 10); } @@ -2641,18 +2641,6 @@ cdrom_read_track_information(cdrom_t *dev, const uint8_t *cdb, uint8_t *buffer) return ret; } -int -cdrom_ext_medium_changed(const cdrom_t *dev) -{ - int ret = 0; - - if (dev && dev->ops && dev->ops->ext_medium_changed && - (dev->cd_status != CD_STATUS_PLAYING) && (dev->cd_status != CD_STATUS_PAUSED)) - ret = dev->ops->ext_medium_changed(dev->local); - - return ret; -} - int cdrom_is_empty(const uint8_t id) { @@ -2700,6 +2688,44 @@ cdrom_toc_dump(cdrom_t *dev) } #endif +void +cdrom_set_empty(cdrom_t *dev) +{ + dev->cd_status = CD_STATUS_EMPTY; +} + +void +cdrom_update_status(cdrom_t *dev) +{ + const int was_empty = (dev->cd_status == CD_STATUS_EMPTY); + + if (dev->ops->load != NULL) + dev->ops->load(dev->local); + + /* All good, reset state. */ + dev->seek_pos = 0; + dev->cd_buflen = 0; + + if ((dev->ops->is_empty != NULL) && dev->ops->is_empty(dev->local)) + dev->cd_status = CD_STATUS_EMPTY; + else if (dev->ops->is_dvd(dev->local)) + dev->cd_status = CD_STATUS_DVD; + else + dev->cd_status = dev->ops->has_audio(dev->local) ? CD_STATUS_STOPPED : + CD_STATUS_DATA_ONLY; + + dev->cdrom_capacity = dev->ops->get_last_block(dev->local); + + if (dev->cd_status != CD_STATUS_EMPTY) { + /* Signal media change to the emulated machine. */ + cdrom_insert(dev->id); + + /* The drive was previously empty, transition directly to UNIT ATTENTION. */ + if (was_empty) + cdrom_insert(dev->id); + } +} + int cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert) { @@ -2728,10 +2754,12 @@ cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert) dev->seek_pos = 0; dev->cd_buflen = 0; + if ((dev->ops->is_empty != NULL) && dev->ops->is_empty(dev->local)) + dev->cd_status = CD_STATUS_EMPTY; if (dev->ops->is_dvd(dev->local)) dev->cd_status = CD_STATUS_DVD; else - dev->cd_status = dev->ops->has_audio(dev->local) ? CD_STATUS_STOPPED : + dev->cd_status = dev->ops->has_audio(dev->local) ? CD_STATUS_STOPPED : CD_STATUS_DATA_ONLY; dev->cdrom_capacity = dev->ops->get_last_block(dev->local); @@ -2744,7 +2772,7 @@ cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert) cdrom_toc_dump(dev); #endif - if (!skip_insert) { + if (!skip_insert && (dev->cd_status != CD_STATUS_EMPTY)) { /* Signal media change to the emulated machine. */ cdrom_insert(dev->id); diff --git a/src/cdrom/cdrom_image.c b/src/cdrom/cdrom_image.c index afc70bda7..271a290cb 100644 --- a/src/cdrom/cdrom_image.c +++ b/src/cdrom/cdrom_image.c @@ -1992,7 +1992,8 @@ static const cdrom_ops_t image_ops = { image_is_dvd, image_has_audio, NULL, - image_close + image_close, + NULL }; /* Public functions. */ diff --git a/src/cdrom/cdrom_image_viso.c b/src/cdrom/cdrom_image_viso.c index 52657e38d..4bf976794 100644 --- a/src/cdrom/cdrom_image_viso.c +++ b/src/cdrom/cdrom_image_viso.c @@ -32,13 +32,13 @@ #include #include #include <86box/86box.h> -#include <86box/bswap.h> #include <86box/cdrom.h> #include <86box/cdrom_image.h> #include <86box/cdrom_image_viso.h> #include <86box/log.h> #include <86box/path.h> #include <86box/plat.h> +#include <86box/bswap.h> #include <86box/plat_dir.h> #include <86box/version.h> #include <86box/nvr.h> diff --git a/src/chipset/82c100.c b/src/chipset/82c100.c index 05c3522d8..a9d61b3b9 100644 --- a/src/chipset/82c100.c +++ b/src/chipset/82c100.c @@ -358,8 +358,7 @@ ct_82c100_init(UNUSED(const device_t *info)) { ct_82c100_t *dev; - dev = (ct_82c100_t *) malloc(sizeof(ct_82c100_t)); - memset(dev, 0x00, sizeof(ct_82c100_t)); + dev = (ct_82c100_t *) calloc(1, sizeof(ct_82c100_t)); ct_82c100_reset(dev); diff --git a/src/chipset/acc2168.c b/src/chipset/acc2168.c index 982f50e82..dbbdc99f6 100644 --- a/src/chipset/acc2168.c +++ b/src/chipset/acc2168.c @@ -184,8 +184,7 @@ acc2168_close(void *priv) static void * acc2168_init(UNUSED(const device_t *info)) { - acc2168_t *dev = (acc2168_t *) malloc(sizeof(acc2168_t)); - memset(dev, 0, sizeof(acc2168_t)); + acc2168_t *dev = (acc2168_t *) calloc(1, sizeof(acc2168_t)); device_add(&port_92_device); io_sethandler(0x00f2, 0x0002, acc2168_read, NULL, NULL, acc2168_write, NULL, NULL, dev); diff --git a/src/chipset/ali1409.c b/src/chipset/ali1409.c index 8cda1a22b..5009a6505 100644 --- a/src/chipset/ali1409.c +++ b/src/chipset/ali1409.c @@ -40,9 +40,8 @@ #include <86box/fdc.h> #include <86box/smram.h> #include <86box/chipset.h> - +#include <86box/plat_unused.h> - #ifdef ENABLE_ALI1409_LOG int ali1409_do_log = ENABLE_ALI1409_LOG; @@ -161,10 +160,9 @@ ali1409_close(void *priv) } static void * -ali1409_init(const device_t *info) +ali1409_init(UNUSED(const device_t *info)) { - ali1409_t *dev = (ali1409_t *) malloc(sizeof(ali1409_t)); - memset(dev, 0, sizeof(ali1409_t)); + ali1409_t *dev = (ali1409_t *) calloc(1, sizeof(ali1409_t)); dev->cfg_locked = 1; @@ -173,7 +171,7 @@ ali1409_init(const device_t *info) 23h Data Port */ - ali1409_log ("Bus speed: %i",cpu_busspeed); + ali1409_log ("Bus speed: %i", cpu_busspeed); io_sethandler(0x0022, 0x0002, ali1409_read, NULL, NULL, ali1409_write, NULL, NULL, dev); diff --git a/src/chipset/ali1429.c b/src/chipset/ali1429.c index 4a6a5cfa9..e2478078f 100644 --- a/src/chipset/ali1429.c +++ b/src/chipset/ali1429.c @@ -331,8 +331,7 @@ ali1429_defaults(ali1429_t *dev) static void * ali1429_init(const device_t *info) { - ali1429_t *dev = (ali1429_t *) malloc(sizeof(ali1429_t)); - memset(dev, 0, sizeof(ali1429_t)); + ali1429_t *dev = (ali1429_t *) calloc(1, sizeof(ali1429_t)); dev->cfg_locked = 1; GREEN = info->local; diff --git a/src/chipset/ali1435.c b/src/chipset/ali1435.c index 8360267c9..ff096ac55 100644 --- a/src/chipset/ali1435.c +++ b/src/chipset/ali1435.c @@ -282,8 +282,7 @@ ali1435_close(void *priv) static void * ali1435_init(UNUSED(const device_t *info)) { - ali1435_t *dev = (ali1435_t *) malloc(sizeof(ali1435_t)); - memset(dev, 0, sizeof(ali1435_t)); + ali1435_t *dev = (ali1435_t *) calloc(1, sizeof(ali1435_t)); dev->cfg_locked = 1; diff --git a/src/chipset/ali1489.c b/src/chipset/ali1489.c index c61dd1511..fc51bbed2 100644 --- a/src/chipset/ali1489.c +++ b/src/chipset/ali1489.c @@ -470,8 +470,7 @@ ali1489_close(void *priv) static void * ali1489_init(UNUSED(const device_t *info)) { - ali1489_t *dev = (ali1489_t *) malloc(sizeof(ali1489_t)); - memset(dev, 0, sizeof(ali1489_t)); + ali1489_t *dev = (ali1489_t *) calloc(1, sizeof(ali1489_t)); /* M1487/M1489 22h Index Port diff --git a/src/chipset/ali1531.c b/src/chipset/ali1531.c index 1ff0689ad..e765e6d45 100644 --- a/src/chipset/ali1531.c +++ b/src/chipset/ali1531.c @@ -369,8 +369,7 @@ ali1531_close(void *priv) static void * ali1531_init(UNUSED(const device_t *info)) { - ali1531_t *dev = (ali1531_t *) malloc(sizeof(ali1531_t)); - memset(dev, 0, sizeof(ali1531_t)); + ali1531_t *dev = (ali1531_t *) calloc(1, sizeof(ali1531_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, ali1531_read, ali1531_write, dev, &dev->pci_slot); diff --git a/src/chipset/ali1541.c b/src/chipset/ali1541.c index 3d7c1c546..eed6ddbc5 100644 --- a/src/chipset/ali1541.c +++ b/src/chipset/ali1541.c @@ -643,8 +643,7 @@ ali1541_close(void *priv) static void * ali1541_init(UNUSED(const device_t *info)) { - ali1541_t *dev = (ali1541_t *) malloc(sizeof(ali1541_t)); - memset(dev, 0, sizeof(ali1541_t)); + ali1541_t *dev = (ali1541_t *) calloc(1, sizeof(ali1541_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, ali1541_read, ali1541_write, dev, &dev->pci_slot); diff --git a/src/chipset/ali1543.c b/src/chipset/ali1543.c index 2b9c93cb4..69a8990e9 100644 --- a/src/chipset/ali1543.c +++ b/src/chipset/ali1543.c @@ -1599,8 +1599,7 @@ ali1543_close(void *priv) static void * ali1543_init(const device_t *info) { - ali1543_t *dev = (ali1543_t *) malloc(sizeof(ali1543_t)); - memset(dev, 0, sizeof(ali1543_t)); + ali1543_t *dev = (ali1543_t *) calloc(1, sizeof(ali1543_t)); /* Device 02: M1533 Southbridge */ pci_add_card(PCI_ADD_SOUTHBRIDGE, ali1533_read, ali1533_write, dev, &dev->pci_slot); diff --git a/src/chipset/ali1621.c b/src/chipset/ali1621.c index 96748ce34..d44c0f5a9 100644 --- a/src/chipset/ali1621.c +++ b/src/chipset/ali1621.c @@ -669,8 +669,7 @@ ali1621_close(void *priv) static void * ali1621_init(UNUSED(const device_t *info)) { - ali1621_t *dev = (ali1621_t *) malloc(sizeof(ali1621_t)); - memset(dev, 0, sizeof(ali1621_t)); + ali1621_t *dev = (ali1621_t *) calloc(1, sizeof(ali1621_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, ali1621_read, ali1621_write, dev, &dev->pci_slot); diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index 2d66ba9d1..c351a0cfa 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -466,8 +466,7 @@ ali6117_init(const device_t *info) ali6117_log("ALI6117: init()\n"); - ali6117_t *dev = (ali6117_t *) malloc(sizeof(ali6117_t)); - memset(dev, 0, sizeof(ali6117_t)); + ali6117_t *dev = (ali6117_t *) calloc(1, sizeof(ali6117_t)); dev->local = info->local; diff --git a/src/chipset/contaq_82c59x.c b/src/chipset/contaq_82c59x.c index 90667c42f..1981fd11c 100644 --- a/src/chipset/contaq_82c59x.c +++ b/src/chipset/contaq_82c59x.c @@ -322,8 +322,7 @@ contaq_82c59x_close(void *priv) static void * contaq_82c59x_init(const device_t *info) { - contaq_82c59x_t *dev = (contaq_82c59x_t *) malloc(sizeof(contaq_82c59x_t)); - memset(dev, 0x00, sizeof(contaq_82c59x_t)); + contaq_82c59x_t *dev = (contaq_82c59x_t *) calloc(1, sizeof(contaq_82c59x_t)); dev->green = info->local; diff --git a/src/chipset/cs4031.c b/src/chipset/cs4031.c index b482fa254..cfec9ad30 100644 --- a/src/chipset/cs4031.c +++ b/src/chipset/cs4031.c @@ -164,8 +164,7 @@ cs4031_close(void *priv) static void * cs4031_init(UNUSED(const device_t *info)) { - cs4031_t *dev = (cs4031_t *) malloc(sizeof(cs4031_t)); - memset(dev, 0, sizeof(cs4031_t)); + cs4031_t *dev = (cs4031_t *) calloc(1, sizeof(cs4031_t)); dev->port_92 = device_add(&port_92_device); diff --git a/src/chipset/cs8230.c b/src/chipset/cs8230.c index 62852b88d..0374a44a6 100644 --- a/src/chipset/cs8230.c +++ b/src/chipset/cs8230.c @@ -157,8 +157,7 @@ cs8230_close(void *priv) static void * cs8230_init(UNUSED(const device_t *info)) { - cs8230_t *cs8230 = (cs8230_t *) malloc(sizeof(cs8230_t)); - memset(cs8230, 0, sizeof(cs8230_t)); + cs8230_t *cs8230 = (cs8230_t *) calloc(1, sizeof(cs8230_t)); io_sethandler(0x0022, 0x0002, cs8230_read, NULL, NULL, cs8230_write, NULL, NULL, cs8230); diff --git a/src/chipset/et6000.c b/src/chipset/et6000.c index 608f2cc9b..14ebf852e 100644 --- a/src/chipset/et6000.c +++ b/src/chipset/et6000.c @@ -137,8 +137,7 @@ et6000_close(void *priv) static void * et6000_init(UNUSED(const device_t *info)) { - et6000_t *dev = (et6000_t *) malloc(sizeof(et6000_t)); - memset(dev, 0, sizeof(et6000_t)); + et6000_t *dev = (et6000_t *) calloc(1, sizeof(et6000_t)); /* Port 92h */ device_add(&port_92_device); diff --git a/src/chipset/gc100.c b/src/chipset/gc100.c index fc2321fae..23455b952 100644 --- a/src/chipset/gc100.c +++ b/src/chipset/gc100.c @@ -208,8 +208,7 @@ gc100_close(void *priv) static void * gc100_init(const device_t *info) { - gc100_t *dev = (gc100_t *) malloc(sizeof(gc100_t)); - memset(dev, 0, sizeof(gc100_t)); + gc100_t *dev = (gc100_t *) calloc(1, sizeof(gc100_t)); dev->reg[0x2] = 0xff; dev->reg[0x3] = 0x0; diff --git a/src/chipset/headland.c b/src/chipset/headland.c index 9d7cf97c7..1172d105d 100644 --- a/src/chipset/headland.c +++ b/src/chipset/headland.c @@ -594,8 +594,7 @@ headland_init(const device_t *info) headland_t *dev; int ht386 = 0; - dev = (headland_t *) malloc(sizeof(headland_t)); - memset(dev, 0x00, sizeof(headland_t)); + dev = (headland_t *) calloc(1, sizeof(headland_t)); dev->has_cri = (info->local & HEADLAND_HAS_CRI); dev->has_sleep = (info->local & HEADLAND_HAS_SLEEP); diff --git a/src/chipset/ims8848.c b/src/chipset/ims8848.c index 0ce3a5e44..094ee31f8 100644 --- a/src/chipset/ims8848.c +++ b/src/chipset/ims8848.c @@ -381,8 +381,7 @@ ims8848_close(void *priv) static void * ims8848_init(UNUSED(const device_t *info)) { - ims8848_t *dev = (ims8848_t *) malloc(sizeof(ims8848_t)); - memset(dev, 0, sizeof(ims8848_t)); + ims8848_t *dev = (ims8848_t *) calloc(1, sizeof(ims8848_t)); device_add(&port_92_device); diff --git a/src/chipset/intel_420ex.c b/src/chipset/intel_420ex.c index 7b069cce3..662fd0509 100644 --- a/src/chipset/intel_420ex.c +++ b/src/chipset/intel_420ex.c @@ -533,8 +533,7 @@ i420ex_speed_changed(void *priv) static void * i420ex_init(const device_t *info) { - i420ex_t *dev = (i420ex_t *) malloc(sizeof(i420ex_t)); - memset(dev, 0, sizeof(i420ex_t)); + i420ex_t *dev = (i420ex_t *) calloc(1, sizeof(i420ex_t)); dev->smram = smram_add(); diff --git a/src/chipset/intel_4x0.c b/src/chipset/intel_4x0.c index 36303deb7..f9d6af150 100644 --- a/src/chipset/intel_4x0.c +++ b/src/chipset/intel_4x0.c @@ -1608,11 +1608,9 @@ i4x0_close(void *priv) static void * i4x0_init(const device_t *info) { - i4x0_t *dev = (i4x0_t *) malloc(sizeof(i4x0_t)); + i4x0_t *dev = (i4x0_t *) calloc(1, sizeof(i4x0_t)); uint8_t *regs; - memset(dev, 0, sizeof(i4x0_t)); - dev->smram_low = smram_add(); dev->smram_high = smram_add(); diff --git a/src/chipset/intel_82335.c b/src/chipset/intel_82335.c index cc7f07c3a..bd53e0d05 100644 --- a/src/chipset/intel_82335.c +++ b/src/chipset/intel_82335.c @@ -171,8 +171,7 @@ intel_82335_close(void *priv) static void * intel_82335_init(UNUSED(const device_t *info)) { - intel_82335_t *dev = (intel_82335_t *) malloc(sizeof(intel_82335_t)); - memset(dev, 0, sizeof(intel_82335_t)); + intel_82335_t *dev = (intel_82335_t *) calloc(1, sizeof(intel_82335_t)); memset(dev->regs, 0, sizeof(dev->regs)); diff --git a/src/chipset/intel_i450kx.c b/src/chipset/intel_i450kx.c index 1dfd6f315..34cc6a62f 100644 --- a/src/chipset/intel_i450kx.c +++ b/src/chipset/intel_i450kx.c @@ -799,8 +799,8 @@ i450kx_close(void *priv) static void * i450kx_init(UNUSED(const device_t *info)) { - i450kx_t *dev = (i450kx_t *) malloc(sizeof(i450kx_t)); - memset(dev, 0, sizeof(i450kx_t)); + i450kx_t *dev = (i450kx_t *) calloc(1, sizeof(i450kx_t)); + pci_add_card(PCI_ADD_NORTHBRIDGE, pb_read, pb_write, dev, &dev->pb_slot); /* Device 19h: Intel 450KX PCI Bridge PB */ pci_add_card(PCI_ADD_NORTHBRIDGE_SEC, mc_read, mc_write, dev, &dev->mc_slot); /* Device 14h: Intel 450KX Memory Controller MC */ diff --git a/src/chipset/intel_piix.c b/src/chipset/intel_piix.c index e52492df9..6969d3274 100644 --- a/src/chipset/intel_piix.c +++ b/src/chipset/intel_piix.c @@ -1538,8 +1538,7 @@ piix_speed_changed(void *priv) static void * piix_init(const device_t *info) { - piix_t *dev = (piix_t *) malloc(sizeof(piix_t)); - memset(dev, 0, sizeof(piix_t)); + piix_t *dev = (piix_t *) calloc(1, sizeof(piix_t)); dev->type = info->local & 0x0f; /* If (dev->type == 4) and (dev->rev & 0x08), then this is PIIX4E. */ diff --git a/src/chipset/intel_sio.c b/src/chipset/intel_sio.c index c66b5ce04..9b6d28ab1 100644 --- a/src/chipset/intel_sio.c +++ b/src/chipset/intel_sio.c @@ -508,8 +508,7 @@ sio_speed_changed(void *priv) static void * sio_init(const device_t *info) { - sio_t *dev = (sio_t *) malloc(sizeof(sio_t)); - memset(dev, 0, sizeof(sio_t)); + sio_t *dev = (sio_t *) calloc(1, sizeof(sio_t)); pci_add_card(PCI_ADD_SOUTHBRIDGE, sio_read, sio_write, dev, &dev->pci_slot); diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 6f7dc5be3..069fa87e4 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -906,8 +906,7 @@ neat_init(UNUSED(const device_t *info)) uint8_t j; /* Create an instance. */ - dev = (neat_t *) malloc(sizeof(neat_t)); - memset(dev, 0x00, sizeof(neat_t)); + dev = (neat_t *) calloc(1, sizeof(neat_t)); /* Get configured I/O address. */ j = (dev->regs[REG_RB9] & RB9_BASE) >> RB9_BASE_SH; diff --git a/src/chipset/olivetti_eva.c b/src/chipset/olivetti_eva.c index bdb5440c9..7defac6ae 100644 --- a/src/chipset/olivetti_eva.c +++ b/src/chipset/olivetti_eva.c @@ -134,8 +134,7 @@ olivetti_eva_close(void *priv) static void * olivetti_eva_init(UNUSED(const device_t *info)) { - olivetti_eva_t *dev = (olivetti_eva_t *) malloc(sizeof(olivetti_eva_t)); - memset(dev, 0, sizeof(olivetti_eva_t)); + olivetti_eva_t *dev = (olivetti_eva_t *) calloc(1, sizeof(olivetti_eva_t)); /* GA98 registers */ dev->reg_065 = 0x00; diff --git a/src/chipset/opti283.c b/src/chipset/opti283.c index b708eb0ab..395ad4212 100644 --- a/src/chipset/opti283.c +++ b/src/chipset/opti283.c @@ -284,8 +284,7 @@ opti283_close(void *priv) static void * opti283_init(UNUSED(const device_t *info)) { - opti283_t *dev = (opti283_t *) malloc(sizeof(opti283_t)); - memset(dev, 0x00, sizeof(opti283_t)); + opti283_t *dev = (opti283_t *) calloc(1, sizeof(opti283_t)); io_sethandler(0x0022, 0x0001, opti283_read, NULL, NULL, opti283_write, NULL, NULL, dev); io_sethandler(0x0023, 0x0001, opti283_read, NULL, NULL, opti283_write, NULL, NULL, dev); diff --git a/src/chipset/opti291.c b/src/chipset/opti291.c index 0ff037434..91b9010e2 100644 --- a/src/chipset/opti291.c +++ b/src/chipset/opti291.c @@ -138,8 +138,7 @@ opti291_close(void *priv) static void * opti291_init(UNUSED(const device_t *info)) { - opti291_t *dev = (opti291_t *) malloc(sizeof(opti291_t)); - memset(dev, 0, sizeof(opti291_t)); + opti291_t *dev = (opti291_t *) calloc(1, sizeof(opti291_t)); io_sethandler(0x022, 0x0001, opti291_read, NULL, NULL, opti291_write, NULL, NULL, dev); io_sethandler(0x024, 0x0001, opti291_read, NULL, NULL, opti291_write, NULL, NULL, dev); diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index f53ae0899..aa4e4b4c5 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -219,8 +219,7 @@ opti495_close(void *priv) static void * opti495_init(const device_t *info) { - opti495_t *dev = (opti495_t *) malloc(sizeof(opti495_t)); - memset(dev, 0, sizeof(opti495_t)); + opti495_t *dev = (opti495_t *) calloc(1, sizeof(opti495_t)); device_add(&port_92_device); diff --git a/src/chipset/opti499.c b/src/chipset/opti499.c index 81c5bee5a..d54e8184e 100644 --- a/src/chipset/opti499.c +++ b/src/chipset/opti499.c @@ -242,8 +242,7 @@ opti499_close(void *priv) static void * opti499_init(UNUSED(const device_t *info)) { - opti499_t *dev = (opti499_t *) malloc(sizeof(opti499_t)); - memset(dev, 0, sizeof(opti499_t)); + opti499_t *dev = (opti499_t *) calloc(1, sizeof(opti499_t)); device_add(&port_92_device); diff --git a/src/chipset/opti5x7.c b/src/chipset/opti5x7.c index 015ffb9f4..03fde4173 100644 --- a/src/chipset/opti5x7.c +++ b/src/chipset/opti5x7.c @@ -172,8 +172,7 @@ opti5x7_close(void *priv) static void * opti5x7_init(const device_t *info) { - opti5x7_t *dev = (opti5x7_t *) malloc(sizeof(opti5x7_t)); - memset(dev, 0, sizeof(opti5x7_t)); + opti5x7_t *dev = (opti5x7_t *) calloc(1, sizeof(opti5x7_t)); dev->is_pci = info->local; diff --git a/src/chipset/opti822.c b/src/chipset/opti822.c index 9dd835412..471fbe393 100644 --- a/src/chipset/opti822.c +++ b/src/chipset/opti822.c @@ -394,8 +394,7 @@ opti822_close(void *priv) static void * opti822_init(UNUSED(const device_t *info)) { - opti822_t *dev = (opti822_t *) malloc(sizeof(opti822_t)); - memset(dev, 0, sizeof(opti822_t)); + opti822_t *dev = (opti822_t *) calloc(1, sizeof(opti822_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, opti822_pci_read, opti822_pci_write, dev, &dev->pci_slot); diff --git a/src/chipset/opti895.c b/src/chipset/opti895.c index 4ce31c362..cb55ef2a7 100644 --- a/src/chipset/opti895.c +++ b/src/chipset/opti895.c @@ -259,8 +259,7 @@ opti895_close(void *priv) static void * opti895_init(const device_t *info) { - opti895_t *dev = (opti895_t *) malloc(sizeof(opti895_t)); - memset(dev, 0, sizeof(opti895_t)); + opti895_t *dev = (opti895_t *) calloc(1, sizeof(opti895_t)); device_add(&port_92_device); diff --git a/src/chipset/scamp.c b/src/chipset/scamp.c index 6a38f4ec2..8e7892c2e 100644 --- a/src/chipset/scamp.c +++ b/src/chipset/scamp.c @@ -1046,8 +1046,7 @@ static void * scamp_init(UNUSED(const device_t *info)) { uint32_t addr; - scamp_t *dev = (scamp_t *) malloc(sizeof(scamp_t)); - memset(dev, 0x00, sizeof(scamp_t)); + scamp_t *dev = (scamp_t *) calloc(1, sizeof(scamp_t)); dev->cfg_regs[CFG_ID] = ID_VL82C311; dev->cfg_enable = 1; diff --git a/src/chipset/scat.c b/src/chipset/scat.c index edbaf41e3..43f93649e 100644 --- a/src/chipset/scat.c +++ b/src/chipset/scat.c @@ -1403,8 +1403,7 @@ scat_init(const device_t *info) uint32_t k; int sx; - dev = (scat_t *) malloc(sizeof(scat_t)); - memset(dev, 0x00, sizeof(scat_t)); + dev = (scat_t *) calloc(1, sizeof(scat_t)); dev->type = info->local; sx = (dev->type == 32) ? 1 : 0; diff --git a/src/chipset/sis_5513_p2i.c b/src/chipset/sis_5513_p2i.c index e7012e1b6..3655ccc3f 100644 --- a/src/chipset/sis_5513_p2i.c +++ b/src/chipset/sis_5513_p2i.c @@ -115,7 +115,7 @@ sis_5513_apc_reset(sis_5513_pci_to_isa_t *dev) } static void -sis_5513_apc_write(uint16_t addr, uint8_t val, void *priv) +sis_5513_apc_write(UNUSED(uint16_t addr), uint8_t val, void *priv) { sis_5513_pci_to_isa_t *dev = (sis_5513_pci_to_isa_t *) priv; uint8_t nvr_index = nvr_get_index(dev->nvr, 0); @@ -135,7 +135,7 @@ sis_5513_apc_write(uint16_t addr, uint8_t val, void *priv) } static uint8_t -sis_5513_apc_read(uint16_t addr, void *priv) +sis_5513_apc_read(UNUSED(uint16_t addr), void *priv) { sis_5513_pci_to_isa_t *dev = (sis_5513_pci_to_isa_t *) priv; uint8_t nvr_index = nvr_get_index(dev->nvr, 0); diff --git a/src/chipset/sis_5571_old.c b/src/chipset/sis_5571_old.c index 422ed4bb8..495137aed 100644 --- a/src/chipset/sis_5571_old.c +++ b/src/chipset/sis_5571_old.c @@ -732,8 +732,7 @@ sis_5571_close(void *priv) static void * sis_5571_init(UNUSED(const device_t *info)) { - sis_5571_t *dev = (sis_5571_t *) malloc(sizeof(sis_5571_t)); - memset(dev, 0x00, sizeof(sis_5571_t)); + sis_5571_t *dev = (sis_5571_t *) calloc(1, sizeof(sis_5571_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, memory_pci_bridge_read, memory_pci_bridge_write, dev, &dev->nb_slot); pci_add_card(PCI_ADD_SOUTHBRIDGE, pci_isa_bridge_read, pci_isa_bridge_write, dev, &dev->sb_slot); diff --git a/src/chipset/sis_5595_pmu.c b/src/chipset/sis_5595_pmu.c index 2f5aa10b1..7de9735f1 100644 --- a/src/chipset/sis_5595_pmu.c +++ b/src/chipset/sis_5595_pmu.c @@ -119,7 +119,7 @@ sis_5595_pmu_trap_io_mask(int size, uint16_t addr, uint8_t write, uint8_t val, v } static void -sis_5595_pmu_trap_io_ide_bm(int size, uint16_t addr, uint8_t write, uint8_t val, void *priv) +sis_5595_pmu_trap_io_ide_bm(UNUSED(int size), UNUSED(uint16_t addr), UNUSED(uint8_t write), UNUSED(uint8_t val), void *priv) { sis_5595_pmu_io_trap_t *trap = (sis_5595_pmu_io_trap_t *) priv; sis_5595_pmu_t *dev = (sis_5595_pmu_t *) trap->priv; diff --git a/src/chipset/sis_85c310.c b/src/chipset/sis_85c310.c index d62cc3b24..dfbd4b465 100644 --- a/src/chipset/sis_85c310.c +++ b/src/chipset/sis_85c310.c @@ -130,8 +130,7 @@ rabbit_close(void *priv) static void * rabbit_init(UNUSED(const device_t *info)) { - rabbit_t *dev = (rabbit_t *) malloc(sizeof(rabbit_t)); - memset(dev, 0, sizeof(rabbit_t)); + rabbit_t *dev = (rabbit_t *) calloc(1, sizeof(rabbit_t)); io_sethandler(0x0022, 0x0002, rabbit_read, NULL, NULL, rabbit_write, NULL, NULL, dev); diff --git a/src/chipset/sis_85c496.c b/src/chipset/sis_85c496.c index 5ba315822..10bccc1c8 100644 --- a/src/chipset/sis_85c496.c +++ b/src/chipset/sis_85c496.c @@ -637,8 +637,7 @@ static void * sis_85c496_init(const device_t *info) { - sis_85c496_t *dev = malloc(sizeof(sis_85c496_t)); - memset(dev, 0x00, sizeof(sis_85c496_t)); + sis_85c496_t *dev = calloc(1, sizeof(sis_85c496_t)); dev->smram = smram_add(); diff --git a/src/chipset/sis_85c4xx.c b/src/chipset/sis_85c4xx.c index 1f98ee8a6..6e26a4751 100644 --- a/src/chipset/sis_85c4xx.c +++ b/src/chipset/sis_85c4xx.c @@ -368,8 +368,7 @@ sis_85c4xx_close(void *priv) static void * sis_85c4xx_init(const device_t *info) { - sis_85c4xx_t *dev = (sis_85c4xx_t *) malloc(sizeof(sis_85c4xx_t)); - memset(dev, 0, sizeof(sis_85c4xx_t)); + sis_85c4xx_t *dev = (sis_85c4xx_t *) calloc(1, sizeof(sis_85c4xx_t)); dev->is_471 = (info->local >> 8) & 0xff; diff --git a/src/chipset/stpc.c b/src/chipset/stpc.c index 3bb3a7c2a..23cc56bd3 100644 --- a/src/chipset/stpc.c +++ b/src/chipset/stpc.c @@ -912,8 +912,7 @@ stpc_init(const device_t *info) { stpc_log("STPC: init()\n"); - stpc_t *dev = (stpc_t *) malloc(sizeof(stpc_t)); - memset(dev, 0, sizeof(stpc_t)); + stpc_t *dev = (stpc_t *) calloc(1, sizeof(stpc_t)); dev->local = info->local; @@ -963,8 +962,7 @@ stpc_serial_init(UNUSED(const device_t *info)) { stpc_log("STPC: serial_init()\n"); - stpc_serial_t *dev = (stpc_serial_t *) malloc(sizeof(stpc_serial_t)); - memset(dev, 0, sizeof(stpc_serial_t)); + stpc_serial_t *dev = (stpc_serial_t *) calloc(1, sizeof(stpc_serial_t)); dev->uart[0] = device_add_inst(&ns16550_device, 1); dev->uart[1] = device_add_inst(&ns16550_device, 2); @@ -1076,8 +1074,7 @@ stpc_lpt_init(UNUSED(const device_t *info)) { stpc_log("STPC: lpt_init()\n"); - stpc_lpt_t *dev = (stpc_lpt_t *) malloc(sizeof(stpc_lpt_t)); - memset(dev, 0, sizeof(stpc_lpt_t)); + stpc_lpt_t *dev = (stpc_lpt_t *) calloc(1, sizeof(stpc_lpt_t)); stpc_lpt_reset(dev); diff --git a/src/chipset/umc_8886.c b/src/chipset/umc_8886.c index 30b0ecb71..f96480c2c 100644 --- a/src/chipset/umc_8886.c +++ b/src/chipset/umc_8886.c @@ -392,8 +392,7 @@ umc_8886_close(void *priv) static void * umc_8886_init(const device_t *info) { - umc_8886_t *dev = (umc_8886_t *) malloc(sizeof(umc_8886_t)); - memset(dev, 0, sizeof(umc_8886_t)); + umc_8886_t *dev = (umc_8886_t *) calloc(1, sizeof(umc_8886_t)); /* Device 12: UMC 8886xx */ pci_add_card(PCI_ADD_SOUTHBRIDGE, umc_8886_read, umc_8886_write, dev, &dev->pci_slot); diff --git a/src/chipset/umc_8890.c b/src/chipset/umc_8890.c index 37862e2fc..cb69ce6a8 100644 --- a/src/chipset/umc_8890.c +++ b/src/chipset/umc_8890.c @@ -38,6 +38,7 @@ #include <86box/smram.h> #include <86box/chipset.h> +#include <86box/plat_unused.h> #ifdef ENABLE_UMC_8890_LOG int umc_8890_do_log = ENABLE_UMC_8890_LOG; @@ -209,7 +210,7 @@ umc_8890_close(void *priv) static void * -umc_8890_init(const device_t *info) +umc_8890_init(UNUSED(const device_t *info)) { umc_8890_t *dev = (umc_8890_t *) calloc(1, sizeof(umc_8890_t)); diff --git a/src/chipset/umc_hb4.c b/src/chipset/umc_hb4.c index 98bdfc82c..889691988 100644 --- a/src/chipset/umc_hb4.c +++ b/src/chipset/umc_hb4.c @@ -450,8 +450,7 @@ ims8848_read(uint16_t addr, void *priv) static void * hb4_init(UNUSED(const device_t *info)) { - hb4_t *dev = (hb4_t *) malloc(sizeof(hb4_t)); - memset(dev, 0, sizeof(hb4_t)); + hb4_t *dev = (hb4_t *) calloc(1, sizeof(hb4_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, hb4_read, hb4_write, dev, &dev->pci_slot); /* Device 10: UMC 8881x */ diff --git a/src/chipset/via_apollo.c b/src/chipset/via_apollo.c index fa96c4927..110b1f8e1 100644 --- a/src/chipset/via_apollo.c +++ b/src/chipset/via_apollo.c @@ -725,8 +725,7 @@ via_apollo_reset(void *priv) static void * via_apollo_init(const device_t *info) { - via_apollo_t *dev = (via_apollo_t *) malloc(sizeof(via_apollo_t)); - memset(dev, 0, sizeof(via_apollo_t)); + via_apollo_t *dev = (via_apollo_t *) calloc(1, sizeof(via_apollo_t)); dev->smram = smram_add(); if (dev->id != VIA_8601) diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index 3a6e6fc5c..dcfe41811 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -1627,8 +1627,7 @@ pipc_reset(void *priv) static void * pipc_init(const device_t *info) { - pipc_t *dev = (pipc_t *) malloc(sizeof(pipc_t)); - memset(dev, 0, sizeof(pipc_t)); + pipc_t *dev = (pipc_t *) calloc(1, sizeof(pipc_t)); pipc_log("PIPC: init()\n"); diff --git a/src/chipset/via_vt82c49x.c b/src/chipset/via_vt82c49x.c index f36dad2e7..3aaef55a6 100644 --- a/src/chipset/via_vt82c49x.c +++ b/src/chipset/via_vt82c49x.c @@ -342,8 +342,7 @@ vt82c49x_close(void *priv) static void * vt82c49x_init(const device_t *info) { - vt82c49x_t *dev = (vt82c49x_t *) malloc(sizeof(vt82c49x_t)); - memset(dev, 0x00, sizeof(vt82c49x_t)); + vt82c49x_t *dev = (vt82c49x_t *) calloc(1, sizeof(vt82c49x_t)); dev->smram_smm = smram_add(); dev->smram_low = smram_add(); diff --git a/src/chipset/via_vt82c505.c b/src/chipset/via_vt82c505.c index 8cb6c67a0..dbbb447c7 100644 --- a/src/chipset/via_vt82c505.c +++ b/src/chipset/via_vt82c505.c @@ -167,7 +167,7 @@ vt82c505_in(uint16_t addr, void *priv) static void vt82c505_reset(void *priv) { - vt82c505_t *dev = (vt82c505_t *) malloc(sizeof(vt82c505_t)); + vt82c505_t *dev = (vt82c505_t *) calloc(1, sizeof(vt82c505_t)); dev->pci_conf[0x04] = 0x07; dev->pci_conf[0x07] = 0x00; @@ -204,8 +204,7 @@ vt82c505_close(void *priv) static void * vt82c505_init(UNUSED(const device_t *info)) { - vt82c505_t *dev = (vt82c505_t *) malloc(sizeof(vt82c505_t)); - memset(dev, 0, sizeof(vt82c505_t)); + vt82c505_t *dev = (vt82c505_t *) calloc(1, sizeof(vt82c505_t)); pci_add_card(PCI_ADD_NORTHBRIDGE, vt82c505_read, vt82c505_write, dev, &dev->pci_slot); diff --git a/src/chipset/vl82c480.c b/src/chipset/vl82c480.c index 38a6bdfb9..496544c63 100644 --- a/src/chipset/vl82c480.c +++ b/src/chipset/vl82c480.c @@ -180,8 +180,7 @@ vl82c480_close(void *priv) static void * vl82c480_init(const device_t *info) { - vl82c480_t *dev = (vl82c480_t *) malloc(sizeof(vl82c480_t)); - memset(dev, 0, sizeof(vl82c480_t)); + vl82c480_t *dev = (vl82c480_t *) calloc(1, sizeof(vl82c480_t)); dev->regs[0x00] = info->local; dev->regs[0x01] = 0xff; diff --git a/src/chipset/wd76c10.c b/src/chipset/wd76c10.c index 6de921af1..d7d8b0fe2 100644 --- a/src/chipset/wd76c10.c +++ b/src/chipset/wd76c10.c @@ -37,6 +37,7 @@ #include <86box/port_92.h> #include <86box/serial.h> #include <86box/plat_fallthrough.h> +#include <86box/plat_unused.h> #include <86box/chipset.h> /* Lock/Unlock Procedures */ @@ -879,12 +880,12 @@ wd76c10_reset(void *priv) static void * -wd76c10_init(const device_t *info) +wd76c10_init(UNUSED(const device_t *info)) { wd76c10_t *dev = (wd76c10_t *) calloc(1, sizeof(wd76c10_t)); uint32_t total_mem = mem_size << 10; uint32_t accum_mem = 0x00000000; - ram_bank_t *rb; + ram_bank_t *rb = NULL; /* Calculate the physical RAM banks. */ for (uint8_t i = 0; i < 4; i++) { diff --git a/src/codegen/codegen_ops_arith.h b/src/codegen/codegen_ops_arith.h index 28ee6d06c..50ef4310f 100644 --- a/src/codegen/codegen_ops_arith.h +++ b/src/codegen/codegen_ops_arith.h @@ -1,5 +1,5 @@ static uint32_t -ropINC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropINC_rw(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -22,7 +22,7 @@ ropINC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropINC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropINC_rl(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -45,7 +45,7 @@ ropINC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropDEC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropDEC_rw(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -68,7 +68,7 @@ ropDEC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropDEC_rl(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -93,7 +93,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod #define ROP_ARITH_RMW(name, op, writeback) \ static uint32_t \ - rop##name##_b_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_b_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -129,7 +129,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; \ } \ static uint32_t \ - rop##name##_w_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_w_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -165,7 +165,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; \ } \ static uint32_t \ - rop##name##_l_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_l_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -203,7 +203,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod #define ROP_ARITH_RM(name, op, writeback) \ static uint32_t \ - rop##name##_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_b_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -233,7 +233,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; \ } \ static uint32_t \ - rop##name##_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_w_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -263,7 +263,7 @@ ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; \ } \ static uint32_t \ - rop##name##_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_l_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -299,7 +299,7 @@ ROP_ARITH_RM(ADD, ADD, 1) ROP_ARITH_RM(SUB, SUB, 1) static uint32_t -ropCMP_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_b_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -326,7 +326,7 @@ ropCMP_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + 1; } static uint32_t -ropCMP_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_w_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -353,7 +353,7 @@ ropCMP_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + 1; } static uint32_t -ropCMP_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_l_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -381,7 +381,7 @@ ropCMP_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c } static uint32_t -ropCMP_b_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_b_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -408,7 +408,7 @@ ropCMP_b_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropCMP_w_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_w_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -435,7 +435,7 @@ ropCMP_w_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropCMP_l_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_l_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -463,7 +463,7 @@ ropCMP_l_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropADD_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropADD_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -478,7 +478,7 @@ ropADD_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropADD_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropADD_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -493,7 +493,7 @@ ropADD_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropADD_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropADD_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -510,7 +510,7 @@ ropADD_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -ropCMP_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -525,7 +525,7 @@ ropCMP_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropCMP_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -540,7 +540,7 @@ ropCMP_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropCMP_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCMP_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -557,7 +557,7 @@ ropCMP_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -ropSUB_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropSUB_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -572,7 +572,7 @@ ropSUB_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropSUB_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropSUB_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -587,7 +587,7 @@ ropSUB_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropSUB_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropSUB_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -604,7 +604,7 @@ ropSUB_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -rop80(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +rop80(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; uint32_t imm; @@ -679,7 +679,7 @@ rop80(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblo } static uint32_t -rop81_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +rop81_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; uint32_t imm; @@ -753,7 +753,7 @@ rop81_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 3; } static uint32_t -rop81_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +rop81_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; uint32_t imm; @@ -827,7 +827,7 @@ rop81_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -rop83_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +rop83_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; uint32_t imm; @@ -904,7 +904,7 @@ rop83_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 2; } static uint32_t -rop83_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +rop83_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; uint32_t imm; diff --git a/src/codegen/codegen_ops_fpu.h b/src/codegen/codegen_ops_fpu.h index 242743dee..a82b10d82 100644 --- a/src/codegen/codegen_ops_fpu.h +++ b/src/codegen/codegen_ops_fpu.h @@ -1,5 +1,5 @@ static uint32_t -ropFXCH(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFXCH(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); @@ -9,7 +9,7 @@ ropFXCH(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -ropFLD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFLD(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); @@ -19,7 +19,7 @@ ropFLD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codebl } static uint32_t -ropFST(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFST(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); @@ -28,7 +28,7 @@ ropFST(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codebl return op_pc; } static uint32_t -ropFSTP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSTP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); @@ -39,7 +39,7 @@ ropFSTP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -ropFLDs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFLDs(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -57,7 +57,7 @@ ropFLDs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 1; } static uint32_t -ropFLDd(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFLDd(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -76,7 +76,7 @@ ropFLDd(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -ropFILDw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFILDw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -94,7 +94,7 @@ ropFILDw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc + 1; } static uint32_t -ropFILDl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFILDl(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -112,7 +112,7 @@ ropFILDl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc + 1; } static uint32_t -ropFILDq(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFILDq(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -133,7 +133,7 @@ ropFILDq(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code } static uint32_t -ropFSTs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSTs(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; @@ -153,7 +153,7 @@ ropFSTs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 1; } static uint32_t -ropFSTd(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSTd(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg1; @@ -194,24 +194,28 @@ ropFSTPd(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return new_pc; } -#define ropFarith(name, size, load, op) \ - static uint32_t \ - ropF##name##size(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - x86seg *target_seg; \ - \ - FP_ENTER(); \ - op_pc--; \ - target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ - \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - \ - CHECK_SEG_READ(target_seg); \ - load(target_seg); \ - \ - op(FPU_##name); \ - \ - return op_pc + 1; \ +#define ropFarith(name, size, load, op) \ + static uint32_t \ + ropF##name##size(UNUSED(uint8_t opcode), \ + uint32_t fetchdat, \ + uint32_t op_32, \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + x86seg *target_seg; \ + \ + FP_ENTER(); \ + op_pc--; \ + target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ + \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + \ + CHECK_SEG_READ(target_seg); \ + load(target_seg); \ + \ + op(FPU_##name); \ + \ + return op_pc + 1; \ } ropFarith(ADD, s, MEM_LOAD_ADDR_EA_L, FP_OP_S); @@ -239,32 +243,40 @@ ropFarith(MUL, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL); ropFarith(SUB, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL); ropFarith(SUBR, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL); -#define ropFcompare(name, size, load, op) \ - static uint32_t \ - ropF##name##size(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - x86seg *target_seg; \ - \ - FP_ENTER(); \ - op_pc--; \ - target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ - \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - \ - CHECK_SEG_READ(target_seg); \ - load(target_seg); \ - \ - op(); \ - \ - return op_pc + 1; \ - } \ - static uint32_t ropF##name##P##size(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - uint32_t new_pc = ropF##name##size(opcode, fetchdat, op_32, op_pc, block); \ - \ - FP_POP(); \ - \ - return new_pc; \ +#define ropFcompare(name, size, load, op) \ + static uint32_t \ + ropF##name##size(UNUSED(uint8_t opcode), \ + uint32_t fetchdat, \ + uint32_t op_32, \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + x86seg *target_seg; \ + \ + FP_ENTER(); \ + op_pc--; \ + target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ + \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + \ + CHECK_SEG_READ(target_seg); \ + load(target_seg); \ + \ + op(); \ + \ + return op_pc + 1; \ + } \ + static uint32_t ropF##name##P##size(uint8_t opcode, \ + uint32_t fetchdat, \ + uint32_t op_32, \ + uint32_t op_pc, \ + codeblock_t *block) \ + { \ + uint32_t new_pc = ropF##name##size(opcode, fetchdat, op_32, op_pc, block); \ + \ + FP_POP(); \ + \ + return new_pc; \ } ropFcompare(COM, s, MEM_LOAD_ADDR_EA_L, FP_COMPARE_S); @@ -348,7 +360,7 @@ ropFSUBs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code #endif static uint32_t -ropFADD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFADD(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_ADD, 0, opcode & 7); @@ -356,7 +368,7 @@ ropFADD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } static uint32_t -ropFCOM(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFCOM(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_COMPARE_REG(0, opcode & 7); @@ -364,7 +376,7 @@ ropFCOM(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } static uint32_t -ropFDIV(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIV(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIV, 0, opcode & 7); @@ -372,7 +384,7 @@ ropFDIV(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } static uint32_t -ropFDIVR(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIVR(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIVR, 0, opcode & 7); @@ -380,7 +392,7 @@ ropFDIVR(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFMUL(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFMUL(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_MUL, 0, opcode & 7); @@ -388,7 +400,7 @@ ropFMUL(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } static uint32_t -ropFSUB(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUB(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUB, 0, opcode & 7); @@ -396,7 +408,7 @@ ropFSUB(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } static uint32_t -ropFSUBR(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUBR(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUBR, 0, opcode & 7); @@ -405,7 +417,7 @@ ropFSUBR(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code } static uint32_t -ropFADDr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFADDr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_ADD, opcode & 7, 0); @@ -413,7 +425,7 @@ ropFADDr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFDIVr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIVr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIV, opcode & 7, 0); @@ -421,7 +433,7 @@ ropFDIVr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFDIVRr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIVRr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIVR, opcode & 7, 0); @@ -429,7 +441,7 @@ ropFDIVRr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropFMULr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFMULr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_MUL, opcode & 7, 0); @@ -437,7 +449,7 @@ ropFMULr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFSUBr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUBr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUB, opcode & 7, 0); @@ -445,7 +457,7 @@ ropFSUBr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFSUBRr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUBRr(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUBR, opcode & 7, 0); @@ -454,7 +466,7 @@ ropFSUBRr(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropFADDP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFADDP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_ADD, opcode & 7, 0); @@ -463,7 +475,7 @@ ropFADDP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFCOMP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFCOMP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_COMPARE_REG(0, opcode & 7); @@ -472,7 +484,7 @@ ropFCOMP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFDIVP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIVP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIV, opcode & 7, 0); @@ -481,7 +493,7 @@ ropFDIVP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFDIVRP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFDIVRP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_DIVR, opcode & 7, 0); @@ -490,7 +502,7 @@ ropFDIVRP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropFMULP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFMULP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_MUL, opcode & 7, 0); @@ -499,7 +511,7 @@ ropFMULP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFSUBP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUBP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUB, opcode & 7, 0); @@ -508,7 +520,7 @@ ropFSUBP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc; } static uint32_t -ropFSUBRP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSUBRP(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_OP_REG(FPU_SUBR, opcode & 7, 0); @@ -518,7 +530,7 @@ ropFSUBRP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropFCOMPP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFCOMPP(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_COMPARE_REG(0, 1); @@ -528,7 +540,7 @@ ropFCOMPP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropFSTSW_AX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSTSW_AX(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -540,7 +552,7 @@ ropFSTSW_AX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c } static uint32_t -ropFISTw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFISTw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; @@ -560,7 +572,7 @@ ropFISTw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc + 1; } static uint32_t -ropFISTl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFISTl(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; @@ -599,7 +611,7 @@ ropFISTPl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return new_pc; } static uint32_t -ropFISTPq(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFISTPq(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg1; @@ -623,7 +635,7 @@ ropFISTPq(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropFLDCW(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFLDCW(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; @@ -640,7 +652,7 @@ ropFLDCW(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc + 1; } static uint32_t -ropFSTCW(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFSTCW(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; x86seg *target_seg; @@ -658,7 +670,7 @@ ropFSTCW(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code } static uint32_t -ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFCHS(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_FCHS(); @@ -666,17 +678,21 @@ ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; } -#define opFLDimm(name, v) \ - static uint32_t \ - ropFLD##name(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - static double fp_imm = v; \ - static uint64_t *fptr = (uint64_t *) &fp_imm; \ - \ - FP_ENTER(); \ - FP_LOAD_IMM_Q(*fptr); \ - \ - return op_pc; \ +#define opFLDimm(name, v) \ + static uint32_t \ + ropFLD##name(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + static double fp_imm = v; \ + static uint64_t *fptr = (uint64_t *) &fp_imm; \ + \ + FP_ENTER(); \ + FP_LOAD_IMM_Q(*fptr); \ + \ + return op_pc; \ } // clang-format off @@ -689,7 +705,7 @@ opFLDimm(Z, 0.0) // clang-format on static uint32_t -ropFLDLN2(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) +ropFLDLN2(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { FP_ENTER(); FP_LOAD_IMM_Q(0x3fe62e42fefa39f0ULL); diff --git a/src/codegen/codegen_ops_jump.h b/src/codegen/codegen_ops_jump.h index da16ce03e..4572b623b 100644 --- a/src/codegen/codegen_ops_jump.h +++ b/src/codegen/codegen_ops_jump.h @@ -1,5 +1,5 @@ static uint32_t -ropJMP_r8(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropJMP_r8(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t offset = fetchdat & 0xff; @@ -12,7 +12,7 @@ ropJMP_r8(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropJMP_r16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropJMP_r16(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint16_t offset = fetchdat & 0xffff; @@ -22,7 +22,7 @@ ropJMP_r16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropJMP_r32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropJMP_r32(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t offset = fastreadl(cs + op_pc); @@ -32,7 +32,7 @@ ropJMP_r32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropJCXZ(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropJCXZ(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t offset = fetchdat & 0xff; @@ -51,7 +51,7 @@ ropJCXZ(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -ropLOOP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropLOOP(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t offset = fetchdat & 0xff; @@ -214,45 +214,51 @@ BRANCH_COND_S(int pc_offset, uint32_t op_pc, uint32_t offset, int not ) } } -#define ropBRANCH(name, func, not ) \ - static uint32_t \ - rop##name(uint8_t opcode, uint32_t fetchdat, \ - uint32_t op_32, uint32_t op_pc, \ - codeblock_t *block) \ - { \ - uint32_t offset = fetchdat & 0xff; \ - \ - if (offset & 0x80) \ - offset |= 0xffffff00; \ - \ - func(1, op_pc, offset, not ); \ - \ - return op_pc + 1; \ - } \ - static uint32_t \ - rop##name##_w(uint8_t opcode, \ - uint32_t fetchdat, uint32_t op_32, \ - uint32_t op_pc, codeblock_t *block) \ - { \ - uint32_t offset = fetchdat & 0xffff; \ - \ - if (offset & 0x8000) \ - offset |= 0xffff0000; \ - \ - func(2, op_pc, offset, not ); \ - \ - return op_pc + 2; \ - } \ - static uint32_t \ - rop##name##_l(uint8_t opcode, \ - uint32_t fetchdat, uint32_t op_32, \ - uint32_t op_pc, codeblock_t *block) \ - { \ - uint32_t offset = fastreadl(cs + op_pc); \ - \ - func(4, op_pc, offset, not ); \ - \ - return op_pc + 4; \ +#define ropBRANCH(name, func, not ) \ + static uint32_t \ + rop##name(UNUSED(uint8_t opcode), \ + uint32_t fetchdat, \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + uint32_t offset = fetchdat & 0xff; \ + \ + if (offset & 0x80) \ + offset |= 0xffffff00; \ + \ + func(1, op_pc, offset, not ); \ + \ + return op_pc + 1; \ + } \ + static uint32_t \ + rop##name##_w(UNUSED(uint8_t opcode), \ + uint32_t fetchdat, \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + uint32_t offset = fetchdat & 0xffff; \ + \ + if (offset & 0x8000) \ + offset |= 0xffff0000; \ + \ + func(2, op_pc, offset, not ); \ + \ + return op_pc + 2; \ + } \ + static uint32_t \ + rop##name##_l(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + uint32_t offset = fastreadl(cs + op_pc); \ + \ + func(4, op_pc, offset, not ); \ + \ + return op_pc + 4; \ } // clang-format off diff --git a/src/codegen/codegen_ops_logic.h b/src/codegen/codegen_ops_logic.h index 9f23723e2..2c79c4a2d 100644 --- a/src/codegen/codegen_ops_logic.h +++ b/src/codegen/codegen_ops_logic.h @@ -1,6 +1,6 @@ #define ROP_LOGIC(name, op, writeback) \ static uint32_t \ - rop##name##_b_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_b_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -33,7 +33,7 @@ return op_pc + 1; \ } \ static uint32_t \ - rop##name##_w_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_w_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -66,7 +66,7 @@ return op_pc + 1; \ } \ static uint32_t \ - rop##name##_l_rmw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_l_rmw(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -99,7 +99,7 @@ return op_pc + 1; \ } \ static uint32_t \ - rop##name##_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_b_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -126,7 +126,7 @@ return op_pc + 1; \ } \ static uint32_t \ - rop##name##_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_w_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -153,7 +153,7 @@ return op_pc + 1; \ } \ static uint32_t \ - rop##name##_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + rop##name##_l_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int src_reg; \ int dst_reg; \ @@ -185,7 +185,7 @@ ROP_LOGIC(OR, OR, 1) ROP_LOGIC(XOR, XOR, 1) static uint32_t -ropTEST_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_b_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -209,7 +209,7 @@ ropTEST_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropTEST_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_w_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -233,7 +233,7 @@ ropTEST_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropTEST_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_l_rm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -258,7 +258,7 @@ ropTEST_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropAND_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropAND_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -270,7 +270,7 @@ ropAND_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropAND_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropAND_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -282,7 +282,7 @@ ropAND_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropAND_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropAND_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -296,7 +296,7 @@ ropAND_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -ropOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropOR_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -308,7 +308,7 @@ ropOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropOR_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -320,7 +320,7 @@ ropOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropOR_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -334,7 +334,7 @@ ropOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropTEST_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -346,7 +346,7 @@ ropTEST_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc return op_pc + 1; } static uint32_t -ropTEST_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -358,7 +358,7 @@ ropTEST_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc return op_pc + 2; } static uint32_t -ropTEST_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropTEST_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -372,7 +372,7 @@ ropTEST_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_p } static uint32_t -ropXOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXOR_AL_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B(REG_AL); @@ -384,7 +384,7 @@ ropXOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropXOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXOR_AX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W(REG_AX); @@ -396,7 +396,7 @@ ropXOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropXOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXOR_EAX_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_L(REG_EAX); @@ -410,7 +410,7 @@ ropXOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -ropF6(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropF6(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; @@ -458,7 +458,7 @@ ropF6(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblo return 0; } static uint32_t -ropF7_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropF7_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; @@ -506,7 +506,7 @@ ropF7_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return 0; } static uint32_t -ropF7_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropF7_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg; int host_reg; diff --git a/src/codegen/codegen_ops_misc.h b/src/codegen/codegen_ops_misc.h index 61854ab37..db16dc09e 100644 --- a/src/codegen/codegen_ops_misc.h +++ b/src/codegen/codegen_ops_misc.h @@ -1,24 +1,24 @@ static uint32_t -ropNOP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropNOP(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { return op_pc; } static uint32_t -ropCLD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCLD(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { CLEAR_BITS((uintptr_t) &cpu_state.flags, D_FLAG); return op_pc; } static uint32_t -ropSTD(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropSTD(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { SET_BITS((uintptr_t) &cpu_state.flags, D_FLAG); return op_pc; } static uint32_t -ropCLI(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCLI(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { if (!IOPLp && (cr4 & (CR4_VME | CR4_PVI))) return 0; @@ -29,7 +29,7 @@ ropCLI(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codebl return op_pc; } static uint32_t -ropSTI(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropSTI(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { if (!IOPLp && (cr4 & (CR4_VME | CR4_PVI))) return 0; @@ -38,7 +38,7 @@ ropSTI(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codebl } static uint32_t -ropFE(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFE(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int host_reg; @@ -88,7 +88,7 @@ ropFE(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblo } static uint32_t codegen_temp; static uint32_t -ropFF_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFF_16(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int host_reg; @@ -175,7 +175,7 @@ ropFF_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return 0; } static uint32_t -ropFF_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropFF_32(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int host_reg; diff --git a/src/codegen/codegen_ops_mmx.h b/src/codegen/codegen_ops_mmx.h index 4c5a92c8f..2e07bde77 100644 --- a/src/codegen/codegen_ops_mmx.h +++ b/src/codegen/codegen_ops_mmx.h @@ -1,5 +1,5 @@ static uint32_t -ropMOVQ_q_mm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVQ_q_mm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg1; int host_reg2 = 0; @@ -25,7 +25,7 @@ ropMOVQ_q_mm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOVQ_mm_q(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVQ_mm_q(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { MMX_ENTER(); @@ -50,7 +50,7 @@ ropMOVQ_mm_q(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOVD_l_mm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVD_l_mm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -74,7 +74,7 @@ ropMOVD_l_mm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOVD_mm_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVD_mm_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { MMX_ENTER(); @@ -95,36 +95,40 @@ ropMOVD_mm_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } -#define MMX_OP(name, func) \ - static uint32_t \ - name(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - int src_reg1; \ - int src_reg2; \ - int xmm_src; \ - int xmm_dst; \ - \ - MMX_ENTER(); \ - \ - if ((fetchdat & 0xc0) == 0xc0) { \ - xmm_src = LOAD_MMX_Q_MMX(fetchdat & 7); \ - } else { \ - x86seg *target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ - \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - \ - CHECK_SEG_READ(target_seg); \ - \ - MEM_LOAD_ADDR_EA_Q(target_seg); \ - src_reg1 = LOAD_Q_REG_1; \ - src_reg2 = LOAD_Q_REG_2; \ - xmm_src = LOAD_INT_TO_MMX(src_reg1, src_reg2); \ - } \ - xmm_dst = LOAD_MMX_Q_MMX((fetchdat >> 3) & 7); \ - func(xmm_dst, xmm_src); \ - STORE_MMX_Q_MMX((fetchdat >> 3) & 7, xmm_dst); \ - \ - return op_pc + 1; \ +#define MMX_OP(name, func) \ + static uint32_t \ + name(UNUSED(uint8_t opcode), \ + uint32_t fetchdat, \ + uint32_t op_32, \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + int src_reg1; \ + int src_reg2; \ + int xmm_src; \ + int xmm_dst; \ + \ + MMX_ENTER(); \ + \ + if ((fetchdat & 0xc0) == 0xc0) { \ + xmm_src = LOAD_MMX_Q_MMX(fetchdat & 7); \ + } else { \ + x86seg *target_seg = FETCH_EA(op_ea_seg, fetchdat, op_ssegs, &op_pc, op_32); \ + \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + \ + CHECK_SEG_READ(target_seg); \ + \ + MEM_LOAD_ADDR_EA_Q(target_seg); \ + src_reg1 = LOAD_Q_REG_1; \ + src_reg2 = LOAD_Q_REG_2; \ + xmm_src = LOAD_INT_TO_MMX(src_reg1, src_reg2); \ + } \ + xmm_dst = LOAD_MMX_Q_MMX((fetchdat >> 3) & 7); \ + func(xmm_dst, xmm_src); \ + STORE_MMX_Q_MMX((fetchdat >> 3) & 7, xmm_dst); \ + \ + return op_pc + 1; \ } MMX_OP(ropPAND, MMX_AND) @@ -179,7 +183,7 @@ MMX_OP(ropPMULHW, MMX_PMULHW); MMX_OP(ropPMADDWD, MMX_PMADDWD); static uint32_t -ropPSxxW_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPSxxW_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int xmm_dst; @@ -207,7 +211,7 @@ ropPSxxW_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropPSxxD_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPSxxD_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int xmm_dst; @@ -235,7 +239,7 @@ ropPSxxD_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropPSxxQ_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPSxxQ_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int xmm_dst; @@ -264,7 +268,7 @@ ropPSxxQ_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropEMMS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropEMMS(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc), UNUSED(codeblock_t *block)) { codegen_mmx_entered = 0; diff --git a/src/codegen/codegen_ops_mov.h b/src/codegen/codegen_ops_mov.h index 04c4bf2bc..039489035 100644 --- a/src/codegen/codegen_ops_mov.h +++ b/src/codegen/codegen_ops_mov.h @@ -1,19 +1,19 @@ static uint32_t -ropMOV_rb_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_rb_imm(uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { STORE_IMM_REG_B(opcode & 7, fetchdat & 0xff); return op_pc + 1; } static uint32_t -ropMOV_rw_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_rw_imm(uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { STORE_IMM_REG_W(opcode & 7, fetchdat & 0xffff); return op_pc + 2; } static uint32_t -ropMOV_rl_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_rl_imm(uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { fetchdat = fastreadl(cs + op_pc); @@ -23,7 +23,7 @@ ropMOV_rl_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOV_b_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_b_r(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_B((fetchdat >> 3) & 7); @@ -44,7 +44,7 @@ ropMOV_b_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co return op_pc + 1; } static uint32_t -ropMOV_w_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_w_r(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg = LOAD_REG_W((fetchdat >> 3) & 7); @@ -66,7 +66,7 @@ ropMOV_w_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropMOV_l_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_l_r(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -90,7 +90,7 @@ ropMOV_l_r(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropMOV_r_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_r_b(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_B(fetchdat & 7); @@ -109,7 +109,7 @@ ropMOV_r_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co return op_pc + 1; } static uint32_t -ropMOV_r_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_r_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_W(fetchdat & 7); @@ -128,7 +128,7 @@ ropMOV_r_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co return op_pc + 1; } static uint32_t -ropMOV_r_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_r_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_L(fetchdat & 7); @@ -148,7 +148,7 @@ ropMOV_r_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropMOV_b_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_b_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { STORE_IMM_REG_B(fetchdat & 7, (fetchdat >> 8) & 0xff); @@ -167,7 +167,7 @@ ropMOV_b_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 2; } static uint32_t -ropMOV_w_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_w_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { STORE_IMM_REG_W(fetchdat & 7, (fetchdat >> 8) & 0xffff); @@ -186,7 +186,7 @@ ropMOV_w_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 3; } static uint32_t -ropMOV_l_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_l_imm(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { uint32_t imm = fastreadl(cs + op_pc + 1); @@ -208,7 +208,7 @@ ropMOV_l_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOV_AL_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_AL_a(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; @@ -226,7 +226,7 @@ ropMOV_AL_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + ((op_32 & 0x200) ? 4 : 2); } static uint32_t -ropMOV_AX_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_AX_a(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; @@ -244,7 +244,7 @@ ropMOV_AX_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + ((op_32 & 0x200) ? 4 : 2); } static uint32_t -ropMOV_EAX_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_EAX_a(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; @@ -263,7 +263,7 @@ ropMOV_EAX_a(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOV_a_AL(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_a_AL(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; int host_reg; @@ -284,7 +284,7 @@ ropMOV_a_AL(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + ((op_32 & 0x200) ? 4 : 2); } static uint32_t -ropMOV_a_AX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_a_AX(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; int host_reg; @@ -305,7 +305,7 @@ ropMOV_a_AX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc + ((op_32 & 0x200) ? 4 : 2); } static uint32_t -ropMOV_a_EAX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_a_EAX(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t addr; int host_reg; @@ -327,7 +327,7 @@ ropMOV_a_EAX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropLEA_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropLEA_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int dest_reg = (fetchdat >> 3) & 7; @@ -341,7 +341,7 @@ ropLEA_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code return op_pc + 1; } static uint32_t -ropLEA_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropLEA_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int dest_reg = (fetchdat >> 3) & 7; @@ -356,7 +356,7 @@ ropLEA_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, code } static uint32_t -ropMOVZX_w_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVZX_w_b(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_B(fetchdat & 7); @@ -377,7 +377,7 @@ ropMOVZX_w_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOVZX_l_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVZX_l_b(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_B(fetchdat & 7); @@ -398,7 +398,7 @@ ropMOVZX_l_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOVZX_l_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVZX_l_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_W(fetchdat & 7); @@ -420,7 +420,7 @@ ropMOVZX_l_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOVSX_w_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVSX_w_b(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_B(fetchdat & 7); @@ -441,7 +441,7 @@ ropMOVSX_w_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOVSX_l_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVSX_l_b(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_B(fetchdat & 7); @@ -462,7 +462,7 @@ ropMOVSX_l_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOVSX_l_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOVSX_l_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { if ((fetchdat & 0xc0) == 0xc0) { int host_reg = LOAD_REG_W(fetchdat & 7); @@ -484,7 +484,7 @@ ropMOVSX_l_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropMOV_w_seg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_w_seg(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -531,7 +531,7 @@ ropMOV_w_seg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return op_pc + 1; } static uint32_t -ropMOV_seg_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropMOV_seg_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -578,7 +578,7 @@ ropMOV_seg_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } #define ropLseg(seg, rseg) \ - static uint32_t ropL##seg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ + static uint32_t ropL##seg(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) \ { \ int dest_reg = (fetchdat >> 3) & 7; \ x86seg *target_seg; \ diff --git a/src/codegen/codegen_ops_shift.h b/src/codegen/codegen_ops_shift.h index d750bfcad..a36fb3fdc 100644 --- a/src/codegen/codegen_ops_shift.h +++ b/src/codegen/codegen_ops_shift.h @@ -43,7 +43,7 @@ } static uint32_t -ropC0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropC0(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count; @@ -57,7 +57,7 @@ ropC0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblo return op_pc + 2; } static uint32_t -ropC1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropC1_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count; @@ -71,7 +71,7 @@ ropC1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 2; } static uint32_t -ropC1_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropC1_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count; @@ -86,7 +86,7 @@ ropC1_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb } static uint32_t -ropD0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropD0(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count = 1; @@ -100,7 +100,7 @@ ropD0(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblo return op_pc + 1; } static uint32_t -ropD1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropD1_w(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count = 1; @@ -114,7 +114,7 @@ ropD1_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc + 1; } static uint32_t -ropD1_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropD1_l(UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, UNUSED(codeblock_t *block)) { x86seg *target_seg = NULL; int count = 1; diff --git a/src/codegen/codegen_ops_stack.h b/src/codegen/codegen_ops_stack.h index 342ddedd4..b7e3d66fe 100644 --- a/src/codegen/codegen_ops_stack.h +++ b/src/codegen/codegen_ops_stack.h @@ -1,5 +1,5 @@ static uint32_t -ropPUSH_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_16(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -12,7 +12,7 @@ ropPUSH_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co return op_pc; } static uint32_t -ropPUSH_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_32(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -26,7 +26,7 @@ ropPUSH_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, co } static uint32_t -ropPUSH_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_imm_16(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint16_t imm = fetchdat & 0xffff; int host_reg; @@ -40,7 +40,7 @@ ropPUSH_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc return op_pc + 2; } static uint32_t -ropPUSH_imm_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_imm_32(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t imm = fastreadl(cs + op_pc); int host_reg; @@ -55,7 +55,7 @@ ropPUSH_imm_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc } static uint32_t -ropPUSH_imm_b16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_imm_b16(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint16_t imm = fetchdat & 0xff; int host_reg; @@ -72,7 +72,7 @@ ropPUSH_imm_b16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_p return op_pc + 1; } static uint32_t -ropPUSH_imm_b32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPUSH_imm_b32(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t imm = fetchdat & 0xff; int host_reg; @@ -90,7 +90,7 @@ ropPUSH_imm_b32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_p } static uint32_t -ropPOP_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPOP_16(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); LOAD_STACK_TO_EA(0); @@ -101,7 +101,7 @@ ropPOP_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc; } static uint32_t -ropPOP_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropPOP_32(uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); LOAD_STACK_TO_EA(0); @@ -113,7 +113,7 @@ ropPOP_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropRET_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropRET_16(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc), UNUSED(codeblock_t *block)) { STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); LOAD_STACK_TO_EA(0); @@ -124,7 +124,7 @@ ropRET_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return -1; } static uint32_t -ropRET_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropRET_32(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc), UNUSED(codeblock_t *block)) { STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); LOAD_STACK_TO_EA(0); @@ -136,7 +136,7 @@ ropRET_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod } static uint32_t -ropRET_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropRET_imm_16(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc), UNUSED(codeblock_t *block)) { uint16_t offset = fetchdat & 0xffff; @@ -149,7 +149,7 @@ ropRET_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, return -1; } static uint32_t -ropRET_imm_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropRET_imm_32(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc), UNUSED(codeblock_t *block)) { uint16_t offset = fetchdat & 0xffff; @@ -163,7 +163,7 @@ ropRET_imm_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, } static uint32_t -ropCALL_r16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCALL_r16(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint16_t offset = fetchdat & 0xffff; int host_reg; @@ -178,7 +178,7 @@ ropCALL_r16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return -1; } static uint32_t -ropCALL_r32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropCALL_r32(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { uint32_t offset = fastreadl(cs + op_pc); int host_reg; @@ -194,7 +194,7 @@ ropCALL_r32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c } static uint32_t -ropLEAVE_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropLEAVE_16(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -209,7 +209,7 @@ ropLEAVE_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc; } static uint32_t -ropLEAVE_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropLEAVE_32(UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int host_reg; @@ -224,32 +224,40 @@ ropLEAVE_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, c return op_pc; } -#define ROP_PUSH_SEG(seg) \ - static uint32_t \ - ropPUSH_##seg##_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - int host_reg; \ - \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - LOAD_STACK_TO_EA(-2); \ - host_reg = LOAD_VAR_W((uintptr_t) &seg); \ - MEM_STORE_ADDR_EA_W(&cpu_state.seg_ss, host_reg); \ - SP_MODIFY(-2); \ - \ - return op_pc; \ - } \ - static uint32_t \ - ropPUSH_##seg##_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - int host_reg; \ - \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - LOAD_STACK_TO_EA(-4); \ - host_reg = LOAD_VAR_W((uintptr_t) &seg); \ - MEM_STORE_ADDR_EA_L(&cpu_state.seg_ss, host_reg); \ - SP_MODIFY(-4); \ - \ - return op_pc; \ +#define ROP_PUSH_SEG(seg) \ + static uint32_t \ + ropPUSH_##seg##_16(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + int host_reg; \ + \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + LOAD_STACK_TO_EA(-2); \ + host_reg = LOAD_VAR_W((uintptr_t) &seg); \ + MEM_STORE_ADDR_EA_W(&cpu_state.seg_ss, host_reg); \ + SP_MODIFY(-2); \ + \ + return op_pc; \ + } \ + static uint32_t \ + ropPUSH_##seg##_32(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + int host_reg; \ + \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + LOAD_STACK_TO_EA(-4); \ + host_reg = LOAD_VAR_W((uintptr_t) &seg); \ + MEM_STORE_ADDR_EA_L(&cpu_state.seg_ss, host_reg); \ + SP_MODIFY(-4); \ + \ + return op_pc; \ } ROP_PUSH_SEG(CS) @@ -259,28 +267,36 @@ ROP_PUSH_SEG(FS) ROP_PUSH_SEG(GS) ROP_PUSH_SEG(SS) -#define ROP_POP_SEG(seg, rseg) \ - static uint32_t \ - ropPOP_##seg##_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - LOAD_STACK_TO_EA(0); \ - MEM_LOAD_ADDR_EA_W(&cpu_state.seg_ss); \ - LOAD_SEG(0, &rseg); \ - SP_MODIFY(2); \ - \ - return op_pc; \ - } \ - static uint32_t \ - ropPOP_##seg##_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ - LOAD_STACK_TO_EA(0); \ - MEM_LOAD_ADDR_EA_W(&cpu_state.seg_ss); \ - LOAD_SEG(0, &rseg); \ - SP_MODIFY(4); \ - \ - return op_pc; \ +#define ROP_POP_SEG(seg, rseg) \ + static uint32_t \ + ropPOP_##seg##_16(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + LOAD_STACK_TO_EA(0); \ + MEM_LOAD_ADDR_EA_W(&cpu_state.seg_ss); \ + LOAD_SEG(0, &rseg); \ + SP_MODIFY(2); \ + \ + return op_pc; \ + } \ + static uint32_t \ + ropPOP_##seg##_32(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + STORE_IMM_ADDR_L((uintptr_t) &cpu_state.oldpc, op_old_pc); \ + LOAD_STACK_TO_EA(0); \ + MEM_LOAD_ADDR_EA_W(&cpu_state.seg_ss); \ + LOAD_SEG(0, &rseg); \ + SP_MODIFY(4); \ + \ + return op_pc; \ } ROP_POP_SEG(DS, cpu_state.seg_ds) diff --git a/src/codegen/codegen_ops_x86-64.h b/src/codegen/codegen_ops_x86-64.h index 08b9ee5f2..e46f55a05 100644 --- a/src/codegen/codegen_ops_x86-64.h +++ b/src/codegen/codegen_ops_x86-64.h @@ -55,7 +55,7 @@ call_long(uintptr_t func) } static __inline void -load_param_1_32(codeblock_t *block, uint32_t param) +load_param_1_32(UNUSED(codeblock_t *block), uint32_t param) { #if _WIN64 addbyte(0xb9); /*MOVL $fetchdat,%ecx*/ @@ -93,7 +93,7 @@ static __inline void load_param_1_64(codeblock_t *block, uint64_t param) #endif static __inline void -load_param_2_32(codeblock_t *block, uint32_t param) +load_param_2_32(UNUSED(codeblock_t *block), uint32_t param) { #if _WIN64 addbyte(0xba); /*MOVL $fetchdat,%edx*/ @@ -118,7 +118,7 @@ load_param_2_reg_32(int reg) #endif } static __inline void -load_param_2_64(codeblock_t *block, uint64_t param) +load_param_2_64(UNUSED(codeblock_t *block), uint64_t param) { addbyte(0x48); #if _WIN64 @@ -1492,7 +1492,7 @@ MEM_STORE_ADDR_EA_L(x86seg *seg, int host_reg) /*done:*/ } static __inline void -MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, int host_reg2) +MEM_STORE_ADDR_EA_Q(x86seg *seg, int host_reg, UNUSED(int host_reg2)) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) { addbyte(0x31); /*XOR ECX, ECX*/ @@ -3926,7 +3926,7 @@ FP_LOAD_REG(int reg) return REG_EBX; } static __inline void -FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) +FP_LOAD_REG_D(int reg, int *host_reg1, UNUSED(int *host_reg2)) { addbyte(0x8b); /*MOV EBX, TOP*/ addbyte(0x5d); @@ -4086,7 +4086,7 @@ FP_LOAD_REG_INT(int reg) return REG_EBX; } static __inline void -FP_LOAD_REG_INT_Q(int reg, int *host_reg1, int *host_reg2) +FP_LOAD_REG_INT_Q(int reg, int *host_reg1, UNUSED(int *host_reg2)) { addbyte(0x89); /*MOV EBX, EAX*/ addbyte(0xc3); @@ -4693,7 +4693,7 @@ LOAD_MMX_D(int guest_reg) return host_reg; } static __inline void -LOAD_MMX_Q(int guest_reg, int *host_reg1, int *host_reg2) +LOAD_MMX_Q(int guest_reg, int *host_reg1, UNUSED(int *host_reg2)) { int host_reg = REG_EBX; @@ -4725,7 +4725,7 @@ LOAD_MMX_Q_MMX(int guest_reg) } static __inline int -LOAD_INT_TO_MMX(int src_reg1, int src_reg2) +LOAD_INT_TO_MMX(int src_reg1, UNUSED(int src_reg2)) { int dst_reg = find_host_xmm_reg(); host_reg_xmm_mapping[dst_reg] = 100; @@ -4758,7 +4758,7 @@ STORE_MMX_LQ(int guest_reg, int host_reg1) addbyte((uint8_t) cpu_state_offset(MM[guest_reg].l[0])); } static __inline void -STORE_MMX_Q(int guest_reg, int host_reg1, int host_reg2) +STORE_MMX_Q(int guest_reg, int host_reg1, UNUSED(int host_reg2)) { if (host_reg1 & 8) addbyte(0x4c); diff --git a/src/codegen/codegen_ops_xchg.h b/src/codegen/codegen_ops_xchg.h index 28a558078..467f711e4 100644 --- a/src/codegen/codegen_ops_xchg.h +++ b/src/codegen/codegen_ops_xchg.h @@ -1,16 +1,20 @@ -#define OP_XCHG_AX_(reg) \ - static uint32_t \ - ropXCHG_AX_##reg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - int ax_reg, host_reg, temp_reg; \ - \ - ax_reg = LOAD_REG_W(REG_AX); \ - host_reg = LOAD_REG_W(REG_##reg); \ - temp_reg = COPY_REG(host_reg); \ - STORE_REG_TARGET_W_RELEASE(ax_reg, REG_##reg); \ - STORE_REG_TARGET_W_RELEASE(temp_reg, REG_AX); \ - \ - return op_pc; \ +#define OP_XCHG_AX_(reg) \ + static uint32_t \ + ropXCHG_AX_##reg(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + int ax_reg, host_reg, temp_reg; \ + \ + ax_reg = LOAD_REG_W(REG_AX); \ + host_reg = LOAD_REG_W(REG_##reg); \ + temp_reg = COPY_REG(host_reg); \ + STORE_REG_TARGET_W_RELEASE(ax_reg, REG_##reg); \ + STORE_REG_TARGET_W_RELEASE(temp_reg, REG_AX); \ + \ + return op_pc; \ } OP_XCHG_AX_(BX) @@ -21,19 +25,23 @@ OP_XCHG_AX_(DI) OP_XCHG_AX_(SP) OP_XCHG_AX_(BP) -#define OP_XCHG_EAX_(reg) \ - static uint32_t \ - ropXCHG_EAX_##reg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \ - { \ - int eax_reg, host_reg, temp_reg; \ - \ - eax_reg = LOAD_REG_L(REG_EAX); \ - host_reg = LOAD_REG_L(REG_##reg); \ - temp_reg = COPY_REG(host_reg); \ - STORE_REG_TARGET_L_RELEASE(eax_reg, REG_##reg); \ - STORE_REG_TARGET_L_RELEASE(temp_reg, REG_EAX); \ - \ - return op_pc; \ +#define OP_XCHG_EAX_(reg) \ + static uint32_t \ + ropXCHG_EAX_##reg(UNUSED(uint8_t opcode), \ + UNUSED(uint32_t fetchdat), \ + UNUSED(uint32_t op_32), \ + uint32_t op_pc, \ + UNUSED(codeblock_t *block)) \ + { \ + int eax_reg, host_reg, temp_reg; \ + \ + eax_reg = LOAD_REG_L(REG_EAX); \ + host_reg = LOAD_REG_L(REG_##reg); \ + temp_reg = COPY_REG(host_reg); \ + STORE_REG_TARGET_L_RELEASE(eax_reg, REG_##reg); \ + STORE_REG_TARGET_L_RELEASE(temp_reg, REG_EAX); \ + \ + return op_pc; \ } OP_XCHG_EAX_(EBX) @@ -45,7 +53,7 @@ OP_XCHG_EAX_(ESP) OP_XCHG_EAX_(EBP) static uint32_t -ropXCHG_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXCHG_b(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -63,7 +71,7 @@ ropXCHG_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; } static uint32_t -ropXCHG_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXCHG_w(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; @@ -81,7 +89,7 @@ ropXCHG_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, cod return op_pc + 1; } static uint32_t -ropXCHG_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +ropXCHG_l(UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc, UNUSED(codeblock_t *block)) { int src_reg; int dst_reg; diff --git a/src/codegen/codegen_x86-64.c b/src/codegen/codegen_x86-64.c index 59f411612..04c2136ff 100644 --- a/src/codegen/codegen_x86-64.c +++ b/src/codegen/codegen_x86-64.c @@ -125,7 +125,7 @@ add_to_block_list(codeblock_t *block) } static void -remove_from_block_list(codeblock_t *block, uint32_t pc) +remove_from_block_list(codeblock_t *block, UNUSED(uint32_t pc)) { if (!block->page_mask) return; diff --git a/src/codegen_new/codegen_ir.c b/src/codegen_new/codegen_ir.c index 6345bbe86..ed8ae051f 100644 --- a/src/codegen_new/codegen_ir.c +++ b/src/codegen_new/codegen_ir.c @@ -2,6 +2,7 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> +#include <86box/plat_unused.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/codegen_new/codegen_ir_defs.h b/src/codegen_new/codegen_ir_defs.h index 26a1c3cb4..9bd2f9afe 100644 --- a/src/codegen_new/codegen_ir_defs.h +++ b/src/codegen_new/codegen_ir_defs.h @@ -410,7 +410,7 @@ uop_gen_reg_src1(uint32_t uop_type, ir_data_t *ir, int src_reg_a) } static inline void -uop_gen_reg_src1_arg(uint32_t uop_type, ir_data_t *ir, int arg, int src_reg_a) +uop_gen_reg_src1_arg(uint32_t uop_type, ir_data_t *ir, UNUSED(int arg), int src_reg_a) { uop_t *uop = uop_alloc(ir, uop_type); diff --git a/src/codegen_new/codegen_ops.c b/src/codegen_new/codegen_ops.c index 59e148659..bb7d1f3ee 100644 --- a/src/codegen_new/codegen_ops.c +++ b/src/codegen_new/codegen_ops.c @@ -2,6 +2,7 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> +#include <86box/plat_unused.h> #include "codegen.h" #include "codegen_ir.h" diff --git a/src/codegen_new/codegen_ops_3dnow.c b/src/codegen_new/codegen_ops_3dnow.c index 8b4d471ba..03af718d1 100644 --- a/src/codegen_new/codegen_ops_3dnow.c +++ b/src/codegen_new/codegen_ops_3dnow.c @@ -17,7 +17,7 @@ #include "codegen_ops_helpers.h" #define ropParith(func) \ - uint32_t rop##func(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ int dest_reg = (fetchdat >> 3) & 7; \ \ @@ -192,7 +192,7 @@ ropPFRSQRT(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f } uint32_t -ropPFRSQIT1(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPFRSQIT1(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MMX_ENTER(ir); diff --git a/src/codegen_new/codegen_ops_arith.c b/src/codegen_new/codegen_ops_arith.c index 9e136ace5..c899c13d8 100644 --- a/src/codegen_new/codegen_ops_arith.c +++ b/src/codegen_new/codegen_ops_arith.c @@ -22,7 +22,7 @@ get_cf(ir_data_t *ir, int dest_reg) } uint32_t -ropADC_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropADC_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -39,7 +39,7 @@ ropADC_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropADC_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropADC_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -274,7 +274,7 @@ ropADC_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropADD_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropADD_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -289,7 +289,7 @@ ropADD_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropADD_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropADD_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -511,7 +511,7 @@ ropADD_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropCMP_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCMP_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -526,7 +526,7 @@ ropCMP_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropCMP_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCMP_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -734,7 +734,7 @@ ropCMP_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropSBB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSBB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -751,7 +751,7 @@ ropSBB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropSBB_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSBB_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -988,7 +988,7 @@ ropSBB_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropSUB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSUB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -1003,7 +1003,7 @@ ropSUB_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropSUB_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSUB_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -2293,7 +2293,7 @@ rebuild_c(ir_data_t *ir) } uint32_t -ropINC_r16(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropINC_r16(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { rebuild_c(ir); @@ -2307,7 +2307,7 @@ ropINC_r16(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opc return op_pc; } uint32_t -ropINC_r32(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropINC_r32(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { rebuild_c(ir); @@ -2322,7 +2322,7 @@ ropINC_r32(UNUSED(UNUSED(codeblock_t *block)), ir_data_t *ir, UNUSED(uint8_t opc } uint32_t -ropDEC_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropDEC_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { rebuild_c(ir); @@ -2336,7 +2336,7 @@ ropDEC_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t f return op_pc; } uint32_t -ropDEC_r32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropDEC_r32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { rebuild_c(ir); diff --git a/src/codegen_new/codegen_ops_branch.c b/src/codegen_new/codegen_ops_branch.c index cedb54177..1e2589f8b 100644 --- a/src/codegen_new/codegen_ops_branch.c +++ b/src/codegen_new/codegen_ops_branch.c @@ -816,7 +816,7 @@ ropJNLE_common(codeblock_t *block, ir_data_t *ir, uint32_t dest_addr, uint32_t n } #define ropJ(cond) \ - uint32_t ropJ##cond##_8(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropJ##cond##_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) \ { \ uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); \ uint32_t dest_addr = op_pc + 1 + offset; \ @@ -829,7 +829,7 @@ ropJNLE_common(codeblock_t *block, ir_data_t *ir, uint32_t dest_addr, uint32_t n codegen_mark_code_present(block, cs + op_pc, 1); \ return ret ? dest_addr : (op_pc + 1); \ } \ - uint32_t ropJ##cond##_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropJ##cond##_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ uint32_t offset = (int32_t) (int16_t) fastreadw(cs + op_pc); \ uint32_t dest_addr = (op_pc + 2 + offset) & 0xffff; \ @@ -840,7 +840,7 @@ ropJNLE_common(codeblock_t *block, ir_data_t *ir, uint32_t dest_addr, uint32_t n codegen_mark_code_present(block, cs + op_pc, 2); \ return ret ? dest_addr : (op_pc + 2); \ } \ - uint32_t ropJ##cond##_32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropJ##cond##_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ uint32_t offset = fastreadl(cs + op_pc); \ uint32_t dest_addr = op_pc + 4 + offset; \ @@ -852,6 +852,7 @@ ropJNLE_common(codeblock_t *block, ir_data_t *ir, uint32_t dest_addr, uint32_t n return ret ? dest_addr : (op_pc + 4); \ } +// clang-format off ropJ(O) ropJ(NO) ropJ(B) @@ -868,9 +869,10 @@ ropJ(L) ropJ(NL) ropJ(LE) ropJ(NLE) +// clang-format on uint32_t -ropJCXZ(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropJCXZ(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); uint32_t dest_addr = op_pc + 1 + offset; @@ -892,7 +894,7 @@ ropJCXZ(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetc } uint32_t -ropLOOP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropLOOP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); uint32_t dest_addr = op_pc + 1 + offset; @@ -932,7 +934,7 @@ ropLOOP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetc } uint32_t -ropLOOPE(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropLOOPE(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); uint32_t dest_addr = op_pc + 1 + offset; @@ -965,7 +967,7 @@ ropLOOPE(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet return op_pc + 1; } uint32_t -ropLOOPNE(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropLOOPNE(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); uint32_t dest_addr = op_pc + 1 + offset; diff --git a/src/codegen_new/codegen_ops_fpu_arith.c b/src/codegen_new/codegen_ops_fpu_arith.c index a7b5290f4..43d243c0f 100644 --- a/src/codegen_new/codegen_ops_fpu_arith.c +++ b/src/codegen_new/codegen_ops_fpu_arith.c @@ -79,7 +79,7 @@ ropFCOMP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet return op_pc; } uint32_t -ropFCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FCOM(ir, IREG_temp0_W, IREG_ST(0), IREG_ST(1)); @@ -289,7 +289,7 @@ ropFUCOMP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fe return op_pc; } uint32_t -ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FCOM(ir, IREG_temp0_W, IREG_ST(0), IREG_ST(1)); @@ -301,7 +301,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f } #define ropF_arith_mem(name, load_uop) \ - uint32_t ropFADD##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -318,7 +318,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFCOM##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFCOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -329,12 +329,12 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f codegen_check_seg_read(block, ir, target_seg); \ load_uop(ir, IREG_temp0_D, ireg_seg_base(target_seg), IREG_eaaddr); \ uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \ - uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ + uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \ \ return op_pc + 1; \ } \ - uint32_t ropFCOMP##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFCOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -351,7 +351,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFDIV##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -366,7 +366,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFDIVR##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -381,7 +381,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFMUL##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -396,7 +396,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFSUB##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFSUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -411,7 +411,7 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f \ return op_pc + 1; \ } \ - uint32_t ropFSUBR##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFSUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -433,7 +433,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) // clang-format on #define ropFI_arith_mem(name, temp_reg) \ - uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -449,7 +449,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) \ return op_pc + 1; \ } \ - uint32_t ropFICOM##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFICOM##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -461,12 +461,12 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \ uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \ uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \ - uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ + uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \ \ return op_pc + 1; \ } \ - uint32_t ropFICOMP##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFICOMP##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -478,13 +478,13 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) uop_MEM_LOAD_REG(ir, temp_reg, ireg_seg_base(target_seg), IREG_eaaddr); \ uop_MOV_DOUBLE_INT(ir, IREG_temp0_D, temp_reg); \ uop_FCOM(ir, IREG_temp1_W, IREG_ST(0), IREG_temp0_D); \ - uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ + uop_AND_IMM(ir, IREG_NPXS, IREG_NPXS, ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3)); \ uop_OR(ir, IREG_NPXS, IREG_NPXS, IREG_temp1_W); \ fpu_POP(block, ir); \ \ return op_pc + 1; \ } \ - uint32_t ropFIDIV##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFIDIV##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -500,7 +500,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) \ return op_pc + 1; \ } \ - uint32_t ropFIDIVR##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFIDIVR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -516,7 +516,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) \ return op_pc + 1; \ } \ - uint32_t ropFIMUL##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFIMUL##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -532,7 +532,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) \ return op_pc + 1; \ } \ - uint32_t ropFISUB##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFISUB##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -548,7 +548,7 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) \ return op_pc + 1; \ } \ - uint32_t ropFISUBR##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropFISUBR##name(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg; \ \ @@ -565,11 +565,13 @@ ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) return op_pc + 1; \ } +// clang-format off ropFI_arith_mem(l, IREG_temp0) ropFI_arith_mem(w, IREG_temp0_W) +// clang-format on uint32_t -ropFABS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFABS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FABS(ir, IREG_ST(0), IREG_ST(0)); @@ -579,7 +581,7 @@ ropFABS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint3 } uint32_t -ropFCHS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFCHS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FCHS(ir, IREG_ST(0), IREG_ST(0)); @@ -588,7 +590,7 @@ ropFCHS(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint3 return op_pc; } uint32_t -ropFSQRT(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFSQRT(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FSQRT(ir, IREG_ST(0), IREG_ST(0)); @@ -597,7 +599,7 @@ ropFSQRT(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint return op_pc; } uint32_t -ropFTST(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFTST(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_FTST(ir, IREG_temp0_W, IREG_ST(0)); diff --git a/src/codegen_new/codegen_ops_fpu_constant.c b/src/codegen_new/codegen_ops_fpu_constant.c index a91d675c5..6ec2f6888 100644 --- a/src/codegen_new/codegen_ops_fpu_constant.c +++ b/src/codegen_new/codegen_ops_fpu_constant.c @@ -19,7 +19,7 @@ #include "codegen_ops_helpers.h" uint32_t -ropFLD1(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFLD1(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_MOV_IMM(ir, IREG_temp0, 1); @@ -30,7 +30,7 @@ ropFLD1(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetc return op_pc; } uint32_t -ropFLDZ(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFLDZ(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_MOV_IMM(ir, IREG_temp0, 0); diff --git a/src/codegen_new/codegen_ops_fpu_misc.c b/src/codegen_new/codegen_ops_fpu_misc.c index 31b668488..938204a70 100644 --- a/src/codegen_new/codegen_ops_fpu_misc.c +++ b/src/codegen_new/codegen_ops_fpu_misc.c @@ -98,7 +98,7 @@ ropFSTSW(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet return op_pc + 1; } uint32_t -ropFSTSW_AX(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropFSTSW_AX(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_FP_ENTER(ir); uop_MOV(ir, IREG_AX, IREG_NPXS); diff --git a/src/codegen_new/codegen_ops_helpers.h b/src/codegen_new/codegen_ops_helpers.h index 5a8f1e1c7..92b721099 100644 --- a/src/codegen_new/codegen_ops_helpers.h +++ b/src/codegen_new/codegen_ops_helpers.h @@ -71,7 +71,7 @@ fpu_PUSH(codeblock_t *block, ir_data_t *ir) } static inline void -CHECK_SEG_LIMITS(codeblock_t *block, ir_data_t *ir, x86seg *seg, int addr_reg, int end_offset) +CHECK_SEG_LIMITS(UNUSED(codeblock_t *block), ir_data_t *ir, x86seg *seg, int addr_reg, int end_offset) { if ((seg == &cpu_state.seg_ds && codegen_flat_ds && !(cpu_cur_status & CPU_STATUS_NOTFLATDS)) || (seg == &cpu_state.seg_ss && codegen_flat_ss && !(cpu_cur_status & CPU_STATUS_NOTFLATSS))) return; @@ -85,7 +85,7 @@ CHECK_SEG_LIMITS(codeblock_t *block, ir_data_t *ir, x86seg *seg, int addr_reg, i } static inline void -LOAD_IMMEDIATE_FROM_RAM_8(codeblock_t *block, ir_data_t *ir, int dest_reg, uint32_t addr) +LOAD_IMMEDIATE_FROM_RAM_8(UNUSED(codeblock_t *block), ir_data_t *ir, int dest_reg, uint32_t addr) { uop_MOVZX_REG_PTR_8(ir, dest_reg, get_ram_ptr(addr)); } diff --git a/src/codegen_new/codegen_ops_jump.c b/src/codegen_new/codegen_ops_jump.c index fb2f1e5ba..430b16b2b 100644 --- a/src/codegen_new/codegen_ops_jump.c +++ b/src/codegen_new/codegen_ops_jump.c @@ -15,7 +15,7 @@ #include "codegen_ops_mov.h" uint32_t -ropJMP_r8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropJMP_r8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t offset = (int32_t) (int8_t) fastreadb(cs + op_pc); uint32_t dest_addr = op_pc + 1 + offset; @@ -29,7 +29,7 @@ ropJMP_r8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fe return dest_addr; } uint32_t -ropJMP_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropJMP_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t offset = (int32_t) (int16_t) fastreadw(cs + op_pc); uint32_t dest_addr = op_pc + 2 + offset; @@ -42,7 +42,7 @@ ropJMP_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f return dest_addr; } uint32_t -ropJMP_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropJMP_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t offset = fastreadl(cs + op_pc); uint32_t dest_addr = op_pc + 4 + offset; @@ -54,7 +54,7 @@ ropJMP_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f } uint32_t -ropJMP_far_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropJMP_far_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t new_pc = fastreadw(cs + op_pc); uint16_t new_cs = fastreadw(cs + op_pc + 2); @@ -69,7 +69,7 @@ ropJMP_far_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return -1; } uint32_t -ropJMP_far_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropJMP_far_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t new_pc = fastreadl(cs + op_pc); uint16_t new_cs = fastreadw(cs + op_pc + 4); @@ -85,7 +85,7 @@ ropJMP_far_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ } uint32_t -ropCALL_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCALL_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t offset = (int32_t) (int16_t) fastreadw(cs + op_pc); uint16_t ret_addr = op_pc + 2; @@ -104,7 +104,7 @@ ropCALL_r16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t return -1; } uint32_t -ropCALL_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCALL_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t offset = fastreadl(cs + op_pc); uint32_t ret_addr = op_pc + 4; @@ -122,7 +122,7 @@ ropCALL_r32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropRET_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) +ropRET_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -138,7 +138,7 @@ ropRET_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uin return -1; } uint32_t -ropRET_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) +ropRET_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -154,7 +154,7 @@ ropRET_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uin } uint32_t -ropRET_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropRET_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t offset = fastreadw(cs + op_pc); @@ -173,7 +173,7 @@ ropRET_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return -1; } uint32_t -ropRET_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropRET_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t offset = fastreadw(cs + op_pc); @@ -192,7 +192,7 @@ ropRET_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ } uint32_t -ropRETF_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) +ropRETF_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) { if ((msw & 1) && !(cpu_state.eflags & VM_FLAG)) return 0; @@ -215,7 +215,7 @@ ropRETF_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), ui return -1; } uint32_t -ropRETF_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) +ropRETF_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), UNUSED(uint32_t op_pc)) { if ((msw & 1) && !(cpu_state.eflags & VM_FLAG)) return 0; @@ -239,7 +239,7 @@ ropRETF_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), ui } uint32_t -ropRETF_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropRETF_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t offset; @@ -266,7 +266,7 @@ ropRETF_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 return -1; } uint32_t -ropRETF_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropRETF_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t offset; diff --git a/src/codegen_new/codegen_ops_logic.c b/src/codegen_new/codegen_ops_logic.c index 684052fea..f289f1cba 100644 --- a/src/codegen_new/codegen_ops_logic.c +++ b/src/codegen_new/codegen_ops_logic.c @@ -16,7 +16,7 @@ #include "codegen_ops_logic.h" uint32_t -ropAND_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropAND_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -29,7 +29,7 @@ ropAND_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropAND_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropAND_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -226,7 +226,7 @@ ropAND_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -239,7 +239,7 @@ ropOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t return op_pc + 1; } uint32_t -ropOR_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropOR_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -437,7 +437,7 @@ ropOR_l_rmw(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropTEST_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropTEST_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -449,7 +449,7 @@ ropTEST_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 return op_pc + 1; } uint32_t -ropTEST_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropTEST_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); @@ -557,7 +557,7 @@ ropTEST_l_rm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t } uint32_t -ropXOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropXOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm_data = fastreadb(cs + op_pc); @@ -570,7 +570,7 @@ ropXOR_AL_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + 1; } uint32_t -ropXOR_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropXOR_AX_imm(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm_data = fastreadw(cs + op_pc); diff --git a/src/codegen_new/codegen_ops_misc.c b/src/codegen_new/codegen_ops_misc.c index 545634672..c709dffc9 100644 --- a/src/codegen_new/codegen_ops_misc.c +++ b/src/codegen_new/codegen_ops_misc.c @@ -485,34 +485,34 @@ ropFF_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet } uint32_t -ropNOP(UNUSED(codeblock_t *block), UNUSED(ir_data_t *ir), UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropNOP(UNUSED(codeblock_t *block), UNUSED(ir_data_t *ir), UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { return op_pc; } uint32_t -ropCBW(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCBW(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOVSX(ir, IREG_AX, IREG_AL); return op_pc; } uint32_t -ropCDQ(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCDQ(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_SAR_IMM(ir, IREG_EDX, IREG_EAX, 31); return op_pc; } uint32_t -ropCWD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCWD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_SAR_IMM(ir, IREG_DX, IREG_AX, 15); return op_pc; } uint32_t -ropCWDE(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCWDE(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOVSX(ir, IREG_EAX, IREG_AX); @@ -520,7 +520,7 @@ ropCWDE(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint3 } #define ropLxS(name, seg) \ - uint32_t rop##name##_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##name##_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg = NULL; \ int dest_reg = (fetchdat >> 3) & 7; \ @@ -542,7 +542,7 @@ ropCWDE(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint3 \ return op_pc + 1; \ } \ - uint32_t rop##name##_32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##name##_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ x86seg *target_seg = NULL; \ int dest_reg = (fetchdat >> 3) & 7; \ @@ -572,21 +572,21 @@ ropLxS(LGS, &cpu_state.seg_gs) ropLxS(LSS, &cpu_state.seg_ss) uint32_t -ropCLC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCLC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_CALL_FUNC(ir, flags_rebuild); uop_AND_IMM(ir, IREG_flags, IREG_flags, ~C_FLAG); return op_pc; } uint32_t -ropCMC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCMC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_CALL_FUNC(ir, flags_rebuild); uop_XOR_IMM(ir, IREG_flags, IREG_flags, C_FLAG); return op_pc; } uint32_t -ropSTC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSTC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_CALL_FUNC(ir, flags_rebuild); uop_OR_IMM(ir, IREG_flags, IREG_flags, C_FLAG); @@ -594,20 +594,20 @@ ropSTC(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32 } uint32_t -ropCLD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCLD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_AND_IMM(ir, IREG_flags, IREG_flags, ~D_FLAG); return op_pc; } uint32_t -ropSTD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSTD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_OR_IMM(ir, IREG_flags, IREG_flags, D_FLAG); return op_pc; } uint32_t -ropCLI(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropCLI(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { if (!IOPLp && (cr4 & (CR4_VME | CR4_PVI))) return 0; @@ -616,7 +616,7 @@ ropCLI(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32 return op_pc; } uint32_t -ropSTI(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropSTI(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { if (!IOPLp && (cr4 & (CR4_VME | CR4_PVI))) return 0; diff --git a/src/codegen_new/codegen_ops_mmx_arith.c b/src/codegen_new/codegen_ops_mmx_arith.c index e99b4c56d..8fd1d1651 100644 --- a/src/codegen_new/codegen_ops_mmx_arith.c +++ b/src/codegen_new/codegen_ops_mmx_arith.c @@ -2,6 +2,7 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> +#include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" @@ -16,7 +17,7 @@ #include "codegen_ops_helpers.h" #define ropParith(func) \ - uint32_t rop##func(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ int dest_reg = (fetchdat >> 3) & 7; \ \ @@ -58,4 +59,4 @@ ropParith(PSUBUSW) ropParith(PMADDWD) ropParith(PMULHW) ropParith(PMULLW) - // clang-format on +// clang-format on diff --git a/src/codegen_new/codegen_ops_mmx_cmp.c b/src/codegen_new/codegen_ops_mmx_cmp.c index 6f38cba67..e00e56472 100644 --- a/src/codegen_new/codegen_ops_mmx_cmp.c +++ b/src/codegen_new/codegen_ops_mmx_cmp.c @@ -2,6 +2,7 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> +#include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" @@ -16,7 +17,7 @@ #include "codegen_ops_helpers.h" #define ropPcmp(func) \ - uint32_t rop##func(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ int dest_reg = (fetchdat >> 3) & 7; \ \ @@ -45,4 +46,4 @@ ropPcmp(PCMPEQD) ropPcmp(PCMPGTB) ropPcmp(PCMPGTW) ropPcmp(PCMPGTD) - // clang-format on +// clang-format on diff --git a/src/codegen_new/codegen_ops_mmx_pack.c b/src/codegen_new/codegen_ops_mmx_pack.c index d25edd52e..18377e142 100644 --- a/src/codegen_new/codegen_ops_mmx_pack.c +++ b/src/codegen_new/codegen_ops_mmx_pack.c @@ -2,6 +2,7 @@ #include <86box/86box.h> #include "cpu.h" #include <86box/mem.h> +#include <86box/plat_unused.h> #include "x86.h" #include "x86_flags.h" @@ -16,7 +17,7 @@ #include "codegen_ops_helpers.h" #define ropPpack(func) \ - uint32_t rop##func(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t rop##func(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ { \ int dest_reg = (fetchdat >> 3) & 7; \ \ @@ -48,4 +49,4 @@ ropPpack(PUNPCKLDQ) ropPpack(PUNPCKHBW) ropPpack(PUNPCKHWD) ropPpack(PUNPCKHDQ) - // clang-format on +// clang-format on diff --git a/src/codegen_new/codegen_ops_mov.c b/src/codegen_new/codegen_ops_mov.c index eae7045a8..031d2ea05 100644 --- a/src/codegen_new/codegen_ops_mov.c +++ b/src/codegen_new/codegen_ops_mov.c @@ -15,7 +15,7 @@ #include "codegen_ops_mov.h" uint32_t -ropMOV_rb_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropMOV_rb_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint8_t imm = fastreadb(cs + op_pc); @@ -25,7 +25,7 @@ ropMOV_rb_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchd return op_pc + 1; } uint32_t -ropMOV_rw_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropMOV_rw_imm(codeblock_t *block, ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm = fastreadw(cs + op_pc); @@ -172,7 +172,7 @@ ropMOV_r_l(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f } uint32_t -ropMOV_AL_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_AL_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr; @@ -189,7 +189,7 @@ ropMOV_AL_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + ((op_32 & 0x200) ? 4 : 2); } uint32_t -ropMOV_AX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_AX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr; @@ -206,7 +206,7 @@ ropMOV_AX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + ((op_32 & 0x200) ? 4 : 2); } uint32_t -ropMOV_EAX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_EAX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr = 0; @@ -233,7 +233,7 @@ ropMOV_EAX_abs(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 } uint32_t -ropMOV_abs_AL(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_abs_AL(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr; @@ -250,7 +250,7 @@ ropMOV_abs_AL(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + ((op_32 & 0x200) ? 4 : 2); } uint32_t -ropMOV_abs_AX(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_abs_AX(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr; @@ -267,7 +267,7 @@ ropMOV_abs_AX(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_ return op_pc + ((op_32 & 0x200) ? 4 : 2); } uint32_t -ropMOV_abs_EAX(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropMOV_abs_EAX(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uint32_t addr; @@ -614,7 +614,7 @@ ropMOVZX_32_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 } uint32_t -ropXCHG_AX(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropXCHG_AX(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int reg2 = IREG_16(opcode & 7); @@ -625,7 +625,7 @@ ropXCHG_AX(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t f return op_pc; } uint32_t -ropXCHG_EAX(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropXCHG_EAX(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int reg2 = IREG_32(opcode & 7); @@ -716,7 +716,7 @@ ropXCHG_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t f } uint32_t -ropXLAT(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +ropXLAT(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), uint32_t op_32, uint32_t op_pc) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); diff --git a/src/codegen_new/codegen_ops_stack.c b/src/codegen_new/codegen_ops_stack.c index 92ad9509d..057cccb0f 100644 --- a/src/codegen_new/codegen_ops_stack.c +++ b/src/codegen_new/codegen_ops_stack.c @@ -16,7 +16,7 @@ #include "codegen_ops_misc.h" uint32_t -ropPUSH_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -28,7 +28,7 @@ ropPUSH_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t return op_pc; } uint32_t -ropPUSH_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -41,7 +41,7 @@ ropPUSH_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t } uint32_t -ropPOP_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPOP_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -57,7 +57,7 @@ ropPOP_r16(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t f return op_pc; } uint32_t -ropPOP_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPOP_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -74,7 +74,7 @@ ropPOP_r32(UNUSED(codeblock_t *block), ir_data_t *ir, uint8_t opcode, uint32_t f } uint32_t -ropPUSH_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm = fastreadw(cs + op_pc); int sp_reg; @@ -88,7 +88,7 @@ ropPUSH_imm_16(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 return op_pc + 2; } uint32_t -ropPUSH_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t imm = fastreadl(cs + op_pc); int sp_reg; @@ -103,7 +103,7 @@ ropPUSH_imm_32(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32 } uint32_t -ropPUSH_imm_16_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_imm_16_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint16_t imm = (int16_t) (int8_t) fastreadb(cs + op_pc); int sp_reg; @@ -117,7 +117,7 @@ ropPUSH_imm_16_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint return op_pc + 1; } uint32_t -ropPUSH_imm_32_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSH_imm_32_8(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uint32_t imm = (int32_t) (int8_t) fastreadb(cs + op_pc); int sp_reg; @@ -197,7 +197,7 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet } #define ROP_PUSH_SEG(seg) \ - uint32_t ropPUSH_##seg##_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropPUSH_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ int sp_reg; \ \ @@ -208,7 +208,7 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet \ return op_pc; \ } \ - uint32_t ropPUSH_##seg##_32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropPUSH_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ int sp_reg; \ \ @@ -222,7 +222,7 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet } #define ROP_POP_SEG(seg, rseg) \ - uint32_t ropPOP_##seg##_16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropPOP_##seg##_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \ \ @@ -237,7 +237,7 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet \ return op_pc; \ } \ - uint32_t ropPOP_##seg##_32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ + uint32_t ropPOP_##seg##_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) \ { \ uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); \ \ @@ -253,6 +253,7 @@ ropPOP_L(codeblock_t *block, ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fet return op_pc; \ } +// clang-format off ROP_PUSH_SEG(CS) ROP_PUSH_SEG(DS) ROP_PUSH_SEG(ES) @@ -263,9 +264,10 @@ ROP_POP_SEG(DS, cpu_state.seg_ds) ROP_POP_SEG(ES, cpu_state.seg_es) ROP_POP_SEG(FS, cpu_state.seg_fs) ROP_POP_SEG(GS, cpu_state.seg_gs) +// clang-format on uint32_t -ropLEAVE_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropLEAVE_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -281,7 +283,7 @@ ropLEAVE_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), u return op_pc; } uint32_t -ropLEAVE_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropLEAVE_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { uop_MOV_IMM(ir, IREG_oldpc, cpu_state.oldpc); @@ -298,7 +300,7 @@ ropLEAVE_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), u } uint32_t -ropPUSHA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSHA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -317,7 +319,7 @@ ropPUSHA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), u return op_pc; } uint32_t -ropPUSHA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSHA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -337,7 +339,7 @@ ropPUSHA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), u } uint32_t -ropPOPA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPOPA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -355,7 +357,7 @@ ropPOPA_16(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), ui return op_pc; } uint32_t -ropPOPA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPOPA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -374,7 +376,7 @@ ropPOPA_32(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), ui } uint32_t -ropPUSHF(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSHF(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; @@ -390,7 +392,7 @@ ropPUSHF(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint return op_pc; } uint32_t -ropPUSHFD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), uint32_t fetchdat, UNUSED(uint32_t op_32), uint32_t op_pc) +ropPUSHFD(UNUSED(codeblock_t *block), ir_data_t *ir, UNUSED(uint8_t opcode), UNUSED(uint32_t fetchdat), UNUSED(uint32_t op_32), uint32_t op_pc) { int sp_reg; diff --git a/src/cpu/386.c b/src/cpu/386.c index 21db155e9..caa5f84a2 100644 --- a/src/cpu/386.c +++ b/src/cpu/386.c @@ -27,6 +27,7 @@ #include <86box/fdc.h> #include <86box/machine.h> #include <86box/plat_fallthrough.h> +#include <86box/plat_unused.h> #include <86box/gdbstub.h> #ifndef OPS_286_386 # define OPS_286_386 diff --git a/src/cpu/386_common.c b/src/cpu/386_common.c index a68d866bf..8a2bb4ab8 100644 --- a/src/cpu/386_common.c +++ b/src/cpu/386_common.c @@ -1825,7 +1825,7 @@ cpu_386_check_instruction_fault(void) } int -sysenter(uint32_t fetchdat) +sysenter(UNUSED(uint32_t fetchdat)) { #ifdef ENABLE_386_COMMON_LOG x386_common_log("SYSENTER called\n"); @@ -1907,7 +1907,7 @@ sysenter(uint32_t fetchdat) } int -sysexit(uint32_t fetchdat) +sysexit(UNUSED(uint32_t fetchdat)) { #ifdef ENABLE_386_COMMON_LOG x386_common_log("SYSEXIT called\n"); @@ -1994,7 +1994,7 @@ sysexit(uint32_t fetchdat) } int -syscall_op(uint32_t fetchdat) +syscall_op(UNUSED(uint32_t fetchdat)) { #ifdef ENABLE_386_COMMON_LOG x386_common_log("SYSCALL called\n"); @@ -2046,7 +2046,7 @@ syscall_op(uint32_t fetchdat) } int -sysret(uint32_t fetchdat) +sysret(UNUSED(uint32_t fetchdat)) { #ifdef ENABLE_386_COMMON_LOG x386_common_log("SYSRET called\n"); diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index c4c095735..5f41c416a 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -30,6 +30,7 @@ #include <86box/fdc.h> #include <86box/machine.h> #include <86box/plat_fallthrough.h> +#include <86box/plat_unused.h> #include <86box/gdbstub.h> #ifdef USE_DYNAREC # include "codegen.h" diff --git a/src/cpu/808x.c b/src/cpu/808x.c index f37672a5c..a74cf84ab 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -35,6 +35,7 @@ #include <86box/ppi.h> #include <86box/timer.h> #include <86box/gdbstub.h> +#include <86box/plat_unused.h> /* Is the CPU 8088 or 8086. */ int is8086 = 0; @@ -815,7 +816,7 @@ pop(void) } static void -access(int num, int bits) +access(int num, UNUSED(int bits)) { switch (num) { case 0: @@ -1419,7 +1420,7 @@ set_pzs(int bits) } static void -set_co_mul(int bits, int carry) +set_co_mul(UNUSED(int bits), int carry) { set_cf(carry); set_of(carry); diff --git a/src/cpu/codegen_timing_486.c b/src/cpu/codegen_timing_486.c index 90d682211..d8f05cfd3 100644 --- a/src/cpu/codegen_timing_486.c +++ b/src/cpu/codegen_timing_486.c @@ -328,7 +328,7 @@ codegen_timing_486_start(void) } void -codegen_timing_486_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_486_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { timing_count += COUNT(opcode_timings_486[prefix], 0); last_prefix = prefix; diff --git a/src/cpu/codegen_timing_k5.c b/src/cpu/codegen_timing_k5.c index 42b1129fe..8ce2f4cea 100644 --- a/src/cpu/codegen_timing_k5.c +++ b/src/cpu/codegen_timing_k5.c @@ -8,6 +8,7 @@ #include <86box/mem.h> #include "cpu.h" #include <86box/machine.h> +#include <86box/plat_unused.h> #include "x86.h" #include "x86_ops.h" @@ -2037,7 +2038,7 @@ codegen_timing_k5_start(void) } void -codegen_timing_k5_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_k5_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { if (prefix != 0x0f) decode_timestamp++; @@ -2047,7 +2048,7 @@ codegen_timing_k5_prefix(uint8_t prefix, uint32_t fetchdat) } void -codegen_timing_k5_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc) +codegen_timing_k5_opcode(uint8_t opcode, UNUSED(uint32_t fetchdat), int op_32, uint32_t op_pc) { const risc86_instruction_t **ins_table; const uint64_t *deps; diff --git a/src/cpu/codegen_timing_k6.c b/src/cpu/codegen_timing_k6.c index 5566fbbcd..34297211b 100644 --- a/src/cpu/codegen_timing_k6.c +++ b/src/cpu/codegen_timing_k6.c @@ -8,6 +8,7 @@ #include <86box/mem.h> #include "cpu.h" #include <86box/machine.h> +#include <86box/plat_unused.h> #include "x86.h" #include "x86_ops.h" @@ -2037,7 +2038,7 @@ codegen_timing_k6_start(void) } void -codegen_timing_k6_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_k6_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { if (prefix != 0x0f) decode_timestamp++; @@ -2047,7 +2048,7 @@ codegen_timing_k6_prefix(uint8_t prefix, uint32_t fetchdat) } void -codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc) +codegen_timing_k6_opcode(uint8_t opcode, UNUSED(uint32_t fetchdat), int op_32, uint32_t op_pc) { const risc86_instruction_t **ins_table; const uint64_t *deps; diff --git a/src/cpu/codegen_timing_p6.c b/src/cpu/codegen_timing_p6.c index a22813068..42db319c3 100644 --- a/src/cpu/codegen_timing_p6.c +++ b/src/cpu/codegen_timing_p6.c @@ -1845,7 +1845,7 @@ codegen_timing_p6_start(void) } void -codegen_timing_p6_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_p6_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { if (prefix != 0x0f) decode_timestamp++; @@ -1855,7 +1855,7 @@ codegen_timing_p6_prefix(uint8_t prefix, uint32_t fetchdat) } void -codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(uint32_t op_pc)) +codegen_timing_p6_opcode(uint8_t opcode, UNUSED(uint32_t fetchdat), int op_32, UNUSED(uint32_t op_pc)) { const macro_op_t **ins_table; const uint64_t *deps; diff --git a/src/cpu/codegen_timing_winchip.c b/src/cpu/codegen_timing_winchip.c index 3597517ce..0d39f4151 100644 --- a/src/cpu/codegen_timing_winchip.c +++ b/src/cpu/codegen_timing_winchip.c @@ -328,7 +328,7 @@ codegen_timing_winchip_start(void) } void -codegen_timing_winchip_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_winchip_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { timing_count += COUNT(opcode_timings_winchip[prefix], 0); last_prefix = prefix; diff --git a/src/cpu/codegen_timing_winchip2.c b/src/cpu/codegen_timing_winchip2.c index f37fe3366..696a059cf 100644 --- a/src/cpu/codegen_timing_winchip2.c +++ b/src/cpu/codegen_timing_winchip2.c @@ -589,7 +589,7 @@ codegen_timing_winchip2_start(void) } static void -codegen_timing_winchip2_prefix(uint8_t prefix, uint32_t fetchdat) +codegen_timing_winchip2_prefix(uint8_t prefix, UNUSED(uint32_t fetchdat)) { if (prefix == 0x0f) { /*0fh prefix is 'free'*/ diff --git a/src/cpu/x86_ops_3dnow.h b/src/cpu/x86_ops_3dnow.h index b72cbc06c..2b4ed1a6d 100644 --- a/src/cpu/x86_ops_3dnow.h +++ b/src/cpu/x86_ops_3dnow.h @@ -20,7 +20,7 @@ opPREFETCH_a32(uint32_t fetchdat) } static int -opFEMMS(uint32_t fetchdat) +opFEMMS(UNUSED(uint32_t fetchdat)) { ILLEGAL_ON(!cpu_has_feature(CPU_FEATURE_MMX)); if (cr0 & 0xc) { @@ -33,7 +33,7 @@ opFEMMS(uint32_t fetchdat) } static int -opPAVGUSB(uint32_t fetchdat) +opPAVGUSB(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -54,7 +54,7 @@ opPAVGUSB(uint32_t fetchdat) return 0; } static int -opPF2ID(uint32_t fetchdat) +opPF2ID(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -69,7 +69,7 @@ opPF2ID(uint32_t fetchdat) return 0; } static int -opPF2IW(uint32_t fetchdat) +opPF2IW(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -84,7 +84,7 @@ opPF2IW(uint32_t fetchdat) return 0; } static int -opPFACC(uint32_t fetchdat) +opPFACC(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -101,7 +101,7 @@ opPFACC(uint32_t fetchdat) return 0; } static int -opPFNACC(uint32_t fetchdat) +opPFNACC(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -118,7 +118,7 @@ opPFNACC(uint32_t fetchdat) return 0; } static int -opPFPNACC(uint32_t fetchdat) +opPFPNACC(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -135,7 +135,7 @@ opPFPNACC(uint32_t fetchdat) return 0; } static int -opPSWAPD(uint32_t fetchdat) +opPSWAPD(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -155,7 +155,7 @@ opPSWAPD(uint32_t fetchdat) return 0; } static int -opPFADD(uint32_t fetchdat) +opPFADD(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -170,7 +170,7 @@ opPFADD(uint32_t fetchdat) return 0; } static int -opPFCMPEQ(uint32_t fetchdat) +opPFCMPEQ(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -185,7 +185,7 @@ opPFCMPEQ(uint32_t fetchdat) return 0; } static int -opPFCMPGE(uint32_t fetchdat) +opPFCMPGE(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -200,7 +200,7 @@ opPFCMPGE(uint32_t fetchdat) return 0; } static int -opPFCMPGT(uint32_t fetchdat) +opPFCMPGT(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -215,7 +215,7 @@ opPFCMPGT(uint32_t fetchdat) return 0; } static int -opPFMAX(uint32_t fetchdat) +opPFMAX(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -232,7 +232,7 @@ opPFMAX(uint32_t fetchdat) return 0; } static int -opPFMIN(uint32_t fetchdat) +opPFMIN(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -249,7 +249,7 @@ opPFMIN(uint32_t fetchdat) return 0; } static int -opPFMUL(uint32_t fetchdat) +opPFMUL(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -264,7 +264,7 @@ opPFMUL(uint32_t fetchdat) return 0; } static int -opPFRCP(uint32_t fetchdat) +opPFRCP(UNUSED(uint32_t fetchdat)) { MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -293,7 +293,7 @@ opPFRCP(uint32_t fetchdat) } /*Since opPFRCP() calculates a full precision reciprocal, treat the followup iterations as MOVs*/ static int -opPFRCPIT1(uint32_t fetchdat) +opPFRCPIT1(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -308,7 +308,7 @@ opPFRCPIT1(uint32_t fetchdat) return 0; } static int -opPFRCPIT2(uint32_t fetchdat) +opPFRCPIT2(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -323,7 +323,7 @@ opPFRCPIT2(uint32_t fetchdat) return 0; } static int -opPFRSQRT(uint32_t fetchdat) +opPFRSQRT(UNUSED(uint32_t fetchdat)) { MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -352,7 +352,7 @@ opPFRSQRT(uint32_t fetchdat) } /*Since opPFRSQRT() calculates a full precision inverse square root, treat the followup iteration as a NOP*/ static int -opPFRSQIT1(uint32_t fetchdat) +opPFRSQIT1(UNUSED(uint32_t fetchdat)) { MMX_REG src; @@ -362,7 +362,7 @@ opPFRSQIT1(uint32_t fetchdat) return 0; } static int -opPFSUB(uint32_t fetchdat) +opPFSUB(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -377,7 +377,7 @@ opPFSUB(uint32_t fetchdat) return 0; } static int -opPFSUBR(uint32_t fetchdat) +opPFSUBR(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -392,7 +392,7 @@ opPFSUBR(uint32_t fetchdat) return 0; } static int -opPI2FD(uint32_t fetchdat) +opPI2FD(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -407,7 +407,7 @@ opPI2FD(uint32_t fetchdat) return 0; } static int -opPI2FW(uint32_t fetchdat) +opPI2FW(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); @@ -422,7 +422,7 @@ opPI2FW(uint32_t fetchdat) return 0; } static int -opPMULHRW(uint32_t fetchdat) +opPMULHRW(UNUSED(uint32_t fetchdat)) { MMX_REG src; MMX_REG *dst = MMX_GETREGP(cpu_reg); diff --git a/src/cpu/x86_ops_arith.h b/src/cpu/x86_ops_arith.h index 4e3f74e36..0764877a4 100644 --- a/src/cpu/x86_ops_arith.h +++ b/src/cpu/x86_ops_arith.h @@ -313,7 +313,7 @@ return 0; \ } \ \ - static int op##name##_EAX_imm(uint32_t fetchdat) \ + static int op##name##_EAX_imm(UNUSED(uint32_t fetchdat)) \ { \ uint32_t dst = EAX; \ uint32_t src = getlong(); \ @@ -581,7 +581,7 @@ opCMP_AX_imm(uint32_t fetchdat) } static int -opCMP_EAX_imm(uint32_t fetchdat) +opCMP_EAX_imm(UNUSED(uint32_t fetchdat)) { uint32_t src = getlong(); @@ -747,7 +747,7 @@ opTEST_AX(uint32_t fetchdat) return 0; } static int -opTEST_EAX(uint32_t fetchdat) +opTEST_EAX(UNUSED(uint32_t fetchdat)) { uint32_t temp = getlong(); if (cpu_state.abrt) diff --git a/src/cpu/x86_ops_bcd.h b/src/cpu/x86_ops_bcd.h index a04dea65a..a0d18875d 100644 --- a/src/cpu/x86_ops_bcd.h +++ b/src/cpu/x86_ops_bcd.h @@ -1,5 +1,5 @@ static int -opAAA(uint32_t fetchdat) +opAAA(UNUSED(uint32_t fetchdat)) { flags_rebuild(); if ((cpu_state.flags & A_FLAG) || ((AL & 0xF) > 9)) { @@ -46,7 +46,7 @@ opAAM(uint32_t fetchdat) } static int -opAAS(uint32_t fetchdat) +opAAS(UNUSED(uint32_t fetchdat)) { flags_rebuild(); if ((cpu_state.flags & A_FLAG) || ((AL & 0xF) > 9)) { @@ -63,7 +63,7 @@ opAAS(uint32_t fetchdat) } static int -opDAA(uint32_t fetchdat) +opDAA(UNUSED(uint32_t fetchdat)) { uint16_t tempw; uint16_t old_AL; @@ -100,7 +100,7 @@ opDAA(uint32_t fetchdat) } static int -opDAS(uint32_t fetchdat) +opDAS(UNUSED(uint32_t fetchdat)) { uint16_t tempw; uint16_t old_AL; diff --git a/src/cpu/x86_ops_call.h b/src/cpu/x86_ops_call.h index 9d52a2764..ee54dceff 100644 --- a/src/cpu/x86_ops_call.h +++ b/src/cpu/x86_ops_call.h @@ -209,7 +209,7 @@ opCALL_far_w(uint32_t fetchdat) return 0; } static int -opCALL_far_l(uint32_t fetchdat) +opCALL_far_l(UNUSED(uint32_t fetchdat)) { uint32_t old_cs; uint32_t old_pc; diff --git a/src/cpu/x86_ops_cyrix.h b/src/cpu/x86_ops_cyrix.h index 672ebd08e..8c3d6e155 100644 --- a/src/cpu/x86_ops_cyrix.h +++ b/src/cpu/x86_ops_cyrix.h @@ -212,7 +212,7 @@ opRSTS_a32(uint32_t fetchdat) } static int -opSMINT(uint32_t fetchdat) +opSMINT(UNUSED(uint32_t fetchdat)) { if (in_smm) fatal("opSMINT\n"); @@ -223,7 +223,7 @@ opSMINT(uint32_t fetchdat) } static int -opRDSHR_a16(uint32_t fetchdat) +opRDSHR_a16(UNUSED(uint32_t fetchdat)) { if (in_smm) fatal("opRDSHR_a16\n"); @@ -233,7 +233,7 @@ opRDSHR_a16(uint32_t fetchdat) return 1; } static int -opRDSHR_a32(uint32_t fetchdat) +opRDSHR_a32(UNUSED(uint32_t fetchdat)) { if (in_smm) fatal("opRDSHR_a32\n"); @@ -244,7 +244,7 @@ opRDSHR_a32(uint32_t fetchdat) } static int -opWRSHR_a16(uint32_t fetchdat) +opWRSHR_a16(UNUSED(uint32_t fetchdat)) { if (in_smm) fatal("opWRSHR_a16\n"); @@ -254,7 +254,7 @@ opWRSHR_a16(uint32_t fetchdat) return 1; } static int -opWRSHR_a32(uint32_t fetchdat) +opWRSHR_a32(UNUSED(uint32_t fetchdat)) { if (in_smm) fatal("opWRSHR_a32\n"); diff --git a/src/cpu/x86_ops_flag.h b/src/cpu/x86_ops_flag.h index 019472aa0..a0fa612a8 100644 --- a/src/cpu/x86_ops_flag.h +++ b/src/cpu/x86_ops_flag.h @@ -1,5 +1,5 @@ static int -opCMC(uint32_t fetchdat) +opCMC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags ^= C_FLAG; @@ -9,7 +9,7 @@ opCMC(uint32_t fetchdat) } static int -opCLC(uint32_t fetchdat) +opCLC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags &= ~C_FLAG; @@ -18,7 +18,7 @@ opCLC(uint32_t fetchdat) return 0; } static int -opCLD(uint32_t fetchdat) +opCLD(UNUSED(uint32_t fetchdat)) { cpu_state.flags &= ~D_FLAG; CLOCK_CYCLES(2); @@ -26,7 +26,7 @@ opCLD(uint32_t fetchdat) return 0; } static int -opCLI(uint32_t fetchdat) +opCLI(UNUSED(uint32_t fetchdat)) { if (!IOPLp) { if ((!(cpu_state.eflags & VM_FLAG) && (cr4 & CR4_PVI)) || ((cpu_state.eflags & VM_FLAG) && (cr4 & CR4_VME))) { @@ -44,7 +44,7 @@ opCLI(uint32_t fetchdat) } static int -opSTC(uint32_t fetchdat) +opSTC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags |= C_FLAG; @@ -53,7 +53,7 @@ opSTC(uint32_t fetchdat) return 0; } static int -opSTD(uint32_t fetchdat) +opSTD(UNUSED(uint32_t fetchdat)) { cpu_state.flags |= D_FLAG; CLOCK_CYCLES(2); @@ -61,7 +61,7 @@ opSTD(uint32_t fetchdat) return 0; } static int -opSTI(uint32_t fetchdat) +opSTI(UNUSED(uint32_t fetchdat)) { if (!IOPLp) { if ((!(cpu_state.eflags & VM_FLAG) && (cr4 & CR4_PVI)) || ((cpu_state.eflags & VM_FLAG) && (cr4 & CR4_VME))) { @@ -87,7 +87,7 @@ opSTI(uint32_t fetchdat) } static int -opSAHF(uint32_t fetchdat) +opSAHF(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags = (cpu_state.flags & 0xff00) | (AH & 0xd5) | 2; @@ -101,7 +101,7 @@ opSAHF(uint32_t fetchdat) return 0; } static int -opLAHF(uint32_t fetchdat) +opLAHF(UNUSED(uint32_t fetchdat)) { flags_rebuild(); AH = cpu_state.flags & 0xff; @@ -111,7 +111,7 @@ opLAHF(uint32_t fetchdat) } static int -opPUSHF(uint32_t fetchdat) +opPUSHF(UNUSED(uint32_t fetchdat)) { if ((cpu_state.eflags & VM_FLAG) && (IOPL < 3)) { if (cr4 & CR4_VME) { @@ -135,7 +135,7 @@ opPUSHF(uint32_t fetchdat) return cpu_state.abrt; } static int -opPUSHFD(uint32_t fetchdat) +opPUSHFD(UNUSED(uint32_t fetchdat)) { uint16_t tempw; if ((cpu_state.eflags & VM_FLAG) && (IOPL < 3)) { @@ -156,7 +156,7 @@ opPUSHFD(uint32_t fetchdat) } static int -opPOPF_186(uint32_t fetchdat) +opPOPF_186(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -192,7 +192,7 @@ opPOPF_186(uint32_t fetchdat) return 0; } static int -opPOPF_286(uint32_t fetchdat) +opPOPF_286(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -228,7 +228,7 @@ opPOPF_286(uint32_t fetchdat) return 0; } static int -opPOPF(uint32_t fetchdat) +opPOPF(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -284,7 +284,7 @@ opPOPF(uint32_t fetchdat) return 0; } static int -opPOPFD(uint32_t fetchdat) +opPOPFD(UNUSED(uint32_t fetchdat)) { uint32_t templ; diff --git a/src/cpu/x86_ops_flag_2386.h b/src/cpu/x86_ops_flag_2386.h index ba34ae5e7..c9a2d5ab2 100644 --- a/src/cpu/x86_ops_flag_2386.h +++ b/src/cpu/x86_ops_flag_2386.h @@ -1,5 +1,5 @@ static int -opCMC(uint32_t fetchdat) +opCMC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags ^= C_FLAG; @@ -9,7 +9,7 @@ opCMC(uint32_t fetchdat) } static int -opCLC(uint32_t fetchdat) +opCLC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags &= ~C_FLAG; @@ -18,7 +18,7 @@ opCLC(uint32_t fetchdat) return 0; } static int -opCLD(uint32_t fetchdat) +opCLD(UNUSED(uint32_t fetchdat)) { cpu_state.flags &= ~D_FLAG; CLOCK_CYCLES(2); @@ -26,7 +26,7 @@ opCLD(uint32_t fetchdat) return 0; } static int -opCLI(uint32_t fetchdat) +opCLI(UNUSED(uint32_t fetchdat)) { if (!IOPLp) { if ((!(cpu_state.eflags & VM_FLAG) && (cr4 & CR4_PVI)) || ((cpu_state.eflags & VM_FLAG) && (cr4 & CR4_VME))) { @@ -44,7 +44,7 @@ opCLI(uint32_t fetchdat) } static int -opSTC(uint32_t fetchdat) +opSTC(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags |= C_FLAG; @@ -53,7 +53,7 @@ opSTC(uint32_t fetchdat) return 0; } static int -opSTD(uint32_t fetchdat) +opSTD(UNUSED(uint32_t fetchdat)) { cpu_state.flags |= D_FLAG; CLOCK_CYCLES(2); @@ -61,7 +61,7 @@ opSTD(uint32_t fetchdat) return 0; } static int -opSTI(uint32_t fetchdat) +opSTI(UNUSED(uint32_t fetchdat)) { if (!IOPLp) { if ((!(cpu_state.eflags & VM_FLAG) && (cr4 & CR4_PVI)) || ((cpu_state.eflags & VM_FLAG) && (cr4 & CR4_VME))) { @@ -87,7 +87,7 @@ opSTI(uint32_t fetchdat) } static int -opSAHF(uint32_t fetchdat) +opSAHF(UNUSED(uint32_t fetchdat)) { flags_rebuild(); cpu_state.flags = (cpu_state.flags & 0xff00) | (AH & 0xd5) | 2; @@ -101,7 +101,7 @@ opSAHF(uint32_t fetchdat) return 0; } static int -opLAHF(uint32_t fetchdat) +opLAHF(UNUSED(uint32_t fetchdat)) { flags_rebuild(); AH = cpu_state.flags & 0xff; @@ -111,7 +111,7 @@ opLAHF(uint32_t fetchdat) } static int -opPUSHF(uint32_t fetchdat) +opPUSHF(UNUSED(uint32_t fetchdat)) { if ((cpu_state.eflags & VM_FLAG) && (IOPL < 3)) { if (cr4 & CR4_VME) { @@ -135,7 +135,7 @@ opPUSHF(uint32_t fetchdat) return cpu_state.abrt; } static int -opPUSHFD(uint32_t fetchdat) +opPUSHFD(UNUSED(uint32_t fetchdat)) { uint16_t tempw; if ((cpu_state.eflags & VM_FLAG) && (IOPL < 3)) { @@ -156,7 +156,7 @@ opPUSHFD(uint32_t fetchdat) } static int -opPOPF_186(uint32_t fetchdat) +opPOPF_186(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -190,7 +190,7 @@ opPOPF_186(uint32_t fetchdat) return 0; } static int -opPOPF_286(uint32_t fetchdat) +opPOPF_286(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -224,7 +224,7 @@ opPOPF_286(uint32_t fetchdat) return 0; } static int -opPOPF(uint32_t fetchdat) +opPOPF(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -278,7 +278,7 @@ opPOPF(uint32_t fetchdat) return 0; } static int -opPOPFD(uint32_t fetchdat) +opPOPFD(UNUSED(uint32_t fetchdat)) { uint32_t templ; diff --git a/src/cpu/x86_ops_fpu.h b/src/cpu/x86_ops_fpu.h index 74c67c2ee..3434c4a73 100644 --- a/src/cpu/x86_ops_fpu.h +++ b/src/cpu/x86_ops_fpu.h @@ -90,7 +90,7 @@ opESCAPE_df_a32(uint32_t fetchdat) } static int -opWAIT(uint32_t fetchdat) +opWAIT(UNUSED(uint32_t fetchdat)) { if ((cr0 & 0xa) == 0xa) { x86_int(7); diff --git a/src/cpu/x86_ops_fpu_2386.h b/src/cpu/x86_ops_fpu_2386.h index cc9c6dcc2..c2252af12 100644 --- a/src/cpu/x86_ops_fpu_2386.h +++ b/src/cpu/x86_ops_fpu_2386.h @@ -90,7 +90,7 @@ opESCAPE_df_a32(uint32_t fetchdat) } static int -opWAIT(uint32_t fetchdat) +opWAIT(UNUSED(uint32_t fetchdat)) { if ((cr0 & 0xa) == 0xa) { x86_int(7); diff --git a/src/cpu/x86_ops_inc_dec.h b/src/cpu/x86_ops_inc_dec.h index 3eb908c57..b33d02f45 100644 --- a/src/cpu/x86_ops_inc_dec.h +++ b/src/cpu/x86_ops_inc_dec.h @@ -1,5 +1,5 @@ #define INC_DEC_OP(name, reg, inc, setflags) \ - static int op##name(uint32_t fetchdat) \ + static int op##name(UNUSED(uint32_t fetchdat)) \ { \ setflags(reg, 1); \ reg += inc; \ diff --git a/src/cpu/x86_ops_int.h b/src/cpu/x86_ops_int.h index a73ed62e0..1ed5e6c2f 100644 --- a/src/cpu/x86_ops_int.h +++ b/src/cpu/x86_ops_int.h @@ -1,5 +1,5 @@ static int -opINT3(uint32_t fetchdat) +opINT3(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -18,7 +18,7 @@ opINT3(uint32_t fetchdat) } static int -opINT1(uint32_t fetchdat) +opINT1(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -75,7 +75,7 @@ opINT(uint32_t fetchdat) } static int -opINTO(uint32_t fetchdat) +opINTO(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); diff --git a/src/cpu/x86_ops_io.h b/src/cpu/x86_ops_io.h index 8a99b8668..36bf05cd3 100644 --- a/src/cpu/x86_ops_io.h +++ b/src/cpu/x86_ops_io.h @@ -75,7 +75,7 @@ opOUT_EAX_imm(uint32_t fetchdat) } static int -opIN_AL_DX(uint32_t fetchdat) +opIN_AL_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 1); AL = inb(DX); @@ -86,7 +86,7 @@ opIN_AL_DX(uint32_t fetchdat) return 0; } static int -opIN_AX_DX(uint32_t fetchdat) +opIN_AX_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 2); AX = inw(DX); @@ -97,7 +97,7 @@ opIN_AX_DX(uint32_t fetchdat) return 0; } static int -opIN_EAX_DX(uint32_t fetchdat) +opIN_EAX_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 4); EAX = inl(DX); @@ -109,7 +109,7 @@ opIN_EAX_DX(uint32_t fetchdat) } static int -opOUT_AL_DX(uint32_t fetchdat) +opOUT_AL_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 1); outb(DX, AL); @@ -120,7 +120,7 @@ opOUT_AL_DX(uint32_t fetchdat) return x86_was_reset; } static int -opOUT_AX_DX(uint32_t fetchdat) +opOUT_AX_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 2); outw(DX, AX); @@ -131,7 +131,7 @@ opOUT_AX_DX(uint32_t fetchdat) return 0; } static int -opOUT_EAX_DX(uint32_t fetchdat) +opOUT_EAX_DX(UNUSED(uint32_t fetchdat)) { check_io_perm(DX, 4); outl(DX, EAX); diff --git a/src/cpu/x86_ops_jump.h b/src/cpu/x86_ops_jump.h index 97ca673d7..fc99fc5fd 100644 --- a/src/cpu/x86_ops_jump.h +++ b/src/cpu/x86_ops_jump.h @@ -51,7 +51,7 @@ return 0; \ } \ \ - static int opJ##condition##_l(uint32_t fetchdat) \ + static int opJ##condition##_l(UNUSED(uint32_t fetchdat)) \ { \ uint32_t offset = getlong(); \ if (cpu_state.abrt) \ @@ -256,7 +256,7 @@ opJMP_r16(uint32_t fetchdat) return 0; } static int -opJMP_r32(uint32_t fetchdat) +opJMP_r32(UNUSED(uint32_t fetchdat)) { int32_t offset = (int32_t) getlong(); if (cpu_state.abrt) @@ -289,7 +289,7 @@ opJMP_far_a16(uint32_t fetchdat) return 0; } static int -opJMP_far_a32(uint32_t fetchdat) +opJMP_far_a32(UNUSED(uint32_t fetchdat)) { uint16_t seg; uint32_t addr; @@ -323,7 +323,7 @@ opCALL_r16(uint32_t fetchdat) return 0; } static int -opCALL_r32(uint32_t fetchdat) +opCALL_r32(UNUSED(uint32_t fetchdat)) { int32_t addr = getlong(); @@ -339,7 +339,7 @@ opCALL_r32(uint32_t fetchdat) } static int -opRET_w(uint32_t fetchdat) +opRET_w(UNUSED(uint32_t fetchdat)) { uint16_t ret; @@ -355,7 +355,7 @@ opRET_w(uint32_t fetchdat) return 0; } static int -opRET_l(uint32_t fetchdat) +opRET_l(UNUSED(uint32_t fetchdat)) { uint32_t ret; diff --git a/src/cpu/x86_ops_misc.h b/src/cpu/x86_ops_misc.h index c0b9de437..ffc79f0e8 100644 --- a/src/cpu/x86_ops_misc.h +++ b/src/cpu/x86_ops_misc.h @@ -1,5 +1,5 @@ static int -opCBW(uint32_t fetchdat) +opCBW(UNUSED(uint32_t fetchdat)) { AH = (AL & 0x80) ? 0xff : 0; CLOCK_CYCLES(3); @@ -7,7 +7,7 @@ opCBW(uint32_t fetchdat) return 0; } static int -opCWDE(uint32_t fetchdat) +opCWDE(UNUSED(uint32_t fetchdat)) { EAX = (AX & 0x8000) ? (0xffff0000 | AX) : AX; CLOCK_CYCLES(3); @@ -15,7 +15,7 @@ opCWDE(uint32_t fetchdat) return 0; } static int -opCWD(uint32_t fetchdat) +opCWD(UNUSED(uint32_t fetchdat)) { DX = (AX & 0x8000) ? 0xFFFF : 0; CLOCK_CYCLES(2); @@ -23,7 +23,7 @@ opCWD(uint32_t fetchdat) return 0; } static int -opCDQ(uint32_t fetchdat) +opCDQ(UNUSED(uint32_t fetchdat)) { EDX = (EAX & 0x80000000) ? 0xffffffff : 0; CLOCK_CYCLES(2); @@ -32,7 +32,7 @@ opCDQ(uint32_t fetchdat) } static int -opNOP(uint32_t fetchdat) +opNOP(UNUSED(uint32_t fetchdat)) { CLOCK_CYCLES((is486) ? 1 : 3); PREFETCH_RUN(3, 1, -1, 0, 0, 0, 0, 0); @@ -40,7 +40,7 @@ opNOP(uint32_t fetchdat) } static int -opSETALC(uint32_t fetchdat) +opSETALC(UNUSED(uint32_t fetchdat)) { AL = (CF_SET()) ? 0xff : 0; CLOCK_CYCLES(timing_rr); @@ -701,7 +701,7 @@ opF7_l_a32(uint32_t fetchdat) } static int -opHLT(uint32_t fetchdat) +opHLT(UNUSED(uint32_t fetchdat)) { if ((CPL || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); @@ -856,7 +856,7 @@ opBOUND_l_a32(uint32_t fetchdat) } static int -opCLTS(uint32_t fetchdat) +opCLTS(UNUSED(uint32_t fetchdat)) { if ((CPL || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); @@ -869,14 +869,14 @@ opCLTS(uint32_t fetchdat) } static int -opINVD(uint32_t fetchdat) +opINVD(UNUSED(uint32_t fetchdat)) { CLOCK_CYCLES(1000); CPU_BLOCK_END(); return 0; } static int -opWBINVD(uint32_t fetchdat) +opWBINVD(UNUSED(uint32_t fetchdat)) { if ((CPL || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); @@ -888,7 +888,7 @@ opWBINVD(uint32_t fetchdat) } static int -opLOADALL(uint32_t fetchdat) +opLOADALL(UNUSED(uint32_t fetchdat)) { if (CPL && (cr0 & 1)) { x86gpf(NULL, 0); @@ -998,7 +998,7 @@ loadall_load_segment(uint32_t addr, x86seg *s) } static int -opLOADALL386(uint32_t fetchdat) +opLOADALL386(UNUSED(uint32_t fetchdat)) { uint32_t la_addr = es + EDI; @@ -1046,7 +1046,7 @@ opLOADALL386(uint32_t fetchdat) } static int -opCPUID(uint32_t fetchdat) +opCPUID(UNUSED(uint32_t fetchdat)) { if (CPUID) { cpu_CPUID(); @@ -1059,7 +1059,7 @@ opCPUID(uint32_t fetchdat) } static int -opRDMSR(uint32_t fetchdat) +opRDMSR(UNUSED(uint32_t fetchdat)) { if (cpu_has_feature(CPU_FEATURE_MSR)) { cpu_RDMSR(); @@ -1072,7 +1072,7 @@ opRDMSR(uint32_t fetchdat) } static int -opWRMSR(uint32_t fetchdat) +opWRMSR(UNUSED(uint32_t fetchdat)) { if (cpu_has_feature(CPU_FEATURE_MSR)) { cpu_WRMSR(); @@ -1085,7 +1085,7 @@ opWRMSR(uint32_t fetchdat) } static int -opRSM(uint32_t fetchdat) +opRSM(UNUSED(uint32_t fetchdat)) { if (in_smm) { leave_smm(); diff --git a/src/cpu/x86_ops_mmx.h b/src/cpu/x86_ops_mmx.h index ab5e19762..338948af5 100644 --- a/src/cpu/x86_ops_mmx.h +++ b/src/cpu/x86_ops_mmx.h @@ -34,7 +34,7 @@ x87_set_mmx() static int -opEMMS(uint32_t fetchdat) +opEMMS(UNUSED(uint32_t fetchdat)) { if (!cpu_has_feature(CPU_FEATURE_MMX)) { cpu_state.pc = cpu_state.oldpc; diff --git a/src/cpu/x86_ops_mov.h b/src/cpu/x86_ops_mov.h index e77876d5c..787a727d3 100644 --- a/src/cpu/x86_ops_mov.h +++ b/src/cpu/x86_ops_mov.h @@ -129,7 +129,7 @@ opMOV_SP_imm(uint32_t fetchdat) } static int -opMOV_EAX_imm(uint32_t fetchdat) +opMOV_EAX_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -140,7 +140,7 @@ opMOV_EAX_imm(uint32_t fetchdat) return 0; } static int -opMOV_EBX_imm(uint32_t fetchdat) +opMOV_EBX_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -151,7 +151,7 @@ opMOV_EBX_imm(uint32_t fetchdat) return 0; } static int -opMOV_ECX_imm(uint32_t fetchdat) +opMOV_ECX_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -162,7 +162,7 @@ opMOV_ECX_imm(uint32_t fetchdat) return 0; } static int -opMOV_EDX_imm(uint32_t fetchdat) +opMOV_EDX_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -173,7 +173,7 @@ opMOV_EDX_imm(uint32_t fetchdat) return 0; } static int -opMOV_ESI_imm(uint32_t fetchdat) +opMOV_ESI_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -184,7 +184,7 @@ opMOV_ESI_imm(uint32_t fetchdat) return 0; } static int -opMOV_EDI_imm(uint32_t fetchdat) +opMOV_EDI_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -195,7 +195,7 @@ opMOV_EDI_imm(uint32_t fetchdat) return 0; } static int -opMOV_EBP_imm(uint32_t fetchdat) +opMOV_EBP_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -206,7 +206,7 @@ opMOV_EBP_imm(uint32_t fetchdat) return 0; } static int -opMOV_ESP_imm(uint32_t fetchdat) +opMOV_ESP_imm(UNUSED(uint32_t fetchdat)) { uint32_t templ = getlong(); if (cpu_state.abrt) @@ -326,7 +326,7 @@ opMOV_AL_a16(uint32_t fetchdat) return 0; } static int -opMOV_AL_a32(uint32_t fetchdat) +opMOV_AL_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; uint32_t addr = getlong(); @@ -356,7 +356,7 @@ opMOV_AX_a16(uint32_t fetchdat) return 0; } static int -opMOV_AX_a32(uint32_t fetchdat) +opMOV_AX_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; uint32_t addr = getlong(); @@ -386,7 +386,7 @@ opMOV_EAX_a16(uint32_t fetchdat) return 0; } static int -opMOV_EAX_a32(uint32_t fetchdat) +opMOV_EAX_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; uint32_t addr = getlong(); @@ -413,7 +413,7 @@ opMOV_a16_AL(uint32_t fetchdat) return cpu_state.abrt; } static int -opMOV_a32_AL(uint32_t fetchdat) +opMOV_a32_AL(UNUSED(uint32_t fetchdat)) { uint32_t addr = getlong(); SEG_CHECK_WRITE(cpu_state.ea_seg); @@ -435,7 +435,7 @@ opMOV_a16_AX(uint32_t fetchdat) return cpu_state.abrt; } static int -opMOV_a32_AX(uint32_t fetchdat) +opMOV_a32_AX(UNUSED(uint32_t fetchdat)) { uint32_t addr = getlong(); if (cpu_state.abrt) @@ -459,7 +459,7 @@ opMOV_a16_EAX(uint32_t fetchdat) return cpu_state.abrt; } static int -opMOV_a32_EAX(uint32_t fetchdat) +opMOV_a32_EAX(UNUSED(uint32_t fetchdat)) { uint32_t addr = getlong(); if (cpu_state.abrt) @@ -515,7 +515,7 @@ opLEA_l_a32(uint32_t fetchdat) } static int -opXLAT_a16(uint32_t fetchdat) +opXLAT_a16(UNUSED(uint32_t fetchdat)) { uint32_t addr = (BX + AL) & 0xFFFF; uint8_t temp; @@ -530,7 +530,7 @@ opXLAT_a16(uint32_t fetchdat) return 0; } static int -opXLAT_a32(uint32_t fetchdat) +opXLAT_a32(UNUSED(uint32_t fetchdat)) { uint32_t addr = EBX + AL; uint8_t temp; diff --git a/src/cpu/x86_ops_msr.h b/src/cpu/x86_ops_msr.h index daae01d84..a59cecdd4 100644 --- a/src/cpu/x86_ops_msr.h +++ b/src/cpu/x86_ops_msr.h @@ -1,5 +1,5 @@ static int -opRDTSC(uint32_t fetchdat) +opRDTSC(UNUSED(uint32_t fetchdat)) { if (!cpu_has_feature(CPU_FEATURE_RDTSC)) { cpu_state.pc = cpu_state.oldpc; @@ -21,7 +21,7 @@ opRDTSC(uint32_t fetchdat) } static int -opRDPMC(uint32_t fetchdat) +opRDPMC(UNUSED(uint32_t fetchdat)) { if (ECX > 1 || (!(cr4 & CR4_PCE) && (cr0 & 1) && CPL)) { x86gpf("RDPMC not allowed", 0); diff --git a/src/cpu/x86_ops_pmode.h b/src/cpu/x86_ops_pmode.h index 4f32b0e37..81f194f14 100644 --- a/src/cpu/x86_ops_pmode.h +++ b/src/cpu/x86_ops_pmode.h @@ -172,12 +172,12 @@ opLAR(w_a16, fetch_ea_16, 0, 0) return cpu_state.abrt; \ } - opLSL(w_a16, fetch_ea_16, 0, 0) - opLSL(w_a32, fetch_ea_32, 0, 1) - opLSL(l_a16, fetch_ea_16, 1, 0) - opLSL(l_a32, fetch_ea_32, 1, 1) +opLSL(w_a16, fetch_ea_16, 0, 0) +opLSL(w_a32, fetch_ea_32, 0, 1) +opLSL(l_a16, fetch_ea_16, 1, 0) +opLSL(l_a32, fetch_ea_32, 1, 1) - static int op0F00_common(uint32_t fetchdat, int ea32) +static int op0F00_common(uint32_t fetchdat, UNUSED(int ea32)) { int dpl; int valid; @@ -359,7 +359,7 @@ op0F00_a32(uint32_t fetchdat) } static int -op0F01_common(uint32_t fetchdat, int is32, int is286, int ea32) +op0F01_common(UNUSED(uint32_t fetchdat), int is32, int is286, UNUSED(int ea32)) { uint32_t base; uint16_t limit; diff --git a/src/cpu/x86_ops_rep.h b/src/cpu/x86_ops_rep.h index a49db7e81..c75684d31 100644 --- a/src/cpu/x86_ops_rep.h +++ b/src/cpu/x86_ops_rep.h @@ -1,5 +1,5 @@ #define REP_OPS(size, CNT_REG, SRC_REG, DEST_REG) \ - static int opREP_INSB_##size(uint32_t fetchdat) \ + static int opREP_INSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -38,7 +38,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSW_##size(uint32_t fetchdat) \ + static int opREP_INSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -77,7 +77,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSL_##size(uint32_t fetchdat) \ + static int opREP_INSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -117,7 +117,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_OUTSB_##size(uint32_t fetchdat) \ + static int opREP_OUTSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -148,7 +148,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSW_##size(uint32_t fetchdat) \ + static int opREP_OUTSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -179,7 +179,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSL_##size(uint32_t fetchdat) \ + static int opREP_OUTSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -211,7 +211,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_MOVSB_##size(uint32_t fetchdat) \ + static int opREP_MOVSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -264,7 +264,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSW_##size(uint32_t fetchdat) \ + static int opREP_MOVSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -318,7 +318,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSL_##size(uint32_t fetchdat) \ + static int opREP_MOVSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -373,7 +373,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_STOSB_##size(uint32_t fetchdat) \ + static int opREP_STOSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -405,7 +405,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSW_##size(uint32_t fetchdat) \ + static int opREP_STOSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -437,7 +437,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSL_##size(uint32_t fetchdat) \ + static int opREP_STOSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -470,7 +470,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_LODSB_##size(uint32_t fetchdat) \ + static int opREP_LODSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -502,7 +502,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSW_##size(uint32_t fetchdat) \ + static int opREP_LODSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -534,7 +534,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSL_##size(uint32_t fetchdat) \ + static int opREP_LODSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -570,7 +570,7 @@ #define CHEK_READ(a, b, c) #define REP_OPS_CMPS_SCAS(size, CNT_REG, SRC_REG, DEST_REG, FV) \ - static int opREP_CMPSB_##size(uint32_t fetchdat) \ + static int opREP_CMPSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -623,7 +623,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSW_##size(uint32_t fetchdat) \ + static int opREP_CMPSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -677,7 +677,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSL_##size(uint32_t fetchdat) \ + static int opREP_CMPSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -732,7 +732,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_SCASB_##size(uint32_t fetchdat) \ + static int opREP_SCASB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -767,7 +767,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASW_##size(uint32_t fetchdat) \ + static int opREP_SCASW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -802,7 +802,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASL_##size(uint32_t fetchdat) \ + static int opREP_SCASL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ diff --git a/src/cpu/x86_ops_rep_2386.h b/src/cpu/x86_ops_rep_2386.h index fe5048340..aa1984f81 100644 --- a/src/cpu/x86_ops_rep_2386.h +++ b/src/cpu/x86_ops_rep_2386.h @@ -1,5 +1,5 @@ #define REP_OPS(size, CNT_REG, SRC_REG, DEST_REG) \ - static int opREP_INSB_##size(uint32_t fetchdat) \ + static int opREP_INSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -38,7 +38,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSW_##size(uint32_t fetchdat) \ + static int opREP_INSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -77,7 +77,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSL_##size(uint32_t fetchdat) \ + static int opREP_INSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -117,7 +117,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_OUTSB_##size(uint32_t fetchdat) \ + static int opREP_OUTSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -148,7 +148,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSW_##size(uint32_t fetchdat) \ + static int opREP_OUTSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -179,7 +179,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSL_##size(uint32_t fetchdat) \ + static int opREP_OUTSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ \ @@ -211,7 +211,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_MOVSB_##size(uint32_t fetchdat) \ + static int opREP_MOVSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -264,7 +264,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSW_##size(uint32_t fetchdat) \ + static int opREP_MOVSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -318,7 +318,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSL_##size(uint32_t fetchdat) \ + static int opREP_MOVSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -373,7 +373,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_STOSB_##size(uint32_t fetchdat) \ + static int opREP_STOSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -405,7 +405,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSW_##size(uint32_t fetchdat) \ + static int opREP_STOSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -437,7 +437,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSL_##size(uint32_t fetchdat) \ + static int opREP_STOSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -470,7 +470,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_LODSB_##size(uint32_t fetchdat) \ + static int opREP_LODSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -502,7 +502,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSW_##size(uint32_t fetchdat) \ + static int opREP_LODSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -534,7 +534,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSL_##size(uint32_t fetchdat) \ + static int opREP_LODSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -570,7 +570,7 @@ #define CHEK_READ(a, b, c) #define REP_OPS_CMPS_SCAS(size, CNT_REG, SRC_REG, DEST_REG, FV) \ - static int opREP_CMPSB_##size(uint32_t fetchdat) \ + static int opREP_CMPSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -619,7 +619,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSW_##size(uint32_t fetchdat) \ + static int opREP_CMPSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -669,7 +669,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSL_##size(uint32_t fetchdat) \ + static int opREP_CMPSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ \ @@ -720,7 +720,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_SCASB_##size(uint32_t fetchdat) \ + static int opREP_SCASB_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -755,7 +755,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASW_##size(uint32_t fetchdat) \ + static int opREP_SCASW_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ @@ -790,7 +790,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASL_##size(uint32_t fetchdat) \ + static int opREP_SCASL_##size(UNUSED(uint32_t fetchdat)) \ { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ diff --git a/src/cpu/x86_ops_rep_dyn.h b/src/cpu/x86_ops_rep_dyn.h index cf32209cc..bdb721ab0 100644 --- a/src/cpu/x86_ops_rep_dyn.h +++ b/src/cpu/x86_ops_rep_dyn.h @@ -1,5 +1,5 @@ #define REP_OPS(size, CNT_REG, SRC_REG, DEST_REG) \ - static int opREP_INSB_##size(uint32_t fetchdat) \ + static int opREP_INSB_##size(UNUSED(uint32_t fetchdat)) \ { \ addr64 = 0x00000000; \ \ @@ -32,7 +32,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSW_##size(uint32_t fetchdat) \ + static int opREP_INSW_##size(UNUSED(uint32_t fetchdat)) \ { \ addr64a[0] = addr64a[1] = 0x00000000; \ \ @@ -65,7 +65,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_INSL_##size(uint32_t fetchdat) \ + static int opREP_INSL_##size(UNUSED(uint32_t fetchdat)) \ { \ addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000; \ \ @@ -99,7 +99,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_OUTSB_##size(uint32_t fetchdat) \ + static int opREP_OUTSB_##size(UNUSED(uint32_t fetchdat)) \ { \ if (CNT_REG > 0) { \ uint8_t temp; \ @@ -124,7 +124,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSW_##size(uint32_t fetchdat) \ + static int opREP_OUTSW_##size(UNUSED(uint32_t fetchdat)) \ { \ if (CNT_REG > 0) { \ uint16_t temp; \ @@ -149,7 +149,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_OUTSL_##size(uint32_t fetchdat) \ + static int opREP_OUTSL_##size(UNUSED(uint32_t fetchdat)) \ { \ if (CNT_REG > 0) { \ uint32_t temp; \ @@ -175,7 +175,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_MOVSB_##size(uint32_t fetchdat) \ + static int opREP_MOVSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ addr64 = addr64_2 = 0x00000000; \ @@ -223,7 +223,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSW_##size(uint32_t fetchdat) \ + static int opREP_MOVSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ addr64a[0] = addr64a[1] = 0x00000000; \ @@ -272,7 +272,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_MOVSL_##size(uint32_t fetchdat) \ + static int opREP_MOVSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000; \ @@ -322,7 +322,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_STOSB_##size(uint32_t fetchdat) \ + static int opREP_STOSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -350,7 +350,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSW_##size(uint32_t fetchdat) \ + static int opREP_STOSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -378,7 +378,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_STOSL_##size(uint32_t fetchdat) \ + static int opREP_STOSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -407,7 +407,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_LODSB_##size(uint32_t fetchdat) \ + static int opREP_LODSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -435,7 +435,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSW_##size(uint32_t fetchdat) \ + static int opREP_LODSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -463,7 +463,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_LODSL_##size(uint32_t fetchdat) \ + static int opREP_LODSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ if (trap) \ @@ -495,7 +495,7 @@ #define CHEK_READ(a, b, c) #define REP_OPS_CMPS_SCAS(size, CNT_REG, SRC_REG, DEST_REG, FV) \ - static int opREP_CMPSB_##size(uint32_t fetchdat) \ + static int opREP_CMPSB_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ \ @@ -545,7 +545,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSW_##size(uint32_t fetchdat) \ + static int opREP_CMPSW_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ \ @@ -596,7 +596,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_CMPSL_##size(uint32_t fetchdat) \ + static int opREP_CMPSL_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ \ @@ -648,7 +648,7 @@ return cpu_state.abrt; \ } \ \ - static int opREP_SCASB_##size(uint32_t fetchdat) \ + static int opREP_SCASB_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ int cycles_end = cycles - 1000; \ @@ -680,7 +680,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASW_##size(uint32_t fetchdat) \ + static int opREP_SCASW_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ int cycles_end = cycles - 1000; \ @@ -712,7 +712,7 @@ } \ return cpu_state.abrt; \ } \ - static int opREP_SCASL_##size(uint32_t fetchdat) \ + static int opREP_SCASL_##size(UNUSED(uint32_t fetchdat)) \ { \ int tempz; \ int cycles_end = cycles - 1000; \ diff --git a/src/cpu/x86_ops_ret.h b/src/cpu/x86_ops_ret.h index d30d4eb8f..935fb5aa0 100644 --- a/src/cpu/x86_ops_ret.h +++ b/src/cpu/x86_ops_ret.h @@ -47,7 +47,7 @@ cycles -= timing_retf_rm; static int -opRETF_a16(uint32_t fetchdat) +opRETF_a16(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -60,7 +60,7 @@ opRETF_a16(uint32_t fetchdat) return 0; } static int -opRETF_a32(uint32_t fetchdat) +opRETF_a32(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -103,7 +103,7 @@ opRETF_a32_imm(uint32_t fetchdat) } static int -opIRET_186(uint32_t fetchdat) +opIRET_186(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -146,7 +146,7 @@ opIRET_186(uint32_t fetchdat) } static int -opIRET_286(uint32_t fetchdat) +opIRET_286(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -189,7 +189,7 @@ opIRET_286(uint32_t fetchdat) } static int -opIRET(uint32_t fetchdat) +opIRET(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -260,7 +260,7 @@ opIRET(uint32_t fetchdat) } static int -opIRETD(uint32_t fetchdat) +opIRETD(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); diff --git a/src/cpu/x86_ops_ret_2386.h b/src/cpu/x86_ops_ret_2386.h index ca85bf2b0..155925dfe 100644 --- a/src/cpu/x86_ops_ret_2386.h +++ b/src/cpu/x86_ops_ret_2386.h @@ -47,7 +47,7 @@ cycles -= timing_retf_rm; static int -opRETF_a16(uint32_t fetchdat) +opRETF_a16(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -60,7 +60,7 @@ opRETF_a16(uint32_t fetchdat) return 0; } static int -opRETF_a32(uint32_t fetchdat) +opRETF_a32(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -103,7 +103,7 @@ opRETF_a32_imm(uint32_t fetchdat) } static int -opIRET_186(uint32_t fetchdat) +opIRET_186(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -144,7 +144,7 @@ opIRET_186(uint32_t fetchdat) } static int -opIRET_286(uint32_t fetchdat) +opIRET_286(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -185,7 +185,7 @@ opIRET_286(uint32_t fetchdat) } static int -opIRET(uint32_t fetchdat) +opIRET(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); @@ -254,7 +254,7 @@ opIRET(uint32_t fetchdat) } static int -opIRETD(uint32_t fetchdat) +opIRETD(UNUSED(uint32_t fetchdat)) { int cycles_old = cycles; UN_USED(cycles_old); diff --git a/src/cpu/x86_ops_stack.h b/src/cpu/x86_ops_stack.h index fbf603ddb..f5d608fbb 100644 --- a/src/cpu/x86_ops_stack.h +++ b/src/cpu/x86_ops_stack.h @@ -1,5 +1,5 @@ #define PUSH_W_OP(reg) \ - static int opPUSH_##reg(uint32_t fetchdat) \ + static int opPUSH_##reg(UNUSED(uint32_t fetchdat)) \ { \ PUSH_W(reg); \ CLOCK_CYCLES((is486) ? 1 : 2); \ @@ -8,7 +8,7 @@ } #define PUSH_L_OP(reg) \ - static int opPUSH_##reg(uint32_t fetchdat) \ + static int opPUSH_##reg(UNUSED(uint32_t fetchdat)) \ { \ PUSH_L(reg); \ CLOCK_CYCLES((is486) ? 1 : 2); \ @@ -17,7 +17,7 @@ } #define POP_W_OP(reg) \ - static int opPOP_##reg(uint32_t fetchdat) \ + static int opPOP_##reg(UNUSED(uint32_t fetchdat)) \ { \ reg = POP_W(); \ CLOCK_CYCLES((is486) ? 1 : 4); \ @@ -26,7 +26,7 @@ } #define POP_L_OP(reg) \ - static int opPOP_##reg(uint32_t fetchdat) \ + static int opPOP_##reg(UNUSED(uint32_t fetchdat)) \ { \ reg = POP_L(); \ CLOCK_CYCLES((is486) ? 1 : 4); \ @@ -71,7 +71,7 @@ POP_L_OP(EBP) POP_L_OP(ESP) static int -opPUSHA_w(uint32_t fetchdat) +opPUSHA_w(UNUSED(uint32_t fetchdat)) { if (stack32) { writememw(ss, ESP - 2, AX); @@ -101,7 +101,7 @@ opPUSHA_w(uint32_t fetchdat) return cpu_state.abrt; } static int -opPUSHA_l(uint32_t fetchdat) +opPUSHA_l(UNUSED(uint32_t fetchdat)) { if (stack32) { writememl(ss, ESP - 4, EAX); @@ -132,7 +132,7 @@ opPUSHA_l(uint32_t fetchdat) } static int -opPOPA_w(uint32_t fetchdat) +opPOPA_w(UNUSED(uint32_t fetchdat)) { if (stack32) { DI = readmemw(ss, ESP); @@ -186,7 +186,7 @@ opPOPA_w(uint32_t fetchdat) return 0; } static int -opPOPA_l(uint32_t fetchdat) +opPOPA_l(UNUSED(uint32_t fetchdat)) { if (stack32) { EDI = readmeml(ss, ESP); @@ -250,7 +250,7 @@ opPUSH_imm_w(uint32_t fetchdat) return cpu_state.abrt; } static int -opPUSH_imm_l(uint32_t fetchdat) +opPUSH_imm_l(UNUSED(uint32_t fetchdat)) { uint32_t val = getlong(); if (cpu_state.abrt) @@ -550,7 +550,7 @@ opENTER_l(uint32_t fetchdat) } static int -opLEAVE_w(uint32_t fetchdat) +opLEAVE_w(UNUSED(uint32_t fetchdat)) { uint32_t tempESP = ESP; uint16_t temp; @@ -568,7 +568,7 @@ opLEAVE_w(uint32_t fetchdat) return 0; } static int -opLEAVE_l(uint32_t fetchdat) +opLEAVE_l(UNUSED(uint32_t fetchdat)) { uint32_t tempESP = ESP; uint32_t temp; @@ -587,14 +587,14 @@ opLEAVE_l(uint32_t fetchdat) } #define PUSH_SEG_OPS(seg) \ - static int opPUSH_##seg##_w(uint32_t fetchdat) \ + static int opPUSH_##seg##_w(UNUSED(uint32_t fetchdat)) \ { \ PUSH_W(seg); \ CLOCK_CYCLES(2); \ PREFETCH_RUN(2, 1, -1, 0, 0, 1, 0, 0); \ return cpu_state.abrt; \ } \ - static int opPUSH_##seg##_l(uint32_t fetchdat) \ + static int opPUSH_##seg##_l(UNUSED(uint32_t fetchdat)) \ { \ PUSH_L(seg); \ CLOCK_CYCLES(2); \ @@ -603,7 +603,7 @@ opLEAVE_l(uint32_t fetchdat) } #define POP_SEG_OPS(seg, realseg) \ - static int opPOP_##seg##_w(uint32_t fetchdat) \ + static int opPOP_##seg##_w(UNUSED(uint32_t fetchdat)) \ { \ uint16_t temp_seg; \ uint32_t temp_esp = ESP; \ @@ -617,7 +617,7 @@ opLEAVE_l(uint32_t fetchdat) PREFETCH_RUN(is486 ? 3 : 7, 1, -1, 0, 0, 1, 0, 0); \ return cpu_state.abrt; \ } \ - static int opPOP_##seg##_l(uint32_t fetchdat) \ + static int opPOP_##seg##_l(UNUSED(uint32_t fetchdat)) \ { \ uint32_t temp_seg; \ uint32_t temp_esp = ESP; \ diff --git a/src/cpu/x86_ops_string.h b/src/cpu/x86_ops_string.h index 619386fcb..d3a7d89a9 100644 --- a/src/cpu/x86_ops_string.h +++ b/src/cpu/x86_ops_string.h @@ -1,5 +1,5 @@ static int -opMOVSB_a16(uint32_t fetchdat) +opMOVSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -35,7 +35,7 @@ opMOVSB_a16(uint32_t fetchdat) return 0; } static int -opMOVSB_a32(uint32_t fetchdat) +opMOVSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -71,7 +71,7 @@ opMOVSB_a32(uint32_t fetchdat) } static int -opMOVSW_a16(uint32_t fetchdat) +opMOVSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -107,7 +107,7 @@ opMOVSW_a16(uint32_t fetchdat) return 0; } static int -opMOVSW_a32(uint32_t fetchdat) +opMOVSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -144,7 +144,7 @@ opMOVSW_a32(uint32_t fetchdat) } static int -opMOVSL_a16(uint32_t fetchdat) +opMOVSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -180,7 +180,7 @@ opMOVSL_a16(uint32_t fetchdat) return 0; } static int -opMOVSL_a32(uint32_t fetchdat) +opMOVSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -217,7 +217,7 @@ opMOVSL_a32(uint32_t fetchdat) } static int -opCMPSB_a16(uint32_t fetchdat) +opCMPSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t src; uint8_t dst; @@ -258,7 +258,7 @@ opCMPSB_a16(uint32_t fetchdat) return 0; } static int -opCMPSB_a32(uint32_t fetchdat) +opCMPSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t src; uint8_t dst; @@ -300,7 +300,7 @@ opCMPSB_a32(uint32_t fetchdat) } static int -opCMPSW_a16(uint32_t fetchdat) +opCMPSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t src; uint16_t dst; @@ -342,7 +342,7 @@ opCMPSW_a16(uint32_t fetchdat) return 0; } static int -opCMPSW_a32(uint32_t fetchdat) +opCMPSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t src; uint16_t dst; @@ -385,7 +385,7 @@ opCMPSW_a32(uint32_t fetchdat) } static int -opCMPSL_a16(uint32_t fetchdat) +opCMPSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t src; uint32_t dst; @@ -427,7 +427,7 @@ opCMPSL_a16(uint32_t fetchdat) return 0; } static int -opCMPSL_a32(uint32_t fetchdat) +opCMPSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t src; uint32_t dst; @@ -470,7 +470,7 @@ opCMPSL_a32(uint32_t fetchdat) } static int -opSTOSB_a16(uint32_t fetchdat) +opSTOSB_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI); @@ -486,7 +486,7 @@ opSTOSB_a16(uint32_t fetchdat) return 0; } static int -opSTOSB_a32(uint32_t fetchdat) +opSTOSB_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI); @@ -503,7 +503,7 @@ opSTOSB_a32(uint32_t fetchdat) } static int -opSTOSW_a16(uint32_t fetchdat) +opSTOSW_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI + 1UL); @@ -519,7 +519,7 @@ opSTOSW_a16(uint32_t fetchdat) return 0; } static int -opSTOSW_a32(uint32_t fetchdat) +opSTOSW_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 1UL); @@ -536,7 +536,7 @@ opSTOSW_a32(uint32_t fetchdat) } static int -opSTOSL_a16(uint32_t fetchdat) +opSTOSL_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI + 3UL); @@ -552,7 +552,7 @@ opSTOSL_a16(uint32_t fetchdat) return 0; } static int -opSTOSL_a32(uint32_t fetchdat) +opSTOSL_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 3UL); @@ -569,7 +569,7 @@ opSTOSL_a32(uint32_t fetchdat) } static int -opLODSB_a16(uint32_t fetchdat) +opLODSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -588,7 +588,7 @@ opLODSB_a16(uint32_t fetchdat) return 0; } static int -opLODSB_a32(uint32_t fetchdat) +opLODSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -608,7 +608,7 @@ opLODSB_a32(uint32_t fetchdat) } static int -opLODSW_a16(uint32_t fetchdat) +opLODSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -627,7 +627,7 @@ opLODSW_a16(uint32_t fetchdat) return 0; } static int -opLODSW_a32(uint32_t fetchdat) +opLODSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -647,7 +647,7 @@ opLODSW_a32(uint32_t fetchdat) } static int -opLODSL_a16(uint32_t fetchdat) +opLODSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -666,7 +666,7 @@ opLODSL_a16(uint32_t fetchdat) return 0; } static int -opLODSL_a32(uint32_t fetchdat) +opLODSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -686,7 +686,7 @@ opLODSL_a32(uint32_t fetchdat) } static int -opSCASB_a16(uint32_t fetchdat) +opSCASB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -705,7 +705,7 @@ opSCASB_a16(uint32_t fetchdat) return 0; } static int -opSCASB_a32(uint32_t fetchdat) +opSCASB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -725,7 +725,7 @@ opSCASB_a32(uint32_t fetchdat) } static int -opSCASW_a16(uint32_t fetchdat) +opSCASW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -744,7 +744,7 @@ opSCASW_a16(uint32_t fetchdat) return 0; } static int -opSCASW_a32(uint32_t fetchdat) +opSCASW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -764,7 +764,7 @@ opSCASW_a32(uint32_t fetchdat) } static int -opSCASL_a16(uint32_t fetchdat) +opSCASL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -783,7 +783,7 @@ opSCASL_a16(uint32_t fetchdat) return 0; } static int -opSCASL_a32(uint32_t fetchdat) +opSCASL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -803,7 +803,7 @@ opSCASL_a32(uint32_t fetchdat) } static int -opINSB_a16(uint32_t fetchdat) +opINSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -829,7 +829,7 @@ opINSB_a16(uint32_t fetchdat) return 0; } static int -opINSB_a32(uint32_t fetchdat) +opINSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -856,7 +856,7 @@ opINSB_a32(uint32_t fetchdat) } static int -opINSW_a16(uint32_t fetchdat) +opINSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -882,7 +882,7 @@ opINSW_a16(uint32_t fetchdat) return 0; } static int -opINSW_a32(uint32_t fetchdat) +opINSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -909,7 +909,7 @@ opINSW_a32(uint32_t fetchdat) } static int -opINSL_a16(uint32_t fetchdat) +opINSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -935,7 +935,7 @@ opINSL_a16(uint32_t fetchdat) return 0; } static int -opINSL_a32(uint32_t fetchdat) +opINSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -962,7 +962,7 @@ opINSL_a32(uint32_t fetchdat) } static int -opOUTSB_a16(uint32_t fetchdat) +opOUTSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -982,7 +982,7 @@ opOUTSB_a16(uint32_t fetchdat) return 0; } static int -opOUTSB_a32(uint32_t fetchdat) +opOUTSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -1003,7 +1003,7 @@ opOUTSB_a32(uint32_t fetchdat) } static int -opOUTSW_a16(uint32_t fetchdat) +opOUTSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -1023,7 +1023,7 @@ opOUTSW_a16(uint32_t fetchdat) return 0; } static int -opOUTSW_a32(uint32_t fetchdat) +opOUTSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -1044,7 +1044,7 @@ opOUTSW_a32(uint32_t fetchdat) } static int -opOUTSL_a16(uint32_t fetchdat) +opOUTSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -1064,7 +1064,7 @@ opOUTSL_a16(uint32_t fetchdat) return 0; } static int -opOUTSL_a32(uint32_t fetchdat) +opOUTSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; diff --git a/src/cpu/x86_ops_string_2386.h b/src/cpu/x86_ops_string_2386.h index 98875e54f..32d69d4b2 100644 --- a/src/cpu/x86_ops_string_2386.h +++ b/src/cpu/x86_ops_string_2386.h @@ -1,5 +1,5 @@ static int -opMOVSB_a16(uint32_t fetchdat) +opMOVSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -35,7 +35,7 @@ opMOVSB_a16(uint32_t fetchdat) return 0; } static int -opMOVSB_a32(uint32_t fetchdat) +opMOVSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -71,7 +71,7 @@ opMOVSB_a32(uint32_t fetchdat) } static int -opMOVSW_a16(uint32_t fetchdat) +opMOVSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -107,7 +107,7 @@ opMOVSW_a16(uint32_t fetchdat) return 0; } static int -opMOVSW_a32(uint32_t fetchdat) +opMOVSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -144,7 +144,7 @@ opMOVSW_a32(uint32_t fetchdat) } static int -opMOVSL_a16(uint32_t fetchdat) +opMOVSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -180,7 +180,7 @@ opMOVSL_a16(uint32_t fetchdat) return 0; } static int -opMOVSL_a32(uint32_t fetchdat) +opMOVSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -217,7 +217,7 @@ opMOVSL_a32(uint32_t fetchdat) } static int -opCMPSB_a16(uint32_t fetchdat) +opCMPSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t src; uint8_t dst; @@ -254,7 +254,7 @@ opCMPSB_a16(uint32_t fetchdat) return 0; } static int -opCMPSB_a32(uint32_t fetchdat) +opCMPSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t src; uint8_t dst; @@ -292,7 +292,7 @@ opCMPSB_a32(uint32_t fetchdat) } static int -opCMPSW_a16(uint32_t fetchdat) +opCMPSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t src; uint16_t dst; @@ -330,7 +330,7 @@ opCMPSW_a16(uint32_t fetchdat) return 0; } static int -opCMPSW_a32(uint32_t fetchdat) +opCMPSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t src; uint16_t dst; @@ -369,7 +369,7 @@ opCMPSW_a32(uint32_t fetchdat) } static int -opCMPSL_a16(uint32_t fetchdat) +opCMPSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t src; uint32_t dst; @@ -407,7 +407,7 @@ opCMPSL_a16(uint32_t fetchdat) return 0; } static int -opCMPSL_a32(uint32_t fetchdat) +opCMPSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t src; uint32_t dst; @@ -446,7 +446,7 @@ opCMPSL_a32(uint32_t fetchdat) } static int -opSTOSB_a16(uint32_t fetchdat) +opSTOSB_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI); @@ -462,7 +462,7 @@ opSTOSB_a16(uint32_t fetchdat) return 0; } static int -opSTOSB_a32(uint32_t fetchdat) +opSTOSB_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI); @@ -479,7 +479,7 @@ opSTOSB_a32(uint32_t fetchdat) } static int -opSTOSW_a16(uint32_t fetchdat) +opSTOSW_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI + 1UL); @@ -495,7 +495,7 @@ opSTOSW_a16(uint32_t fetchdat) return 0; } static int -opSTOSW_a32(uint32_t fetchdat) +opSTOSW_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 1UL); @@ -512,7 +512,7 @@ opSTOSW_a32(uint32_t fetchdat) } static int -opSTOSL_a16(uint32_t fetchdat) +opSTOSL_a16(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, DI, DI + 3UL); @@ -528,7 +528,7 @@ opSTOSL_a16(uint32_t fetchdat) return 0; } static int -opSTOSL_a32(uint32_t fetchdat) +opSTOSL_a32(UNUSED(uint32_t fetchdat)) { SEG_CHECK_WRITE(&cpu_state.seg_es); CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 3UL); @@ -545,7 +545,7 @@ opSTOSL_a32(uint32_t fetchdat) } static int -opLODSB_a16(uint32_t fetchdat) +opLODSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -564,7 +564,7 @@ opLODSB_a16(uint32_t fetchdat) return 0; } static int -opLODSB_a32(uint32_t fetchdat) +opLODSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -584,7 +584,7 @@ opLODSB_a32(uint32_t fetchdat) } static int -opLODSW_a16(uint32_t fetchdat) +opLODSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -603,7 +603,7 @@ opLODSW_a16(uint32_t fetchdat) return 0; } static int -opLODSW_a32(uint32_t fetchdat) +opLODSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -623,7 +623,7 @@ opLODSW_a32(uint32_t fetchdat) } static int -opLODSL_a16(uint32_t fetchdat) +opLODSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -642,7 +642,7 @@ opLODSL_a16(uint32_t fetchdat) return 0; } static int -opLODSL_a32(uint32_t fetchdat) +opLODSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -662,7 +662,7 @@ opLODSL_a32(uint32_t fetchdat) } static int -opSCASB_a16(uint32_t fetchdat) +opSCASB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -681,7 +681,7 @@ opSCASB_a16(uint32_t fetchdat) return 0; } static int -opSCASB_a32(uint32_t fetchdat) +opSCASB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -701,7 +701,7 @@ opSCASB_a32(uint32_t fetchdat) } static int -opSCASW_a16(uint32_t fetchdat) +opSCASW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -720,7 +720,7 @@ opSCASW_a16(uint32_t fetchdat) return 0; } static int -opSCASW_a32(uint32_t fetchdat) +opSCASW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -740,7 +740,7 @@ opSCASW_a32(uint32_t fetchdat) } static int -opSCASL_a16(uint32_t fetchdat) +opSCASL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -759,7 +759,7 @@ opSCASL_a16(uint32_t fetchdat) return 0; } static int -opSCASL_a32(uint32_t fetchdat) +opSCASL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -779,7 +779,7 @@ opSCASL_a32(uint32_t fetchdat) } static int -opINSB_a16(uint32_t fetchdat) +opINSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -805,7 +805,7 @@ opINSB_a16(uint32_t fetchdat) return 0; } static int -opINSB_a32(uint32_t fetchdat) +opINSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -832,7 +832,7 @@ opINSB_a32(uint32_t fetchdat) } static int -opINSW_a16(uint32_t fetchdat) +opINSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -858,7 +858,7 @@ opINSW_a16(uint32_t fetchdat) return 0; } static int -opINSW_a32(uint32_t fetchdat) +opINSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -885,7 +885,7 @@ opINSW_a32(uint32_t fetchdat) } static int -opINSL_a16(uint32_t fetchdat) +opINSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -911,7 +911,7 @@ opINSL_a16(uint32_t fetchdat) return 0; } static int -opINSL_a32(uint32_t fetchdat) +opINSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -938,7 +938,7 @@ opINSL_a32(uint32_t fetchdat) } static int -opOUTSB_a16(uint32_t fetchdat) +opOUTSB_a16(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -958,7 +958,7 @@ opOUTSB_a16(uint32_t fetchdat) return 0; } static int -opOUTSB_a32(uint32_t fetchdat) +opOUTSB_a32(UNUSED(uint32_t fetchdat)) { uint8_t temp; @@ -979,7 +979,7 @@ opOUTSB_a32(uint32_t fetchdat) } static int -opOUTSW_a16(uint32_t fetchdat) +opOUTSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -999,7 +999,7 @@ opOUTSW_a16(uint32_t fetchdat) return 0; } static int -opOUTSW_a32(uint32_t fetchdat) +opOUTSW_a32(UNUSED(uint32_t fetchdat)) { uint16_t temp; @@ -1020,7 +1020,7 @@ opOUTSW_a32(uint32_t fetchdat) } static int -opOUTSL_a16(uint32_t fetchdat) +opOUTSL_a16(UNUSED(uint32_t fetchdat)) { uint32_t temp; @@ -1040,7 +1040,7 @@ opOUTSL_a16(uint32_t fetchdat) return 0; } static int -opOUTSL_a32(uint32_t fetchdat) +opOUTSL_a32(UNUSED(uint32_t fetchdat)) { uint32_t temp; diff --git a/src/cpu/x86_ops_xchg.h b/src/cpu/x86_ops_xchg.h index 70e7be58c..826181a8e 100644 --- a/src/cpu/x86_ops_xchg.h +++ b/src/cpu/x86_ops_xchg.h @@ -116,7 +116,7 @@ opXCHG_l_a32(uint32_t fetchdat) } static int -opXCHG_AX_BX(uint32_t fetchdat) +opXCHG_AX_BX(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = BX; @@ -126,7 +126,7 @@ opXCHG_AX_BX(uint32_t fetchdat) return 0; } static int -opXCHG_AX_CX(uint32_t fetchdat) +opXCHG_AX_CX(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = CX; @@ -136,7 +136,7 @@ opXCHG_AX_CX(uint32_t fetchdat) return 0; } static int -opXCHG_AX_DX(uint32_t fetchdat) +opXCHG_AX_DX(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = DX; @@ -146,7 +146,7 @@ opXCHG_AX_DX(uint32_t fetchdat) return 0; } static int -opXCHG_AX_SI(uint32_t fetchdat) +opXCHG_AX_SI(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = SI; @@ -156,7 +156,7 @@ opXCHG_AX_SI(uint32_t fetchdat) return 0; } static int -opXCHG_AX_DI(uint32_t fetchdat) +opXCHG_AX_DI(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = DI; @@ -166,7 +166,7 @@ opXCHG_AX_DI(uint32_t fetchdat) return 0; } static int -opXCHG_AX_BP(uint32_t fetchdat) +opXCHG_AX_BP(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = BP; @@ -176,7 +176,7 @@ opXCHG_AX_BP(uint32_t fetchdat) return 0; } static int -opXCHG_AX_SP(uint32_t fetchdat) +opXCHG_AX_SP(UNUSED(uint32_t fetchdat)) { uint16_t temp = AX; AX = SP; @@ -187,7 +187,7 @@ opXCHG_AX_SP(uint32_t fetchdat) } static int -opXCHG_EAX_EBX(uint32_t fetchdat) +opXCHG_EAX_EBX(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = EBX; @@ -197,7 +197,7 @@ opXCHG_EAX_EBX(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_ECX(uint32_t fetchdat) +opXCHG_EAX_ECX(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = ECX; @@ -207,7 +207,7 @@ opXCHG_EAX_ECX(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_EDX(uint32_t fetchdat) +opXCHG_EAX_EDX(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = EDX; @@ -217,7 +217,7 @@ opXCHG_EAX_EDX(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_ESI(uint32_t fetchdat) +opXCHG_EAX_ESI(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = ESI; @@ -227,7 +227,7 @@ opXCHG_EAX_ESI(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_EDI(uint32_t fetchdat) +opXCHG_EAX_EDI(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = EDI; @@ -237,7 +237,7 @@ opXCHG_EAX_EDI(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_EBP(uint32_t fetchdat) +opXCHG_EAX_EBP(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = EBP; @@ -247,7 +247,7 @@ opXCHG_EAX_EBP(uint32_t fetchdat) return 0; } static int -opXCHG_EAX_ESP(uint32_t fetchdat) +opXCHG_EAX_ESP(UNUSED(uint32_t fetchdat)) { uint32_t temp = EAX; EAX = ESP; @@ -258,7 +258,7 @@ opXCHG_EAX_ESP(uint32_t fetchdat) } #define opBSWAP(reg) \ - static int opBSWAP_##reg(uint32_t fetchdat) \ + static int opBSWAP_##reg(UNUSED(uint32_t fetchdat)) \ { \ reg = (reg >> 24) | ((reg >> 8) & 0xff00) | ((reg << 8) & 0xff0000) | ((reg << 24) & 0xff000000); \ CLOCK_CYCLES(1); \ @@ -275,4 +275,4 @@ opBSWAP(ESI) opBSWAP(EDI) opBSWAP(EBP) opBSWAP(ESP) - // clang-format on +// clang-format on diff --git a/src/cpu/x87.c b/src/cpu/x87.c index 3b06cab3c..fecca0772 100644 --- a/src/cpu/x87.c +++ b/src/cpu/x87.c @@ -20,6 +20,7 @@ #include "softfloat3e/config.h" #include "softfloat3e/fpu_trans.h" #include "softfloat3e/specialize.h" +#include <86box/plat_unused.h> uint32_t x87_pc_off; uint32_t x87_op_off; @@ -312,7 +313,7 @@ FPU_write_eflags_fpu_compare(int float_relation) } uint16_t -FPU_exception(uint32_t fetchdat, uint16_t exceptions, int store) +FPU_exception(UNUSED(uint32_t fetchdat), uint16_t exceptions, int store) { uint16_t status; uint16_t unmasked; diff --git a/src/cpu/x87_ops.h b/src/cpu/x87_ops.h index d33122b5c..f1362bf76 100644 --- a/src/cpu/x87_ops.h +++ b/src/cpu/x87_ops.h @@ -542,7 +542,7 @@ op_nofpu_a32(uint32_t fetchdat) #ifdef FPU_8087 static int -FPU_ILLEGAL_a16(uint32_t fetchdat) +FPU_ILLEGAL_a16(UNUSED(uint32_t fetchdat)) { geteaw(); wait(timing_rr, 0); diff --git a/src/cpu/x87_ops_arith.h b/src/cpu/x87_ops_arith.h index 31c26231b..8d0c02167 100644 --- a/src/cpu/x87_ops_arith.h +++ b/src/cpu/x87_ops_arith.h @@ -1,5 +1,5 @@ #define opFPU(name, optype, a_size, load_var, get, use_var, cycle_postfix) \ - static int opFADD##name##_a##a_size(uint32_t fetchdat) \ + static int opFADD##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -18,7 +18,7 @@ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fadd##cycle_postfix) : ((x87_concurrency.fadd##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFCOM##name##_a##a_size(uint32_t fetchdat) \ + static int opFCOM##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -27,13 +27,13 @@ load_var = get(); \ if (cpu_state.abrt) \ return 1; \ - cpu_state.npxs &= ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3); \ + cpu_state.npxs &= ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3); \ cpu_state.npxs |= x87_compare(ST(0), (double) use_var); \ CLOCK_CYCLES_FPU((fpu_type >= FPU_487SX) ? (x87_timings.fcom##cycle_postfix) : ((x87_timings.fcom##cycle_postfix) * cpu_multi)); \ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fcom##cycle_postfix) : ((x87_concurrency.fcom##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFCOMP##name##_a##a_size(uint32_t fetchdat) \ + static int opFCOMP##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -42,14 +42,14 @@ load_var = get(); \ if (cpu_state.abrt) \ return 1; \ - cpu_state.npxs &= ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3); \ + cpu_state.npxs &= ~(FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3); \ cpu_state.npxs |= x87_compare(ST(0), (double) use_var); \ x87_pop(); \ CLOCK_CYCLES_FPU((fpu_type >= FPU_487SX) ? (x87_timings.fcom##cycle_postfix) : ((x87_timings.fcom##cycle_postfix) * cpu_multi)); \ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fcom##cycle_postfix) : ((x87_concurrency.fcom##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFDIV##name##_a##a_size(uint32_t fetchdat) \ + static int opFDIV##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -64,7 +64,7 @@ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fadd##cycle_postfix) : ((x87_concurrency.fadd##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFDIVR##name##_a##a_size(uint32_t fetchdat) \ + static int opFDIVR##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -79,7 +79,7 @@ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fdiv##cycle_postfix) : ((x87_concurrency.fdiv##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFMUL##name##_a##a_size(uint32_t fetchdat) \ + static int opFMUL##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -94,7 +94,7 @@ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fmul##cycle_postfix) : ((x87_concurrency.fmul##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFSUB##name##_a##a_size(uint32_t fetchdat) \ + static int opFSUB##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -109,7 +109,7 @@ CONCURRENCY_CYCLES((fpu_type >= FPU_487SX) ? (x87_concurrency.fadd##cycle_postfix) : ((x87_concurrency.fadd##cycle_postfix) * cpu_multi)); \ return 0; \ } \ - static int opFSUBR##name##_a##a_size(uint32_t fetchdat) \ + static int opFSUBR##name##_a##a_size(UNUSED(uint32_t fetchdat)) \ { \ optype t; \ FP_ENTER(); \ @@ -208,7 +208,7 @@ opFCOMP(uint32_t fetchdat) } static int -opFCOMPP(uint32_t fetchdat) +opFCOMPP(UNUSED(uint32_t fetchdat)) { uint64_t *p, *q; FP_ENTER(); @@ -229,7 +229,7 @@ opFCOMPP(uint32_t fetchdat) } #ifndef FPU_8087 static int -opFUCOMPP(uint32_t fetchdat) +opFUCOMPP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; diff --git a/src/cpu/x87_ops_loadstore.h b/src/cpu/x87_ops_loadstore.h index 0936f325b..d0b31ac85 100644 --- a/src/cpu/x87_ops_loadstore.h +++ b/src/cpu/x87_ops_loadstore.h @@ -17,7 +17,7 @@ * Copyright 2016-2019 Miran Grca. */ static int -opFILDiw_a16(uint32_t fetchdat) +opFILDiw_a16(UNUSED(uint32_t fetchdat)) { int16_t temp; FP_ENTER(); @@ -50,7 +50,7 @@ opFILDiw_a32(uint32_t fetchdat) #endif static int -opFISTiw_a16(uint32_t fetchdat) +opFISTiw_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -75,7 +75,7 @@ opFISTiw_a32(uint32_t fetchdat) #endif static int -opFISTPiw_a16(uint32_t fetchdat) +opFISTPiw_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -106,7 +106,7 @@ opFISTPiw_a32(uint32_t fetchdat) #endif static int -opFILDiq_a16(uint32_t fetchdat) +opFILDiq_a16(UNUSED(uint32_t fetchdat)) { int64_t temp64; FP_ENTER(); @@ -145,7 +145,7 @@ opFILDiq_a32(uint32_t fetchdat) #endif static int -FBLD_a16(uint32_t fetchdat) +FBLD_a16(UNUSED(uint32_t fetchdat)) { uint16_t load_reg_hi = 0xffff; uint64_t load_reg_lo = BX_CONST64(0xC000000000000000); @@ -228,7 +228,7 @@ FBLD_a32(uint32_t fetchdat) #endif static int -FBSTP_a16(uint32_t fetchdat) +FBSTP_a16(UNUSED(uint32_t fetchdat)) { double dt; double tempd; @@ -296,7 +296,7 @@ FBSTP_a32(uint32_t fetchdat) #endif static int -FISTPiq_a16(uint32_t fetchdat) +FISTPiq_a16(UNUSED(uint32_t fetchdat)) { int64_t temp64; FP_ENTER(); @@ -337,7 +337,7 @@ FISTPiq_a32(uint32_t fetchdat) #endif static int -opFILDil_a16(uint32_t fetchdat) +opFILDil_a16(UNUSED(uint32_t fetchdat)) { int32_t templ; FP_ENTER(); @@ -370,7 +370,7 @@ opFILDil_a32(uint32_t fetchdat) #endif static int -opFISTil_a16(uint32_t fetchdat) +opFISTil_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -395,7 +395,7 @@ opFISTil_a32(uint32_t fetchdat) #endif static int -opFISTPil_a16(uint32_t fetchdat) +opFISTPil_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -426,7 +426,7 @@ opFISTPil_a32(uint32_t fetchdat) #endif static int -opFLDe_a16(uint32_t fetchdat) +opFLDe_a16(UNUSED(uint32_t fetchdat)) { double t; FP_ENTER(); @@ -459,7 +459,7 @@ opFLDe_a32(uint32_t fetchdat) #endif static int -opFSTPe_a16(uint32_t fetchdat) +opFSTPe_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -490,7 +490,7 @@ opFSTPe_a32(uint32_t fetchdat) #endif static int -opFLDd_a16(uint32_t fetchdat) +opFLDd_a16(UNUSED(uint32_t fetchdat)) { x87_td t; FP_ENTER(); @@ -523,7 +523,7 @@ opFLDd_a32(uint32_t fetchdat) #endif static int -opFSTd_a16(uint32_t fetchdat) +opFSTd_a16(UNUSED(uint32_t fetchdat)) { x87_td t; FP_ENTER(); @@ -552,7 +552,7 @@ opFSTd_a32(uint32_t fetchdat) #endif static int -opFSTPd_a16(uint32_t fetchdat) +opFSTPd_a16(UNUSED(uint32_t fetchdat)) { x87_td t; FP_ENTER(); @@ -587,7 +587,7 @@ opFSTPd_a32(uint32_t fetchdat) #endif static int -opFLDs_a16(uint32_t fetchdat) +opFLDs_a16(UNUSED(uint32_t fetchdat)) { x87_ts ts; FP_ENTER(); @@ -620,7 +620,7 @@ opFLDs_a32(uint32_t fetchdat) #endif static int -opFSTs_a16(uint32_t fetchdat) +opFSTs_a16(UNUSED(uint32_t fetchdat)) { x87_ts ts; FP_ENTER(); @@ -649,7 +649,7 @@ opFSTs_a32(uint32_t fetchdat) #endif static int -opFSTPs_a16(uint32_t fetchdat) +opFSTPs_a16(UNUSED(uint32_t fetchdat)) { x87_ts ts; FP_ENTER(); diff --git a/src/cpu/x87_ops_misc.h b/src/cpu/x87_ops_misc.h index 96750468a..c1f09fda9 100644 --- a/src/cpu/x87_ops_misc.h +++ b/src/cpu/x87_ops_misc.h @@ -12,7 +12,7 @@ opFI(uint32_t fetchdat) } #else static int -opFSTSW_AX(uint32_t fetchdat) +opFSTSW_AX(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -24,7 +24,7 @@ opFSTSW_AX(uint32_t fetchdat) #endif static int -opFNOP(uint32_t fetchdat) +opFNOP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -34,7 +34,7 @@ opFNOP(uint32_t fetchdat) } static int -opFXTRACT(uint32_t fetchdat) +opFXTRACT(UNUSED(uint32_t fetchdat)) { x87_conv_t test; int64_t exp80; @@ -56,7 +56,7 @@ opFXTRACT(uint32_t fetchdat) } static int -opFCLEX(uint32_t fetchdat) +opFCLEX(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -67,7 +67,7 @@ opFCLEX(uint32_t fetchdat) } static int -opFINIT(uint32_t fetchdat) +opFINIT(UNUSED(uint32_t fetchdat)) { uint64_t *p; FP_ENTER(); @@ -208,7 +208,7 @@ FSTOR(void) return cpu_state.abrt; } static int -opFSTOR_a16(uint32_t fetchdat) +opFSTOR_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -429,7 +429,7 @@ FSAVE(void) return cpu_state.abrt; } static int -opFSAVE_a16(uint32_t fetchdat) +opFSAVE_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -450,7 +450,7 @@ opFSAVE_a32(uint32_t fetchdat) #endif static int -opFSTSW_a16(uint32_t fetchdat) +opFSTSW_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -516,7 +516,7 @@ opFXCH(uint32_t fetchdat) } static int -opFCHS(uint32_t fetchdat) +opFCHS(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -528,7 +528,7 @@ opFCHS(uint32_t fetchdat) } static int -opFABS(uint32_t fetchdat) +opFABS(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -540,7 +540,7 @@ opFABS(uint32_t fetchdat) } static int -opFTST(uint32_t fetchdat) +opFTST(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -555,7 +555,7 @@ opFTST(uint32_t fetchdat) } static int -opFXAM(uint32_t fetchdat) +opFXAM(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -579,7 +579,7 @@ opFXAM(uint32_t fetchdat) } static int -opFLD1(uint32_t fetchdat) +opFLD1(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -590,7 +590,7 @@ opFLD1(uint32_t fetchdat) } static int -opFLDL2T(uint32_t fetchdat) +opFLDL2T(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -601,7 +601,7 @@ opFLDL2T(uint32_t fetchdat) } static int -opFLDL2E(uint32_t fetchdat) +opFLDL2E(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -612,7 +612,7 @@ opFLDL2E(uint32_t fetchdat) } static int -opFLDPI(uint32_t fetchdat) +opFLDPI(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -623,7 +623,7 @@ opFLDPI(uint32_t fetchdat) } static int -opFLDEG2(uint32_t fetchdat) +opFLDEG2(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -634,7 +634,7 @@ opFLDEG2(uint32_t fetchdat) } static int -opFLDLN2(uint32_t fetchdat) +opFLDLN2(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -645,7 +645,7 @@ opFLDLN2(uint32_t fetchdat) } static int -opFLDZ(uint32_t fetchdat) +opFLDZ(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -657,7 +657,7 @@ opFLDZ(uint32_t fetchdat) } static int -opF2XM1(uint32_t fetchdat) +opF2XM1(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -669,7 +669,7 @@ opF2XM1(uint32_t fetchdat) } static int -opFYL2X(uint32_t fetchdat) +opFYL2X(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -682,7 +682,7 @@ opFYL2X(uint32_t fetchdat) } static int -opFYL2XP1(uint32_t fetchdat) +opFYL2XP1(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -695,7 +695,7 @@ opFYL2XP1(uint32_t fetchdat) } static int -opFPTAN(uint32_t fetchdat) +opFPTAN(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -709,7 +709,7 @@ opFPTAN(uint32_t fetchdat) } static int -opFPATAN(uint32_t fetchdat) +opFPATAN(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -722,7 +722,7 @@ opFPATAN(uint32_t fetchdat) } static int -opFDECSTP(uint32_t fetchdat) +opFDECSTP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -737,7 +737,7 @@ opFDECSTP(uint32_t fetchdat) } static int -opFINCSTP(uint32_t fetchdat) +opFINCSTP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -752,7 +752,7 @@ opFINCSTP(uint32_t fetchdat) } static int -opFPREM(uint32_t fetchdat) +opFPREM(UNUSED(uint32_t fetchdat)) { int64_t temp64; FP_ENTER(); @@ -773,7 +773,7 @@ opFPREM(uint32_t fetchdat) } static int -opFPREM1(uint32_t fetchdat) +opFPREM1(UNUSED(uint32_t fetchdat)) { int64_t temp64; FP_ENTER(); @@ -794,7 +794,7 @@ opFPREM1(uint32_t fetchdat) } static int -opFSQRT(uint32_t fetchdat) +opFSQRT(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -807,7 +807,7 @@ opFSQRT(uint32_t fetchdat) #ifndef FPU_8087 static int -opFSINCOS(uint32_t fetchdat) +opFSINCOS(UNUSED(uint32_t fetchdat)) { double td; FP_ENTER(); @@ -824,7 +824,7 @@ opFSINCOS(uint32_t fetchdat) #endif static int -opFRNDINT(uint32_t fetchdat) +opFRNDINT(UNUSED(uint32_t fetchdat)) { double dst0; @@ -839,7 +839,7 @@ opFRNDINT(uint32_t fetchdat) } static int -opFSCALE(uint32_t fetchdat) +opFSCALE(UNUSED(uint32_t fetchdat)) { int64_t temp64; FP_ENTER(); @@ -855,7 +855,7 @@ opFSCALE(uint32_t fetchdat) #ifndef FPU_8087 static int -opFSIN(uint32_t fetchdat) +opFSIN(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -868,7 +868,7 @@ opFSIN(uint32_t fetchdat) } static int -opFCOS(uint32_t fetchdat) +opFCOS(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -909,7 +909,7 @@ FLDENV(void) } static int -opFLDENV_a16(uint32_t fetchdat) +opFLDENV_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -930,7 +930,7 @@ opFLDENV_a32(uint32_t fetchdat) #endif static int -opFLDCW_a16(uint32_t fetchdat) +opFLDCW_a16(UNUSED(uint32_t fetchdat)) { uint16_t tempw; FP_ENTER(); @@ -1011,7 +1011,7 @@ FSTENV(void) } static int -opFSTENV_a16(uint32_t fetchdat) +opFSTENV_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -1032,7 +1032,7 @@ opFSTENV_a32(uint32_t fetchdat) #endif static int -opFSTCW_a16(uint32_t fetchdat) +opFSTCW_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); diff --git a/src/cpu/x87_ops_sf.h b/src/cpu/x87_ops_sf.h index 31416447e..0d4fee81a 100644 --- a/src/cpu/x87_ops_sf.h +++ b/src/cpu/x87_ops_sf.h @@ -235,7 +235,7 @@ fpu_load_environment(void) } static int -sf_FLDCW_a16(uint32_t fetchdat) +sf_FLDCW_a16(UNUSED(uint32_t fetchdat)) { uint16_t tempw; @@ -288,7 +288,7 @@ sf_FLDCW_a32(uint32_t fetchdat) #endif static int -sf_FNSTCW_a16(uint32_t fetchdat) +sf_FNSTCW_a16(UNUSED(uint32_t fetchdat)) { uint16_t cwd = i387_get_control_word(); @@ -317,7 +317,7 @@ sf_FNSTCW_a32(uint32_t fetchdat) #endif static int -sf_FNSTSW_a16(uint32_t fetchdat) +sf_FNSTSW_a16(UNUSED(uint32_t fetchdat)) { uint16_t swd = i387_get_status_word(); @@ -359,7 +359,7 @@ sf_FI(uint32_t fetchdat) } #else static int -sf_FNSTSW_AX(uint32_t fetchdat) +sf_FNSTSW_AX(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -371,7 +371,7 @@ sf_FNSTSW_AX(uint32_t fetchdat) #endif static int -sf_FRSTOR_a16(uint32_t fetchdat) +sf_FRSTOR_a16(UNUSED(uint32_t fetchdat)) { floatx80 tmp; int offset; @@ -414,7 +414,7 @@ sf_FRSTOR_a32(uint32_t fetchdat) #endif static int -sf_FNSAVE_a16(uint32_t fetchdat) +sf_FNSAVE_a16(UNUSED(uint32_t fetchdat)) { floatx80 stn; int offset; @@ -488,7 +488,7 @@ sf_FNSAVE_a32(uint32_t fetchdat) #endif static int -sf_FNCLEX(uint32_t fetchdat) +sf_FNCLEX(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -499,7 +499,7 @@ sf_FNCLEX(uint32_t fetchdat) } static int -sf_FNINIT(uint32_t fetchdat) +sf_FNINIT(UNUSED(uint32_t fetchdat)) { FP_ENTER(); cpu_state.pc++; @@ -525,7 +525,7 @@ sf_FNINIT(uint32_t fetchdat) } static int -sf_FLDENV_a16(uint32_t fetchdat) +sf_FLDENV_a16(UNUSED(uint32_t fetchdat)) { int tag; @@ -572,7 +572,7 @@ sf_FLDENV_a32(uint32_t fetchdat) #endif static int -sf_FNSTENV_a16(uint32_t fetchdat) +sf_FNSTENV_a16(UNUSED(uint32_t fetchdat)) { FP_ENTER(); fetch_ea_16(fetchdat); @@ -605,7 +605,7 @@ sf_FNSTENV_a32(uint32_t fetchdat) #endif static int -sf_FNOP(uint32_t fetchdat) +sf_FNOP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); FPU_check_pending_exceptions(); diff --git a/src/cpu/x87_ops_sf_arith.h b/src/cpu/x87_ops_sf_arith.h index edbd64dcf..c9e25e97c 100644 --- a/src/cpu/x87_ops_sf_arith.h +++ b/src/cpu/x87_ops_sf_arith.h @@ -1,7 +1,7 @@ #define sf_FPU(name, optype, a_size, load_var, rw, use_var, is_nan, cycle_postfix) \ static int sf_FADD##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ @@ -31,7 +31,7 @@ next_ins: } \ static int sf_FDIV##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ @@ -61,7 +61,7 @@ next_ins: } \ static int sf_FDIVR##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ @@ -91,7 +91,7 @@ next_ins: } \ static int sf_FMUL##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ @@ -121,7 +121,7 @@ next_ins: } \ static int sf_FSUB##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ @@ -151,7 +151,7 @@ next_ins: } \ static int sf_FSUBR##name##_a##a_size(uint32_t fetchdat) \ { \ - floatx80 a, result; \ + floatx80 a, result; \ struct softfloat_status_t status; \ optype temp; \ FP_ENTER(); \ diff --git a/src/cpu/x87_ops_sf_compare.h b/src/cpu/x87_ops_sf_compare.h index c4a38b375..945ed99d3 100644 --- a/src/cpu/x87_ops_sf_compare.h +++ b/src/cpu/x87_ops_sf_compare.h @@ -460,7 +460,7 @@ sf_FTST(uint32_t fetchdat) } static int -sf_FXAM(uint32_t fetchdat) +sf_FXAM(UNUSED(uint32_t fetchdat)) { floatx80 reg; int sign; diff --git a/src/cpu/x87_ops_sf_misc.h b/src/cpu/x87_ops_sf_misc.h index 0aab2ec08..746e85c6f 100644 --- a/src/cpu/x87_ops_sf_misc.h +++ b/src/cpu/x87_ops_sf_misc.h @@ -81,7 +81,7 @@ sf_FABS(uint32_t fetchdat) } static int -sf_FDECSTP(uint32_t fetchdat) +sf_FDECSTP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); FPU_check_pending_exceptions(); @@ -94,7 +94,7 @@ sf_FDECSTP(uint32_t fetchdat) } static int -sf_FINCSTP(uint32_t fetchdat) +sf_FINCSTP(UNUSED(uint32_t fetchdat)) { FP_ENTER(); FPU_check_pending_exceptions(); diff --git a/src/device/cartridge.c b/src/device/cartridge.c index 22b36484a..d2e91ecb3 100644 --- a/src/device/cartridge.c +++ b/src/device/cartridge.c @@ -113,8 +113,7 @@ cart_image_load(int drive, char *fn) (void) !fread(&base, 1, 2, fp); base <<= 4; fseek(fp, 0x00000200, SEEK_SET); - carts[drive].buf = (uint8_t *) malloc(size); - memset(carts[drive].buf, 0x00, size); + carts[drive].buf = (uint8_t *) calloc(1, size); (void) !fread(carts[drive].buf, 1, size, fp); fclose(fp); } else { @@ -122,8 +121,7 @@ cart_image_load(int drive, char *fn) if (size == 32768) base += 0x8000; fseek(fp, 0x00000000, SEEK_SET); - carts[drive].buf = (uint8_t *) malloc(size); - memset(carts[drive].buf, 0x00, size); + carts[drive].buf = (uint8_t *) calloc(1, size); (void) !fread(carts[drive].buf, 1, size, fp); fclose(fp); } diff --git a/src/device/cassette.c b/src/device/cassette.c index 608de7463..ac79edff2 100644 --- a/src/device/cassette.c +++ b/src/device/cassette.c @@ -131,9 +131,7 @@ pc_cas_free(pc_cassette_t *cas) pc_cassette_t * pc_cas_new(void) { - pc_cassette_t *cas; - - cas = malloc(sizeof(pc_cassette_t)); + pc_cassette_t *cas = calloc(1, sizeof( pc_cassette_t)); if (cas == NULL) { return (NULL); diff --git a/src/device/clock_ics9xxx.c b/src/device/clock_ics9xxx.c index 263170741..02f033e9b 100644 --- a/src/device/clock_ics9xxx.c +++ b/src/device/clock_ics9xxx.c @@ -1181,8 +1181,7 @@ ics9xxx_find_bus_match(ics9xxx_t *dev, uint32_t bus, uint8_t preset_mask, uint8_ static void * ics9xxx_init(const device_t *info) { - ics9xxx_t *dev = (ics9xxx_t *) malloc(sizeof(ics9xxx_t)); - memset(dev, 0, sizeof(ics9xxx_t)); + ics9xxx_t *dev = (ics9xxx_t *) calloc(1, sizeof(ics9xxx_t)); dev->model_idx = info->local; dev->model = (ics9xxx_model_t *) &ics9xxx_models[dev->model_idx]; @@ -1267,8 +1266,7 @@ ics9xxx_close(void *priv) device_t * ics9xxx_get(uint8_t model) { - device_t *dev = (device_t *) malloc(sizeof(device_t)); - memset(dev, 0, sizeof(device_t)); + device_t *dev = (device_t *) calloc(1, sizeof(device_t)); dev->name = "ICS9xxx-xx Clock Generator"; dev->local = model; diff --git a/src/device/hasp.c b/src/device/hasp.c index 9873c3460..3834af4cd 100644 --- a/src/device/hasp.c +++ b/src/device/hasp.c @@ -305,8 +305,7 @@ hasp_read_status(void *priv) static void * hasp_init(void *lpt, int type) { - hasp_t *dev = malloc(sizeof(hasp_t)); - memset(dev, 0, sizeof(hasp_t)); + hasp_t *dev = calloc(1, sizeof(hasp_t)); hasp_log("HASP: init(%d)\n", type); diff --git a/src/device/hwm_gl518sm.c b/src/device/hwm_gl518sm.c index 23763ebb8..cfc16664a 100644 --- a/src/device/hwm_gl518sm.c +++ b/src/device/hwm_gl518sm.c @@ -282,8 +282,7 @@ gl518sm_close(void *priv) static void * gl518sm_init(const device_t *info) { - gl518sm_t *dev = (gl518sm_t *) malloc(sizeof(gl518sm_t)); - memset(dev, 0, sizeof(gl518sm_t)); + gl518sm_t *dev = (gl518sm_t *) calloc(1, sizeof(gl518sm_t)); dev->local = info->local; diff --git a/src/device/hwm_lm75.c b/src/device/hwm_lm75.c index 831d16ded..29fe2024f 100644 --- a/src/device/hwm_lm75.c +++ b/src/device/hwm_lm75.c @@ -216,8 +216,7 @@ lm75_close(void *priv) static void * lm75_init(const device_t *info) { - lm75_t *dev = (lm75_t *) malloc(sizeof(lm75_t)); - memset(dev, 0, sizeof(lm75_t)); + lm75_t *dev = (lm75_t *) calloc(1, sizeof(lm75_t)); dev->local = info->local; diff --git a/src/device/hwm_lm78.c b/src/device/hwm_lm78.c index 3219e87e6..1e61168ac 100644 --- a/src/device/hwm_lm78.c +++ b/src/device/hwm_lm78.c @@ -771,8 +771,7 @@ lm78_close(void *priv) static void * lm78_init(const device_t *info) { - lm78_t *dev = (lm78_t *) malloc(sizeof(lm78_t)); - memset(dev, 0, sizeof(lm78_t)); + lm78_t *dev = (lm78_t *) calloc(1, sizeof(lm78_t)); dev->local = info->local; diff --git a/src/device/hwm_vt82c686.c b/src/device/hwm_vt82c686.c index 7d764bcb9..8623a9f6b 100644 --- a/src/device/hwm_vt82c686.c +++ b/src/device/hwm_vt82c686.c @@ -183,8 +183,7 @@ vt82c686_close(void *priv) static void * vt82c686_init(UNUSED(const device_t *info)) { - vt82c686_t *dev = (vt82c686_t *) malloc(sizeof(vt82c686_t)); - memset(dev, 0, sizeof(vt82c686_t)); + vt82c686_t *dev = (vt82c686_t *) calloc(1, sizeof(vt82c686_t)); /* Set default values. Since this hardware monitor has a complex voltage factor system, the values struct contains voltage values *before* applying their respective factors. */ diff --git a/src/device/i2c.c b/src/device/i2c.c index 56e6f8f4c..eb80f413b 100644 --- a/src/device/i2c.c +++ b/src/device/i2c.c @@ -67,8 +67,7 @@ i2c_log(const char *fmt, ...) void * i2c_addbus(char *name) { - i2c_bus_t *bus = (i2c_bus_t *) malloc(sizeof(i2c_bus_t)); - memset(bus, 0, sizeof(i2c_bus_t)); + i2c_bus_t *bus = (i2c_bus_t *) calloc(1, sizeof(i2c_bus_t)); bus->name = name; @@ -127,8 +126,7 @@ i2c_sethandler(void *bus_handle, uint8_t base, int size, for (int c = 0; c < size; c++) { p = bus->last[base + c]; - q = (i2c_t *) malloc(sizeof(i2c_t)); - memset(q, 0, sizeof(i2c_t)); + q = (i2c_t *) calloc(1, sizeof(i2c_t)); if (p) { p->next = q; q->prev = p; diff --git a/src/device/i2c_gpio.c b/src/device/i2c_gpio.c index 22bdaffd3..61a3dbe05 100644 --- a/src/device/i2c_gpio.c +++ b/src/device/i2c_gpio.c @@ -59,8 +59,7 @@ i2c_gpio_log(int level, const char *fmt, ...) void * i2c_gpio_init(char *bus_name) { - i2c_gpio_t *dev = (i2c_gpio_t *) malloc(sizeof(i2c_gpio_t)); - memset(dev, 0, sizeof(i2c_gpio_t)); + i2c_gpio_t *dev = (i2c_gpio_t *) calloc(1, sizeof(i2c_gpio_t)); i2c_gpio_log(1, "I2C GPIO %s: init()\n", bus_name); diff --git a/src/device/isamem.c b/src/device/isamem.c index 5d3164757..5cac31c7f 100644 --- a/src/device/isamem.c +++ b/src/device/isamem.c @@ -27,16 +27,20 @@ * modern boards even have multiple 'copies' of those registers, * which can be switched very fast, to allow for multitasking. * - * TODO: The EV159 is supposed to support 16b EMS transfers, but the + * TODO: The EV-159 is supposed to support 16b EMS transfers, but the * EMM.sys driver for it doesn't seem to want to do that.. * + * EV-125 (It supports backfill) + * https://theretroweb.com/expansioncard/documentation/50250.pdf * + * EV-158 (RAM 10000) + * http://web.archive.org/web/19961104093221/http://www.everex.com/supp/techlib/memmem.html * * Authors: Fred N. van Kempen, * Jasmine Iwanek * * Copyright 2018 Fred N. van Kempen. - * Copyright 2022-2024 Jasmine Iwanek. + * Copyright 2022-2025 Jasmine Iwanek. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the @@ -102,7 +106,7 @@ #define ISAMEM_BRXT_CARD 13 #define ISAMEM_BRAT_CARD 14 #define ISAMEM_EV165A_CARD 15 -#define ISAMEM_LOTECH_CARD 16 +#define ISAMEM_LOTECH_EMS_CARD 16 #define ISAMEM_DEBUG 0 @@ -304,16 +308,13 @@ ems_writew(uint32_t addr, uint16_t val, void *priv) static uint8_t ems_in(uint16_t port, void *priv) { - const emsreg_t *dev = (emsreg_t *) priv; - uint8_t ret = 0xff; -#ifdef ENABLE_ISAMEM_LOG - int vpage; -#endif - + const emsreg_t *dev = (emsreg_t *) priv; + uint8_t ret = 0xff; /* Get the viewport page number. */ #ifdef ENABLE_ISAMEM_LOG - vpage = (port / EMS_PGSIZE); + int vpage = (port / EMS_PGSIZE); #endif + port &= (EMS_PGSIZE - 1); switch (port & 0x0001) { @@ -339,13 +340,11 @@ ems_in(uint16_t port, void *priv) static uint8_t consecutive_ems_in(uint16_t port, void *priv) { - const memdev_t *dev = (memdev_t *) priv; - uint8_t ret = 0xff; - int vpage; - + const memdev_t *dev = (memdev_t *) priv; + uint8_t ret = 0xff; /* Get the viewport page number. */ - vpage = (port - dev->base_addr[0]); - + int vpage = (port - dev->base_addr[0]); + ret = dev->ems[vpage].page; if (dev->ems[vpage].enabled) ret |= 0x80; @@ -359,11 +358,10 @@ consecutive_ems_in(uint16_t port, void *priv) static void ems_out(uint16_t port, uint8_t val, void *priv) { - emsreg_t *dev = (emsreg_t *) priv; - int vpage; - + emsreg_t *dev = (emsreg_t *) priv; /* Get the viewport page number. */ - vpage = (port / EMS_PGSIZE); + int vpage = (port / EMS_PGSIZE); + port &= (EMS_PGSIZE - 1); switch (port & 0x0001) { @@ -433,11 +431,9 @@ ems_out(uint16_t port, uint8_t val, void *priv) static void consecutive_ems_out(uint16_t port, uint8_t val, void *priv) { - memdev_t *dev = (memdev_t *) priv; - int vpage; - + memdev_t *dev = (memdev_t *) priv; /* Get the viewport page number. */ - vpage = (port - dev->base_addr[0]); + int vpage = (port - dev->base_addr[0]); isamem_log("ISAMEM: write(%04x, %02x) to page mapping registers! (page=%d)\n", port, val, vpage); @@ -483,8 +479,7 @@ isamem_init(const device_t *info) uint8_t *ptr; /* Find our device and create an instance. */ - dev = (memdev_t *) malloc(sizeof(memdev_t)); - memset(dev, 0x00, sizeof(memdev_t)); + dev = (memdev_t *) calloc(1, sizeof(memdev_t)); dev->name = info->name; dev->board = info->local; @@ -579,7 +574,7 @@ isamem_init(const device_t *info) dev->flags |= FLAG_FAST; break; - case ISAMEM_LOTECH_CARD: /* Lotech EMS */ + case ISAMEM_LOTECH_EMS_CARD: /* Lotech EMS */ /* The Lotech EMS cannot have more than 4096KB per board. */ ems_max = EMS_LOTECH_MAXSIZE; fallthrough; @@ -801,7 +796,7 @@ isamem_init(const device_t *info) mem_mapping_disable(&dev->ems[i].mapping); /* Set up an I/O port handler. */ - if (dev->board != ISAMEM_LOTECH_CARD) + if (dev->board != ISAMEM_LOTECH_EMS_CARD) io_sethandler(dev->base_addr[0] + (EMS_PGSIZE * i), 2, ems_in, NULL, NULL, ems_out, NULL, NULL, &(dev->ems[i])); @@ -832,7 +827,7 @@ isamem_init(const device_t *info) } } - if (dev->board == ISAMEM_LOTECH_CARD) + if (dev->board == ISAMEM_LOTECH_EMS_CARD) io_sethandler(dev->base_addr[0], 4, consecutive_ems_in, NULL, NULL, consecutive_ems_out, NULL, NULL, dev); } @@ -1031,6 +1026,7 @@ static const device_config_t genericxt_config[] = { // clang-format on }; +// This also nicely accounts for the Everex EV-138 static const device_t genericxt_device = { .name = "Generic PC/XT Memory Expansion", .internal_name = "genericxt", @@ -1237,6 +1233,7 @@ static const device_config_t genericat_config[] = { // clang-format on }; +// This also nicely accounts for the Everex EV-135 static const device_t genericat_device = { .name = "Generic PC/AT Memory Expansion", .internal_name = "genericat", @@ -1857,11 +1854,11 @@ static const device_config_t lotech_config[] = { // clang-format on }; -static const device_t lotech_device = { +static const device_t lotech_ems_device = { .name = "Lo-tech EMS Board", .internal_name = "lotechems", .flags = DEVICE_ISA, - .local = ISAMEM_LOTECH_CARD, + .local = ISAMEM_LOTECH_EMS_CARD, .init = isamem_init, .close = isamem_close, .reset = NULL, @@ -2072,7 +2069,7 @@ static const struct { #ifdef USE_ISAMEM_IAB { &iab_device }, #endif /* USE_ISAMEM_IAB */ - { &lotech_device }, + { &lotech_ems_device }, { NULL } // clang-format on }; diff --git a/src/device/isapnp.c b/src/device/isapnp.c index 479b6b9b2..1ee8be040 100644 --- a/src/device/isapnp.c +++ b/src/device/isapnp.c @@ -679,7 +679,7 @@ isapnp_write_data(UNUSED(uint16_t addr), uint8_t val, void *priv) static void * isapnp_init(UNUSED(const device_t *info)) { - isapnp_t *dev = (isapnp_t *) malloc(sizeof(isapnp_t)); + isapnp_t *dev = (isapnp_t *) calloc(1, sizeof(isapnp_t)); memset(dev, 0, sizeof(isapnp_t)); io_sethandler(0x279, 1, NULL, NULL, NULL, isapnp_write_addr, NULL, NULL, dev); @@ -728,8 +728,7 @@ isapnp_add_card(uint8_t *rom, uint16_t rom_size, if (!dev) dev = (isapnp_t *) device_add(&isapnp_device); - isapnp_card_t *card = (isapnp_card_t *) malloc(sizeof(isapnp_card_t)); - memset(card, 0, sizeof(isapnp_card_t)); + isapnp_card_t *card = (isapnp_card_t *) calloc(1, sizeof(isapnp_card_t)); card->enable = 1; card->priv = priv; diff --git a/src/device/isartc.c b/src/device/isartc.c index 77f35ffc7..f24ffb72b 100644 --- a/src/device/isartc.c +++ b/src/device/isartc.c @@ -520,8 +520,7 @@ isartc_init(const device_t *info) is_at = is_at || !strcmp(machine_get_internal_name(), "xi8088"); /* Create a device instance. */ - dev = (rtcdev_t *) malloc(sizeof(rtcdev_t)); - memset(dev, 0x00, sizeof(rtcdev_t)); + dev = (rtcdev_t *) calloc(1, sizeof(rtcdev_t)); dev->name = info->name; dev->board = info->local; dev->irq = -1; diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index aef3b2cc6..ad1625873 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -2282,8 +2282,7 @@ kbc_at_init(const device_t *info) atkbc_t *dev; int max_ports; - dev = (atkbc_t *) malloc(sizeof(atkbc_t)); - memset(dev, 0x00, sizeof(atkbc_t)); + dev = (atkbc_t *) calloc(1, sizeof(atkbc_t)); dev->flags = info->local; @@ -2393,8 +2392,7 @@ kbc_at_init(const device_t *info) #endif for (int i = 0; i < max_ports; i++) { - kbc_at_ports[i] = (kbc_at_port_t *) malloc(sizeof(kbc_at_port_t)); - memset(kbc_at_ports[i], 0x00, sizeof(kbc_at_port_t)); + kbc_at_ports[i] = (kbc_at_port_t *) calloc(1, sizeof(kbc_at_port_t)); kbc_at_ports[i]->out_new = -1; } diff --git a/src/device/keyboard_xt.c b/src/device/keyboard_xt.c index c614bad8c..644168004 100644 --- a/src/device/keyboard_xt.c +++ b/src/device/keyboard_xt.c @@ -1000,8 +1000,7 @@ kbd_init(const device_t *info) { xtkbd_t *kbd; - kbd = (xtkbd_t *) malloc(sizeof(xtkbd_t)); - memset(kbd, 0x00, sizeof(xtkbd_t)); + kbd = (xtkbd_t *) calloc(1, sizeof(xtkbd_t)); io_sethandler(0x0060, 4, kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd); diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index 9c0d8b02e..b56a3cc18 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -614,8 +614,7 @@ bm_init(const device_t *info) mouse_t *dev; int hz; - dev = (mouse_t *) malloc(sizeof(mouse_t)); - memset(dev, 0x00, sizeof(mouse_t)); + dev = (mouse_t *) calloc(1, sizeof(mouse_t)); if ((info->local & ~MOUSE_TYPE_ONBOARD) == MOUSE_TYPE_INPORT) dev->flags = FLAG_INPORT; diff --git a/src/device/mouse_microtouch_touchscreen.c b/src/device/mouse_microtouch_touchscreen.c index c6bef89dc..24d5de1fb 100644 --- a/src/device/mouse_microtouch_touchscreen.c +++ b/src/device/mouse_microtouch_touchscreen.c @@ -128,8 +128,7 @@ mtouch_initnvr(void *priv) FILE *fp; /* Allocate and initialize the EEPROM. */ - dev->nvr = (uint8_t *) malloc(NVR_SIZE); - memset(dev->nvr, 0x00, NVR_SIZE); + dev->nvr = (uint8_t *) calloc(1, NVR_SIZE); fp = nvr_fopen(dev->nvr_path, "rb"); if (fp) { @@ -314,7 +313,7 @@ mtouch_process_commands(mouse_microtouch_t *dev) } static void -mtouch_write(serial_t *serial, void *priv, uint8_t data) +mtouch_write(UNUSED(serial_t *serial), void *priv, uint8_t data) { mouse_microtouch_t *dev = (mouse_microtouch_t *) priv; @@ -496,7 +495,7 @@ mtouch_poll_global(void) } void * -mtouch_init(const device_t *info) +mtouch_init(UNUSED(const device_t *info)) { mouse_microtouch_t *dev = calloc(1, sizeof(mouse_microtouch_t)); diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 99d08cd37..c64be5a6d 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -845,8 +845,7 @@ sermouse_init(const device_t *info) void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data); void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period); - dev = (mouse_t *) malloc(sizeof(mouse_t)); - memset(dev, 0x00, sizeof(mouse_t)); + dev = (mouse_t *) calloc(1, sizeof(mouse_t)); dev->name = info->name; dev->but = device_get_config_int("buttons"); dev->rev = device_get_config_int("revision"); diff --git a/src/device/nec_mate_unk.c b/src/device/nec_mate_unk.c index 3244733c9..c0393eaa2 100644 --- a/src/device/nec_mate_unk.c +++ b/src/device/nec_mate_unk.c @@ -30,7 +30,7 @@ #include <86box/plat_unused.h> static uint8_t -nec_mate_unk_read(UNUSED(uint16_t addr), void *priv) +nec_mate_unk_read(UNUSED(uint16_t addr), UNUSED(void *priv)) { /* Expected by this NEC machine. @@ -49,7 +49,7 @@ nec_mate_unk_close(void *priv) } static void * -nec_mate_unk_init(const device_t *info) +nec_mate_unk_init(UNUSED(const device_t *info)) { /* We have to return something non-NULL. */ uint8_t *dev = (uint8_t *) calloc(1, sizeof(uint8_t)); diff --git a/src/device/novell_cardkey.c b/src/device/novell_cardkey.c index 737b4104d..34b6390d1 100644 --- a/src/device/novell_cardkey.c +++ b/src/device/novell_cardkey.c @@ -61,7 +61,7 @@ novell_cardkey_read(uint16_t port, void *priv) return val ^ 0xFF; } -void* novell_cardkey_init(const device_t* info) +void* novell_cardkey_init(UNUSED(const device_t* info)) { char sernumstr[13] = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 0 }; int i = 0; diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index 4321bf433..7dda00aee 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -491,8 +491,7 @@ pci_bridge_init(const device_t *info) uint8_t interrupt_mask; uint8_t slot_count; - pci_bridge_t *dev = (pci_bridge_t *) malloc(sizeof(pci_bridge_t)); - memset(dev, 0, sizeof(pci_bridge_t)); + pci_bridge_t *dev = (pci_bridge_t *) calloc(1, sizeof(pci_bridge_t)); dev->local = info->local; dev->bus_index = pci_register_bus(); diff --git a/src/device/phoenix_486_jumper.c b/src/device/phoenix_486_jumper.c index 6032a59dc..a3e2f0e7e 100644 --- a/src/device/phoenix_486_jumper.c +++ b/src/device/phoenix_486_jumper.c @@ -110,8 +110,7 @@ phoenix_486_jumper_close(void *priv) static void * phoenix_486_jumper_init(const device_t *info) { - phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) malloc(sizeof(phoenix_486_jumper_t)); - memset(dev, 0, sizeof(phoenix_486_jumper_t)); + phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) calloc(1, sizeof(phoenix_486_jumper_t)); dev->type = info->local; diff --git a/src/device/serial.c b/src/device/serial.c index 1e2618449..0ba60551c 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -914,8 +914,7 @@ serial_reset(void *priv) static void * serial_init(const device_t *info) { - serial_t *dev = (serial_t *) malloc(sizeof(serial_t)); - memset(dev, 0, sizeof(serial_t)); + serial_t *dev = (serial_t *) calloc(1, sizeof(serial_t)); dev->inst = next_inst; diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index 445b67d04..bb2378a22 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -178,8 +178,7 @@ serial_passthrough_dev_init(const device_t *info) { serial_passthrough_t *dev; - dev = (serial_passthrough_t *) malloc(sizeof(serial_passthrough_t)); - memset(dev, 0, sizeof(serial_passthrough_t)); + dev = (serial_passthrough_t *) calloc(1, sizeof(serial_passthrough_t)); dev->mode = device_get_config_int("mode"); dev->port = device_get_instance() - 1; diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index de487ef73..3907a065e 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -273,7 +273,7 @@ smbus_ali7101_reset(void *priv) static void * smbus_ali7101_init(const device_t *info) { - smbus_ali7101_t *dev = (smbus_ali7101_t *) malloc(sizeof(smbus_ali7101_t)); + smbus_ali7101_t *dev = (smbus_ali7101_t *) calloc(1, sizeof(smbus_ali7101_t)); memset(dev, 0, sizeof(smbus_ali7101_t)); dev->local = info->local; diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index d72712cc6..a9ffcd847 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -357,8 +357,7 @@ smbus_piix4_setclock(smbus_piix4_t *dev, int clock) static void * smbus_piix4_init(const device_t *info) { - smbus_piix4_t *dev = (smbus_piix4_t *) malloc(sizeof(smbus_piix4_t)); - memset(dev, 0, sizeof(smbus_piix4_t)); + smbus_piix4_t *dev = (smbus_piix4_t *) calloc(1, sizeof(smbus_piix4_t)); dev->local = info->local; /* We save the I2C bus handle on dev but use i2c_smbus for all operations because diff --git a/src/device/smbus_sis5595.c b/src/device/smbus_sis5595.c index e7cffc577..0a24d2355 100644 --- a/src/device/smbus_sis5595.c +++ b/src/device/smbus_sis5595.c @@ -343,8 +343,7 @@ smbus_sis5595_reset(void *priv) static void * smbus_sis5595_init(const device_t *info) { - smbus_sis5595_t *dev = (smbus_sis5595_t *) malloc(sizeof(smbus_sis5595_t)); - memset(dev, 0, sizeof(smbus_sis5595_t)); + smbus_sis5595_t *dev = (smbus_sis5595_t *) calloc(1, sizeof(smbus_sis5595_t)); dev->local = info->local; diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index d9dc02da0..adc39d509 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -920,8 +920,7 @@ wd1007vse1_init(UNUSED(const device_t *info)) { int c; - esdi_t *esdi = malloc(sizeof(esdi_t)); - memset(esdi, 0x00, sizeof(esdi_t)); + esdi_t *esdi = calloc(1, sizeof(esdi_t)); c = 0; for (uint8_t d = 0; d < HDD_NUM; d++) { diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index 83d2dc3b7..b7ab5ff9f 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -1249,10 +1249,9 @@ esdi_init(UNUSED(const device_t *info)) uint8_t c; uint8_t i; - dev = malloc(sizeof(esdi_t)); + dev = calloc(1, sizeof(esdi_t)); if (dev == NULL) return (NULL); - memset(dev, 0x00, sizeof(esdi_t)); /* Mark as unconfigured. */ dev->irq_status = 0xff; diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 49d23daee..592649c0e 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -386,7 +386,7 @@ ide_atapi_get_period(uint8_t channel) } static void -ide_irq_update(ide_board_t *dev, int log) +ide_irq_update(ide_board_t *dev, UNUSED(int log)) { ide_t *ide; uint8_t set; @@ -1894,7 +1894,7 @@ ide_read_data(ide_t *ide) } static uint8_t -ide_status(ide_t *ide, ide_t *ide_other, int ch) +ide_status(ide_t *ide, UNUSED(ide_t *ide_other), UNUSED(int ch)) { uint8_t ret; @@ -3207,7 +3207,7 @@ mcide_mca_reset(void *priv) } static void -mcide_reset(void *priv) +mcide_reset(UNUSED(void *priv)) { for (uint8_t i = 0; i < 2; i++) { if (ide_boards[i] != NULL) diff --git a/src/disk/hdc_ide_cmd640.c b/src/disk/hdc_ide_cmd640.c index 9c0178a47..84a40efa4 100644 --- a/src/disk/hdc_ide_cmd640.c +++ b/src/disk/hdc_ide_cmd640.c @@ -504,8 +504,7 @@ cmd640_close(void *priv) static void * cmd640_init(const device_t *info) { - cmd640_t *dev = (cmd640_t *) malloc(sizeof(cmd640_t)); - memset(dev, 0x00, sizeof(cmd640_t)); + cmd640_t *dev = (cmd640_t *) calloc(1, sizeof(cmd640_t)); dev->id = next_id | 0x60; diff --git a/src/disk/hdc_ide_cmd646.c b/src/disk/hdc_ide_cmd646.c index b79f84f03..b548390fd 100644 --- a/src/disk/hdc_ide_cmd646.c +++ b/src/disk/hdc_ide_cmd646.c @@ -391,8 +391,7 @@ cmd646_close(void *priv) static void * cmd646_init(const device_t *info) { - cmd646_t *dev = (cmd646_t *) malloc(sizeof(cmd646_t)); - memset(dev, 0x00, sizeof(cmd646_t)); + cmd646_t *dev = (cmd646_t *) calloc(1, sizeof(cmd646_t)); dev->local = info->local; diff --git a/src/disk/hdc_ide_opti611.c b/src/disk/hdc_ide_opti611.c index 67cdfc779..4927b5fe3 100644 --- a/src/disk/hdc_ide_opti611.c +++ b/src/disk/hdc_ide_opti611.c @@ -317,8 +317,7 @@ opti611_close(void *priv) static void * opti611_init(UNUSED(const device_t *info)) { - opti611_t *dev = (opti611_t *) malloc(sizeof(opti611_t)); - memset(dev, 0, sizeof(opti611_t)); + opti611_t *dev = (opti611_t *) calloc(1, sizeof(opti611_t)); dev->is_sec = info->local; diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index ec4c7228c..73dc5f36b 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -578,8 +578,7 @@ sff_close(void *priv) static void * sff_init(UNUSED(const device_t *info)) { - sff8038i_t *dev = (sff8038i_t *) malloc(sizeof(sff8038i_t)); - memset(dev, 0, sizeof(sff8038i_t)); + sff8038i_t *dev = (sff8038i_t *) calloc(1, sizeof(sff8038i_t)); /* Make sure to only add IDE once. */ if (next_id == 0) diff --git a/src/disk/hdc_ide_w83769f.c b/src/disk/hdc_ide_w83769f.c index 897a26593..9c0f744b2 100644 --- a/src/disk/hdc_ide_w83769f.c +++ b/src/disk/hdc_ide_w83769f.c @@ -353,8 +353,7 @@ w83769f_close(void *priv) static void * w83769f_init(const device_t *info) { - w83769f_t *dev = (w83769f_t *) malloc(sizeof(w83769f_t)); - memset(dev, 0x00, sizeof(w83769f_t)); + w83769f_t *dev = (w83769f_t *) calloc(1, sizeof(w83769f_t)); dev->id = next_id | 0x60; diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index abd379646..eeb242a94 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -744,8 +744,7 @@ mfm_init(UNUSED(const device_t *info)) int c; st506_at_log("WD1003: ISA MFM/RLL Fixed Disk Adapter initializing ...\n"); - mfm = malloc(sizeof(mfm_t)); - memset(mfm, 0x00, sizeof(mfm_t)); + mfm = calloc(1, sizeof(mfm_t)); c = 0; for (uint8_t d = 0; d < HDD_NUM; d++) { diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index d950fbe34..789e7e6c4 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -1627,8 +1627,7 @@ st506_init(const device_t *info) int i; int c; - dev = (hdc_t *) malloc(sizeof(hdc_t)); - memset(dev, 0x00, sizeof(hdc_t)); + dev = (hdc_t *) calloc(1, sizeof(hdc_t)); dev->type = info->local & 255; /* Set defaults for the controller. */ diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 1ddbd33e2..553e53b48 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -1000,8 +1000,7 @@ xta_init(const device_t *info) int max = XTA_NUM; /* Allocate and initialize device block. */ - dev = malloc(sizeof(hdc_t)); - memset(dev, 0x00, sizeof(hdc_t)); + dev = calloc(1, sizeof(hdc_t)); dev->type = info->local; /* Do per-controller-type setup. */ diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 623f68cb5..7ec7695b3 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -132,13 +132,11 @@ xtide_read(uint16_t port, void *priv) static void * xtide_init(const device_t *info) { - xtide_t *xtide = malloc(sizeof(xtide_t)); + xtide_t *xtide = calloc(1, sizeof(xtide_t)); - memset(xtide, 0x00, sizeof(xtide_t)); - - rom_init(&xtide->bios_rom, - device_get_bios_file(info, device_get_config_bios("bios"), 0), - 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); + rom_init(&xtide->bios_rom, + device_get_bios_file(info, device_get_config_bios("bios"), 0), + 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); xtide->ide_board = ide_xtide_init(); @@ -152,13 +150,11 @@ xtide_init(const device_t *info) static void * xtide_at_init(const device_t *info) { - xtide_t *xtide = malloc(sizeof(xtide_t)); + xtide_t *xtide = calloc(1, sizeof(xtide_t)); - memset(xtide, 0x00, sizeof(xtide_t)); - - rom_init(&xtide->bios_rom, - device_get_bios_file(info, device_get_config_bios("bios"), 0), - 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); + rom_init(&xtide->bios_rom, + device_get_bios_file(info, device_get_config_bios("bios"), 0), + 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); device_add(&ide_isa_2ch_device); @@ -168,9 +164,7 @@ xtide_at_init(const device_t *info) static void * xtide_acculogic_init(UNUSED(const device_t *info)) { - xtide_t *xtide = malloc(sizeof(xtide_t)); - - memset(xtide, 0x00, sizeof(xtide_t)); + xtide_t *xtide = calloc(1, sizeof(xtide_t)); rom_init(&xtide->bios_rom, ROM_PATH_PS2, 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); @@ -203,9 +197,7 @@ xtide_close(void *priv) static void * xtide_at_ps2_init(UNUSED(const device_t *info)) { - xtide_t *xtide = malloc(sizeof(xtide_t)); - - memset(xtide, 0x00, sizeof(xtide_t)); + xtide_t *xtide = calloc(1, sizeof(xtide_t)); rom_init(&xtide->bios_rom, ROM_PATH_PS2AT, 0xc8000, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); diff --git a/src/disk/lba_enhancer.c b/src/disk/lba_enhancer.c index c7f3fd969..8e8bc480d 100644 --- a/src/disk/lba_enhancer.c +++ b/src/disk/lba_enhancer.c @@ -44,7 +44,7 @@ lba_enhancer_close(void* priv) } void * -lba_enhancer_init(const device_t *info) +lba_enhancer_init(UNUSED(const device_t *info)) { lba_enhancer_t *dev = (lba_enhancer_t *) calloc(1, sizeof(lba_enhancer_t)); diff --git a/src/disk/mo.c b/src/disk/mo.c index 7528806c7..5494fc9a8 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -1975,7 +1975,7 @@ mo_global_init(void) } static int -mo_get_max(const ide_t *ide, const int ide_has_dma, const int type) +mo_get_max(UNUSED(const ide_t *ide), const int ide_has_dma, const int type) { int ret; @@ -1999,7 +1999,7 @@ mo_get_max(const ide_t *ide, const int ide_has_dma, const int type) } static int -mo_get_timings(const ide_t *ide, const int ide_has_dma, const int type) +mo_get_timings(UNUSED(const ide_t *ide), const int ide_has_dma, const int type) { int ret; diff --git a/src/disk/zip.c b/src/disk/zip.c index fd261b4dd..72781281a 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -2062,7 +2062,7 @@ zip_global_init(void) } static int -zip_get_max(const ide_t *ide, const int ide_has_dma, const int type) +zip_get_max(UNUSED(const ide_t *ide), const int ide_has_dma, const int type) { int ret; @@ -2086,7 +2086,7 @@ zip_get_max(const ide_t *ide, const int ide_has_dma, const int type) } static int -zip_get_timings(const ide_t *ide, const int ide_has_dma, const int type) +zip_get_timings(UNUSED(const ide_t *ide), const int ide_has_dma, const int type) { int ret; diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 5c377f95f..300d775c5 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -2314,8 +2314,7 @@ fdc_close(void *priv) static void * fdc_init(const device_t *info) { - fdc_t *fdc = (fdc_t *) malloc(sizeof(fdc_t)); - memset(fdc, 0, sizeof(fdc_t)); + fdc_t *fdc = (fdc_t *) calloc(1, sizeof(fdc_t)); fdc->flags = info->local; diff --git a/src/floppy/fdc_compaticard.c b/src/floppy/fdc_compaticard.c index a693c9cb2..4abc4abac 100644 --- a/src/floppy/fdc_compaticard.c +++ b/src/floppy/fdc_compaticard.c @@ -30,6 +30,7 @@ #include <86box/fdd.h> #include <86box/fdc.h> #include <86box/fdc_ext.h> +#include <86box/plat_unused.h> #define DEVICE_COMPATICARD_I 0 #define DEVICE_COMPATICARD_II 1 @@ -57,7 +58,7 @@ typedef struct compaticard_s { } compaticard_t; static void -compaticard_out(uint16_t port, uint8_t val, void *priv) +compaticard_out(UNUSED(uint16_t port), uint8_t val, void *priv) { compaticard_t *dev = (compaticard_t *) priv; @@ -65,7 +66,7 @@ compaticard_out(uint16_t port, uint8_t val, void *priv) } static uint8_t -compaticard_in(uint16_t port, void *priv) +compaticard_in(UNUSED(uint16_t port), void *priv) { compaticard_t *dev = (compaticard_t *) priv; uint8_t ret = (dev->cr_2 &CR_2_MASK); diff --git a/src/floppy/fdc_magitronic.c b/src/floppy/fdc_magitronic.c index 09b766d6c..2b708a121 100644 --- a/src/floppy/fdc_magitronic.c +++ b/src/floppy/fdc_magitronic.c @@ -90,8 +90,7 @@ b215_close(void *priv) static void * b215_init(UNUSED(const device_t *info)) { - b215_t *dev = (b215_t *) malloc(sizeof(b215_t)); - memset(dev, 0, sizeof(b215_t)); + b215_t *dev = (b215_t *) calloc(1, sizeof(b215_t)); rom_init(&dev->rom, ROM_B215, ROM_ADDR, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL); diff --git a/src/floppy/fdc_monster.c b/src/floppy/fdc_monster.c index bb210fb44..51fb108d6 100644 --- a/src/floppy/fdc_monster.c +++ b/src/floppy/fdc_monster.c @@ -13,7 +13,7 @@ * Authors: Jasmine Iwanek, * Miran Grca, * - * Copyright 2022-2024 Jasmine Iwanek. + * Copyright 2022-2025 Jasmine Iwanek. * Copyright 2024 Miran Grca. */ #include diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index 6a8bbbd43..587eb64fa 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -97,8 +97,7 @@ pii_init(const device_t *info) { pii_t *dev; - dev = (pii_t *) malloc(sizeof(pii_t)); - memset(dev, 0, sizeof(pii_t)); + dev = (pii_t *) calloc(1, sizeof(pii_t)); if (BIOS_ADDR != 0) rom_init(&dev->bios_rom, DTK_VARIANT, BIOS_ADDR, 0x2000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL); diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index 0e8a6590a..140e87899 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -2731,8 +2731,7 @@ d86f_prepare_sector(int drive, int side, int prev_pos, uint8_t *id_buf, uint8_t uint16_t datadam_mfm = 0x4A55; if (fdd_get_turbo(drive) && (dev->version == 0x0063)) { - s = (sector_t *) malloc(sizeof(sector_t)); - memset(s, 0, sizeof(sector_t)); + s = (sector_t *) calloc(1, sizeof(sector_t)); s->c = id_buf[0]; s->h = id_buf[1]; s->r = id_buf[2]; @@ -3921,8 +3920,7 @@ d86f_setup(int drive) d86f_t *dev; /* Allocate a drive structure. */ - dev = (d86f_t *) malloc(sizeof(d86f_t)); - memset(dev, 0x00, sizeof(d86f_t)); + dev = (d86f_t *) calloc(1, sizeof(d86f_t)); dev->state = STATE_IDLE; dev->last_side_sector[0] = NULL; diff --git a/src/floppy/fdd_fdi.c b/src/floppy/fdd_fdi.c index f14bf2cd4..97b6441a0 100644 --- a/src/floppy/fdd_fdi.c +++ b/src/floppy/fdd_fdi.c @@ -316,15 +316,13 @@ fdi_load(int drive, char *fn) writeprot[drive] = fwriteprot[drive] = 1; /* Allocate a drive block. */ - dev = (fdi_t *) malloc(sizeof(fdi_t)); + dev = (fdi_t *) calloc(1, sizeof(fdi_t)); if (dev == NULL) { memset(floppyfns[drive], 0, sizeof(floppyfns[drive])); return; } - memset(dev, 0x00, sizeof(fdi_t)); - d86f_unregister(drive); dev->fp = plat_fopen(fn, "rb"); diff --git a/src/floppy/fdd_imd.c b/src/floppy/fdd_imd.c index 0839c2900..7994530ed 100644 --- a/src/floppy/fdd_imd.c +++ b/src/floppy/fdd_imd.c @@ -635,8 +635,7 @@ imd_load(int drive, char *fn) writeprot[drive] = 0; /* Allocate a drive block. */ - dev = (imd_t *) malloc(sizeof(imd_t)); - memset(dev, 0x00, sizeof(imd_t)); + dev = (imd_t *) calloc(1, sizeof(imd_t)); dev->fp = plat_fopen(fn, "rb+"); if (dev->fp == NULL) { diff --git a/src/floppy/fdd_img.c b/src/floppy/fdd_img.c index 69a753ef5..30e0212cd 100644 --- a/src/floppy/fdd_img.c +++ b/src/floppy/fdd_img.c @@ -681,8 +681,7 @@ img_load(int drive, char *fn) writeprot[drive] = 0; /* Allocate a drive block. */ - dev = (img_t *) malloc(sizeof(img_t)); - memset(dev, 0x00, sizeof(img_t)); + dev = (img_t *) calloc(1, sizeof(img_t)); dev->fp = plat_fopen(fn, "rb+"); if (dev->fp == NULL) { diff --git a/src/floppy/fdd_mfm.c b/src/floppy/fdd_mfm.c index a332d25c9..87da4e08b 100644 --- a/src/floppy/fdd_mfm.c +++ b/src/floppy/fdd_mfm.c @@ -396,8 +396,7 @@ mfm_load(int drive, char *fn) writeprot[drive] = fwriteprot[drive] = 1; /* Allocate a drive block. */ - dev = (mfm_t *) malloc(sizeof(mfm_t)); - memset(dev, 0x00, sizeof(mfm_t)); + dev = (mfm_t *) calloc(1, sizeof(mfm_t)); dev->fp = plat_fopen(fn, "rb"); if (dev->fp == NULL) { diff --git a/src/floppy/fdd_pcjs.c b/src/floppy/fdd_pcjs.c index 76f8ca7dc..6f69042b0 100644 --- a/src/floppy/fdd_pcjs.c +++ b/src/floppy/fdd_pcjs.c @@ -469,7 +469,7 @@ track_flags(int drive) } static void -set_sector(int drive, int side, uint8_t c, uint8_t h, uint8_t r, uint8_t n) +set_sector(int drive, int side, uint8_t c, UNUSED(uint8_t h), uint8_t r, UNUSED(uint8_t n)) { pcjs_t *dev = images[drive]; @@ -617,8 +617,7 @@ pcjs_load(int drive, char *fn) d86f_unregister(drive); /* Allocate a drive block */ - dev = (pcjs_t *) malloc(sizeof(pcjs_t)); - memset(dev, 0x00, sizeof(pcjs_t)); + dev = (pcjs_t *) calloc(1, sizeof(pcjs_t)); /* Open the image file, read-only */ dev->fp = plat_fopen(fn, "rb"); diff --git a/src/floppy/fdd_td0.c b/src/floppy/fdd_td0.c index 0bf4b1c71..f5882158b 100644 --- a/src/floppy/fdd_td0.c +++ b/src/floppy/fdd_td0.c @@ -1214,8 +1214,7 @@ td0_load(int drive, char *fn) writeprot[drive] = 1; - dev = (td0_t *) malloc(sizeof(td0_t)); - memset(dev, 0x00, sizeof(td0_t)); + dev = (td0_t *) calloc(1, sizeof(td0_t)); td0[drive] = dev; dev->fp = plat_fopen(fn, "rb"); diff --git a/src/game/gameport.c b/src/game/gameport.c index f3b54c803..39193af88 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -366,15 +366,11 @@ gameport_add(const device_t *gameport_type) static void * gameport_init(const device_t *info) { - gameport_t *dev = NULL; - - dev = malloc(sizeof(gameport_t)); - memset(dev, 0x00, sizeof(gameport_t)); + gameport_t *dev = calloc(1, sizeof(gameport_t)); /* Allocate global instance. */ if (!joystick_instance[0] && joystick_type) { - joystick_instance[0] = malloc(sizeof(joystick_instance_t)); - memset(joystick_instance[0], 0x00, sizeof(joystick_instance_t)); + joystick_instance[0] = calloc(1, sizeof(joystick_instance_t)); joystick_instance[0]->axis[0].joystick = joystick_instance[0]; joystick_instance[0]->axis[1].joystick = joystick_instance[0]; @@ -650,7 +646,7 @@ static const device_config_t tmacm_config[] = { { "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/include/86box/bswap.h b/src/include/86box/bswap.h index f7d3a3d0e..37c846d59 100644 --- a/src/include/86box/bswap.h +++ b/src/include/86box/bswap.h @@ -133,12 +133,12 @@ bswap64s(uint64_t *s) return endian##_bswap(v, size); \ } \ \ - static __inline void endian##size##_to_cpus(type *p) \ + static __inline void endian##size##_to_cpus(UNUSED(type *p)) \ { \ endian##_bswaps(p, size) \ } \ \ - static __inline void cpu_to_##endian##size##s(type *p) \ + static __inline void cpu_to_##endian##size##s(UNUSED(type *p)) \ { \ endian##_bswaps(p, size) \ } \ diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index de20facdb..7c028d7d6 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -104,8 +104,7 @@ enum { #define CDV EMU_VERSION_EX -static const struct -{ +static const struct cdrom_drive_types_s { const char vendor[9]; const char model[17]; const char revision[5]; @@ -204,19 +203,19 @@ static const struct Unusual 2.23x according to Google, I'm rounding it upwards to 3x. Assumed caddy based on the DM-3024. */ - { "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1 }, /* Caddy. */ + { "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1, { -1, -1, -1, -1 } }, /* Caddy. */ /* The characteristics are a complete guesswork because I can't find this one on Google. Also, INQUIRY length is always 96 on these Toshiba drives. */ - { "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0 }, /* Tray. */ - { "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1 }, /* Caddy. */ - { "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0 }, /* Tray. */ - { "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0 }, /* Tray. */ - { "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0 }, /* Tray. */ - { "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0 } + { "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */ + { "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1, { -1, -1, -1, -1 } }, /* Caddy. */ + { "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */ + { "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */ + { "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */ + { "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0, { -1, -1, -1, -1 } } }; /* To shut up the GCC compilers. */ @@ -272,8 +271,9 @@ typedef struct cdrom_ops_t { uint32_t *info); int (*is_dvd)(const void *local); int (*has_audio)(const void *local); - int (*ext_medium_changed)(void *local); + int (*is_empty)(const void *local); void (*close)(void *local); + void (*load)(const void *local); } cdrom_ops_t; typedef struct cdrom { @@ -424,7 +424,8 @@ extern int cdrom_read_dvd_structure(const cdrom_t *dev, const uint8_ uint8_t *buffer, uint32_t *info); extern void cdrom_read_disc_information(const cdrom_t *dev, uint8_t *buffer); extern int cdrom_read_track_information(cdrom_t *dev, const uint8_t *cdb, uint8_t *buffer); -extern int cdrom_ext_medium_changed(const cdrom_t *dev); +extern void cdrom_set_empty(cdrom_t *dev); +extern void cdrom_update_status(cdrom_t *dev); extern int cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert); extern void cdrom_global_init(void); diff --git a/src/include/86box/net_ne2000.h b/src/include/86box/net_ne2000.h index cb17ef8b1..ecf2612b5 100644 --- a/src/include/86box/net_ne2000.h +++ b/src/include/86box/net_ne2000.h @@ -44,7 +44,7 @@ enum { NE2K_NE2000_COMPAT = 4, /* 16-bit ISA NE2000-Compatible */ NE2K_NE2000_COMPAT_8BIT = 5, /* 8-bit ISA NE2000-Compatible, like: https://github.com/skiselev/isa8_eth */ NE2K_ETHERNEXT_MC = 6, /* 16-bit MCA EtherNext/MC */ - NE2K_RTL8019AS = 7, /* 16-bit ISA PnP Realtek 8019AS */ + NE2K_RTL8019AS_PNP = 7, /* 16-bit ISA PnP Realtek 8019AS */ NE2K_DE220P = 8, /* 16-bit ISA PnP D-Link DE-220P */ NE2K_RTL8029AS = 9, /* 32-bit PCI Realtek 8029AS */ /* Check nic_init() if adding items after this point. */ diff --git a/src/include/86box/network.h b/src/include/86box/network.h index fa6408790..2140d62dd 100644 --- a/src/include/86box/network.h +++ b/src/include/86box/network.h @@ -213,7 +213,7 @@ extern const device_t ne2000_device; extern const device_t ne2000_compat_device; extern const device_t ne2000_compat_8bit_device; extern const device_t ethernext_mc_device; -extern const device_t rtl8019as_device; +extern const device_t rtl8019as_pnp_device; extern const device_t de220p_device; extern const device_t rtl8029as_device; diff --git a/src/include/86box/scsi_device.h b/src/include/86box/scsi_device.h index 84abee066..ffe042481 100644 --- a/src/include/86box/scsi_device.h +++ b/src/include/86box/scsi_device.h @@ -219,7 +219,7 @@ #define ASC_INV_FIELD_IN_PARAMETER_LIST 0x26 #define ASC_WRITE_PROTECTED 0x27 #define ASC_MEDIUM_MAY_HAVE_CHANGED 0x28 -#define ASC_CAPACITY_DATA_CHANGED 0x2A +#define ASC_CAPACITY_DATA_CHANGED 0x2a #define ASC_INCOMPATIBLE_FORMAT 0x30 #define ASC_MEDIUM_NOT_PRESENT 0x3a #define ASC_DATA_PHASE_ERROR 0x4b diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 891f02e84..3dba578bd 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -619,8 +619,7 @@ vid_init_1512(amstrad_t *ams) amsvid_t *vid; /* Allocate a video controller block. */ - vid = (amsvid_t *) malloc(sizeof(amsvid_t)); - memset(vid, 0x00, sizeof(amsvid_t)); + vid = (amsvid_t *) calloc(1, sizeof(amsvid_t)); video_inform(VIDEO_FLAG_TYPE_CGA, &timing_pc1512); @@ -823,8 +822,7 @@ vid_init_1640(amstrad_t *ams) amsvid_t *vid; /* Allocate a video controller block. */ - vid = (amsvid_t *) malloc(sizeof(amsvid_t)); - memset(vid, 0x00, sizeof(amsvid_t)); + vid = (amsvid_t *) calloc(1, sizeof(amsvid_t)); rom_init(&vid->bios_rom, "roms/machines/pc1640/40100", 0xc0000, 0x8000, 0x7fff, 0, 0); @@ -1620,8 +1618,7 @@ vid_init_200(amstrad_t *ams) mda_t *mda; /* Allocate a video controller block. */ - vid = (amsvid_t *) malloc(sizeof(amsvid_t)); - memset(vid, 0x00, sizeof(amsvid_t)); + vid = (amsvid_t *) calloc(1, sizeof(amsvid_t)); vid->emulation = device_get_config_int("video_emulation"); @@ -2870,8 +2867,7 @@ machine_amstrad_init(const machine_t *model, int type) { amstrad_t *ams; - ams = (amstrad_t *) malloc(sizeof(amstrad_t)); - memset(ams, 0x00, sizeof(amstrad_t)); + ams = (amstrad_t *) calloc(1, sizeof(amstrad_t)); ams->type = type; amstrad_latch = 0x80000000; diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 3b9462f90..904122bad 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -629,8 +629,7 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self) static void * compaq_plasma_init(UNUSED(const device_t *info)) { - compaq_plasma_t *self = malloc(sizeof(compaq_plasma_t)); - memset(self, 0, sizeof(compaq_plasma_t)); + compaq_plasma_t *self = calloc(1, sizeof(compaq_plasma_t)); video_inform(VIDEO_FLAG_TYPE_CGA, &timing_compaq_plasma); if (compaq_machine_type == COMPAQ_PORTABLEIII) diff --git a/src/machine/m_at_grid.c b/src/machine/m_at_grid.c index 443607382..03b7288b9 100644 --- a/src/machine/m_at_grid.c +++ b/src/machine/m_at_grid.c @@ -38,6 +38,7 @@ #include <86box/mem.h> #include <86box/rom.h> #include <86box/vid_cga.h> +#include <86box/plat_unused.h> #define GRID_APPROM_SELECT 0x440 #define GRID_APPROM_ENABLE 0x405 @@ -263,7 +264,7 @@ static uint8_t grid_io_read(uint16_t port, void *priv) { } static void * -grid_init(const device_t *info) +grid_init(UNUSED(const device_t *info)) { grid_t *dev = calloc(1, sizeof(grid_t)); diff --git a/src/machine/m_at_t3100e_vid.c b/src/machine/m_at_t3100e_vid.c index 80af959af..c827a05e5 100644 --- a/src/machine/m_at_t3100e_vid.c +++ b/src/machine/m_at_t3100e_vid.c @@ -655,8 +655,7 @@ t3100e_recalcattrs(t3100e_t *t3100e) void * t3100e_init(UNUSED(const device_t *info)) { - t3100e_t *t3100e = malloc(sizeof(t3100e_t)); - memset(t3100e, 0, sizeof(t3100e_t)); + t3100e_t *t3100e = calloc(1, sizeof(t3100e_t)); loadfont("roms/machines/t3100e/t3100e_font.bin", 5); cga_init(&t3100e->cga); video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t3100e); diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index 847053bdb..ca9e72fca 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -1532,8 +1532,7 @@ machine_pcjr_init(UNUSED(const machine_t *model)) if (bios_only || !ret) return ret; - pcjr = malloc(sizeof(pcjr_t)); - memset(pcjr, 0x00, sizeof(pcjr_t)); + pcjr = calloc(1, sizeof(pcjr_t)); pic_init_pcjr(); pit_common_init(0, pit_irq0_timer_pcjr, NULL); diff --git a/src/machine/m_ps1.c b/src/machine/m_ps1.c index 8b2a096c7..92846c401 100644 --- a/src/machine/m_ps1.c +++ b/src/machine/m_ps1.c @@ -299,8 +299,7 @@ ps1_setup(int model) ps1_t *ps; void *priv; - ps = (ps1_t *) malloc(sizeof(ps1_t)); - memset(ps, 0x00, sizeof(ps1_t)); + ps = (ps1_t *) calloc(1, sizeof(ps1_t)); ps->model = model; io_sethandler(0x0091, 1, diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index 06c7a2c95..d407953b4 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -1297,8 +1297,7 @@ ps1_hdc_init(UNUSED(const device_t *info)) int c; /* Allocate and initialize device block. */ - dev = malloc(sizeof(hdc_t)); - memset(dev, 0x00, sizeof(hdc_t)); + dev = calloc(1, sizeof(hdc_t)); /* Set up controller parameters for PS/1 2011. */ dev->base = 0x0320; diff --git a/src/machine/m_ps2_isa.c b/src/machine/m_ps2_isa.c index c0c4f7c79..7d024c335 100644 --- a/src/machine/m_ps2_isa.c +++ b/src/machine/m_ps2_isa.c @@ -151,8 +151,7 @@ ps2_isa_setup(int model, int cpu_type) ps2_isa_t *ps2; void *priv; - ps2 = (ps2_isa_t *) malloc(sizeof(ps2_isa_t)); - memset(ps2, 0x00, sizeof(ps2_isa_t)); + ps2 = (ps2_isa_t *) calloc(1, sizeof(ps2_isa_t)); ps2->model = model; ps2->cpu_type = cpu_type; diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index 8e46c6154..7072c5e78 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -1359,8 +1359,7 @@ vid_init(tandy_t *dev) int display_type; t1kvid_t *vid; - vid = malloc(sizeof(t1kvid_t)); - memset(vid, 0x00, sizeof(t1kvid_t)); + vid = calloc(1, sizeof(t1kvid_t)); vid->memctrl = -1; video_inform(VIDEO_FLAG_TYPE_CGA, &timing_dram); @@ -1540,8 +1539,7 @@ eep_init(const device_t *info) t1keep_t *eep; FILE *fp = NULL; - eep = (t1keep_t *) malloc(sizeof(t1keep_t)); - memset(eep, 0x00, sizeof(t1keep_t)); + eep = (t1keep_t *) calloc(1, sizeof(t1keep_t)); switch (info->local) { case TYPE_TANDY1000HX: diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 3b907f4df..b6e4fb94a 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -2313,8 +2313,7 @@ machine_xt_m24_init(const machine_t *model) if (bios_only || !ret) return ret; - m24_kbd = (m24_kbd_t *) malloc(sizeof(m24_kbd_t)); - memset(m24_kbd, 0x00, sizeof(m24_kbd_t)); + m24_kbd = (m24_kbd_t *) calloc(1, sizeof(m24_kbd_t)); machine_common_init(model); @@ -2330,10 +2329,9 @@ machine_xt_m24_init(const machine_t *model) nmi_init(); /* Allocate an NVR for this machine. */ - nvr = (nvr_t *) malloc(sizeof(nvr_t)); + nvr = (nvr_t *) calloc(1, sizeof(nvr_t)); if (nvr == NULL) return 0; - memset(nvr, 0x00, sizeof(nvr_t)); mm58174_init(nvr, model->nvrmask + 1); @@ -2374,8 +2372,7 @@ machine_xt_m240_init(const machine_t *model) if (bios_only || !ret) return ret; - m24_kbd = (m24_kbd_t *) malloc(sizeof(m24_kbd_t)); - memset(m24_kbd, 0x00, sizeof(m24_kbd_t)); + m24_kbd = (m24_kbd_t *) calloc(1, sizeof(m24_kbd_t)); machine_common_init(model); @@ -2404,10 +2401,9 @@ machine_xt_m240_init(const machine_t *model) nmi_init(); /* Allocate an NVR for this machine. */ - nvr = (nvr_t *) malloc(sizeof(nvr_t)); + nvr = (nvr_t *) calloc(1, sizeof(nvr_t)); if (nvr == NULL) return 0; - memset(nvr, 0x00, sizeof(nvr_t)); mm58274_init(nvr, model->nvrmask + 1); @@ -2438,8 +2434,7 @@ machine_xt_m19_init(const machine_t *model) m19_vid_t *vid; /* Do not move memory allocation elsewhere. */ - vid = (m19_vid_t *) malloc(sizeof(m19_vid_t)); - memset(vid, 0x00, sizeof(m19_vid_t)); + vid = (m19_vid_t *) calloc(1, sizeof(m19_vid_t)); machine_common_init(model); diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index 0d1ba714b..efad869e1 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -651,8 +651,7 @@ t1000_recalcattrs(t1000_t *t1000) static void * t1000_init(UNUSED(const device_t *info)) { - t1000_t *t1000 = malloc(sizeof(t1000_t)); - memset(t1000, 0, sizeof(t1000_t)); + t1000_t *t1000 = calloc(1, sizeof(t1000_t)); loadfont("roms/machines/t1000/t1000font.bin", 8); cga_init(&t1000->cga); video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t1000); diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 776e10c9f..833529ffb 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -73,8 +73,7 @@ zenith_scratchpad_init(UNUSED(const device_t *info)) { zenith_t *dev; - dev = (zenith_t *) malloc(sizeof(zenith_t)); - memset(dev, 0x00, sizeof(zenith_t)); + dev = (zenith_t *) calloc(1, sizeof(zenith_t)); dev->scratchpad_ram = malloc(0x4000); diff --git a/src/mem/catalyst_flash.c b/src/mem/catalyst_flash.c index 4bb9b585a..fd2bb739f 100644 --- a/src/mem/catalyst_flash.c +++ b/src/mem/catalyst_flash.c @@ -192,8 +192,7 @@ catalyst_flash_init(UNUSED(const device_t *info)) FILE *fp; flash_t *dev; - dev = malloc(sizeof(flash_t)); - memset(dev, 0, sizeof(flash_t)); + dev = calloc(1, sizeof(flash_t)); sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); diff --git a/src/mem/i2c_eeprom.c b/src/mem/i2c_eeprom.c index 8e4a6cc14..a8ae7ed04 100644 --- a/src/mem/i2c_eeprom.c +++ b/src/mem/i2c_eeprom.c @@ -128,8 +128,7 @@ log2i(uint32_t i) void * i2c_eeprom_init(void *i2c, uint8_t addr, uint8_t *data, uint32_t size, uint8_t writable) { - i2c_eeprom_t *dev = (i2c_eeprom_t *) malloc(sizeof(i2c_eeprom_t)); - memset(dev, 0, sizeof(i2c_eeprom_t)); + i2c_eeprom_t *dev = (i2c_eeprom_t *) calloc(1, sizeof(i2c_eeprom_t)); /* Round size up to the next power of 2. */ uint32_t pow_size = 1 << log2i(size); diff --git a/src/mem/intel_flash.c b/src/mem/intel_flash.c index 56a7ad0e0..7375b1f42 100644 --- a/src/mem/intel_flash.c +++ b/src/mem/intel_flash.c @@ -351,8 +351,7 @@ intel_flash_init(const device_t *info) flash_t *dev; uint8_t type = info->local & 0xff; - dev = malloc(sizeof(flash_t)); - memset(dev, 0, sizeof(flash_t)); + dev = calloc(1, sizeof(flash_t)); sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); diff --git a/src/mem/smram.c b/src/mem/smram.c index 0532e2dd5..afbc5475c 100644 --- a/src/mem/smram.c +++ b/src/mem/smram.c @@ -245,12 +245,11 @@ smram_add(void) return NULL; } - temp_smram = (smram_t *) malloc(sizeof(smram_t)); + temp_smram = (smram_t *) calloc(1, sizeof(smram_t)); if (temp_smram == NULL) { - fatal("smram_add(): temp_smram malloc failed\n"); + fatal("smram_add(): temp_smram calloc failed\n"); return NULL; } - memset(temp_smram, 0x00, sizeof(smram_t)); memset(&(temp_smram->mapping), 0x00, sizeof(mem_mapping_t)); /* Add struct to the beginning of the list if necessary.*/ diff --git a/src/mem/spd.c b/src/mem/spd.c index fee9b0b11..01cd7b464 100644 --- a/src/mem/spd.c +++ b/src/mem/spd.c @@ -221,8 +221,7 @@ spd_register(uint8_t ram_type, uint8_t slot_mask, uint16_t max_module_size) if (!(slot_mask & (1 << slot))) continue; /* slot disabled */ - spd_modules[slot] = (spd_t *) malloc(sizeof(spd_t)); - memset(spd_modules[slot], 0, sizeof(spd_t)); + spd_modules[slot] = (spd_t *) calloc(1, sizeof(spd_t)); spd_modules[slot]->slot = slot; spd_modules[slot]->size = rows[row]; diff --git a/src/mem/sst_flash.c b/src/mem/sst_flash.c index 3dce35444..5a9c9c877 100644 --- a/src/mem/sst_flash.c +++ b/src/mem/sst_flash.c @@ -505,8 +505,7 @@ static void * sst_init(const device_t *info) { FILE *fp; - sst_t *dev = malloc(sizeof(sst_t)); - memset(dev, 0, sizeof(sst_t)); + sst_t *dev = calloc(1, sizeof(sst_t)); sprintf(flash_path, "%s.bin", machine_get_internal_name_ex(machine)); diff --git a/src/network/net_3c501.c b/src/network/net_3c501.c index 21d71d75e..73dd5ef62 100644 --- a/src/network/net_3c501.c +++ b/src/network/net_3c501.c @@ -56,7 +56,6 @@ #include <86box/thread.h> #include <86box/timer.h> #include <86box/network.h> -#include <86box/bswap.h> #include <86box/plat_unused.h> /* Maximum number of times we report a link down to the guest (failure to send frame) */ @@ -1080,8 +1079,7 @@ threec501_nic_init(UNUSED(const device_t *info)) uint32_t mac; threec501_t *dev; - dev = malloc(sizeof(threec501_t)); - memset(dev, 0x00, sizeof(threec501_t)); + dev = calloc(1, sizeof(threec501_t)); dev->maclocal[0] = 0x02; /* 02:60:8C (3Com OID) */ dev->maclocal[1] = 0x60; dev->maclocal[2] = 0x8C; diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index f96e76a11..cd5016147 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -60,7 +60,6 @@ #include <86box/timer.h> #include <86box/network.h> #include <86box/net_dp8390.h> -#include <86box/bswap.h> #include <86box/plat_unused.h> typedef struct threec503_t { @@ -573,8 +572,7 @@ threec503_nic_init(UNUSED(const device_t *info)) uint32_t mac; threec503_t *dev; - dev = malloc(sizeof(threec503_t)); - memset(dev, 0x00, sizeof(threec503_t)); + dev = calloc(1, sizeof(threec503_t)); dev->maclocal[0] = 0x02; /* 02:60:8C (3Com OID) */ dev->maclocal[1] = 0x60; dev->maclocal[2] = 0x8C; diff --git a/src/network/net_dp8390.c b/src/network/net_dp8390.c index 297e11424..623dec56c 100644 --- a/src/network/net_dp8390.c +++ b/src/network/net_dp8390.c @@ -918,8 +918,7 @@ dp8390_set_defaults(dp8390_t *dev, uint8_t flags) void dp8390_mem_alloc(dp8390_t *dev, uint32_t start, uint32_t size) { - dev->mem = (uint8_t *) malloc(size * sizeof(uint8_t)); - memset(dev->mem, 0, size * sizeof(uint8_t)); + dev->mem = (uint8_t *) calloc(size, sizeof(uint8_t)); dev->mem_start = start; dev->mem_end = start + size; dev->mem_size = size; @@ -1007,8 +1006,7 @@ dp8390_soft_reset(dp8390_t *dev) static void * dp8390_init(UNUSED(const device_t *info)) { - dp8390_t *dp8390 = (dp8390_t *) malloc(sizeof(dp8390_t)); - memset(dp8390, 0, sizeof(dp8390_t)); + dp8390_t *dp8390 = (dp8390_t *) calloc(1, sizeof(dp8390_t)); /* Set values assuming WORD and only the clear IRQ flag - - the NIC can then call dp8390_set_defaults() again to diff --git a/src/network/net_modem.c b/src/network/net_modem.c index 732190254..83dfe04d7 100644 --- a/src/network/net_modem.c +++ b/src/network/net_modem.c @@ -1133,7 +1133,7 @@ modem_dtr_callback_timer(void *priv) } void -modem_dtr_callback(serial_t *serial, int status, void *priv) +modem_dtr_callback(UNUSED(serial_t *serial), int status, void *priv) { modem_t *dev = (modem_t *) priv; dev->dtrstate = !!status; @@ -1483,7 +1483,7 @@ modem_cmdpause_timer_callback(void *priv) /* Initialize the device for use by the user. */ static void * -modem_init(const device_t *info) +modem_init(UNUSED(const device_t *info)) { modem_t *modem = (modem_t *) calloc(1, sizeof(modem_t)); const char *phonebook_file = NULL; diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 1f191e047..2f6c60d51 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -66,7 +66,6 @@ #include <86box/network.h> #include <86box/net_dp8390.h> #include <86box/net_ne2000.h> -#include <86box/bswap.h> #include <86box/isapnp.h> #include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> @@ -313,7 +312,7 @@ asic_write(nic_t *dev, uint32_t off, uint32_t val, unsigned len) static uint32_t page3_read(nic_t *dev, uint32_t off, UNUSED(unsigned int len)) { - if (dev->board >= NE2K_RTL8019AS) + if (dev->board >= NE2K_RTL8019AS_PNP) switch (off) { case 0x1: /* 9346CR */ return (dev->_9346cr); @@ -328,7 +327,7 @@ page3_read(nic_t *dev, uint32_t off, UNUSED(unsigned int len)) return (dev->config3 & 0x46); case 0x8: /* CSNSAV */ - return ((dev->board == NE2K_RTL8019AS) ? dev->pnp_csnsav : 0x00); + return ((dev->board == NE2K_RTL8019AS_PNP) ? dev->pnp_csnsav : 0x00); case 0xe: /* 8029ASID0 */ if (dev->board == NE2K_RTL8029AS) @@ -351,7 +350,7 @@ page3_read(nic_t *dev, uint32_t off, UNUSED(unsigned int len)) static void page3_write(nic_t *dev, uint32_t off, uint32_t val, UNUSED(unsigned len)) { - if (dev->board >= NE2K_RTL8019AS) { + if (dev->board >= NE2K_RTL8019AS_PNP) { nelog(3, "%s: Page2 write to register 0x%02x, len=%u, value=0x%04x\n", dev->name, off, len, val); @@ -912,17 +911,15 @@ nic_init(const device_t *info) { uint32_t mac; uint32_t mac_oui; - char *rom; + char *rom = NULL; nic_t *dev; int set_oui = 0; - dev = malloc(sizeof(nic_t)); - memset(dev, 0x00, sizeof(nic_t)); + dev = calloc(1, sizeof(nic_t)); dev->name = info->name; dev->board = info->local; - rom = NULL; - if (dev->board >= NE2K_RTL8019AS) { + if (dev->board >= NE2K_RTL8019AS_PNP) { dev->base_address = 0x340; dev->base_irq = 12; if (dev->board == NE2K_RTL8029AS) { @@ -1045,18 +1042,18 @@ nic_init(const device_t *info) dp8390_mem_alloc(dev->dp8390, 0x4000, 0x8000); break; - case NE2K_RTL8019AS: + case NE2K_RTL8019AS_PNP: case NE2K_RTL8029AS: dev->is_pci = (dev->board == NE2K_RTL8029AS) ? 1 : 0; dev->maclocal[0] = 0x00; /* 00:E0:4C (Realtek OID) */ dev->maclocal[1] = 0xE0; dev->maclocal[2] = 0x4C; - rom = (dev->board == NE2K_RTL8019AS) ? ROM_PATH_RTL8019 : ROM_PATH_RTL8029; + rom = (dev->board == NE2K_RTL8019AS_PNP) ? ROM_PATH_RTL8019 : ROM_PATH_RTL8029; if (dev->is_pci) dp8390_set_defaults(dev->dp8390, DP8390_FLAG_EVEN_MAC); else dp8390_set_defaults(dev->dp8390, DP8390_FLAG_EVEN_MAC | DP8390_FLAG_CLEAR_IRQ); - dp8390_set_id(dev->dp8390, 0x50, (dev->board == NE2K_RTL8019AS) ? 0x70 : 0x43); + dp8390_set_id(dev->dp8390, 0x50, (dev->board == NE2K_RTL8019AS_PNP) ? 0x70 : 0x43); dp8390_mem_alloc(dev->dp8390, 0x4000, 0x8000); break; @@ -1093,13 +1090,13 @@ nic_init(const device_t *info) * Make this device known to the I/O system. * PnP and PCI devices start with address spaces inactive. */ - if ((dev->board < NE2K_RTL8019AS) && (dev->board != NE2K_ETHERNEXT_MC)) + if ((dev->board < NE2K_RTL8019AS_PNP) && (dev->board != NE2K_ETHERNEXT_MC)) nic_ioset(dev, dev->base_address); /* Set up our BIOS ROM space, if any. */ nic_rom_init(dev, rom); - if (dev->board >= NE2K_RTL8019AS) { + if (dev->board >= NE2K_RTL8019AS_PNP) { if (dev->is_pci) { /* * Configure the PCI space registers. @@ -1147,7 +1144,7 @@ nic_init(const device_t *info) pci_add_card(PCI_ADD_NORMAL, nic_pci_read, nic_pci_write, dev, &dev->pci_slot); } - /* Initialize the RTL8029 EEPROM. */ + /* Initialize the RTL80x9 EEPROM. */ memset(dev->eeprom, 0x00, sizeof(dev->eeprom)); if (dev->board == NE2K_RTL8029AS) { @@ -1161,7 +1158,7 @@ nic_init(const device_t *info) const char *pnp_rom_file = NULL; int pnp_rom_len = 0x4a; switch (dev->board) { - case NE2K_RTL8019AS: + case NE2K_RTL8019AS_PNP: pnp_rom_file = "roms/network/rtl8019as/RTL8019A.BIN"; break; @@ -1185,7 +1182,7 @@ nic_init(const device_t *info) } switch (info->local) { - case NE2K_RTL8019AS: + case NE2K_RTL8019AS_PNP: case NE2K_DE220P: dev->pnp_card = isapnp_add_card(pnp_rom, pnp_rom_len, nic_pnp_config_changed, nic_pnp_csn_changed, @@ -1709,11 +1706,11 @@ const device_t ethernext_mc_device = { .config = mca_mac_config }; -const device_t rtl8019as_device = { +const device_t rtl8019as_pnp_device = { .name = "Realtek RTL8019AS", .internal_name = "ne2kpnp", .flags = DEVICE_ISA | DEVICE_AT, - .local = NE2K_RTL8019AS, + .local = NE2K_RTL8019AS_PNP, .init = nic_init, .close = nic_close, .reset = NULL, diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index c9323e702..5487486b4 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -46,9 +46,9 @@ #include <86box/thread.h> #include <86box/network.h> #include <86box/net_pcnet.h> -#include <86box/bswap.h> #include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> +#include <86box/bswap.h> /* PCI info. */ #define PCI_VENDID 0x1022 /* AMD */ @@ -2916,8 +2916,7 @@ pcnet_init(const device_t *info) int c; uint16_t checksum; - dev = malloc(sizeof(nic_t)); - memset(dev, 0x00, sizeof(nic_t)); + dev = calloc(1, sizeof(nic_t)); dev->name = info->name; dev->board = info->local & 0xff; diff --git a/src/network/net_plip.c b/src/network/net_plip.c index b1264b045..f80effeec 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -445,8 +445,7 @@ plip_rx(void *priv, uint8_t *buf, int io_len) static void * plip_lpt_init(void *lpt) { - plip_t *dev = (plip_t *) malloc(sizeof(plip_t)); - memset(dev, 0, sizeof(plip_t)); + plip_t *dev = (plip_t *) calloc(1, sizeof(plip_t)); plip_log(1, "PLIP: lpt_init()\n"); diff --git a/src/network/net_rtl8139.c b/src/network/net_rtl8139.c index b9b7fc957..74b041b35 100644 --- a/src/network/net_rtl8139.c +++ b/src/network/net_rtl8139.c @@ -44,10 +44,10 @@ #include <86box/thread.h> #include <86box/network.h> #include <86box/net_eeprom_nmc93cxx.h> -#include <86box/bswap.h> #include <86box/nvr.h> #include "cpu.h" #include <86box/plat_unused.h> +#include <86box/bswap.h> #define PCI_PERIOD 30 /* 30 ns period = 33.333333 Mhz frequency */ @@ -1210,7 +1210,7 @@ rtl8139_CpCmd_read(RTL8139State *s) } static void -rtl8139_IntrMitigate_write(UNUSED(RTL8139State *s), uint32_t val) +rtl8139_IntrMitigate_write(UNUSED(RTL8139State *s), UNUSED(uint32_t val)) { rtl8139_log("C+ IntrMitigate register write(w) val=0x%04x\n", val); } @@ -3151,7 +3151,7 @@ rtl8139_pci_read(UNUSED(int func), int addr, void *priv) } static void -rtl8139_pci_write(int func, int addr, uint8_t val, void *priv) +rtl8139_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) { RTL8139State *s = (RTL8139State *) priv; diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index 22fdc722d..11f1a74b2 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -133,7 +133,7 @@ net_slirp_clock_get_ns(UNUSED(void *opaque)) static void * net_slirp_timer_new(SlirpTimerCb cb, void *cb_opaque, UNUSED(void *opaque)) { - pc_timer_t *timer = malloc(sizeof(pc_timer_t)); + pc_timer_t *timer = calloc(1, sizeof(pc_timer_t)); timer_add(timer, cb, cb_opaque, 0); return timer; } @@ -422,8 +422,7 @@ net_slirp_init(const netcard_t *card, const uint8_t *mac_addr, UNUSED(void *priv #ifndef _WIN32 slirp->pfd_size = 16 * sizeof(struct pollfd); - slirp->pfd = malloc(slirp->pfd_size); - memset(slirp->pfd, 0, slirp->pfd_size); + slirp->pfd = calloc(1, slirp->pfd_size); #endif /* Set the IP addresses to use. */ diff --git a/src/network/net_tulip.c b/src/network/net_tulip.c index af30c5505..2c3aab379 100644 --- a/src/network/net_tulip.c +++ b/src/network/net_tulip.c @@ -32,9 +32,9 @@ #include <86box/thread.h> #include <86box/network.h> #include <86box/net_eeprom_nmc93cxx.h> -#include <86box/bswap.h> #include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> +#include <86box/bswap.h> #define ROM_PATH_DEC21140 "roms/network/dec21140/BIOS13502.BIN" diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index d22b6076c..1e5496851 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -63,7 +63,6 @@ #include <86box/network.h> #include <86box/net_dp8390.h> #include <86box/net_wd8003.h> -#include <86box/bswap.h> #include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> @@ -651,8 +650,7 @@ wd_init(const device_t *info) uint32_t mac; wd_t *dev; - dev = malloc(sizeof(wd_t)); - memset(dev, 0x00, sizeof(wd_t)); + dev = calloc(1, sizeof(wd_t)); dev->name = info->name; dev->board = info->local; diff --git a/src/network/network.c b/src/network/network.c index f4b03ee79..66990e51d 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -96,7 +96,7 @@ static const NETWORK_CARD net_cards[] = { { &ne1000_device }, { &ne2000_device }, { &pcnet_am79c960_eb_device }, - { &rtl8019as_device }, + { &rtl8019as_pnp_device }, { &wd8003e_device }, { &wd8003eb_device }, { &wd8013ebt_device }, diff --git a/src/nvr_ps2.c b/src/nvr_ps2.c index 809083395..3ca0b0ba5 100644 --- a/src/nvr_ps2.c +++ b/src/nvr_ps2.c @@ -114,8 +114,7 @@ ps2_nvr_init(const device_t *info) FILE *fp = NULL; int c; - nvr = (ps2_nvr_t *) malloc(sizeof(ps2_nvr_t)); - memset(nvr, 0x00, sizeof(ps2_nvr_t)); + nvr = (ps2_nvr_t *) calloc(1, sizeof(ps2_nvr_t)); if (info->local) nvr->size = 2048; diff --git a/src/pic.c b/src/pic.c index fa7ff3662..7f6eda40d 100644 --- a/src/pic.c +++ b/src/pic.c @@ -245,7 +245,7 @@ pic_update_pending_at(void) } static void -pic_callback(void *priv) +pic_callback(UNUSED(void *priv)) { update_pending(); } diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 0b40bec90..0198444a0 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -1952,7 +1952,7 @@ read_status(void *priv) static void * escp_init(void *lpt) { - escp_t *dev; + escp_t *dev = NULL; /* Initialize FreeType. */ if (ft_lib == NULL) { @@ -1964,8 +1964,7 @@ escp_init(void *lpt) } /* Initialize a device instance. */ - dev = (escp_t *) malloc(sizeof(escp_t)); - memset(dev, 0x00, sizeof(escp_t)); + dev = (escp_t *) calloc(1, sizeof(escp_t)); dev->ctrl = 0x04; dev->lpt = lpt; diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index dcd018881..1a9d5c0e8 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -366,13 +366,12 @@ ps_read_status(void *priv) static void * ps_init(void *lpt) { - ps_t *dev; + ps_t *dev = (ps_t *) calloc(1, sizeof(ps_t)); gsapi_revision_t rev; - dev = (ps_t *) malloc(sizeof(ps_t)); - memset(dev, 0x00, sizeof(ps_t)); dev->ctrl = 0x04; dev->lpt = lpt; + dev->pcl = false; /* Try loading the DLL. */ ghostscript_handle = dynld_module(PATH_GHOSTSCRIPT_DLL, ghostscript_imports); @@ -415,11 +414,9 @@ ps_init(void *lpt) static void * pcl_init(void *lpt) { - ps_t *dev; + ps_t *dev = (ps_t *) calloc(1, sizeof(ps_t)); gsapi_revision_t rev; - dev = (ps_t *) malloc(sizeof(ps_t)); - memset(dev, 0x00, sizeof(ps_t)); dev->ctrl = 0x04; dev->lpt = lpt; dev->pcl = true; diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index ddf9faf53..e04ef9680 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -421,11 +421,9 @@ read_status(void *priv) static void * prnt_init(void *lpt) { - prnt_t *dev; - /* Initialize a device instance. */ - dev = (prnt_t *) malloc(sizeof(prnt_t)); - memset(dev, 0x00, sizeof(prnt_t)); + prnt_t *dev = (prnt_t *) calloc(1, sizeof(prnt_t)); + dev->ctrl = 0x04; dev->lpt = lpt; diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index d7ea91f70..c08a03016 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -189,6 +189,7 @@ add_library(ui STATIC qt_mediahistorymanager.hpp ../qt_resources.qrc + ./qdarkstyle/dark/darkstyle.qrc ) if(RTMIDI) @@ -203,6 +204,7 @@ if(WIN32) enable_language(RC) target_sources(86Box PUBLIC 86Box-qt.rc) target_sources(plat PRIVATE win_dynld.c) + target_link_libraries(86Box dwmapi) # CMake 3.22 messed this up for clang/clang++ # See https://gitlab.kitware.com/cmake/cmake/-/issues/22611 diff --git a/src/qt/dummy_cdrom_ioctl.c b/src/qt/dummy_cdrom_ioctl.c index ae4eb1727..bddfabb5b 100644 --- a/src/qt/dummy_cdrom_ioctl.c +++ b/src/qt/dummy_cdrom_ioctl.c @@ -40,7 +40,6 @@ typedef struct ioctl_t { cdrom_t *dev; void *log; - int toc_valid; void *handle; char path[256]; } ioctl_t; @@ -77,8 +76,6 @@ ioctl_open_handle(UNUSED(ioctl_t *ioctl)) static void ioctl_read_toc(ioctl_t *ioctl) { - if (!ioctl->toc_valid) - ioctl->toc_valid = 1; } /* Shared functions. */ @@ -97,7 +94,7 @@ ioctl_get_raw_track_info(UNUSED(const void *local), int *num, uint8_t *rti) } static int -ioctl_is_track_pre(const void *local, const uint32_t sector) +ioctl_is_track_pre(const void *local, UNUSED(const uint32_t sector)) { ioctl_t *ioctl = (ioctl_t *) local; @@ -111,7 +108,7 @@ ioctl_is_track_pre(const void *local, const uint32_t sector) } static int -ioctl_read_sector(const void *local, uint8_t *buffer, uint32_t const sector) +ioctl_read_sector(const void *local, UNUSED(uint8_t *buffer), UNUSED(uint32_t const sector)) { ioctl_t *ioctl = (ioctl_t *) local; @@ -159,6 +156,12 @@ ioctl_has_audio(UNUSED(const void *local)) return 0; } +static int +ioctl_is_empty(const void *local) +{ + return 1; +} + static int ioctl_ext_medium_changed(UNUSED(void *local)) { @@ -186,6 +189,18 @@ ioctl_close(void *local) ioctl->log = NULL; } +static void +ioctl_load(const void *local) +{ + const ioctl_t *ioctl = (const ioctl_t *) local; + + if (ioctl_open_handle((ioctl_t *) ioctl)) { + ioctl_close_handle((ioctl_t *) ioctl); + + ioctl_read_toc((ioctl_t *) ioctl); + } +} + static const cdrom_ops_t ioctl_ops = { ioctl_get_track_info, ioctl_get_raw_track_info, @@ -196,8 +211,9 @@ static const cdrom_ops_t ioctl_ops = { ioctl_read_dvd_structure, ioctl_is_dvd, ioctl_has_audio, - ioctl_ext_medium_changed, - ioctl_close + ioctl_is_empty, + ioctl_close, + ioctl_load }; /* Public functions. */ @@ -218,7 +234,6 @@ ioctl_open(cdrom_t *dev, const char *drv) ioctl_log(ioctl->log, "Path is %s\n", ioctl->path); ioctl->dev = dev; - ioctl->toc_valid = 0; dev->ops = &ioctl_ops; } diff --git a/src/qt/qdarkstyle/dark/darkstyle.qrc b/src/qt/qdarkstyle/dark/darkstyle.qrc new file mode 100644 index 000000000..ce0d85be6 --- /dev/null +++ b/src/qt/qdarkstyle/dark/darkstyle.qrc @@ -0,0 +1,216 @@ + + + + rc/arrow_down.png + rc/arrow_down@2x.png + rc/arrow_down_disabled.png + rc/arrow_down_disabled@2x.png + rc/arrow_down_focus.png + rc/arrow_down_focus@2x.png + rc/arrow_down_pressed.png + rc/arrow_down_pressed@2x.png + rc/arrow_left.png + rc/arrow_left@2x.png + rc/arrow_left_disabled.png + rc/arrow_left_disabled@2x.png + rc/arrow_left_focus.png + rc/arrow_left_focus@2x.png + rc/arrow_left_pressed.png + rc/arrow_left_pressed@2x.png + rc/arrow_right.png + rc/arrow_right@2x.png + rc/arrow_right_disabled.png + rc/arrow_right_disabled@2x.png + rc/arrow_right_focus.png + rc/arrow_right_focus@2x.png + rc/arrow_right_pressed.png + rc/arrow_right_pressed@2x.png + rc/arrow_up.png + rc/arrow_up@2x.png + rc/arrow_up_disabled.png + rc/arrow_up_disabled@2x.png + rc/arrow_up_focus.png + rc/arrow_up_focus@2x.png + rc/arrow_up_pressed.png + rc/arrow_up_pressed@2x.png + rc/base_icon.png + rc/base_icon@2x.png + rc/base_icon_disabled.png + rc/base_icon_disabled@2x.png + rc/base_icon_focus.png + rc/base_icon_focus@2x.png + rc/base_icon_pressed.png + rc/base_icon_pressed@2x.png + rc/branch_closed.png + rc/branch_closed@2x.png + rc/branch_closed_disabled.png + rc/branch_closed_disabled@2x.png + rc/branch_closed_focus.png + rc/branch_closed_focus@2x.png + rc/branch_closed_pressed.png + rc/branch_closed_pressed@2x.png + rc/branch_end.png + rc/branch_end@2x.png + rc/branch_end_disabled.png + rc/branch_end_disabled@2x.png + rc/branch_end_focus.png + rc/branch_end_focus@2x.png + rc/branch_end_pressed.png + rc/branch_end_pressed@2x.png + rc/branch_line.png + rc/branch_line@2x.png + rc/branch_line_disabled.png + rc/branch_line_disabled@2x.png + rc/branch_line_focus.png + rc/branch_line_focus@2x.png + rc/branch_line_pressed.png + rc/branch_line_pressed@2x.png + rc/branch_more.png + rc/branch_more@2x.png + rc/branch_more_disabled.png + rc/branch_more_disabled@2x.png + rc/branch_more_focus.png + rc/branch_more_focus@2x.png + rc/branch_more_pressed.png + rc/branch_more_pressed@2x.png + rc/branch_open.png + rc/branch_open@2x.png + rc/branch_open_disabled.png + rc/branch_open_disabled@2x.png + rc/branch_open_focus.png + rc/branch_open_focus@2x.png + rc/branch_open_pressed.png + rc/branch_open_pressed@2x.png + rc/checkbox_checked.png + rc/checkbox_checked@2x.png + rc/checkbox_checked_disabled.png + rc/checkbox_checked_disabled@2x.png + rc/checkbox_checked_focus.png + rc/checkbox_checked_focus@2x.png + rc/checkbox_checked_pressed.png + rc/checkbox_checked_pressed@2x.png + rc/checkbox_indeterminate.png + rc/checkbox_indeterminate@2x.png + rc/checkbox_indeterminate_disabled.png + rc/checkbox_indeterminate_disabled@2x.png + rc/checkbox_indeterminate_focus.png + rc/checkbox_indeterminate_focus@2x.png + rc/checkbox_indeterminate_pressed.png + rc/checkbox_indeterminate_pressed@2x.png + rc/checkbox_unchecked.png + rc/checkbox_unchecked@2x.png + rc/checkbox_unchecked_disabled.png + rc/checkbox_unchecked_disabled@2x.png + rc/checkbox_unchecked_focus.png + rc/checkbox_unchecked_focus@2x.png + rc/checkbox_unchecked_pressed.png + rc/checkbox_unchecked_pressed@2x.png + rc/line_horizontal.png + rc/line_horizontal@2x.png + rc/line_horizontal_disabled.png + rc/line_horizontal_disabled@2x.png + rc/line_horizontal_focus.png + rc/line_horizontal_focus@2x.png + rc/line_horizontal_pressed.png + rc/line_horizontal_pressed@2x.png + rc/line_vertical.png + rc/line_vertical@2x.png + rc/line_vertical_disabled.png + rc/line_vertical_disabled@2x.png + rc/line_vertical_focus.png + rc/line_vertical_focus@2x.png + rc/line_vertical_pressed.png + rc/line_vertical_pressed@2x.png + rc/radio_checked.png + rc/radio_checked@2x.png + rc/radio_checked_disabled.png + rc/radio_checked_disabled@2x.png + rc/radio_checked_focus.png + rc/radio_checked_focus@2x.png + rc/radio_checked_pressed.png + rc/radio_checked_pressed@2x.png + rc/radio_unchecked.png + rc/radio_unchecked@2x.png + rc/radio_unchecked_disabled.png + rc/radio_unchecked_disabled@2x.png + rc/radio_unchecked_focus.png + rc/radio_unchecked_focus@2x.png + rc/radio_unchecked_pressed.png + rc/radio_unchecked_pressed@2x.png + rc/toolbar_move_horizontal.png + rc/toolbar_move_horizontal@2x.png + rc/toolbar_move_horizontal_disabled.png + rc/toolbar_move_horizontal_disabled@2x.png + rc/toolbar_move_horizontal_focus.png + rc/toolbar_move_horizontal_focus@2x.png + rc/toolbar_move_horizontal_pressed.png + rc/toolbar_move_horizontal_pressed@2x.png + rc/toolbar_move_vertical.png + rc/toolbar_move_vertical@2x.png + rc/toolbar_move_vertical_disabled.png + rc/toolbar_move_vertical_disabled@2x.png + rc/toolbar_move_vertical_focus.png + rc/toolbar_move_vertical_focus@2x.png + rc/toolbar_move_vertical_pressed.png + rc/toolbar_move_vertical_pressed@2x.png + rc/toolbar_separator_horizontal.png + rc/toolbar_separator_horizontal@2x.png + rc/toolbar_separator_horizontal_disabled.png + rc/toolbar_separator_horizontal_disabled@2x.png + rc/toolbar_separator_horizontal_focus.png + rc/toolbar_separator_horizontal_focus@2x.png + rc/toolbar_separator_horizontal_pressed.png + rc/toolbar_separator_horizontal_pressed@2x.png + rc/toolbar_separator_vertical.png + rc/toolbar_separator_vertical@2x.png + rc/toolbar_separator_vertical_disabled.png + rc/toolbar_separator_vertical_disabled@2x.png + rc/toolbar_separator_vertical_focus.png + rc/toolbar_separator_vertical_focus@2x.png + rc/toolbar_separator_vertical_pressed.png + rc/toolbar_separator_vertical_pressed@2x.png + rc/transparent.png + rc/transparent@2x.png + rc/transparent_disabled.png + rc/transparent_disabled@2x.png + rc/transparent_focus.png + rc/transparent_focus@2x.png + rc/transparent_pressed.png + rc/transparent_pressed@2x.png + rc/window_close.png + rc/window_close@2x.png + rc/window_close_disabled.png + rc/window_close_disabled@2x.png + rc/window_close_focus.png + rc/window_close_focus@2x.png + rc/window_close_pressed.png + rc/window_close_pressed@2x.png + rc/window_grip.png + rc/window_grip@2x.png + rc/window_grip_disabled.png + rc/window_grip_disabled@2x.png + rc/window_grip_focus.png + rc/window_grip_focus@2x.png + rc/window_grip_pressed.png + rc/window_grip_pressed@2x.png + rc/window_minimize.png + rc/window_minimize@2x.png + rc/window_minimize_disabled.png + rc/window_minimize_disabled@2x.png + rc/window_minimize_focus.png + rc/window_minimize_focus@2x.png + rc/window_minimize_pressed.png + rc/window_minimize_pressed@2x.png + rc/window_undock.png + rc/window_undock@2x.png + rc/window_undock_disabled.png + rc/window_undock_disabled@2x.png + rc/window_undock_focus.png + rc/window_undock_focus@2x.png + rc/window_undock_pressed.png + rc/window_undock_pressed@2x.png + + + darkstyle.qss + + diff --git a/src/qt/qdarkstyle/dark/darkstyle.qss b/src/qt/qdarkstyle/dark/darkstyle.qss new file mode 100644 index 000000000..6e1ec4b06 --- /dev/null +++ b/src/qt/qdarkstyle/dark/darkstyle.qss @@ -0,0 +1,2214 @@ +/* --------------------------------------------------------------------------- + + WARNING! File created programmatically. All changes made in this file will be lost! + + Created by the qtsass compiler v0.4.0 + + The definitions are in the "qdarkstyle.qss._styles.scss" module + +--------------------------------------------------------------------------- */ +/* Light Style - QDarkStyleSheet ------------------------------------------ */ +/* + +See Qt documentation: + + - https://doc.qt.io/qt-5/stylesheet.html + - https://doc.qt.io/qt-5/stylesheet-reference.html + - https://doc.qt.io/qt-5/stylesheet-examples.html + +--------------------------------------------------------------------------- */ +/* Reset elements ------------------------------------------------------------ + +Resetting everything helps to unify styles across different operating systems + +--------------------------------------------------------------------------- */ + +/* Changed to be fully grayscale. */ + +* { + padding: 0px; + margin: 0px; + border: 0px; + border-style: none; + border-image: none; + outline: 0; +} + +/* specific reset for elements inside QToolBar */ +QToolBar * { + margin: 0px; + padding: 0px; +} + +/* QWidget ---------------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QWidget { + background-color: #272727; + border: 0px solid #525252; + padding: 0px; + color: #E3E3E3; + selection-background-color: #616161; + selection-color: #E3E3E3; +} + +QWidget:disabled { + background-color: #272727; + color: #8B8B8B; + selection-background-color: #444444; + selection-color: #8B8B8B; +} + +QWidget::item:selected { + background-color: #616161; +} + +QWidget::item:hover:!selected { + background-color: #666666; +} + +/* QMainWindow ------------------------------------------------------------ + +This adjusts the splitter in the dock widget, not qsplitter +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmainwindow + +--------------------------------------------------------------------------- */ +QMainWindow::separator { + background-color: #525252; + border: 0px solid #272727; + spacing: 0px; + padding: 2px; +} + +QMainWindow::separator:hover { + background-color: #767676; + border: 0px solid #666666; +} + +QMainWindow::separator:horizontal { + width: 5px; + margin-top: 2px; + margin-bottom: 2px; + image: url(":/qss_icons/dark/rc/toolbar_separator_vertical.png"); +} + +QMainWindow::separator:vertical { + height: 5px; + margin-left: 2px; + margin-right: 2px; + image: url(":/qss_icons/dark/rc/toolbar_separator_horizontal.png"); +} + +/* QToolTip --------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtooltip + +--------------------------------------------------------------------------- */ +QToolTip { + background-color: #616161; + color: #E3E3E3; + /* If you remove the border property, background stops working on Windows */ + border: none; + /* Remove padding, for fix combo box tooltip */ + padding: 0px; + /* Remove opacity, fix #174 - may need to use RGBA */ +} + +/* QStatusBar ------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qstatusbar + +--------------------------------------------------------------------------- */ +QStatusBar { + border: 1px solid #272727; + /* Fixes Spyder #9120, #9121 */ + background: #272727; + /* Fixes #205, white vertical borders separating items */ +} + +QStatusBar::item { + border: none; +} + +QStatusBar QToolTip { + background-color: #666666; + border: 1px solid #272727; + color: #272727; + /* Remove padding, for fix combo box tooltip */ + padding: 0px; + /* Reducing transparency to read better */ + opacity: 230; +} + +QStatusBar QLabel { + /* Fixes Spyder #9120, #9121 */ + background: transparent; + padding: 0px; +} + +/* QCheckBox -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcheckbox + +--------------------------------------------------------------------------- */ +QCheckBox { + background-color: #272727; + color: #E3E3E3; + spacing: 4px; + outline: none; + padding-top: 4px; + padding-bottom: 4px; +} + +QCheckBox:focus { + border: none; +} + +QCheckBox QWidget:disabled { + background-color: #272727; + color: #8B8B8B; +} + +QCheckBox::indicator { + margin-left: 2px; + height: 14px; + width: 14px; +} + +QCheckBox::indicator:unchecked { + image: url(":/qss_icons/dark/rc/checkbox_unchecked.png"); +} + +QCheckBox::indicator:unchecked:hover, QCheckBox::indicator:unchecked:focus, QCheckBox::indicator:unchecked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_unchecked_focus.png"); +} + +QCheckBox::indicator:unchecked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_unchecked_disabled.png"); +} + +QCheckBox::indicator:checked { + image: url(":/qss_icons/dark/rc/checkbox_checked.png"); +} + +QCheckBox::indicator:checked:hover, QCheckBox::indicator:checked:focus, QCheckBox::indicator:checked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_checked_focus.png"); +} + +QCheckBox::indicator:checked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_checked_disabled.png"); +} + +QCheckBox::indicator:indeterminate { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate.png"); +} + +QCheckBox::indicator:indeterminate:disabled { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate_disabled.png"); +} + +QCheckBox::indicator:indeterminate:focus, QCheckBox::indicator:indeterminate:hover, QCheckBox::indicator:indeterminate:pressed { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate_focus.png"); +} + +/* QGroupBox -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qgroupbox + +--------------------------------------------------------------------------- */ +QGroupBox { + font-weight: bold; + border: 1px solid #525252; + border-radius: 4px; + padding: 2px; + margin-top: 6px; + margin-bottom: 4px; +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: top left; + left: 4px; + padding-left: 2px; + padding-right: 4px; + padding-top: -4px; +} + +QGroupBox::indicator { + margin-left: 2px; + margin-top: 2px; + padding: 0; + height: 14px; + width: 14px; +} + +QGroupBox::indicator:unchecked { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_unchecked.png"); +} + +QGroupBox::indicator:unchecked:hover, QGroupBox::indicator:unchecked:focus, QGroupBox::indicator:unchecked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_unchecked_focus.png"); +} + +QGroupBox::indicator:unchecked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_unchecked_disabled.png"); +} + +QGroupBox::indicator:checked { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_checked.png"); +} + +QGroupBox::indicator:checked:hover, QGroupBox::indicator:checked:focus, QGroupBox::indicator:checked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_checked_focus.png"); +} + +QGroupBox::indicator:checked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_checked_disabled.png"); +} + +/* QRadioButton ----------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qradiobutton + +--------------------------------------------------------------------------- */ +QRadioButton { + background-color: #272727; + color: #E3E3E3; + spacing: 4px; + padding-top: 4px; + padding-bottom: 4px; + border: none; + outline: none; +} + +QRadioButton:focus { + border: none; +} + +QRadioButton:disabled { + background-color: #272727; + color: #8B8B8B; + border: none; + outline: none; +} + +QRadioButton QWidget { + background-color: #272727; + color: #E3E3E3; + spacing: 0px; + padding: 0px; + outline: none; + border: none; +} + +QRadioButton::indicator { + border: none; + outline: none; + margin-left: 2px; + height: 14px; + width: 14px; +} + +QRadioButton::indicator:unchecked { + image: url(":/qss_icons/dark/rc/radio_unchecked.png"); +} + +QRadioButton::indicator:unchecked:hover, QRadioButton::indicator:unchecked:focus, QRadioButton::indicator:unchecked:pressed { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_unchecked_focus.png"); +} + +QRadioButton::indicator:unchecked:disabled { + image: url(":/qss_icons/dark/rc/radio_unchecked_disabled.png"); +} + +QRadioButton::indicator:checked { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked.png"); +} + +QRadioButton::indicator:checked:hover, QRadioButton::indicator:checked:focus, QRadioButton::indicator:checked:pressed { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked_focus.png"); +} + +QRadioButton::indicator:checked:disabled { + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked_disabled.png"); +} + +/* QMenuBar --------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmenubar + +--------------------------------------------------------------------------- */ +QMenuBar { + background-color: #272727; + padding: 2px; + border: 1px solid #525252; + color: #E3E3E3; + selection-background-color: #666666; +} + +QMenuBar:focus { + border: 1px solid #616161; +} + +QMenuBar::item { + background: transparent; + padding-left: 7px; + padding-right: 7px; +} + +QMenuBar::item:selected { + padding: 4px; + background: transparent; + border: 0px solid #525252; + background-color: #383838; +} + +QMenuBar::item:pressed { + padding: 4px; + border: 0px solid #525252; + background-color: #383838; + color: #E3E3E3; +} + +/* QMenu ------------------------------------------------------------------ + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmenu + +--------------------------------------------------------------------------- */ +QMenu { + border: 0px solid #525252; + color: #E3E3E3; + margin: 0px; + background-color: #2C2C2C; + selection-background-color: #666666; +} + +QMenu::separator { + height: 1px; + background-color: #767676; + color: #E3E3E3; +} + +QMenu::item { + background-color: #2C2C2C; + padding: 4px 24px 4px 28px; + /* Reserve space for selection border */ + border: 1px transparent #525252; +} + +QMenu::item:selected { + color: #E3E3E3; + background-color: #353535; +} + +QMenu::item:pressed { + background-color: #353535; +} + +QMenu::icon { + padding-left: 10px; + width: 14px; + height: 14px; +} + +QMenu::indicator { + padding-left: 8px; + width: 12px; + height: 12px; + /* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */ + /* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */ +} + +QMenu::indicator:non-exclusive:unchecked { + image: url(":/qss_icons/dark/rc/checkbox_unchecked.png"); +} + +QMenu::indicator:non-exclusive:unchecked:hover, QMenu::indicator:non-exclusive:unchecked:focus, QMenu::indicator:non-exclusive:unchecked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_unchecked_focus.png"); +} + +QMenu::indicator:non-exclusive:unchecked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_unchecked_disabled.png"); +} + +QMenu::indicator:non-exclusive:checked { + image: url(":/qss_icons/dark/rc/checkbox_checked.png"); +} + +QMenu::indicator:non-exclusive:checked:hover, QMenu::indicator:non-exclusive:checked:focus, QMenu::indicator:non-exclusive:checked:pressed { + border: none; + image: url(":/qss_icons/dark/rc/checkbox_checked_focus.png"); +} + +QMenu::indicator:non-exclusive:checked:disabled { + image: url(":/qss_icons/dark/rc/checkbox_checked_disabled.png"); +} + +QMenu::indicator:non-exclusive:indeterminate { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate.png"); +} + +QMenu::indicator:non-exclusive:indeterminate:disabled { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate_disabled.png"); +} + +QMenu::indicator:non-exclusive:indeterminate:focus, QMenu::indicator:non-exclusive:indeterminate:hover, QMenu::indicator:non-exclusive:indeterminate:pressed { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate_focus.png"); +} + +QMenu::indicator:exclusive:unchecked { + image: url(":/qss_icons/dark/rc/radio_unchecked.png"); +} + +QMenu::indicator:exclusive:unchecked:hover, QMenu::indicator:exclusive:unchecked:focus, QMenu::indicator:exclusive:unchecked:pressed { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_unchecked_focus.png"); +} + +QMenu::indicator:exclusive:unchecked:disabled { + image: url(":/qss_icons/dark/rc/radio_unchecked_disabled.png"); +} + +QMenu::indicator:exclusive:checked { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked.png"); +} + +QMenu::indicator:exclusive:checked:hover, QMenu::indicator:exclusive:checked:focus, QMenu::indicator:exclusive:checked:pressed { + border: none; + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked_focus.png"); +} + +QMenu::indicator:exclusive:checked:disabled { + outline: none; + image: url(":/qss_icons/dark/rc/radio_checked_disabled.png"); +} + +QMenu::right-arrow { + margin: 5px; + padding-left: 12px; + image: url(":/qss_icons/dark/rc/arrow_right.png"); + height: 12px; + width: 12px; +} + +/* QAbstractItemView ------------------------------------------------------ + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox + +--------------------------------------------------------------------------- */ +QAbstractItemView { + alternate-background-color: #272727; + color: #E3E3E3; + border: 1px solid #525252; + border-radius: 4px; +} + +QAbstractItemView QLineEdit { + padding: 2px; +} + +/* QAbstractScrollArea ---------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qabstractscrollarea + +--------------------------------------------------------------------------- */ +QAbstractScrollArea { + background-color: #272727; + border: 1px solid #525252; + border-radius: 4px; + /* fix #159 */ + padding: 2px; + /* remove min-height to fix #244 */ + color: #E3E3E3; +} + +QAbstractScrollArea:disabled { + color: #8B8B8B; +} + +/* QScrollArea ------------------------------------------------------------ + +--------------------------------------------------------------------------- */ +QScrollArea QWidget QWidget:disabled { + background-color: #272727; +} + +/* QScrollBar ------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qscrollbar + +--------------------------------------------------------------------------- */ +QScrollBar:horizontal { + height: 16px; + margin: 2px 16px 2px 16px; + border: 1px solid #525252; + border-radius: 4px; + background-color: #272727; +} + +QScrollBar:vertical { + background-color: #272727; + width: 16px; + margin: 16px 2px 16px 2px; + border: 1px solid #525252; + border-radius: 4px; +} + +QScrollBar::handle:horizontal { + background-color: #767676; + border: 1px solid #525252; + border-radius: 4px; + min-width: 8px; +} + +QScrollBar::handle:horizontal:hover { + background-color: #616161; + border: #616161; + border-radius: 4px; + min-width: 8px; +} + +QScrollBar::handle:horizontal:focus { + border: 1px solid #666666; +} + +QScrollBar::handle:vertical { + background-color: #767676; + border: 1px solid #525252; + min-height: 8px; + border-radius: 4px; +} + +QScrollBar::handle:vertical:hover { + background-color: #616161; + border: #616161; + border-radius: 4px; + min-height: 8px; +} + +QScrollBar::handle:vertical:focus { + border: 1px solid #666666; +} + +QScrollBar::add-line:horizontal { + margin: 0px 0px 0px 0px; + border-image: url(":/qss_icons/dark/rc/arrow_right_disabled.png"); + height: 12px; + width: 12px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::add-line:horizontal:hover, QScrollBar::add-line:horizontal:on { + border-image: url(":/qss_icons/dark/rc/arrow_right.png"); + height: 12px; + width: 12px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::add-line:vertical { + margin: 3px 0px 3px 0px; + border-image: url(":/qss_icons/dark/rc/arrow_down_disabled.png"); + height: 12px; + width: 12px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::add-line:vertical:hover, QScrollBar::add-line:vertical:on { + border-image: url(":/qss_icons/dark/rc/arrow_down.png"); + height: 12px; + width: 12px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal { + margin: 0px 3px 0px 3px; + border-image: url(":/qss_icons/dark/rc/arrow_left_disabled.png"); + height: 12px; + width: 12px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal:hover, QScrollBar::sub-line:horizontal:on { + border-image: url(":/qss_icons/dark/rc/arrow_left.png"); + height: 12px; + width: 12px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:vertical { + margin: 3px 0px 3px 0px; + border-image: url(":/qss_icons/dark/rc/arrow_up_disabled.png"); + height: 12px; + width: 12px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:vertical:hover, QScrollBar::sub-line:vertical:on { + border-image: url(":/qss_icons/dark/rc/arrow_up.png"); + height: 12px; + width: 12px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal { + background: none; +} + +QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { + background: none; +} + +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; +} + +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} + +/* QTextEdit -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-specific-widgets + +--------------------------------------------------------------------------- */ +QTextEdit { + background-color: #272727; + color: #E3E3E3; + border-radius: 4px; + border: 1px solid #525252; +} + +QTextEdit:focus { + border: 1px solid #666666; +} + +QTextEdit:selected { + background: #616161; + color: #525252; +} + +/* QPlainTextEdit --------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QPlainTextEdit { + background-color: #272727; + color: #E3E3E3; + border-radius: 4px; + border: 1px solid #525252; +} + +QPlainTextEdit:focus { + border: 1px solid #666666; +} + +QPlainTextEdit:selected { + background: #616161; + color: #525252; +} + +/* QSizeGrip -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qsizegrip + +--------------------------------------------------------------------------- */ +QSizeGrip { + background: transparent; + width: 12px; + height: 12px; + image: url(":/qss_icons/dark/rc/window_grip.png"); +} + +/* QToolBar --------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbar + +--------------------------------------------------------------------------- */ +QToolBar { + background-color: #272727; + border-bottom: 1px solid #272727; + padding: 1px; + font-weight: bold; +} + +QToolBar:disabled { + /* Fixes #272 */ + background-color: #272727; +} + +QToolBar::handle:horizontal { + width: 16px; + image: url(":/qss_icons/dark/rc/toolbar_move_horizontal.png"); +} + +QToolBar::handle:vertical { + height: 16px; + image: url(":/qss_icons/dark/rc/toolbar_move_vertical.png"); +} + +QToolBar::separator:horizontal { + width: 16px; + image: url(":/qss_icons/dark/rc/toolbar_separator_horizontal.png"); +} + +QToolBar::separator:vertical { + height: 16px; + image: url(":/qss_icons/dark/rc/toolbar_separator_vertical.png"); +} + +QToolButton#qt_toolbar_ext_button { + background: #272727; + border: 0px; + color: #E3E3E3; + image: url(":/qss_icons/dark/rc/arrow_right.png"); +} + +/* QAbstractSpinBox ------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QAbstractSpinBox { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + /* This fixes 103, 111 */ + padding-top: 2px; + /* This fixes 103, 111 */ + padding-bottom: 2px; + padding-left: 4px; + padding-right: 4px; + border-radius: 4px; + /* min-width: 5px; removed to fix 109 */ +} + +QAbstractSpinBox:up-button { + background-color: transparent #272727; + subcontrol-origin: border; + subcontrol-position: top right; + border-left: 1px solid #525252; + border-bottom: 1px solid #525252; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin: 1px; + width: 12px; + margin-bottom: -1px; +} + +QAbstractSpinBox::up-arrow, QAbstractSpinBox::up-arrow:disabled, QAbstractSpinBox::up-arrow:off { + image: url(":/qss_icons/dark/rc/arrow_up_disabled.png"); + height: 8px; + width: 8px; +} + +QAbstractSpinBox::up-arrow:hover { + image: url(":/qss_icons/dark/rc/arrow_up.png"); +} + +QAbstractSpinBox:down-button { + background-color: transparent #272727; + subcontrol-origin: border; + subcontrol-position: bottom right; + border-left: 1px solid #525252; + border-top: 1px solid #525252; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin: 1px; + width: 12px; + margin-top: -1px; +} + +QAbstractSpinBox::down-arrow, QAbstractSpinBox::down-arrow:disabled, QAbstractSpinBox::down-arrow:off { + image: url(":/qss_icons/dark/rc/arrow_down_disabled.png"); + height: 8px; + width: 8px; +} + +QAbstractSpinBox::down-arrow:hover { + image: url(":/qss_icons/dark/rc/arrow_down.png"); +} + +QAbstractSpinBox:hover { + border: 1px solid #616161; + color: #E3E3E3; +} + +QAbstractSpinBox:focus { + border: 1px solid #666666; +} + +QAbstractSpinBox:selected { + background: #616161; + color: #525252; +} + +/* ------------------------------------------------------------------------ */ +/* DISPLAYS --------------------------------------------------------------- */ +/* ------------------------------------------------------------------------ */ +/* QLabel ----------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe + +--------------------------------------------------------------------------- */ +QLabel { + background-color: #272727; + border: 0px solid #525252; + padding: 2px; + margin: 0px; + color: #E3E3E3; +} + +QLabel:disabled { + background-color: #272727; + border: 0px solid #525252; + color: #8B8B8B; +} + +/* QTextBrowser ----------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qabstractscrollarea + +--------------------------------------------------------------------------- */ +QTextBrowser { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + border-radius: 4px; +} + +QTextBrowser:disabled { + background-color: #272727; + border: 1px solid #525252; + color: #8B8B8B; + border-radius: 4px; +} + +QTextBrowser:hover, QTextBrowser:!hover, QTextBrowser:selected, QTextBrowser:pressed { + border: 1px solid #525252; +} + +/* QGraphicsView ---------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QGraphicsView { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + border-radius: 4px; +} + +QGraphicsView:disabled { + background-color: #272727; + border: 1px solid #525252; + color: #8B8B8B; + border-radius: 4px; +} + +QGraphicsView:hover, QGraphicsView:!hover, QGraphicsView:selected, QGraphicsView:pressed { + border: 1px solid #525252; +} + +/* QCalendarWidget -------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QCalendarWidget { + border: 1px solid #525252; + border-radius: 4px; +} + +QCalendarWidget:disabled { + background-color: #272727; + color: #8B8B8B; +} + +/* QLCDNumber ------------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QLCDNumber { + background-color: #272727; + color: #E3E3E3; +} + +QLCDNumber:disabled { + background-color: #272727; + color: #8B8B8B; +} + +/* QProgressBar ----------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qprogressbar + +--------------------------------------------------------------------------- */ +QProgressBar { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + border-radius: 4px; + text-align: center; +} + +QProgressBar:disabled { + background-color: #272727; + border: 1px solid #525252; + color: #8B8B8B; + border-radius: 4px; + text-align: center; +} + +QProgressBar::chunk { + background-color: #616161; + color: #272727; + border-radius: 4px; +} + +QProgressBar::chunk:disabled { + background-color: #444444; + color: #8B8B8B; + border-radius: 4px; +} + +/* ------------------------------------------------------------------------ */ +/* BUTTONS ---------------------------------------------------------------- */ +/* ------------------------------------------------------------------------ */ +/* QPushButton ------------------------------------------------------------ + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qpushbutton + +--------------------------------------------------------------------------- */ +QPushButton { + background-color: #333333; + color: #E3E3E3; + border-radius: 4px; + padding: 4px; + outline: none; + border: 1px solid white; +} + +QPushButton:disabled { + background-color: #333333; + color: #8B8B8B; + border-radius: 4px; + padding: 4px; + border: 1px solid #9B9B9B; +} + +QPushButton:checked { + background-color: #666666; + border-radius: 4px; + padding: 4px; + outline: none; +} + +QPushButton:checked:disabled { + background-color: #525252; + color: #8B8B8B; + border-radius: 4px; + padding: 4px; + outline: none; +} + +QPushButton:checked:selected { + background: #454545; +} + +QPushButton:hover { + background-color: #454545; + color: #E3E3E3; + border: 1px solid #9B9B9B; +} + +QPushButton:pressed { + background-color: #666666; + border: 1px solid #9B9B9B; +} + +QPushButton:selected { + background: #333333; + color: #E3E3E3; +} + +QPushButton::menu-indicator { + subcontrol-origin: padding; + subcontrol-position: bottom right; + bottom: 4px; +} + +QDialogButtonBox QPushButton { + /* Issue #194 #248 - Special case of QPushButton inside dialogs, for better UI */ + min-width: 80px; +} + +/* QToolButton ------------------------------------------------------------ + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbutton + +--------------------------------------------------------------------------- */ +QToolButton { + background-color: #272727; + color: #E3E3E3; + border-radius: 4px; + padding: 2px; + outline: none; + border: none; + /* The subcontrols below are used only in the DelayedPopup mode */ + /* The subcontrols below are used only in the MenuButtonPopup mode */ + /* The subcontrol below is used only in the InstantPopup or DelayedPopup mode */ +} + +QToolButton:disabled { + background-color: #272727; + color: #8B8B8B; + border-radius: 4px; + padding: 2px; +} + +QToolButton:checked { + background-color: #767676; + border-radius: 4px; + padding: 2px; + outline: none; +} + +QToolButton:checked:disabled { + background-color: #767676; + color: #8B8B8B; + border-radius: 4px; + padding: 2px; + outline: none; +} + +QToolButton:checked:hover { + background-color: #666666; + color: #E3E3E3; +} + +QToolButton:checked:pressed { + background-color: #767676; +} + +QToolButton:checked:selected { + background: #767676; + color: #E3E3E3; +} + +QToolButton:hover { + background-color: #666666; + color: #E3E3E3; +} + +QToolButton:pressed { + background-color: #767676; +} + +QToolButton:selected { + background: #767676; + color: #E3E3E3; +} + +QToolButton[popupMode="0"] { + /* Only for DelayedPopup */ + padding-right: 2px; +} + +QToolButton[popupMode="1"] { + /* Only for MenuButtonPopup */ + padding-right: 20px; +} + +QToolButton[popupMode="1"]::menu-button { + border: none; +} + +QToolButton[popupMode="1"]::menu-button:hover { + border: none; + border-left: 1px solid #525252; + border-radius: 0; +} + +QToolButton[popupMode="2"] { + /* Only for InstantPopup */ + padding-right: 2px; +} + +QToolButton::menu-button { + padding: 2px; + border-radius: 4px; + width: 12px; + border: none; + outline: none; +} + +QToolButton::menu-button:hover { + border: 1px solid #616161; +} + +QToolButton::menu-button:checked:hover { + border: 1px solid #616161; +} + +QToolButton::menu-indicator { + image: url(":/qss_icons/dark/rc/arrow_down.png"); + height: 8px; + width: 8px; + top: 0; + /* Exclude a shift for better image */ + left: -2px; + /* Shift it a bit */ +} + +QToolButton::menu-arrow { + image: url(":/qss_icons/dark/rc/arrow_down.png"); + height: 8px; + width: 8px; +} + +QToolButton::menu-arrow:hover { + image: url(":/qss_icons/dark/rc/arrow_down_focus.png"); +} + +/* QCommandLinkButton ----------------------------------------------------- + +--------------------------------------------------------------------------- */ +QCommandLinkButton { + background-color: transparent; + border: 1px solid #525252; + color: #E3E3E3; + border-radius: 4px; + padding: 0px; + margin: 0px; +} + +QCommandLinkButton:disabled { + background-color: transparent; + color: #8B8B8B; +} + +/* ------------------------------------------------------------------------ */ +/* INPUTS - NO FIELDS ----------------------------------------------------- */ +/* ------------------------------------------------------------------------ */ +/* QComboBox -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox + +--------------------------------------------------------------------------- */ +QComboBox { + border: 1px solid #525252; + border-radius: 4px; + selection-background-color: #616161; + padding-left: 4px; + padding-right: 4px; + /* padding-right = 36; 4 + 16*2 See scrollbar size */ + /* changed to 4px to fix #239 */ + /* Fixes #103, #111 */ + min-height: 1.5em; + /* padding-top: 2px; removed to fix #132 */ + /* padding-bottom: 2px; removed to fix #132 */ + /* min-width: 75px; removed to fix #109 */ + /* Needed to remove indicator - fix #132 */ +} + +QComboBox QAbstractItemView { + border: 1px solid #525252; + border-radius: 0; + background-color: #272727; + selection-background-color: #616161; +} + +QComboBox QAbstractItemView:hover { + background-color: #272727; + color: #E3E3E3; +} + +QComboBox QAbstractItemView:selected { + background: #616161; + color: #525252; +} + +QComboBox QAbstractItemView:alternate { + background: #272727; +} + +QComboBox:disabled { + background-color: #272727; + color: #8B8B8B; +} + +QComboBox:hover { + border: 1px solid #616161; + background-color: #454545; +} + +QComboBox:focus { + border: 1px solid #666666; +} + +QComboBox:on { + selection-background-color: #616161; + background-color: #666666; +} + +QComboBox::indicator { + border: none; + border-radius: 0; + background-color: transparent; + selection-background-color: transparent; + color: transparent; + selection-color: transparent; + /* Needed to remove indicator - fix #132 */ +} + +QComboBox::indicator:alternate { + background: #272727; +} + +QComboBox::item { + /* Remove to fix #282, #285 and MR #288*/ + /*&:checked { + font-weight: bold; + } + + &:selected { + border: 0px solid transparent; + } + */ +} + +QComboBox::item:alternate { + background: #272727; +} + +QComboBox::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 12px; + border-left: 1px solid #525252; +} + +QComboBox::down-arrow { + image: url(":/qss_icons/dark/rc/arrow_down_disabled.png"); + height: 8px; + width: 8px; +} + +QComboBox::down-arrow:on, QComboBox::down-arrow:hover, QComboBox::down-arrow:focus { + image: url(":/qss_icons/dark/rc/arrow_down.png"); +} + +/* QSlider ---------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qslider + +--------------------------------------------------------------------------- */ +QSlider:disabled { + background: #272727; +} + +QSlider:focus { + border: none; +} + +QSlider::groove:horizontal { + background: #525252; + border: 1px solid #525252; + height: 4px; + margin: 0px; + border-radius: 4px; +} + +QSlider::groove:vertical { + background: #525252; + border: 1px solid #525252; + width: 4px; + margin: 0px; + border-radius: 4px; +} + +QSlider::add-page:vertical { + background: #616161; + border: 1px solid #525252; + width: 4px; + margin: 0px; + border-radius: 4px; +} + +QSlider::add-page:vertical :disabled { + background: #444444; +} + +QSlider::sub-page:horizontal { + background: #616161; + border: 1px solid #525252; + height: 4px; + margin: 0px; + border-radius: 4px; +} + +QSlider::sub-page:horizontal:disabled { + background: #444444; +} + +QSlider::handle:horizontal { + background: #A9A9A9; + border: 1px solid #525252; + width: 8px; + height: 8px; + margin: -8px 0px; + border-radius: 4px; +} + +QSlider::handle:horizontal:hover { + background: #616161; + border: 1px solid #616161; +} + +QSlider::handle:horizontal:focus { + border: 1px solid #666666; +} + +QSlider::handle:vertical { + background: #A9A9A9; + border: 1px solid #525252; + width: 8px; + height: 8px; + margin: 0 -8px; + border-radius: 4px; +} + +QSlider::handle:vertical:hover { + background: #616161; + border: 1px solid #616161; +} + +QSlider::handle:vertical:focus { + border: 1px solid #666666; +} + +/* QLineEdit -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlineedit + +--------------------------------------------------------------------------- */ +QLineEdit { + background-color: #272727; + padding-top: 2px; + /* This QLineEdit fix 103, 111 */ + padding-bottom: 2px; + /* This QLineEdit fix 103, 111 */ + padding-left: 4px; + padding-right: 4px; + border-style: solid; + border: 1px solid #525252; + border-radius: 4px; + color: #E3E3E3; +} + +QLineEdit:disabled { + background-color: #272727; + color: #8B8B8B; +} + +QLineEdit:hover { + border: 1px solid #616161; + color: #E3E3E3; +} + +QLineEdit:focus { + border: 1px solid #666666; +} + +QLineEdit:selected { + background-color: #616161; + color: #525252; +} + +/* QTabWiget -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar + +--------------------------------------------------------------------------- */ +QTabWidget { + padding: 2px; + selection-background-color: #525252; +} + +QTabWidget QWidget { + /* Fixes #189 */ + border-radius: 4px; +} + +QTabWidget::pane { + border: 1px solid #525252; + border-radius: 4px; + margin: 0px; + /* Fixes double border inside pane with pyqt5 */ + padding: 0px; +} + +QTabWidget::pane:selected { + background-color: #525252; + border: 1px solid #616161; +} + +/* QTabBar ---------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar + +--------------------------------------------------------------------------- */ +QTabBar, QDockWidget QTabBar { + qproperty-drawBase: 0; + border-radius: 4px; + margin: 0px; + padding: 2px; + border: 0; + /* left: 5px; move to the right by 5px - removed for fix */ +} + +QTabBar::close-button, QDockWidget QTabBar::close-button { + border: 0; + margin: 0; + padding: 4px; + image: url(":/qss_icons/dark/rc/window_close.png"); +} + +QTabBar::close-button:hover, QDockWidget QTabBar::close-button:hover { + image: url(":/qss_icons/dark/rc/window_close_focus.png"); +} + +QTabBar::close-button:pressed, QDockWidget QTabBar::close-button:pressed { + image: url(":/qss_icons/dark/rc/window_close_pressed.png"); +} + +QTabBar::tab, QDockWidget QTabBar::tab { + /* !selected and disabled ----------------------------------------- */ + /* selected ------------------------------------------------------- */ +} + +QTabBar::tab:top:selected:disabled, QDockWidget QTabBar::tab:top:selected:disabled { + border-bottom: 3px solid #444444; + color: #8B8B8B; + background-color: #525252; +} + +QTabBar::tab:bottom:selected:disabled, QDockWidget QTabBar::tab:bottom:selected:disabled { + border-top: 3px solid #444444; + color: #8B8B8B; + background-color: #525252; +} + +QTabBar::tab:left:selected:disabled, QDockWidget QTabBar::tab:left:selected:disabled { + border-right: 3px solid #444444; + color: #8B8B8B; + background-color: #525252; +} + +QTabBar::tab:right:selected:disabled, QDockWidget QTabBar::tab:right:selected:disabled { + border-left: 3px solid #444444; + color: #8B8B8B; + background-color: #525252; +} + +QTabBar::tab:top:!selected:disabled, QDockWidget QTabBar::tab:top:!selected:disabled { + border-bottom: 3px solid #272727; + color: #8B8B8B; + background-color: #272727; +} + +QTabBar::tab:bottom:!selected:disabled, QDockWidget QTabBar::tab:bottom:!selected:disabled { + border-top: 3px solid #272727; + color: #8B8B8B; + background-color: #272727; +} + +QTabBar::tab:left:!selected:disabled, QDockWidget QTabBar::tab:left:!selected:disabled { + border-right: 3px solid #272727; + color: #8B8B8B; + background-color: #272727; +} + +QTabBar::tab:right:!selected:disabled, QDockWidget QTabBar::tab:right:!selected:disabled { + border-left: 3px solid #272727; + color: #8B8B8B; + background-color: #272727; +} + +QTabBar::tab:top:!selected, QDockWidget QTabBar::tab:top:!selected { + border-bottom: 2px solid #272727; + margin-top: 2px; +} + +QTabBar::tab:bottom:!selected, QDockWidget QTabBar::tab:bottom:!selected { + border-top: 2px solid #272727; + margin-bottom: 2px; +} + +QTabBar::tab:left:!selected, QDockWidget QTabBar::tab:left:!selected { + border-left: 2px solid #272727; + margin-right: 2px; +} + +QTabBar::tab:right:!selected, QDockWidget QTabBar::tab:right:!selected { + border-right: 2px solid #272727; + margin-left: 2px; +} + +QTabBar::tab:top, QDockWidget QTabBar::tab:top { + background-color: #525252; + margin-left: 2px; + padding-left: 4px; + padding-right: 4px; + padding-top: 2px; + padding-bottom: 2px; + min-width: 5px; + border-bottom: 3px solid #525252; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +QTabBar::tab:top:selected, QDockWidget QTabBar::tab:top:selected { + background-color: #666666; + border-bottom: 3px solid #898989; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +QTabBar::tab:top:!selected:hover, QDockWidget QTabBar::tab:top:!selected:hover { + border: 1px solid #666666; + border-bottom: 3px solid #666666; + /* Fixes spyder-ide/spyder#9766 and #243 */ + padding-left: 3px; + padding-right: 3px; +} + +QTabBar::tab:bottom, QDockWidget QTabBar::tab:bottom { + border-top: 3px solid #525252; + background-color: #525252; + margin-left: 2px; + padding-left: 4px; + padding-right: 4px; + padding-top: 2px; + padding-bottom: 2px; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + min-width: 5px; +} + +QTabBar::tab:bottom:selected, QDockWidget QTabBar::tab:bottom:selected { + background-color: #666666; + border-top: 3px solid #898989; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; +} + +QTabBar::tab:bottom:!selected:hover, QDockWidget QTabBar::tab:bottom:!selected:hover { + border: 1px solid #666666; + border-top: 3px solid #666666; + /* Fixes spyder-ide/spyder#9766 and #243 */ + padding-left: 3px; + padding-right: 3px; +} + +QTabBar::tab:left, QDockWidget QTabBar::tab:left { + background-color: #525252; + margin-top: 2px; + padding-left: 2px; + padding-right: 2px; + padding-top: 4px; + padding-bottom: 4px; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + min-height: 5px; +} + +QTabBar::tab:left:selected, QDockWidget QTabBar::tab:left:selected { + background-color: #666666; + border-right: 3px solid #898989; +} + +QTabBar::tab:left:!selected:hover, QDockWidget QTabBar::tab:left:!selected:hover { + border: 1px solid #666666; + border-right: 3px solid #666666; + /* Fixes different behavior #271 */ + margin-right: 0px; + padding-right: -1px; +} + +QTabBar::tab:right, QDockWidget QTabBar::tab:right { + background-color: #525252; + margin-top: 2px; + padding-left: 2px; + padding-right: 2px; + padding-top: 4px; + padding-bottom: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + min-height: 5px; +} + +QTabBar::tab:right:selected, QDockWidget QTabBar::tab:right:selected { + background-color: #666666; + border-left: 3px solid #898989; +} + +QTabBar::tab:right:!selected:hover, QDockWidget QTabBar::tab:right:!selected:hover { + border: 1px solid #666666; + border-left: 3px solid #666666; + /* Fixes different behavior #271 */ + margin-left: 0px; + padding-left: 0px; +} + +QTabBar QToolButton, QDockWidget QTabBar QToolButton { + /* Fixes #136 */ + background-color: #525252; + height: 12px; + width: 12px; +} + +QTabBar QToolButton:pressed, QDockWidget QTabBar QToolButton:pressed { + background-color: #525252; +} + +QTabBar QToolButton:pressed:hover, QDockWidget QTabBar QToolButton:pressed:hover { + border: 1px solid #616161; +} + +QTabBar QToolButton::left-arrow:enabled, QDockWidget QTabBar QToolButton::left-arrow:enabled { + image: url(":/qss_icons/dark/rc/arrow_left.png"); +} + +QTabBar QToolButton::left-arrow:disabled, QDockWidget QTabBar QToolButton::left-arrow:disabled { + image: url(":/qss_icons/dark/rc/arrow_left_disabled.png"); +} + +QTabBar QToolButton::right-arrow:enabled, QDockWidget QTabBar QToolButton::right-arrow:enabled { + image: url(":/qss_icons/dark/rc/arrow_right.png"); +} + +QTabBar QToolButton::right-arrow:disabled, QDockWidget QTabBar QToolButton::right-arrow:disabled { + image: url(":/qss_icons/dark/rc/arrow_right_disabled.png"); +} + +/* QDockWiget ------------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QDockWidget { + outline: 1px solid #525252; + background-color: #272727; + border: 1px solid #525252; + border-radius: 4px; + titlebar-close-icon: url(":/qss_icons/dark/rc/transparent.png"); + titlebar-normal-icon: url(":/qss_icons/dark/rc/transparent.png"); +} + +QDockWidget::title { + /* Better size for title bar */ + padding: 3px; + spacing: 4px; + border: none; + background-color: #525252; +} + +QDockWidget::close-button { + icon-size: 12px; + border: none; + background: transparent; + background-image: transparent; + border: 0; + margin: 0; + padding: 0; + image: url(":/qss_icons/dark/rc/window_close.png"); +} + +QDockWidget::close-button:hover { + image: url(":/qss_icons/dark/rc/window_close_focus.png"); +} + +QDockWidget::close-button:pressed { + image: url(":/qss_icons/dark/rc/window_close_pressed.png"); +} + +QDockWidget::float-button { + icon-size: 12px; + border: none; + background: transparent; + background-image: transparent; + border: 0; + margin: 0; + padding: 0; + image: url(":/qss_icons/dark/rc/window_undock.png"); +} + +QDockWidget::float-button:hover { + image: url(":/qss_icons/dark/rc/window_undock_focus.png"); +} + +QDockWidget::float-button:pressed { + image: url(":/qss_icons/dark/rc/window_undock_pressed.png"); +} + +/* QTreeView QListView QTableView ----------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtreeview +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtableview + +--------------------------------------------------------------------------- */ +QTreeView:branch:selected, QTreeView:branch:hover { + background: url(":/qss_icons/dark/rc/transparent.png"); +} + +QTreeView:branch:has-siblings:!adjoins-item { + border-image: url(":/qss_icons/dark/rc/branch_line.png") 0; +} + +QTreeView:branch:has-siblings:adjoins-item { + border-image: url(":/qss_icons/dark/rc/branch_more.png") 0; +} + +QTreeView:branch:!has-children:!has-siblings:adjoins-item { + border-image: url(":/qss_icons/dark/rc/branch_end.png") 0; +} + +QTreeView:branch:has-children:!has-siblings:closed, QTreeView:branch:closed:has-children:has-siblings { + border-image: none; + image: url(":/qss_icons/dark/rc/branch_closed.png"); +} + +QTreeView:branch:open:has-children:!has-siblings, QTreeView:branch:open:has-children:has-siblings { + border-image: none; + image: url(":/qss_icons/dark/rc/branch_open.png"); +} + +QTreeView:branch:has-children:!has-siblings:closed:hover, QTreeView:branch:closed:has-children:has-siblings:hover { + image: url(":/qss_icons/dark/rc/branch_closed_focus.png"); +} + +QTreeView:branch:open:has-children:!has-siblings:hover, QTreeView:branch:open:has-children:has-siblings:hover { + image: url(":/qss_icons/dark/rc/branch_open_focus.png"); +} + +QTreeView::indicator:checked, +QListView::indicator:checked, +QTableView::indicator:checked, +QColumnView::indicator:checked { + image: url(":/qss_icons/dark/rc/checkbox_checked.png"); +} + +QTreeView::indicator:checked:hover, QTreeView::indicator:checked:focus, QTreeView::indicator:checked:pressed, +QListView::indicator:checked:hover, +QListView::indicator:checked:focus, +QListView::indicator:checked:pressed, +QTableView::indicator:checked:hover, +QTableView::indicator:checked:focus, +QTableView::indicator:checked:pressed, +QColumnView::indicator:checked:hover, +QColumnView::indicator:checked:focus, +QColumnView::indicator:checked:pressed { + image: url(":/qss_icons/dark/rc/checkbox_checked_focus.png"); +} + +QTreeView::indicator:unchecked, +QListView::indicator:unchecked, +QTableView::indicator:unchecked, +QColumnView::indicator:unchecked { + image: url(":/qss_icons/dark/rc/checkbox_unchecked.png"); +} + +QTreeView::indicator:unchecked:hover, QTreeView::indicator:unchecked:focus, QTreeView::indicator:unchecked:pressed, +QListView::indicator:unchecked:hover, +QListView::indicator:unchecked:focus, +QListView::indicator:unchecked:pressed, +QTableView::indicator:unchecked:hover, +QTableView::indicator:unchecked:focus, +QTableView::indicator:unchecked:pressed, +QColumnView::indicator:unchecked:hover, +QColumnView::indicator:unchecked:focus, +QColumnView::indicator:unchecked:pressed { + image: url(":/qss_icons/dark/rc/checkbox_unchecked_focus.png"); +} + +QTreeView::indicator:indeterminate, +QListView::indicator:indeterminate, +QTableView::indicator:indeterminate, +QColumnView::indicator:indeterminate { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate.png"); +} + +QTreeView::indicator:indeterminate:hover, QTreeView::indicator:indeterminate:focus, QTreeView::indicator:indeterminate:pressed, +QListView::indicator:indeterminate:hover, +QListView::indicator:indeterminate:focus, +QListView::indicator:indeterminate:pressed, +QTableView::indicator:indeterminate:hover, +QTableView::indicator:indeterminate:focus, +QTableView::indicator:indeterminate:pressed, +QColumnView::indicator:indeterminate:hover, +QColumnView::indicator:indeterminate:focus, +QColumnView::indicator:indeterminate:pressed { + image: url(":/qss_icons/dark/rc/checkbox_indeterminate_focus.png"); +} + +QTreeView, +QListView, +QTableView, +QColumnView { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + gridline-color: #525252; + border-radius: 4px; +} + +QTreeView:disabled, +QListView:disabled, +QTableView:disabled, +QColumnView:disabled { + background-color: #272727; + color: #8B8B8B; +} + +QTreeView:selected, +QListView:selected, +QTableView:selected, +QColumnView:selected { + background-color: #616161; + color: #525252; +} + +QTreeView:focus, +QListView:focus, +QTableView:focus, +QColumnView:focus { + border: 1px solid #666666; +} + +QTreeView::item:pressed, +QListView::item:pressed, +QTableView::item:pressed, +QColumnView::item:pressed { + background-color: #616161; +} + +QTreeView::item:selected:active, +QListView::item:selected:active, +QTableView::item:selected:active, +QColumnView::item:selected:active { + background-color: #616161; +} + +QTreeView::item:selected:!active, +QListView::item:selected:!active, +QTableView::item:selected:!active, +QColumnView::item:selected:!active { + color: #E3E3E3; + background-color: #414141; +} + +QTreeView::item:!selected:hover, +QListView::item:!selected:hover, +QTableView::item:!selected:hover, +QColumnView::item:!selected:hover { + outline: 0; + color: #E3E3E3; + background-color: #414141; +} + +QTableCornerButton::section { + background-color: #272727; + border: 1px transparent #525252; + border-radius: 0px; +} + +/* QHeaderView ------------------------------------------------------------ + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qheaderview + +--------------------------------------------------------------------------- */ +QHeaderView { + background-color: #525252; + border: 0px transparent #525252; + padding: 0; + margin: 0; + border-radius: 0; +} + +QHeaderView:disabled { + background-color: #525252; + border: 1px transparent #525252; +} + +QHeaderView::section { + background-color: #525252; + color: #E3E3E3; + border-radius: 0; + text-align: left; + font-size: 13px; +} + +QHeaderView::section::horizontal { + padding-top: 0; + padding-bottom: 0; + padding-left: 4px; + padding-right: 4px; + border-left: 1px solid #272727; +} + +QHeaderView::section::horizontal::first, QHeaderView::section::horizontal::only-one { + border-left: 1px solid #525252; +} + +QHeaderView::section::horizontal:disabled { + color: #8B8B8B; +} + +QHeaderView::section::vertical { + padding-top: 0; + padding-bottom: 0; + padding-left: 4px; + padding-right: 4px; + border-top: 1px solid #272727; +} + +QHeaderView::section::vertical::first, QHeaderView::section::vertical::only-one { + border-top: 1px solid #525252; +} + +QHeaderView::section::vertical:disabled { + color: #8B8B8B; +} + +QHeaderView::down-arrow { + /* Those settings (border/width/height/background-color) solve bug */ + /* transparent arrow background and size */ + background-color: #525252; + border: none; + height: 12px; + width: 12px; + padding-left: 2px; + padding-right: 2px; + image: url(":/qss_icons/dark/rc/arrow_down.png"); +} + +QHeaderView::up-arrow { + background-color: #525252; + border: none; + height: 12px; + width: 12px; + padding-left: 2px; + padding-right: 2px; + image: url(":/qss_icons/dark/rc/arrow_up.png"); +} + +/* QToolBox -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbox + +--------------------------------------------------------------------------- */ +QToolBox { + padding: 0px; + border: 0px; + border: 1px solid #525252; +} + +QToolBox:selected { + padding: 0px; + border: 2px solid #616161; +} + +QToolBox::tab { + background-color: #272727; + border: 1px solid #525252; + color: #E3E3E3; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +QToolBox::tab:disabled { + color: #8B8B8B; +} + +QToolBox::tab:selected { + background-color: #767676; + border-bottom: 2px solid #616161; +} + +QToolBox::tab:selected:disabled { + background-color: #525252; + border-bottom: 2px solid #444444; +} + +QToolBox::tab:!selected { + background-color: #525252; + border-bottom: 2px solid #525252; +} + +QToolBox::tab:!selected:disabled { + background-color: #272727; +} + +QToolBox::tab:hover { + border-color: #666666; + border-bottom: 2px solid #666666; +} + +QToolBox QScrollArea { + padding: 0px; + border: 0px; + background-color: #272727; +} + +/* QFrame ----------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe +https://doc.qt.io/qt-5/qframe.html#-prop +https://doc.qt.io/qt-5/qframe.html#details +https://stackoverflow.com/questions/14581498/qt-stylesheet-for-hline-vline-color + +--------------------------------------------------------------------------- */ +/* (dot) .QFrame fix #141, #126, #123 */ +.QFrame { + border-radius: 4px; + border: 1px solid #525252; + /* No frame */ + /* HLine */ + /* HLine */ +} + +.QFrame[frameShape="0"] { + border-radius: 4px; + border: 1px transparent #525252; +} + +.QFrame[frameShape="4"] { + max-height: 2px; + border: none; + background-color: #525252; +} + +.QFrame[frameShape="5"] { + max-width: 2px; + border: none; + background-color: #525252; +} + +/* QSplitter -------------------------------------------------------------- + +https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qsplitter + +--------------------------------------------------------------------------- */ +QSplitter { + background-color: #525252; + spacing: 0px; + padding: 0px; + margin: 0px; +} + +QSplitter::handle { + background-color: #525252; + border: 0px solid #272727; + spacing: 0px; + padding: 1px; + margin: 0px; +} + +QSplitter::handle:hover { + background-color: #A9A9A9; +} + +QSplitter::handle:horizontal { + width: 5px; + image: url(":/qss_icons/dark/rc/line_vertical.png"); +} + +QSplitter::handle:vertical { + height: 5px; + image: url(":/qss_icons/dark/rc/line_horizontal.png"); +} + +/* QDateEdit, QDateTimeEdit ----------------------------------------------- + +--------------------------------------------------------------------------- */ +QDateEdit, QDateTimeEdit { + selection-background-color: #616161; + border-style: solid; + border: 1px solid #525252; + border-radius: 4px; + /* This fixes 103, 111 */ + padding-top: 2px; + /* This fixes 103, 111 */ + padding-bottom: 2px; + padding-left: 4px; + padding-right: 4px; + min-width: 10px; +} + +QDateEdit:on, QDateTimeEdit:on { + selection-background-color: #616161; +} + +QDateEdit::drop-down, QDateTimeEdit::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 12px; + border-left: 1px solid #525252; +} + +QDateEdit::down-arrow, QDateTimeEdit::down-arrow { + image: url(":/qss_icons/dark/rc/arrow_down_disabled.png"); + height: 8px; + width: 8px; +} + +QDateEdit::down-arrow:on, QDateEdit::down-arrow:hover, QDateEdit::down-arrow:focus, QDateTimeEdit::down-arrow:on, QDateTimeEdit::down-arrow:hover, QDateTimeEdit::down-arrow:focus { + image: url(":/qss_icons/dark/rc/arrow_down.png"); +} + +QDateEdit QAbstractItemView, QDateTimeEdit QAbstractItemView { + background-color: #272727; + border-radius: 4px; + border: 1px solid #525252; + selection-background-color: #616161; +} + +/* QAbstractView ---------------------------------------------------------- + +--------------------------------------------------------------------------- */ +QAbstractView:hover { + border: 1px solid #616161; + color: #E3E3E3; +} + +QAbstractView:selected { + background: #616161; + color: #525252; +} + +/* PlotWidget ------------------------------------------------------------- + +--------------------------------------------------------------------------- */ +PlotWidget { + /* Fix cut labels in plots #134 */ + padding: 0px; +} diff --git a/src/qt/qdarkstyle/dark/rc/.keep b/src/qt/qdarkstyle/dark/rc/.keep new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/src/qt/qdarkstyle/dark/rc/.keep @@ -0,0 +1 @@ + diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down.png b/src/qt/qdarkstyle/dark/rc/arrow_down.png new file mode 100644 index 000000000..412b76e6f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_down@2x.png new file mode 100644 index 000000000..74d0099ec Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_disabled.png b/src/qt/qdarkstyle/dark/rc/arrow_down_disabled.png new file mode 100644 index 000000000..972df9cd1 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_down_disabled@2x.png new file mode 100644 index 000000000..b0fb4ad11 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_focus.png b/src/qt/qdarkstyle/dark/rc/arrow_down_focus.png new file mode 100644 index 000000000..22df2c525 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_focus@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_down_focus@2x.png new file mode 100644 index 000000000..06b80be4b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_pressed.png b/src/qt/qdarkstyle/dark/rc/arrow_down_pressed.png new file mode 100644 index 000000000..50f41cc6f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_down_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_down_pressed@2x.png new file mode 100644 index 000000000..ef20f2cb0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_down_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left.png b/src/qt/qdarkstyle/dark/rc/arrow_left.png new file mode 100644 index 000000000..b7aeac5f8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_left@2x.png new file mode 100644 index 000000000..fef91a8c8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_disabled.png b/src/qt/qdarkstyle/dark/rc/arrow_left_disabled.png new file mode 100644 index 000000000..79b1f0565 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_left_disabled@2x.png new file mode 100644 index 000000000..144fdb5f8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_focus.png b/src/qt/qdarkstyle/dark/rc/arrow_left_focus.png new file mode 100644 index 000000000..ef0284994 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_focus@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_left_focus@2x.png new file mode 100644 index 000000000..ca821dcac Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_pressed.png b/src/qt/qdarkstyle/dark/rc/arrow_left_pressed.png new file mode 100644 index 000000000..c723d3bff Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_left_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_left_pressed@2x.png new file mode 100644 index 000000000..f0bcb5229 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_left_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right.png b/src/qt/qdarkstyle/dark/rc/arrow_right.png new file mode 100644 index 000000000..78d67f2db Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_right@2x.png new file mode 100644 index 000000000..ce0a8faeb Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_disabled.png b/src/qt/qdarkstyle/dark/rc/arrow_right_disabled.png new file mode 100644 index 000000000..88da1f980 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_right_disabled@2x.png new file mode 100644 index 000000000..5351587e3 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_focus.png b/src/qt/qdarkstyle/dark/rc/arrow_right_focus.png new file mode 100644 index 000000000..92271a8ed Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_focus@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_right_focus@2x.png new file mode 100644 index 000000000..d6c31bdda Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_pressed.png b/src/qt/qdarkstyle/dark/rc/arrow_right_pressed.png new file mode 100644 index 000000000..22902cf4f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_right_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_right_pressed@2x.png new file mode 100644 index 000000000..f6181eb64 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_right_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up.png b/src/qt/qdarkstyle/dark/rc/arrow_up.png new file mode 100644 index 000000000..50321f29b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_up@2x.png new file mode 100644 index 000000000..8c73c3be3 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_disabled.png b/src/qt/qdarkstyle/dark/rc/arrow_up_disabled.png new file mode 100644 index 000000000..48054a8ae Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_up_disabled@2x.png new file mode 100644 index 000000000..e99960594 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_focus.png b/src/qt/qdarkstyle/dark/rc/arrow_up_focus.png new file mode 100644 index 000000000..567ec8bdf Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_focus@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_up_focus@2x.png new file mode 100644 index 000000000..f6998104b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_pressed.png b/src/qt/qdarkstyle/dark/rc/arrow_up_pressed.png new file mode 100644 index 000000000..223320106 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/arrow_up_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/arrow_up_pressed@2x.png new file mode 100644 index 000000000..9954cf519 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/arrow_up_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon.png b/src/qt/qdarkstyle/dark/rc/base_icon.png new file mode 100644 index 000000000..bb00857a4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon@2x.png b/src/qt/qdarkstyle/dark/rc/base_icon@2x.png new file mode 100644 index 000000000..bc4ab78a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_disabled.png b/src/qt/qdarkstyle/dark/rc/base_icon_disabled.png new file mode 100644 index 000000000..bb00857a4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/base_icon_disabled@2x.png new file mode 100644 index 000000000..bc4ab78a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_focus.png b/src/qt/qdarkstyle/dark/rc/base_icon_focus.png new file mode 100644 index 000000000..bb00857a4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_focus@2x.png b/src/qt/qdarkstyle/dark/rc/base_icon_focus@2x.png new file mode 100644 index 000000000..bc4ab78a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_pressed.png b/src/qt/qdarkstyle/dark/rc/base_icon_pressed.png new file mode 100644 index 000000000..bb00857a4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/base_icon_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/base_icon_pressed@2x.png new file mode 100644 index 000000000..bc4ab78a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/base_icon_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed.png b/src/qt/qdarkstyle/dark/rc/branch_closed.png new file mode 100644 index 000000000..4c152b795 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_closed@2x.png new file mode 100644 index 000000000..a641a550b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_disabled.png b/src/qt/qdarkstyle/dark/rc/branch_closed_disabled.png new file mode 100644 index 000000000..165fae29b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/branch_closed_disabled@2x.png new file mode 100644 index 000000000..421e8e094 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_focus.png b/src/qt/qdarkstyle/dark/rc/branch_closed_focus.png new file mode 100644 index 000000000..ccc249a59 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_focus@2x.png b/src/qt/qdarkstyle/dark/rc/branch_closed_focus@2x.png new file mode 100644 index 000000000..88dd0a62b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_pressed.png b/src/qt/qdarkstyle/dark/rc/branch_closed_pressed.png new file mode 100644 index 000000000..2aae68a0a Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_closed_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_closed_pressed@2x.png new file mode 100644 index 000000000..3849a7ff0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_closed_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end.png b/src/qt/qdarkstyle/dark/rc/branch_end.png new file mode 100644 index 000000000..f92994650 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end@2x.png b/src/qt/qdarkstyle/dark/rc/branch_end@2x.png new file mode 100644 index 000000000..582832220 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_disabled.png b/src/qt/qdarkstyle/dark/rc/branch_end_disabled.png new file mode 100644 index 000000000..bb4344c78 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/branch_end_disabled@2x.png new file mode 100644 index 000000000..8feb46d46 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_focus.png b/src/qt/qdarkstyle/dark/rc/branch_end_focus.png new file mode 100644 index 000000000..ff713cf5f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_focus@2x.png b/src/qt/qdarkstyle/dark/rc/branch_end_focus@2x.png new file mode 100644 index 000000000..0bd0e4ba3 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_pressed.png b/src/qt/qdarkstyle/dark/rc/branch_end_pressed.png new file mode 100644 index 000000000..2020162f2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_end_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_end_pressed@2x.png new file mode 100644 index 000000000..2a5c4fabf Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_end_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line.png b/src/qt/qdarkstyle/dark/rc/branch_line.png new file mode 100644 index 000000000..2e8c72ab6 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line@2x.png b/src/qt/qdarkstyle/dark/rc/branch_line@2x.png new file mode 100644 index 000000000..c8f07af31 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_disabled.png b/src/qt/qdarkstyle/dark/rc/branch_line_disabled.png new file mode 100644 index 000000000..9c8c47b3d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/branch_line_disabled@2x.png new file mode 100644 index 000000000..9b868f2a5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_focus.png b/src/qt/qdarkstyle/dark/rc/branch_line_focus.png new file mode 100644 index 000000000..c2ab3e19e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_focus@2x.png b/src/qt/qdarkstyle/dark/rc/branch_line_focus@2x.png new file mode 100644 index 000000000..512ee13a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_pressed.png b/src/qt/qdarkstyle/dark/rc/branch_line_pressed.png new file mode 100644 index 000000000..3ca15c5d0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_line_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_line_pressed@2x.png new file mode 100644 index 000000000..368553102 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_line_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more.png b/src/qt/qdarkstyle/dark/rc/branch_more.png new file mode 100644 index 000000000..976354bc4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more@2x.png b/src/qt/qdarkstyle/dark/rc/branch_more@2x.png new file mode 100644 index 000000000..9c1ab07d0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_disabled.png b/src/qt/qdarkstyle/dark/rc/branch_more_disabled.png new file mode 100644 index 000000000..29d99a63e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/branch_more_disabled@2x.png new file mode 100644 index 000000000..aba830362 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_focus.png b/src/qt/qdarkstyle/dark/rc/branch_more_focus.png new file mode 100644 index 000000000..20a6f27b8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_focus@2x.png b/src/qt/qdarkstyle/dark/rc/branch_more_focus@2x.png new file mode 100644 index 000000000..6f42eea84 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_pressed.png b/src/qt/qdarkstyle/dark/rc/branch_more_pressed.png new file mode 100644 index 000000000..4f4d9fb91 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_more_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_more_pressed@2x.png new file mode 100644 index 000000000..5f18f8341 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_more_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open.png b/src/qt/qdarkstyle/dark/rc/branch_open.png new file mode 100644 index 000000000..fdf0f8b43 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open@2x.png b/src/qt/qdarkstyle/dark/rc/branch_open@2x.png new file mode 100644 index 000000000..703cd6af3 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_disabled.png b/src/qt/qdarkstyle/dark/rc/branch_open_disabled.png new file mode 100644 index 000000000..8328e84d7 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/branch_open_disabled@2x.png new file mode 100644 index 000000000..d8d0faecb Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_focus.png b/src/qt/qdarkstyle/dark/rc/branch_open_focus.png new file mode 100644 index 000000000..711ce0979 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_focus@2x.png b/src/qt/qdarkstyle/dark/rc/branch_open_focus@2x.png new file mode 100644 index 000000000..b38e17a33 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_pressed.png b/src/qt/qdarkstyle/dark/rc/branch_open_pressed.png new file mode 100644 index 000000000..441c27344 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/branch_open_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/branch_open_pressed@2x.png new file mode 100644 index 000000000..0e43e8b73 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/branch_open_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked.png new file mode 100644 index 000000000..3687e56c0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked@2x.png new file mode 100644 index 000000000..e7a6b1afe Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled.png new file mode 100644 index 000000000..e3cb2f127 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled@2x.png new file mode 100644 index 000000000..0c8c28a24 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus.png new file mode 100644 index 000000000..58982ce87 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus@2x.png new file mode 100644 index 000000000..ba33ba4fb Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed.png new file mode 100644 index 000000000..f104bb240 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed@2x.png new file mode 100644 index 000000000..bb972d68f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_checked_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate.png new file mode 100644 index 000000000..8159551de Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate@2x.png new file mode 100644 index 000000000..75864b46d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled.png new file mode 100644 index 000000000..181625a00 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled@2x.png new file mode 100644 index 000000000..0d32c78f3 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus.png new file mode 100644 index 000000000..d7b19f61a Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus@2x.png new file mode 100644 index 000000000..d6403ca42 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed.png new file mode 100644 index 000000000..37f46ca3d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed@2x.png new file mode 100644 index 000000000..aa7493edc Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_indeterminate_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked.png new file mode 100644 index 000000000..e363ed620 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked@2x.png new file mode 100644 index 000000000..520f5e2a2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled.png new file mode 100644 index 000000000..066185ee7 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled@2x.png new file mode 100644 index 000000000..9c80ad75a Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus.png new file mode 100644 index 000000000..366b868de Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus@2x.png new file mode 100644 index 000000000..4ab217356 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed.png new file mode 100644 index 000000000..d9a0bf71c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed@2x.png new file mode 100644 index 000000000..9e2b0515e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/checkbox_unchecked_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal.png b/src/qt/qdarkstyle/dark/rc/line_horizontal.png new file mode 100644 index 000000000..4f88ddf7b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal@2x.png b/src/qt/qdarkstyle/dark/rc/line_horizontal@2x.png new file mode 100644 index 000000000..63be00c16 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled.png new file mode 100644 index 000000000..941f14a38 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled@2x.png new file mode 100644 index 000000000..972fa0800 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_focus.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_focus.png new file mode 100644 index 000000000..221fd4607 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_focus@2x.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_focus@2x.png new file mode 100644 index 000000000..7e6505cae Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed.png new file mode 100644 index 000000000..9f9113323 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed@2x.png new file mode 100644 index 000000000..465680c3b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_horizontal_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical.png b/src/qt/qdarkstyle/dark/rc/line_vertical.png new file mode 100644 index 000000000..6ee62c156 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical@2x.png b/src/qt/qdarkstyle/dark/rc/line_vertical@2x.png new file mode 100644 index 000000000..d65e74c62 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_disabled.png b/src/qt/qdarkstyle/dark/rc/line_vertical_disabled.png new file mode 100644 index 000000000..c7c4c8959 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/line_vertical_disabled@2x.png new file mode 100644 index 000000000..b052de522 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_focus.png b/src/qt/qdarkstyle/dark/rc/line_vertical_focus.png new file mode 100644 index 000000000..36baa0936 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_focus@2x.png b/src/qt/qdarkstyle/dark/rc/line_vertical_focus@2x.png new file mode 100644 index 000000000..24a2b771c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_pressed.png b/src/qt/qdarkstyle/dark/rc/line_vertical_pressed.png new file mode 100644 index 000000000..60e357446 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/line_vertical_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/line_vertical_pressed@2x.png new file mode 100644 index 000000000..c9494051c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/line_vertical_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked.png b/src/qt/qdarkstyle/dark/rc/radio_checked.png new file mode 100644 index 000000000..acb890155 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked@2x.png b/src/qt/qdarkstyle/dark/rc/radio_checked@2x.png new file mode 100644 index 000000000..e19047621 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_disabled.png b/src/qt/qdarkstyle/dark/rc/radio_checked_disabled.png new file mode 100644 index 000000000..49df43922 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/radio_checked_disabled@2x.png new file mode 100644 index 000000000..a9ffd40ce Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_focus.png b/src/qt/qdarkstyle/dark/rc/radio_checked_focus.png new file mode 100644 index 000000000..4bd472e16 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_focus@2x.png b/src/qt/qdarkstyle/dark/rc/radio_checked_focus@2x.png new file mode 100644 index 000000000..aed5e0c94 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_pressed.png b/src/qt/qdarkstyle/dark/rc/radio_checked_pressed.png new file mode 100644 index 000000000..ebb323b8c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_checked_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/radio_checked_pressed@2x.png new file mode 100644 index 000000000..ffe0fd851 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_checked_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked.png new file mode 100644 index 000000000..9ffddc4a0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked@2x.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked@2x.png new file mode 100644 index 000000000..2160a32ed Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled.png new file mode 100644 index 000000000..7ddff642d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled@2x.png new file mode 100644 index 000000000..4de5d0d2d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus.png new file mode 100644 index 000000000..e62b996b1 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus@2x.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus@2x.png new file mode 100644 index 000000000..eaf7bc26b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed.png new file mode 100644 index 000000000..8aaa343e8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed@2x.png new file mode 100644 index 000000000..ba4f83b91 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/radio_unchecked_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal.png new file mode 100644 index 000000000..fa449d6ee Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal@2x.png new file mode 100644 index 000000000..682575ee2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled.png new file mode 100644 index 000000000..568b0fbe1 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled@2x.png new file mode 100644 index 000000000..4d15f1478 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus.png new file mode 100644 index 000000000..cdb96bfb9 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus@2x.png new file mode 100644 index 000000000..23e06a015 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed.png new file mode 100644 index 000000000..9ce6f8d89 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed@2x.png new file mode 100644 index 000000000..4d8e53e8e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_horizontal_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical.png new file mode 100644 index 000000000..bbc8abb1f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical@2x.png new file mode 100644 index 000000000..136ebae2c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled.png new file mode 100644 index 000000000..37453ac25 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled@2x.png new file mode 100644 index 000000000..cca8f6d96 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus.png new file mode 100644 index 000000000..b54877181 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus@2x.png new file mode 100644 index 000000000..d4dd49dec Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed.png new file mode 100644 index 000000000..768ebaf4c Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed@2x.png new file mode 100644 index 000000000..2f170ffd8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_move_vertical_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal.png new file mode 100644 index 000000000..01e350132 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal@2x.png new file mode 100644 index 000000000..68d768e5e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled.png new file mode 100644 index 000000000..f8796f9e6 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled@2x.png new file mode 100644 index 000000000..1d9f20421 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus.png new file mode 100644 index 000000000..b592e61c1 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus@2x.png new file mode 100644 index 000000000..a593a7e76 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed.png new file mode 100644 index 000000000..a806257e0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed@2x.png new file mode 100644 index 000000000..e1e8e3c14 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_horizontal_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical.png new file mode 100644 index 000000000..2a14f5cbd Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical@2x.png new file mode 100644 index 000000000..35371feea Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled.png new file mode 100644 index 000000000..48b2657f5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled@2x.png new file mode 100644 index 000000000..a2173c5ee Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus.png new file mode 100644 index 000000000..e31c694b0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus@2x.png new file mode 100644 index 000000000..ce743cc86 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed.png new file mode 100644 index 000000000..4ee7aaaab Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed@2x.png new file mode 100644 index 000000000..d8bf93bf6 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/toolbar_separator_vertical_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent.png b/src/qt/qdarkstyle/dark/rc/transparent.png new file mode 100644 index 000000000..67753617f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent@2x.png b/src/qt/qdarkstyle/dark/rc/transparent@2x.png new file mode 100644 index 000000000..4012944b5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_disabled.png b/src/qt/qdarkstyle/dark/rc/transparent_disabled.png new file mode 100644 index 000000000..67753617f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/transparent_disabled@2x.png new file mode 100644 index 000000000..4012944b5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_focus.png b/src/qt/qdarkstyle/dark/rc/transparent_focus.png new file mode 100644 index 000000000..67753617f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_focus@2x.png b/src/qt/qdarkstyle/dark/rc/transparent_focus@2x.png new file mode 100644 index 000000000..4012944b5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_pressed.png b/src/qt/qdarkstyle/dark/rc/transparent_pressed.png new file mode 100644 index 000000000..67753617f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/transparent_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/transparent_pressed@2x.png new file mode 100644 index 000000000..4012944b5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/transparent_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close.png b/src/qt/qdarkstyle/dark/rc/window_close.png new file mode 100644 index 000000000..0b67d3bcc Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close@2x.png b/src/qt/qdarkstyle/dark/rc/window_close@2x.png new file mode 100644 index 000000000..bb8ac7da5 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_disabled.png b/src/qt/qdarkstyle/dark/rc/window_close_disabled.png new file mode 100644 index 000000000..46de804b8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/window_close_disabled@2x.png new file mode 100644 index 000000000..8e4cd15d8 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_focus.png b/src/qt/qdarkstyle/dark/rc/window_close_focus.png new file mode 100644 index 000000000..bb7d8c511 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_focus@2x.png b/src/qt/qdarkstyle/dark/rc/window_close_focus@2x.png new file mode 100644 index 000000000..692ce24f2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_pressed.png b/src/qt/qdarkstyle/dark/rc/window_close_pressed.png new file mode 100644 index 000000000..53ae7f38e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_close_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/window_close_pressed@2x.png new file mode 100644 index 000000000..e02b12292 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_close_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip.png b/src/qt/qdarkstyle/dark/rc/window_grip.png new file mode 100644 index 000000000..db9ccb877 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip@2x.png b/src/qt/qdarkstyle/dark/rc/window_grip@2x.png new file mode 100644 index 000000000..30b0639f4 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_disabled.png b/src/qt/qdarkstyle/dark/rc/window_grip_disabled.png new file mode 100644 index 000000000..97c0e0f90 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/window_grip_disabled@2x.png new file mode 100644 index 000000000..7a3d8de6d Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_focus.png b/src/qt/qdarkstyle/dark/rc/window_grip_focus.png new file mode 100644 index 000000000..99b27c9ce Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_focus@2x.png b/src/qt/qdarkstyle/dark/rc/window_grip_focus@2x.png new file mode 100644 index 000000000..833cb90a9 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_pressed.png b/src/qt/qdarkstyle/dark/rc/window_grip_pressed.png new file mode 100644 index 000000000..afea9749e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_grip_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/window_grip_pressed@2x.png new file mode 100644 index 000000000..c1c1a0e4b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_grip_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize.png b/src/qt/qdarkstyle/dark/rc/window_minimize.png new file mode 100644 index 000000000..d8c54ebf2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize@2x.png b/src/qt/qdarkstyle/dark/rc/window_minimize@2x.png new file mode 100644 index 000000000..5421a3690 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_disabled.png b/src/qt/qdarkstyle/dark/rc/window_minimize_disabled.png new file mode 100644 index 000000000..cc51ed0ee Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/window_minimize_disabled@2x.png new file mode 100644 index 000000000..c1676469f Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_focus.png b/src/qt/qdarkstyle/dark/rc/window_minimize_focus.png new file mode 100644 index 000000000..1dcd083c0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_focus@2x.png b/src/qt/qdarkstyle/dark/rc/window_minimize_focus@2x.png new file mode 100644 index 000000000..2a4c868e0 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_pressed.png b/src/qt/qdarkstyle/dark/rc/window_minimize_pressed.png new file mode 100644 index 000000000..0bb532126 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_minimize_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/window_minimize_pressed@2x.png new file mode 100644 index 000000000..5a515c806 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_minimize_pressed@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock.png b/src/qt/qdarkstyle/dark/rc/window_undock.png new file mode 100644 index 000000000..d1f454259 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock@2x.png b/src/qt/qdarkstyle/dark/rc/window_undock@2x.png new file mode 100644 index 000000000..f0efa3429 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_disabled.png b/src/qt/qdarkstyle/dark/rc/window_undock_disabled.png new file mode 100644 index 000000000..6a609492b Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_disabled.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_disabled@2x.png b/src/qt/qdarkstyle/dark/rc/window_undock_disabled@2x.png new file mode 100644 index 000000000..c2e1b8fa7 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_disabled@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_focus.png b/src/qt/qdarkstyle/dark/rc/window_undock_focus.png new file mode 100644 index 000000000..d6eebbdc2 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_focus.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_focus@2x.png b/src/qt/qdarkstyle/dark/rc/window_undock_focus@2x.png new file mode 100644 index 000000000..1aef06053 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_focus@2x.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_pressed.png b/src/qt/qdarkstyle/dark/rc/window_undock_pressed.png new file mode 100644 index 000000000..8b6beb19e Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_pressed.png differ diff --git a/src/qt/qdarkstyle/dark/rc/window_undock_pressed@2x.png b/src/qt/qdarkstyle/dark/rc/window_undock_pressed@2x.png new file mode 100644 index 000000000..677ded425 Binary files /dev/null and b/src/qt/qdarkstyle/dark/rc/window_undock_pressed@2x.png differ diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index f77370574..72b0eef53 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #ifdef QT_STATIC /* Static builds need plugin imports */ @@ -42,15 +44,6 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin) # endif #endif -#ifdef Q_OS_WINDOWS -# include "qt_rendererstack.hpp" -# include "qt_winrawinputfilter.hpp" -# include "qt_winmanagerfilter.hpp" -# include <86box/win.h> -# include -# include -#endif - extern "C" { #include <86box/86box.h> #include <86box/config.h> @@ -64,6 +57,15 @@ extern "C" { #include <86box/version.h> } +#ifdef Q_OS_WINDOWS +# include "qt_rendererstack.hpp" +# include "qt_winrawinputfilter.hpp" +# include "qt_winmanagerfilter.hpp" +# include <86box/win.h> +# include +# include +#endif + #include #include #include @@ -339,6 +341,10 @@ main_thread_fn() static std::thread *main_thread; +#ifdef Q_OS_WINDOWS +extern bool windows_is_light_theme(); +#endif + int main(int argc, char *argv[]) { @@ -354,6 +360,23 @@ main(int argc, char *argv[]) QApplication app(argc, argv); QLocale::setDefault(QLocale::C); +#ifdef Q_OS_WINDOWS + Q_INIT_RESOURCE(darkstyle); + QApplication::setAttribute(Qt::AA_NativeWindows); + + if (!windows_is_light_theme()) { + QFile f(":qdarkstyle/dark/darkstyle.qss"); + + if (!f.exists()) { + printf("Unable to set stylesheet, file not found\n"); + } else { + f.open(QFile::ReadOnly | QFile::Text); + QTextStream ts(&f); + qApp->setStyleSheet(ts.readAll()); + } + } +#endif + qt_set_sequence_auto_mnemonic(false); Q_INIT_RESOURCE(qt_resources); Q_INIT_RESOURCE(qt_translations); diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 9db428051..25e33d77c 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -177,6 +177,7 @@ private: friend class ProgSettings; friend class RendererCommon; friend class RendererStack; // For UI variable access by non-primary renderer windows. + friend class WindowsRawInputFilter; // Needed to reload renderers on style sheet changes. }; #endif // QT_MAINWINDOW_HPP diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index a0ef86533..dd6c34efc 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -156,6 +156,7 @@ strnicmp(const char *s1, const char *s2, size_t n) void do_start(void) { + // } void @@ -557,7 +558,7 @@ endblit() std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } -} +} /*extern "C" */ #ifdef Q_OS_WINDOWS size_t diff --git a/src/qt/qt_styleoverride.cpp b/src/qt/qt_styleoverride.cpp index 7ec5a341c..60a7162a5 100644 --- a/src/qt/qt_styleoverride.cpp +++ b/src/qt/qt_styleoverride.cpp @@ -19,6 +19,13 @@ #include #include +#ifdef Q_OS_WINDOWS +#include +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif +#endif + int StyleOverride::styleHint( StyleHint hint, @@ -48,6 +55,11 @@ StyleOverride::polish(QWidget *widget) widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true); } widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false); +#ifdef Q_OS_WINDOWS + extern bool windows_is_light_theme(); + BOOL DarkMode = !windows_is_light_theme(); + DwmSetWindowAttribute((HWND)widget->winId(), DWMWA_USE_IMMERSIVE_DARK_MODE, (LPCVOID)&DarkMode, sizeof(DarkMode)); +#endif } if (qobject_cast(widget)) { diff --git a/src/qt/qt_winrawinputfilter.cpp b/src/qt/qt_winrawinputfilter.cpp index 73e8a2995..13e0ec9a7 100644 --- a/src/qt/qt_winrawinputfilter.cpp +++ b/src/qt/qt_winrawinputfilter.cpp @@ -34,15 +34,27 @@ #include "qt_winrawinputfilter.hpp" #include +#include +#include +#include +#include #include #include +#include +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif #include <86box/keyboard.h> #include <86box/mouse.h> #include <86box/plat.h> #include <86box/86box.h> +#include <86box/cdrom.h> +#include <86box/video.h> +#include +#include extern void win_keyboard_handle(uint32_t scancode, int up, int e0, int e1); @@ -50,6 +62,35 @@ extern void win_keyboard_handle(uint32_t scancode, int up, int e0, int e1); #include #include "qt_rendererstack.hpp" +#include "ui_qt_mainwindow.h" + +bool windows_is_light_theme() { + // based on https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application + + // The value is expected to be a REG_DWORD, which is a signed 32-bit little-endian + auto buffer = std::vector(4); + auto cbData = static_cast(buffer.size() * sizeof(char)); + auto res = RegGetValueW( + HKEY_CURRENT_USER, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + L"AppsUseLightTheme", + RRF_RT_REG_DWORD, // expected value type + nullptr, + buffer.data(), + &cbData); + + if (res != ERROR_SUCCESS) { + return 1; + } + + // convert bytes written to our buffer to an int, assuming little-endian + auto i = int(buffer[3] << 24 | + buffer[2] << 16 | + buffer[1] << 8 | + buffer[0]); + + return i == 1; +} extern "C" void win_joystick_handle(PRAWINPUT); std::unique_ptr @@ -113,34 +154,142 @@ WindowsRawInputFilter::~WindowsRawInputFilter() RegisterRawInputDevices(rid, 2, sizeof(rid[0])); } +static void +notify_drives(ULONG unitmask, int empty) +{ + char p[1024] = { 0 }; + + for (int i = 0; i < 26; ++i) { + if (unitmask & 0x1) { + cdrom_t *dev = NULL; + + sprintf(p, "ioctl://\\\\.\\%c:", 'A' + i); + + for (int i = 0; i < CDROM_NUM; i++) + if (!stricmp(cdrom[i].image_path, p)) { + dev = &(cdrom[i]); + if (empty) + cdrom_set_empty(dev); + else + cdrom_update_status(dev); + // pclog("CD-ROM %i : Drive notified of media %s\n", + // dev->id, empty ? "removal" : "change"); + } + } + + unitmask = unitmask >> 1; + } +} + +static void +device_change(WPARAM wParam, LPARAM lParam) +{ + PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR) lParam; + + switch(wParam) { + case DBT_DEVICEARRIVAL: + case DBT_DEVICEREMOVECOMPLETE: + /* Check whether a CD or DVD was inserted into a drive. */ + if (lpdb->dbch_devicetype == DBT_DEVTYP_VOLUME) { + PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME) lpdb; + + if (lpdbv->dbcv_flags & DBTF_MEDIA) + notify_drives(lpdbv->dbcv_unitmask, + (wParam == DBT_DEVICEREMOVECOMPLETE)); + } + break; + + default: + /* + Process other WM_DEVICECHANGE notifications for other + devices or reasons. + */ + break; + } +} + bool WindowsRawInputFilter::nativeEventFilter(const QByteArray &eventType, void *message, result_t *result) { if (eventType == "windows_generic_MSG") { MSG *msg = static_cast(message); - if (msg->message == WM_INPUT) { - - if (window->isActiveWindow() && menus_open == 0) - handle_input((HRAWINPUT) msg->lParam); - else - { - for (auto &w : window->renderers) { - if (w && w->isActiveWindow()) { - handle_input((HRAWINPUT) msg->lParam); - break; + if (msg != nullptr) switch(msg->message) { + case WM_INPUT: + if (window->isActiveWindow() && (menus_open == 0)) + handle_input((HRAWINPUT) msg->lParam); + else { + for (auto &w : window->renderers) { + if (w && w->isActiveWindow()) { + handle_input((HRAWINPUT) msg->lParam); + break; + } } } - } - - return true; - } - - /* Stop processing of Alt-F4 */ - if (msg->message == WM_SYSKEYDOWN) { - if (msg->wParam == 0x73) { return true; - } + case WM_SETTINGCHANGE: + if ((((void *) msg->lParam) != nullptr) && + (wcscmp(L"ImmersiveColorSet", (wchar_t*)msg->lParam) == 0)) { + + if (!windows_is_light_theme()) { + QFile f(":qdarkstyle/dark/darkstyle.qss"); + + if (!f.exists()) + printf("Unable to set stylesheet, file not found\n"); + else { + f.open(QFile::ReadOnly | QFile::Text); + QTextStream ts(&f); + qApp->setStyleSheet(ts.readAll()); + } + QTimer::singleShot(1000, [this] () { + BOOL DarkMode = TRUE; + auto vid_stack = (RendererStack::Renderer) vid_api; + DwmSetWindowAttribute((HWND) window->winId(), + DWMWA_USE_IMMERSIVE_DARK_MODE, + (LPCVOID) &DarkMode, + sizeof(DarkMode)); + window->ui->stackedWidget->switchRenderer(vid_stack); + for (int i = 1; i < MONITORS_NUM; i++) { + if ((window->renderers[i] != nullptr) && + !window->renderers[i]->isHidden()) + window->renderers[i]->switchRenderer(vid_stack); + } + }); + } else { + qApp->setStyleSheet(""); + QTimer::singleShot(1000, [this] () { + BOOL DarkMode = FALSE; + DwmSetWindowAttribute((HWND) window->winId(), + DWMWA_USE_IMMERSIVE_DARK_MODE, + (LPCVOID) &DarkMode, + sizeof(DarkMode)); + }); + } + + QTimer::singleShot(1000, [this] () { + window->resizeContents(monitors[0].mon_scrnsz_x, + monitors[0].mon_scrnsz_y); + for (int i = 1; i < MONITORS_NUM; i++) { + auto mon = &(monitors[i]); + + if ((window->renderers[i] != nullptr) && + !window->renderers[i]->isHidden()) + window->resizeContentsMonitor(mon->mon_scrnsz_x, + mon->mon_scrnsz_y, + i); + } + }); + } + break; + case WM_SYSKEYDOWN: + /* Stop processing of Alt-F4 */ + if (msg->wParam == 0x73) + return true; + break; + case WM_DEVICECHANGE: + if (msg->hwnd == (HWND) window->winId()) + device_change(msg->wParam, msg->lParam); + break; } } diff --git a/src/qt/win_cdrom_ioctl.c b/src/qt/win_cdrom_ioctl.c index 271f7226f..621cf0b76 100644 --- a/src/qt/win_cdrom_ioctl.c +++ b/src/qt/win_cdrom_ioctl.c @@ -30,10 +30,13 @@ #include #include #include +#include #include +#include <86box/86box.h> #include <86box/cdrom.h> #include <86box/log.h> #include <86box/plat_cdrom_ioctl.h> +#include <86box/scsi_device.h> typedef struct ioctl_t { cdrom_t *dev; @@ -41,7 +44,6 @@ typedef struct ioctl_t { int is_dvd; int has_audio; int32_t tracks_num; - int toc_valid; uint8_t cur_toc[65536]; CDROM_READ_TOC_EX cur_read_toc_ex; int blocks_num; @@ -50,9 +52,8 @@ typedef struct ioctl_t { WCHAR path[256]; } ioctl_t; -static void ioctl_read_toc(ioctl_t *ioctl); -static int ioctl_read_dvd_structure(const void *local, uint8_t layer, uint8_t format, - uint8_t *buffer, uint32_t *info); +static int ioctl_read_dvd_structure(const void *local, uint8_t layer, uint8_t format, + uint8_t *buffer, uint32_t *info); #ifdef ENABLE_IOCTL_LOG int ioctl_do_log = ENABLE_IOCTL_LOG; @@ -93,25 +94,6 @@ ioctl_open_handle(ioctl_t *ioctl) return (ioctl->handle != INVALID_HANDLE_VALUE); } -static int -ioctl_load(ioctl_t *ioctl) -{ - int ret = 0; - - if (ioctl_open_handle(ioctl)) { - long size; - DeviceIoControl(ioctl->handle, IOCTL_STORAGE_LOAD_MEDIA, - NULL, 0, NULL, 0, - (LPDWORD) &size, NULL); - ret = 1; - ioctl_close_handle(ioctl); - - ioctl_read_toc(ioctl); - } - - return ret; -} - static int ioctl_read_normal_toc(ioctl_t *ioctl, uint8_t *toc_buf) { @@ -265,11 +247,8 @@ ioctl_read_raw_toc(ioctl_t *ioctl) static void ioctl_read_toc(ioctl_t *ioctl) { - if (!ioctl->toc_valid) { - ioctl->toc_valid = 1; - (void) ioctl_read_normal_toc(ioctl, ioctl->cur_toc); - ioctl_read_raw_toc(ioctl); - } + (void) ioctl_read_normal_toc(ioctl, ioctl->cur_toc); + ioctl_read_raw_toc(ioctl); } static int @@ -300,8 +279,6 @@ ioctl_is_track_audio(const ioctl_t *ioctl, const uint32_t pos) const raw_track_info_t *rti = (const raw_track_info_t *) ioctl->cur_rti; int ret = 0; - ioctl_read_toc((ioctl_t *) ioctl); - if (ioctl->has_audio && !ioctl->is_dvd) { const int track = ioctl_get_track(ioctl, pos); const int control = rti[track].adr_ctl; @@ -323,8 +300,6 @@ ioctl_get_track_info(const void *local, const uint32_t track, const CDROM_TOC *toc = (const CDROM_TOC *) ioctl->cur_toc; int ret = 1; - ioctl_read_toc((ioctl_t *) ioctl); - if ((track < 1) || (track == 0xaa) || (track > (toc->LastTrack + 1))) { ioctl_log(ioctl->log, "ioctl_get_track_info(%02i)\n", track); ret = 0; @@ -362,8 +337,6 @@ ioctl_is_track_pre(const void *local, const uint32_t sector) const raw_track_info_t *rti = (const raw_track_info_t *) ioctl->cur_rti; int ret = 0; - ioctl_read_toc((ioctl_t *) ioctl); - if (ioctl->has_audio && !ioctl->is_dvd) { const int track = ioctl_get_track(ioctl, sector); const int control = rti[track].adr_ctl; @@ -571,8 +544,6 @@ ioctl_get_last_block(const void *local) const CDROM_TOC *toc = (const CDROM_TOC *) ioctl->cur_toc; uint32_t lb = 0; - ioctl_read_toc((ioctl_t *) ioctl); - for (int c = 0; c <= toc->LastTrack; c++) { const TRACK_DATA *td = &toc->TrackData[c]; const uint32_t address = MSFtoLBA(td->Address[1], td->Address[2], @@ -687,44 +658,80 @@ ioctl_has_audio(const void *local) } static int -ioctl_ext_medium_changed(void *local) +ioctl_is_empty(const void *local) { - ioctl_t * ioctl = (ioctl_t *) local; - const CDROM_TOC *toc = (CDROM_TOC *) ioctl->cur_toc; - const TRACK_DATA *ltd = &toc->TrackData[toc->LastTrack]; - const uint32_t old_addr = *(uint32_t *) ltd->Address; - const int temp = ioctl_read_normal_toc(ioctl, ioctl->cur_toc); - int ret = 0; + typedef struct SCSI_PASS_THROUGH_DIRECT_BUF { + SCSI_PASS_THROUGH_DIRECT spt; + ULONG Filler; + UCHAR SenseBuf[64]; + } SCSI_PASS_THROUGH_DIRECT_BUF; - if (temp == 1) { - if (ioctl->toc_valid && ((*(uint32_t *) ltd->Address) != old_addr)) { - /* The TOC has changed. */ - ioctl->toc_valid = 0; - ret = 1; - } + const ioctl_t * ioctl = (const ioctl_t *) local; + unsigned long int unused = 0; + SCSI_PASS_THROUGH_DIRECT_BUF req; - if (!ioctl->toc_valid) { - ioctl->toc_valid = 1; - ioctl_read_raw_toc(ioctl); - } - } else { - /* There has been some kind of error - not a medium change, but a not ready - condition. */ - ret = -1; - } + ioctl_open_handle((ioctl_t *) ioctl); - if (ret == 1) { - if (ioctl->is_dvd) - ioctl->dev->cd_status = CD_STATUS_DVD; - else - ioctl->dev->cd_status = ioctl->has_audio ? CD_STATUS_STOPPED : - CD_STATUS_DATA_ONLY; + memset(&req, 0x00, sizeof(SCSI_PASS_THROUGH_DIRECT_BUF)); + req.spt.Length = sizeof(SCSI_PASS_THROUGH_DIRECT); + req.spt.PathId = 0; + req.spt.TargetId = 1; + req.spt.Lun = 0; + req.spt.CdbLength = 12; + req.spt.DataIn = SCSI_IOCTL_DATA_IN; + req.spt.SenseInfoLength = sizeof(req.SenseBuf); + req.spt.DataTransferLength = 0; + req.spt.TimeOutValue = 6; + req.spt.DataBuffer = NULL; + req.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_DIRECT_BUF, SenseBuf); - ioctl->dev->cdrom_capacity = ioctl_get_last_block(ioctl); - } else if (ret == -1) - ioctl->dev->cd_status = CD_STATUS_EMPTY; + /* Fill in the CDB. */ + req.spt.Cdb[0] = 0x00; + req.spt.Cdb[1] = 0x00; + req.spt.Cdb[2] = 0x00; + req.spt.Cdb[3] = 0x00; + req.spt.Cdb[4] = 0x00; + req.spt.Cdb[5] = 0x00; + req.spt.Cdb[6] = 0x00; + req.spt.Cdb[7] = 0x00; + req.spt.Cdb[8] = 0x00; + req.spt.Cdb[9] = 0x00; + req.spt.Cdb[10] = 0x00; + req.spt.Cdb[11] = 0x00; - ioctl_log(ioctl->log, "ioctl_ext_medium_changed(): %i\n", ret); + DWORD length = sizeof(SCSI_PASS_THROUGH_DIRECT_BUF); + +#ifdef ENABLE_IOCTL_LOG + uint8_t *cdb = (uint8_t *) req.spt.Cdb; + ioctl_log(ioctl->log, "Host CDB: %02X %02X %02X %02X %02X %02X " + "%02X %02X %02X %02X %02X %02X\n", + cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], + cdb[6], cdb[7], cdb[8], cdb[9], cdb[10], cdb[11]); +#endif + + int ret = DeviceIoControl(ioctl->handle, IOCTL_SCSI_PASS_THROUGH_DIRECT, + &req, length, + &req, length, + &unused, NULL); + + ioctl_log(ioctl->log, "ioctl_read_dvd_structure(): ret = %d, " + "req.spt.DataTransferLength = %lu\n", + ret, req.spt.DataTransferLength); + ioctl_log(ioctl->log, "Sense: %08X, %08X\n", req.spt.SenseInfoLength, + req.spt.SenseInfoOffset); + + if (req.spt.SenseInfoLength >= 16) { + uint8_t *sb = (uint8_t *) req.SenseBuf; + /* Return sense to the host as is. */ + ret = ((sb[2] == SENSE_NOT_READY) && (sb[12] == ASC_MEDIUM_NOT_PRESENT)); + ioctl_log(ioctl->log, "Host sense: %02X %02X %02X %02X %02X %02X %02X %02X\n", + sb[0], sb[1], sb[ 2], sb[ 3], sb[ 4], sb[ 5], sb[ 6], sb[ 7]); + ioctl_log(ioctl->log, " %02X %02X %02X %02X %02X %02X %02X %02X\n", + sb[8], sb[9], sb[10], sb[11], sb[12], sb[13], sb[14], sb[15]); + } else + ret = 0; + + ioctl_close_handle((ioctl_t *) ioctl); return ret; } @@ -743,6 +750,22 @@ ioctl_close(void *local) ioctl->log = NULL; } +static void +ioctl_load(const void *local) +{ + const ioctl_t *ioctl = (const ioctl_t *) local; + + if (ioctl_open_handle((ioctl_t *) ioctl)) { + long size; + DeviceIoControl(ioctl->handle, IOCTL_STORAGE_LOAD_MEDIA, + NULL, 0, NULL, 0, + (LPDWORD) &size, NULL); + ioctl_close_handle((ioctl_t *) ioctl); + + ioctl_read_toc((ioctl_t *) ioctl); + } +} + static const cdrom_ops_t ioctl_ops = { ioctl_get_track_info, ioctl_get_raw_track_info, @@ -753,8 +776,9 @@ static const cdrom_ops_t ioctl_ops = { ioctl_read_dvd_structure, ioctl_is_dvd, ioctl_has_audio, - ioctl_ext_medium_changed, - ioctl_close + ioctl_is_empty, + ioctl_close, + ioctl_load }; /* Public functions. */ @@ -775,7 +799,6 @@ ioctl_open(cdrom_t *dev, const char *drv) ioctl_log(ioctl->log, "Path is %S\n", ioctl->path); ioctl->dev = dev; - ioctl->toc_valid = 0; dev->ops = &ioctl_ops; diff --git a/src/qt/win_opendir.c b/src/qt/win_opendir.c index 051ed20bb..46c7eb21e 100644 --- a/src/qt/win_opendir.c +++ b/src/qt/win_opendir.c @@ -40,21 +40,19 @@ opendir(const char *name) DIR *p; /* Create a new control structure. */ - p = (DIR *) malloc(sizeof(DIR)); + p = (DIR *) calloc(1, sizeof(DIR)); if (p == NULL) return (NULL); - memset(p, 0x00, sizeof(DIR)); p->flags = (DIR_F_LOWER | DIR_F_SANE); p->offset = 0; p->sts = 0; /* Create a work area. */ - p->dta = (char *) malloc(sizeof(FINDATA)); + p->dta = (char *) calloc(1, sizeof(FINDATA)); if (p->dta == NULL) { free(p); return (NULL); } - memset(p->dta, 0x00, sizeof(struct _finddata_t)); /* Add search filespec. */ strcpy(p->dir, name); diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 9e19e8524..b6a1698c5 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -925,8 +925,7 @@ aha_setnvr(x54x_t *dev) return; /* Allocate and initialize the EEPROM. */ - dev->nvr = (uint8_t *) malloc(NVR_SIZE); - memset(dev->nvr, 0x00, NVR_SIZE); + dev->nvr = (uint8_t *) calloc(1, NVR_SIZE); fp = nvr_fopen(dev->nvr_path, "rb"); if (fp) { diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 6d95ce44a..b235f2c3c 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1546,8 +1546,7 @@ buslogic_init(const device_t *info) dev = x54x_init(info); dev->bus = scsi_get_bus(); - dev->ven_data = malloc(sizeof(buslogic_data_t)); - memset(dev->ven_data, 0x00, sizeof(buslogic_data_t)); + dev->ven_data = calloc(1, sizeof(buslogic_data_t)); bl = (buslogic_data_t *) dev->ven_data; diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 33858ebbc..04c6532df 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -678,8 +678,13 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) dev->callback += period; scsi_cdrom_set_callback(dev); return; + case 0x43: + dev->drv->seek_diff = dev->drv->seek_pos + 150; + dev->drv->seek_pos = 0; + fallthrough; case 0x08: case 0x28: + case 0x42: case 0x44: case 0xa8: /* Seek time is in us. */ period = cdrom_seek_time(dev->drv); @@ -693,7 +698,7 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) dev->callback += period; fallthrough; case 0x25: - case 0x42 ... 0x44: + // case 0x42 ... 0x44: case 0x51 ... 0x52: case 0xad: case 0xb8 ... 0xb9: @@ -702,6 +707,11 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) dev->callback += 40.0; /* Account for seek time. */ /* 44100 * 16 bits * 2 channels = 176400 bytes per second */ + /* + TODO: This is a bit of a lie - the actual period is closer to + 75 * 2448 bytes per second, because the subchannel data + has to be read as well. + */ bytes_per_second = 176400.0; bytes_per_second *= (double) dev->drv->cur_speed; break; @@ -730,7 +740,19 @@ scsi_cdrom_command_common(scsi_cdrom_t *dev) period = 1000000.0 / bytes_per_second; scsi_cdrom_log(dev->log, "Byte transfer period: %" PRIu64 " us\n", (uint64_t) period); - period = period * (double) (dev->packet_len); + switch (cmd) { + default: + period = period * (double) (dev->packet_len); + break; + case 0x42: case 0x44: + /* READ SUBCHANNEL or READ HEADER - period of 1 entire sector. */ + period = period * 2352.0; + break; + case 0x43: + /* READ TOC - period of 175 entire frames. */ + period = period * 150.0 * 2352.0; + break; + } scsi_cdrom_log(dev->log, "Sector transfer period: %" PRIu64 " us\n", (uint64_t) period); dev->callback += period; @@ -1181,25 +1203,6 @@ scsi_cdrom_insert(void *priv) } } -static void -scsi_cdrom_ext_insert(void *priv, int ext_medium_changed) -{ - scsi_cdrom_t *dev = (scsi_cdrom_t *) priv; - - if ((dev == NULL) || (dev->drv == NULL)) - return; - - if ((dev->drv->ops == NULL) || (ext_medium_changed == -1)) { - dev->unit_attention = 0; - dev->drv->cd_status = CD_STATUS_EMPTY; - scsi_cdrom_log(dev->log, "External media removal\n"); - } else if (ext_medium_changed == 1) { - dev->unit_attention = 0; - dev->drv->cd_status |= CD_STATUS_TRANSITION; - scsi_cdrom_log(dev->log, "External media transition\n"); - } -} - static int scsi_command_check_ready(const scsi_cdrom_t *dev, const uint8_t *cdb) { @@ -1223,7 +1226,6 @@ static int scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, const uint8_t *cdb) { int ready; - const int ext_medium_changed = cdrom_ext_medium_changed(dev->drv); if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) { @@ -1257,9 +1259,6 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, const uint8_t *cdb) return 0; } - if (ext_medium_changed != 0) - scsi_cdrom_ext_insert((void *) dev, ext_medium_changed); - if ((dev->drv->cd_status == CD_STATUS_PLAYING) || (dev->drv->cd_status == CD_STATUS_PAUSED)) { ready = 1; @@ -1270,13 +1269,10 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, const uint8_t *cdb) if ((cdb[0] == GPCMD_TEST_UNIT_READY) || (cdb[0] == GPCMD_REQUEST_SENSE)) ready = 0; else { - if ((ext_medium_changed != 0) || - !(scsi_cdrom_command_flags[cdb[0]] & ALLOW_UA)) { - scsi_cdrom_log(dev->log, "(ext_medium_changed != 0): scsi_cdrom_insert()\n"); + if (!(scsi_cdrom_command_flags[cdb[0]] & ALLOW_UA)) scsi_cdrom_insert((void *) dev); - } - ready = (dev->drv->cd_status != CD_STATUS_EMPTY) || (ext_medium_changed == -1); + ready = (dev->drv->cd_status != CD_STATUS_EMPTY); } } else ready = (dev->drv->cd_status != CD_STATUS_EMPTY); @@ -1469,10 +1465,6 @@ void scsi_cdrom_request_sense_for_scsi(scsi_common_t *sc, uint8_t *buffer, uint8_t alloc_length) { scsi_cdrom_t *dev = (scsi_cdrom_t *) sc; - const int ext_medium_changed = cdrom_ext_medium_changed(dev->drv); - - if (ext_medium_changed != 0) - scsi_cdrom_ext_insert((void *) dev, ext_medium_changed); if ((dev->drv->cd_status == CD_STATUS_EMPTY) && dev->unit_attention) { /* @@ -1524,7 +1516,7 @@ scsi_cdrom_set_speed(scsi_cdrom_t *dev, const uint8_t *cdb) } static uint8_t -scsi_cdrom_command_chinon(void *sc, const uint8_t *cdb, int32_t *BufLen) +scsi_cdrom_command_chinon(void *sc, const uint8_t *cdb, UNUSED(int32_t *BufLen)) { scsi_cdrom_t *dev = (scsi_cdrom_t *) sc; uint8_t cmd_stat = 0x00; @@ -1761,7 +1753,7 @@ scsi_cdrom_command_dec_sony_texel(void *sc, const uint8_t *cdb, int32_t *BufLen) } static uint8_t -scsi_cdrom_command_matsushita(void *sc, const uint8_t *cdb, int32_t *BufLen) +scsi_cdrom_command_matsushita(void *sc, const uint8_t *cdb, UNUSED(int32_t *BufLen)) { scsi_cdrom_t *dev = (scsi_cdrom_t *) sc; const uint8_t cmd_stat = 0x00; @@ -3581,7 +3573,7 @@ scsi_cdrom_close(void *priv) } static int -scsi_cdrom_get_max(const ide_t *ide, const int ide_has_dma, const int type) +scsi_cdrom_get_max(const ide_t *ide, UNUSED(const int ide_has_dma), const int type) { const scsi_cdrom_t *dev = (scsi_cdrom_t *) ide->sc; int ret; @@ -3600,7 +3592,7 @@ scsi_cdrom_get_max(const ide_t *ide, const int ide_has_dma, const int type) } static int -scsi_cdrom_get_timings(const ide_t *ide, const int ide_has_dma, const int type) +scsi_cdrom_get_timings(const ide_t *ide, UNUSED(const int ide_has_dma), const int type) { const scsi_cdrom_t *dev = (scsi_cdrom_t *) ide->sc; int has_dma = cdrom_has_dma(dev->drv->type); @@ -3628,7 +3620,7 @@ scsi_cdrom_get_timings(const ide_t *ide, const int ide_has_dma, const int type) * Fill in ide->buffer with the output of the "IDENTIFY PACKET DEVICE" command */ static void -scsi_cdrom_identify(const ide_t *ide, const int ide_has_dma) +scsi_cdrom_identify(const ide_t *ide, UNUSED(const int ide_has_dma)) { const scsi_cdrom_t *dev = (scsi_cdrom_t *) ide->sc; char model[2048] = { 0 }; diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index c11f09443..878259094 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -1642,7 +1642,7 @@ scsi_disk_phase_data_out(scsi_common_t *sc) } static int -scsi_disk_get_max(const ide_t *ide, int ide_has_dma, const int type) +scsi_disk_get_max(UNUSED(const ide_t *ide), int ide_has_dma, const int type) { int ret; @@ -1668,7 +1668,7 @@ scsi_disk_get_max(const ide_t *ide, int ide_has_dma, const int type) } static int -scsi_disk_get_timings(const ide_t *ide, const int ide_has_dma, const int type) +scsi_disk_get_timings(UNUSED(const ide_t *ide), const int ide_has_dma, const int type) { int ret; diff --git a/src/scsi/scsi_ncr53c400.c b/src/scsi/scsi_ncr53c400.c index def001624..d8008cf02 100644 --- a/src/scsi/scsi_ncr53c400.c +++ b/src/scsi/scsi_ncr53c400.c @@ -632,14 +632,10 @@ ncr53c400_init(const device_t *info) { const char *bios_ver = NULL; const char *fn; - ncr53c400_t *ncr400; - ncr_t *ncr; + ncr53c400_t *ncr400 = calloc(1, sizeof(ncr53c400_t)); + ncr_t *ncr = &ncr400->ncr; scsi_bus_t *scsi_bus; - ncr400 = malloc(sizeof(ncr53c400_t)); - memset(ncr400, 0x00, sizeof(ncr53c400_t)); - ncr = &ncr400->ncr; - ncr400->type = info->local; ncr->bus = scsi_get_bus(); diff --git a/src/scsi/scsi_ncr53c8xx.c b/src/scsi/scsi_ncr53c8xx.c index 27542028a..d26da3bb3 100644 --- a/src/scsi/scsi_ncr53c8xx.c +++ b/src/scsi/scsi_ncr53c8xx.c @@ -2530,10 +2530,7 @@ ncr53c8xx_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) static void * ncr53c8xx_init(const device_t *info) { - ncr53c8xx_t *dev; - - dev = malloc(sizeof(ncr53c8xx_t)); - memset(dev, 0x00, sizeof(ncr53c8xx_t)); + ncr53c8xx_t *dev = calloc(1, sizeof(ncr53c8xx_t)); dev->bus = scsi_get_bus(); diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index e8f256bed..012d5524b 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -2204,10 +2204,7 @@ esp_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) static void * dc390_init(UNUSED(const device_t *info)) { - esp_t *dev; - - dev = malloc(sizeof(esp_t)); - memset(dev, 0x00, sizeof(esp_t)); + esp_t *dev = calloc(1, sizeof(esp_t)); dev->bus = scsi_get_bus(); @@ -2419,10 +2416,7 @@ ncr53c9x_mca_feedb(void *priv) static void * ncr53c9x_mca_init(const device_t *info) { - esp_t *dev; - - dev = malloc(sizeof(esp_t)); - memset(dev, 0x00, sizeof(esp_t)); + esp_t *dev = calloc(1, sizeof(esp_t)); dev->bus = scsi_get_bus(); diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index 8be075833..cbf6ff205 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -1162,8 +1162,7 @@ spock_mca_reset(void *priv) static void * spock_init(const device_t *info) { - spock_t *scsi = malloc(sizeof(spock_t)); - memset(scsi, 0x00, sizeof(spock_t)); + spock_t *scsi = calloc(1, sizeof(spock_t)); scsi->bus = scsi_get_bus(); diff --git a/src/scsi/scsi_t128.c b/src/scsi/scsi_t128.c index 92de9d17b..ff5f584f1 100644 --- a/src/scsi/scsi_t128.c +++ b/src/scsi/scsi_t128.c @@ -472,14 +472,10 @@ t228_feedb(void *priv) static void * t128_init(const device_t *info) { - t128_t *t128; - ncr_t *ncr; + t128_t *t128 = calloc(1, sizeof(t128_t)); + ncr_t *ncr = &t128->ncr; scsi_bus_t *scsi_bus; - t128 = malloc(sizeof(t128_t)); - memset(t128, 0x00, sizeof(t128_t)); - ncr = &t128->ncr; - ncr->bus = scsi_get_bus(); scsi_bus = &ncr->scsibus; diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index 6876e4385..c248fbe92 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -287,10 +287,9 @@ x54x_bios_scsi_command(scsi_device_t *dev, uint8_t *cdb, uint8_t *buf, int len, static uint8_t x54x_bios_read_capacity(scsi_device_t *sd, uint8_t *buf, int transfer_size) { - uint8_t *cdb; + uint8_t *cdb = (uint8_t *) malloc(12);; uint8_t ret; - cdb = (uint8_t *) malloc(12); memset(cdb, 0, 12); cdb[0] = GPCMD_READ_CDROM_CAPACITY; @@ -305,10 +304,9 @@ x54x_bios_read_capacity(scsi_device_t *sd, uint8_t *buf, int transfer_size) static uint8_t x54x_bios_inquiry(scsi_device_t *sd, uint8_t *buf, int transfer_size) { - uint8_t *cdb; + uint8_t *cdb = (uint8_t *) malloc(12); uint8_t ret; - cdb = (uint8_t *) malloc(12); memset(cdb, 0, 12); cdb[0] = GPCMD_INQUIRY; cdb[4] = 36; @@ -324,14 +322,13 @@ x54x_bios_inquiry(scsi_device_t *sd, uint8_t *buf, int transfer_size) static uint8_t x54x_bios_command_08(scsi_device_t *sd, uint8_t *buffer, int transfer_size) { - uint8_t *rcbuf; + uint8_t *rcbuf = (uint8_t *) malloc(8); uint8_t ret; int i; memset(buffer, 0x00, 6); - rcbuf = (uint8_t *) malloc(8); - ret = x54x_bios_read_capacity(sd, rcbuf, transfer_size); + ret = x54x_bios_read_capacity(sd, rcbuf, transfer_size); if (ret) { free(rcbuf); return ret; @@ -353,13 +350,12 @@ x54x_bios_command_08(scsi_device_t *sd, uint8_t *buffer, int transfer_size) static int x54x_bios_command_15(scsi_device_t *sd, uint8_t *buffer, int transfer_size) { - uint8_t *inqbuf; + uint8_t *inqbuf = (uint8_t *) malloc(36); uint8_t *rcbuf; uint8_t ret; memset(buffer, 0x00, 6); - inqbuf = (uint8_t *) malloc(36); ret = x54x_bios_inquiry(sd, inqbuf, transfer_size); if (ret) { free(inqbuf); @@ -1896,13 +1892,11 @@ x54x_mem_disable(x54x_t *dev) void * x54x_init(const device_t *info) { - x54x_t *dev; + x54x_t *dev = calloc(1, sizeof(x54x_t)); /* Allocate control block and set up basic stuff. */ - dev = malloc(sizeof(x54x_t)); if (dev == NULL) return dev; - memset(dev, 0x00, sizeof(x54x_t)); dev->type = info->local; dev->card_bus = info->flags; diff --git a/src/sio/sio_82091aa.c b/src/sio/sio_82091aa.c index 59349dcbe..76c7ba3f5 100644 --- a/src/sio/sio_82091aa.c +++ b/src/sio/sio_82091aa.c @@ -257,8 +257,7 @@ i82091aa_close(void *priv) static void * i82091aa_init(const device_t *info) { - i82091aa_t *dev = (i82091aa_t *) malloc(sizeof(i82091aa_t)); - memset(dev, 0, sizeof(i82091aa_t)); + i82091aa_t *dev = (i82091aa_t *) calloc(1, sizeof(i82091aa_t)); dev->fdc = device_add(&fdc_at_device); diff --git a/src/sio/sio_acc3221.c b/src/sio/sio_acc3221.c index 6fcac024c..d52949d46 100644 --- a/src/sio/sio_acc3221.c +++ b/src/sio/sio_acc3221.c @@ -454,8 +454,7 @@ acc3221_close(void *priv) static void * acc3221_init(UNUSED(const device_t *info)) { - acc3221_t *dev = (acc3221_t *) malloc(sizeof(acc3221_t)); - memset(dev, 0, sizeof(acc3221_t)); + acc3221_t *dev = (acc3221_t *) calloc(1, sizeof(acc3221_t)); dev->fdc = device_add(&fdc_at_device); diff --git a/src/sio/sio_ali5123.c b/src/sio/sio_ali5123.c index ce250ff2b..5380e065a 100644 --- a/src/sio/sio_ali5123.c +++ b/src/sio/sio_ali5123.c @@ -463,8 +463,7 @@ ali5123_close(void *priv) static void * ali5123_init(const device_t *info) { - ali5123_t *dev = (ali5123_t *) malloc(sizeof(ali5123_t)); - memset(dev, 0, sizeof(ali5123_t)); + ali5123_t *dev = (ali5123_t *) calloc(1, sizeof(ali5123_t)); dev->fdc = device_add(&fdc_at_ali_device); diff --git a/src/sio/sio_detect.c b/src/sio/sio_detect.c index ae34730ac..ffa0ec9d0 100644 --- a/src/sio/sio_detect.c +++ b/src/sio/sio_detect.c @@ -65,8 +65,7 @@ sio_detect_close(void *priv) static void * sio_detect_init(UNUSED(const device_t *info)) { - sio_detect_t *dev = (sio_detect_t *) malloc(sizeof(sio_detect_t)); - memset(dev, 0, sizeof(sio_detect_t)); + sio_detect_t *dev = (sio_detect_t *) calloc(1, sizeof(sio_detect_t)); device_add(&fdc_at_smc_device); diff --git a/src/sio/sio_f82c710.c b/src/sio/sio_f82c710.c index 04dcf109a..8882f16e0 100644 --- a/src/sio/sio_f82c710.c +++ b/src/sio/sio_f82c710.c @@ -364,8 +364,7 @@ f82c710_close(void *priv) static void * f82c710_init(const device_t *info) { - upc_t *dev = (upc_t *) malloc(sizeof(upc_t)); - memset(dev, 0, sizeof(upc_t)); + upc_t *dev = (upc_t *) calloc(1, sizeof(upc_t)); dev->local = info->local; if (dev->local == 606) { diff --git a/src/sio/sio_fdc37c669.c b/src/sio/sio_fdc37c669.c index 7f02026e5..7f97e79b0 100644 --- a/src/sio/sio_fdc37c669.c +++ b/src/sio/sio_fdc37c669.c @@ -335,8 +335,7 @@ fdc37c669_close(void *priv) static void * fdc37c669_init(const device_t *info) { - fdc37c669_t *dev = (fdc37c669_t *) malloc(sizeof(fdc37c669_t)); - memset(dev, 0, sizeof(fdc37c669_t)); + fdc37c669_t *dev = (fdc37c669_t *) calloc(1, sizeof(fdc37c669_t)); dev->id = next_id; diff --git a/src/sio/sio_fdc37c67x.c b/src/sio/sio_fdc37c67x.c index bac4685f5..f0fb8cd64 100644 --- a/src/sio/sio_fdc37c67x.c +++ b/src/sio/sio_fdc37c67x.c @@ -591,8 +591,7 @@ fdc37c67x_close(void *priv) static void * fdc37c67x_init(const device_t *info) { - fdc37c67x_t *dev = (fdc37c67x_t *) malloc(sizeof(fdc37c67x_t)); - memset(dev, 0, sizeof(fdc37c67x_t)); + fdc37c67x_t *dev = (fdc37c67x_t *) calloc(1, sizeof(fdc37c67x_t)); dev->fdc = device_add(&fdc_at_smc_device); diff --git a/src/sio/sio_fdc37c6xx.c b/src/sio/sio_fdc37c6xx.c index 6340218b7..530fff216 100644 --- a/src/sio/sio_fdc37c6xx.c +++ b/src/sio/sio_fdc37c6xx.c @@ -312,8 +312,7 @@ fdc37c6xx_close(void *priv) static void * fdc37c6xx_init(const device_t *info) { - fdc37c6xx_t *dev = (fdc37c6xx_t *) malloc(sizeof(fdc37c6xx_t)); - memset(dev, 0, sizeof(fdc37c6xx_t)); + fdc37c6xx_t *dev = (fdc37c6xx_t *) calloc(1, sizeof(fdc37c6xx_t)); dev->fdc = device_add(&fdc_at_smc_device); diff --git a/src/sio/sio_fdc37c93x.c b/src/sio/sio_fdc37c93x.c index 0279903c6..42908ecaf 100644 --- a/src/sio/sio_fdc37c93x.c +++ b/src/sio/sio_fdc37c93x.c @@ -918,8 +918,7 @@ access_bus_close(void *priv) static void * access_bus_init(UNUSED(const device_t *info)) { - access_bus_t *dev = (access_bus_t *) malloc(sizeof(access_bus_t)); - memset(dev, 0, sizeof(access_bus_t)); + access_bus_t *dev = (access_bus_t *) calloc(1, sizeof(access_bus_t)); return dev; } @@ -950,8 +949,7 @@ static void * fdc37c93x_init(const device_t *info) { int is_compaq; - fdc37c93x_t *dev = (fdc37c93x_t *) malloc(sizeof(fdc37c93x_t)); - memset(dev, 0, sizeof(fdc37c93x_t)); + fdc37c93x_t *dev = (fdc37c93x_t *) calloc(1, sizeof(fdc37c93x_t)); dev->fdc = device_add(&fdc_at_smc_device); diff --git a/src/sio/sio_fdc37m60x.c b/src/sio/sio_fdc37m60x.c index aab4d8968..671b3581b 100644 --- a/src/sio/sio_fdc37m60x.c +++ b/src/sio/sio_fdc37m60x.c @@ -306,8 +306,7 @@ fdc37m60x_close(void *priv) static void * fdc37m60x_init(const device_t *info) { - fdc37m60x_t *dev = (fdc37m60x_t *) malloc(sizeof(fdc37m60x_t)); - memset(dev, 0, sizeof(fdc37m60x_t)); + fdc37m60x_t *dev = (fdc37m60x_t *) calloc(1, sizeof(fdc37m60x_t)); SIO_INDEX_PORT = info->local; dev->fdc = device_add(&fdc_at_smc_device); diff --git a/src/sio/sio_it86x1f.c b/src/sio/sio_it86x1f.c index 610d69197..1cde8657e 100644 --- a/src/sio/sio_it86x1f.c +++ b/src/sio/sio_it86x1f.c @@ -602,7 +602,7 @@ it86x1f_pnp_write_vendor_reg(uint8_t ld, uint8_t reg, uint8_t val, void *priv) } static void -it86x1f_write_addr(uint16_t port, uint8_t val, void *priv) +it86x1f_write_addr(UNUSED(uint16_t port), uint8_t val, void *priv) { it86x1f_t *dev = (it86x1f_t *) priv; @@ -623,7 +623,7 @@ it86x1f_write_addr(uint16_t port, uint8_t val, void *priv) } static void -it86x1f_write_data(uint16_t port, uint8_t val, void *priv) +it86x1f_write_data(UNUSED(uint16_t port), uint8_t val, void *priv) { it86x1f_t *dev = (it86x1f_t *) priv; @@ -659,7 +659,7 @@ it86x1f_write_data(uint16_t port, uint8_t val, void *priv) } static uint8_t -it86x1f_read_addr(uint16_t port, void *priv) +it86x1f_read_addr(UNUSED(uint16_t port), void *priv) { it86x1f_t *dev = (it86x1f_t *) priv; uint8_t ret = dev->locked ? 0xff : dev->cur_reg; @@ -670,7 +670,7 @@ it86x1f_read_addr(uint16_t port, void *priv) } static uint8_t -it86x1f_read_data(uint16_t port, void *priv) +it86x1f_read_data(UNUSED(uint16_t port), void *priv) { it86x1f_t *dev = (it86x1f_t *) priv; uint8_t ret = 0xff; @@ -799,8 +799,7 @@ it86x1f_close(void *priv) static void * it86x1f_init(UNUSED(const device_t *info)) { - it86x1f_t *dev = (it86x1f_t *) malloc(sizeof(it86x1f_t)); - memset(dev, 0, sizeof(it86x1f_t)); + it86x1f_t *dev = (it86x1f_t *) calloc(1, sizeof(it86x1f_t)); uint8_t i; for (i = 0; i < (sizeof(it86x1f_models) / sizeof(it86x1f_models[0])); i++) { diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index b21c2d1fc..33cb0d865 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -68,7 +68,7 @@ pc87306_gpio_write(uint16_t port, uint8_t val, void *priv) } uint8_t -pc87306_gpio_read(uint16_t port, void *priv) +pc87306_gpio_read(uint16_t port, UNUSED(void *priv)) { uint32_t ret = machine_handle_gpio(0, 0xffffffff); @@ -467,8 +467,7 @@ pc87306_close(void *priv) static void * pc87306_init(UNUSED(const device_t *info)) { - pc87306_t *dev = (pc87306_t *) malloc(sizeof(pc87306_t)); - memset(dev, 0, sizeof(pc87306_t)); + pc87306_t *dev = (pc87306_t *) calloc(1, sizeof(pc87306_t)); dev->fdc = device_add(&fdc_at_nsc_device); diff --git a/src/sio/sio_pc87307.c b/src/sio/sio_pc87307.c index 1f84152f5..eba0748c9 100644 --- a/src/sio/sio_pc87307.c +++ b/src/sio/sio_pc87307.c @@ -593,8 +593,7 @@ pc87307_close(void *priv) static void * pc87307_init(const device_t *info) { - pc87307_t *dev = (pc87307_t *) malloc(sizeof(pc87307_t)); - memset(dev, 0, sizeof(pc87307_t)); + pc87307_t *dev = (pc87307_t *) calloc(1, sizeof(pc87307_t)); dev->id = info->local & 0xff; diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index f445ee189..1b790bc6b 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -466,8 +466,7 @@ pc87309_close(void *priv) static void * pc87309_init(const device_t *info) { - pc87309_t *dev = (pc87309_t *) malloc(sizeof(pc87309_t)); - memset(dev, 0, sizeof(pc87309_t)); + pc87309_t *dev = (pc87309_t *) calloc(1, sizeof(pc87309_t)); dev->id = info->local & 0xff; diff --git a/src/sio/sio_pc87311.c b/src/sio/sio_pc87311.c index f1b823e47..1f38e6aa8 100644 --- a/src/sio/sio_pc87311.c +++ b/src/sio/sio_pc87311.c @@ -269,8 +269,7 @@ pc87311_close(void *priv) static void * pc87311_init(const device_t *info) { - pc87311_t *dev = (pc87311_t *) malloc(sizeof(pc87311_t)); - memset(dev, 0, sizeof(pc87311_t)); + pc87311_t *dev = (pc87311_t *) calloc(1, sizeof(pc87311_t)); /* Avoid conflicting with machines that make no use of the PC87311 Internal IDE */ HAS_IDE_FUNCTIONALITY = info->local; diff --git a/src/sio/sio_pc87332.c b/src/sio/sio_pc87332.c index 494c6d8bb..f746306bd 100644 --- a/src/sio/sio_pc87332.c +++ b/src/sio/sio_pc87332.c @@ -323,8 +323,7 @@ pc87332_close(void *priv) static void * pc87332_init(const device_t *info) { - pc87332_t *dev = (pc87332_t *) malloc(sizeof(pc87332_t)); - memset(dev, 0, sizeof(pc87332_t)); + pc87332_t *dev = (pc87332_t *) calloc(1, sizeof(pc87332_t)); dev->fdc = device_add(&fdc_at_nsc_device); diff --git a/src/sio/sio_prime3b.c b/src/sio/sio_prime3b.c index 1633c844b..2cadda2ab 100644 --- a/src/sio/sio_prime3b.c +++ b/src/sio/sio_prime3b.c @@ -257,8 +257,7 @@ prime3b_close(void *priv) static void * prime3b_init(const device_t *info) { - prime3b_t *dev = (prime3b_t *) malloc(sizeof(prime3b_t)); - memset(dev, 0, sizeof(prime3b_t)); + prime3b_t *dev = (prime3b_t *) calloc(1, sizeof(prime3b_t)); /* Avoid conflicting with machines that make no use of the Prime3B Internal IDE */ HAS_IDE_FUNCTIONALITY = info->local; diff --git a/src/sio/sio_prime3c.c b/src/sio/sio_prime3c.c index 68361d3e0..e646a3653 100644 --- a/src/sio/sio_prime3c.c +++ b/src/sio/sio_prime3c.c @@ -296,8 +296,7 @@ prime3c_close(void *priv) static void * prime3c_init(const device_t *info) { - prime3c_t *dev = (prime3c_t *) malloc(sizeof(prime3c_t)); - memset(dev, 0, sizeof(prime3c_t)); + prime3c_t *dev = (prime3c_t *) calloc(1, sizeof(prime3c_t)); /* Avoid conflicting with machines that make no use of the Prime3C Internal IDE */ HAS_IDE_FUNCTIONALITY = info->local; diff --git a/src/sio/sio_um8669f.c b/src/sio/sio_um8669f.c index e3ef81e11..b3d5259a2 100644 --- a/src/sio/sio_um8669f.c +++ b/src/sio/sio_um8669f.c @@ -328,8 +328,7 @@ um8669f_init(const device_t *info) { um8669f_log("UM8669F: init(%02X)\n", info->local); - um8669f_t *dev = (um8669f_t *) malloc(sizeof(um8669f_t)); - memset(dev, 0, sizeof(um8669f_t)); + um8669f_t *dev = (um8669f_t *) calloc(1, sizeof(um8669f_t)); dev->pnp_card = isapnp_add_card(um8669f_pnp_rom, sizeof(um8669f_pnp_rom), um8669f_pnp_config_changed, NULL, NULL, NULL, dev); for (uint8_t i = 0; i < (sizeof(um8669f_pnp_defaults) / sizeof(isapnp_device_config_t)); i++) diff --git a/src/sio/sio_vl82c113.c b/src/sio/sio_vl82c113.c index ecfc7ba09..ee18b1893 100644 --- a/src/sio/sio_vl82c113.c +++ b/src/sio/sio_vl82c113.c @@ -24,6 +24,7 @@ #include <86box/keyboard.h> #include <86box/nvr.h> #include <86box/sio.h> +#include <86box/plat_unused.h> typedef struct vl82c113_t { uint8_t index; @@ -128,7 +129,7 @@ vl82c113_close(void *priv) } static void * -vl82c113_init(const device_t *info) +vl82c113_init(UNUSED(const device_t *info)) { vl82c113_t *dev = (vl82c113_t *) calloc(1, sizeof(vl82c113_t)); diff --git a/src/sio/sio_vt82c686.c b/src/sio/sio_vt82c686.c index 47b5e1c09..fa0bf3c63 100644 --- a/src/sio/sio_vt82c686.c +++ b/src/sio/sio_vt82c686.c @@ -287,8 +287,7 @@ vt82c686_close(void *priv) static void * vt82c686_init(UNUSED(const device_t *info)) { - vt82c686_t *dev = (vt82c686_t *) malloc(sizeof(vt82c686_t)); - memset(dev, 0, sizeof(vt82c686_t)); + vt82c686_t *dev = (vt82c686_t *) calloc(1, sizeof(vt82c686_t)); dev->fdc = device_add(&fdc_at_smc_device); dev->fdc_dma = 2; diff --git a/src/sio/sio_w83787f.c b/src/sio/sio_w83787f.c index 69bdb1220..ea5169afc 100644 --- a/src/sio/sio_w83787f.c +++ b/src/sio/sio_w83787f.c @@ -443,8 +443,7 @@ w83787f_close(void *priv) static void * w83787f_init(const device_t *info) { - w83787f_t *dev = (w83787f_t *) malloc(sizeof(w83787f_t)); - memset(dev, 0, sizeof(w83787f_t)); + w83787f_t *dev = (w83787f_t *) calloc(1, sizeof(w83787f_t)); HAS_IDE_FUNCTIONALITY = (info->local & 0x30); diff --git a/src/sio/sio_w83877f.c b/src/sio/sio_w83877f.c index a6ea6f4e4..90a3dba1b 100644 --- a/src/sio/sio_w83877f.c +++ b/src/sio/sio_w83877f.c @@ -444,8 +444,7 @@ w83877f_close(void *priv) static void * w83877f_init(const device_t *info) { - w83877f_t *dev = (w83877f_t *) malloc(sizeof(w83877f_t)); - memset(dev, 0, sizeof(w83877f_t)); + w83877f_t *dev = (w83877f_t *) calloc(1, sizeof(w83877f_t)); dev->fdc = device_add(&fdc_at_winbond_device); diff --git a/src/sio/sio_w83977f.c b/src/sio/sio_w83977f.c index 7df0163a5..1d743cc64 100644 --- a/src/sio/sio_w83977f.c +++ b/src/sio/sio_w83977f.c @@ -593,8 +593,7 @@ w83977f_close(void *priv) static void * w83977f_init(const device_t *info) { - w83977f_t *dev = (w83977f_t *) malloc(sizeof(w83977f_t)); - memset(dev, 0, sizeof(w83977f_t)); + w83977f_t *dev = (w83977f_t *) calloc(1, sizeof(w83977f_t)); dev->type = info->local & 0x0f; dev->hefras = info->local & 0x40; diff --git a/src/sound/midi.c b/src/sound/midi.c index e9b4a82b6..9f83e88dc 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -157,8 +157,7 @@ midi_out_device_init(void) void midi_out_init(midi_device_t *device) { - midi_out = (midi_t *) malloc(sizeof(midi_t)); - memset(midi_out, 0, sizeof(midi_t)); + midi_out = (midi_t *) calloc(1, sizeof(midi_t)); midi_out->m_out_device = device; } @@ -166,8 +165,7 @@ midi_out_init(midi_device_t *device) void midi_in_init(midi_device_t *device, midi_t **mididev) { - *mididev = (midi_t *) malloc(sizeof(midi_t)); - memset(*mididev, 0, sizeof(midi_t)); + *mididev = (midi_t *) calloc(1, sizeof(midi_t)); (*mididev)->m_in_device = device; } @@ -394,8 +392,7 @@ midi_in_handler(int set, void (*msg)(void *priv, uint8_t *msg, uint32_t len), in if ((mih_first != NULL) && (mih_last == NULL)) fatal("First MIDI IN handler present with no last MIDI IN handler\n"); - temp = (midi_in_handler_t *) malloc(sizeof(midi_in_handler_t)); - memset(temp, 0, sizeof(midi_in_handler_t)); + temp = (midi_in_handler_t *) calloc(1, sizeof(midi_in_handler_t)); temp->msg = msg; temp->sysex = sysex; temp->priv = priv; diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 51383bdcf..6ba017cd1 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -262,8 +262,7 @@ fluidsynth_init(UNUSED(const device_t *info)) al_set_midi(data->samplerate, data->buf_size); - dev = malloc(sizeof(midi_device_t)); - memset(dev, 0, sizeof(midi_device_t)); + dev = calloc(1, sizeof(midi_device_t)); dev->play_msg = fluidsynth_msg; dev->play_sysex = fluidsynth_sysex; diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index f95445540..ab2165c52 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -298,8 +298,7 @@ mt32emu_init(char *control_rom, char *pcm_rom) al_set_midi(samplerate, buf_size); - dev = malloc(sizeof(midi_device_t)); - memset(dev, 0, sizeof(midi_device_t)); + dev = calloc(1, sizeof(midi_device_t)); dev->play_msg = mt32_msg; dev->play_sysex = mt32_sysex; diff --git a/src/sound/midi_opl4.c b/src/sound/midi_opl4.c index cf99e092d..5ec15cc7c 100644 --- a/src/sound/midi_opl4.c +++ b/src/sound/midi_opl4.c @@ -557,7 +557,7 @@ program_change(uint8_t midi_channel, uint8_t program, opl4_midi_t *opl4_midi) } static void -opl4_midi_thread(void *arg) +opl4_midi_thread(UNUSED(void *arg)) { opl4_midi_t *opl4_midi = opl4_midi_cur; uint32_t i = 0; @@ -648,18 +648,18 @@ opl4_midi_msg(uint8_t *val) } void -opl4_midi_sysex(uint8_t *data, unsigned int len) +opl4_midi_sysex(UNUSED(uint8_t *data), UNUSED(unsigned int len)) { + // } void * -opl4_init(const device_t *info) +opl4_init(UNUSED(const device_t *info)) { midi_device_t *dev; extern void al_set_midi(int freq, int buf_size); - dev = malloc(sizeof(midi_device_t)); - memset(dev, 0, sizeof(midi_device_t)); + dev = calloc(1, sizeof(midi_device_t)); dev->play_msg = opl4_midi_msg; dev->play_sysex = opl4_midi_sysex; diff --git a/src/sound/midi_rtmidi.cpp b/src/sound/midi_rtmidi.cpp index e2458c9fe..9da3fdb91 100644 --- a/src/sound/midi_rtmidi.cpp +++ b/src/sound/midi_rtmidi.cpp @@ -73,8 +73,7 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len) void * rtmidi_output_init(UNUSED(const device_t *info)) { - midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t)); - memset(dev, 0, sizeof(midi_device_t)); + midi_device_t *dev = (midi_device_t *) calloc(1, sizeof(midi_device_t)); dev->play_msg = rtmidi_play_msg; dev->play_sysex = rtmidi_play_sysex; @@ -156,8 +155,7 @@ rtmidi_input_callback(UNUSED(double timeStamp), std::vector *mess void * rtmidi_input_init(UNUSED(const device_t *info)) { - midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t)); - memset(dev, 0, sizeof(midi_device_t)); + midi_device_t *dev = (midi_device_t *) calloc(1, sizeof(midi_device_t)); try { if (!midiin) diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index f6c01c4ea..e92830f67 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -577,8 +577,7 @@ ac97_codec_getrate(void *priv, uint8_t reg) static void * ac97_codec_init(const device_t *info) { - ac97_codec_t *dev = malloc(sizeof(ac97_codec_t)); - memset(dev, 0, sizeof(ac97_codec_t)); + ac97_codec_t *dev = calloc(1, sizeof(ac97_codec_t)); for (; dev->model < (sizeof(ac97_codecs) / sizeof(ac97_codecs[0])); dev->model++) { if (ac97_codecs[dev->model].device->local == info->local) diff --git a/src/sound/snd_ac97_via.c b/src/sound/snd_ac97_via.c index e3fa9d2e4..8c1e45c40 100644 --- a/src/sound/snd_ac97_via.c +++ b/src/sound/snd_ac97_via.c @@ -787,8 +787,7 @@ ac97_via_speed_changed(void *priv) static void * ac97_via_init(UNUSED(const device_t *info)) { - ac97_via_t *dev = malloc(sizeof(ac97_via_t)); - memset(dev, 0, sizeof(ac97_via_t)); + ac97_via_t *dev = calloc(1, sizeof(ac97_via_t)); ac97_via_log("AC97 VIA: init()\n"); diff --git a/src/sound/snd_adlib.c b/src/sound/snd_adlib.c index 983ccf7d3..1f307596c 100644 --- a/src/sound/snd_adlib.c +++ b/src/sound/snd_adlib.c @@ -103,8 +103,7 @@ adlib_mca_feedb(void *priv) void * adlib_init(UNUSED(const device_t *info)) { - adlib_t *adlib = malloc(sizeof(adlib_t)); - memset(adlib, 0, sizeof(adlib_t)); + adlib_t *adlib = calloc(1, sizeof(adlib_t)); adlib_log("adlib_init\n"); fm_driver_get(FM_YM3812, &adlib->opl); diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 7b5deaac5..8a809803d 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -1066,8 +1066,7 @@ adgold_init(UNUSED(const device_t *info)) FILE *fp; int c; double out; - adgold_t *adgold = malloc(sizeof(adgold_t)); - memset(adgold, 0, sizeof(adgold_t)); + adgold_t *adgold = calloc(1, sizeof(adgold_t)); adgold->dma = device_get_config_int("dma"); adgold->irq = device_get_config_int("irq"); diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 07add5062..9e520bcf5 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -2645,8 +2645,7 @@ static void es137x_speed_changed(void *priv); static void * es1370_init(const device_t *info) { - es137x_t *dev = malloc(sizeof(es137x_t)); - memset(dev, 0x00, sizeof(es137x_t)); + es137x_t *dev = calloc(1, sizeof(es137x_t)); dev->type = info->local; if (device_get_config_int("receive_input")) @@ -2689,8 +2688,7 @@ es1370_init(const device_t *info) static void * es1371_init(const device_t *info) { - es137x_t *dev = malloc(sizeof(es137x_t)); - memset(dev, 0x00, sizeof(es137x_t)); + es137x_t *dev = calloc(1, sizeof(es137x_t)); dev->type = info->local & 0xffffff00; if (device_get_config_int("receive_input")) diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index cf05203f3..dfbab2bd3 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -974,8 +974,7 @@ azt_init(const device_t *info) int loaded_from_eeprom = 0; uint16_t addr_setting; uint8_t read_eeprom[AZTECH_EEPROM_SIZE]; - azt2316a_t *azt2316a = malloc(sizeof(azt2316a_t)); - memset(azt2316a, 0, sizeof(azt2316a_t)); + azt2316a_t *azt2316a = calloc(1, sizeof(azt2316a_t)); azt2316a->type = info->local; @@ -1226,8 +1225,7 @@ azt_init(const device_t *info) 2x4 to 2x5 -> Mixer interface 2x6, 2xA, 2xC, 2xE -> DSP chip 2x8, 2x9, 388 and 389 FM chip (9 voices).*/ - azt2316a->sb = malloc(sizeof(sb_t)); - memset(azt2316a->sb, 0, sizeof(sb_t)); + azt2316a->sb = calloc(1, sizeof(sb_t)); azt2316a->sb->opl_enabled = device_get_config_int("opl"); @@ -1259,8 +1257,7 @@ azt_init(const device_t *info) sound_set_cd_audio_filter(sbpro_filter_cd_audio, azt2316a->sb); if (azt2316a->cur_mpu401_enabled) { - azt2316a->mpu = (mpu_t *) malloc(sizeof(mpu_t)); - memset(azt2316a->mpu, 0, sizeof(mpu_t)); + azt2316a->mpu = (mpu_t *) calloc(1, sizeof(mpu_t)); mpu401_init(azt2316a->mpu, azt2316a->cur_mpu401_addr, azt2316a->cur_mpu401_irq, M_UART, device_get_config_int("receive_input401")); } else azt2316a->mpu = NULL; diff --git a/src/sound/snd_cmi8x38.c b/src/sound/snd_cmi8x38.c index 833124bb2..5f75d0dc3 100644 --- a/src/sound/snd_cmi8x38.c +++ b/src/sound/snd_cmi8x38.c @@ -1434,8 +1434,7 @@ cmi8x38_reset(void *priv) static void * cmi8x38_init(const device_t *info) { - cmi8x38_t *dev = malloc(sizeof(cmi8x38_t)); - memset(dev, 0, sizeof(cmi8x38_t)); + cmi8x38_t *dev = calloc(1, sizeof(cmi8x38_t)); /* Set the chip type. */ if ((info->local == CMEDIA_CMI8738_6CH) && !device_get_config_int("six_channel")) diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index 2ec81b53d..f8db04fed 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -181,8 +181,7 @@ cms_read(uint16_t addr, void *priv) void * cms_init(UNUSED(const device_t *info)) { - cms_t *cms = malloc(sizeof(cms_t)); - memset(cms, 0, sizeof(cms_t)); + cms_t *cms = calloc(1, sizeof(cms_t)); uint16_t addr = device_get_config_hex16("base"); io_sethandler(addr, 0x0010, cms_read, NULL, NULL, cms_write, NULL, NULL, cms); diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index 0a383e13f..d164e3ac6 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -468,10 +468,9 @@ cs423x_slam_write(UNUSED(uint16_t addr), uint8_t val, void *priv) if (dev->slam_config) cs423x_pnp_config_changed(dev->slam_ld, dev->slam_config, dev); else - dev->slam_config = (isapnp_device_config_t *) malloc(sizeof(isapnp_device_config_t)); + dev->slam_config = (isapnp_device_config_t *) calloc(1, sizeof(isapnp_device_config_t)); /* Start new logical device. */ - memset(dev->slam_config, 0, sizeof(isapnp_device_config_t)); dev->slam_ld = val; break; @@ -846,8 +845,7 @@ cs423x_reset(void *priv) static void * cs423x_init(const device_t *info) { - cs423x_t *dev = malloc(sizeof(cs423x_t)); - memset(dev, 0, sizeof(cs423x_t)); + cs423x_t *dev = calloc(1, sizeof(cs423x_t)); /* Initialize model-specific data. */ dev->type = info->local & 0xff; diff --git a/src/sound/snd_emu8k.c b/src/sound/snd_emu8k.c index 5f13d2f8e..822abeeaa 100644 --- a/src/sound/snd_emu8k.c +++ b/src/sound/snd_emu8k.c @@ -328,7 +328,7 @@ emu8k_log(const char *fmt, ...) static inline int16_t EMU8K_READ(emu8k_t *emu8k, uint32_t addr) { - const register emu8k_mem_pointers_t addrmem = { { addr } }; + register const emu8k_mem_pointers_t addrmem = { { addr } }; return emu8k->ram_pointers[addrmem.hb_address][addrmem.lw_address]; } @@ -2171,8 +2171,7 @@ emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram) emu8k->rom[0x7ffff] = 0; } - emu8k->empty = malloc(2 * BLOCK_SIZE_WORDS); - memset(emu8k->empty, 0, 2 * BLOCK_SIZE_WORDS); + emu8k->empty = calloc(2, BLOCK_SIZE_WORDS); int j = 0; for (; j < 0x8; j++) { @@ -2186,8 +2185,7 @@ emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram) /*Clip to 28MB, since that's the max that we can address. */ if (onboard_ram > 0x7000) onboard_ram = 0x7000; - emu8k->ram = malloc(onboard_ram * 1024); - memset(emu8k->ram, 0, onboard_ram * 1024); + emu8k->ram = calloc(1024, onboard_ram); const int i_end = onboard_ram >> 7; int i = 0; for (; i < i_end; i++, j++) { diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index b39d77708..9dcf0f00b 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1348,12 +1348,10 @@ gus_init(UNUSED(const device_t *info)) int c; double out = 1.0; uint8_t gus_ram = device_get_config_int("gus_ram"); - gus_t *gus = malloc(sizeof(gus_t)); - memset(gus, 0x00, sizeof(gus_t)); + gus_t *gus = calloc(1, sizeof(gus_t)); gus->gus_end_ram = 1 << (18 + gus_ram); - gus->ram = (uint8_t *) malloc(gus->gus_end_ram); - memset(gus->ram, 0x00, (gus->gus_end_ram)); + gus->ram = (uint8_t *) calloc(1, gus->gus_end_ram); for (c = 0; c < 32; c++) { gus->ctrl[c] = 1; diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index 8fb526f14..812a649a8 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -82,8 +82,7 @@ dac_get_buffer(int32_t *buffer, int len, void *priv) static void * dac_init(void *lpt) { - lpt_dac_t *lpt_dac = malloc(sizeof(lpt_dac_t)); - memset(lpt_dac, 0, sizeof(lpt_dac_t)); + lpt_dac_t *lpt_dac = calloc(1, sizeof(lpt_dac_t)); lpt_dac->lpt = lpt; diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index bd794fffb..06160ce4c 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -115,8 +115,7 @@ dss_callback(void *priv) static void * dss_init(void *lpt) { - dss_t *dss = malloc(sizeof(dss_t)); - memset(dss, 0, sizeof(dss_t)); + dss_t *dss = calloc(1, sizeof(dss_t)); dss->lpt = lpt; diff --git a/src/sound/snd_opl2board.c b/src/sound/snd_opl2board.c index f1bda3398..a76b6bf4d 100644 --- a/src/sound/snd_opl2board.c +++ b/src/sound/snd_opl2board.c @@ -124,8 +124,7 @@ opl2board_device_mca_feedb(void *priv) void * opl2board_device_init(UNUSED(const device_t *info)) { - opl2board_device_t *serial = malloc(sizeof(opl2board_device_t)); - memset(serial, 0, sizeof(opl2board_device_t)); + opl2board_device_t *serial = calloc(1, sizeof(opl2board_device_t)); opl2board_device_log("opl2board_device_init\n"); fm_driver_get(FM_OPL2BOARD, &serial->opl); diff --git a/src/sound/snd_opl_esfm.c b/src/sound/snd_opl_esfm.c index 993a0ec6b..bcd2a56e9 100644 --- a/src/sound/snd_opl_esfm.c +++ b/src/sound/snd_opl_esfm.c @@ -34,6 +34,7 @@ #include <86box/device.h> #include <86box/timer.h> #include <86box/snd_opl.h> +#include <86box/plat_unused.h> #define RSM_FRAC 10 @@ -175,7 +176,7 @@ esfm_drv_set_do_cycles(void *priv, int8_t do_cycles) } static void * -esfm_drv_init(const device_t *info) +esfm_drv_init(UNUSED(const device_t *info)) { esfm_drv_t *dev = (esfm_drv_t *) calloc(1, sizeof(esfm_drv_t)); dev->flags = FLAG_CYCLES | FLAG_OPL3; diff --git a/src/sound/snd_optimc.c b/src/sound/snd_optimc.c index d69986d98..7058d918c 100644 --- a/src/sound/snd_optimc.c +++ b/src/sound/snd_optimc.c @@ -419,8 +419,7 @@ optimc_init(const device_t *info) music_add_handler(sb_get_music_buffer_sbpro, optimc->sb); sound_set_cd_audio_filter(sbpro_filter_cd_audio, optimc->sb); /* CD audio filter for the default context */ - optimc->mpu = (mpu_t *) malloc(sizeof(mpu_t)); - memset(optimc->mpu, 0, sizeof(mpu_t)); + optimc->mpu = (mpu_t *) calloc(1, sizeof(mpu_t)); mpu401_init(optimc->mpu, optimc->cur_mpu401_addr, optimc->cur_mpu401_irq, M_UART, device_get_config_int("receive_input401")); if (device_get_config_int("receive_input")) diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 110ee95c9..05df32322 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -1671,7 +1671,7 @@ pas16_out(uint16_t port, uint8_t val, void *priv) - A 16-bit sample always takes two ctr_clock() ticks. */ static uint16_t -pas16_dma_channel_read(pas16_t *pas16, int channel) +pas16_dma_channel_read(pas16_t *pas16, UNUSED(int channel)) { int status; uint16_t ret; @@ -2320,8 +2320,7 @@ pas16_init(const device_t *info) fm_driver_get(FM_YMF262, &pas16->opl); sb_dsp_set_real_opl(&pas16->dsp, 1); sb_dsp_init(&pas16->dsp, SB_DSP_201, SB_SUBTYPE_DEFAULT, pas16); - pas16->mpu = (mpu_t *) malloc(sizeof(mpu_t)); - memset(pas16->mpu, 0, sizeof(mpu_t)); + pas16->mpu = (mpu_t *) calloc(1, sizeof(mpu_t)); mpu401_init(pas16->mpu, 0, 0, M_UART, device_get_config_int("receive_input401")); sb_dsp_set_mpu(&pas16->dsp, pas16->mpu); diff --git a/src/sound/snd_ps1.c b/src/sound/snd_ps1.c index 531c2a369..15cad0051 100644 --- a/src/sound/snd_ps1.c +++ b/src/sound/snd_ps1.c @@ -166,8 +166,7 @@ ps1snd_get_buffer(int32_t *buffer, int len, void *priv) static void * ps1snd_init(UNUSED(const device_t *info)) { - ps1snd_t *ps1snd = malloc(sizeof(ps1snd_t)); - memset(ps1snd, 0x00, sizeof(ps1snd_t)); + ps1snd_t *ps1snd = calloc(1, sizeof(ps1snd_t)); sn76489_init(&ps1snd->sn76489, 0x0205, 0x0001, SN76496, 4000000); diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 657f94b01..0b09a7b2e 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -193,8 +193,7 @@ pssj_get_buffer(int32_t *buffer, int len, void *priv) void * pssj_init(UNUSED(const device_t *info)) { - pssj_t *pssj = malloc(sizeof(pssj_t)); - memset(pssj, 0, sizeof(pssj_t)); + pssj_t *pssj = calloc(1, sizeof(pssj_t)); sn76489_init(&pssj->sn76489, 0x00c0, 0x0004, PSSJ, 3579545); @@ -208,8 +207,7 @@ pssj_init(UNUSED(const device_t *info)) void * pssj_1e0_init(UNUSED(const device_t *info)) { - pssj_t *pssj = malloc(sizeof(pssj_t)); - memset(pssj, 0, sizeof(pssj_t)); + pssj_t *pssj = calloc(1, sizeof(pssj_t)); sn76489_init(&pssj->sn76489, 0x01e0, 0x0004, PSSJ, 3579545); @@ -223,8 +221,7 @@ pssj_1e0_init(UNUSED(const device_t *info)) void * pssj_isa_init(UNUSED(const device_t *info)) { - pssj_t *pssj = malloc(sizeof(pssj_t)); - memset(pssj, 0, sizeof(pssj_t)); + pssj_t *pssj = calloc(1, sizeof(pssj_t)); uint16_t addr = device_get_config_hex16("base"); diff --git a/src/sound/snd_resid.cpp b/src/sound/snd_resid.cpp index b9895cf7e..b0503cac2 100644 --- a/src/sound/snd_resid.cpp +++ b/src/sound/snd_resid.cpp @@ -87,10 +87,10 @@ sid_write(uint16_t addr, uint8_t val, UNUSED(void *priv)) #define CLOCK_DELTA(n) (int) (((14318180.0 * n) / 16.0) / (float) RESID_FREQ) static void -fillbuf2(int &count, int16_t *buf, int len) +fillbuf2(int &count, int16_t *buf, UNUSED(int len)) { - int c; - c = psid->sid->clock(count, buf); + int c = psid->sid->clock(count, buf); + if (!c) *buf = psid->last_sample; psid->last_sample = *buf; diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 692a53aa3..ea961a6d3 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -1417,7 +1417,7 @@ sb_ct1745_mixer_reset(sb_t *sb) } static void -ess_base_write(uint16_t addr, uint8_t val, void *priv) +ess_base_write(uint16_t addr, UNUSED(uint8_t val), void *priv) { sb_t *ess = (sb_t *) priv; @@ -1463,7 +1463,7 @@ ess_base_read(uint16_t addr, void *priv) } static void -ess_fm_midi_write(uint16_t addr, uint8_t val, void *priv) +ess_fm_midi_write(UNUSED(uint16_t addr), UNUSED(uint8_t val), void *priv) { sb_t *ess = (sb_t *) priv; @@ -1471,7 +1471,7 @@ ess_fm_midi_write(uint16_t addr, uint8_t val, void *priv) } static uint8_t -ess_fm_midi_read(uint16_t addr, void *priv) +ess_fm_midi_read(UNUSED(uint16_t addr), void *priv) { sb_t *ess = (sb_t *) priv; diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 8fb8db06e..89064bea4 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -228,8 +228,7 @@ sn76489_init(sn76489_t *sn76489, uint16_t base, uint16_t size, int type, int fre void * sn76489_device_init(UNUSED(const device_t *info)) { - sn76489_t *sn76489 = malloc(sizeof(sn76489_t)); - memset(sn76489, 0, sizeof(sn76489_t)); + sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t)); sn76489_init(sn76489, 0x00c0, 0x0008, SN76496, 3579545); @@ -239,8 +238,7 @@ sn76489_device_init(UNUSED(const device_t *info)) void * ncr8496_device_init(UNUSED(const device_t *info)) { - sn76489_t *sn76489 = malloc(sizeof(sn76489_t)); - memset(sn76489, 0, sizeof(sn76489_t)); + sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t)); sn76489_init(sn76489, 0x00c0, 0x0008, NCR8496, 3579545); @@ -250,8 +248,7 @@ ncr8496_device_init(UNUSED(const device_t *info)) void * tndy_device_init(UNUSED(const device_t *info)) { - sn76489_t *sn76489 = malloc(sizeof(sn76489_t)); - memset(sn76489, 0, sizeof(sn76489_t)); + sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t)); uint16_t addr = device_get_config_hex16("base"); diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index e03be6b4c..0e1bbd96c 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -70,8 +70,7 @@ ssi2001_write(uint16_t addr, uint8_t val, void *priv) void * ssi2001_init(UNUSED(const device_t *info)) { - ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t)); - memset(ssi2001, 0, sizeof(ssi2001_t)); + ssi2001_t *ssi2001 = calloc(1, sizeof(ssi2001_t)); ssi2001->psid = sid_init(0); sid_reset(ssi2001->psid); @@ -95,13 +94,13 @@ ssi2001_close(void *priv) } static uint8_t -entertainer_read(uint16_t addr, void *priv) +entertainer_read(UNUSED(uint16_t addr), UNUSED(void *priv)) { return 0xa5; } static void -entertainer_write(uint16_t addr, uint8_t val, void *priv) +entertainer_write(UNUSED(uint16_t addr), uint8_t val, void *priv) { entertainer_t *entertainer = (entertainer_t *) priv; entertainer->regs = val; @@ -110,10 +109,8 @@ entertainer_write(uint16_t addr, uint8_t val, void *priv) void * entertainer_init(UNUSED(const device_t *info)) { - ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t)); - entertainer_t *entertainer = malloc(sizeof(entertainer_t)); - memset(ssi2001, 0, sizeof(ssi2001_t)); - memset(entertainer, 0, sizeof(entertainer_t)); + ssi2001_t *ssi2001 = calloc(1, sizeof(ssi2001_t)); + entertainer_t *entertainer = calloc(1, sizeof(entertainer_t)); ssi2001->psid = sid_init(0); sid_reset(ssi2001->psid); @@ -166,15 +163,27 @@ static const device_config_t ssi2001_config[] = { { .description = "" } } }, - { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "gameport", + .description = "Enable Game port", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; static const device_config_t entertainer_config[] = { // clang-format off - { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "gameport", + .description = "Enable Game port", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 833308280..0f37cbf27 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -107,8 +107,7 @@ wss_get_music_buffer(int32_t *buffer, int len, void *priv) void * wss_init(UNUSED(const device_t *info)) { - wss_t *wss = malloc(sizeof(wss_t)); - memset(wss, 0, sizeof(wss_t)); + wss_t *wss = calloc(1, sizeof(wss_t)); uint16_t addr = device_get_config_hex16("base"); wss->opl_enabled = device_get_config_int("opl"); @@ -209,8 +208,7 @@ ncr_audio_mca_feedb(void *priv) void * ncr_audio_init(UNUSED(const device_t *info)) { - wss_t *wss = malloc(sizeof(wss_t)); - memset(wss, 0, sizeof(wss_t)); + wss_t *wss = calloc(1, sizeof(wss_t)); fm_driver_get(FM_YMF262, &wss->opl); ad1848_init(&wss->ad1848, AD1848_TYPE_DEFAULT); diff --git a/src/unix/dummy_cdrom_ioctl.c b/src/unix/dummy_cdrom_ioctl.c index ae4eb1727..bddfabb5b 100644 --- a/src/unix/dummy_cdrom_ioctl.c +++ b/src/unix/dummy_cdrom_ioctl.c @@ -40,7 +40,6 @@ typedef struct ioctl_t { cdrom_t *dev; void *log; - int toc_valid; void *handle; char path[256]; } ioctl_t; @@ -77,8 +76,6 @@ ioctl_open_handle(UNUSED(ioctl_t *ioctl)) static void ioctl_read_toc(ioctl_t *ioctl) { - if (!ioctl->toc_valid) - ioctl->toc_valid = 1; } /* Shared functions. */ @@ -97,7 +94,7 @@ ioctl_get_raw_track_info(UNUSED(const void *local), int *num, uint8_t *rti) } static int -ioctl_is_track_pre(const void *local, const uint32_t sector) +ioctl_is_track_pre(const void *local, UNUSED(const uint32_t sector)) { ioctl_t *ioctl = (ioctl_t *) local; @@ -111,7 +108,7 @@ ioctl_is_track_pre(const void *local, const uint32_t sector) } static int -ioctl_read_sector(const void *local, uint8_t *buffer, uint32_t const sector) +ioctl_read_sector(const void *local, UNUSED(uint8_t *buffer), UNUSED(uint32_t const sector)) { ioctl_t *ioctl = (ioctl_t *) local; @@ -159,6 +156,12 @@ ioctl_has_audio(UNUSED(const void *local)) return 0; } +static int +ioctl_is_empty(const void *local) +{ + return 1; +} + static int ioctl_ext_medium_changed(UNUSED(void *local)) { @@ -186,6 +189,18 @@ ioctl_close(void *local) ioctl->log = NULL; } +static void +ioctl_load(const void *local) +{ + const ioctl_t *ioctl = (const ioctl_t *) local; + + if (ioctl_open_handle((ioctl_t *) ioctl)) { + ioctl_close_handle((ioctl_t *) ioctl); + + ioctl_read_toc((ioctl_t *) ioctl); + } +} + static const cdrom_ops_t ioctl_ops = { ioctl_get_track_info, ioctl_get_raw_track_info, @@ -196,8 +211,9 @@ static const cdrom_ops_t ioctl_ops = { ioctl_read_dvd_structure, ioctl_is_dvd, ioctl_has_audio, - ioctl_ext_medium_changed, - ioctl_close + ioctl_is_empty, + ioctl_close, + ioctl_load }; /* Public functions. */ @@ -218,7 +234,6 @@ ioctl_open(cdrom_t *dev, const char *drv) ioctl_log(ioctl->log, "Path is %s\n", ioctl->path); ioctl->dev = dev; - ioctl->toc_valid = 0; dev->ops = &ioctl_ops; } diff --git a/src/unix/unix.c b/src/unix/unix.c index 8e070d372..7f653b9b6 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -301,7 +301,7 @@ path_abs(char *path) } void -path_normalize(char *path) +path_normalize(UNUSED(char *path)) { /* No-op. */ } @@ -459,13 +459,13 @@ plat_remove(char *path) } void -ui_sb_update_icon_state(int tag, int state) +ui_sb_update_icon_state(UNUSED(int tag), UNUSED(int state)) { /* No-op. */ } void -ui_sb_update_icon(int tag, int active) +ui_sb_update_icon(UNUSED(int tag), UNUSED(int active)) { /* No-op. */ } @@ -477,7 +477,7 @@ plat_delay_ms(uint32_t count) } void -ui_sb_update_tip(int arg) +ui_sb_update_tip(UNUSED(int arg)) { /* No-op. */ } @@ -514,8 +514,9 @@ path_get_dirname(char *dest, const char *path) *dest = '\0'; } volatile int cpu_thread_run = 1; + void -ui_sb_set_text_w(wchar_t *wstr) +ui_sb_set_text_w(UNUSED(wchar_t *wstr)) { /* No-op. */ } @@ -533,7 +534,7 @@ strnicmp(const char *s1, const char *s2, size_t n) } void -main_thread(void *param) +main_thread(UNUSED(void *param)) { uint32_t old_time; uint32_t new_time; @@ -707,7 +708,7 @@ plat_power_off(void) } void -ui_sb_bugui(char *str) +ui_sb_bugui(UNUSED(char *str)) { /* No-op. */ } @@ -726,7 +727,7 @@ int real_sdl_w; int real_sdl_h; void -ui_sb_set_ready(int ready) +ui_sb_set_ready(UNUSED(int ready)) { /* No-op. */ } @@ -912,14 +913,14 @@ void (*f_rl_callback_handler_remove)(void) = NULL; #endif uint32_t -timer_onesec(uint32_t interval, void *param) +timer_onesec(uint32_t interval, UNUSED(void *param)) { pc_onesec(); return interval; } void -monitor_thread(void *param) +monitor_thread(UNUSED(void *param)) { #ifndef USE_CLI if (isatty(fileno(stdin)) && isatty(fileno(stdout))) { @@ -1369,14 +1370,14 @@ main(int argc, char **argv) return 0; } char * -plat_vidapi_name(int i) +plat_vidapi_name(UNUSED(int i)) { return "default"; } /* Sets up the program language before initialization. */ uint32_t -plat_language_code(char *langcode) +plat_language_code(UNUSED(char *langcode)) { /* or maybe not */ return 0; @@ -1413,7 +1414,7 @@ plat_set_thread_name(void *thread, const char *name) /* Converts back the language code to LCID */ void -plat_language_code_r(uint32_t lcid, char *outbuf, int len) +plat_language_code_r(UNUSED(uint32_t lcid), UNUSED(char *outbuf), UNUSED(int len)) { /* or maybe not */ return; @@ -1451,7 +1452,7 @@ endblit(void) /* API */ void -ui_sb_mt32lcd(char *str) +ui_sb_mt32lcd(UNUSED(char *str)) { /* No-op. */ } diff --git a/src/unix/unix_cdrom.c b/src/unix/unix_cdrom.c index 5223b08ba..b1096b0b4 100644 --- a/src/unix/unix_cdrom.c +++ b/src/unix/unix_cdrom.c @@ -70,7 +70,7 @@ cassette_eject(void) } void -cartridge_mount(uint8_t id, char *fn, uint8_t wp) +cartridge_mount(uint8_t id, char *fn, UNUSED(uint8_t wp)) { cart_close(id); cart_load(id, fn); @@ -121,7 +121,7 @@ floppy_eject(uint8_t id) } void -plat_cdrom_ui_update(uint8_t id, uint8_t reload) +plat_cdrom_ui_update(uint8_t id, UNUSED(uint8_t reload)) { cdrom_t *drv = &cdrom[id]; diff --git a/src/unix/unix_sdl.c b/src/unix/unix_sdl.c index 002e33fd6..651822335 100644 --- a/src/unix/unix_sdl.c +++ b/src/unix/unix_sdl.c @@ -533,19 +533,19 @@ ui_window_title(wchar_t *str) } void -ui_init_monitor(int monitor_index) +ui_init_monitor(UNUSED(int monitor_index)) { /* No-op. */ } void -ui_deinit_monitor(int monitor_index) +ui_deinit_monitor(UNUSED(int monitor_index)) { /* No-op. */ } void -plat_resize_request(int w, int h, int monitor_index) +plat_resize_request(UNUSED(int w), UNUSED(int h), int monitor_index) { atomic_store((&doresize_monitors[monitor_index]), 1); } diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 0ef4df6df..a923ea7e2 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -291,7 +291,7 @@ mach_pixel_read(mach_t *mach) } static void -mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, mach_t *mach, ibm8514_t *dev) +mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint32_t cpu_dat, UNUSED(svga_t *svga), mach_t *mach, ibm8514_t *dev) { int compare_mode; uint16_t poly_src = 0; diff --git a/src/video/vid_bt481_ramdac.c b/src/video/vid_bt481_ramdac.c index d1c85dcfe..1b81e2dc7 100644 --- a/src/video/vid_bt481_ramdac.c +++ b/src/video/vid_bt481_ramdac.c @@ -26,6 +26,7 @@ #include <86box/timer.h> #include <86box/video.h> #include <86box/vid_svga.h> +#include <86box/plat_unused.h> typedef struct bt481_ramdac_t { int state; @@ -128,7 +129,7 @@ bt481_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga) } static void * -bt481_ramdac_init(const device_t *info) +bt481_ramdac_init(UNUSED(const device_t *info)) { bt481_ramdac_t *ramdac = (bt481_ramdac_t *) malloc(sizeof(bt481_ramdac_t)); memset(ramdac, 0, sizeof(bt481_ramdac_t)); diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index 375830f3c..d324368ab 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -448,7 +448,7 @@ cga_interpolate_linear(uint8_t co1, uint8_t co2, double fraction) } static color_t -cga_interpolate_lookup(cga_t *cga, color_t color1, color_t color2, double fraction) +cga_interpolate_lookup(cga_t *cga, color_t color1, color_t color2, UNUSED(double fraction)) { color_t ret; uint8_t dt = cga->double_type - DOUBLE_INTERPOLATE_SRGB; diff --git a/src/video/vid_chips_69000.c b/src/video/vid_chips_69000.c index de66a37aa..012a16348 100644 --- a/src/video/vid_chips_69000.c +++ b/src/video/vid_chips_69000.c @@ -166,12 +166,12 @@ static chips_69000_t *reset_state = NULL; /* TODO: Probe timings on real hardware. */ static video_timings_t timing_chips = { .type = VIDEO_PCI, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 10, .read_w = 10, .read_l = 10 }; -uint8_t chips_69000_readb_linear(uint32_t addr, void *p); -uint16_t chips_69000_readw_linear(uint32_t addr, void *p); -uint32_t chips_69000_readl_linear(uint32_t addr, void *p); -void chips_69000_writeb_linear(uint32_t addr, uint8_t val, void *p); -void chips_69000_writew_linear(uint32_t addr, uint16_t val, void *p); -void chips_69000_writel_linear(uint32_t addr, uint32_t val, void *p); +uint8_t chips_69000_readb_linear(uint32_t addr, void *priv); +uint16_t chips_69000_readw_linear(uint32_t addr, void *priv); +uint32_t chips_69000_readl_linear(uint32_t addr, void *priv); +void chips_69000_writeb_linear(uint32_t addr, uint8_t val, void *priv); +void chips_69000_writew_linear(uint32_t addr, uint16_t val, void *priv); +void chips_69000_writel_linear(uint32_t addr, uint32_t val, void *priv); /* Multimedia handling. */ uint8_t @@ -1643,9 +1643,9 @@ chips_69000_write_ext_reg(chips_69000_t* chips, uint8_t val) } void -chips_69000_out(uint16_t addr, uint8_t val, void *p) +chips_69000_out(uint16_t addr, uint8_t val, void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; svga_t *svga = &chips->svga; uint8_t old, index; @@ -1750,9 +1750,9 @@ chips_69000_out(uint16_t addr, uint8_t val, void *p) } uint8_t -chips_69000_in(uint16_t addr, void *p) +chips_69000_in(uint16_t addr, void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; svga_t *svga = &chips->svga; uint8_t temp = 0, index; @@ -1828,9 +1828,9 @@ chips_69000_in(uint16_t addr, void *p) } static uint8_t -chips_69000_pci_read(int func, int addr, void *p) +chips_69000_pci_read(UNUSED(int func), int addr, void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; { switch (addr) { @@ -1885,9 +1885,9 @@ chips_69000_pci_read(int func, int addr, void *p) } static void -chips_69000_pci_write(int func, int addr, uint8_t val, void *p) +chips_69000_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; { switch (addr) { @@ -2193,71 +2193,71 @@ chips_69000_writel_mmio(uint32_t addr, uint32_t val, chips_69000_t* chips) } uint8_t -chips_69000_readb_linear(uint32_t addr, void *p) +chips_69000_readb_linear(uint32_t addr, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x400000) return chips_69000_readb_mmio(addr, chips); - return svga_readb_linear(addr & 0x1FFFFF, p); + return svga_readb_linear(addr & 0x1FFFFF, priv); } uint16_t -chips_69000_readw_linear(uint32_t addr, void *p) +chips_69000_readw_linear(uint32_t addr, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x800000) { if (addr & 0x400000) return bswap16(chips_69000_readw_mmio(addr, chips)); - return bswap16(svga_readw_linear(addr & 0x1FFFFF, p)); + return bswap16(svga_readw_linear(addr & 0x1FFFFF, priv)); } if (addr & 0x400000) return chips_69000_readw_mmio(addr, chips); - return svga_readw_linear(addr & 0x1FFFFF, p); + return svga_readw_linear(addr & 0x1FFFFF, priv); } uint32_t -chips_69000_readl_linear(uint32_t addr, void *p) +chips_69000_readl_linear(uint32_t addr, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x800000) { if (addr & 0x400000) return bswap32(chips_69000_readl_mmio(addr, chips)); - return bswap32(svga_readl_linear(addr & 0x1FFFFF, p)); + return bswap32(svga_readl_linear(addr & 0x1FFFFF, priv)); } if (addr & 0x400000) return chips_69000_readl_mmio(addr, chips); - return svga_readl_linear(addr & 0x1FFFFF, p); + return svga_readl_linear(addr & 0x1FFFFF, priv); } void -chips_69000_writeb_linear(uint32_t addr, uint8_t val, void *p) +chips_69000_writeb_linear(uint32_t addr, uint8_t val, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x400000) return chips_69000_writeb_mmio(addr, val, chips); - svga_writeb_linear(addr & 0x1FFFFF, val, p); + svga_writeb_linear(addr & 0x1FFFFF, val, priv); } void -chips_69000_writew_linear(uint32_t addr, uint16_t val, void *p) +chips_69000_writew_linear(uint32_t addr, uint16_t val, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x800000) @@ -2266,13 +2266,13 @@ chips_69000_writew_linear(uint32_t addr, uint16_t val, void *p) if (addr & 0x400000) return chips_69000_writew_mmio(addr, val, chips); - svga_writew_linear(addr & 0x1FFFFF, val, p); + svga_writew_linear(addr & 0x1FFFFF, val, priv); } void -chips_69000_writel_linear(uint32_t addr, uint32_t val, void *p) +chips_69000_writel_linear(uint32_t addr, uint32_t val, void *priv) { - svga_t *svga = (svga_t *) p; + svga_t *svga = (svga_t *) priv; chips_69000_t *chips = (chips_69000_t *) svga->priv; if (addr & 0x800000) @@ -2281,7 +2281,7 @@ chips_69000_writel_linear(uint32_t addr, uint32_t val, void *p) if (addr & 0x400000) return chips_69000_writel_mmio(addr, val, chips); - svga_writel_linear(addr & 0x1FFFFF, val, p); + svga_writel_linear(addr & 0x1FFFFF, val, priv); } void @@ -2526,9 +2526,9 @@ chips_69000_available(void) } void -chips_69000_close(void *p) +chips_69000_close(void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; chips->quit = 1; // thread_set_event(chips->fifo_event); @@ -2544,17 +2544,17 @@ chips_69000_close(void *p) } void -chips_69000_speed_changed(void *p) +chips_69000_speed_changed(void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; svga_recalctimings(&chips->svga); } void -chips_69000_force_redraw(void *p) +chips_69000_force_redraw(void *priv) { - chips_69000_t *chips = (chips_69000_t *) p; + chips_69000_t *chips = (chips_69000_t *) priv; chips->svga.fullchange = chips->svga.monitor->mon_changeframecount; } diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index a0d92ef9e..9ee74f512 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -6174,7 +6174,7 @@ mystique_hwcursor_draw(svga_t *svga, int displine) } static uint8_t -mystique_tvp3026_gpio_read(uint8_t cntl, void *priv) +mystique_tvp3026_gpio_read(UNUSED(uint8_t cntl), void *priv) { mystique_t *mystique = (mystique_t *) priv; diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 4db2737ca..e68e4c1a0 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1467,7 +1467,7 @@ svga_poll(void *priv) } uint32_t -svga_conv_16to32(struct svga_t *svga, uint16_t color, uint8_t bpp) +svga_conv_16to32(UNUSED(struct svga_t *svga), uint16_t color, uint8_t bpp) { return (bpp == 15) ? video_15to32[color] : video_16to32[color]; } diff --git a/src/video/vid_table.c b/src/video/vid_table.c index d10727d04..3055fc362 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -50,209 +50,208 @@ static int was_reset = 0; static const VIDEO_CARD video_cards[] = { // clang-format off - { &device_none }, - { &device_internal }, - { &atiega800p_device }, - { &mach8_vga_isa_device, VIDEO_FLAG_TYPE_8514 }, - { &mach32_isa_device, VIDEO_FLAG_TYPE_8514 }, - { &mach64gx_isa_device }, - { &ati28800k_device }, - { &ati18800_vga88_device }, - { &ati28800_device }, - { &compaq_ati28800_device }, - { &ati28800_wonder1024d_xl_plus_device }, + { .device = &device_none, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &device_internal, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &atiega800p_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mach8_vga_isa_device, .flags = VIDEO_FLAG_TYPE_8514 }, + { .device = &mach32_isa_device, .flags = VIDEO_FLAG_TYPE_8514 }, + { .device = &mach64gx_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ati28800k_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ati18800_vga88_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ati28800_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &compaq_ati28800_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ati28800_wonder1024d_xl_plus_device, .flags = VIDEO_FLAG_TYPE_NONE }, #ifdef USE_XL24 - { &ati28800_wonderxl24_device }, + { .device = &ati28800_wonderxl24_device, .flags = VIDEO_FLAG_TYPE_NONE }, #endif /* USE_XL24 */ - { &ati18800_device }, - { &ati18800_wonder_device }, - { &cga_device }, - { &sega_device }, - { &gd5401_isa_device }, - { &gd5402_isa_device }, - { &gd5420_isa_device }, - { &gd5422_isa_device }, - { &gd5426_isa_device }, - { &gd5426_diamond_speedstar_pro_a1_isa_device }, - { &gd5428_boca_isa_device }, - { &gd5428_isa_device }, - { &gd5429_isa_device }, - { &gd5434_isa_device }, - { &gd5434_diamond_speedstar_64_a3_isa_device }, - { &compaq_cga_device }, - { &compaq_cga_2_device }, - { &cpqega_device }, - { &ega_device }, - { &g2_gc205_device }, - { &hercules_device, VIDEO_FLAG_TYPE_MDA }, - { &herculesplus_device, VIDEO_FLAG_TYPE_MDA }, - { &incolor_device }, - { &inmos_isa_device, VIDEO_FLAG_TYPE_XGA }, - { &im1024_device }, - { &iskra_ega_device }, - { &et4000_kasan_isa_device }, - { &mda_device, VIDEO_FLAG_TYPE_MDA }, - { &genius_device }, - { &nga_device }, - { &ogc_device }, - { &oti037c_device }, - { &oti067_device }, - { &oti077_device }, - { ¶dise_pvga1a_device }, - { ¶dise_wd90c11_device }, - { ¶dise_wd90c30_device }, - { &colorplus_device }, - { &pgc_device }, - { &cga_pravetz_device }, - { &radius_svga_multiview_isa_device }, - { &realtek_rtg3105_device }, - { &realtek_rtg3106_device }, - { &s3_diamond_stealth_vram_isa_device }, - { &s3_orchid_86c911_isa_device }, - { &s3_ami_86c924_isa_device }, - { &s3_metheus_86c928_isa_device }, - { &s3_phoenix_86c801_isa_device }, - { &s3_spea_mirage_86c801_isa_device }, - { &sigma_device }, - { &tvga8900b_device }, - { &tvga8900d_device }, - { &tvga8900dr_device }, - { &tvga9000b_device }, - { &nec_sv9000_device }, - { &et4000k_isa_device }, - { &et2000_device }, - { &et3000_isa_device }, - { &et4000_tc6058af_isa_device }, - { &et4000_isa_device }, - { &et4000w32_device }, - { &et4000w32i_isa_device }, - { &vga_device }, - { &v7_vga_1024i_device }, - { &wy700_device }, - { &mach32_mca_device, VIDEO_FLAG_TYPE_8514 }, - { &gd5426_mca_device }, - { &gd5428_mca_device }, - { &et4000_mca_device }, - { &radius_svga_multiview_mca_device }, - { &mach32_pci_device, VIDEO_FLAG_TYPE_8514 }, - { &mach64gx_pci_device }, - { &mach64vt2_device }, - { &bochs_svga_device }, - { &chips_69000_device }, - { &gd5430_pci_device, }, - { &gd5434_pci_device }, - { &gd5436_pci_device, VIDEO_FLAG_TYPE_SPECIAL }, - { &gd5440_pci_device }, - { &gd5446_pci_device, VIDEO_FLAG_TYPE_SPECIAL }, - { &gd5446_stb_pci_device, VIDEO_FLAG_TYPE_SPECIAL }, - { &gd5480_pci_device }, - { &et4000w32p_videomagic_revb_pci_device }, - { &et4000w32p_revc_pci_device }, - { &et4000w32p_cardex_pci_device }, - { &et4000w32p_noncardex_pci_device }, - { &et4000w32p_pci_device }, - { &s3_spea_mercury_lite_86c928_pci_device }, - { &s3_diamond_stealth64_964_pci_device }, - { &s3_elsa_winner2000_pro_x_964_pci_device }, - { &s3_mirocrystal_20sv_964_pci_device }, - { &s3_bahamas64_pci_device }, - { &s3_phoenix_vision864_pci_device }, - { &s3_diamond_stealth_se_pci_device }, - { &s3_phoenix_trio32_pci_device }, - { &s3_diamond_stealth64_pci_device }, - { &s3_9fx_pci_device }, - { &s3_phoenix_trio64_pci_device }, - { &s3_diamond_stealth64_968_pci_device }, - { &s3_elsa_winner2000_pro_x_pci_device }, - { &s3_mirovideo_40sv_ergo_968_pci_device }, - { &s3_9fx_771_pci_device }, - { &s3_phoenix_vision968_pci_device }, - { &s3_spea_mercury_p64v_pci_device }, - { &s3_9fx_531_pci_device }, - { &s3_phoenix_vision868_pci_device }, - { &s3_cardex_trio64vplus_pci_device }, - { &s3_phoenix_trio64vplus_pci_device }, - { &s3_trio64v2_dx_pci_device }, - { &s3_virge_325_pci_device }, - { &s3_diamond_stealth_2000_pci_device }, - { &s3_mirocrystal_3d_pci_device }, - { &s3_diamond_stealth_3000_pci_device }, - { &s3_stb_velocity_3d_pci_device }, - { &s3_virge_375_pci_device }, - { &s3_diamond_stealth_2000pro_pci_device }, - { &s3_virge_385_pci_device }, - { &s3_virge_357_pci_device }, - { &s3_diamond_stealth_4000_pci_device }, - { &s3_trio3d2x_pci_device }, - { &millennium_device }, - { &millennium_ii_device }, - { &mystique_device }, - { &mystique_220_device }, - { &tgui9440_pci_device }, - { &tgui9660_pci_device }, - { &tgui9680_pci_device }, - { &voodoo_banshee_device }, - { &creative_voodoo_banshee_device }, - { &voodoo_3_1000_device }, - { &voodoo_3_2000_device }, - { &voodoo_3_3000_device }, - { &mach32_vlb_device, VIDEO_FLAG_TYPE_8514 }, - { &mach64gx_vlb_device }, - { &et4000w32i_vlb_device }, - { &et4000w32p_videomagic_revb_vlb_device }, - { &et4000w32p_revc_vlb_device }, - { &et4000w32p_cardex_vlb_device }, - { &et4000w32p_vlb_device }, - { &et4000w32p_noncardex_vlb_device }, - { &gd5424_vlb_device }, - { &gd5426_vlb_device }, - { &gd5428_vlb_device }, - { &gd5428_diamond_speedstar_pro_b1_vlb_device }, - { &gd5429_vlb_device }, - { &gd5430_diamond_speedstar_pro_se_a8_vlb_device }, - { &gd5430_vlb_device }, - { &gd5434_vlb_device }, - { &s3_metheus_86c928_vlb_device }, - { &s3_mirocrystal_8s_805_vlb_device }, - { &s3_mirocrystal_10sd_805_vlb_device }, - { &s3_phoenix_86c805_vlb_device }, - { &s3_spea_mirage_86c805_vlb_device }, - { &s3_diamond_stealth64_964_vlb_device }, - { &s3_mirocrystal_20sv_964_vlb_device }, - { &s3_mirocrystal_20sd_864_vlb_device }, - { &s3_bahamas64_vlb_device }, - { &s3_phoenix_vision864_vlb_device }, - { &s3_diamond_stealth_se_vlb_device }, - { &s3_phoenix_trio32_vlb_device }, - { &s3_diamond_stealth64_vlb_device }, - { &s3_9fx_vlb_device }, - { &s3_phoenix_trio64_vlb_device }, - { &s3_spea_mirage_p64_vlb_device }, - { &s3_diamond_stealth64_968_vlb_device }, - { &s3_stb_powergraph_64_video_vlb_device }, - { &ht216_32_standalone_device }, - { &tgui9400cxi_device }, - { &tgui9440_vlb_device }, - { &s3_virge_357_agp_device }, - { &s3_diamond_stealth_4000_agp_device }, - { &s3_trio3d2x_agp_device }, + { .device = &ati18800_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ati18800_wonder_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &cga_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &sega_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5401_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5402_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5420_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5422_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5426_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5426_diamond_speedstar_pro_a1_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5428_boca_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5428_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5429_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5434_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5434_diamond_speedstar_64_a3_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &compaq_cga_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &compaq_cga_2_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &cpqega_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ega_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &g2_gc205_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &hercules_device, .flags = VIDEO_FLAG_TYPE_MDA }, + { .device = &herculesplus_device, .flags = VIDEO_FLAG_TYPE_MDA }, + { .device = &incolor_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &inmos_isa_device, .flags = VIDEO_FLAG_TYPE_XGA }, + { .device = &im1024_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &iskra_ega_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000_kasan_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mda_device, .flags = VIDEO_FLAG_TYPE_MDA }, + { .device = &genius_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &nga_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ogc_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &oti037c_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &oti067_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &oti077_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = ¶dise_pvga1a_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = ¶dise_wd90c11_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = ¶dise_wd90c30_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &colorplus_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &pgc_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &cga_pravetz_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &radius_svga_multiview_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &realtek_rtg3105_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &realtek_rtg3106_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_vram_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_orchid_86c911_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_ami_86c924_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_metheus_86c928_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_86c801_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_spea_mirage_86c801_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &sigma_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tvga8900b_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tvga8900d_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tvga8900dr_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tvga9000b_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &nec_sv9000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000k_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et2000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et3000_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000_tc6058af_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32i_isa_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &vga_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &v7_vga_1024i_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &wy700_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mach32_mca_device, .flags = VIDEO_FLAG_TYPE_8514 }, + { .device = &gd5426_mca_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5428_mca_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000_mca_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &radius_svga_multiview_mca_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mach32_pci_device, .flags = VIDEO_FLAG_TYPE_8514 }, + { .device = &mach64gx_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mach64vt2_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &bochs_svga_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &chips_69000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5430_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5434_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5436_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL }, + { .device = &gd5440_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5446_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL }, + { .device = &gd5446_stb_pci_device, .flags = VIDEO_FLAG_TYPE_SPECIAL }, + { .device = &gd5480_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_videomagic_revb_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_revc_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_cardex_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_noncardex_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_spea_mercury_lite_86c928_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_964_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_elsa_winner2000_pro_x_964_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_20sv_964_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_bahamas64_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_vision864_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_se_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_trio32_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_9fx_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_trio64_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_968_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_elsa_winner2000_pro_x_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirovideo_40sv_ergo_968_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_9fx_771_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_vision968_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_spea_mercury_p64v_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_9fx_531_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_vision868_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_cardex_trio64vplus_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_trio64vplus_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_trio64v2_dx_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_virge_325_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_2000_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_3d_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_3000_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_stb_velocity_3d_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_virge_375_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_2000pro_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_virge_385_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_virge_357_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_4000_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_trio3d2x_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &millennium_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &millennium_ii_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mystique_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mystique_220_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tgui9440_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tgui9660_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tgui9680_pci_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_banshee_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &creative_voodoo_banshee_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_1000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_2000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3000_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &mach32_vlb_device, .flags = VIDEO_FLAG_TYPE_8514 }, + { .device = &mach64gx_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32i_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_videomagic_revb_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_revc_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_cardex_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &et4000w32p_noncardex_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5424_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5426_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5428_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5428_diamond_speedstar_pro_b1_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5429_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5430_diamond_speedstar_pro_se_a8_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5430_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &gd5434_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_metheus_86c928_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_8s_805_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_10sd_805_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_86c805_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_spea_mirage_86c805_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_964_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_20sv_964_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_mirocrystal_20sd_864_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_bahamas64_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_vision864_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_se_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_trio32_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_9fx_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_phoenix_trio64_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_spea_mirage_p64_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth64_968_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_stb_powergraph_64_video_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &ht216_32_standalone_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tgui9400cxi_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &tgui9440_vlb_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_virge_357_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_diamond_stealth_4000_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &s3_trio3d2x_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, #ifdef USE_G100 - { &productiva_g100_device, VIDEO_FLAG_TYPE_SPECIAL }, + { .device = &productiva_g100_device, .flags = VIDEO_FLAG_TYPE_SPECIAL }, #endif /*USE_G100 */ - { &velocity_100_agp_device }, - { &velocity_200_agp_device }, - { &voodoo_3_1000_agp_device }, - { &voodoo_3_2000_agp_device }, - { &voodoo_3_3000_agp_device }, - { &voodoo_3_3500_agp_ntsc_device }, - { &voodoo_3_3500_agp_pal_device }, - { &compaq_voodoo_3_3500_agp_device }, - { &voodoo_3_3500_se_agp_device }, - { &voodoo_3_3500_si_agp_device }, - { &nv3_device_agp }, - { &nv3_device_pci }, - - { NULL } + { .device = &velocity_100_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &velocity_200_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_1000_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_2000_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3000_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3500_agp_ntsc_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3500_agp_pal_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &compaq_voodoo_3_3500_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3500_se_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &voodoo_3_3500_si_agp_device, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &nv3_device_agp, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = &nv3_device_pci, .flags = VIDEO_FLAG_TYPE_NONE }, + { .device = NULL, .flags = VIDEO_FLAG_TYPE_NONE } // clang-format on }; diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index efab288de..e9fbe57f2 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -210,7 +210,7 @@ static void tgui_ext_writel(uint32_t addr, uint32_t val, void *priv); /*Remap address for chain-4/doubleword style layout*/ static __inline uint32_t -dword_remap(svga_t *svga, uint32_t in_addr) +dword_remap(UNUSED(svga_t *svga), uint32_t in_addr) { return ((in_addr << 2) & 0x3fff0) | ((in_addr >> 14) & 0xc) | (in_addr & ~0x3fffc); } diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index 93b557fec..ebd92d983 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -480,7 +480,7 @@ banshee_updatemapping(banshee_t *banshee) } uint32_t -banshee_conv_16to32(svga_t* svga, uint16_t color, uint8_t bpp) +banshee_conv_16to32(svga_t* svga, uint16_t color, UNUSED(uint8_t bpp)) { banshee_t *banshee = (banshee_t *) svga->priv; uint32_t ret = 0x00000000; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index 862dbd1cf..fb27b8b2c 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -19,7 +19,7 @@ #include #include #include -#include <86box/bswap.h> +//#include <86box/bswap.h> #include <86box/86box.h> #include <86box/io.h> #include <86box/machine.h> @@ -1504,7 +1504,7 @@ xga_bitblt(svga_t *svga) uint32_t old_dest_dat; uint32_t color_cmp = xga->accel.color_cmp; uint32_t plane_mask = xga->accel.plane_mask; - uint32_t patbase = xga->accel.px_map_base[xga->accel.pat_src]; + uint32_t patbase; uint32_t dstbase = xga->accel.px_map_base[xga->accel.dst_map]; uint32_t srcbase = xga->accel.px_map_base[xga->accel.src_map]; uint32_t patwidth = xga->accel.px_map_width[xga->accel.pat_src]; @@ -1632,6 +1632,8 @@ xga_bitblt(svga_t *svga) } } } else if (xga->accel.pat_src >= 1) { + patbase = xga->accel.px_map_base[xga->accel.pat_src]; + if (patheight == 7) { if (xga->accel.src_map != 1) xga->accel.pattern = 1; @@ -1741,6 +1743,8 @@ xga_bitblt(svga_t *svga) } } } else { + patbase = xga->accel.px_map_base[xga->accel.pat_src]; + while (xga->accel.y >= 0) { mix = xga_accel_read_pattern_map_pixel(svga, xga->accel.px, xga->accel.py, patbase, patwidth + 1);