Re-integrated the Amstrad machines.
This commit is contained in:
@@ -1347,7 +1347,7 @@ uint8_t fdc_read(uint16_t addr, void *priv)
|
|||||||
else if (fdd_is_ed(drive))
|
else if (fdd_is_ed(drive))
|
||||||
temp = 0x10;
|
temp = 0x10;
|
||||||
else
|
else
|
||||||
temp = 0x30;
|
temp = 0x00;
|
||||||
}
|
}
|
||||||
else if (!fdc.enh_mode)
|
else if (!fdc.enh_mode)
|
||||||
temp = 0x20;
|
temp = 0x20;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Definitions for the keyboard interface.
|
* Definitions for the keyboard interface.
|
||||||
*
|
*
|
||||||
* Version: @(#)keyboard.h 1.0.5 2017/11/03
|
* Version: @(#)keyboard.h 1.0.6 2017/11/06
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -38,6 +38,8 @@ extern int64_t keyboard_delay;
|
|||||||
|
|
||||||
extern void (*keyboard_send)(uint8_t val);
|
extern void (*keyboard_send)(uint8_t val);
|
||||||
|
|
||||||
|
extern scancode scancode_xt[272];
|
||||||
|
|
||||||
extern uint8_t keyboard_set3_flags[272];
|
extern uint8_t keyboard_set3_flags[272];
|
||||||
extern uint8_t keyboard_set3_all_repeat;
|
extern uint8_t keyboard_set3_all_repeat;
|
||||||
extern uint8_t keyboard_set3_all_break;
|
extern uint8_t keyboard_set3_all_break;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the XT-style keyboard.
|
* Implementation of the XT-style keyboard.
|
||||||
*
|
*
|
||||||
* Version: @(#)keyboard_xt.c 1.0.2 2017/11/04
|
* Version: @(#)keyboard_xt.c 1.0.3 2017/11/06
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -61,7 +61,7 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
/*XT keyboard has no escape scancodes, and no scancodes beyond 53*/
|
/*XT keyboard has no escape scancodes, and no scancodes beyond 53*/
|
||||||
static scancode scancode_xt[272] = {
|
scancode scancode_xt[272] = {
|
||||||
{ {-1}, {-1} }, { {0x01, -1}, {0x81, -1} },
|
{ {-1}, {-1} }, { {0x01, -1}, {0x81, -1} },
|
||||||
{ {0x02, -1}, {0x82, -1} }, { {0x03, -1}, {0x83, -1} },
|
{ {0x02, -1}, {0x82, -1} }, { {0x03, -1}, {0x83, -1} },
|
||||||
{ {0x04, -1}, {0x84, -1} }, { {0x05, -1}, {0x85, -1} },
|
{ {0x04, -1}, {0x84, -1} }, { {0x05, -1}, {0x85, -1} },
|
||||||
|
|||||||
@@ -6,9 +6,28 @@
|
|||||||
*
|
*
|
||||||
* This file is part of the 86Box distribution.
|
* This file is part of the 86Box distribution.
|
||||||
*
|
*
|
||||||
* Emulation of the Amstrad series PC's.
|
* Emulation of the Amstrad series of PC's.
|
||||||
*
|
*
|
||||||
* Version: @(#)m_amstrad.c 1.0.2 2017/11/03
|
* The module supports the PC1512, PC1640 and PC200, including
|
||||||
|
* their keyboard, mouse and video devices.
|
||||||
|
*
|
||||||
|
* PC1512: The PC1512 extends CGA with a bit-planar 640x200x16 mode.
|
||||||
|
* Most CRTC registers are fixed.
|
||||||
|
*
|
||||||
|
* The Technical Reference Manual lists the video waitstate
|
||||||
|
* time as between 12 and 46 cycles. We currently always use
|
||||||
|
* the lower number.
|
||||||
|
*
|
||||||
|
* PC1640: Mostly standard EGA, but with CGA & Hercules emulation.
|
||||||
|
*
|
||||||
|
* PC200: CGA with some NMI stuff. But we don't need that as it's only
|
||||||
|
* used for TV and LCD displays, and we're emulating a CRT.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* TODO: EGA mode does not seem to work in the PC1640; it displays some
|
||||||
|
* semi-random junk. Video-memory pointer maybe?
|
||||||
|
*
|
||||||
|
* Version: @(#)m_amstrad.c 1.0.3 2017/11/08
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -24,6 +43,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include "../86box.h"
|
#include "../86box.h"
|
||||||
|
#include "../cpu/cpu.h"
|
||||||
#include "../io.h"
|
#include "../io.h"
|
||||||
#include "../nmi.h"
|
#include "../nmi.h"
|
||||||
#include "../pic.h"
|
#include "../pic.h"
|
||||||
@@ -38,14 +58,21 @@
|
|||||||
#include "../mouse.h"
|
#include "../mouse.h"
|
||||||
#include "../game/gameport.h"
|
#include "../game/gameport.h"
|
||||||
#include "../lpt.h"
|
#include "../lpt.h"
|
||||||
#include "../sound/sound.h"
|
|
||||||
#include "../sound/snd_speaker.h"
|
|
||||||
#include "../floppy/floppy.h"
|
#include "../floppy/floppy.h"
|
||||||
#include "../floppy/fdd.h"
|
#include "../floppy/fdd.h"
|
||||||
#include "../floppy/fdc.h"
|
#include "../floppy/fdc.h"
|
||||||
|
#include "../sound/sound.h"
|
||||||
|
#include "../sound/snd_speaker.h"
|
||||||
|
#include "../video/video.h"
|
||||||
|
#include "../video/vid_cga.h"
|
||||||
|
#include "../video/vid_ega.h"
|
||||||
|
#include "../video/vid_paradise.h"
|
||||||
#include "machine.h"
|
#include "machine.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define BIOS_1640_PATH L"roms/machines/pc1640/40100"
|
||||||
|
|
||||||
|
|
||||||
#define STAT_PARITY 0x80
|
#define STAT_PARITY 0x80
|
||||||
#define STAT_RTIMEOUT 0x40
|
#define STAT_RTIMEOUT 0x40
|
||||||
#define STAT_TTIMEOUT 0x20
|
#define STAT_TTIMEOUT 0x20
|
||||||
@@ -56,6 +83,41 @@
|
|||||||
#define STAT_OFULL 0x01
|
#define STAT_OFULL 0x01
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
mem_mapping_t cga_map; /* 1512/1640/200 */
|
||||||
|
mem_mapping_t ega_map; /* 1640 */
|
||||||
|
rom_t bios_rom; /* 1640 */
|
||||||
|
cga_t cga; /* 1640/200 */
|
||||||
|
ega_t ega; /* 1640 */
|
||||||
|
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 */
|
||||||
|
int linepos,
|
||||||
|
displine;
|
||||||
|
int sc, vc;
|
||||||
|
int cgadispon;
|
||||||
|
int con, coff,
|
||||||
|
cursoron,
|
||||||
|
cgablink;
|
||||||
|
int64_t vsynctime;
|
||||||
|
int vadj;
|
||||||
|
uint16_t ma, maback;
|
||||||
|
int dispon;
|
||||||
|
int blink;
|
||||||
|
int64_t dispontime, /* 1512/1640 */
|
||||||
|
dispofftime; /* 1512/1640 */
|
||||||
|
int64_t vidtime; /* 1512/1640 */
|
||||||
|
int firstline,
|
||||||
|
lastline;
|
||||||
|
uint8_t *vram;
|
||||||
|
} amsvid_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Machine stuff. */
|
/* Machine stuff. */
|
||||||
uint8_t dead;
|
uint8_t dead;
|
||||||
@@ -72,12 +134,741 @@ typedef struct {
|
|||||||
uint8_t mousex,
|
uint8_t mousex,
|
||||||
mousey;
|
mousey;
|
||||||
int oldb;
|
int oldb;
|
||||||
|
|
||||||
|
/* Video stuff. */
|
||||||
|
amsvid_t *vid;
|
||||||
} amstrad_t;
|
} amstrad_t;
|
||||||
|
|
||||||
|
|
||||||
static uint8_t key_queue[16];
|
static uint8_t key_queue[16];
|
||||||
static int key_queue_start = 0,
|
static int key_queue_start = 0,
|
||||||
key_queue_end = 0;
|
key_queue_end = 0;
|
||||||
|
static uint8_t crtc_mask[32] = {
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f,
|
||||||
|
0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
|
||||||
|
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
recalc_timings_1512(amsvid_t *vid)
|
||||||
|
{
|
||||||
|
double _dispontime, _dispofftime, disptime;
|
||||||
|
|
||||||
|
disptime = 128; /*Fixed on PC1512*/
|
||||||
|
_dispontime = 80;
|
||||||
|
_dispofftime = disptime - _dispontime;
|
||||||
|
_dispontime *= CGACONST;
|
||||||
|
_dispofftime *= CGACONST;
|
||||||
|
vid->dispontime = (int64_t)(_dispontime * (1 << TIMER_SHIFT));
|
||||||
|
vid->dispofftime = (int64_t)(_dispofftime * (1 << TIMER_SHIFT));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_out_1512(uint16_t addr, uint8_t val, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
uint8_t old;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case 0x3d4:
|
||||||
|
vid->crtcreg = val & 31;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3d5:
|
||||||
|
old = vid->crtc[vid->crtcreg];
|
||||||
|
vid->crtc[vid->crtcreg] = val & crtc_mask[vid->crtcreg];
|
||||||
|
if (old != val) {
|
||||||
|
if (vid->crtcreg < 0xe || vid->crtcreg > 0x10) {
|
||||||
|
fullchange = changeframecount;
|
||||||
|
recalc_timings_1512(vid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3d8:
|
||||||
|
if ((val & 0x12) == 0x12 && (vid->cgamode & 0x12) != 0x12) {
|
||||||
|
vid->plane_write = 0xf;
|
||||||
|
vid->plane_read = 0;
|
||||||
|
}
|
||||||
|
vid->cgamode = val;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3d9:
|
||||||
|
vid->cgacol = val;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3dd:
|
||||||
|
vid->plane_write = val;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3de:
|
||||||
|
vid->plane_read = val & 3;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3df:
|
||||||
|
vid->border = val;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static uint8_t
|
||||||
|
vid_in_1512(uint16_t addr, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
uint8_t ret = 0xff;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case 0x3d4:
|
||||||
|
ret = vid->crtcreg;
|
||||||
|
|
||||||
|
case 0x3d5:
|
||||||
|
ret = vid->crtc[vid->crtcreg];
|
||||||
|
|
||||||
|
case 0x3da:
|
||||||
|
ret = vid->stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_write_1512(uint32_t addr, uint8_t val, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
egawrites++;
|
||||||
|
cycles -= 12;
|
||||||
|
addr &= 0x3fff;
|
||||||
|
|
||||||
|
if ((vid->cgamode & 0x12) == 0x12) {
|
||||||
|
if (vid->plane_write & 1) vid->vram[addr] = val;
|
||||||
|
if (vid->plane_write & 2) vid->vram[addr | 0x4000] = val;
|
||||||
|
if (vid->plane_write & 4) vid->vram[addr | 0x8000] = val;
|
||||||
|
if (vid->plane_write & 8) vid->vram[addr | 0xc000] = val;
|
||||||
|
} else
|
||||||
|
vid->vram[addr] = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static uint8_t
|
||||||
|
vid_read_1512(uint32_t addr, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
egareads++;
|
||||||
|
cycles -= 12;
|
||||||
|
addr &= 0x3fff;
|
||||||
|
|
||||||
|
if ((vid->cgamode & 0x12) == 0x12)
|
||||||
|
return(vid->vram[addr | (vid->plane_read << 14)]);
|
||||||
|
|
||||||
|
return(vid->vram[addr]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_poll_1512(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
uint16_t ca = (vid->crtc[15] | (vid->crtc[14] << 8)) & 0x3fff;
|
||||||
|
int drawcursor;
|
||||||
|
int x, c;
|
||||||
|
uint8_t chr, attr;
|
||||||
|
uint16_t dat, dat2, dat3, dat4;
|
||||||
|
int cols[4];
|
||||||
|
int col;
|
||||||
|
int oldsc;
|
||||||
|
|
||||||
|
if (! vid->linepos) {
|
||||||
|
vid->vidtime += vid->dispofftime;
|
||||||
|
vid->stat |= 1;
|
||||||
|
vid->linepos = 1;
|
||||||
|
oldsc = vid->sc;
|
||||||
|
if (vid->dispon) {
|
||||||
|
if (vid->displine < vid->firstline) {
|
||||||
|
vid->firstline = vid->displine;
|
||||||
|
video_wait_for_buffer();
|
||||||
|
}
|
||||||
|
vid->lastline = vid->displine;
|
||||||
|
for (c = 0; c < 8; c++) {
|
||||||
|
if ((vid->cgamode & 0x12) == 0x12) {
|
||||||
|
buffer->line[vid->displine][c] = (vid->border & 15) + 16;
|
||||||
|
if (vid->cgamode & 1)
|
||||||
|
buffer->line[vid->displine][c + (vid->crtc[1] << 3) + 8] = 0;
|
||||||
|
else
|
||||||
|
buffer->line[vid->displine][c + (vid->crtc[1] << 4) + 8] = 0;
|
||||||
|
} else {
|
||||||
|
buffer->line[vid->displine][c] = (vid->cgacol & 15) + 16;
|
||||||
|
if (vid->cgamode & 1)
|
||||||
|
buffer->line[vid->displine][c + (vid->crtc[1] << 3) + 8] = (vid->cgacol & 15) + 16;
|
||||||
|
else
|
||||||
|
buffer->line[vid->displine][c + (vid->crtc[1] << 4) + 8] = (vid->cgacol & 15) + 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (vid->cgamode & 1) {
|
||||||
|
for (x = 0; x < 80; x++) {
|
||||||
|
chr = vid->vram[ ((vid->ma << 1) & 0x3fff)];
|
||||||
|
attr = vid->vram[(((vid->ma << 1) + 1) & 0x3fff)];
|
||||||
|
drawcursor = ((vid->ma == ca) && vid->con && vid->cursoron);
|
||||||
|
if (vid->cgamode & 0x20) {
|
||||||
|
cols[1] = (attr & 15) + 16;
|
||||||
|
cols[0] = ((attr >> 4) & 7) + 16;
|
||||||
|
if ((vid->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||||
|
cols[1] = cols[0];
|
||||||
|
} else {
|
||||||
|
cols[1] = (attr & 15) + 16;
|
||||||
|
cols[0] = (attr >> 4) + 16;
|
||||||
|
}
|
||||||
|
if (drawcursor) {
|
||||||
|
for (c = 0; c < 8; c++)
|
||||||
|
buffer->line[vid->displine][(x << 3) + c + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||||
|
} else {
|
||||||
|
for (c = 0; c < 8; c++)
|
||||||
|
buffer->line[vid->displine][(x << 3) + c + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||||
|
}
|
||||||
|
vid->ma++;
|
||||||
|
}
|
||||||
|
} else if (! (vid->cgamode & 2)) {
|
||||||
|
for (x = 0; x < 40; x++) {
|
||||||
|
chr = vid->vram[((vid->ma << 1) & 0x3fff)];
|
||||||
|
attr = vid->vram[(((vid->ma << 1) + 1) & 0x3fff)];
|
||||||
|
drawcursor = ((vid->ma == ca) && vid->con && vid->cursoron);
|
||||||
|
if (vid->cgamode & 0x20) {
|
||||||
|
cols[1] = (attr & 15) + 16;
|
||||||
|
cols[0] = ((attr >> 4) & 7) + 16;
|
||||||
|
if ((vid->blink & 16) && (attr & 0x80))
|
||||||
|
cols[1] = cols[0];
|
||||||
|
} else {
|
||||||
|
cols[1] = (attr & 15) + 16;
|
||||||
|
cols[0] = (attr >> 4) + 16;
|
||||||
|
}
|
||||||
|
vid->ma++;
|
||||||
|
if (drawcursor) {
|
||||||
|
for (c = 0; c < 8; c++)
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 8] =
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||||
|
} else {
|
||||||
|
for (c = 0; c < 8; c++)
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 8] =
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (! (vid->cgamode & 16)) {
|
||||||
|
cols[0] = (vid->cgacol & 15) | 16;
|
||||||
|
col = (vid->cgacol & 16) ? 24 : 16;
|
||||||
|
if (vid->cgamode & 4) {
|
||||||
|
cols[1] = col | 3;
|
||||||
|
cols[2] = col | 4;
|
||||||
|
cols[3] = col | 7;
|
||||||
|
} else if (vid->cgacol & 32) {
|
||||||
|
cols[1] = col | 3;
|
||||||
|
cols[2] = col | 5;
|
||||||
|
cols[3] = col | 7;
|
||||||
|
} else {
|
||||||
|
cols[1] = col | 2;
|
||||||
|
cols[2] = col | 4;
|
||||||
|
cols[3] = col | 6;
|
||||||
|
}
|
||||||
|
for (x = 0; x < 40; x++) {
|
||||||
|
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++) {
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 8] =
|
||||||
|
buffer->line[vid->displine][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||||
|
dat <<= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (x = 0; x < 40; x++) {
|
||||||
|
ca = ((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000);
|
||||||
|
dat = (vid->vram[ca] << 8) | vid->vram[ca + 1];
|
||||||
|
dat2 = (vid->vram[ca + 0x4000] << 8) | vid->vram[ca + 0x4001];
|
||||||
|
dat3 = (vid->vram[ca + 0x8000] << 8) | vid->vram[ca + 0x8001];
|
||||||
|
dat4 = (vid->vram[ca + 0xc000] << 8) | vid->vram[ca + 0xc001];
|
||||||
|
|
||||||
|
vid->ma++;
|
||||||
|
for (c = 0; c < 16; c++) {
|
||||||
|
buffer->line[vid->displine][(x << 4) + c + 8] = (((dat >> 15) | ((dat2 >> 15) << 1) | ((dat3 >> 15) << 2) | ((dat4 >> 15) << 3)) & (vid->cgacol & 15)) + 16;
|
||||||
|
dat <<= 1;
|
||||||
|
dat2 <<= 1;
|
||||||
|
dat3 <<= 1;
|
||||||
|
dat4 <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cols[0] = ((vid->cgamode & 0x12) == 0x12) ? 0 : (vid->cgacol & 15) + 16;
|
||||||
|
if (vid->cgamode & 1)
|
||||||
|
hline(buffer, 0, vid->displine, (vid->crtc[1] << 3) + 16, cols[0]);
|
||||||
|
else
|
||||||
|
hline(buffer, 0, vid->displine, (vid->crtc[1] << 4) + 16, cols[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
vid->sc = oldsc;
|
||||||
|
if (vid->vsynctime)
|
||||||
|
vid->stat |= 8;
|
||||||
|
vid->displine++;
|
||||||
|
if (vid->displine >= 360)
|
||||||
|
vid->displine = 0;
|
||||||
|
} else {
|
||||||
|
vid->vidtime += vid->dispontime;
|
||||||
|
if ((vid->lastline - vid->firstline) == 199)
|
||||||
|
vid->dispon = 0; /*Amstrad PC1512 always displays 200 lines, regardless of CRTC settings*/
|
||||||
|
if (vid->dispon)
|
||||||
|
vid->stat &= ~1;
|
||||||
|
vid->linepos = 0;
|
||||||
|
if (vid->vsynctime) {
|
||||||
|
vid->vsynctime--;
|
||||||
|
if (! vid->vsynctime)
|
||||||
|
vid->stat &= ~8;
|
||||||
|
}
|
||||||
|
if (vid->sc == (vid->crtc[11] & 31)) {
|
||||||
|
vid->con = 0;
|
||||||
|
vid->coff = 1;
|
||||||
|
}
|
||||||
|
if (vid->vadj) {
|
||||||
|
vid->sc++;
|
||||||
|
vid->sc &= 31;
|
||||||
|
vid->ma = vid->maback;
|
||||||
|
vid->vadj--;
|
||||||
|
if (! vid->vadj) {
|
||||||
|
vid->dispon = 1;
|
||||||
|
vid->ma = vid->maback = (vid->crtc[13] | (vid->crtc[12] << 8)) & 0x3fff;
|
||||||
|
vid->sc = 0;
|
||||||
|
}
|
||||||
|
} else if (vid->sc == vid->crtc[9]) {
|
||||||
|
vid->maback = vid->ma;
|
||||||
|
vid->sc = 0;
|
||||||
|
vid->vc++;
|
||||||
|
vid->vc &= 127;
|
||||||
|
|
||||||
|
if (vid->displine == 32) {
|
||||||
|
vid->vc = 0;
|
||||||
|
vid->vadj = 6;
|
||||||
|
if ((vid->crtc[10] & 0x60) == 0x20)
|
||||||
|
vid->cursoron = 0;
|
||||||
|
else
|
||||||
|
vid->cursoron = vid->blink & 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vid->displine >= 262) {
|
||||||
|
vid->dispon = 0;
|
||||||
|
vid->displine = 0;
|
||||||
|
vid->vsynctime = 46;
|
||||||
|
|
||||||
|
if (vid->cgamode&1)
|
||||||
|
x = (vid->crtc[1] << 3) + 16;
|
||||||
|
else
|
||||||
|
x = (vid->crtc[1] << 4) + 16;
|
||||||
|
#if 0
|
||||||
|
//FIXME: this doesnt seem right???? --FvK
|
||||||
|
x = 640 + 16;
|
||||||
|
#endif
|
||||||
|
vid->lastline++;
|
||||||
|
|
||||||
|
if ((x != xsize) || ((vid->lastline - vid->firstline) != ysize) || video_force_resize_get()) {
|
||||||
|
xsize = x;
|
||||||
|
ysize = vid->lastline - vid->firstline;
|
||||||
|
if (xsize < 64) xsize = 656;
|
||||||
|
if (ysize < 32) ysize = 200;
|
||||||
|
set_screen_size(xsize, (ysize << 1) + 16);
|
||||||
|
|
||||||
|
if (video_force_resize_get())
|
||||||
|
video_force_resize_set(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
video_blit_memtoscreen_8(0, vid->firstline - 4, 0, (vid->lastline - vid->firstline) + 8, xsize, (vid->lastline - vid->firstline) + 8);
|
||||||
|
|
||||||
|
video_res_x = xsize - 16;
|
||||||
|
video_res_y = ysize;
|
||||||
|
if (vid->cgamode & 1) {
|
||||||
|
video_res_x /= 8;
|
||||||
|
video_res_y /= vid->crtc[9] + 1;
|
||||||
|
video_bpp = 0;
|
||||||
|
} else if (! (vid->cgamode & 2)) {
|
||||||
|
video_res_x /= 16;
|
||||||
|
video_res_y /= vid->crtc[9] + 1;
|
||||||
|
video_bpp = 0;
|
||||||
|
} else if (! (vid->cgamode & 16)) {
|
||||||
|
video_res_x /= 2;
|
||||||
|
video_bpp = 2;
|
||||||
|
} else {
|
||||||
|
video_bpp = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
vid->firstline = 1000;
|
||||||
|
vid->lastline = 0;
|
||||||
|
vid->blink++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vid->sc++;
|
||||||
|
vid->sc &= 31;
|
||||||
|
vid->ma = vid->maback;
|
||||||
|
}
|
||||||
|
if (vid->sc == (vid->crtc[10] & 31))
|
||||||
|
vid->con = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_init_1512(amstrad_t *ams)
|
||||||
|
{
|
||||||
|
amsvid_t *vid;
|
||||||
|
|
||||||
|
/* Allocate a video controller block. */
|
||||||
|
vid = (amsvid_t *)malloc(sizeof(amsvid_t));
|
||||||
|
memset(vid, 0x00, sizeof(amsvid_t));
|
||||||
|
|
||||||
|
vid->vram = malloc(0x10000);
|
||||||
|
vid->cgacol = 7;
|
||||||
|
vid->cgamode = 0x12;
|
||||||
|
|
||||||
|
timer_add(vid_poll_1512, &vid->vidtime, TIMER_ALWAYS_ENABLED, vid);
|
||||||
|
mem_mapping_add(&vid->cga_map, 0xb8000, 0x08000,
|
||||||
|
vid_read_1512, NULL, NULL, vid_write_1512, NULL, NULL,
|
||||||
|
NULL, 0, vid);
|
||||||
|
io_sethandler(0x03d0, 16,
|
||||||
|
vid_in_1512, NULL, NULL, vid_out_1512, NULL, NULL, vid);
|
||||||
|
|
||||||
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
ams->vid = vid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_close_1512(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
free(vid->vram);
|
||||||
|
|
||||||
|
free(vid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_speed_change_1512(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
recalc_timings_1512(vid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static device_t vid_1512_device = {
|
||||||
|
"Amstrad PC1512 (video)",
|
||||||
|
0, 0,
|
||||||
|
NULL, vid_close_1512, NULL,
|
||||||
|
NULL,
|
||||||
|
vid_speed_change_1512,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
recalc_timings_1640(amsvid_t *vid)
|
||||||
|
{
|
||||||
|
cga_recalctimings(&vid->cga);
|
||||||
|
ega_recalctimings(&vid->ega);
|
||||||
|
|
||||||
|
if (vid->cga_enabled) {
|
||||||
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
vid->dispontime = vid->cga.dispontime;
|
||||||
|
vid->dispofftime = vid->cga.dispofftime;
|
||||||
|
} else {
|
||||||
|
overscan_x = 16; overscan_y = 28;
|
||||||
|
|
||||||
|
vid->dispontime = vid->ega.dispontime;
|
||||||
|
vid->dispofftime = vid->ega.dispofftime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_out_1640(uint16_t addr, uint8_t val, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case 0x03db:
|
||||||
|
vid->cga_enabled = val & 0x40;
|
||||||
|
if (vid->cga_enabled) {
|
||||||
|
mem_mapping_enable(&vid->cga_map);
|
||||||
|
mem_mapping_disable(&vid->ega_map);
|
||||||
|
} else {
|
||||||
|
mem_mapping_disable(&vid->cga_map);
|
||||||
|
switch (vid->ega.gdcreg[6] & 0xc) {
|
||||||
|
case 0x0: /*128k at A0000*/
|
||||||
|
mem_mapping_set_addr(&vid->ega_map,
|
||||||
|
0xa0000, 0x20000);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x4: /*64k at A0000*/
|
||||||
|
mem_mapping_set_addr(&vid->ega_map,
|
||||||
|
0xa0000, 0x10000);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x8: /*32k at B0000*/
|
||||||
|
mem_mapping_set_addr(&vid->ega_map,
|
||||||
|
0xb0000, 0x08000);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0xC: /*32k at B8000*/
|
||||||
|
mem_mapping_set_addr(&vid->ega_map,
|
||||||
|
0xb8000, 0x08000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vid->cga_enabled)
|
||||||
|
cga_out(addr, val, &vid->cga);
|
||||||
|
else
|
||||||
|
ega_out(addr, val, &vid->ega);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static uint8_t
|
||||||
|
vid_in_1640(uint16_t addr, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vid->cga_enabled)
|
||||||
|
return(cga_in(addr, &vid->cga));
|
||||||
|
else
|
||||||
|
return(ega_in(addr, &vid->ega));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_poll_1640(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
if (vid->cga_enabled) {
|
||||||
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
vid->cga.vidtime = vid->vidtime;
|
||||||
|
cga_poll(&vid->cga);
|
||||||
|
vid->vidtime = vid->cga.vidtime;
|
||||||
|
} else {
|
||||||
|
overscan_x = 16; overscan_y = 28;
|
||||||
|
|
||||||
|
vid->ega.vidtime = vid->vidtime;
|
||||||
|
ega_poll(&vid->ega);
|
||||||
|
vid->vidtime = vid->ega.vidtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_init_1640(amstrad_t *ams)
|
||||||
|
{
|
||||||
|
amsvid_t *vid;
|
||||||
|
|
||||||
|
/* Allocate a video controller block. */
|
||||||
|
vid = (amsvid_t *)malloc(sizeof(amsvid_t));
|
||||||
|
memset(vid, 0x00, sizeof(amsvid_t));
|
||||||
|
|
||||||
|
rom_init(&vid->bios_rom, BIOS_1640_PATH, 0xc0000, 0x8000, 0x7fff, 0, 0);
|
||||||
|
|
||||||
|
ega_init(&vid->ega);
|
||||||
|
vid->cga.vram = vid->ega.vram;
|
||||||
|
vid->cga_enabled = 1;
|
||||||
|
cga_init(&vid->cga);
|
||||||
|
|
||||||
|
mem_mapping_add(&vid->cga_map, 0xb8000, 0x08000,
|
||||||
|
cga_read, NULL, NULL, cga_write, NULL, NULL, NULL, 0, &vid->cga);
|
||||||
|
mem_mapping_add(&vid->ega_map, 0, 0,
|
||||||
|
ega_read, NULL, NULL, ega_write, NULL, NULL, NULL, 0, &vid->ega);
|
||||||
|
io_sethandler(0x03a0, 64,
|
||||||
|
vid_in_1640, NULL, NULL, vid_out_1640, NULL, NULL, vid);
|
||||||
|
|
||||||
|
timer_add(vid_poll_1640, &vid->vidtime, TIMER_ALWAYS_ENABLED, vid);
|
||||||
|
|
||||||
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
ams->vid = vid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_close_1640(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
free(vid->ega.vram);
|
||||||
|
|
||||||
|
free(vid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_speed_changed_1640(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
recalc_timings_1640(vid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static device_t vid_1640_device = {
|
||||||
|
"Amstrad PC1640 (video)",
|
||||||
|
0, 0,
|
||||||
|
NULL, vid_close_1640, NULL,
|
||||||
|
NULL,
|
||||||
|
vid_speed_changed_1640,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_out_200(uint16_t addr, uint8_t val, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
cga_t *cga = &vid->cga;
|
||||||
|
uint8_t old;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case 0x3d5:
|
||||||
|
if (!(vid->plane_read & 0x40) && cga->crtcreg <= 11) {
|
||||||
|
if (vid->plane_read & 0x80)
|
||||||
|
nmi = 1;
|
||||||
|
|
||||||
|
vid->plane_write = 0x20 | (cga->crtcreg & 0x1f);
|
||||||
|
vid->border = val;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
old = cga->crtc[cga->crtcreg];
|
||||||
|
cga->crtc[cga->crtcreg] = val & crtc_mask[cga->crtcreg];
|
||||||
|
if (old != val) {
|
||||||
|
if (cga->crtcreg < 0xe || cga->crtcreg > 0x10) {
|
||||||
|
fullchange = changeframecount;
|
||||||
|
cga_recalctimings(cga);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3d8:
|
||||||
|
old = cga->cgamode;
|
||||||
|
cga->cgamode = val;
|
||||||
|
if ((cga->cgamode ^ old) & 3)
|
||||||
|
cga_recalctimings(cga);
|
||||||
|
vid->plane_write |= 0x80;
|
||||||
|
if (vid->plane_read & 0x80)
|
||||||
|
nmi = 1;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x3de:
|
||||||
|
vid->plane_read = val;
|
||||||
|
vid->plane_write = 0x1f;
|
||||||
|
if (val & 0x80)
|
||||||
|
vid->plane_write |= 0x40;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cga_out(addr, val, cga);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static uint8_t
|
||||||
|
vid_in_200(uint16_t addr, void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
cga_t *cga = &vid->cga;
|
||||||
|
uint8_t ret;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case 0x3d8:
|
||||||
|
return(cga->cgamode);
|
||||||
|
|
||||||
|
case 0x3dd:
|
||||||
|
ret = vid->plane_write;
|
||||||
|
vid->plane_write &= 0x1f;
|
||||||
|
nmi = 0;
|
||||||
|
return(ret);
|
||||||
|
|
||||||
|
case 0x3de:
|
||||||
|
return((vid->plane_read & 0xc7) | 0x10); /*External CGA*/
|
||||||
|
|
||||||
|
case 0x3df:
|
||||||
|
return(vid->border);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(cga_in(addr, cga));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_init_200(amstrad_t *ams)
|
||||||
|
{
|
||||||
|
amsvid_t *vid;
|
||||||
|
cga_t *cga;
|
||||||
|
|
||||||
|
/* Allocate a video controller block. */
|
||||||
|
vid = (amsvid_t *)malloc(sizeof(amsvid_t));
|
||||||
|
memset(vid, 0x00, sizeof(amsvid_t));
|
||||||
|
|
||||||
|
cga = &vid->cga;
|
||||||
|
cga->vram = malloc(0x4000);
|
||||||
|
cga_init(cga);
|
||||||
|
|
||||||
|
mem_mapping_add(&vid->cga_map, 0xb8000, 0x08000,
|
||||||
|
cga_read, NULL, NULL, cga_write, NULL, NULL, NULL, 0, cga);
|
||||||
|
io_sethandler(0x03d0, 16,
|
||||||
|
vid_in_200, NULL, NULL, vid_out_200, NULL, NULL, vid);
|
||||||
|
|
||||||
|
timer_add(cga_poll, &cga->vidtime, TIMER_ALWAYS_ENABLED, cga);
|
||||||
|
|
||||||
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
ams->vid = vid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_close_200(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
free(vid->cga.vram);
|
||||||
|
|
||||||
|
free(vid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
vid_speed_changed_200(void *priv)
|
||||||
|
{
|
||||||
|
amsvid_t *vid = (amsvid_t *)priv;
|
||||||
|
|
||||||
|
cga_recalctimings(&vid->cga);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static device_t vid_200_device = {
|
||||||
|
"Amstrad PC200 (video)",
|
||||||
|
0, 0,
|
||||||
|
NULL, vid_close_200, NULL,
|
||||||
|
NULL,
|
||||||
|
vid_speed_changed_200,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -313,6 +1104,8 @@ machine_amstrad_init(machine_t *model)
|
|||||||
memset(ams, 0x00, sizeof(amstrad_t));
|
memset(ams, 0x00, sizeof(amstrad_t));
|
||||||
|
|
||||||
machine_common_init(model);
|
machine_common_init(model);
|
||||||
|
|
||||||
|
nmi_init();
|
||||||
|
|
||||||
lpt2_remove_ams();
|
lpt2_remove_ams();
|
||||||
|
|
||||||
@@ -327,10 +1120,41 @@ machine_amstrad_init(machine_t *model)
|
|||||||
|
|
||||||
io_sethandler(0x007a, 1,
|
io_sethandler(0x007a, 1,
|
||||||
ms_read, NULL, NULL, ms_write, NULL, NULL, ams);
|
ms_read, NULL, NULL, ms_write, NULL, NULL, ams);
|
||||||
|
|
||||||
|
switch(romset) {
|
||||||
|
case ROM_PC1512:
|
||||||
|
vid_init_1512(ams);
|
||||||
|
device_add_ex(&vid_1512_device, ams->vid);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PC1640:
|
||||||
|
vid_init_1640(ams);
|
||||||
|
device_add_ex(&vid_1640_device, ams->vid);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PC200:
|
||||||
|
vid_init_200(ams);
|
||||||
|
device_add_ex(&vid_200_device, ams->vid);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PC2086:
|
||||||
|
device_add(¶dise_pvga1a_pc2086_device);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PC3086:
|
||||||
|
device_add(¶dise_pvga1a_pc3086_device);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_MEGAPC:
|
||||||
|
device_add(¶dise_wd90c11_megapc_device);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize the (custom) keyboard/mouse interface. */
|
/* Initialize the (custom) keyboard/mouse interface. */
|
||||||
ams->wantirq = 0;
|
ams->wantirq = 0;
|
||||||
io_sethandler(0x0060, 6,
|
io_sethandler(0x0060, 6,
|
||||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, ams);
|
kbd_read, NULL, NULL, kbd_write, NULL, NULL, ams);
|
||||||
|
timer_add(kbd_poll, &keyboard_delay, TIMER_ALWAYS_ENABLED, ams);
|
||||||
keyboard_set_table(scancode_xt);
|
keyboard_set_table(scancode_xt);
|
||||||
keyboard_send = kbd_adddata;
|
keyboard_send = kbd_adddata;
|
||||||
keyboard_scan = 1;
|
keyboard_scan = 1;
|
||||||
@@ -343,7 +1167,5 @@ machine_amstrad_init(machine_t *model)
|
|||||||
|
|
||||||
/* FIXME: make sure this is correct? */
|
/* FIXME: make sure this is correct? */
|
||||||
nvr_at_init(1);
|
nvr_at_init(1);
|
||||||
|
|
||||||
nmi_init();
|
|
||||||
|
|
||||||
fdc_set_dskchg_activelow();
|
fdc_set_dskchg_activelow();
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
*
|
*
|
||||||
* Emulation of the IBM PS/1 models 2011, 2121 and 2133.
|
* Emulation of the IBM PS/1 models 2011, 2121 and 2133.
|
||||||
*
|
*
|
||||||
|
* Model 2011: The initial model, using a 10MHz 80286.
|
||||||
|
*
|
||||||
* Model 2121: This is similar to model 2011 but some of the functionality
|
* Model 2121: This is similar to model 2011 but some of the functionality
|
||||||
* has moved to a chip at ports 0xe0 (index)/0xe1 (data). The
|
* has moved to a chip at ports 0xe0 (index)/0xe1 (data). The
|
||||||
* only functions I have identified are enables for the first
|
* only functions I have identified are enables for the first
|
||||||
@@ -315,7 +317,11 @@ ps1_setup(int model)
|
|||||||
io_sethandler(0x00e0, 2,
|
io_sethandler(0x00e0, 2,
|
||||||
ps1_read, NULL, NULL, ps1_write, NULL, NULL, ps);
|
ps1_read, NULL, NULL, ps1_write, NULL, NULL, ps);
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
|
rom_init(&ps->high_rom,
|
||||||
|
L"roms/machines/ibmps1_2121/fc0000.bin",
|
||||||
|
0xfc0000, 0x20000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||||
|
#else
|
||||||
rom_init(&ps->high_rom,
|
rom_init(&ps->high_rom,
|
||||||
L"roms/machines/ibmps1_2121/fc0000_shell.bin",
|
L"roms/machines/ibmps1_2121/fc0000_shell.bin",
|
||||||
0xfc0000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL);
|
0xfc0000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||||
|
|||||||
14
src/pc.c
14
src/pc.c
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Main emulator module where most things are controlled.
|
* Main emulator module where most things are controlled.
|
||||||
*
|
*
|
||||||
* Version: @(#)pc.c 1.0.41 2017/11/04
|
* Version: @(#)pc.c 1.0.42 2017/11/05
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -68,7 +68,6 @@
|
|||||||
#include "sound/snd_speaker.h"
|
#include "sound/snd_speaker.h"
|
||||||
#include "sound/snd_ssi2001.h"
|
#include "sound/snd_ssi2001.h"
|
||||||
#include "video/video.h"
|
#include "video/video.h"
|
||||||
#include "video/vid_voodoo.h"
|
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "plat.h"
|
#include "plat.h"
|
||||||
#include "plat_joystick.h"
|
#include "plat_joystick.h"
|
||||||
@@ -683,6 +682,8 @@ pc_reset_hard_init(void)
|
|||||||
fdc_update_is_nsc(0);
|
fdc_update_is_nsc(0);
|
||||||
floppy_reset();
|
floppy_reset();
|
||||||
|
|
||||||
|
mouse_emu_init();
|
||||||
|
|
||||||
#ifndef WALTJE
|
#ifndef WALTJE
|
||||||
/* This is needed to initialize the serial timer. */
|
/* This is needed to initialize the serial timer. */
|
||||||
serial_init();
|
serial_init();
|
||||||
@@ -706,13 +707,11 @@ pc_reset_hard_init(void)
|
|||||||
lpt1_device_init();
|
lpt1_device_init();
|
||||||
|
|
||||||
/* Reset keyboard and/or mouse. */
|
/* Reset keyboard and/or mouse. */
|
||||||
|
// FIXME: do we really have to reset the *AT* keyboard?? --FvK
|
||||||
keyboard_at_reset();
|
keyboard_at_reset();
|
||||||
mouse_emu_init();
|
|
||||||
|
|
||||||
/* Reset the video card. */
|
/* Reset the video card. */
|
||||||
video_reset();
|
video_reset(gfxcard);
|
||||||
if (voodoo_enabled)
|
|
||||||
device_add(&voodoo_device);
|
|
||||||
|
|
||||||
/* Reset the Floppy Disk controller. */
|
/* Reset the Floppy Disk controller. */
|
||||||
fdc_reset();
|
fdc_reset();
|
||||||
@@ -721,6 +720,7 @@ pc_reset_hard_init(void)
|
|||||||
hdc_reset();
|
hdc_reset();
|
||||||
|
|
||||||
/* Reconfire and reset the IDE layer. */
|
/* Reconfire and reset the IDE layer. */
|
||||||
|
// FIXME: this should have been done via hdc_reset() above.. --FvK
|
||||||
ide_ter_disable();
|
ide_ter_disable();
|
||||||
ide_qua_disable();
|
ide_qua_disable();
|
||||||
if (ide_enable[2])
|
if (ide_enable[2])
|
||||||
@@ -738,6 +738,7 @@ pc_reset_hard_init(void)
|
|||||||
network_reset();
|
network_reset();
|
||||||
|
|
||||||
/* Reset and reconfigure the Sound Card layer. */
|
/* Reset and reconfigure the Sound Card layer. */
|
||||||
|
// FIXME: should be just one sound_reset() here. --FvK
|
||||||
sound_card_init();
|
sound_card_init();
|
||||||
if (mpu401_standalone_enable)
|
if (mpu401_standalone_enable)
|
||||||
mpu401_device_add();
|
mpu401_device_add();
|
||||||
@@ -752,7 +753,6 @@ pc_reset_hard_init(void)
|
|||||||
gameport_update_joystick_type();
|
gameport_update_joystick_type();
|
||||||
|
|
||||||
if (config_changed) {
|
if (config_changed) {
|
||||||
pclog("PC: configuration changed, updating status bar and saving..\n");
|
|
||||||
ui_sb_update_panes();
|
ui_sb_update_panes();
|
||||||
|
|
||||||
config_save();
|
config_save();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* This is intended to be used by another SVGA driver,
|
* This is intended to be used by another SVGA driver,
|
||||||
* and not as a card in it's own right.
|
* and not as a card in it's own right.
|
||||||
*
|
*
|
||||||
* Version: @(#)vid_svga.c 1.0.10 2017/11/04
|
* Version: @(#)vid_svga.c 1.0.11 2017/11/05
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -186,6 +186,9 @@ void svga_out(uint16_t addr, uint8_t val, void *p)
|
|||||||
}
|
}
|
||||||
svga_recalctimings(svga);
|
svga_recalctimings(svga);
|
||||||
break;
|
break;
|
||||||
|
case 0x3C3:
|
||||||
|
svga->enabled = (val & 0x01);
|
||||||
|
break;
|
||||||
case 0x3C4:
|
case 0x3C4:
|
||||||
svga->seqaddr = val;
|
svga->seqaddr = val;
|
||||||
break;
|
break;
|
||||||
@@ -264,7 +267,8 @@ void svga_out(uint16_t addr, uint8_t val, void *p)
|
|||||||
svga->vgapal[svga->dac_write].g &= 0x3f;
|
svga->vgapal[svga->dac_write].g &= 0x3f;
|
||||||
svga->vgapal[svga->dac_write].b &= 0x3f;
|
svga->vgapal[svga->dac_write].b &= 0x3f;
|
||||||
|
|
||||||
if ((romset == ROM_IBMPS1_2011) || (romset == ROM_IBMPS1_2121) || (romset == ROM_IBMPS2_M30_286))
|
// if ((romset == ROM_IBMPS1_2011) || (romset == ROM_IBMPS1_2121) || (romset == ROM_IBMPS2_M30_286))
|
||||||
|
if (romset == ROM_IBMPS1_2011)
|
||||||
{
|
{
|
||||||
svga->pallook[svga->dac_write] = makecol32((svga->vgapal[svga->dac_write].r & 0x3f) * 4, (svga->vgapal[svga->dac_write].g & 0x3f) * 4, (svga->vgapal[svga->dac_write].b & 0x3f) * 4);
|
svga->pallook[svga->dac_write] = makecol32((svga->vgapal[svga->dac_write].r & 0x3f) * 4, (svga->vgapal[svga->dac_write].g & 0x3f) * 4, (svga->vgapal[svga->dac_write].b & 0x3f) * 4);
|
||||||
}
|
}
|
||||||
@@ -273,6 +277,10 @@ void svga_out(uint16_t addr, uint8_t val, void *p)
|
|||||||
svga->pallook[svga->dac_write] = makecol32(video_6to8[svga->vgapal[svga->dac_write].r], video_6to8[svga->vgapal[svga->dac_write].g], video_6to8[svga->vgapal[svga->dac_write].b]);
|
svga->pallook[svga->dac_write] = makecol32(video_6to8[svga->vgapal[svga->dac_write].r], video_6to8[svga->vgapal[svga->dac_write].g], video_6to8[svga->vgapal[svga->dac_write].b]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if 1
|
||||||
|
// FIXME: temp to see if this fixes 2401 on PS/1.
|
||||||
|
svga->sense = (svga->vgapal[svga->dac_write].r & svga->vgapal[svga->dac_write].g & svga->vgapal[svga->dac_write].b) & 0x10;
|
||||||
|
#endif
|
||||||
svga->dac_pos = 0;
|
svga->dac_pos = 0;
|
||||||
svga->dac_write = (svga->dac_write + 1) & 255;
|
svga->dac_write = (svga->dac_write + 1) & 255;
|
||||||
break;
|
break;
|
||||||
@@ -414,7 +422,8 @@ uint8_t svga_in(uint16_t addr, void *p)
|
|||||||
case 0x3C1:
|
case 0x3C1:
|
||||||
return svga->attrregs[svga->attraddr];
|
return svga->attrregs[svga->attraddr];
|
||||||
case 0x3c2:
|
case 0x3c2:
|
||||||
if ((romset == ROM_IBMPS1_2011) || (romset == ROM_IBMPS1_2121) || (romset == ROM_IBMPS1_2121_ISA) || (romset == ROM_IBMPS1_2133) || (romset == ROM_IBMPS2_M30_286) || (romset == ROM_IBMPS2_M50) || (romset == ROM_IBMPS2_M55SX) || (romset == ROM_IBMPS2_M80))
|
// if ((romset == ROM_IBMPS1_2011) || (romset == ROM_IBMPS1_2121) || (romset == ROM_IBMPS1_2121_ISA) || (romset == ROM_IBMPS1_2133) || (romset == ROM_IBMPS2_M30_286) || (romset == ROM_IBMPS2_M50) || (romset == ROM_IBMPS2_M55SX) || (romset == ROM_IBMPS2_M80))
|
||||||
|
if (romset == ROM_IBMPS1_2011)
|
||||||
{
|
{
|
||||||
if ((svga->vgapal[0].r + svga->vgapal[0].g + svga->vgapal[0].b) >= 0x50)
|
if ((svga->vgapal[0].r + svga->vgapal[0].g + svga->vgapal[0].b) >= 0x50)
|
||||||
{
|
{
|
||||||
@@ -450,7 +459,11 @@ uint8_t svga_in(uint16_t addr, void *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
temp = svga->sense;
|
||||||
|
pclog("SVGAread = %02x\n", temp);
|
||||||
return temp;
|
return temp;
|
||||||
|
case 0x3C3:
|
||||||
|
return svga->enabled & 0x01;
|
||||||
case 0x3C4:
|
case 0x3C4:
|
||||||
return svga->seqaddr;
|
return svga->seqaddr;
|
||||||
case 0x3C5:
|
case 0x3C5:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Generic SVGA handling.
|
* Generic SVGA handling.
|
||||||
*
|
*
|
||||||
* Version: @(#)vid_svga.h 1.0.1 2017/11/04
|
* Version: @(#)vid_svga.h 1.0.2 2017/11/05
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -21,6 +21,9 @@ typedef struct svga_t
|
|||||||
{
|
{
|
||||||
mem_mapping_t mapping;
|
mem_mapping_t mapping;
|
||||||
|
|
||||||
|
int enabled;
|
||||||
|
|
||||||
|
|
||||||
uint8_t crtcreg;
|
uint8_t crtcreg;
|
||||||
uint8_t crtc[128];
|
uint8_t crtc[128];
|
||||||
uint8_t gdcreg[64];
|
uint8_t gdcreg[64];
|
||||||
@@ -81,6 +84,7 @@ typedef struct svga_t
|
|||||||
double clock;
|
double clock;
|
||||||
uint32_t ma_latch;
|
uint32_t ma_latch;
|
||||||
int bpp;
|
int bpp;
|
||||||
|
int sense;
|
||||||
|
|
||||||
int64_t dispontime, dispofftime;
|
int64_t dispontime, dispofftime;
|
||||||
int64_t vidtime;
|
int64_t vidtime;
|
||||||
|
|||||||
@@ -60,9 +60,10 @@
|
|||||||
#include "vid_s3.h"
|
#include "vid_s3.h"
|
||||||
#include "vid_s3_virge.h"
|
#include "vid_s3_virge.h"
|
||||||
#include "vid_tgui9440.h"
|
#include "vid_tgui9440.h"
|
||||||
|
#include "vid_ti_cf62011.h"
|
||||||
#include "vid_tvga.h"
|
#include "vid_tvga.h"
|
||||||
#include "vid_vga.h"
|
#include "vid_vga.h"
|
||||||
#include "vid_ti_cf62011.h"
|
#include "vid_voodoo.h"
|
||||||
#include "vid_wy700.h"
|
#include "vid_wy700.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -161,36 +162,25 @@ video_cards[] = {
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
video_reset_card(int card)
|
video_reset(int card)
|
||||||
{
|
{
|
||||||
/* Nothing to do if this is their internal video card. */
|
pclog("VIDEO: reset (romset=%d, gfxcard=%d, internal=%d)\n",
|
||||||
if (card == GFX_NONE) return;
|
romset, card, (machines[machine].flags & MACHINE_VIDEO)?1:0);
|
||||||
if ((machines[machine].flags & MACHINE_VIDEO) &&
|
|
||||||
(card == GFX_INTERNAL)) return;
|
|
||||||
|
|
||||||
pclog("Video_reset_card(gfx=%i)\n", card);
|
/* Reset the CGA palette. */
|
||||||
|
cga_palette = 0;
|
||||||
|
cgapal_rebuild();
|
||||||
|
|
||||||
|
/* Do not initialize internal cards here. */
|
||||||
|
if ((card == GFX_NONE) || \
|
||||||
|
(card == GFX_INTERNAL) || machines[machine].fixed_gfxcard) return;
|
||||||
|
|
||||||
|
/* Initialize the video card. */
|
||||||
device_add(video_cards[video_old_to_new(card)].device);
|
device_add(video_cards[video_old_to_new(card)].device);
|
||||||
|
|
||||||
#if 0
|
/* Enable the Voodoo if configured. */
|
||||||
case ROM_PC1512:
|
if (voodoo_enabled)
|
||||||
device_add(&pc1512_device);
|
device_add(&voodoo_device);
|
||||||
case ROM_PC1640:
|
|
||||||
device_add(&pc1640_device);
|
|
||||||
case ROM_PC200:
|
|
||||||
device_add(&pc200_device);
|
|
||||||
case ROM_PC2086:
|
|
||||||
device_add(¶dise_pvga1a_pc2086_device);
|
|
||||||
case ROM_PC3086:
|
|
||||||
device_add(¶dise_pvga1a_pc3086_device);
|
|
||||||
case ROM_MEGAPC:
|
|
||||||
device_add(¶dise_wd90c11_megapc_device);
|
|
||||||
case ROM_TANDY:
|
|
||||||
case ROM_TANDY1000HX:
|
|
||||||
device_add(&tandy_device);
|
|
||||||
case ROM_TANDY1000SL2:
|
|
||||||
device_add(&tandysl_device);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ typedef struct {
|
|||||||
|
|
||||||
rom_t bios_rom;
|
rom_t bios_rom;
|
||||||
|
|
||||||
|
int enabled;
|
||||||
|
|
||||||
uint32_t vram_size;
|
uint32_t vram_size;
|
||||||
|
|
||||||
uint8_t banking;
|
uint8_t banking;
|
||||||
@@ -89,15 +91,22 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
|||||||
svga_t *svga = &ti->svga;
|
svga_t *svga = &ti->svga;
|
||||||
uint8_t old;
|
uint8_t old;
|
||||||
|
|
||||||
if (((addr & 0xfff0) == 0x3d0 ||
|
#if 0
|
||||||
(addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60;
|
if (((addr & 0xfff0) == 0x03d0 || (addr & 0xfff0) == 0x03b0) &&
|
||||||
|
!(svga->miscout & 1)) addr ^= 0x60;
|
||||||
|
#endif
|
||||||
|
pclog("TISVGA_out(%04x, %02x)\n", addr, val);
|
||||||
|
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
case 0x3D4:
|
case 0x0102:
|
||||||
|
ti->enabled = (val & 0x01);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 0x03d4:
|
||||||
svga->crtcreg = val & 0x1f;
|
svga->crtcreg = val & 0x1f;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 0x3D5:
|
case 0x03d5:
|
||||||
if ((svga->crtcreg < 7) && (svga->crtc[0x11] & 0x80))
|
if ((svga->crtcreg < 7) && (svga->crtc[0x11] & 0x80))
|
||||||
return;
|
return;
|
||||||
if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80))
|
if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80))
|
||||||
@@ -115,16 +124,14 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
|||||||
case 0x2100:
|
case 0x2100:
|
||||||
ti->reg_2100 = val;
|
ti->reg_2100 = val;
|
||||||
if ((val & 7) < 4)
|
if ((val & 7) < 4)
|
||||||
svga->write_bank = 0;
|
svga->read_bank = svga->write_bank = 0;
|
||||||
else
|
else
|
||||||
svga->write_bank = (ti->banking & 0x7) * 0x10000;
|
svga->read_bank = svga->write_bank = (ti->banking & 0x7) * 0x10000;
|
||||||
svga->read_bank = svga->write_bank;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x2108:
|
case 0x2108:
|
||||||
if ((ti->reg_2100 & 7) >= 4)
|
if ((ti->reg_2100 & 7) >= 4)
|
||||||
svga->write_bank = (val & 0x7) * 0x10000;
|
svga->read_bank = svga->write_bank = (val & 0x7) * 0x10000;
|
||||||
svga->read_bank = svga->write_bank;
|
|
||||||
ti->banking = val;
|
ti->banking = val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -144,26 +151,36 @@ vid_in(uint16_t addr, void *priv)
|
|||||||
svga_t *svga = &ti->svga;
|
svga_t *svga = &ti->svga;
|
||||||
uint8_t ret;
|
uint8_t ret;
|
||||||
|
|
||||||
if (((addr & 0xfff0) == 0x3d0 ||
|
#if 0
|
||||||
(addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60;
|
if (((addr & 0xfff0) == 0x03d0 || (addr & 0xfff0) == 0x03b0) &&
|
||||||
|
!(svga->miscout & 1)) addr ^= 0x60;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
case 0x100:
|
case 0x0100:
|
||||||
ret = 0xfe;
|
ret = 0xfe;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x101:
|
case 0x0101:
|
||||||
ret = 0xe8;
|
ret = 0xe8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x3D4:
|
case 0x0102:
|
||||||
|
ret = ti->enabled;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x03d4:
|
||||||
ret = svga->crtcreg;
|
ret = svga->crtcreg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x3D5:
|
case 0x03d5:
|
||||||
ret = svga->crtc[svga->crtcreg];
|
ret = svga->crtc[svga->crtcreg];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x2100:
|
||||||
|
ret = ti->reg_2100;
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x2108:
|
case 0x2108:
|
||||||
ret = ti->banking;
|
ret = ti->banking;
|
||||||
break;
|
break;
|
||||||
@@ -177,6 +194,8 @@ vid_in(uint16_t addr, void *priv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pclog("TISVGA_in(%04x) = %02x\n", addr, ret);
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,9 +255,11 @@ vid_init(device_t *info)
|
|||||||
|
|
||||||
pclog("VIDEO: initializing %s, %dK VRAM\n", info->name, ti->vram_size);
|
pclog("VIDEO: initializing %s, %dK VRAM\n", info->name, ti->vram_size);
|
||||||
|
|
||||||
svga_init(&ti->svga, ti, ti->vram_size<<10, NULL, vid_in, vid_out, NULL, NULL);
|
svga_init(&ti->svga, ti,
|
||||||
|
ti->vram_size<<10,
|
||||||
|
NULL, vid_in, vid_out, NULL, NULL);
|
||||||
|
|
||||||
io_sethandler(0x0100, 2, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
io_sethandler(0x0100, 2, vid_in, NULL, NULL, NULL, NULL, NULL, ti);
|
||||||
io_sethandler(0x03c0, 32, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
io_sethandler(0x03c0, 32, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
||||||
io_sethandler(0x2100, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
io_sethandler(0x2100, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
||||||
|
|
||||||
@@ -290,7 +311,7 @@ device_t ti_cf62011_device = {
|
|||||||
device_t ibm_ps1_2121_device = {
|
device_t ibm_ps1_2121_device = {
|
||||||
"IBM PS/1 Model 2121 SVGA",
|
"IBM PS/1 Model 2121 SVGA",
|
||||||
0,
|
0,
|
||||||
256,
|
512,
|
||||||
vid_init, vid_close, NULL,
|
vid_init, vid_close, NULL,
|
||||||
NULL,
|
NULL,
|
||||||
vid_speed_changed,
|
vid_speed_changed,
|
||||||
|
|||||||
@@ -554,17 +554,6 @@ video_close(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
video_reset(void)
|
|
||||||
{
|
|
||||||
pclog("VIDEO: reset(rom=%d, gfx=%d, internal=%d)\n",
|
|
||||||
romset, gfxcard, (machines[machine].flags & MACHINE_VIDEO)?1:0);
|
|
||||||
|
|
||||||
cga_palette = 0;
|
|
||||||
cgapal_rebuild();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
video_force_resize_get(void)
|
video_force_resize_get(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,13 +98,15 @@ enum {
|
|||||||
|
|
||||||
#define MDA ((gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || \
|
#define MDA ((gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || \
|
||||||
gfxcard==GFX_HERCULESPLUS || gfxcard==GFX_INCOLOR || \
|
gfxcard==GFX_HERCULESPLUS || gfxcard==GFX_INCOLOR || \
|
||||||
gfxcard==GFX_GENIUS) && (romset<ROM_TANDY || romset>=ROM_IBMAT))
|
gfxcard==GFX_GENIUS) && \
|
||||||
|
(romset<ROM_TANDY || romset>=ROM_IBMAT))
|
||||||
|
|
||||||
#define VGA ((gfxcard>=GFX_TVGA) && gfxcard!=GFX_COLORPLUS && \
|
#define VGA (((gfxcard>=GFX_TVGA) && gfxcard!=GFX_COLORPLUS && \
|
||||||
gfxcard!=GFX_INCOLOR && gfxcard!=GFX_WY700 && gfxcard!=GFX_GENIUS && \
|
gfxcard!=GFX_INCOLOR && gfxcard!=GFX_WY700 && \
|
||||||
gfxcard!=GFX_COMPAQ_EGA && gfxcard!=GFX_SUPER_EGA && \
|
gfxcard!=GFX_GENIUS && gfxcard!=GFX_COMPAQ_EGA && \
|
||||||
gfxcard!=GFX_HERCULESPLUS && romset!=ROM_PC1640 && \
|
gfxcard!=GFX_SUPER_EGA && gfxcard!=GFX_HERCULESPLUS) && \
|
||||||
romset!=ROM_PC1512 && romset!=ROM_TANDY && romset!=ROM_PC200)
|
(romset!=ROM_PC1640 && romset!=ROM_PC1512 && \
|
||||||
|
romset!=ROM_TANDY && romset!=ROM_PC200))
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FULLSCR_SCALE_FULL = 0,
|
FULLSCR_SCALE_FULL = 0,
|
||||||
@@ -209,8 +211,7 @@ extern void updatewindowsize(int x, int y);
|
|||||||
|
|
||||||
extern void video_init(void);
|
extern void video_init(void);
|
||||||
extern void video_close(void);
|
extern void video_close(void);
|
||||||
extern void video_reset(void);
|
extern void video_reset(int card);
|
||||||
extern void video_reset_card(int);
|
|
||||||
extern uint8_t video_force_resize_get(void);
|
extern uint8_t video_force_resize_get(void);
|
||||||
extern void video_force_resize_set(uint8_t res);
|
extern void video_force_resize_set(uint8_t res);
|
||||||
extern void video_update_timing(void);
|
extern void video_update_timing(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user