mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
More sonarlint work
This commit is contained in:
@@ -74,6 +74,7 @@
|
||||
#include <86box/vid_mda.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_amstrad.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
@@ -84,60 +85,64 @@
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
typedef struct {
|
||||
rom_t bios_rom; /* 1640 */
|
||||
cga_t cga; /* 1640/200 */
|
||||
mda_t mda; /* 1512/200/PPC512/640*/
|
||||
ega_t ega; /* 1640 */
|
||||
uint8_t emulation; /* Which display are we emulating? */
|
||||
uint8_t dipswitches; /* DIP switches 1-3 */
|
||||
uint8_t crtc_index; /* CRTC index readback
|
||||
* Bit 7: CGA control port written
|
||||
* Bit 6: Operation control port written
|
||||
* Bit 5: CRTC register written
|
||||
* Bits 0-4: Last CRTC register selected */
|
||||
uint8_t operation_ctrl;
|
||||
uint8_t reg_3df, type;
|
||||
uint8_t crtc[32];
|
||||
int crtcreg;
|
||||
int cga_enabled; /* 1640 */
|
||||
uint8_t cgacol,
|
||||
cgamode,
|
||||
stat;
|
||||
uint8_t plane_write, /* 1512/200 */
|
||||
plane_read, /* 1512/200 */
|
||||
border, /* 1512/200 */
|
||||
invert; /* 512/640 */
|
||||
int fontbase; /* 1512/200 */
|
||||
int linepos,
|
||||
displine;
|
||||
int sc, vc;
|
||||
int cgadispon;
|
||||
int con, coff,
|
||||
cursoron,
|
||||
cgablink;
|
||||
int vsynctime;
|
||||
int fullchange;
|
||||
int vadj;
|
||||
uint16_t ma, maback;
|
||||
int dispon;
|
||||
int blink;
|
||||
uint64_t dispontime, /* 1512/1640 */
|
||||
dispofftime; /* 1512/1640 */
|
||||
pc_timer_t timer; /* 1512/1640 */
|
||||
int firstline,
|
||||
lastline;
|
||||
uint8_t *vram;
|
||||
void *ams;
|
||||
typedef struct amsvid_t {
|
||||
rom_t bios_rom; /* 1640 */
|
||||
cga_t cga; /* 1640/200 */
|
||||
mda_t mda; /* 1512/200/PPC512/640*/
|
||||
ega_t ega; /* 1640 */
|
||||
uint8_t emulation; /* Which display are we emulating? */
|
||||
uint8_t dipswitches; /* DIP switches 1-3 */
|
||||
uint8_t crtc_index; /* CRTC index readback
|
||||
* Bit 7: CGA control port written
|
||||
* Bit 6: Operation control port written
|
||||
* Bit 5: CRTC register written
|
||||
* Bits 0-4: Last CRTC register selected */
|
||||
uint8_t operation_ctrl;
|
||||
uint8_t reg_3df;
|
||||
uint8_t type;
|
||||
uint8_t crtc[32];
|
||||
int crtcreg;
|
||||
int cga_enabled; /* 1640 */
|
||||
uint8_t cgacol;
|
||||
uint8_t cgamode;
|
||||
uint8_t stat;
|
||||
uint8_t plane_write; /* 1512/200 */
|
||||
uint8_t plane_read; /* 1512/200 */
|
||||
uint8_t border; /* 1512/200 */
|
||||
uint8_t invert; /* 512/640 */
|
||||
int fontbase; /* 1512/200 */
|
||||
int linepos;
|
||||
int displine;
|
||||
int sc;
|
||||
int vc;
|
||||
int cgadispon;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int cgablink;
|
||||
int vsynctime;
|
||||
int fullchange;
|
||||
int vadj;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
int dispon;
|
||||
int blink;
|
||||
uint64_t dispontime; /* 1512/1640 */
|
||||
uint64_t dispofftime; /* 1512/1640 */
|
||||
pc_timer_t timer; /* 1512/1640 */
|
||||
int firstline;
|
||||
int lastline;
|
||||
uint8_t *vram;
|
||||
void *ams;
|
||||
} amsvid_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct amstrad_t {
|
||||
/* Machine stuff. */
|
||||
uint8_t dead;
|
||||
uint8_t stat1,
|
||||
stat2;
|
||||
uint8_t type,
|
||||
language;
|
||||
uint8_t stat1;
|
||||
uint8_t stat2;
|
||||
uint8_t type;
|
||||
uint8_t language;
|
||||
|
||||
/* Keyboard stuff. */
|
||||
int8_t wantirq;
|
||||
@@ -147,8 +152,8 @@ typedef struct {
|
||||
pc_timer_t send_delay_timer;
|
||||
|
||||
/* Mouse stuff. */
|
||||
uint8_t mousex,
|
||||
mousey;
|
||||
uint8_t mousex;
|
||||
uint8_t mousey;
|
||||
int oldb;
|
||||
|
||||
/* Video stuff. */
|
||||
@@ -160,7 +165,7 @@ uint32_t amstrad_latch;
|
||||
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0;
|
||||
static int key_queue_end = 0;
|
||||
static int key_queue_end = 0;
|
||||
static uint8_t crtc_mask[32] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f,
|
||||
0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
|
||||
@@ -263,6 +268,9 @@ vid_out_1512(uint16_t addr, uint8_t val, void *priv)
|
||||
case 0x03df:
|
||||
vid->border = val;
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +295,9 @@ vid_in_1512(uint16_t addr, void *priv)
|
||||
case 0x03da:
|
||||
ret = vid->stat;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -780,9 +791,15 @@ vid_out_1640(uint16_t addr, uint8_t val, void *priv)
|
||||
mem_mapping_set_addr(&vid->ega.mapping,
|
||||
0xb8000, 0x08000);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (vid->cga_enabled)
|
||||
@@ -924,6 +941,9 @@ ams_inform(amsvid_t *vid)
|
||||
case PC200_LCDM:
|
||||
video_inform(VIDEO_FLAG_TYPE_MDA, &timing_pc200);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1013,6 +1033,9 @@ set_lcd_cols(uint8_t mode_reg)
|
||||
lcdcols[c][0][0] = lcdcols[c][1][0] = blue;
|
||||
lcdcols[c][0][1] = lcdcols[c][1][1] = blue;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1043,6 +1066,9 @@ vid_in_200(uint16_t addr, void *priv)
|
||||
|
||||
case 0x03df:
|
||||
return (vid->reg_3df);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (addr >= 0x3D0 && addr <= 0x3DF)
|
||||
@@ -1176,6 +1202,9 @@ vid_out_200(uint16_t addr, uint8_t val, void *priv)
|
||||
mem_mapping_enable(&vid->cga.mapping);
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (addr >= 0x3D0 && addr <= 0x3DF)
|
||||
@@ -1272,7 +1301,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, &((uint32_t *) (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++;
|
||||
}
|
||||
}
|
||||
@@ -1422,7 +1451,7 @@ lcdc_poll(amsvid_t *vid)
|
||||
dat = (cga->vram[((cga->ma << 1) & 0x1fff) + ((cga->sc & 1) * 0x2000)] << 8) | cga->vram[((cga->ma << 1) & 0x1fff) + ((cga->sc & 1) * 0x2000) + 1];
|
||||
cga->ma++;
|
||||
for (uint8_t c = 0; c < 16; c++) {
|
||||
buffer32->line[(cga->displine << 1)][(x << 4) + c] = buffer32->line[(cga->displine << 1) + 1][(x << 4) + c] = (dat & 0x8000) ? blue : green;
|
||||
buffer32->line[cga->displine << 1][(x << 4) + c] = buffer32->line[(cga->displine << 1) + 1][(x << 4) + c] = (dat & 0x8000) ? blue : green;
|
||||
dat <<= 1;
|
||||
}
|
||||
}
|
||||
@@ -1568,9 +1597,9 @@ lcdc_poll(amsvid_t *vid)
|
||||
}
|
||||
|
||||
static void
|
||||
vid_poll_200(void *p)
|
||||
vid_poll_200(void *priv)
|
||||
{
|
||||
amsvid_t *vid = (amsvid_t *) p;
|
||||
amsvid_t *vid = (amsvid_t *) priv;
|
||||
|
||||
switch (vid->emulation) {
|
||||
case PC200_LCDM:
|
||||
@@ -1579,6 +1608,9 @@ vid_poll_200(void *p)
|
||||
case PC200_LCDC:
|
||||
lcdc_poll(vid);
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1614,6 +1646,9 @@ vid_init_200(amstrad_t *ams)
|
||||
break;
|
||||
/* The other combination is 'IDA disabled' (0x20) - see
|
||||
* m_amstrad.c */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else
|
||||
switch (vid->emulation) {
|
||||
@@ -1635,6 +1670,9 @@ vid_init_200(amstrad_t *ams)
|
||||
case PC200_LCDM:
|
||||
vid->dipswitches = 0x10;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
cga = &vid->cga;
|
||||
@@ -1969,7 +2007,7 @@ const device_t vid_pc3086_device = {
|
||||
};
|
||||
|
||||
static void
|
||||
ms_write(uint16_t addr, uint8_t val, void *priv)
|
||||
ms_write(uint16_t addr, UNUSED(uint8_t val), void *priv)
|
||||
{
|
||||
amstrad_t *ams = (amstrad_t *) priv;
|
||||
|
||||
@@ -1997,7 +2035,7 @@ ms_read(uint16_t addr, void *priv)
|
||||
}
|
||||
|
||||
static int
|
||||
ms_poll(int x, int y, int z, int b, void *priv)
|
||||
ms_poll(int x, int y, UNUSED(int z), int b, void *priv)
|
||||
{
|
||||
amstrad_t *ams = (amstrad_t *) priv;
|
||||
|
||||
@@ -2222,6 +2260,9 @@ ams_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0xdead:
|
||||
ams->dead = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2285,6 +2326,9 @@ ams_read(uint16_t port, void *priv)
|
||||
case AMSTRAD_SW10:
|
||||
ret |= 0x20;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2300,6 +2344,9 @@ ams_read(uint16_t port, void *priv)
|
||||
case 0xdead:
|
||||
ret = ams->dead;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -2482,6 +2529,9 @@ machine_amstrad_init(const machine_t *model, int type)
|
||||
case AMS_PC3086:
|
||||
ams->fdc = device_add(&fdc_at_actlow_device);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ams->language = 7;
|
||||
@@ -2539,6 +2589,9 @@ machine_amstrad_init(const machine_t *model, int type)
|
||||
device_context_restore();
|
||||
device_add(¶dise_pvga1a_pc3086_device);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else if ((type == AMS_PC200) || (type == AMS_PPC512))
|
||||
io_sethandler(0x03de, 1,
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <86box/scsi_ncr53c8xx.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
int
|
||||
machine_at_acc386_init(const machine_t *model)
|
||||
@@ -812,7 +813,7 @@ machine_at_greenb_init(const machine_t *model)
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_sis_85c496_common_init(const machine_t *model)
|
||||
machine_at_sis_85c496_common_init(UNUSED(const machine_t *model))
|
||||
{
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
@@ -1281,7 +1282,9 @@ machine_at_abpb4_init(const machine_t *model)
|
||||
device_add(&ali1489_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_at_device);
|
||||
// device_add(&intel_flash_bxt_device);
|
||||
#if 0
|
||||
device_add(&intel_flash_bxt_device);
|
||||
#endif
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -1788,7 +1791,7 @@ machine_at_tg486gp_init(const machine_t *model)
|
||||
int
|
||||
machine_at_tg486g_init(const machine_t *model)
|
||||
{
|
||||
int ret, i;
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/tg486g/tg486g.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
@@ -1803,7 +1806,7 @@ machine_at_tg486g_init(const machine_t *model)
|
||||
device_add(&keyboard_ps2_tg_ami_pci_device);
|
||||
|
||||
if (gfxcard[0] != VID_INTERNAL) {
|
||||
for (i = 0; i < 32768; i++)
|
||||
for (uint16_t i = 0; i < 32768; i++)
|
||||
rom[i] = mem_readb_phys(0x000c0000 + i);
|
||||
}
|
||||
mem_mapping_set_addr(&bios_mapping, 0x0c0000, 0x40000);
|
||||
|
||||
@@ -52,11 +52,12 @@
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
static serial_t *cmd_uart;
|
||||
|
||||
static void
|
||||
cbm_io_write(uint16_t port, uint8_t val, void *p)
|
||||
cbm_io_write(UNUSED(uint16_t port), uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
lpt1_remove();
|
||||
lpt2_remove();
|
||||
@@ -71,6 +72,9 @@ cbm_io_write(uint16_t port, uint8_t val, void *p)
|
||||
case 3:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (val & 0xc) {
|
||||
@@ -80,6 +84,9 @@ cbm_io_write(uint16_t port, uint8_t val, void *p)
|
||||
case 0x8:
|
||||
serial_setup(cmd_uart, COM1_ADDR, COM1_IRQ);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/vid_cga_comp.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
|
||||
static video_timings_t timing_compaq_plasma = { .type = VIDEO_ISA, .write_b = 8, .write_w = 16, .write_l = 32, .read_b = 8, .read_w = 16, .read_l = 32 };
|
||||
@@ -127,7 +128,7 @@ compaq_plasma_recalctimings(compaq_plasma_t *self)
|
||||
}
|
||||
|
||||
static void
|
||||
compaq_plasma_waitstates(void *p)
|
||||
compaq_plasma_waitstates(UNUSED(void *priv))
|
||||
{
|
||||
int ws_array[16] = { 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8 };
|
||||
int ws;
|
||||
@@ -205,6 +206,9 @@ compaq_plasma_out(uint16_t addr, uint8_t val, void *priv)
|
||||
else
|
||||
mem_mapping_enable(&self->cga.mapping);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,22 +253,25 @@ compaq_plasma_in(uint16_t addr, void *priv)
|
||||
case 0x23c6:
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
compaq_plasma_poll(void *p)
|
||||
compaq_plasma_poll(void *priv)
|
||||
{
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) p;
|
||||
uint8_t chr, attr;
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) priv;
|
||||
uint8_t chr;
|
||||
uint8_t attr;
|
||||
uint8_t sc;
|
||||
uint16_t ma = (self->cga.crtc[13] | (self->cga.crtc[12] << 8)) & 0x7fff;
|
||||
uint16_t ca = (self->cga.crtc[15] | (self->cga.crtc[14] << 8)) & 0x7fff;
|
||||
uint16_t addr;
|
||||
int drawcursor;
|
||||
int x, c;
|
||||
int cursorline;
|
||||
int blink = 0;
|
||||
int underline = 0;
|
||||
@@ -272,8 +279,10 @@ compaq_plasma_poll(void *p)
|
||||
uint32_t fg = (self->cga.cgacol & 0x0f) ? amber : black;
|
||||
uint32_t bg = black;
|
||||
uint32_t cols[2];
|
||||
uint8_t dat2, pattern;
|
||||
uint32_t ink0 = 0, ink1 = 0;
|
||||
uint8_t dat2;
|
||||
uint8_t pattern;
|
||||
uint32_t ink0 = 0;
|
||||
uint32_t ink1 = 0;
|
||||
|
||||
/* Switch between internal plasma and external CRT display. */
|
||||
if ((cpq_st_display_internal != -1) && (cpq_st_display_internal != self->internal_monitor)) {
|
||||
@@ -304,25 +313,25 @@ compaq_plasma_poll(void *p)
|
||||
} else {
|
||||
addr = ((self->cga.displine >> 1) & 1) * 0x2000 + (self->cga.displine >> 2) * 80 + ((ma & ~1) << 1);
|
||||
}
|
||||
for (x = 0; x < 80; x++) {
|
||||
dat2 = self->cga.vram[(addr & 0x7FFF)];
|
||||
for (uint8_t x = 0; x < 80; x++) {
|
||||
dat2 = self->cga.vram[addr & 0x7FFF];
|
||||
addr++;
|
||||
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
ink = (dat2 & 0x80) ? fg : bg;
|
||||
if (!(self->cga.cgamode & 8))
|
||||
ink = black;
|
||||
((uint32_t *) buffer32->line[self->cga.displine])[x * 8 + c] = ink;
|
||||
(buffer32->line[self->cga.displine])[x * 8 + c] = ink;
|
||||
dat2 <<= 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
addr = ((self->cga.displine >> 1) & 1) * 0x2000 + (self->cga.displine >> 2) * 80 + ((ma & ~1) << 1);
|
||||
for (x = 0; x < 80; x++) {
|
||||
dat2 = self->cga.vram[(addr & 0x7fff)];
|
||||
for (uint8_t x = 0; x < 80; x++) {
|
||||
dat2 = self->cga.vram[addr & 0x7fff];
|
||||
addr++;
|
||||
|
||||
for (c = 0; c < 4; c++) {
|
||||
for (uint8_t c = 0; c < 4; c++) {
|
||||
pattern = (dat2 & 0xC0) >> 6;
|
||||
if (!(self->cga.cgamode & 8))
|
||||
pattern = 0;
|
||||
@@ -352,6 +361,9 @@ compaq_plasma_poll(void *p)
|
||||
case 3:
|
||||
ink0 = ink1 = amber;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
buffer32->line[self->cga.displine][x * 8 + 2 * c] = ink0;
|
||||
buffer32->line[self->cga.displine][x * 8 + 2 * c + 1] = ink1;
|
||||
@@ -371,7 +383,7 @@ compaq_plasma_poll(void *p)
|
||||
cursorline = ((self->cga.crtc[0x0a] & 0x0f) * 2 <= sc) && ((self->cga.crtc[0x0b] & 0x0F) * 2 >= sc);
|
||||
|
||||
/* for each text column */
|
||||
for (x = 0; x < 80; x++) {
|
||||
for (uint8_t x = 0; x < 80; x++) {
|
||||
/* video output enabled */
|
||||
if (self->cga.cgamode & 8) {
|
||||
chr = self->cga.vram[(addr + 2 * x) & 0x7fff];
|
||||
@@ -405,13 +417,13 @@ compaq_plasma_poll(void *p)
|
||||
/* character underline active and 7th row of pixels in character height being drawn */
|
||||
if (underline && (sc == 7)) {
|
||||
/* for each pixel in character width */
|
||||
for (c = 0; c < 8; c++)
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
buffer32->line[self->cga.displine][(x << 3) + c] = mdaattr[attr][blink][1];
|
||||
} else if (drawcursor) {
|
||||
for (c = 0; c < 8; c++)
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
buffer32->line[self->cga.displine][(x << 3) + c] = cols[(fontdatm[chr + self->cga.fontbase][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
buffer32->line[self->cga.displine][(x << 3) + c] = cols[(fontdatm[chr + self->cga.fontbase][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
|
||||
@@ -427,7 +439,7 @@ compaq_plasma_poll(void *p)
|
||||
else
|
||||
cursorline = ((self->cga.crtc[0x0a] & 0x0f) * 2 <= sc) && ((self->cga.crtc[0x0b] & 0x0F) * 2 >= sc);
|
||||
|
||||
for (x = 0; x < 40; x++) {
|
||||
for (uint8_t x = 0; x < 40; x++) {
|
||||
if (self->cga.cgamode & 8) {
|
||||
chr = self->cga.vram[(addr + 2 * x) & 0x7fff];
|
||||
attr = self->cga.vram[(addr + 2 * x + 1) & 0x7fff];
|
||||
@@ -460,14 +472,14 @@ compaq_plasma_poll(void *p)
|
||||
/* character underline active and 7th row of pixels in character height being drawn */
|
||||
if (underline && (sc == 7)) {
|
||||
/* for each pixel in character width */
|
||||
for (c = 0; c < 8; c++)
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
buffer32->line[self->cga.displine][(x << 4) + (c * 2)] = buffer32->line[self->cga.displine][(x << 4) + (c * 2) + 1] = mdaattr[attr][blink][1];
|
||||
} else if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[self->cga.displine][(x << 4) + c * 2] = buffer32->line[self->cga.displine][(x << 4) + c * 2 + 1] = cols[(fontdatm[chr][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[self->cga.displine][(x << 4) + c * 2] = buffer32->line[self->cga.displine][(x << 4) + c * 2 + 1] = cols[(fontdatm[chr][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
@@ -530,9 +542,7 @@ compaq_plasma_poll(void *p)
|
||||
static void
|
||||
compaq_plasma_mdaattr_rebuild(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
for (c = 0; c < 256; c++) {
|
||||
for (uint16_t c = 0; c < 256; c++) {
|
||||
mdaattr[c][0][0] = mdaattr[c][1][0] = mdaattr[c][1][1] = 16;
|
||||
if (c & 8)
|
||||
mdaattr[c][0][1] = 15 + 16;
|
||||
@@ -636,7 +646,7 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
}
|
||||
|
||||
static void *
|
||||
compaq_plasma_init(const device_t *info)
|
||||
compaq_plasma_init(UNUSED(const device_t *info))
|
||||
{
|
||||
compaq_plasma_t *self = malloc(sizeof(compaq_plasma_t));
|
||||
memset(self, 0, sizeof(compaq_plasma_t));
|
||||
@@ -674,18 +684,18 @@ compaq_plasma_init(const device_t *info)
|
||||
}
|
||||
|
||||
static void
|
||||
compaq_plasma_close(void *p)
|
||||
compaq_plasma_close(void *priv)
|
||||
{
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) p;
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) priv;
|
||||
|
||||
free(self->cga.vram);
|
||||
free(self);
|
||||
}
|
||||
|
||||
static void
|
||||
compaq_plasma_speed_changed(void *p)
|
||||
compaq_plasma_speed_changed(void *priv)
|
||||
{
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) p;
|
||||
compaq_plasma_t *self = (compaq_plasma_t *) priv;
|
||||
|
||||
compaq_plasma_recalctimings(self);
|
||||
}
|
||||
@@ -727,7 +737,7 @@ const device_t compaq_plasma_device = {
|
||||
};
|
||||
|
||||
static uint8_t
|
||||
read_ram(uint32_t addr, void *priv)
|
||||
read_ram(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addreadlookup(mem_logical_addr, addr);
|
||||
@@ -736,7 +746,7 @@ read_ram(uint32_t addr, void *priv)
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
read_ramw(uint32_t addr, void *priv)
|
||||
read_ramw(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addreadlookup(mem_logical_addr, addr);
|
||||
@@ -745,7 +755,7 @@ read_ramw(uint32_t addr, void *priv)
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
read_raml(uint32_t addr, void *priv)
|
||||
read_raml(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addreadlookup(mem_logical_addr, addr);
|
||||
@@ -754,7 +764,7 @@ read_raml(uint32_t addr, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
write_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
write_ram(uint32_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addwritelookup(mem_logical_addr, addr);
|
||||
@@ -763,7 +773,7 @@ write_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
write_ramw(uint32_t addr, uint16_t val, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addwritelookup(mem_logical_addr, addr);
|
||||
@@ -772,7 +782,7 @@ write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
write_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
write_raml(uint32_t addr, uint32_t val, UNUSED(void *priv))
|
||||
{
|
||||
addr = (addr & 0x7ffff) + 0x80000;
|
||||
addwritelookup(mem_logical_addr, addr);
|
||||
@@ -830,6 +840,9 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_compaq_device);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,9 @@ machine_at_p2bls_init(const machine_t *model)
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
// device_add(ics9xxx_get(ICS9150_08)); /* setting proper speeds requires some interaction with the AS97127F ASIC */
|
||||
#if 0
|
||||
device_add(ics9xxx_get(ICS9150_08)); /* setting proper speeds requires some interaction with the AS97127F ASIC */
|
||||
#endif
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
device_add(&w83781d_device); /* fans: Chassis, CPU, Power; temperatures: MB, unused, CPU */
|
||||
|
||||
@@ -81,7 +81,9 @@ machine_at_award_common_init(const machine_t *model)
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
// device_add(&keyboard_ps2_pci_device);
|
||||
#if 0
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
#endif
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,9 @@ machine_at_thor_common_init(const machine_t *model, int mr)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64vplus_onboard_pci_device);
|
||||
|
||||
// device_add(&keyboard_ps2_ami_pci_device);
|
||||
#if 0
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
#endif
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_at_t3100e.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
extern uint8_t *ram; /* Physical RAM */
|
||||
|
||||
@@ -191,12 +192,12 @@ static unsigned t3100e_ems_page_reg[] = {
|
||||
0x4208,
|
||||
0x8208,
|
||||
0xc208, /* The first four map the first 2Mb */
|
||||
/* of RAM into the page frame */
|
||||
/* of RAM into the page frame */
|
||||
0x218,
|
||||
0x4218,
|
||||
0x8218,
|
||||
0xc218, /* The next four map the next 2Mb */
|
||||
/* of RAM */
|
||||
/* of RAM */
|
||||
0x258,
|
||||
0x4258,
|
||||
0x8258,
|
||||
@@ -221,7 +222,7 @@ struct t3100e_ems_regs {
|
||||
/* Bit 0 is 0 for colour, 1 for mono */
|
||||
} t3100e_ems;
|
||||
|
||||
void t3100e_ems_out(uint16_t addr, uint8_t val, void *p);
|
||||
void t3100e_ems_out(uint16_t addr, uint8_t val, void *priv);
|
||||
|
||||
#ifdef ENABLE_T3100E_LOG
|
||||
int t3100e_do_log = ENABLE_T3100E_LOG;
|
||||
@@ -331,11 +332,15 @@ port_to_page(uint16_t addr)
|
||||
return 14;
|
||||
case 0xC268:
|
||||
return 15;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Used to dump the memory mapping table, for debugging
|
||||
/* Used to dump the memory mapping table, for debugging */
|
||||
#if 0
|
||||
void dump_mappings(void)
|
||||
{
|
||||
mem_mapping_t *mm = base_mapping.next;
|
||||
@@ -377,7 +382,8 @@ void dump_mappings(void)
|
||||
|
||||
mm = mm->next;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
t3100e_map_ram(uint8_t val)
|
||||
@@ -437,7 +443,9 @@ t3100e_map_ram(uint8_t val)
|
||||
&t3100e_ems);
|
||||
}
|
||||
|
||||
// dump_mappings();
|
||||
#if 0
|
||||
dump_mappings();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -470,9 +478,9 @@ t3100e_turbo_set(uint8_t value)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
t3100e_sys_in(uint16_t addr, void *p)
|
||||
t3100e_sys_in(UNUSED(uint16_t addr), void *priv)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) p;
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) priv;
|
||||
|
||||
/* The low 4 bits always seem to be 0x0C. The high 4 are a
|
||||
* notification sent by the keyboard controller when it detects
|
||||
@@ -483,9 +491,11 @@ t3100e_sys_in(uint16_t addr, void *p)
|
||||
|
||||
/* Handle writes to the T3100e system control port at 0x8084 */
|
||||
void
|
||||
t3100e_sys_out(uint16_t addr, uint8_t val, void *p)
|
||||
t3100e_sys_out(UNUSED(uint16_t addr), uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
// struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
|
||||
#if 0
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) priv;
|
||||
#endif
|
||||
|
||||
switch (val & 0xE0) {
|
||||
case 0x00: /* Set serial port IRQs. Not implemented */
|
||||
@@ -551,6 +561,9 @@ t3100e_config_get(void)
|
||||
value |= 0x10;
|
||||
break; /* Tri-mode */
|
||||
/* All others will be treated as 1.4M */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@@ -574,7 +587,11 @@ t3100e_config_get(void)
|
||||
prt_switch = 0; /* No external drive */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} /* End switch */
|
||||
|
||||
switch (prt_switch) {
|
||||
case 0:
|
||||
value |= 4;
|
||||
@@ -585,15 +602,18 @@ t3100e_config_get(void)
|
||||
case 2:
|
||||
value |= 6;
|
||||
break; /* External floppy is B: */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/* Read EMS page register */
|
||||
uint8_t
|
||||
t3100e_ems_in(uint16_t addr, void *p)
|
||||
t3100e_ems_in(uint16_t addr, void *priv)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) p;
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) priv;
|
||||
|
||||
int page = port_to_page(addr);
|
||||
if (page >= 0)
|
||||
@@ -606,9 +626,9 @@ t3100e_ems_in(uint16_t addr, void *p)
|
||||
|
||||
/* Write EMS page register */
|
||||
void
|
||||
t3100e_ems_out(uint16_t addr, uint8_t val, void *p)
|
||||
t3100e_ems_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) p;
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *) priv;
|
||||
int pg = port_to_page(addr);
|
||||
|
||||
if (pg == -1)
|
||||
@@ -654,9 +674,13 @@ ems_read_ramw(uint32_t addr, void *priv)
|
||||
|
||||
if (pg < 0)
|
||||
return 0xFFFF;
|
||||
// t3100e_log("ems_read_ramw addr=%05x ", addr);
|
||||
#if 0
|
||||
t3100e_log("ems_read_ramw addr=%05x ", addr);
|
||||
#endif
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
// t3100e_log("-> %06x val=%04x\n", addr, *(uint16_t *)&ram[addr]);
|
||||
#if 0
|
||||
// t3100e_log("-> %06x val=%04x\n", addr, *(uint16_t *) &ram[addr]);
|
||||
#endif
|
||||
return *(uint16_t *) &ram[addr];
|
||||
}
|
||||
|
||||
@@ -693,9 +717,13 @@ ems_write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
|
||||
if (pg < 0)
|
||||
return;
|
||||
// t3100e_log("ems_write_ramw addr=%05x ", addr);
|
||||
#if 0
|
||||
t3100e_log("ems_write_ramw addr=%05x ", addr);
|
||||
#endif
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
// t3100e_log("-> %06x val=%04x\n", addr, val);
|
||||
#if 0
|
||||
t3100e_log("-> %06x val=%04x\n", addr, val);
|
||||
#endif
|
||||
|
||||
*(uint16_t *) &ram[addr] = val;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/m_at_t3100e.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define T3100E_XSIZE 640
|
||||
#define T3100E_YSIZE 400
|
||||
@@ -134,14 +135,14 @@ typedef struct t3100e_t {
|
||||
static video_timings_t timing_t3100e = { VIDEO_ISA, 8, 16, 32, 8, 16, 32 };
|
||||
|
||||
void t3100e_recalctimings(t3100e_t *t3100e);
|
||||
void t3100e_write(uint32_t addr, uint8_t val, void *p);
|
||||
uint8_t t3100e_read(uint32_t addr, void *p);
|
||||
void t3100e_write(uint32_t addr, uint8_t val, void *priv);
|
||||
uint8_t t3100e_read(uint32_t addr, void *priv);
|
||||
void t3100e_recalcattrs(t3100e_t *t3100e);
|
||||
|
||||
void
|
||||
t3100e_out(uint16_t addr, uint8_t val, void *p)
|
||||
t3100e_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
switch (addr) {
|
||||
/* Emulated CRTC, register select */
|
||||
case 0x3d0:
|
||||
@@ -168,21 +169,20 @@ t3100e_out(uint16_t addr, uint8_t val, void *p)
|
||||
t3100e_recalctimings(t3100e);
|
||||
return;
|
||||
|
||||
/* CGA control register */
|
||||
case 0x3D8:
|
||||
cga_out(addr, val, &t3100e->cga);
|
||||
return;
|
||||
/* CGA colour register */
|
||||
case 0x3D9:
|
||||
case 0x3D8: /* CGA control register */
|
||||
case 0x3D9: /* CGA colour register */
|
||||
cga_out(addr, val, &t3100e->cga);
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
t3100e_in(uint16_t addr, void *p)
|
||||
t3100e_in(uint16_t addr, void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
uint8_t val;
|
||||
|
||||
switch (addr) {
|
||||
@@ -196,24 +196,28 @@ t3100e_in(uint16_t addr, void *p)
|
||||
val |= 0x30; /* Plasma / CRT */
|
||||
return val;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return cga_in(addr, &t3100e->cga);
|
||||
}
|
||||
|
||||
void
|
||||
t3100e_write(uint32_t addr, uint8_t val, void *p)
|
||||
t3100e_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
|
||||
t3100e->vram[addr & 0x7fff] = val;
|
||||
cycles -= 4;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
t3100e_read(uint32_t addr, void *p)
|
||||
t3100e_read(uint32_t addr, void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
cycles -= 4;
|
||||
|
||||
return t3100e->vram[addr & 0x7fff];
|
||||
@@ -242,7 +246,6 @@ void
|
||||
t3100e_text_row80(t3100e_t *t3100e)
|
||||
{
|
||||
uint32_t cols[2];
|
||||
int c;
|
||||
uint8_t chr;
|
||||
uint8_t attr;
|
||||
int drawcursor;
|
||||
@@ -287,12 +290,12 @@ t3100e_text_row80(t3100e_t *t3100e)
|
||||
cols[0] = normcols[attr][0];
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
(buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
(buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
++ma;
|
||||
}
|
||||
@@ -349,11 +352,11 @@ t3100e_text_row40(t3100e_t *t3100e)
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
(buffer32->line[t3100e->displine])[(x << 4) + c * 2] = (buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
(buffer32->line[t3100e->displine])[(x << 4) + c * 2] = (buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
++ma;
|
||||
@@ -386,8 +389,8 @@ t3100e_cgaline6(t3100e_t *t3100e)
|
||||
ink = (dat & 0x80) ? fg : bg;
|
||||
if (!(t3100e->cga.cgamode & 8))
|
||||
ink = black;
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + c] = ink;
|
||||
dat = dat << 1;
|
||||
(buffer32->line[t3100e->displine])[x * 8 + c] = ink;
|
||||
dat = dat << 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,18 +448,21 @@ t3100e_cgaline4(t3100e_t *t3100e)
|
||||
case 3:
|
||||
ink0 = ink1 = amber;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + 2 * c] = ink0;
|
||||
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + 2 * c + 1] = ink1;
|
||||
dat = dat << 2;
|
||||
(buffer32->line[t3100e->displine])[x * 8 + 2 * c] = ink0;
|
||||
(buffer32->line[t3100e->displine])[x * 8 + 2 * c + 1] = ink1;
|
||||
dat = dat << 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
t3100e_poll(void *p)
|
||||
t3100e_poll(void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
|
||||
if (t3100e->video_options != st_video_options) {
|
||||
t3100e->video_options = st_video_options;
|
||||
@@ -646,7 +652,7 @@ t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
}
|
||||
|
||||
void *
|
||||
t3100e_init(const device_t *info)
|
||||
t3100e_init(UNUSED(const device_t *info))
|
||||
{
|
||||
t3100e_t *t3100e = malloc(sizeof(t3100e_t));
|
||||
memset(t3100e, 0, sizeof(t3100e_t));
|
||||
@@ -680,18 +686,18 @@ t3100e_init(const device_t *info)
|
||||
}
|
||||
|
||||
void
|
||||
t3100e_close(void *p)
|
||||
t3100e_close(void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
|
||||
free(t3100e->vram);
|
||||
free(t3100e);
|
||||
}
|
||||
|
||||
void
|
||||
t3100e_speed_changed(void *p)
|
||||
t3100e_speed_changed(void *priv)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *) p;
|
||||
t3100e_t *t3100e = (t3100e_t *) priv;
|
||||
|
||||
t3100e_recalctimings(t3100e);
|
||||
}
|
||||
|
||||
@@ -50,11 +50,12 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
static void
|
||||
elt_vid_off_poll(void *p)
|
||||
elt_vid_off_poll(void *priv)
|
||||
{
|
||||
cga_t *cga = p;
|
||||
cga_t *cga = priv;
|
||||
uint8_t hdisp = cga->crtc[1];
|
||||
|
||||
/* Don't display anything.
|
||||
@@ -65,9 +66,9 @@ elt_vid_off_poll(void *p)
|
||||
}
|
||||
|
||||
static void
|
||||
sysstat_out(uint16_t port, uint8_t val, void *p)
|
||||
sysstat_out(UNUSED(uint16_t port), uint8_t val, void *priv)
|
||||
{
|
||||
cga_t *cga = p;
|
||||
cga_t *cga = priv;
|
||||
|
||||
switch (val) {
|
||||
case 0:
|
||||
@@ -88,9 +89,9 @@ sysstat_out(uint16_t port, uint8_t val, void *p)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
sysstat_in(uint16_t port, void *p)
|
||||
sysstat_in(UNUSED(uint16_t port), void *priv)
|
||||
{
|
||||
cga_t *cga = p;
|
||||
cga_t *cga = priv;
|
||||
uint8_t ret = 0x0a; /* No idea what these bits are */
|
||||
|
||||
/* External CRT. We don't emulate the LCD/CRT switching, let's just
|
||||
@@ -103,9 +104,9 @@ sysstat_in(uint16_t port, void *p)
|
||||
}
|
||||
|
||||
static void
|
||||
elt_vid_out(uint16_t addr, uint8_t val, void *p)
|
||||
elt_vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
cga_t *cga = p;
|
||||
cga_t *cga = priv;
|
||||
|
||||
/* The Equity LT chipset's CRTC contains more registers than the
|
||||
* regular CGA. The BIOS writes one of them, register 36 (0x24).
|
||||
@@ -122,22 +123,23 @@ elt_vid_out(uint16_t addr, uint8_t val, void *p)
|
||||
case 0x3d1:
|
||||
if (cga->crtcreg >= 32)
|
||||
return;
|
||||
/* FALLTHROUGH */
|
||||
[[fallthrough]];
|
||||
|
||||
default:
|
||||
cga->crtcreg &= 31;
|
||||
cga_out(addr, val, p);
|
||||
cga_out(addr, val, priv);
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
elt_vid_in(uint16_t addr, void *p)
|
||||
elt_vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
cga_t *cga = p;
|
||||
cga_t *cga = priv;
|
||||
|
||||
/* Just make sure we don't ever let regular CGA code run with crtcreg
|
||||
* pointing out of crtcregs[] bounds. */
|
||||
cga->crtcreg &= 31;
|
||||
return cga_in(addr, p);
|
||||
return cga_in(addr, priv);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define EUROPC_DEBUG 0 /* current debugging level */
|
||||
|
||||
@@ -125,7 +126,7 @@
|
||||
#define MRTC_CHECK_HI 0x0e /* Checksum, high byte */
|
||||
#define MRTC_CTRLSTAT 0x0f /* RTC control/status, binary */
|
||||
|
||||
typedef struct {
|
||||
typedef struct europc_t {
|
||||
uint16_t jim; /* JIM base address */
|
||||
|
||||
uint8_t regs[16]; /* JIM internal regs (8) */
|
||||
@@ -372,13 +373,17 @@ jim_set(europc_t *sys, uint8_t reg, uint8_t val)
|
||||
switch (val) {
|
||||
case 0x1f: /* 0001 1111 */
|
||||
case 0x0b: /* 0000 1011 */
|
||||
// europc_jim.mode=AGA_MONO;
|
||||
#if 0
|
||||
europc_jim.mode=AGA_MONO;
|
||||
#endif
|
||||
europc_log("EuroPC: AGA Monochrome mode!\n");
|
||||
break;
|
||||
|
||||
case 0x18: /* 0001 1000 */
|
||||
case 0x1a: /* 0001 1010 */
|
||||
// europc_jim.mode=AGA_COLOR;
|
||||
#if 0
|
||||
europc_jim.mode=AGA_COLOR;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x0e: /* 0000 1100 */
|
||||
@@ -392,7 +397,9 @@ jim_set(europc_t *sys, uint8_t reg, uint8_t val)
|
||||
break;
|
||||
|
||||
default:
|
||||
// europc_jim.mode=AGA_OFF;
|
||||
#if 0
|
||||
europc_jim.mode=AGA_OFF;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -400,15 +407,21 @@ jim_set(europc_t *sys, uint8_t reg, uint8_t val)
|
||||
case 4: /* CPU Speed control */
|
||||
switch (val & 0xc0) {
|
||||
case 0x00: /* 4.77 MHz */
|
||||
// cpu_set_clockscale(0, 1.0/2);
|
||||
#if 0
|
||||
cpu_set_clockscale(0, 1.0/2);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x40: /* 7.16 MHz */
|
||||
// cpu_set_clockscale(0, 3.0/4);
|
||||
#if 0
|
||||
cpu_set_clockscale(0, 3.0/4);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default: /* 9.54 MHz */
|
||||
// cpu_set_clockscale(0, 1);break;
|
||||
#if 0
|
||||
cpu_set_clockscale(0, 1);break;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -465,6 +478,9 @@ jim_write(uint16_t addr, uint8_t val, void *priv)
|
||||
sys->nvr_stat = 0;
|
||||
nvr_dosave++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -511,6 +527,9 @@ jim_read(uint16_t addr, void *priv)
|
||||
r = (sys->nvr.regs[sys->nvr_addr] & 0x0f);
|
||||
sys->nvr_stat = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -528,7 +547,7 @@ jim_read(uint16_t addr, void *priv)
|
||||
|
||||
/* Initialize the mainboard 'device' of the machine. */
|
||||
static void *
|
||||
europc_boot(const device_t *info)
|
||||
europc_boot(UNUSED(const device_t *info))
|
||||
{
|
||||
europc_t *sys = &europc;
|
||||
uint8_t b;
|
||||
@@ -573,6 +592,9 @@ europc_boot(const device_t *info)
|
||||
case 640:
|
||||
b |= 0x00;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sys->nvr.regs[MRTC_CONF_C] = b;
|
||||
|
||||
@@ -590,6 +612,9 @@ europc_boot(const device_t *info)
|
||||
case 2: /* 8088, 9.56 MHz */
|
||||
b |= 0x80;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sys->nvr.regs[MRTC_CONF_D] = b;
|
||||
|
||||
@@ -642,7 +667,7 @@ europc_boot(const device_t *info)
|
||||
}
|
||||
|
||||
static void
|
||||
europc_close(void *priv)
|
||||
europc_close(UNUSED(void *priv))
|
||||
{
|
||||
nvr_t *nvr = &europc.nvr;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga_comp.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define PCJR_RGB 0
|
||||
#define PCJR_COMPOSITE 1
|
||||
@@ -62,7 +63,7 @@
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
typedef struct {
|
||||
typedef struct pcjr_t {
|
||||
/* Video Controller stuff. */
|
||||
mem_mapping_t mapping;
|
||||
uint8_t crtc[32];
|
||||
@@ -73,20 +74,28 @@ typedef struct {
|
||||
int memctrl;
|
||||
uint8_t stat;
|
||||
int addr_mode;
|
||||
uint8_t *vram,
|
||||
*b8000;
|
||||
int linepos, displine;
|
||||
int sc, vc;
|
||||
int dispon;
|
||||
int con, coff, cursoron, blink;
|
||||
int vsynctime;
|
||||
int fullchange;
|
||||
int vadj;
|
||||
uint16_t ma, maback;
|
||||
uint64_t dispontime, dispofftime;
|
||||
pc_timer_t timer;
|
||||
int firstline, lastline;
|
||||
int composite;
|
||||
uint8_t *vram;
|
||||
uint8_t *b8000;
|
||||
int linepos;
|
||||
int displine;
|
||||
int sc;
|
||||
int vc;
|
||||
int dispon;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int blink;
|
||||
int vsynctime;
|
||||
int fullchange;
|
||||
int vadj;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
int firstline;
|
||||
int lastline;
|
||||
int composite;
|
||||
|
||||
/* Keyboard Controller stuff. */
|
||||
int latched;
|
||||
@@ -145,9 +154,9 @@ recalc_timings(pcjr_t *pcjr)
|
||||
}
|
||||
|
||||
static void
|
||||
vid_out(uint16_t addr, uint8_t val, void *p)
|
||||
vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
pcjr_t *pcjr = (pcjr_t *) p;
|
||||
pcjr_t *pcjr = (pcjr_t *) priv;
|
||||
uint8_t old;
|
||||
|
||||
switch (addr) {
|
||||
@@ -184,13 +193,16 @@ vid_out(uint16_t addr, uint8_t val, void *p)
|
||||
pcjr->addr_mode = val >> 6;
|
||||
recalc_address(pcjr);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
vid_in(uint16_t addr, void *p)
|
||||
vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
pcjr_t *pcjr = (pcjr_t *) p;
|
||||
pcjr_t *pcjr = (pcjr_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (addr) {
|
||||
@@ -207,15 +219,18 @@ vid_in(uint16_t addr, void *p)
|
||||
pcjr->stat ^= 0x10;
|
||||
ret = pcjr->stat;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
vid_write(uint32_t addr, uint8_t val, void *p)
|
||||
vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
pcjr_t *pcjr = (pcjr_t *) p;
|
||||
pcjr_t *pcjr = (pcjr_t *) priv;
|
||||
|
||||
if (pcjr->memctrl == -1)
|
||||
return;
|
||||
@@ -224,9 +239,9 @@ vid_write(uint32_t addr, uint8_t val, void *p)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
vid_read(uint32_t addr, void *p)
|
||||
vid_read(uint32_t addr, void *priv)
|
||||
{
|
||||
pcjr_t *pcjr = (pcjr_t *) p;
|
||||
pcjr_t *pcjr = (pcjr_t *) priv;
|
||||
|
||||
if (pcjr->memctrl == -1)
|
||||
return 0xff;
|
||||
@@ -235,13 +250,12 @@ vid_read(uint32_t addr, void *p)
|
||||
}
|
||||
|
||||
static void
|
||||
vid_poll(void *p)
|
||||
vid_poll(void *priv)
|
||||
{
|
||||
pcjr_t *pcjr = (pcjr_t *) p;
|
||||
pcjr_t *pcjr = (pcjr_t *) priv;
|
||||
uint16_t ca = (pcjr->crtc[15] | (pcjr->crtc[14] << 8)) & 0x3fff;
|
||||
int drawcursor;
|
||||
int x;
|
||||
int c;
|
||||
int xs_temp;
|
||||
int ys_temp;
|
||||
int oldvc;
|
||||
@@ -268,8 +282,8 @@ vid_poll(void *p)
|
||||
}
|
||||
pcjr->lastline = pcjr->displine;
|
||||
cols[0] = (pcjr->array[2] & 0xf) + 16;
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[pcjr->displine])[c] = cols[0];
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
(buffer32->line[pcjr->displine])[c] = cols[0];
|
||||
if (pcjr->array[0] & 1) {
|
||||
buffer32->line[pcjr->displine << 1][c + (pcjr->crtc[1] << 3) + 8] = buffer32->line[(pcjr->displine << 1) + 1][c + (pcjr->crtc[1] << 3) + 8] = cols[0];
|
||||
} else {
|
||||
@@ -288,6 +302,9 @@ vid_poll(void *p)
|
||||
case 3: /*High resolution graphics*/
|
||||
offset = (pcjr->sc & 3) * 0x2000;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
switch ((pcjr->array[0] & 0x13) | ((pcjr->array[3] & 0x08) << 5)) {
|
||||
case 0x13: /*320x200x16*/
|
||||
@@ -314,7 +331,7 @@ vid_poll(void *p)
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) | pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
chr = (dat >> 7) & 1;
|
||||
chr |= ((dat >> 14) & 2);
|
||||
buffer32->line[pcjr->displine << 1][(x << 3) + 8 + c] = buffer32->line[(pcjr->displine << 1) + 1][(x << 3) + 8 + c] = pcjr->array[(chr & pcjr->array[1]) + 16] + 16;
|
||||
@@ -337,16 +354,16 @@ vid_poll(void *p)
|
||||
cols[0] = pcjr->array[((attr >> 4) & pcjr->array[1]) + 16] + 16;
|
||||
}
|
||||
if (pcjr->sc & 8) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 3) + c + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 3) + c + 8] = cols[0];
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 3) + c + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 3) + c + 8] = cols[(fontdat[chr][pcjr->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 3) + c + 8] ^= 15;
|
||||
buffer32->line[(pcjr->displine << 1) + 1][(x << 3) + c + 8] ^= 15;
|
||||
}
|
||||
@@ -370,17 +387,17 @@ vid_poll(void *p)
|
||||
}
|
||||
pcjr->ma++;
|
||||
if (pcjr->sc & 8) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[0];
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[0];
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][pcjr->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][pcjr->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 16; c++) {
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + c + 8] ^= 15;
|
||||
for (uint8_t c = 0; c < 16; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + c + 8] ^= 15;
|
||||
buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + c + 8] ^= 15;
|
||||
}
|
||||
}
|
||||
@@ -394,8 +411,8 @@ vid_poll(void *p)
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) | pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[pcjr->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
dat <<= 2;
|
||||
}
|
||||
}
|
||||
@@ -406,12 +423,15 @@ vid_poll(void *p)
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) | pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
for (c = 0; c < 16; c++) {
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + c + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + c + 8] = cols[dat >> 15];
|
||||
for (uint8_t c = 0; c < 16; c++) {
|
||||
buffer32->line[pcjr->displine << 1][(x << 4) + c + 8] = buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + c + 8] = cols[dat >> 15];
|
||||
dat <<= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (pcjr->array[3] & 4) {
|
||||
@@ -438,7 +458,7 @@ vid_poll(void *p)
|
||||
else
|
||||
x = (pcjr->crtc[1] << 4) + 16;
|
||||
if (pcjr->composite) {
|
||||
Composite_Process(pcjr->array[0], 0, x >> 2, buffer32->line[(pcjr->displine << 1)]);
|
||||
Composite_Process(pcjr->array[0], 0, x >> 2, buffer32->line[pcjr->displine << 1]);
|
||||
Composite_Process(pcjr->array[0], 0, x >> 2, buffer32->line[(pcjr->displine << 1) + 1]);
|
||||
} else {
|
||||
video_process_8(x, pcjr->displine << 1);
|
||||
@@ -550,7 +570,7 @@ vid_poll(void *p)
|
||||
pcjr->sc &= 31;
|
||||
pcjr->ma = pcjr->maback;
|
||||
}
|
||||
if ((pcjr->sc == (pcjr->crtc[10] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[10] & 31) >> 1))))
|
||||
if (pcjr->sc == (pcjr->crtc[10] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[10] & 31) >> 1)))
|
||||
pcjr->con = 1;
|
||||
}
|
||||
}
|
||||
@@ -591,6 +611,9 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x60:
|
||||
sn76489_mute = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -598,6 +621,9 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
nmi_mask = val & 0x80;
|
||||
pit_devs[0].set_using_timer(pit_devs[0].data, 1, !(val & 0x20));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,6 +663,9 @@ kbd_read(uint16_t port, void *priv)
|
||||
pcjr->latched = 0;
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -765,7 +794,7 @@ const device_t pcjr_device = {
|
||||
};
|
||||
|
||||
int
|
||||
machine_pcjr_init(const machine_t *model)
|
||||
machine_pcjr_init(UNUSED(const machine_t *model))
|
||||
{
|
||||
int display_type;
|
||||
pcjr_t *pcjr;
|
||||
|
||||
@@ -153,6 +153,9 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps->ps1_102 = val;
|
||||
@@ -174,6 +177,9 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x0190:
|
||||
ps->ps1_190 = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,54 +161,54 @@ enum {
|
||||
* block is transferred.
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
typedef struct ssb_t {
|
||||
/* Status byte 0. */
|
||||
uint8_t track_0 : 1, /* T0 */
|
||||
mbz1 : 1, /* 0 */
|
||||
mbz2 : 1, /* 0 */
|
||||
cylinder_err : 1, /* CE */
|
||||
write_fault : 1, /* WF */
|
||||
mbz3 : 1, /* 0 */
|
||||
seek_end : 1, /* SE */
|
||||
not_ready : 1; /* NR */
|
||||
uint8_t track_0 : 1; /* T0 */
|
||||
uint8_t mbz1 : 1; /* 0 */
|
||||
uint8_t mbz2 : 1; /* 0 */
|
||||
uint8_t cylinder_err : 1; /* CE */
|
||||
uint8_t write_fault : 1; /* WF */
|
||||
uint8_t mbz3 : 1; /* 0 */
|
||||
uint8_t seek_end : 1; /* SE */
|
||||
uint8_t not_ready : 1; /* NR */
|
||||
|
||||
/* Status byte 1. */
|
||||
uint8_t id_not_found : 1, /* ID */
|
||||
mbz4 : 1, /* 0 */
|
||||
mbz5 : 1, /* 0 */
|
||||
wrong_cyl : 1, /* WC */
|
||||
all_bit_set : 1, /* BT */
|
||||
mark_not_found : 1, /* AM */
|
||||
ecc_crc_err : 1, /* ET */
|
||||
ecc_crc_field : 1; /* EF */
|
||||
uint8_t id_not_found : 1; /* ID */
|
||||
uint8_t mbz4 : 1; /* 0 */
|
||||
uint8_t mbz5 : 1; /* 0 */
|
||||
uint8_t wrong_cyl : 1; /* WC */
|
||||
uint8_t all_bit_set : 1; /* BT */
|
||||
uint8_t mark_not_found : 1; /* AM */
|
||||
uint8_t ecc_crc_err : 1; /* ET */
|
||||
uint8_t ecc_crc_field : 1; /* EF */
|
||||
|
||||
/* Status byte 2. */
|
||||
uint8_t headsel_state : 4, /* headsel state[4] */
|
||||
defective_sector : 1, /* DS */
|
||||
retried_ok : 1, /* RG */
|
||||
need_reset : 1, /* RR */
|
||||
uint8_t headsel_state : 4; /* headsel state[4] */
|
||||
uint8_t defective_sector : 1; /* DS */
|
||||
uint8_t retried_ok : 1; /* RG */
|
||||
uint8_t need_reset : 1; /* RR */
|
||||
#if 1
|
||||
valid : 1; /* 0 (abused as VALID) */
|
||||
uint8_t valid : 1; /* 0 (abused as VALID) */
|
||||
#else
|
||||
mbz6 : 1; /* 0 */
|
||||
uint8_t mbz6 : 1; /* 0 */
|
||||
#endif
|
||||
|
||||
/* Most recent ID field seen. */
|
||||
uint8_t last_cyl_low; /* Cyl_Low[8] */
|
||||
uint8_t last_head : 4, /* HD[4] */
|
||||
mbz7 : 1, /* 0 */
|
||||
last_cyl_high : 2, /* Cyl_high[2] */
|
||||
last_def_sect : 1; /* DS */
|
||||
uint8_t last_sect; /* Sect[8] */
|
||||
uint8_t last_cyl_low; /* Cyl_Low[8] */
|
||||
uint8_t last_head : 4; /* HD[4] */
|
||||
uint8_t mbz7 : 1; /* 0 */
|
||||
uint8_t last_cyl_high : 2; /* Cyl_high[2] */
|
||||
uint8_t last_def_sect : 1; /* DS */
|
||||
uint8_t last_sect; /* Sect[8] */
|
||||
|
||||
uint8_t sect_size; /* Size[8] = 02 */
|
||||
|
||||
/* Current position. */
|
||||
uint8_t curr_cyl_high : 2, /* Cyl_High_[2] */
|
||||
mbz8 : 1, /* 0 */
|
||||
mbz9 : 1, /* 0 */
|
||||
curr_head : 4; /* HD_2[4] */
|
||||
uint8_t curr_cyl_low; /* Cyl_Low_2[8] */
|
||||
uint8_t curr_cyl_high : 2; /* Cyl_High_[2] */
|
||||
uint8_t mbz8 : 1; /* 0 */
|
||||
uint8_t mbz9 : 1; /* 0 */
|
||||
uint8_t curr_head : 4; /* HD_2[4] */
|
||||
uint8_t curr_cyl_low; /* Cyl_Low_2[8] */
|
||||
|
||||
uint8_t sect_corr; /* sectors corrected */
|
||||
|
||||
@@ -290,21 +290,21 @@ typedef struct {
|
||||
* bits 0.
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
defective_sector : 1, /* DS */
|
||||
mbz1 : 1, /* 0 */
|
||||
head : 4; /* head number */
|
||||
typedef struct fcb_t {
|
||||
uint8_t cyl_high : 2; /* cylinder [9:8] bits */
|
||||
uint8_t defective_sector : 1; /* DS */
|
||||
uint8_t mbz1 : 1; /* 0 */
|
||||
uint8_t head : 4; /* head number */
|
||||
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
|
||||
uint8_t sector; /* sector number */
|
||||
uint8_t sector; /* sector number */
|
||||
|
||||
uint8_t mbz2 : 1, /* 0 */
|
||||
mbo : 1, /* 1 */
|
||||
mbz3 : 6; /* 000000 */
|
||||
uint8_t mbz2 : 1; /* 0 */
|
||||
uint8_t mbo : 1; /* 1 */
|
||||
uint8_t mbz3 : 6; /* 000000 */
|
||||
|
||||
uint8_t fill; /* filler byte */
|
||||
uint8_t fill; /* filler byte */
|
||||
} fcb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -316,31 +316,31 @@ typedef struct {
|
||||
* through a DMA or PIO operation.
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
uint8_t ec_p : 1, /* EC/P (ecc/park) */
|
||||
mbz1 : 1, /* 0 */
|
||||
auto_seek : 1, /* AS (auto-seek) */
|
||||
no_data : 1, /* ND (no data) */
|
||||
cmd : 4; /* command code[4] */
|
||||
typedef struct ccb_t{
|
||||
uint8_t ec_p : 1; /* EC/P (ecc/park) */
|
||||
uint8_t mbz1 : 1; /* 0 */
|
||||
uint8_t auto_seek : 1; /* AS (auto-seek) */
|
||||
uint8_t no_data : 1; /* ND (no data) */
|
||||
uint8_t cmd : 4; /* command code[4] */
|
||||
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
mbz2 : 2, /* 00 */
|
||||
head : 4; /* head number */
|
||||
uint8_t cyl_high : 2; /* cylinder [9:8] bits */
|
||||
uint8_t mbz2 : 2; /* 00 */
|
||||
uint8_t head : 4; /* head number */
|
||||
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
|
||||
uint8_t sector; /* sector number */
|
||||
|
||||
uint8_t mbz3 : 1, /* 0 */
|
||||
mbo1 : 1, /* 1 */
|
||||
mbz4 : 6; /* 000000 */
|
||||
uint8_t mbz3 : 1; /* 0 */
|
||||
uint8_t mbo1 : 1; /* 1 */
|
||||
uint8_t mbz4 : 6; /* 000000 */
|
||||
|
||||
uint8_t count; /* blk count/interleave */
|
||||
} ccb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
/* Define the hard drive geometry table. */
|
||||
typedef struct {
|
||||
typedef struct geom_t {
|
||||
uint16_t cyl;
|
||||
uint8_t hpc;
|
||||
uint8_t spt;
|
||||
@@ -349,54 +349,54 @@ typedef struct {
|
||||
} geom_t;
|
||||
|
||||
/* 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 */
|
||||
typedef struct drive_t {
|
||||
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;
|
||||
|
||||
typedef struct {
|
||||
typedef struct hdc_t {
|
||||
uint16_t base; /* controller base I/O address */
|
||||
int8_t irq; /* controller IRQ channel */
|
||||
int8_t dma; /* controller DMA channel */
|
||||
|
||||
/* Registers. */
|
||||
uint8_t attn, /* ATTENTION register */
|
||||
ctrl, /* Control register (ACR) */
|
||||
status, /* Status register (ASR) */
|
||||
intstat; /* Interrupt Status register (ISR) */
|
||||
uint8_t attn; /* ATTENTION register */
|
||||
uint8_t ctrl; /* Control register (ACR) */
|
||||
uint8_t status; /* Status register (ASR) */
|
||||
uint8_t intstat; /* Interrupt Status register (ISR) */
|
||||
|
||||
uint8_t *reg_91; /* handle to system board's register 0x91 */
|
||||
|
||||
/* Controller state. */
|
||||
uint64_t callback;
|
||||
pc_timer_t timer;
|
||||
int8_t state, /* controller state */
|
||||
reset; /* reset state counter */
|
||||
int8_t state; /* controller state */
|
||||
int8_t reset; /* reset state counter */
|
||||
|
||||
/* 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. */
|
||||
ssb_t ssb; /* sense block */
|
||||
ccb_t ccb; /* command control block */
|
||||
uint16_t track; /* requested track# */
|
||||
uint8_t head, /* requested head# */
|
||||
sector; /* requested sector# */
|
||||
int count; /* requested sector count */
|
||||
ssb_t ssb; /* sense block */
|
||||
ccb_t ccb; /* command control block */
|
||||
uint16_t track; /* requested track# */
|
||||
uint8_t head; /* requested head# */
|
||||
uint8_t sector; /* requested sector# */
|
||||
int count; /* requested sector count */
|
||||
|
||||
drive_t drives[XTA_NUM]; /* the attached drive(s) */
|
||||
|
||||
@@ -602,8 +602,10 @@ do_seek(hdc_t *dev, drive_t *drive, uint16_t cyl)
|
||||
static void
|
||||
do_format(hdc_t *dev, drive_t *drive, ccb_t *ccb)
|
||||
{
|
||||
int start_cyl, end_cyl;
|
||||
int intr = 0, val;
|
||||
int start_cyl;
|
||||
int end_cyl;
|
||||
int intr = 0;
|
||||
int val;
|
||||
off64_t addr;
|
||||
#if 0
|
||||
fcb_t *fcb;
|
||||
@@ -697,8 +699,7 @@ do_fmt:
|
||||
|
||||
/* Done with this track. */
|
||||
dev->state = STATE_FDONE;
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
[[fallthrough]];
|
||||
case STATE_FDONE:
|
||||
/* One more track done. */
|
||||
if (++start_cyl == end_cyl) {
|
||||
@@ -712,6 +713,9 @@ do_fmt:
|
||||
/* This saves us a LOT of code. */
|
||||
dev->state = STATE_FINIT;
|
||||
goto do_fmt;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we errored out, go back idle. */
|
||||
@@ -870,6 +874,9 @@ do_send:
|
||||
/* This saves us a LOT of code. */
|
||||
dev->state = STATE_SEND;
|
||||
goto do_send;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1012,6 +1019,9 @@ do_recv:
|
||||
/* This saves us a LOT of code. */
|
||||
dev->state = STATE_RECV;
|
||||
goto do_recv;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1125,6 +1135,9 @@ hdc_read(uint16_t port, void *priv)
|
||||
ret = dev->intstat;
|
||||
dev->intstat = 0x00;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1231,11 +1244,14 @@ hdc_write(uint16_t port, uint8_t val, void *priv)
|
||||
set_intr(dev, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
ps1_hdc_init(const device_t *info)
|
||||
ps1_hdc_init(UNUSED(const device_t *info))
|
||||
{
|
||||
drive_t *drive;
|
||||
hdc_t *dev;
|
||||
|
||||
@@ -72,6 +72,9 @@ ps2_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2->ps2_102 = val;
|
||||
@@ -93,6 +96,9 @@ ps2_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x0190:
|
||||
ps2->ps2_190 = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +137,9 @@ ps2_read(uint16_t port, void *priv)
|
||||
case 0x0190:
|
||||
temp = ps2->ps2_190;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return temp;
|
||||
|
||||
@@ -68,15 +68,16 @@
|
||||
#include <86box/serial.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
static struct
|
||||
{
|
||||
static struct ps2_t {
|
||||
uint8_t adapter_setup;
|
||||
uint8_t option[4];
|
||||
uint8_t pos_vga;
|
||||
uint8_t setup;
|
||||
uint8_t sys_ctrl_port_a;
|
||||
uint8_t subaddr_lo, subaddr_hi;
|
||||
uint8_t subaddr_lo;
|
||||
uint8_t subaddr_hi;
|
||||
|
||||
uint8_t memory_bank[8];
|
||||
|
||||
@@ -88,11 +89,12 @@ static struct
|
||||
mem_mapping_t cache_mapping;
|
||||
|
||||
uint8_t (*planar_read)(uint16_t port);
|
||||
void (*planar_write)(uint16_t port, uint8_t val);
|
||||
void (*planar_write)(uint16_t port, uint8_t val);
|
||||
|
||||
uint8_t mem_regs[3];
|
||||
|
||||
uint32_t split_addr, split_size;
|
||||
uint32_t split_addr;
|
||||
uint32_t split_size;
|
||||
uint32_t split_phys;
|
||||
|
||||
uint8_t mem_pos_regs[8];
|
||||
@@ -158,7 +160,7 @@ ps2_mca_log(const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
static uint8_t
|
||||
ps2_read_cache_ram(uint32_t addr, void *priv)
|
||||
ps2_read_cache_ram(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
ps2_mca_log("ps2_read_cache_ram: addr=%08x %i %04x:%04x\n", addr, ps2_cache_valid[addr >> 3], CS, cpu_state.pc);
|
||||
if (!ps2_cache_valid[addr >> 3]) {
|
||||
@@ -170,7 +172,7 @@ ps2_read_cache_ram(uint32_t addr, void *priv)
|
||||
return ps2_cache[addr];
|
||||
}
|
||||
static uint16_t
|
||||
ps2_read_cache_ramw(uint32_t addr, void *priv)
|
||||
ps2_read_cache_ramw(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
ps2_mca_log("ps2_read_cache_ramw: addr=%08x %i %04x:%04x\n", addr, ps2_cache_valid[addr >> 3], CS, cpu_state.pc);
|
||||
if (!ps2_cache_valid[addr >> 3]) {
|
||||
@@ -182,7 +184,7 @@ ps2_read_cache_ramw(uint32_t addr, void *priv)
|
||||
return *(uint16_t *) &ps2_cache[addr];
|
||||
}
|
||||
static uint32_t
|
||||
ps2_read_cache_raml(uint32_t addr, void *priv)
|
||||
ps2_read_cache_raml(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
ps2_mca_log("ps2_read_cache_raml: addr=%08x %i %04x:%04x\n", addr, ps2_cache_valid[addr >> 3], CS, cpu_state.pc);
|
||||
if (!ps2_cache_valid[addr >> 3]) {
|
||||
@@ -194,7 +196,7 @@ ps2_read_cache_raml(uint32_t addr, void *priv)
|
||||
return *(uint32_t *) &ps2_cache[addr];
|
||||
}
|
||||
static void
|
||||
ps2_write_cache_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
ps2_write_cache_ram(uint32_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
ps2_mca_log("ps2_write_cache_ram: addr=%08x val=%02x %04x:%04x %i\n", addr, val, CS, cpu_state.pc);
|
||||
ps2_cache[addr] = val;
|
||||
@@ -268,6 +270,9 @@ model_50_read(uint16_t port)
|
||||
return ps2.subaddr_lo;
|
||||
case 0x107:
|
||||
return ps2.subaddr_hi;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
@@ -292,6 +297,9 @@ model_55sx_read(uint16_t port)
|
||||
return ps2.subaddr_lo;
|
||||
case 0x107:
|
||||
return ps2.subaddr_hi;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
@@ -316,6 +324,9 @@ model_70_type3_read(uint16_t port)
|
||||
return ps2.subaddr_lo;
|
||||
case 0x107:
|
||||
return ps2.subaddr_hi;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
@@ -340,6 +351,9 @@ model_80_read(uint16_t port)
|
||||
return ps2.subaddr_lo;
|
||||
case 0x107:
|
||||
return ps2.subaddr_hi;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
@@ -373,6 +387,9 @@ model_50_write(uint16_t port, uint8_t val)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
@@ -392,6 +409,9 @@ model_50_write(uint16_t port, uint8_t val)
|
||||
case 0x107:
|
||||
ps2.subaddr_hi = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,11 +478,12 @@ model_55sx_mem_recalc(void)
|
||||
|
||||
mem_set_mem_state(0xe0000, 0x20000, state);
|
||||
|
||||
/* if (!(ps2.option[3] & 0x08))
|
||||
{
|
||||
#if 0
|
||||
if (!(ps2.option[3] & 0x08)) {
|
||||
ps2_mca_log("Memory not yet configured\n");
|
||||
return;
|
||||
} */
|
||||
}
|
||||
#endif
|
||||
|
||||
ps2_mca_log("Enable shadow mapping at %06X-%06X\n", (mem_size * 1024), (mem_size * 1024) + (remap_size * 1024) - 1);
|
||||
|
||||
@@ -503,6 +524,9 @@ model_55sx_write(uint16_t port, uint8_t val)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
@@ -529,6 +553,9 @@ model_55sx_write(uint16_t port, uint8_t val)
|
||||
case 0x107:
|
||||
ps2.subaddr_hi = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,6 +587,9 @@ model_70_type3_write(uint16_t port, uint8_t val)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
@@ -581,6 +611,9 @@ model_70_type3_write(uint16_t port, uint8_t val)
|
||||
case 0x107:
|
||||
ps2.subaddr_hi = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,6 +645,9 @@ model_80_write(uint16_t port, uint8_t val)
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
@@ -631,17 +667,22 @@ model_80_write(uint16_t port, uint8_t val)
|
||||
case 0x107:
|
||||
ps2.subaddr_hi = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
ps2_mca_read(uint16_t port, void *p)
|
||||
ps2_mca_read(uint16_t port, UNUSED(void *priv))
|
||||
{
|
||||
uint8_t temp;
|
||||
|
||||
switch (port) {
|
||||
case 0x91:
|
||||
// fatal("Read 91 setup=%02x adapter=%02x\n", ps2.setup, ps2.adapter_setup);
|
||||
#if 0
|
||||
fatal("Read 91 setup=%02x adapter=%02x\n", ps2.setup, ps2.adapter_setup);
|
||||
#endif
|
||||
if (!(ps2.setup & PS2_SETUP_IO))
|
||||
temp = 0x00;
|
||||
else if (!(ps2.setup & PS2_SETUP_VGA))
|
||||
@@ -740,7 +781,7 @@ ps2_mca_read(uint16_t port, void *p)
|
||||
}
|
||||
|
||||
static void
|
||||
ps2_mca_write(uint16_t port, uint8_t val, void *p)
|
||||
ps2_mca_write(uint16_t port, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
ps2_mca_log("ps2_write: port=%04x val=%02x %04x:%04x\n", port, val, CS, cpu_state.pc);
|
||||
|
||||
@@ -763,7 +804,7 @@ ps2_mca_write(uint16_t port, uint8_t val, void *p)
|
||||
case 0x101:
|
||||
if (!(ps2.setup & PS2_SETUP_IO))
|
||||
ps2.planar_write(port, val);
|
||||
else if ((ps2.setup & PS2_SETUP_VGA) && (ps2.setup & PS2_SETUP_VGA) && (ps2.adapter_setup & PS2_ADAPTER_SETUP))
|
||||
else if ((ps2.setup & PS2_SETUP_VGA) && (ps2.adapter_setup & PS2_ADAPTER_SETUP))
|
||||
mca_write(port, val);
|
||||
break;
|
||||
case 0x102:
|
||||
@@ -804,6 +845,9 @@ ps2_mca_write(uint16_t port, uint8_t val, void *p)
|
||||
else if (ps2.adapter_setup & PS2_ADAPTER_SETUP)
|
||||
mca_write(port, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,13 +868,13 @@ ps2_mca_board_common_init(void)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ps2_mem_expansion_read(int port, void *p)
|
||||
ps2_mem_expansion_read(int port, UNUSED(void *priv))
|
||||
{
|
||||
return ps2.mem_pos_regs[port & 7];
|
||||
}
|
||||
|
||||
static void
|
||||
ps2_mem_expansion_write(int port, uint8_t val, void *p)
|
||||
ps2_mem_expansion_write(int port, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
if (port < 0x102 || port == 0x104)
|
||||
return;
|
||||
@@ -844,7 +888,7 @@ ps2_mem_expansion_write(int port, uint8_t val, void *p)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ps2_mem_expansion_feedb(void *p)
|
||||
ps2_mem_expansion_feedb(UNUSED(void *priv))
|
||||
{
|
||||
return (ps2.mem_pos_regs[2] & 1);
|
||||
}
|
||||
@@ -888,6 +932,9 @@ ps2_mca_mem_fffc_init(int start_mb)
|
||||
case 8:
|
||||
ps2.mem_pos_regs[4] = 0xaa; /* 10 10 10 10 = 2 2 2 2 */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
mca_add(ps2_mem_expansion_read, ps2_mem_expansion_write, ps2_mem_expansion_feedb, NULL, NULL);
|
||||
@@ -988,9 +1035,6 @@ ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots)
|
||||
ps2.memory_bank[1] = 0x61;
|
||||
break;
|
||||
case 6:
|
||||
ps2.memory_bank[0] = 0x01;
|
||||
ps2.memory_bank[1] = 0x51;
|
||||
break;
|
||||
case 7: /*Not supported*/
|
||||
ps2.memory_bank[0] = 0x01;
|
||||
ps2.memory_bank[1] = 0x51;
|
||||
@@ -999,6 +1043,9 @@ ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots)
|
||||
ps2.memory_bank[0] = 0x01;
|
||||
ps2.memory_bank[1] = 0x01;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
mca_init(slots);
|
||||
@@ -1071,18 +1118,21 @@ mem_encoding_update(void)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
mem_encoding_read(uint16_t addr, void *p)
|
||||
mem_encoding_read(uint16_t addr, UNUSED(void *priv))
|
||||
{
|
||||
switch (addr) {
|
||||
case 0xe0:
|
||||
return ps2.mem_regs[0];
|
||||
case 0xe1:
|
||||
return ps2.mem_regs[1];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
static void
|
||||
mem_encoding_write(uint16_t addr, uint8_t val, void *p)
|
||||
mem_encoding_write(uint16_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
switch (addr) {
|
||||
case 0xe0:
|
||||
@@ -1091,12 +1141,15 @@ mem_encoding_write(uint16_t addr, uint8_t val, void *p)
|
||||
case 0xe1:
|
||||
ps2.mem_regs[1] = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mem_encoding_update();
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
mem_encoding_read_cached(uint16_t addr, void *p)
|
||||
mem_encoding_read_cached(uint16_t addr, UNUSED(void *priv))
|
||||
{
|
||||
switch (addr) {
|
||||
case 0xe0:
|
||||
@@ -1105,12 +1158,15 @@ mem_encoding_read_cached(uint16_t addr, void *p)
|
||||
return ps2.mem_regs[1];
|
||||
case 0xe2:
|
||||
return ps2.mem_regs[2];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
static void
|
||||
mem_encoding_write_cached(uint16_t addr, uint8_t val, void *p)
|
||||
mem_encoding_write_cached(uint16_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
uint8_t old;
|
||||
|
||||
@@ -1145,6 +1201,9 @@ mem_encoding_write_cached(uint16_t addr, uint8_t val, void *p)
|
||||
ram_mid_mapping.flags &= ~MEM_MAPPING_ROM_WS;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ps2_mca_log("mem_encoding_write: addr=%02x val=%02x %04x:%04x %02x %02x\n", addr, val, CS, cpu_state.pc, ps2.mem_regs[1], ps2.mem_regs[2]);
|
||||
mem_encoding_update();
|
||||
@@ -1253,7 +1312,7 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
|
||||
}
|
||||
|
||||
static void
|
||||
ps2_mca_board_model_80_type2_init(int is486)
|
||||
ps2_mca_board_model_80_type2_init(int is486ps2)
|
||||
{
|
||||
ps2_mca_board_common_init();
|
||||
|
||||
@@ -1313,7 +1372,7 @@ ps2_mca_board_model_80_type2_init(int is486)
|
||||
NULL);
|
||||
mem_mapping_disable(&ps2.split_mapping);
|
||||
|
||||
if ((mem_size > 4096) && !is486) {
|
||||
if ((mem_size > 4096) && !is486ps2) {
|
||||
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
|
||||
if (mem_size > 12288)
|
||||
ps2_mca_mem_d071_init(4);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga_comp.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
enum {
|
||||
TANDY_RGB = 0,
|
||||
@@ -62,7 +63,7 @@ enum {
|
||||
EEPROM_WRITE
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct t1kvid_t {
|
||||
mem_mapping_t mapping;
|
||||
mem_mapping_t vram_mapping;
|
||||
|
||||
@@ -72,36 +73,41 @@ typedef struct {
|
||||
int array_index;
|
||||
uint8_t array[256];
|
||||
int memctrl;
|
||||
uint8_t mode, col;
|
||||
uint8_t mode;
|
||||
uint8_t col;
|
||||
uint8_t stat;
|
||||
|
||||
uint8_t *vram, *b8000;
|
||||
uint8_t *vram;
|
||||
uint8_t *b8000;
|
||||
uint32_t b8000_mask;
|
||||
uint32_t b8000_limit;
|
||||
uint8_t planar_ctrl;
|
||||
|
||||
int linepos,
|
||||
displine;
|
||||
int sc, vc;
|
||||
int dispon;
|
||||
int con, coff,
|
||||
cursoron,
|
||||
blink;
|
||||
int linepos;
|
||||
int displine;
|
||||
int sc;
|
||||
int vc;
|
||||
int dispon;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int blink;
|
||||
int fullchange;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
uint16_t ma, maback;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
|
||||
uint64_t dispontime,
|
||||
dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
int firstline,
|
||||
lastline;
|
||||
int firstline;
|
||||
int lastline;
|
||||
|
||||
int composite;
|
||||
} t1kvid_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct t1keep_t {
|
||||
char *path;
|
||||
|
||||
int state;
|
||||
@@ -112,7 +118,7 @@ typedef struct {
|
||||
uint16_t store[64];
|
||||
} t1keep_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct tandy_t {
|
||||
mem_mapping_t ram_mapping;
|
||||
mem_mapping_t rom_mapping; /* SL2 */
|
||||
|
||||
@@ -573,6 +579,9 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
vid->planar_ctrl = val;
|
||||
recalc_mapping(dev);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,6 +607,9 @@ vid_in(uint16_t addr, void *priv)
|
||||
case 0x03da:
|
||||
ret = vid->stat;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -696,7 +708,7 @@ vid_poll(void *priv)
|
||||
} else {
|
||||
buffer32->line[vid->displine << 1][c] = buffer32->line[(vid->displine << 1) + 1][c] = (vid->col & 15) + 16;
|
||||
if (vid->mode & 1) {
|
||||
buffer32->line[(vid->displine << 1)][c + (vid->crtc[1] << 3) + 8] = buffer32->line[(vid->displine << 1) + 1][c + (vid->crtc[1] << 3) + 8] = (vid->col & 15) + 16;
|
||||
buffer32->line[vid->displine << 1][c + (vid->crtc[1] << 3) + 8] = buffer32->line[(vid->displine << 1) + 1][c + (vid->crtc[1] << 3) + 8] = (vid->col & 15) + 16;
|
||||
} else {
|
||||
buffer32->line[vid->displine << 1][c + (vid->crtc[1] << 4) + 8] = buffer32->line[(vid->displine << 1) + 1][c + (vid->crtc[1] << 4) + 8] = (vid->col & 15) + 16;
|
||||
}
|
||||
@@ -773,7 +785,7 @@ vid_poll(void *priv)
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] ^= 15;
|
||||
buffer32->line[vid->displine << 1][(x << 3) + c + 8] ^= 15;
|
||||
buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] ^= 15;
|
||||
}
|
||||
}
|
||||
@@ -796,19 +808,19 @@ vid_poll(void *priv)
|
||||
vid->ma++;
|
||||
if (vid->sc & 8) {
|
||||
for (c = 0; c < 8; c++)
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = cols[0];
|
||||
buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 1 + 8] = cols[0];
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
if (vid->sc == 8) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
} else {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 16; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + c + 8] ^= 15;
|
||||
buffer32->line[vid->displine << 1][(x << 4) + c + 8] ^= 15;
|
||||
buffer32->line[(vid->displine << 1) + 1][(x << 4) + c + 8] ^= 15;
|
||||
}
|
||||
}
|
||||
@@ -837,7 +849,7 @@ vid_poll(void *priv)
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) | vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1];
|
||||
vid->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] = buffer32->line[vid->displine << 1][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
dat <<= 2;
|
||||
}
|
||||
}
|
||||
@@ -848,7 +860,7 @@ vid_poll(void *priv)
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) | vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1];
|
||||
vid->ma++;
|
||||
for (c = 0; c < 16; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + c + 8] = cols[dat >> 15];
|
||||
buffer32->line[vid->displine << 1][(x << 4) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + c + 8] = cols[dat >> 15];
|
||||
dat <<= 1;
|
||||
}
|
||||
}
|
||||
@@ -879,7 +891,7 @@ vid_poll(void *priv)
|
||||
else
|
||||
x = (vid->crtc[1] << 4) + 16;
|
||||
if (!dev->is_sl2 && vid->composite) {
|
||||
Composite_Process(vid->mode, 0, x >> 2, buffer32->line[(vid->displine << 1)]);
|
||||
Composite_Process(vid->mode, 0, x >> 2, buffer32->line[vid->displine << 1]);
|
||||
Composite_Process(vid->mode, 0, x >> 2, buffer32->line[(vid->displine << 1) + 1]);
|
||||
} else {
|
||||
video_process_8(x, vid->displine << 1);
|
||||
@@ -967,7 +979,7 @@ vid_poll(void *priv)
|
||||
if (!enable_overscan)
|
||||
xs_temp -= 16;
|
||||
|
||||
if (((xs_temp != xsize) || (ys_temp != ysize) || video_force_resize_get())) {
|
||||
if ((xs_temp != xsize) || (ys_temp != ysize) || video_force_resize_get()) {
|
||||
xsize = xs_temp;
|
||||
ysize = ys_temp;
|
||||
set_screen_size(xsize, ysize + (enable_overscan ? 16 : 0));
|
||||
@@ -1021,7 +1033,7 @@ vid_poll(void *priv)
|
||||
vid->sc &= 31;
|
||||
vid->ma = vid->maback;
|
||||
}
|
||||
if ((vid->sc == (vid->crtc[10] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[10] & 31) >> 1))))
|
||||
if (vid->sc == (vid->crtc[10] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[10] & 31) >> 1)))
|
||||
vid->con = 1;
|
||||
}
|
||||
}
|
||||
@@ -1139,7 +1151,7 @@ const device_t vid_device_sl = {
|
||||
};
|
||||
|
||||
static void
|
||||
eep_write(uint16_t addr, uint8_t val, void *priv)
|
||||
eep_write(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
{
|
||||
t1keep_t *eep = (t1keep_t *) priv;
|
||||
|
||||
@@ -1166,6 +1178,9 @@ eep_write(uint16_t addr, uint8_t val, void *priv)
|
||||
eep->state = EEPROM_GET_OPERATION;
|
||||
eep->count = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1211,6 +1226,9 @@ eep_write(uint16_t addr, uint8_t val, void *priv)
|
||||
eep->store[eep->addr] = eep->data;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
eep->clk = val & 4;
|
||||
@@ -1233,6 +1251,9 @@ eep_init(const device_t *info)
|
||||
case TYPE_TANDY1000SL2:
|
||||
eep->path = "tandy1000sl2.bin";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
f = nvr_fopen(eep->path, "rb");
|
||||
@@ -1319,6 +1340,10 @@ tandy_write(uint16_t addr, uint8_t val, void *priv)
|
||||
dev->rom_offset = ((val ^ 4) & 7) * 0x10000;
|
||||
mem_mapping_set_exec(&dev->rom_mapping,
|
||||
&dev->rom[dev->rom_offset]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1340,6 +1365,9 @@ tandy_read(uint16_t addr, void *priv)
|
||||
case 0xffea:
|
||||
ret = (dev->rom_bank ^ 0x10);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1475,6 +1503,9 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
device_add(&pssj_device);
|
||||
device_add(&eep_1000sl2_device);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
@@ -52,7 +52,7 @@ int
|
||||
machine_v86p_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
int rom = 0;
|
||||
int rom_id = 0;
|
||||
|
||||
ret = bios_load_interleavedr("roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_122089_Even.rom",
|
||||
"roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_122089_Odd.rom",
|
||||
@@ -60,7 +60,7 @@ machine_v86p_init(const machine_t *model)
|
||||
|
||||
if (!ret) {
|
||||
/* Try an older version of the BIOS. */
|
||||
rom = 1;
|
||||
rom_id = 1;
|
||||
ret = bios_load_interleavedr("roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_090489_Even.rom",
|
||||
"roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_090489_Odd.rom",
|
||||
0x000f8000, 65536, 0);
|
||||
@@ -68,7 +68,7 @@ machine_v86p_init(const machine_t *model)
|
||||
|
||||
if (!ret) {
|
||||
/* Try JVERNET's BIOS. */
|
||||
rom = 2;
|
||||
rom_id = 2;
|
||||
ret = bios_load_linear("roms/machines/v86p/V86P.ROM",
|
||||
0x000f0000, 65536, 0);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ machine_v86p_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (rom == 2)
|
||||
if (rom_id == 2)
|
||||
loadfont("roms/machines/v86p/V86P.FON", 8);
|
||||
else
|
||||
loadfont("roms/machines/v86p/v86pfont.rom", 8);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
static int laserxt_emspage[4];
|
||||
static int laserxt_emscontrol[4];
|
||||
@@ -37,7 +38,7 @@ get_laserxt_ems_addr(uint32_t addr)
|
||||
}
|
||||
|
||||
static void
|
||||
laserxt_write(uint16_t port, uint8_t val, void *priv)
|
||||
laserxt_write(uint16_t port, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
uint32_t paddr;
|
||||
uint32_t vaddr;
|
||||
@@ -73,11 +74,14 @@ laserxt_write(uint16_t port, uint8_t val, void *priv)
|
||||
mem_mapping_set_addr(&laserxt_ems_mapping[3], 0xCC000 + (((laserxt_ems_baseaddr_index + 1) & 0x0C) << 14), 0x4000);
|
||||
flushmmucache();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
laserxt_read(uint16_t port, void *priv)
|
||||
laserxt_read(uint16_t port, UNUSED(void *priv))
|
||||
{
|
||||
switch (port) {
|
||||
case 0x0208:
|
||||
@@ -90,13 +94,15 @@ laserxt_read(uint16_t port, void *priv)
|
||||
case 0x8209:
|
||||
case 0xC209:
|
||||
return laserxt_emscontrol[port >> 14];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
static void
|
||||
mem_write_laserxtems(uint32_t addr, uint8_t val, void *priv)
|
||||
mem_write_laserxtems(uint32_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
addr = get_laserxt_ems_addr(addr);
|
||||
if (addr < (mem_size << 10))
|
||||
@@ -104,7 +110,7 @@ mem_write_laserxtems(uint32_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
mem_read_laserxtems(uint32_t addr, void *priv)
|
||||
mem_read_laserxtems(uint32_t addr, UNUSED(void *priv))
|
||||
{
|
||||
uint8_t val = 0xFF;
|
||||
addr = get_laserxt_ems_addr(addr);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include <86box/vid_ogc.h>
|
||||
#include <86box/vid_colorplus.h>
|
||||
#include <86box/vid_cga_comp.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
@@ -115,7 +116,7 @@ enum MM58274_ADDR {
|
||||
|
||||
static struct tm intclk;
|
||||
|
||||
typedef struct {
|
||||
typedef struct m24_kbd_t {
|
||||
/* Keyboard stuff. */
|
||||
int wantirq;
|
||||
uint8_t command;
|
||||
@@ -123,18 +124,20 @@ typedef struct {
|
||||
uint8_t out;
|
||||
uint8_t output_port;
|
||||
uint8_t id;
|
||||
int param,
|
||||
param_total;
|
||||
int param;
|
||||
int param_total;
|
||||
uint8_t params[16];
|
||||
uint8_t scan[7];
|
||||
|
||||
/* Mouse stuff. */
|
||||
int mouse_mode;
|
||||
int x, y, b;
|
||||
int x;
|
||||
int y;
|
||||
int b;
|
||||
pc_timer_t send_delay_timer;
|
||||
} m24_kbd_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct m19_vid_t {
|
||||
ogc_t ogc;
|
||||
colorplus_t colorplus;
|
||||
int mode;
|
||||
@@ -635,6 +638,10 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
if (val == 0x02)
|
||||
m24_kbd_adddata(0x00);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,7 +732,7 @@ m24_kbd_reset(void *priv)
|
||||
}
|
||||
|
||||
static int
|
||||
ms_poll(int x, int y, int z, int b, void *priv)
|
||||
ms_poll(int x, int y, UNUSED(int z), int b, void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *) priv;
|
||||
|
||||
@@ -1492,12 +1499,16 @@ m19_vid_init(m19_vid_t *vid)
|
||||
{
|
||||
device_context(&m19_vid_device);
|
||||
|
||||
/* int display_type; */
|
||||
#if 0
|
||||
int display_type;
|
||||
#endif
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m19_vid);
|
||||
|
||||
/* display_type = device_get_config_int("display_type"); */
|
||||
#if 0
|
||||
display_type = device_get_config_int("display_type");
|
||||
#endif
|
||||
|
||||
/* OGC emulation part begin */
|
||||
loadfont_ex("roms/machines/m19/BIOS.BIN", 1, 90);
|
||||
@@ -1508,7 +1519,9 @@ m19_vid_init(m19_vid_t *vid)
|
||||
|
||||
vid->ogc.cga.vram = malloc(0x8000);
|
||||
|
||||
/* cga_comp_init(vid->ogc.cga.revision); */
|
||||
#if 0
|
||||
cga_comp_init(vid->ogc.cga.revision);
|
||||
#endif
|
||||
|
||||
vid->ogc.cga.rgb_type = device_get_config_int("rgb_type");
|
||||
cga_palette = (vid->ogc.cga.rgb_type << 1);
|
||||
@@ -1525,11 +1538,15 @@ m19_vid_init(m19_vid_t *vid)
|
||||
/* Plantronics emulation part begin*/
|
||||
/* composite is not working yet */
|
||||
vid->colorplus.cga.composite = 0; //(display_type != CGA_RGB);
|
||||
/* vid->colorplus.cga.snow_enabled = device_get_config_int("snow_enabled"); */
|
||||
#if 0
|
||||
vid->colorplus.cga.snow_enabled = device_get_config_int("snow_enabled");
|
||||
#endif
|
||||
|
||||
vid->colorplus.cga.vram = malloc(0x8000);
|
||||
|
||||
/* vid->colorplus.cga.cgamode = 0x1; */
|
||||
#if 0
|
||||
vid->colorplus.cga.cgamode = 0x1;
|
||||
#endif
|
||||
/* Plantronics emulation part end*/
|
||||
|
||||
timer_add(&vid->ogc.cga.timer, ogc_poll, &vid->ogc, 1);
|
||||
@@ -1602,7 +1619,7 @@ const device_t m19_vid_device = {
|
||||
};
|
||||
|
||||
static uint8_t
|
||||
m24_read(uint16_t port, void *priv)
|
||||
m24_read(uint16_t port, UNUSED(void *priv))
|
||||
{
|
||||
uint8_t ret = 0x00;
|
||||
int fdd_count = 0;
|
||||
@@ -1706,13 +1723,16 @@ m24_read(uint16_t port, void *priv)
|
||||
/* 1 = 720 kB (3.5"), 0 = 360 kB (5.25") */
|
||||
ret |= (fdd_doublestep_40(0) || fdd_doublestep_40(1)) ? 0x1 : 0x0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
m240_read(uint16_t port, void *priv)
|
||||
m240_read(uint16_t port, UNUSED(void *priv))
|
||||
{
|
||||
uint8_t ret = 0x00;
|
||||
int fdd_count = 0;
|
||||
@@ -1761,6 +1781,9 @@ m240_read(uint16_t port, void *priv)
|
||||
ret |= fdd_doublestep_40(1) ? 0x40 : 0x00;
|
||||
ret |= fdd_doublestep_40(0) ? 0x20 : 0x00;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct philips_t {
|
||||
uint8_t reg;
|
||||
} philips_t;
|
||||
|
||||
@@ -80,6 +80,9 @@ philips_write(uint16_t port, uint8_t val, void *priv)
|
||||
else
|
||||
cpu_dynamic_switch(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
philips_log("Philips XT Mainboard: Write %02x at %02x\n", val, port);
|
||||
@@ -100,6 +103,9 @@ philips_read(uint16_t port, void *priv)
|
||||
case 0xc0:
|
||||
ret = dev->reg;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
philips_log("Philips XT Mainboard: Read %02x at %02x\n", ret, port);
|
||||
@@ -116,7 +122,7 @@ philips_close(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
philips_init(const device_t *info)
|
||||
philips_init(UNUSED(const device_t *info))
|
||||
{
|
||||
philips_t *dev = (philips_t *) malloc(sizeof(philips_t));
|
||||
memset(dev, 0, sizeof(philips_t));
|
||||
|
||||
@@ -135,7 +135,7 @@ enum TC8521_ADDR {
|
||||
TC8521_LEAPYEAR = 0x1B
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct t1000_t {
|
||||
/* ROM drive */
|
||||
uint8_t *romdrive;
|
||||
uint8_t rom_ctl;
|
||||
@@ -237,7 +237,7 @@ tc8521_time_get(uint8_t *regs, struct tm *tm)
|
||||
|
||||
/* This is called every second through the NVR/RTC hook. */
|
||||
static void
|
||||
tc8521_tick(nvr_t *nvr)
|
||||
tc8521_tick(UNUSED(nvr_t *nvr))
|
||||
{
|
||||
t1000_log("TC8521: ping\n");
|
||||
}
|
||||
@@ -336,7 +336,7 @@ tc8521_init(nvr_t *nvr, int size)
|
||||
|
||||
/* Given an EMS page ID, return its physical address in RAM. */
|
||||
static uint32_t
|
||||
ems_execaddr(t1000_t *sys, int pg, uint16_t val)
|
||||
ems_execaddr(t1000_t *sys, UNUSED(int pg), uint16_t val)
|
||||
{
|
||||
if (!(val & 0x80))
|
||||
return 0; /* Bit 7 reset => not mapped */
|
||||
@@ -595,6 +595,9 @@ read_ctl(uint16_t addr, void *priv)
|
||||
case 0x52:
|
||||
ret = (sys->is_640k ? 0x80 : 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -656,8 +659,14 @@ write_ctl(uint16_t addr, uint8_t val, void *priv)
|
||||
case 0x52:
|
||||
ems_set_640k(sys, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -689,6 +698,9 @@ t1000_read_nvram(uint16_t addr, void *priv)
|
||||
tmp |= 0x2e; /* Bits 5, 3, 2, 1 always 1 */
|
||||
tmp |= (sys->nvr_active & 0x40) >> 6; /* Ready state */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
@@ -733,6 +745,9 @@ t1000_write_nvram(uint16_t addr, uint8_t val, void *priv)
|
||||
if (val == 0x80)
|
||||
sys->nvr_addr = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,7 +772,7 @@ write_t1200_nvram(uint32_t addr, uint8_t value, void *priv)
|
||||
|
||||
/* Port 0xC8 controls the ROM drive */
|
||||
static uint8_t
|
||||
t1000_read_rom_ctl(uint16_t addr, void *priv)
|
||||
t1000_read_rom_ctl(UNUSED(uint16_t addr), void *priv)
|
||||
{
|
||||
t1000_t *sys = (t1000_t *) priv;
|
||||
|
||||
@@ -765,7 +780,7 @@ t1000_read_rom_ctl(uint16_t addr, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
t1000_write_rom_ctl(uint16_t addr, uint8_t val, void *priv)
|
||||
t1000_write_rom_ctl(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
{
|
||||
t1000_t *sys = (t1000_t *) priv;
|
||||
|
||||
|
||||
@@ -51,12 +51,14 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/m_xt_t1000.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define T1000_XSIZE 640
|
||||
#define T1000_YSIZE 200
|
||||
|
||||
/* Mapping of attributes to colours */
|
||||
static uint32_t blue, grey;
|
||||
static uint32_t blue;
|
||||
static uint32_t grey;
|
||||
static uint8_t boldcols[256]; /* Which attributes use the bold font */
|
||||
static uint32_t blinkcols[256][2];
|
||||
static uint32_t normcols[256][2];
|
||||
@@ -124,14 +126,14 @@ typedef struct t1000_t {
|
||||
} t1000_t;
|
||||
|
||||
static void t1000_recalctimings(t1000_t *t1000);
|
||||
static void t1000_write(uint32_t addr, uint8_t val, void *p);
|
||||
static uint8_t t1000_read(uint32_t addr, void *p);
|
||||
static void t1000_write(uint32_t addr, uint8_t val, void *priv);
|
||||
static uint8_t t1000_read(uint32_t addr, void *priv);
|
||||
static void t1000_recalcattrs(t1000_t *t1000);
|
||||
|
||||
static void
|
||||
t1000_out(uint16_t addr, uint8_t val, void *p)
|
||||
t1000_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
switch (addr) {
|
||||
/* Emulated CRTC, register select */
|
||||
case 0x3d0:
|
||||
@@ -158,21 +160,20 @@ t1000_out(uint16_t addr, uint8_t val, void *p)
|
||||
t1000_recalctimings(t1000);
|
||||
return;
|
||||
|
||||
/* CGA control register */
|
||||
case 0x3D8:
|
||||
cga_out(addr, val, &t1000->cga);
|
||||
return;
|
||||
/* CGA colour register */
|
||||
case 0x3D9:
|
||||
case 0x3D8: /* CGA control register */
|
||||
case 0x3D9: /* CGA colour register */
|
||||
cga_out(addr, val, &t1000->cga);
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
t1000_in(uint16_t addr, void *p)
|
||||
t1000_in(uint16_t addr, void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
uint8_t val;
|
||||
|
||||
switch (addr) {
|
||||
@@ -186,24 +187,29 @@ t1000_in(uint16_t addr, void *p)
|
||||
val |= 0x20; /* LCD / CRT */
|
||||
return val;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return cga_in(addr, &t1000->cga);
|
||||
}
|
||||
|
||||
static void
|
||||
t1000_write(uint32_t addr, uint8_t val, void *p)
|
||||
t1000_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
|
||||
t1000->vram[addr & 0x3fff] = val;
|
||||
cycles -= 4;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
t1000_read(uint32_t addr, void *p)
|
||||
t1000_read(uint32_t addr, void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
|
||||
cycles -= 4;
|
||||
|
||||
return t1000->vram[addr & 0x3fff];
|
||||
@@ -213,7 +219,8 @@ static void
|
||||
t1000_recalctimings(t1000_t *t1000)
|
||||
{
|
||||
double disptime;
|
||||
double _dispontime, _dispofftime;
|
||||
double _dispontime;
|
||||
double _dispofftime;
|
||||
|
||||
if (!t1000->internal) {
|
||||
cga_recalctimings(&t1000->cga);
|
||||
@@ -231,7 +238,6 @@ static void
|
||||
t1000_text_row80(t1000_t *t1000)
|
||||
{
|
||||
uint32_t cols[2];
|
||||
int c;
|
||||
uint8_t chr;
|
||||
uint8_t attr;
|
||||
int drawcursor;
|
||||
@@ -277,12 +283,12 @@ t1000_text_row80(t1000_t *t1000)
|
||||
cols[0] = normcols[attr][0];
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t1000->displine])[(x << 3) + c] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (blue ^ grey);
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
(buffer32->line[t1000->displine])[(x << 3) + c] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (blue ^ grey);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *) buffer32->line[t1000->displine])[(x << 3) + c] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
for (uint8_t c = 0; c < 8; c++)
|
||||
(buffer32->line[t1000->displine])[(x << 3) + c] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
++ma;
|
||||
}
|
||||
@@ -293,8 +299,8 @@ static void
|
||||
t1000_text_row40(t1000_t *t1000)
|
||||
{
|
||||
uint32_t cols[2];
|
||||
int x, c;
|
||||
uint8_t chr, attr;
|
||||
uint8_t chr;
|
||||
uint8_t attr;
|
||||
int drawcursor;
|
||||
int cursorline;
|
||||
int bold;
|
||||
@@ -313,7 +319,7 @@ t1000_text_row40(t1000_t *t1000)
|
||||
} else {
|
||||
cursorline = ((t1000->cga.crtc[10] & 0x0F) <= sc) && ((t1000->cga.crtc[11] & 0x0F) >= sc);
|
||||
}
|
||||
for (x = 0; x < 40; x++) {
|
||||
for (uint8_t x = 0; x < 40; x++) {
|
||||
chr = t1000->vram[(addr + 2 * x) & 0x3FFF];
|
||||
attr = t1000->vram[(addr + 2 * x + 1) & 0x3FFF];
|
||||
drawcursor = ((ma == ca) && cursorline && (t1000->cga.cgamode & 8) && (t1000->cga.cgablink & 16));
|
||||
@@ -338,12 +344,12 @@ t1000_text_row40(t1000_t *t1000)
|
||||
cols[0] = normcols[attr][0];
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t1000->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t1000->displine])[(x << 4) + c * 2 + 1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (blue ^ grey);
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
(buffer32->line[t1000->displine])[(x << 4) + c * 2] = (buffer32->line[t1000->displine])[(x << 4) + c * 2 + 1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (blue ^ grey);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *) buffer32->line[t1000->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t1000->displine])[(x << 4) + c * 2 + 1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
(buffer32->line[t1000->displine])[(x << 4) + c * 2] = (buffer32->line[t1000->displine])[(x << 4) + c * 2 + 1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
++ma;
|
||||
@@ -354,7 +360,6 @@ t1000_text_row40(t1000_t *t1000)
|
||||
static void
|
||||
t1000_cgaline6(t1000_t *t1000)
|
||||
{
|
||||
int x, c;
|
||||
uint8_t dat;
|
||||
uint32_t ink = 0;
|
||||
uint16_t addr;
|
||||
@@ -365,15 +370,15 @@ t1000_cgaline6(t1000_t *t1000)
|
||||
|
||||
addr = ((t1000->displine) & 1) * 0x2000 + (t1000->displine >> 1) * 80 + ((ma & ~1) << 1);
|
||||
|
||||
for (x = 0; x < 80; x++) {
|
||||
for (uint8_t x = 0; x < 80; x++) {
|
||||
dat = t1000->vram[addr & 0x3FFF];
|
||||
addr++;
|
||||
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
ink = (dat & 0x80) ? fg : bg;
|
||||
if (!(t1000->cga.cgamode & 8))
|
||||
ink = grey;
|
||||
((uint32_t *) buffer32->line[t1000->displine])[x * 8 + c] = ink;
|
||||
(buffer32->line[t1000->displine])[x * 8 + c] = ink;
|
||||
dat = dat << 1;
|
||||
}
|
||||
}
|
||||
@@ -384,19 +389,20 @@ t1000_cgaline6(t1000_t *t1000)
|
||||
static void
|
||||
t1000_cgaline4(t1000_t *t1000)
|
||||
{
|
||||
int x, c;
|
||||
uint8_t dat, pattern;
|
||||
uint32_t ink0, ink1;
|
||||
uint8_t dat;
|
||||
uint8_t pattern;
|
||||
uint32_t ink0;
|
||||
uint32_t ink1;
|
||||
uint16_t addr;
|
||||
|
||||
uint16_t ma = (t1000->cga.crtc[13] | (t1000->cga.crtc[12] << 8)) & 0x3fff;
|
||||
addr = ((t1000->displine) & 1) * 0x2000 + (t1000->displine >> 1) * 80 + ((ma & ~1) << 1);
|
||||
|
||||
for (x = 0; x < 80; x++) {
|
||||
for (uint8_t x = 0; x < 80; x++) {
|
||||
dat = t1000->vram[addr & 0x3FFF];
|
||||
addr++;
|
||||
|
||||
for (c = 0; c < 4; c++) {
|
||||
for (uint8_t c = 0; c < 4; c++) {
|
||||
pattern = (dat & 0xC0) >> 6;
|
||||
if (!(t1000->cga.cgamode & 8))
|
||||
pattern = 0;
|
||||
@@ -428,17 +434,17 @@ t1000_cgaline4(t1000_t *t1000)
|
||||
ink0 = ink1 = blue;
|
||||
break;
|
||||
}
|
||||
((uint32_t *) buffer32->line[t1000->displine])[x * 8 + 2 * c] = ink0;
|
||||
((uint32_t *) buffer32->line[t1000->displine])[x * 8 + 2 * c + 1] = ink1;
|
||||
dat = dat << 2;
|
||||
(buffer32->line[t1000->displine])[x * 8 + 2 * c] = ink0;
|
||||
(buffer32->line[t1000->displine])[x * 8 + 2 * c + 1] = ink1;
|
||||
dat = dat << 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
t1000_poll(void *p)
|
||||
t1000_poll(void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
|
||||
if (t1000->video_options != st_video_options || t1000->enabled != st_enabled) {
|
||||
t1000->video_options = st_video_options;
|
||||
@@ -643,7 +649,7 @@ t1000_recalcattrs(t1000_t *t1000)
|
||||
}
|
||||
|
||||
static void *
|
||||
t1000_init(const device_t *info)
|
||||
t1000_init(UNUSED(const device_t *info))
|
||||
{
|
||||
t1000_t *t1000 = malloc(sizeof(t1000_t));
|
||||
memset(t1000, 0, sizeof(t1000_t));
|
||||
@@ -681,18 +687,18 @@ t1000_init(const device_t *info)
|
||||
}
|
||||
|
||||
static void
|
||||
t1000_close(void *p)
|
||||
t1000_close(void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
|
||||
free(t1000->vram);
|
||||
free(t1000);
|
||||
}
|
||||
|
||||
static void
|
||||
t1000_speed_changed(void *p)
|
||||
t1000_speed_changed(void *priv)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *) p;
|
||||
t1000_t *t1000 = (t1000_t *) priv;
|
||||
|
||||
t1000_recalctimings(t1000);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#include <86box/m_xt_xi8088.h>
|
||||
|
||||
@@ -67,7 +68,7 @@ xi8088_bios_128kb(void)
|
||||
}
|
||||
|
||||
static void *
|
||||
xi8088_init(const device_t *info)
|
||||
xi8088_init(UNUSED(const device_t *info))
|
||||
{
|
||||
xi8088.turbo = 1;
|
||||
xi8088.turbo_setting = device_get_config_int("turbo_setting");
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <86box/machine.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
typedef struct {
|
||||
mem_mapping_t scratchpad_mapping;
|
||||
@@ -53,21 +54,21 @@ typedef struct {
|
||||
} zenith_t;
|
||||
|
||||
static uint8_t
|
||||
zenith_scratchpad_read(uint32_t addr, void *p)
|
||||
zenith_scratchpad_read(uint32_t addr, void *priv)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
zenith_t *dev = (zenith_t *) priv;
|
||||
return dev->scratchpad_ram[addr & 0x3fff];
|
||||
}
|
||||
|
||||
static void
|
||||
zenith_scratchpad_write(uint32_t addr, uint8_t val, void *p)
|
||||
zenith_scratchpad_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
zenith_t *dev = (zenith_t *) priv;
|
||||
dev->scratchpad_ram[addr & 0x3fff] = val;
|
||||
}
|
||||
|
||||
static void *
|
||||
zenith_scratchpad_init(const device_t *info)
|
||||
zenith_scratchpad_init(UNUSED(const device_t *info))
|
||||
{
|
||||
zenith_t *dev;
|
||||
|
||||
@@ -85,9 +86,9 @@ zenith_scratchpad_init(const device_t *info)
|
||||
}
|
||||
|
||||
static void
|
||||
zenith_scratchpad_close(void *p)
|
||||
zenith_scratchpad_close(void *priv)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
zenith_t *dev = (zenith_t *) priv;
|
||||
|
||||
free(dev->scratchpad_ram);
|
||||
free(dev);
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <86box/machine.h>
|
||||
#include <86box/isamem.h>
|
||||
#include <86box/pci.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
int bios_only = 0;
|
||||
int machine;
|
||||
@@ -78,8 +79,10 @@ machine_init_ex(int m)
|
||||
gameport_instance_id = 0;
|
||||
|
||||
/* Set up the architecture flags. */
|
||||
// AT = IS_AT(machine);
|
||||
// PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
|
||||
#if 0
|
||||
AT = IS_AT(machine);
|
||||
PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
|
||||
#endif
|
||||
|
||||
cpu_set();
|
||||
pc_speed_changed();
|
||||
@@ -141,14 +144,14 @@ int
|
||||
machine_available(int m)
|
||||
{
|
||||
int ret;
|
||||
device_t *d = (device_t *) machine_get_device(m);
|
||||
device_t *dev = (device_t *) machine_get_device(m);
|
||||
|
||||
bios_only = 1;
|
||||
|
||||
ret = device_available(d);
|
||||
ret = device_available(dev);
|
||||
/* Do not check via machine_init_ex() if the device is not NULL and
|
||||
it has a CONFIG_BIOS field. */
|
||||
if ((d == NULL) || (ret != -1))
|
||||
if ((dev == NULL) || (ret != -1))
|
||||
ret = machine_init_ex(m);
|
||||
|
||||
bios_only = 0;
|
||||
@@ -167,7 +170,7 @@ pit_irq0_timer(int new_out, int old_out)
|
||||
}
|
||||
|
||||
void
|
||||
machine_common_init(const machine_t *model)
|
||||
machine_common_init(UNUSED(const machine_t *model))
|
||||
{
|
||||
/* System devices first. */
|
||||
pic_init();
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
// Temporarily here till we move everything out into the right files
|
||||
extern const device_t pcjr_device;
|
||||
@@ -12953,7 +12954,7 @@ machine_get_p1(void)
|
||||
}
|
||||
|
||||
void
|
||||
machine_load_p1(int m)
|
||||
machine_load_p1(UNUSED(int m))
|
||||
{
|
||||
machine_p1 = machines[machine].kbc_p1;
|
||||
}
|
||||
@@ -12965,7 +12966,7 @@ machine_get_gpio(void)
|
||||
}
|
||||
|
||||
void
|
||||
machine_load_gpio(int m)
|
||||
machine_load_gpio(UNUSED(int m))
|
||||
{
|
||||
machine_gpio = machines[machine].gpio;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user