Merge pull request #3580 from jriwanek-forks/warn-fix

Warning fixes and more tabs to spaces
This commit is contained in:
Miran Grča
2023-08-15 22:00:17 +02:00
committed by GitHub
32 changed files with 6085 additions and 6091 deletions

View File

@@ -100,9 +100,8 @@ typedef struct cpq_386_t {
static uint8_t
cpq_read_ram(uint32_t addr, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint8_t ret = 0xff;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
uint8_t ret = 0xff;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -115,9 +114,8 @@ cpq_read_ram(uint32_t addr, void *priv)
static uint16_t
cpq_read_ramw(uint32_t addr, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint16_t ret = 0xffff;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
uint16_t ret = 0xffff;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -130,9 +128,8 @@ cpq_read_ramw(uint32_t addr, void *priv)
static uint32_t
cpq_read_raml(uint32_t addr, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint32_t ret = 0xffffffff;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
uint32_t ret = 0xffffffff;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -145,8 +142,7 @@ cpq_read_raml(uint32_t addr, void *priv)
static void
cpq_write_ram(uint32_t addr, uint8_t val, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -157,8 +153,7 @@ cpq_write_ram(uint32_t addr, uint8_t val, void *priv)
static void
cpq_write_ramw(uint32_t addr, uint16_t val, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -169,8 +164,7 @@ cpq_write_ramw(uint32_t addr, uint16_t val, void *priv)
static void
cpq_write_raml(uint32_t addr, uint32_t val, void *priv)
{
cpq_ram_t *dev = (cpq_ram_t *) priv;
uint32_t old = addr;
const cpq_ram_t *dev = (cpq_ram_t *) priv;
addr = (addr - dev->virt_base) + dev->phys_base;
@@ -181,8 +175,8 @@ cpq_write_raml(uint32_t addr, uint32_t val, void *priv)
static uint8_t
cpq_read_regs(uint32_t addr, void *priv)
{
cpq_386_t *dev = (cpq_386_t *) priv;
uint8_t ret = 0xff;
const cpq_386_t *dev = (cpq_386_t *) priv;
uint8_t ret = 0xff;
addr &= 0x00000fff;
@@ -195,6 +189,9 @@ cpq_read_regs(uint32_t addr, void *priv)
/* RAM Setup Port (Read/Write) */
ret = dev->regs[addr];
break;
default:
break;
}
return ret;
@@ -203,7 +200,6 @@ cpq_read_regs(uint32_t addr, void *priv)
static uint16_t
cpq_read_regsw(uint32_t addr, void *priv)
{
cpq_386_t *dev = (cpq_386_t *) priv;
uint16_t ret = 0xffff;
ret = cpq_read_regs(addr, priv);
@@ -215,7 +211,6 @@ cpq_read_regsw(uint32_t addr, void *priv)
static uint32_t
cpq_read_regsl(uint32_t addr, void *priv)
{
cpq_386_t *dev = (cpq_386_t *) priv;
uint32_t ret = 0xffffffff;
ret = cpq_read_regsw(addr, priv);
@@ -306,8 +301,6 @@ cpq_recalc_ram(cpq_386_t *dev)
uint8_t end;
uint8_t k;
uint32_t virt_base;
uint32_t virt_addr;
uint32_t phys_addr;
cpq_ram_t *cram;
for (uint16_t i = 0x10; i < sys_min_high; i++)
@@ -393,14 +386,15 @@ cpq_write_regs(uint32_t addr, uint8_t val, void *priv)
cpq_recalc_cache(dev);
}
break;
default:
break;
}
}
static void
cpq_write_regsw(uint32_t addr, uint16_t val, void *priv)
{
cpq_386_t *dev = (cpq_386_t *) priv;
cpq_write_regs(addr, val & 0xff, priv);
cpq_write_regs(addr + 1, (val >> 8) & 0xff, priv);
}
@@ -408,8 +402,6 @@ cpq_write_regsw(uint32_t addr, uint16_t val, void *priv)
static void
cpq_write_regsl(uint32_t addr, uint32_t val, void *priv)
{
cpq_386_t *dev = (cpq_386_t *) priv;
cpq_write_regsw(addr, val & 0xff, priv);
cpq_write_regsw(addr + 2, (val >> 16) & 0xff, priv);
}
@@ -436,11 +428,9 @@ compaq_ram_init(cpq_ram_t *dev)
static void
compaq_ram_diags_parse(cpq_386_t *dev)
{
uint8_t val = dev->regs[0x00000001];
uint8_t val = dev->regs[0x00000001];
uint32_t accum = 0x00100000;
val;
for (uint8_t i = 0; i < 4; i++) {
dev->ram_bases[i] = accum;
@@ -451,6 +441,9 @@ compaq_ram_diags_parse(cpq_386_t *dev)
case RAM_DIAG_H_SYS_RAM_4MB:
dev->ram_sizes[i] = 0x00400000;
break;
default:
break;
}
if (i == 0)
dev->ram_sizes[i] -= 0x00100000;
@@ -476,8 +469,6 @@ compaq_recalc_base_ram(cpq_386_t *dev)
uint8_t low_end = 0x00;
uint8_t high_start = 0x00;
uint8_t high_end = 0x00;
uint32_t phys_addr = 0x00000000;
uint32_t virt_addr = 0x00000000;
cpq_ram_t *cram;
switch (base_mem) {
@@ -618,7 +609,7 @@ compaq_386_close(void *priv)
}
static void *
compaq_386_init(const device_t *info)
compaq_386_init(UNUSED(const device_t *info))
{
cpq_386_t *dev = (cpq_386_t *) calloc(1, sizeof(cpq_386_t));
@@ -706,6 +697,9 @@ compaq_386_init(const device_t *info)
dev->regs[0x00000001] = RAM_DIAG_H_SYS_RAM_4MB | RAM_DIAG_H_MOD_A_RAM_4MB |
RAM_DIAG_H_MOD_B_RAM_4MB | RAM_DIAG_H_MOD_C_RAM_4MB;
break;
default:
break;
}
} else
dev->regs[0x00000001] = RAM_DIAG_H_SYS_RAM_1MB | RAM_DIAG_H_MOD_A_RAM_NONE |

View File

@@ -1,6 +1,7 @@
#if defined __amd64__ || defined _M_X64
# include <stdint.h>
# include <inttypes.h>
# include <86box/86box.h>
# include "cpu.h"
# include <86box/mem.h>
@@ -125,7 +126,7 @@ host_x86_ADD64_REG_IMM(codeblock_t *block, int dst_reg, uint64_t imm_data)
codegen_alloc_bytes(block, 4);
codegen_addbyte4(block, 0x48, 0x83, 0xc0 | RM_OP_ADD | (dst_reg & 7), imm_data & 0xff); /*ADD dst_reg, imm_data*/
} else
fatal("ADD64_REG_IMM !is_imm8 %016llx\n", imm_data);
fatal("ADD64_REG_IMM !is_imm8 %016" PRIx64 "\n", imm_data);
}
void
host_x86_ADD8_REG_REG(codeblock_t *block, int dst_reg, int src_reg)
@@ -1614,7 +1615,7 @@ host_x86_SUB64_REG_IMM(codeblock_t *block, int dst_reg, uint64_t imm_data)
codegen_alloc_bytes(block, 4);
codegen_addbyte4(block, 0x48, 0x83, 0xc0 | RM_OP_SUB | (dst_reg & 7), imm_data & 0xff); /*SUB dst_reg, imm_data*/
} else
fatal("SUB64_REG_IMM !is_imm8 %016llx\n", imm_data);
fatal("SUB64_REG_IMM !is_imm8 %016" PRIx64 "\n", imm_data);
}
void
host_x86_SUB8_REG_REG(codeblock_t *block, int dst_reg, int src_reg)

File diff suppressed because it is too large Load Diff

View File

@@ -64,8 +64,10 @@ static void
postcard_setui(void)
{
if (postcard_ports_num > 1) {
char ps[2][POSTCARDS_NUM][3] = { { 0 },
{ 0 } };
char ps[2][POSTCARDS_NUM][3] = { { { 0 },
{ 0 },
} };
for (uint8_t i = 0; i < POSTCARDS_NUM; i++) {
if (!postcard_written[i]) {
snprintf(ps[0][i], sizeof(ps[0][i]), "--");

View File

@@ -439,14 +439,12 @@ MVHDAPI int
mvhd_file_is_vhd(FILE* f)
{
uint8_t con_str[8];
size_t res;
if (f == NULL) {
return 0;
}
mvhd_fseeko64(f, -MVHD_FOOTER_SIZE, SEEK_END);
res = fread(con_str, sizeof con_str, 1, f);
if (mvhd_is_conectix_str(con_str)) {
return 1;
}

View File

@@ -179,7 +179,7 @@ extern void reset_screen_size_monitor(int monitor_index);
extern void set_screen_size_natural(void);
extern void update_mouse_msg(void);
#if 0
extern void pc_reload(wchar_t *fn);
extern void pc_reload(wchar_t *fn);
#endif
extern int pc_init_modules(void);
extern int pc_init(int argc, char *argv[]);

View File

@@ -1,5 +1,5 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.

View File

@@ -1,18 +1,18 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
* This file is part of the 86Box distribution.
*
* Definitions for the common CD-ROM interface controller handler.
* Definitions for the common CD-ROM interface controller handler.
*
*
*
* Authors: TheCollector1995
* Authors: TheCollector1995
*
* Copyright 2022 TheCollector1995.
* Copyright 2022 TheCollector1995.
*/
#ifndef EMU_CDROM_INTERFACE_H
#define EMU_CDROM_INTERFACE_H

View File

@@ -53,13 +53,13 @@ extern void lpt1_remove_ams(void);
#define lpt4_remove() lpt_port_remove(3)
#if 0
#define lpt5_init(a) lpt_port_init(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt5_init(a) lpt_port_init(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt6_init(a) lpt_port_init(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#define lpt6_init(a) lpt_port_init(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#endif
void lpt_devices_init(void);

View File

@@ -318,8 +318,8 @@ typedef struct _machine_ {
void *kbc_device;
#endif /* EMU_DEVICE_H */
/* Bits:
7-0 Set bits are forced set on P1 (no forced set = 0x00);
15-8 Clear bits are forced clear on P1 (no foced clear = 0xff). */
7-0 Set bits are forced set on P1 (no forced set = 0x00);
15-8 Clear bits are forced clear on P1 (no foced clear = 0xff). */
uint16_t kbc_p1;
uint32_t gpio;
uint32_t gpio_acpi;

View File

@@ -65,7 +65,7 @@ extern const device_t mouse_logibus_device;
extern const device_t mouse_logibus_onboard_device;
extern const device_t mouse_msinport_device;
# ifdef USE_GENIBUS
extern const device_t mouse_genibus_device;
extern const device_t mouse_genibus_device;
# endif
extern const device_t mouse_mssystems_device;
extern const device_t mouse_msserial_device;

View File

@@ -11,7 +11,7 @@
*
*
*
* Based on @(#)Dev3C501.cpp Oracle (VirtualBox)
* Based on @(#)Dev3C501.cpp Oracle (VirtualBox)
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Oracle

View File

@@ -49,7 +49,7 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
# define ftello64 ftello
# define off64_t off_t
#elif defined(_MSC_VER)
// # define fopen64 fopen
// # define fopen64 fopen
# define fseeko64 _fseeki64
# define ftello64 _ftelli64
# define off64_t off_t

View File

@@ -40,23 +40,23 @@ struct dirent {
# define d_namlen d_reclen
typedef struct DIR_t {
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */
short sts; /* last known status code */
char *dta; /* internal work data */
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */
short sts; /* last known status code */
char *dta; /* internal work data */
# ifdef UNICODE
wchar_t dir[MAXDIRLEN + 1]; /* open dir */
wchar_t dir[MAXDIRLEN + 1]; /* open dir */
# else
char dir[MAXDIRLEN + 1]; /* open dir */
char dir[MAXDIRLEN + 1]; /* open dir */
# endif
struct dirent dent; /* actual directory entry */
struct dirent dent; /* actual directory entry */
} DIR;
/* Directory routine flags. */
# define DIR_F_LOWER 0x0001 /* force to lowercase */
# define DIR_F_SANE 0x0002 /* force this to sane path */
# define DIR_F_ISROOT 0x0010 /* this is the root directory */
# define DIR_F_LOWER 0x0001 /* force to lowercase */
# define DIR_F_SANE 0x0002 /* force this to sane path */
# define DIR_F_ISROOT 0x0010 /* this is the root directory */
/* Function prototypes. */
extern DIR *opendir(const char *);

View File

@@ -67,7 +67,7 @@
#define IDT_CPU_SPEED 1710 /* CPU speed: */
#define IDT_FPU 1711 /* FPU: */
#define IDT_WAIT_STATES 1712 /* Wait states: */
#define IDT_MB 1713 /* MB == IDC_TEXT_MB */
#define IDT_MB 1713 /* MB == IDC_TEXT_MB */
#define IDT_MEMORY 1714 /* Memory: */
/* DLG_CFG_VIDEO */

View File

@@ -1,18 +1,18 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
* This file is part of the 86Box distribution.
*
* Definitions for the SMRAM interface.
* Definitions for the SMRAM interface.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2016-2020 Miran Grca.
*/
#ifndef EMU_ROW_H
@@ -43,4 +43,4 @@ extern void row_set_boundary(uint8_t row_id, uint32_t boundary);
extern device_t row_device;
#endif /*EMU_ROW_H*/
#endif /*EMU_ROW_H*/

View File

@@ -30,32 +30,32 @@
#define NVR_SIZE 256 /* size of NVR */
/* EEPROM map and bit definitions. */
#define EE0_HOSTID 0x07 /* EE(0) [2:0] */
#define EE0_ALTFLOP 0x80 /* EE(0) [7] FDC at 370h */
#define EE1_IRQCH 0x07 /* EE(1) [3:0] */
#define EE1_DMACH 0x70 /* EE(1) [7:4] */
#define EE2_RMVOK 0x01 /* EE(2) [0] Support removable disks */
#define EE2_HABIOS 0x02 /* EE(2) [1] HA Bios Space Reserved */
#define EE2_INT19 0x04 /* EE(2) [2] HA Bios Controls INT19 */
#define EE2_DYNSCAN 0x08 /* EE(2) [3] Dynamically scan bus */
#define EE2_TWODRV 0x10 /* EE(2) [4] Allow more than 2 drives */
#define EE2_SEEKRET 0x20 /* EE(2) [5] Immediate return on seek */
#define EE2_EXT1G 0x80 /* EE(2) [7] Extended Translation >1GB */
#define EE3_SPEED 0x00 /* EE(3) [7:0] DMA Speed */
#define EE0_HOSTID 0x07 /* EE(0) [2:0] */
#define EE0_ALTFLOP 0x80 /* EE(0) [7] FDC at 370h */
#define EE1_IRQCH 0x07 /* EE(1) [3:0] */
#define EE1_DMACH 0x70 /* EE(1) [7:4] */
#define EE2_RMVOK 0x01 /* EE(2) [0] Support removable disks */
#define EE2_HABIOS 0x02 /* EE(2) [1] HA Bios Space Reserved */
#define EE2_INT19 0x04 /* EE(2) [2] HA Bios Controls INT19 */
#define EE2_DYNSCAN 0x08 /* EE(2) [3] Dynamically scan bus */
#define EE2_TWODRV 0x10 /* EE(2) [4] Allow more than 2 drives */
#define EE2_SEEKRET 0x20 /* EE(2) [5] Immediate return on seek */
#define EE2_EXT1G 0x80 /* EE(2) [7] Extended Translation >1GB */
#define EE3_SPEED 0x00 /* EE(3) [7:0] DMA Speed */
#define SPEED_33 0xFF
#define SPEED_50 0x00
#define SPEED_56 0x04
#define SPEED_67 0x01
#define SPEED_80 0x02
#define SPEED_10 0x03
#define EE4_FLOPTOK 0x80 /* EE(4) [7] Support Flopticals */
#define EE6_PARITY 0x01 /* EE(6) [0] parity check enable */
#define EE6_TERM 0x02 /* EE(6) [1] host term enable */
#define EE6_RSTBUS 0x04 /* EE(6) [2] reset SCSI bus on boot */
#define EEE_SYNC 0x01 /* EE(E) [0] Enable Sync Negotiation */
#define EEE_DISCON 0x02 /* EE(E) [1] Enable Disconnection */
#define EEE_FAST 0x04 /* EE(E) [2] Enable FAST SCSI */
#define EEE_START 0x08 /* EE(E) [3] Enable Start Unit */
#define EE4_FLOPTOK 0x80 /* EE(4) [7] Support Flopticals */
#define EE6_PARITY 0x01 /* EE(6) [0] parity check enable */
#define EE6_TERM 0x02 /* EE(6) [1] host term enable */
#define EE6_RSTBUS 0x04 /* EE(6) [2] reset SCSI bus on boot */
#define EEE_SYNC 0x01 /* EE(E) [0] Enable Sync Negotiation */
#define EEE_DISCON 0x02 /* EE(E) [1] Enable Disconnection */
#define EEE_FAST 0x04 /* EE(E) [2] Enable FAST SCSI */
#define EEE_START 0x08 /* EE(E) [3] Enable Start Unit */
/*
* Host Adapter I/O ports.
@@ -166,11 +166,11 @@
#define FOURTEEN_BYTES 0x00 /* Request Sense Buffer size */
#define NO_AUTO_REQUEST_SENSE 0x01 /* No Request Sense Buffer */
/* Bytes 4, 5 and 6 Data Length - Data transfer byte count */
/* Bytes 7, 8 and 9 Data Pointer - SGD List or Data Buffer */
/* Bytes 10, 11 and 12 Link Pointer - Next CCB in Linked List */
/* Byte 13 Command Link ID - TBD (I don't know yet) */
/* Byte 14 Host Status - Host Adapter status */
/* Bytes 4, 5 and 6 Data Length - Data transfer byte count */
/* Bytes 7, 8 and 9 Data Pointer - SGD List or Data Buffer */
/* Bytes 10, 11 and 12 Link Pointer - Next CCB in Linked List */
/* Byte 13 Command Link ID - TBD (I don't know yet) */
/* Byte 14 Host Status - Host Adapter status */
#define CCB_COMPLETE 0x00 /* CCB completed without error */
#define CCB_LINKED_COMPLETE 0x0A /* Linked command completed */
#define CCB_LINKED_COMPLETE_INT 0x0B /* Linked complete with intr */

View File

@@ -668,11 +668,11 @@ Short Delay Short Delay + Feedback
// Chorus Params
typedef struct {
WORD FbkLevel; // Feedback Level (0xE600-0xE6FF)
WORD Delay; // Delay (0-0x0DA3) [1/44100 sec]
WORD LfoDepth; // LFO Depth (0xBC00-0xBCFF)
DWORD DelayR; // Right Delay (0-0xFFFFFFFF) [1/256/44100 sec]
DWORD LfoFreq; // LFO Frequency (0-0xFFFFFFFF)
WORD FbkLevel; // Feedback Level (0xE600-0xE6FF)
WORD Delay; // Delay (0-0x0DA3) [1/44100 sec]
WORD LfoDepth; // LFO Depth (0xBC00-0xBCFF)
DWORD DelayR; // Right Delay (0-0xFFFFFFFF) [1/256/44100 sec]
DWORD LfoFreq; // LFO Frequency (0-0xFFFFFFFF)
} CHORUS_TYPE;

View File

@@ -8,7 +8,7 @@
*
* Definitions for the NukedOPL3 driver.
*
* Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16
* Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>

View File

@@ -156,12 +156,12 @@ extern void pgc_sto_raster(pgc_t *, int16_t *x, int16_t *y);
extern void pgc_ito_raster(pgc_t *, int32_t *x, int32_t *y);
extern void pgc_dto_raster(pgc_t *, double *x, double *y);
#if 0
extern int pgc_input_byte(pgc_t *, uint8_t *val);
extern int pgc_output_byte(pgc_t *, uint8_t val);
extern int pgc_input_byte(pgc_t *, uint8_t *val);
extern int pgc_output_byte(pgc_t *, uint8_t val);
#endif
extern int pgc_output_string(pgc_t *, const char *val);
#if 0
extern int pgc_error_byte(pgc_t *, uint8_t val);
extern int pgc_error_byte(pgc_t *, uint8_t val);
#endif
extern int pgc_error_string(pgc_t *, const char *val);
extern int pgc_error(pgc_t *, int err);

View File

@@ -1,18 +1,18 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
* This file is part of the 86Box distribution.
*
* 3DFX Voodoo emulation.
* 3DFX Voodoo emulation.
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2008-2020 Sarah Walker.
* Copyright 2008-2020 Sarah Walker.
*/
#ifndef VIDEO_VOODOO_BLITTER_H

File diff suppressed because it is too large Load Diff

View File

@@ -152,7 +152,7 @@ extern int changeframecount;
extern volatile int screenshots;
#if 0
extern bitmap_t *buffer32;
extern bitmap_t *buffer32;
#endif
#define buffer32 (monitors[monitor_index_global].target_buffer)
#define pal_lookup (monitors[monitor_index_global].mon_pal_lookup)
@@ -179,7 +179,7 @@ extern bitmap_t *buffer32;
extern PALETTE cgapal;
extern PALETTE cgapal_mono[6];
#if 0
extern uint32_t pal_lookup[256];
extern uint32_t pal_lookup[256];
#endif
extern int video_fullscreen;
extern int video_fullscreen_scale;

View File

@@ -1299,7 +1299,7 @@ lcdm_poll(amsvid_t *vid)
drawcursor = ((mda->ma == ca) && mda->con && mda->cursoron);
blink = ((mda->blink & 16) && (mda->ctrl & 0x20) && (attr & 0x80) && !drawcursor);
lcd_draw_char_80(vid, &((buffer32->line[mda->displine]))[x * 8], chr, attr, drawcursor, blink, mda->sc, 0, mda->ctrl);
lcd_draw_char_80(vid, &(buffer32->line[mda->displine])[x * 8], chr, attr, drawcursor, blink, mda->sc, 0, mda->ctrl);
mda->ma++;
}
}
@@ -2005,10 +2005,8 @@ const device_t vid_pc3086_device = {
};
static void
ms_write(uint16_t addr, UNUSED(uint8_t val), void *priv)
ms_write(uint16_t addr, UNUSED(uint8_t val), UNUSED(void *priv))
{
amstrad_t *ams = (amstrad_t *) priv;
if ((addr == 0x78) || (addr == 0x79))
mouse_clear_x();
else
@@ -2016,11 +2014,10 @@ ms_write(uint16_t addr, UNUSED(uint8_t val), void *priv)
}
static uint8_t
ms_read(uint16_t addr, void *priv)
ms_read(uint16_t addr, UNUSED(void *priv))
{
amstrad_t *ams = (amstrad_t *) priv;
uint8_t ret;
int delta = 0;
uint8_t ret;
int delta = 0;
if ((addr == 0x78) || (addr == 0x79)) {
mouse_subtract_x(&delta, NULL, -128, 127, 0);

View File

@@ -705,8 +705,8 @@ const device_config_t compaq_plasma_config[] = {
// clang-format off
{
.name = "rgb_type",
.description = "RGB type",
.type = CONFIG_SELECTION,
.description = "RGB type",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",

View File

@@ -22,5 +22,5 @@ add_library(mt32emu STATIC Analog.cpp BReverbModel.cpp Display.cpp File.cpp File
srchelper/srctools/src/LinearResampler.cpp
srchelper/srctools/src/ResamplerModel.cpp
srchelper/srctools/src/SincResampler.cpp
srchelper/InternalResampler.cpp Synth.cpp Tables.cpp TVA.cpp TVF.cpp
srchelper/InternalResampler.cpp Synth.cpp Tables.cpp TVA.cpp TVF.cpp
TVP.cpp sha1/sha1.cpp c_interface/c_interface.cpp)

View File

@@ -68,7 +68,7 @@ void
ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga)
{
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = &svga->dev8514;
switch (addr) {
case 0:
@@ -172,7 +172,7 @@ uint8_t
ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga)
{
const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = &svga->dev8514;
uint8_t temp = 0;
switch (addr) {

View File

@@ -26,6 +26,7 @@
#include <86box/video.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/plat_unused.h>
typedef struct ati68875_ramdac_t {
uint8_t gen_cntl;
@@ -37,9 +38,9 @@ typedef struct ati68875_ramdac_t {
} ati68875_ramdac_t;
void
ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga)
ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga)
{
ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) p;
ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) priv;
uint8_t rs = (addr & 0x03);
rs |= (!!rs2 << 2);
@@ -73,18 +74,20 @@ ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_
case 0x0f: /* Reset State (RS value = 1111) */
ramdac->mux_cntl = 0x2d;
break;
default:
break;
}
return;
}
uint8_t
ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga)
ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga)
{
ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) p;
ibm8514_t *dev = &svga->dev8514;
uint8_t rs = (addr & 0x03);
uint8_t temp = 0;
const ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) priv;
uint8_t rs = (addr & 0x03);
uint8_t temp = 0;
rs |= (!!rs2 << 2);
rs |= (!!rs3 << 3);
@@ -116,15 +119,21 @@ ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga)
case 0x03:
temp = 0x75;
break;
default:
break;
}
break;
default:
break;
}
return temp;
}
static void *
ati68875_ramdac_init(const device_t *info)
ati68875_ramdac_init(UNUSED(const device_t *info))
{
ati68875_ramdac_t *ramdac = (ati68875_ramdac_t *) malloc(sizeof(ati68875_ramdac_t));
memset(ramdac, 0, sizeof(ati68875_ramdac_t));

View File

@@ -2565,7 +2565,7 @@ mach_recalctimings(svga_t *svga)
{
const mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
int clock_sel;
int clock_sel;
clock_sel = ((svga->miscout >> 2) & 3) | ((mach->regs[0xbe] & 0x10) >> 1) | ((mach->regs[0xb9] & 2) << 1);
@@ -2639,7 +2639,7 @@ mach_recalctimings(svga_t *svga)
dev->pitch = dev->ext_pitch;
dev->rowoffset = dev->ext_crt_pitch;
if ((mach->accel.ext_ge_config & 0x800) || ((!(mach->accel.ext_ge_config & 0x8000) && !(mach->accel.ext_ge_config & 0x800)))) {
if ((mach->accel.ext_ge_config & 0x800) || (!(mach->accel.ext_ge_config & 0x8000) && !(mach->accel.ext_ge_config & 0x800))) {
if ((mach->accel.ext_ge_config & 0x30) == 0x20) {
if ((mach->accel.ext_ge_config & 0xc0) == 0x40)
dev->accel_bpp = 16;
@@ -2676,6 +2676,9 @@ mach_recalctimings(svga_t *svga)
else
svga->render8514 = ibm8514_render_RGBA8888;
break;
default:
break;
}
}
switch (mach->regs[0xb8] & 0xc0) {
@@ -2688,6 +2691,9 @@ mach_recalctimings(svga_t *svga)
case 0xc0:
svga->clock *= 4;
break;
default:
break;
}
} else {
dev->h_disp = (dev->hdisp + 1) << 3;
@@ -2773,6 +2779,9 @@ mach_recalctimings(svga_t *svga)
}
break;
default:
break;
}
}
}
@@ -3645,7 +3654,7 @@ mach_accel_out(uint16_t port, uint8_t val, mach_t *mach)
svga_recalctimings(svga);
break;
case 0x1ee8:
case 0x1ee8:
case 0x1ee9:
mach_log("ATI 8514/A: V_SYNC_WID write 1EE8 = %02x\n", val);
svga_recalctimings(svga);
@@ -4733,9 +4742,8 @@ mach32_write_linear(uint32_t addr, uint8_t val, void *priv)
static void
mach32_write(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
if (!dev->on) {
svga_write(addr, val, svga);
@@ -4749,9 +4757,8 @@ mach32_write(uint32_t addr, uint8_t val, void *priv)
static void
mach32_writew(uint32_t addr, uint16_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
if (!dev->on) {
svga_writew(addr, val, svga);
@@ -4765,9 +4772,8 @@ mach32_writew(uint32_t addr, uint16_t val, void *priv)
static void
mach32_writel(uint32_t addr, uint32_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
if (!dev->on) {
svga_writel(addr, val, svga);
@@ -4783,13 +4789,13 @@ mach32_writel(uint32_t addr, uint32_t val, void *priv)
static uint8_t
mach32_read_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
uint32_t latch_addr = 0;
int readplane = svga->readplane;
uint8_t count;
uint8_t temp;
uint8_t ret;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
uint32_t latch_addr = 0;
int readplane = svga->readplane;
uint8_t count;
uint8_t temp;
uint8_t ret;
cycles -= svga->monitor->mon_video_timing_read_b;
@@ -4864,10 +4870,9 @@ mach32_read_linear(uint32_t addr, void *priv)
static uint8_t
mach32_read(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
uint8_t ret;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
uint8_t ret;
if (!dev->on) {
ret = svga_read(addr, svga);
@@ -4882,10 +4887,9 @@ mach32_read(uint32_t addr, void *priv)
static uint16_t
mach32_readw(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
uint16_t ret;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
uint16_t ret;
if (!dev->on) {
ret = svga_readw(addr, svga);
@@ -4900,10 +4904,9 @@ mach32_readw(uint32_t addr, void *priv)
static uint32_t
mach32_readl(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
uint32_t ret;
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
uint32_t ret;
if (!dev->on) {
ret = svga_readl(addr, svga);
@@ -5171,6 +5174,7 @@ mach32_hwcursor_draw(svga_t *svga, int displine)
dev->hwcursor_latch.addr += 16;
}
#if 0
static void
mach_io_remove(mach_t *mach)
{
@@ -5284,6 +5288,7 @@ mach_io_remove(mach_t *mach)
io_removehandler(0xfaee, 0x0002, mach_accel_inb, mach_accel_inw, mach_accel_inl, mach_accel_outb, mach_accel_outw, mach_accel_outl, mach);
io_removehandler(0xfeee, 0x0002, mach_accel_inb, mach_accel_inw, mach_accel_inl, mach_accel_outb, mach_accel_outw, mach_accel_outl, mach);
}
#endif
static void
mach_io_set(mach_t *mach)

View File

@@ -538,7 +538,7 @@ svga_set_ramdac_type(svga_t *svga, int type)
void
svga_recalctimings(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = &svga->dev8514;
double crtcconst;
double _dispontime;
double _dispofftime;

View File

@@ -1357,8 +1357,6 @@ tgui_accel_command(int count, uint32_t cpu_dat, tgui_t *tgui)
uint32_t trans_col = (tgui->accel.flags & TGUI_TRANSREV) ? tgui->accel.fg_col : tgui->accel.bg_col;
uint16_t *vram_w = (uint16_t *) svga->vram;
uint32_t *vram_l = (uint32_t *) svga->vram;
uint8_t ger22lower = tgui->accel.ger22 & 0xff;
uint8_t ger22upper = (tgui->accel.ger22 >> 8) & 0xff;
if (tgui->accel.bpp == 0) {
trans_col &= 0xff;

View File

@@ -3079,7 +3079,6 @@ xga_init(const device_t *info)
xga_t *xga = &svga->xga;
FILE *f;
uint8_t *rom = NULL;
size_t res;
xga->ext_mem_addr = device_get_config_hex16("ext_mem_addr");
xga->instance_isa = device_get_config_int("instance");
@@ -3104,7 +3103,6 @@ xga_init(const device_t *info)
rom = malloc(xga->bios_rom.sz);
memset(rom, 0xff, xga->bios_rom.sz);
res = fread(rom, xga->bios_rom.sz, 1, f);
(void) fclose(f);
xga->bios_rom.rom = rom;