Next round of sonarlint cleanups
This commit is contained in:
@@ -84,7 +84,11 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
int secount, sector, cylinder, head, cylprecomp;
|
||||
int secount;
|
||||
int sector;
|
||||
int cylinder;
|
||||
int head;
|
||||
int cylprecomp;
|
||||
uint8_t command;
|
||||
uint8_t fdisk;
|
||||
int pos;
|
||||
@@ -132,13 +136,13 @@ irq_raise(esdi_t *esdi)
|
||||
}
|
||||
|
||||
static __inline void
|
||||
irq_lower(esdi_t *esdi)
|
||||
irq_lower(UNUSED(esdi_t *esdi))
|
||||
{
|
||||
picintc(1 << 14);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
irq_update(esdi_t *esdi)
|
||||
irq_update(UNUSED(esdi_t *esdi))
|
||||
{
|
||||
if (esdi->irqstat && !((pic2.irr | pic2.isr) & 0x40) && !(esdi->fdisk & 2))
|
||||
picint(1 << 14);
|
||||
@@ -159,7 +163,7 @@ esdi_set_callback(esdi_t *esdi, double callback)
|
||||
}
|
||||
|
||||
double
|
||||
esdi_get_xfer_time(esdi_t *esdi, int size)
|
||||
esdi_get_xfer_time(UNUSED(esdi_t *esdi), int size)
|
||||
{
|
||||
/* 390.625 us per sector at 10 Mbit/s = 1280 kB/s. */
|
||||
return (3125.0 / 8.0) * (double) size;
|
||||
@@ -417,6 +421,9 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
|
||||
esdi->fdisk = val;
|
||||
irq_update(esdi);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,6 +505,9 @@ esdi_read(uint16_t port, void *priv)
|
||||
irq_lower(esdi);
|
||||
temp = esdi->status;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
esdi_at_log("WD1007 read(%04x) = %02x\n", port, temp);
|
||||
@@ -791,7 +801,7 @@ esdi_callback(void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
loadhd(esdi_t *esdi, int hdd_num, int d, const char *fn)
|
||||
loadhd(esdi_t *esdi, int hdd_num, int d, UNUSED(const char *fn))
|
||||
{
|
||||
drive_t *drive = &esdi->drives[hdd_num];
|
||||
|
||||
@@ -822,7 +832,7 @@ esdi_rom_write(uint32_t addr, uint8_t val, void *p)
|
||||
}
|
||||
|
||||
static void *
|
||||
wd1007vse1_init(const device_t *info)
|
||||
wd1007vse1_init(UNUSED(const device_t *info))
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
#include <86box/ui.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
/* These are hardwired. */
|
||||
#define ESDI_IOADDR_PRI 0x3510
|
||||
@@ -117,8 +118,8 @@ typedef struct esdi_t {
|
||||
uint16_t cmd_data[4];
|
||||
int cmd_dev;
|
||||
|
||||
int status_pos,
|
||||
status_len;
|
||||
int status_pos;
|
||||
int status_len;
|
||||
|
||||
uint16_t status_data[256];
|
||||
|
||||
@@ -221,7 +222,7 @@ set_irq(esdi_t *dev)
|
||||
}
|
||||
|
||||
static __inline void
|
||||
clear_irq(esdi_t *dev)
|
||||
clear_irq(UNUSED(esdi_t *dev))
|
||||
{
|
||||
picintc(1 << 14);
|
||||
}
|
||||
@@ -241,7 +242,7 @@ esdi_mca_set_callback(esdi_t *dev, double callback)
|
||||
}
|
||||
|
||||
static double
|
||||
esdi_mca_get_xfer_time(esdi_t *esdi, int size)
|
||||
esdi_mca_get_xfer_time(UNUSED(esdi_t *esdi), int size)
|
||||
{
|
||||
/* 390.625 us per sector at 10 Mbit/s = 1280 kB/s. */
|
||||
return (3125.0 / 8.0) * (double) size;
|
||||
@@ -440,6 +441,9 @@ esdi_callback(void *priv)
|
||||
dev->irq_in_progress = 1;
|
||||
set_irq(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -513,6 +517,9 @@ esdi_callback(void *priv)
|
||||
dev->irq_in_progress = 1;
|
||||
set_irq(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -546,6 +553,9 @@ esdi_callback(void *priv)
|
||||
dev->irq_in_progress = 1;
|
||||
set_irq(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -577,6 +587,9 @@ esdi_callback(void *priv)
|
||||
dev->irq_in_progress = 1;
|
||||
set_irq(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -695,7 +708,6 @@ esdi_callback(void *priv)
|
||||
}
|
||||
|
||||
dev->data[dev->data_pos++] = val & 0xffff;
|
||||
;
|
||||
}
|
||||
|
||||
memcpy(dev->sector_buffer[dev->sector_pos++], dev->data, 512);
|
||||
@@ -714,6 +726,9 @@ esdi_callback(void *priv)
|
||||
set_irq(dev);
|
||||
ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -771,6 +786,9 @@ esdi_callback(void *priv)
|
||||
set_irq(dev);
|
||||
ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -839,6 +857,9 @@ esdi_callback(void *priv)
|
||||
dev->irq_in_progress = 1;
|
||||
set_irq(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1085,6 +1106,9 @@ esdi_mca_write(int port, uint8_t val, void *priv)
|
||||
case 0x10:
|
||||
dev->dma = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (dev->pos_regs[2] & 1) {
|
||||
@@ -1113,7 +1137,7 @@ esdi_mca_feedb(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
esdi_init(const device_t *info)
|
||||
esdi_init(UNUSED(const device_t *info))
|
||||
{
|
||||
drive_t *drive;
|
||||
esdi_t *dev;
|
||||
|
||||
@@ -111,10 +111,14 @@
|
||||
#define IDE_TIME 10.0
|
||||
|
||||
typedef struct {
|
||||
int bit32, cur_dev,
|
||||
irq, inited,
|
||||
diag, force_ata3;
|
||||
uint16_t base_main, side_main;
|
||||
int bit32;
|
||||
int cur_dev;
|
||||
int irq;
|
||||
int inited;
|
||||
int diag;
|
||||
int force_ata3;
|
||||
uint16_t base_main;
|
||||
uint16_t side_main;
|
||||
pc_timer_t timer;
|
||||
ide_t *ide[2];
|
||||
} ide_board_t;
|
||||
@@ -717,7 +721,7 @@ ide_next_sector(ide_t *ide)
|
||||
}
|
||||
|
||||
static void
|
||||
loadhd(ide_t *ide, int d, const char *fn)
|
||||
loadhd(ide_t *ide, int d, UNUSED(const char *fn))
|
||||
{
|
||||
if (!hdd_image_load(d)) {
|
||||
ide->type = IDE_NONE;
|
||||
@@ -746,7 +750,9 @@ ide_set_signature(ide_t *ide)
|
||||
ide->cylinder = ide->sc->request_length;
|
||||
} else {
|
||||
ide->secount = 1;
|
||||
// ide->cylinder = ((ide->type == IDE_HDD) ? 0 : 0xFFFF);
|
||||
#if 0
|
||||
ide->cylinder = ((ide->type == IDE_HDD) ? 0 : 0xFFFF);
|
||||
#endif
|
||||
ide->cylinder = ((ide->type == IDE_HDD) ? 0 : 0x7F7F);
|
||||
if (ide->type == IDE_HDD)
|
||||
ide->drive = 0;
|
||||
@@ -851,7 +857,7 @@ ide_set_sector(ide_t *ide, int64_t sector_num)
|
||||
if (ide->lba) {
|
||||
ide->head = (sector_num >> 24);
|
||||
ide->cylinder = (sector_num >> 8);
|
||||
ide->sector = (sector_num);
|
||||
ide->sector = sector_num;
|
||||
} else {
|
||||
cyl = sector_num / (hdd[ide->hdd_num].hpc * hdd[ide->hdd_num].spt);
|
||||
r = sector_num % (hdd[ide->hdd_num].hpc * hdd[ide->hdd_num].spt);
|
||||
@@ -1334,7 +1340,7 @@ dev_reset(ide_t *ide)
|
||||
}
|
||||
|
||||
void
|
||||
ide_write_devctl(uint16_t addr, uint8_t val, void *priv)
|
||||
ide_write_devctl(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
{
|
||||
ide_board_t *dev = (ide_board_t *) priv;
|
||||
|
||||
@@ -2048,7 +2054,7 @@ ide_readb(uint16_t addr, void *priv)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
ide_read_alt_status(uint16_t addr, void *priv)
|
||||
ide_read_alt_status(UNUSED(uint16_t addr), void *priv)
|
||||
{
|
||||
uint8_t temp = 0xff;
|
||||
|
||||
@@ -2957,7 +2963,7 @@ ide_ter_init(const device_t *info)
|
||||
|
||||
/* Close a standalone IDE unit. */
|
||||
static void
|
||||
ide_ter_close(void *priv)
|
||||
ide_ter_close(UNUSED(void *priv))
|
||||
{
|
||||
ide_board_close(2);
|
||||
}
|
||||
@@ -2988,7 +2994,7 @@ ide_qua_init(const device_t *info)
|
||||
|
||||
/* Close a standalone IDE unit. */
|
||||
static void
|
||||
ide_qua_close(void *priv)
|
||||
ide_qua_close(UNUSED(void *priv))
|
||||
{
|
||||
ide_board_close(3);
|
||||
}
|
||||
@@ -3087,7 +3093,7 @@ ide_board_reset(int board)
|
||||
|
||||
/* Reset a standalone IDE unit. */
|
||||
static void
|
||||
ide_reset(void *p)
|
||||
ide_reset(UNUSED(void *priv))
|
||||
{
|
||||
ide_log("Resetting IDE...\n");
|
||||
|
||||
@@ -3100,7 +3106,7 @@ ide_reset(void *p)
|
||||
|
||||
/* Close a standalone IDE unit. */
|
||||
static void
|
||||
ide_close(void *priv)
|
||||
ide_close(UNUSED(void *priv))
|
||||
{
|
||||
ide_log("Closing IDE...\n");
|
||||
|
||||
|
||||
@@ -37,14 +37,17 @@
|
||||
#include <86box/zip.h>
|
||||
#include <86box/mo.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t vlb_idx, id,
|
||||
in_cfg, single_channel,
|
||||
pci, regs[256];
|
||||
typedef struct {
|
||||
uint8_t vlb_idx;
|
||||
uint8_t id;
|
||||
uint8_t in_cfg;
|
||||
uint8_t single_channel;
|
||||
uint8_t pci, regs[256];
|
||||
uint32_t local;
|
||||
int slot, irq_mode[2],
|
||||
irq_pin, irq_line;
|
||||
int slot;
|
||||
int irq_mode[2];
|
||||
int irq_pin;
|
||||
int irq_line;
|
||||
} cmd640_t;
|
||||
|
||||
static int next_id = 0;
|
||||
@@ -166,6 +169,9 @@ cmd640_common_write(int addr, uint8_t val, cmd640_t *dev)
|
||||
case 0x5b: /* Undocumented register that Linux attempts to use! */
|
||||
dev->regs[addr] = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +194,9 @@ cmd640_vlb_write(uint16_t addr, uint8_t val, void *priv)
|
||||
if (dev->regs[0x50] & 0x80)
|
||||
dev->in_cfg = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +236,9 @@ cmd640_vlb_read(uint16_t addr, void *priv)
|
||||
if (dev->regs[0x50] & 0x80)
|
||||
dev->in_cfg = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -462,7 +474,9 @@ cmd640_init(const device_t *info)
|
||||
ide_board_set_force_ata3(0, 1);
|
||||
ide_board_set_force_ata3(1, 1);
|
||||
|
||||
// ide_pri_disable();
|
||||
#if 0
|
||||
ide_pri_disable();
|
||||
#endif
|
||||
} else if (info->flags & DEVICE_VLB) {
|
||||
device_add(&ide_vlb_2ch_device);
|
||||
|
||||
|
||||
@@ -37,13 +37,15 @@
|
||||
#include <86box/zip.h>
|
||||
#include <86box/mo.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t vlb_idx, single_channel,
|
||||
in_cfg, regs[256];
|
||||
uint32_t local;
|
||||
int slot, irq_mode[2],
|
||||
irq_pin;
|
||||
typedef struct {
|
||||
uint8_t vlb_idx;
|
||||
uint8_t single_channel;
|
||||
uint8_t in_cfg;
|
||||
uint8_t regs[256];
|
||||
uint32_t local;
|
||||
int slot;
|
||||
int irq_mode[2];
|
||||
int irq_pin;
|
||||
sff8038i_t *bm[2];
|
||||
} cmd646_t;
|
||||
|
||||
@@ -262,6 +264,9 @@ cmd646_pci_write(int func, int addr, uint8_t val, void *priv)
|
||||
case 0x78 ... 0x7f:
|
||||
sff_bus_master_write(addr & 0x0f, val, dev->bm[1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <86box/mem.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -68,6 +69,9 @@ opti611_cfg_write(uint16_t addr, uint8_t val, void *priv)
|
||||
case 0x0006:
|
||||
dev->regs[0x06] = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +113,9 @@ opti611_cfg_read(uint16_t addr, void *priv)
|
||||
case 0x0006:
|
||||
ret = dev->regs[addr];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -153,7 +160,7 @@ opti611_ide_write(uint16_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
opti611_ide_writew(uint16_t addr, uint16_t val, void *priv)
|
||||
opti611_ide_writew(uint16_t addr, UNUSED(uint16_t val), void *priv)
|
||||
{
|
||||
opti611_t *dev = (opti611_t *) priv;
|
||||
|
||||
@@ -169,7 +176,7 @@ opti611_ide_writew(uint16_t addr, uint16_t val, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
opti611_ide_writel(uint16_t addr, uint32_t val, void *priv)
|
||||
opti611_ide_writel(uint16_t addr, UNUSED(uint32_t val), void *priv)
|
||||
{
|
||||
opti611_t *dev = (opti611_t *) priv;
|
||||
|
||||
@@ -281,7 +288,7 @@ opti611_close(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
opti611_init(const device_t *info)
|
||||
opti611_init(UNUSED(const device_t *info))
|
||||
{
|
||||
opti611_t *dev = (opti611_t *) malloc(sizeof(opti611_t));
|
||||
memset(dev, 0, sizeof(opti611_t));
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/mo.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
static int next_id = 0;
|
||||
|
||||
@@ -160,6 +161,9 @@ sff_bus_master_write(uint16_t port, uint8_t val, void *priv)
|
||||
dev->ptr = (dev->ptr & 0x00fffffc) | (val << 24);
|
||||
dev->ptr %= (mem_size * 1024);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +189,9 @@ sff_bus_master_writew(uint16_t port, uint16_t val, void *priv)
|
||||
dev->ptr = (dev->ptr & 0x0000fffc) | (val << 16);
|
||||
dev->ptr %= (mem_size * 1024);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,6 +213,9 @@ sff_bus_master_writel(uint16_t port, uint32_t val, void *priv)
|
||||
dev->ptr %= (mem_size * 1024);
|
||||
dev->ptr0 = val & 0xff;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,6 +248,9 @@ sff_bus_master_read(uint16_t port, void *priv)
|
||||
case 7:
|
||||
ret = dev->ptr >> 24;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sff_log("SFF-8038i Bus master BYTE read : %04X %02X\n", port, ret);
|
||||
@@ -264,6 +277,9 @@ sff_bus_master_readw(uint16_t port, void *priv)
|
||||
case 6:
|
||||
ret = dev->ptr >> 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sff_log("SFF-8038i Bus master WORD read : %04X %04X\n", port, ret);
|
||||
@@ -287,6 +303,9 @@ sff_bus_master_readl(uint16_t port, void *priv)
|
||||
case 4:
|
||||
ret = dev->ptr0 | (dev->ptr & 0xffffff00);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sff_log("sff Bus master DWORD read : %04X %08X\n", port, ret);
|
||||
@@ -295,7 +314,7 @@ sff_bus_master_readl(uint16_t port, void *priv)
|
||||
}
|
||||
|
||||
int
|
||||
sff_bus_master_dma(int channel, uint8_t *data, int transfer_length, int out, void *priv)
|
||||
sff_bus_master_dma(UNUSED(int channel), uint8_t *data, int transfer_length, int out, void *priv)
|
||||
{
|
||||
sff8038i_t *dev = (sff8038i_t *) priv;
|
||||
#ifdef ENABLE_SFF_LOG
|
||||
@@ -379,8 +398,8 @@ sff_bus_master_set_irq(int channel, void *priv)
|
||||
channel &= 0x01;
|
||||
|
||||
switch (dev->irq_mode[channel]) {
|
||||
case 0:
|
||||
default:
|
||||
case 0:
|
||||
/* Legacy IRQ mode. */
|
||||
if (irq)
|
||||
picint(1 << (14 + channel));
|
||||
@@ -481,7 +500,7 @@ sff_set_irq_line(sff8038i_t *dev, int irq_line)
|
||||
}
|
||||
|
||||
void
|
||||
sff_set_irq_level(sff8038i_t *dev, int channel, int irq_level)
|
||||
sff_set_irq_level(sff8038i_t *dev, int channel, UNUSED(int irq_level))
|
||||
{
|
||||
dev->irq_level[channel] = 0;
|
||||
}
|
||||
@@ -492,8 +511,8 @@ sff_set_irq_mode(sff8038i_t *dev, int channel, int irq_mode)
|
||||
dev->irq_mode[channel] = irq_mode;
|
||||
|
||||
switch (dev->irq_mode[channel]) {
|
||||
case 0:
|
||||
default:
|
||||
case 0:
|
||||
/* Legacy IRQ mode. */
|
||||
sff_log("[%08X] Setting channel %i to legacy IRQ %i\n", dev, channel, 14 + channel);
|
||||
break;
|
||||
@@ -537,7 +556,7 @@ sff_close(void *p)
|
||||
|
||||
static void
|
||||
*
|
||||
sff_init(const device_t *info)
|
||||
sff_init(UNUSED(const device_t *info))
|
||||
{
|
||||
sff8038i_t *dev = (sff8038i_t *) malloc(sizeof(sff8038i_t));
|
||||
memset(dev, 0, sizeof(sff8038i_t));
|
||||
|
||||
@@ -75,35 +75,35 @@
|
||||
#define CMD_SET_PARAMETERS 0x91
|
||||
|
||||
typedef struct {
|
||||
int8_t present, /* drive is present */
|
||||
hdd_num, /* drive number in system */
|
||||
steprate, /* current servo step rate */
|
||||
spt, /* physical #sectors per track */
|
||||
hpc, /* physical #heads per cylinder */
|
||||
pad;
|
||||
int16_t tracks; /* physical #tracks per cylinder */
|
||||
int8_t present; /* drive is present */
|
||||
int8_t hdd_num; /* drive number in system */
|
||||
int8_t steprate; /* current servo step rate */
|
||||
int8_t spt; /* physical #sectors per track */
|
||||
int8_t hpc; /* physical #heads per cylinder */
|
||||
int8_t pad;
|
||||
int16_t tracks; /* physical #tracks per cylinder */
|
||||
|
||||
int8_t cfg_spt, /* configured #sectors per track */
|
||||
cfg_hpc; /* configured #heads per track */
|
||||
int8_t cfg_spt; /* configured #sectors per track */
|
||||
int8_t cfg_hpc; /* configured #heads per track */
|
||||
|
||||
int16_t curcyl; /* current track number */
|
||||
int16_t curcyl; /* current track number */
|
||||
} drive_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t precomp, /* 1: precomp/error register */
|
||||
error,
|
||||
secount, /* 2: sector count register */
|
||||
sector, /* 3: sector number */
|
||||
head, /* 6: head number + drive select */
|
||||
command, /* 7: command/status */
|
||||
status,
|
||||
fdisk; /* 8: control register */
|
||||
uint8_t precomp; /* 1: precomp/error register */
|
||||
uint8_t error;
|
||||
uint8_t secount; /* 2: sector count register */
|
||||
uint8_t sector; /* 3: sector number */
|
||||
uint8_t head; /* 6: head number + drive select */
|
||||
uint8_t command; /* 7: command/status */
|
||||
uint8_t status;
|
||||
uint8_t fdisk; /* 8: control register */
|
||||
uint16_t cylinder; /* 4/5: cylinder LOW and HIGH */
|
||||
|
||||
int8_t reset, /* controller in reset */
|
||||
irqstat, /* current IRQ status */
|
||||
drvsel, /* current selected drive */
|
||||
pad;
|
||||
int8_t reset; /* controller in reset */
|
||||
int8_t irqstat; /* current IRQ status */
|
||||
int8_t drvsel; /* current selected drive */
|
||||
int8_t pad;
|
||||
|
||||
int pos; /* offset within data buffer */
|
||||
pc_timer_t callback_timer; /* callback delay timer */
|
||||
@@ -144,7 +144,7 @@ irq_raise(mfm_t *mfm)
|
||||
}
|
||||
|
||||
static inline void
|
||||
irq_lower(mfm_t *mfm)
|
||||
irq_lower(UNUSED(mfm_t *mfm))
|
||||
{
|
||||
picintc(1 << 14);
|
||||
}
|
||||
@@ -668,7 +668,7 @@ do_callback(void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
loadhd(mfm_t *mfm, int c, int d, const char *fn)
|
||||
loadhd(mfm_t *mfm, int c, int d, UNUSED(const char *fn))
|
||||
{
|
||||
drive_t *drive = &mfm->drives[c];
|
||||
|
||||
@@ -686,7 +686,7 @@ loadhd(mfm_t *mfm, int c, int d, const char *fn)
|
||||
}
|
||||
|
||||
static void *
|
||||
mfm_init(const device_t *info)
|
||||
mfm_init(UNUSED(const device_t *info))
|
||||
{
|
||||
mfm_t *mfm;
|
||||
int c;
|
||||
|
||||
@@ -238,12 +238,12 @@ typedef struct {
|
||||
|
||||
uint16_t cylinder; /* current cylinder */
|
||||
|
||||
uint8_t spt, /* physical parameters */
|
||||
hpc;
|
||||
uint8_t spt; /* physical parameters */
|
||||
uint8_t hpc;
|
||||
uint16_t tracks;
|
||||
|
||||
uint8_t cfg_spt, /* configured parameters */
|
||||
cfg_hpc;
|
||||
uint8_t cfg_spt; /* configured parameters */
|
||||
uint8_t cfg_hpc;
|
||||
uint16_t cfg_cyl;
|
||||
} drive_t;
|
||||
|
||||
@@ -253,15 +253,18 @@ typedef struct {
|
||||
uint8_t spt; /* sectors-per-track for controller */
|
||||
|
||||
uint16_t base; /* controller configuration */
|
||||
int8_t irq,
|
||||
dma;
|
||||
int8_t irq;
|
||||
int8_t dma;
|
||||
uint8_t switches;
|
||||
uint8_t misc;
|
||||
uint8_t nr_err, err_bv, cur_sec, pad;
|
||||
uint32_t bios_addr,
|
||||
bios_size,
|
||||
bios_ram;
|
||||
rom_t bios_rom;
|
||||
uint8_t nr_err;
|
||||
uint8_t err_bv;
|
||||
uint8_t cur_sec;
|
||||
uint8_t pad;
|
||||
uint32_t bios_addr;
|
||||
uint32_t bios_size;
|
||||
uint32_t bios_ram;
|
||||
rom_t bios_rom;
|
||||
|
||||
int state; /* operational data */
|
||||
uint8_t irq_dma;
|
||||
@@ -272,14 +275,14 @@ typedef struct {
|
||||
|
||||
uint8_t command[6]; /* current command request */
|
||||
int drive_sel;
|
||||
int sector,
|
||||
head,
|
||||
cylinder,
|
||||
count;
|
||||
int sector;
|
||||
int head;
|
||||
int cylinder;
|
||||
int count;
|
||||
uint8_t compl ; /* current request completion code */
|
||||
|
||||
int buff_pos, /* pointers to the RAM buffer */
|
||||
buff_cnt;
|
||||
int buff_pos; /* pointers to the RAM buffer */
|
||||
int buff_cnt;
|
||||
|
||||
drive_t drives[MFM_NUM]; /* the attached drives */
|
||||
uint8_t scratch[64]; /* ST-11 scratchpad RAM */
|
||||
@@ -1362,9 +1365,10 @@ mem_read(uint32_t addr, void *priv)
|
||||
case ST506_XT_TYPE_ST11R: /* ST-11R */
|
||||
mask = 0x1fff; /* ST-11 decodes RAM on each 8K block */
|
||||
break;
|
||||
|
||||
/* default:
|
||||
break; */
|
||||
#if 0
|
||||
default:
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
addr = addr & dev->bios_rom.mask;
|
||||
@@ -1429,7 +1433,7 @@ loadrom(hdc_t *dev, const char *fn)
|
||||
}
|
||||
|
||||
static void
|
||||
loadhd(hdc_t *dev, int c, int d, const char *fn)
|
||||
loadhd(hdc_t *dev, int c, int d, UNUSED(const char *fn))
|
||||
{
|
||||
drive_t *drive = &dev->drives[c];
|
||||
|
||||
|
||||
@@ -185,12 +185,12 @@ enum {
|
||||
typedef struct {
|
||||
uint8_t cmd; /* [7:5] class, [4:0] opcode */
|
||||
|
||||
uint8_t head : 5, /* [4:0] head number */
|
||||
drvsel : 1, /* [5] drive select */
|
||||
mbz : 2; /* [7:6] 00 */
|
||||
uint8_t head : 5; /* [4:0] head number */
|
||||
uint8_t drvsel : 1; /* [5] drive select */
|
||||
uint8_t mbz : 2; /* [7:6] 00 */
|
||||
|
||||
uint8_t sector : 6, /* [5:0] sector number 0-63 */
|
||||
cyl_high : 2; /* [7:6] cylinder [9:8] bits */
|
||||
uint8_t sector : 6; /* [5:0] sector number 0-63 */
|
||||
uint8_t cyl_high : 2; /* [7:6] cylinder [9:8] bits */
|
||||
|
||||
uint8_t cyl_low; /* [7:0] cylinder [7:0] bits */
|
||||
|
||||
@@ -216,19 +216,19 @@ typedef struct {
|
||||
|
||||
/* Define an attached drive. */
|
||||
typedef struct {
|
||||
int8_t id, /* drive ID on bus */
|
||||
present, /* drive is present */
|
||||
hdd_num, /* index to global disk table */
|
||||
type; /* drive type ID */
|
||||
int8_t id; /* drive ID on bus */
|
||||
int8_t present; /* drive is present */
|
||||
int8_t hdd_num; /* index to global disk table */
|
||||
int8_t type; /* drive type ID */
|
||||
|
||||
uint16_t cur_cyl; /* last known position of heads */
|
||||
|
||||
uint8_t spt, /* active drive parameters */
|
||||
hpc;
|
||||
uint8_t spt; /* active drive parameters */
|
||||
uint8_t hpc;
|
||||
uint16_t tracks;
|
||||
|
||||
uint8_t cfg_spt, /* configured drive parameters */
|
||||
cfg_hpc;
|
||||
uint8_t cfg_spt; /* configured drive parameters */
|
||||
uint8_t cfg_hpc;
|
||||
uint16_t cfg_tracks;
|
||||
} drive_t;
|
||||
|
||||
@@ -252,17 +252,17 @@ typedef struct {
|
||||
pc_timer_t timer;
|
||||
|
||||
/* Data transfer. */
|
||||
int16_t buf_idx, /* buffer index and pointer */
|
||||
buf_len;
|
||||
int16_t buf_idx; /* buffer index and pointer */
|
||||
int16_t buf_len;
|
||||
uint8_t *buf_ptr;
|
||||
|
||||
/* Current operation parameters. */
|
||||
dcb_t dcb; /* device control block */
|
||||
uint16_t track; /* requested track# */
|
||||
uint8_t head, /* requested head# */
|
||||
sector, /* requested sector# */
|
||||
comp; /* operation completion byte */
|
||||
int count; /* requested sector count */
|
||||
dcb_t dcb; /* device control block */
|
||||
uint16_t track; /* requested track# */
|
||||
uint8_t head; /* requested head# */
|
||||
uint8_t sector; /* requested sector# */
|
||||
uint8_t comp; /* operation completion byte */
|
||||
int count; /* requested sector count */
|
||||
|
||||
drive_t drives[XTA_NUM]; /* the attached drive(s) */
|
||||
|
||||
@@ -958,7 +958,9 @@ hdc_write(uint16_t port, uint8_t val, void *priv)
|
||||
break;
|
||||
|
||||
case 3: /* DMA/IRQ intr register */
|
||||
// xta_log("%s: WriteMASK(%02X)\n", dev->name, val);
|
||||
#if 0
|
||||
xta_log("%s: WriteMASK(%02X)\n", dev->name, val);
|
||||
#endif
|
||||
dev->intr = val;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define ROM_PATH_XT "roms/hdd/xtide/ide_xt.bin"
|
||||
#define ROM_PATH_XTP "roms/hdd/xtide/ide_xtp.bin"
|
||||
@@ -193,7 +194,7 @@ xtide_at_386_available(void)
|
||||
}
|
||||
|
||||
static void *
|
||||
xtide_acculogic_init(const device_t *info)
|
||||
xtide_acculogic_init(UNUSED(const device_t *info))
|
||||
{
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
|
||||
@@ -228,7 +229,7 @@ xtide_close(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
xtide_at_ps2_init(const device_t *info)
|
||||
xtide_at_ps2_init(UNUSED(const device_t *info))
|
||||
{
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ no_cdrom:
|
||||
}
|
||||
|
||||
char *
|
||||
hdd_bus_to_string(int bus, int cdrom)
|
||||
hdd_bus_to_string(int bus, UNUSED(int cdrom))
|
||||
{
|
||||
char *s = "none";
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ typedef struct
|
||||
FILE *file; /* Used for HDD_IMAGE_RAW, HDD_IMAGE_HDI, and HDD_IMAGE_HDX. */
|
||||
MVHDMeta *vhd; /* Used for HDD_IMAGE_VHD. */
|
||||
uint32_t base;
|
||||
uint32_t pos, last_sector;
|
||||
uint32_t pos;
|
||||
uint32_t last_sector;
|
||||
uint8_t type; /* HDD_IMAGE_RAW, HDD_IMAGE_HDI, HDD_IMAGE_HDX, or HDD_IMAGE_VHD */
|
||||
uint8_t loaded;
|
||||
} hdd_image_t;
|
||||
@@ -637,7 +638,7 @@ hdd_image_get_type(uint8_t id)
|
||||
}
|
||||
|
||||
void
|
||||
hdd_image_unload(uint8_t id, int fn_preserve)
|
||||
hdd_image_unload(uint8_t id, UNUSED(int fn_preserve))
|
||||
{
|
||||
if (strlen(hdd[id].fn) == 0)
|
||||
return;
|
||||
|
||||
@@ -793,7 +793,7 @@ mo_data_command_finish(mo_t *dev, int len, int block_len, int alloc_len, int dir
|
||||
}
|
||||
|
||||
static void
|
||||
mo_sense_clear(mo_t *dev, int command)
|
||||
mo_sense_clear(mo_t *dev, UNUSED(int command))
|
||||
{
|
||||
mo_sense_key = mo_asc = mo_ascq = 0;
|
||||
}
|
||||
@@ -938,7 +938,7 @@ mo_invalid_field_pl(mo_t *dev)
|
||||
}
|
||||
|
||||
static int
|
||||
mo_blocks(mo_t *dev, int32_t *len, int first_batch, int out)
|
||||
mo_blocks(mo_t *dev, int32_t *len, UNUSED(int first_batch), int out)
|
||||
{
|
||||
*len = 0;
|
||||
|
||||
@@ -1179,7 +1179,9 @@ mo_pre_execution_check(mo_t *dev, uint8_t *cdb)
|
||||
static void
|
||||
mo_seek(mo_t *dev, uint32_t pos)
|
||||
{
|
||||
/* mo_log("MO %i: Seek %08X\n", dev->id, pos); */
|
||||
#if 0
|
||||
mo_log("MO %i: Seek %08X\n", dev->id, pos);
|
||||
#endif
|
||||
dev->sector_pos = pos;
|
||||
}
|
||||
|
||||
@@ -1687,7 +1689,9 @@ mo_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
dev->buffer[1] = 0x80; /*Removable*/
|
||||
dev->buffer[2] = (dev->drv->bus_type == MO_BUS_SCSI) ? 0x02 : 0x00; /*SCSI-2 compliant*/
|
||||
dev->buffer[3] = (dev->drv->bus_type == MO_BUS_SCSI) ? 0x02 : 0x21;
|
||||
// dev->buffer[4] = 31;
|
||||
#if 0
|
||||
dev->buffer[4] = 31;
|
||||
#endif
|
||||
dev->buffer[4] = 0;
|
||||
if (dev->drv->bus_type == MO_BUS_SCSI) {
|
||||
dev->buffer[6] = 1; /* 16-bit transfers supported */
|
||||
@@ -1830,7 +1834,9 @@ mo_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
break;
|
||||
}
|
||||
|
||||
/* mo_log("MO %i: Phase: %02X, request length: %i\n", dev->id, dev->phase, dev->request_length); */
|
||||
#if 0
|
||||
mo_log("MO %i: Phase: %02X, request length: %i\n", dev->id, dev->phase, dev->request_length);
|
||||
#endif
|
||||
|
||||
if (mo_atapi_phase_to_scsi(dev) == SCSI_PHASE_STATUS)
|
||||
mo_buf_free(dev);
|
||||
|
||||
@@ -1768,7 +1768,9 @@ zip_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
case 1: /* Start the disc and read the TOC. */
|
||||
break;
|
||||
case 2: /* Eject the disc if possible. */
|
||||
/* zip_eject(dev->id); */
|
||||
#if 0
|
||||
zip_eject(dev->id);
|
||||
#endif
|
||||
break;
|
||||
case 3: /* Load the disc (close tray). */
|
||||
zip_reload(dev->id);
|
||||
@@ -1850,7 +1852,9 @@ zip_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
dev->buffer[1] = 0x80; /*Removable*/
|
||||
dev->buffer[2] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x00; /*SCSI-2 compliant*/
|
||||
dev->buffer[3] = (dev->drv->bus_type == ZIP_BUS_SCSI) ? 0x02 : 0x21;
|
||||
// dev->buffer[4] = 31;
|
||||
#if 0
|
||||
dev->buffer[4] = 31;
|
||||
#endif
|
||||
dev->buffer[4] = 0;
|
||||
if (dev->drv->bus_type == ZIP_BUS_SCSI) {
|
||||
dev->buffer[6] = 1; /* 16-bit transfers supported */
|
||||
@@ -2010,7 +2014,9 @@ atapi_out:
|
||||
break;
|
||||
}
|
||||
|
||||
/* zip_log("ZIP %i: Phase: %02X, request length: %i\n", dev->id, dev->phase, dev->request_length); */
|
||||
#if 0
|
||||
zip_log("ZIP %i: Phase: %02X, request length: %i\n", dev->id, dev->phase, dev->request_length);
|
||||
#endif
|
||||
|
||||
if (zip_atapi_phase_to_scsi(dev) == SCSI_PHASE_STATUS)
|
||||
zip_buf_free(dev);
|
||||
|
||||
Reference in New Issue
Block a user