Merge branch 'master' of https://github.com/86Box/86Box into feature/968_new
This commit is contained in:
@@ -330,7 +330,8 @@ const scancode scancode_xt[512] = {
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0,
|
||||
key_queue_end = 0;
|
||||
static int is_t1x00 = 0;
|
||||
static int is_tandy = 0, is_t1x00 = 0,
|
||||
is_amstrad = 0;
|
||||
|
||||
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
@@ -425,9 +426,17 @@ kbd_adddata_process(uint16_t val, void (*adddata)(uint16_t val))
|
||||
if (!adddata)
|
||||
return;
|
||||
|
||||
if (is_tandy) {
|
||||
adddata(val);
|
||||
return;
|
||||
}
|
||||
|
||||
keyboard_get_states(NULL, &num_lock, NULL);
|
||||
shift_states = keyboard_get_shift() & STATE_SHIFT_MASK;
|
||||
|
||||
if (is_amstrad)
|
||||
num_lock = !num_lock;
|
||||
|
||||
switch(val) {
|
||||
case FAKE_LSHIFT_ON:
|
||||
if (num_lock) {
|
||||
@@ -553,15 +562,13 @@ kbd_read(uint16_t port, void *priv)
|
||||
ret = ((mem_size-64) / 32) & 0x0f;
|
||||
else
|
||||
ret = ((mem_size-64) / 32) >> 4;
|
||||
}
|
||||
else if (kbd->type == 8) {
|
||||
/* Olivetti M19 */
|
||||
if (kbd->pb & 0x04)
|
||||
} else if (kbd->type == 8) {
|
||||
/* Olivetti M19 */
|
||||
if (kbd->pb & 0x04)
|
||||
ret = kbd->pd;
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
}
|
||||
else {
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
} else {
|
||||
if (kbd->pb & 0x08)
|
||||
ret = kbd->pd >> 4;
|
||||
else {
|
||||
@@ -613,6 +620,13 @@ kbd_reset(void *priv)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
keyboard_set_is_amstrad(int ams)
|
||||
{
|
||||
is_amstrad = ams;
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
kbd_init(const device_t *info)
|
||||
{
|
||||
@@ -727,8 +741,11 @@ kbd_init(const device_t *info)
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
|
||||
is_tandy = (kbd->type == 5);
|
||||
is_t1x00 = (kbd->type == 6);
|
||||
|
||||
is_amstrad = 0;
|
||||
|
||||
return(kbd);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,9 +95,7 @@ extern const device_t sis_85c461_device;
|
||||
extern const device_t sis_85c471_device;
|
||||
extern const device_t sis_85c496_device;
|
||||
extern const device_t sis_85c496_ls486e_device;
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIS_85C50X)
|
||||
extern const device_t sis_85c50x_device;
|
||||
#endif
|
||||
|
||||
/* ST */
|
||||
#if defined(DEV_BRANCH) && defined(USE_STPC)
|
||||
|
||||
@@ -102,6 +102,7 @@ extern void keyboard_set_states(uint8_t cl, uint8_t nl, uint8_t sl);
|
||||
extern int keyboard_recv(uint16_t key);
|
||||
extern int keyboard_isfsexit(void);
|
||||
extern int keyboard_ismsexit(void);
|
||||
extern void keyboard_set_is_amstrad(int ams);
|
||||
|
||||
extern void keyboard_at_adddata_keyboard_raw(uint8_t val);
|
||||
extern void keyboard_at_adddata_mouse(uint8_t val);
|
||||
|
||||
@@ -301,6 +301,7 @@ extern int machine_at_403tg_init(const machine_t *);
|
||||
extern int machine_at_pc330_6571_init(const machine_t *);
|
||||
|
||||
extern int machine_at_sis401_init(const machine_t *);
|
||||
extern int machine_at_av4_init(const machine_t *);
|
||||
extern int machine_at_valuepoint433_init(const machine_t *);
|
||||
|
||||
extern int machine_at_vli486sv2g_init(const machine_t *);
|
||||
@@ -354,10 +355,8 @@ extern int machine_at_excalibur_init(const machine_t *);
|
||||
|
||||
extern int machine_at_batman_init(const machine_t *);
|
||||
extern int machine_at_ambradp60_init(const machine_t *);
|
||||
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
|
||||
extern int machine_at_dellxp60_init(const machine_t *);
|
||||
extern int machine_at_opti560l_init(const machine_t *);
|
||||
#endif
|
||||
extern int machine_at_valuepointp60_init(const machine_t *);
|
||||
extern int machine_at_p5mp3_init(const machine_t *);
|
||||
extern int machine_at_pb520r_init(const machine_t *);
|
||||
@@ -376,11 +375,9 @@ extern int machine_at_vectra54_init(const machine_t *);
|
||||
extern int machine_at_powermate_v_init(const machine_t *);
|
||||
extern int machine_at_acerv30_init(const machine_t *);
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIS_85C50X)
|
||||
extern int machine_at_p5sp4_init(const machine_t *);
|
||||
extern int machine_at_p54sp4_init(const machine_t *);
|
||||
extern int machine_at_sq588_init(const machine_t *);
|
||||
#endif
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *at_endeavor_get_device(void);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define FLAG_ADDR_BY8 2
|
||||
#define FLAG_EXT_WRITE 4
|
||||
#define FLAG_LATCH8 8
|
||||
#define FLAG_NOSKEW 16
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1715,8 +1715,13 @@ vid_close_200(void *priv)
|
||||
{
|
||||
amsvid_t *vid = (amsvid_t *)priv;
|
||||
|
||||
free(vid->cga.vram);
|
||||
free(vid->mda.vram);
|
||||
if (vid->cga.vram != vid->mda.vram) {
|
||||
free(vid->cga.vram);
|
||||
free(vid->mda.vram);
|
||||
} else
|
||||
free(vid->cga.vram);
|
||||
|
||||
vid->cga.vram = vid->mda.vram = NULL;
|
||||
|
||||
free(vid);
|
||||
}
|
||||
@@ -2111,8 +2116,7 @@ kbd_adddata(uint16_t val)
|
||||
static void
|
||||
kbd_adddata_ex(uint16_t val)
|
||||
{
|
||||
kbd_adddata(val);
|
||||
// kbd_adddata_process(val, kbd_adddata);
|
||||
kbd_adddata_process(val, kbd_adddata);
|
||||
}
|
||||
|
||||
|
||||
@@ -2495,6 +2499,7 @@ machine_amstrad_init(const machine_t *model, int type)
|
||||
keyboard_set_table(scancode_xt);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
keyboard_scan = 1;
|
||||
keyboard_set_is_amstrad(1);
|
||||
|
||||
io_sethandler(0x0078, 2,
|
||||
ms_read, NULL, NULL, ms_write, NULL, NULL, ams);
|
||||
|
||||
@@ -102,6 +102,27 @@ machine_at_sis401_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_av4_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/av4/amibios_486dx_isa_bios_aa4025963.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&sis_85c460_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2 mouse
|
||||
{
|
||||
@@ -121,6 +142,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ecs386_init(const machine_t *model)
|
||||
{
|
||||
|
||||
@@ -122,7 +122,6 @@ machine_at_batman_init(const machine_t *model)
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
|
||||
int
|
||||
machine_at_dellxp60_init(const machine_t *model)
|
||||
{
|
||||
@@ -184,7 +183,6 @@ machine_at_opti560l_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
@@ -648,7 +646,6 @@ machine_at_acerv30_init(const machine_t *model)
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIS_85C50X)
|
||||
static void
|
||||
machine_at_sp4_common_init(const machine_t *model)
|
||||
{
|
||||
@@ -737,4 +734,3 @@ machine_at_sq588_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -298,11 +298,11 @@ static const scancode scancode_tandy[512] = {
|
||||
{ {0}, {0} }, { {0}, {0} }, /*140*/
|
||||
{ {0}, {0} }, { {0}, {0} },
|
||||
{ {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/
|
||||
{ {0x48, 0}, {0xc8, 0} }, { {0x49, 0}, {0xc9, 0} },
|
||||
{ {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/
|
||||
{ {0}, {0} }, { {0x4d, 0}, {0xcd, 0} },
|
||||
{ {0x29, 0}, {0xa9, 0} }, { {0x49, 0}, {0xc9, 0} },
|
||||
{ {0}, {0} }, { {0x2b, 0}, {0xab, 0} }, /*148*/
|
||||
{ {0}, {0} }, { {0x4e, 0}, {0xce, 0} },
|
||||
{ {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/
|
||||
{ {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} },
|
||||
{ {0x4a, 0}, {0xca, 0} }, { {0x51, 0}, {0xd1, 0} },
|
||||
{ {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/
|
||||
{ {0}, {0} }, { {0}, {0} },
|
||||
{ {0}, {0} }, { {0}, {0} }, /*154*/
|
||||
|
||||
@@ -118,6 +118,7 @@ m24_log(const char *fmt, ...)
|
||||
#define m24_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_poll(void *priv)
|
||||
{
|
||||
@@ -171,9 +172,8 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (ram[8] == 0xc3) {
|
||||
if (ram[8] == 0xc3)
|
||||
output = 3;
|
||||
}
|
||||
#endif
|
||||
switch (port) {
|
||||
case 0x60:
|
||||
@@ -242,6 +242,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m24_kbd_read(uint16_t port, void *priv)
|
||||
{
|
||||
@@ -279,11 +280,13 @@ m24_kbd_read(uint16_t port, void *priv)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_close(void *priv)
|
||||
{
|
||||
olim24_kbd_t *kbd = (olim24_kbd_t *)priv;
|
||||
/* Stop the timer. */
|
||||
olim24_kbd_t *kbd = (olim24_kbd_t *)priv;
|
||||
|
||||
/* Stop the timer. */
|
||||
timer_disable(&kbd->send_delay_timer);
|
||||
|
||||
/* Disable scanning. */
|
||||
@@ -293,12 +296,13 @@ m24_kbd_close(void *priv)
|
||||
|
||||
io_removehandler(0x0060, 2,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
io_removehandler(0x0064, 1,
|
||||
io_removehandler(0x0064, 1,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
|
||||
free(kbd);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_reset(void *priv)
|
||||
{
|
||||
@@ -319,6 +323,7 @@ m24_kbd_reset(void *priv)
|
||||
m24_kbd->scan[6] = 0x50;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ms_poll(int x, int y, int z, int b, void *priv)
|
||||
{
|
||||
@@ -401,10 +406,12 @@ ms_poll(int x, int y, int z, int b, void *priv)
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_init(olim24_kbd_t *kbd){
|
||||
m24_kbd_init(olim24_kbd_t *kbd)
|
||||
{
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
/* Initialize the keyboard. */
|
||||
io_sethandler(0x0060, 2,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
io_sethandler(0x0064, 1,
|
||||
@@ -418,152 +425,160 @@ m24_kbd_init(olim24_kbd_t *kbd){
|
||||
mouse_set_poll(ms_poll, kbd);
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
|
||||
keyboard_set_is_amstrad(0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
int oldmode = vid->mode;
|
||||
|
||||
/* activating plantronics mode */
|
||||
if (addr == 0x3dd){
|
||||
/* already in graphics mode */
|
||||
if ((val & 0x30) && (vid->ogc.cga.cgamode & 0x2)) {
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
} else {
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
}
|
||||
/* setting graphics mode */
|
||||
} else if (addr == 0x3d8) {
|
||||
if ((val & 0x2) && (vid->colorplus.control & 0x30)){
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
} else {
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
}
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
int oldmode = vid->mode;
|
||||
|
||||
/* activating plantronics mode */
|
||||
if (addr == 0x3dd) {
|
||||
/* already in graphics mode */
|
||||
if ((val & 0x30) && (vid->ogc.cga.cgamode & 0x2))
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
else
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
/* setting graphics mode */
|
||||
} else if (addr == 0x3d8) {
|
||||
if ((val & 0x2) && (vid->colorplus.control & 0x30))
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
else
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
}
|
||||
/* video mode changed */
|
||||
if (oldmode != vid->mode) {
|
||||
/* activate Plantronics emulation */
|
||||
if (vid->mode == PLANTRONICS_MODE){
|
||||
timer_disable(&vid->ogc.cga.timer);
|
||||
timer_set_delay_u64(&vid->colorplus.cga.timer, 0);
|
||||
/* return to OGC mode */
|
||||
} else {
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
timer_set_delay_u64(&vid->ogc.cga.timer, 0);
|
||||
}
|
||||
/* video mode changed */
|
||||
if(oldmode != vid->mode){
|
||||
/* activate Plantronics emulation */
|
||||
if (vid->mode == PLANTRONICS_MODE){
|
||||
timer_disable(&vid->ogc.cga.timer);
|
||||
timer_set_delay_u64(&vid->colorplus.cga.timer, 0);
|
||||
/* return to OGC mode */
|
||||
} else {
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
timer_set_delay_u64(&vid->ogc.cga.timer, 0);
|
||||
}
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
}
|
||||
colorplus_out(addr, val, &vid->colorplus);
|
||||
ogc_out(addr, val, &vid->ogc);
|
||||
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
}
|
||||
|
||||
colorplus_out(addr, val, &vid->colorplus);
|
||||
ogc_out(addr, val, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m19_vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
if ( vid->mode == PLANTRONICS_MODE ) {
|
||||
return colorplus_in(addr, &vid->colorplus);
|
||||
} else {
|
||||
return ogc_in(addr, &vid->ogc);
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
|
||||
if (vid->mode == PLANTRONICS_MODE)
|
||||
return colorplus_in(addr, &vid->colorplus);
|
||||
else
|
||||
return ogc_in(addr, &vid->ogc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
m19_vid_read(uint32_t addr, void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
vid->colorplus.cga.mapping = vid->ogc.cga.mapping;
|
||||
if ( vid->mode == PLANTRONICS_MODE ) {
|
||||
return colorplus_read(addr, &vid->colorplus);
|
||||
} else {
|
||||
return ogc_read(addr, &vid->ogc);
|
||||
}
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
|
||||
vid->colorplus.cga.mapping = vid->ogc.cga.mapping;
|
||||
if (vid->mode == PLANTRONICS_MODE)
|
||||
return colorplus_read(addr, &vid->colorplus);
|
||||
else
|
||||
return ogc_read(addr, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
colorplus_write(addr, val, &vid->colorplus);
|
||||
ogc_write(addr, val, &vid->ogc);
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
|
||||
colorplus_write(addr, val, &vid->colorplus);
|
||||
ogc_write(addr, val, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_close(void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
free(vid->ogc.cga.vram);
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
|
||||
free(vid->ogc.cga.vram);
|
||||
free(vid->colorplus.cga.vram);
|
||||
free(vid);
|
||||
free(vid);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_speed_changed(void *priv)
|
||||
{
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
olim19_vid_t *vid = (olim19_vid_t *)priv;
|
||||
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_init(olim19_vid_t *vid){
|
||||
m19_vid_init(olim19_vid_t *vid)
|
||||
{
|
||||
/* int display_type; */
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
|
||||
//int display_type;
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m19_vid);
|
||||
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m19_vid);
|
||||
/* display_type = device_get_config_int("display_type"); */
|
||||
|
||||
//display_type = device_get_config_int("display_type");
|
||||
|
||||
/* OGC emulation part begin */
|
||||
loadfont_ex(L"roms/machines/olivetti_m19/BIOS.BIN", 1, 90);
|
||||
/* composite is not working yet */
|
||||
vid->ogc.cga.composite = 0; // (display_type != CGA_RGB);
|
||||
//vid->ogc.cga.snow_enabled = device_get_config_int("snow_enabled");
|
||||
|
||||
vid->ogc.cga.vram = malloc(0x8000);
|
||||
/* OGC emulation part begin */
|
||||
loadfont_ex(L"roms/machines/olivetti_m19/BIOS.BIN", 1, 90);
|
||||
/* composite is not working yet */
|
||||
vid->ogc.cga.composite = 0; // (display_type != CGA_RGB);
|
||||
/* vid->ogc.cga.snow_enabled = device_get_config_int("snow_enabled"); */
|
||||
|
||||
//cga_comp_init(vid->ogc.cga.revision);
|
||||
|
||||
//vid->ogc.cga.rgb_type = device_get_config_int("rgb_type");
|
||||
//cga_palette = (vid->ogc.cga.rgb_type << 1);
|
||||
vid->ogc.cga.vram = malloc(0x8000);
|
||||
|
||||
/* cga_comp_init(vid->ogc.cga.revision); */
|
||||
|
||||
/* vid->ogc.cga.rgb_type = device_get_config_int("rgb_type"); */
|
||||
/* cga_palette = (vid->ogc.cga.rgb_type << 1); */
|
||||
cga_palette = 0;
|
||||
cgapal_rebuild();
|
||||
ogc_mdaattr_rebuild();
|
||||
cgapal_rebuild();
|
||||
ogc_mdaattr_rebuild();
|
||||
|
||||
/* color display */
|
||||
// if (device_get_config_int("rgb_type")==0 || device_get_config_int("rgb_type") == 4)
|
||||
vid->ogc.mono_display = 1;
|
||||
// else
|
||||
// vid->ogc.mono_display = 1;
|
||||
/* OGC emulation part end */
|
||||
|
||||
/* 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");
|
||||
/* color display */
|
||||
/* if (device_get_config_int("rgb_type")==0 || device_get_config_int("rgb_type") == 4) */
|
||||
vid->ogc.mono_display = 1;
|
||||
/* else */
|
||||
/* vid->ogc.mono_display = 1; */
|
||||
/* OGC emulation part end */
|
||||
|
||||
/* 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"); */
|
||||
|
||||
vid->colorplus.cga.vram = malloc(0x8000);
|
||||
|
||||
//vid->colorplus.cga.cgamode = 0x1;
|
||||
/* Plantronics emulation part end*/
|
||||
|
||||
timer_add(&vid->ogc.cga.timer, ogc_poll, &vid->ogc, 1);
|
||||
timer_add(&vid->colorplus.cga.timer, colorplus_poll, &vid->colorplus, 1);
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
mem_mapping_add(&vid->ogc.cga.mapping, 0xb8000, 0x08000, m19_vid_read, NULL, NULL, m19_vid_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, vid);
|
||||
io_sethandler(0x03d0, 0x0010, m19_vid_in, NULL, NULL, m19_vid_out, NULL, NULL, vid);
|
||||
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
|
||||
/* vid->colorplus.cga.cgamode = 0x1; */
|
||||
/* Plantronics emulation part end*/
|
||||
|
||||
timer_add(&vid->ogc.cga.timer, ogc_poll, &vid->ogc, 1);
|
||||
timer_add(&vid->colorplus.cga.timer, colorplus_poll, &vid->colorplus, 1);
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
mem_mapping_add(&vid->ogc.cga.mapping, 0xb8000, 0x08000, m19_vid_read, NULL, NULL, m19_vid_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, vid);
|
||||
io_sethandler(0x03d0, 0x0010, m19_vid_in, NULL, NULL, m19_vid_out, NULL, NULL, vid);
|
||||
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
}
|
||||
|
||||
|
||||
const device_t m24_kbd_device = {
|
||||
"Olivetti M24 keyboard and mouse",
|
||||
0,
|
||||
@@ -590,11 +605,13 @@ m19_get_device(void)
|
||||
return &m19_vid_device;
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m24_read(uint16_t port, void *priv)
|
||||
{
|
||||
uint8_t ret = 0x00;
|
||||
int i, fdd_count = 0;
|
||||
uint8_t ret = 0x00;
|
||||
int i, fdd_count = 0;
|
||||
|
||||
switch (port) {
|
||||
/*
|
||||
* port 66:
|
||||
@@ -610,7 +627,7 @@ m24_read(uint16_t port, void *priv)
|
||||
/* Switch 5 - 8087 present */
|
||||
if (hasfpu)
|
||||
ret |= 0x10;
|
||||
/*
|
||||
/*
|
||||
* Switches 1, 2, 3, 4 - installed memory
|
||||
* Switch 8 - Use memory bank 1
|
||||
*/
|
||||
@@ -650,10 +667,9 @@ m24_read(uint16_t port, void *priv)
|
||||
*/
|
||||
case 0x67:
|
||||
for (i = 0; i < FDD_NUM; i++) {
|
||||
if (fdd_get_flags(i)) {
|
||||
if (fdd_get_flags(i))
|
||||
fdd_count++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Switches 7, 8 - floppy drives. */
|
||||
if (!fdd_count)
|
||||
@@ -674,17 +690,19 @@ m24_read(uint16_t port, void *priv)
|
||||
|
||||
/* Switch 2 - Set fast startup */
|
||||
ret |= 0x2;
|
||||
}
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
m24_get_device(void)
|
||||
{
|
||||
return &ogc_m24_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_olim24_init(const machine_t *model)
|
||||
{
|
||||
@@ -708,22 +726,21 @@ machine_xt_olim24_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
//address 66-67 = mainboard dip-switch settings
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
/* Address 66-67 = mainboard dip-switch settings */
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
m24_kbd_init(m24_kbd);
|
||||
device_add_ex(&m24_kbd_device, m24_kbd);
|
||||
m24_kbd_init(m24_kbd);
|
||||
device_add_ex(&m24_kbd_device, m24_kbd);
|
||||
|
||||
/* FIXME: make sure this is correct?? */
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
if (joystick_type)
|
||||
device_add(&gameport_device);
|
||||
device_add(&gameport_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -746,10 +763,10 @@ machine_xt_olim240_init(const machine_t *model)
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
|
||||
/*
|
||||
* port 60: should return jumper settings only under unknown conditions
|
||||
* SWB on mainboard (off=1)
|
||||
* bit 7 - use BIOS HD on mainboard (on) / on controller (off)
|
||||
/*
|
||||
* port 60: should return jumper settings only under unknown conditions
|
||||
* SWB on mainboard (off=1)
|
||||
* bit 7 - use BIOS HD on mainboard (on) / on controller (off)
|
||||
* bit 6 - use OCG/CGA display adapter (on) / other display adapter (off)
|
||||
*/
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
@@ -757,11 +774,11 @@ machine_xt_olim240_init(const machine_t *model)
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (joystick_type)
|
||||
device_add(&gameport_device);
|
||||
if (joystick_type)
|
||||
device_add(&gameport_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
@@ -787,19 +804,19 @@ machine_xt_olim19_init(const machine_t *model)
|
||||
|
||||
olim19_vid_t *vid;
|
||||
|
||||
/* do not move memory allocation elsewhere */
|
||||
vid = (olim19_vid_t *)malloc(sizeof(olim19_vid_t));
|
||||
memset(vid, 0x00, sizeof(olim19_vid_t));
|
||||
/* Do not move memory allocation elsewhere. */
|
||||
vid = (olim19_vid_t *)malloc(sizeof(olim19_vid_t));
|
||||
memset(vid, 0x00, sizeof(olim19_vid_t));
|
||||
|
||||
machine_common_init(model);
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
m19_vid_init(vid);
|
||||
device_add_ex(&m19_vid_device, vid);
|
||||
m19_vid_init(vid);
|
||||
device_add_ex(&m19_vid_device, vid);
|
||||
|
||||
device_add(&keyboard_xt_olivetti_device);
|
||||
|
||||
nmi_init();
|
||||
device_add(&keyboard_xt_olivetti_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ const machine_t machines[] = {
|
||||
{ "[OPTi 802G] IBM PC 330 (type 6571)", "pc330_6571", MACHINE_TYPE_486, CPU_PKG_SOCKET3_PC330, 0, 25000000, 33333333, 0, 0, 2.0, 3.0, MACHINE_VLB | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_pc330_6571_init, NULL },
|
||||
{ "[OPTi 895] Jetway J-403TG", "403tg", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_403tg_init, NULL },
|
||||
{ "[SiS 401] AMI 486 Clone", "sis401", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_sis401_init, NULL },
|
||||
{ "[SiS 460] ABIT AV4", "av4", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_av4_init, NULL },
|
||||
{ "[SiS 461] IBM PS/ValuePoint 433DX/Si", "valuepoint433", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_valuepoint433_init, NULL },
|
||||
{ "[SiS 471] AMI 486 Clone", "ami471", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_ami471_init, NULL },
|
||||
{ "[SiS 471] AMI WinBIOS 486 clone", "win471", MACHINE_TYPE_486, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_win471_init, NULL },
|
||||
@@ -230,10 +231,8 @@ const machine_t machines[] = {
|
||||
/* Socket 4 machines */
|
||||
/* 430LX */
|
||||
{ "[i430LX] ASUS P/I-P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 196608, 2048, 127, machine_at_p5mp3_init, NULL },
|
||||
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
|
||||
{ "[i430LX] Dell Dimension XPS P60", "dellxp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 131072, 2048, 127, machine_at_dellxp60_init, NULL },
|
||||
{ "[i430LX] Dell OptiPlex 560/L", "opti560l", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_opti560l_init, NULL },
|
||||
#endif
|
||||
{ "[i430LX] IBM Ambra DP60 PCI", "ambradp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_ambradp60_init, NULL },
|
||||
{ "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_valuepointp60_init, NULL },
|
||||
{ "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_batman_init, NULL },
|
||||
@@ -244,9 +243,7 @@ const machine_t machines[] = {
|
||||
{ "[OPTi 597] AMI Excalibur VLB", "excalibur", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_VLB | MACHINE_IDE, 2048, 65536, 2048, 127, machine_at_excalibur_init, NULL },
|
||||
|
||||
/* SiS 85C50x */
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIS_85C50X)
|
||||
{ "[SiS 85C50x] ASUS PCI/I-P5SP4", "p5sp4", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 0, 0, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p5sp4_init, NULL },
|
||||
#endif
|
||||
|
||||
/* Socket 5 machines */
|
||||
/* 430NX */
|
||||
@@ -263,10 +260,8 @@ const machine_t machines[] = {
|
||||
{ "[i430FX] PC Partner MB500N", "mb500n", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_mb500n_init, NULL },
|
||||
|
||||
/* SiS 85C50x */
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIS_85C50X)
|
||||
{ "[SiS 85C50x] ASUS PCI/I-P54SP4", "p54sp4", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p54sp4_init, NULL },
|
||||
{ "[SiS 85C50x] BCM SQ-588", "sq588", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_sq588_init, NULL },
|
||||
#endif
|
||||
|
||||
/* Socket 7 machines */
|
||||
/* 430FX */
|
||||
|
||||
@@ -1312,6 +1312,7 @@ void *et4000w32p_init(const device_t *info)
|
||||
|
||||
et4000->svga.clock_gen = et4000->svga.ramdac;
|
||||
et4000->svga.getclock = stg_getclock;
|
||||
et4000->svga.adv_flags |= FLAG_NOSKEW;
|
||||
break;
|
||||
|
||||
case ET4000W32_DIAMOND:
|
||||
|
||||
@@ -445,7 +445,7 @@ svga_recalctimings(svga_t *svga)
|
||||
|
||||
svga->interlace = 0;
|
||||
|
||||
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5);
|
||||
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]);
|
||||
svga->ca_adj = 0;
|
||||
|
||||
svga->rowcount = svga->crtc[9] & 31;
|
||||
@@ -459,6 +459,8 @@ svga_recalctimings(svga_t *svga)
|
||||
svga->hdisp *= (svga->seqregs[1] & 1) ? 16 : 18;
|
||||
} else {
|
||||
svga->render = svga_render_text_80;
|
||||
if (!(svga->adv_flags & FLAG_NOSKEW))
|
||||
svga->ma_latch += ((svga->crtc[8] & 0x60) >> 5);
|
||||
svga->hdisp *= (svga->seqregs[1] & 1) ? 8 : 9;
|
||||
}
|
||||
svga->hdisp_old = svga->hdisp;
|
||||
|
||||
@@ -75,9 +75,6 @@ ifeq ($(DEV_BUILD), y)
|
||||
ifndef SIO_DETECT
|
||||
SIO_DETECT := y
|
||||
endif
|
||||
ifndef USE_SIS_85C50X
|
||||
USE_SIS_85C50X := y
|
||||
endif
|
||||
ifndef STPC
|
||||
STPC := y
|
||||
endif
|
||||
@@ -99,9 +96,6 @@ ifeq ($(DEV_BUILD), y)
|
||||
ifndef USE_VECT486VL
|
||||
USE_VECT486VL := y
|
||||
endif
|
||||
ifndef USE_DELLS4
|
||||
USE_DELLS4 := y
|
||||
endif
|
||||
else
|
||||
ifndef DEBUG
|
||||
DEBUG := n
|
||||
@@ -151,9 +145,6 @@ else
|
||||
ifndef SIO_DETECT
|
||||
SIO_DETECT := n
|
||||
endif
|
||||
ifndef USE_SIS_85C50X
|
||||
USE_SIS_85C50X := n
|
||||
endif
|
||||
ifndef STPC
|
||||
STPC := y
|
||||
endif
|
||||
@@ -175,9 +166,6 @@ else
|
||||
ifndef USE_VECT486VL
|
||||
USE_VECT486VL := n
|
||||
endif
|
||||
ifndef USE_DELLS4
|
||||
USE_DELLS4 := n
|
||||
endif
|
||||
endif
|
||||
|
||||
# Defaults for several build options (possibly defined in a chained file.)
|
||||
@@ -549,11 +537,6 @@ OPTS += -DUSE_SIO_DETECT
|
||||
DEVBROBJ += sio_detect.o
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SIS_85C50X), y)
|
||||
OPTS += -DUSE_SIS_85C50X
|
||||
DEVBROBJ += sis_85c50x.o
|
||||
endif
|
||||
|
||||
ifeq ($(STPC), y)
|
||||
OPTS += -DUSE_STPC
|
||||
DEVBROBJ += stpc.o
|
||||
@@ -581,10 +564,6 @@ ifeq ($(USE_VECT486VL), y)
|
||||
OPTS += -DUSE_VECT486VL
|
||||
endif
|
||||
|
||||
ifeq ($(USE_DELLS4), y)
|
||||
OPTS += -DUSE_DELLS4
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -617,7 +596,7 @@ CPUOBJ := cpu.o cpu_table.o \
|
||||
CHIPSETOBJ := acc2168.o cs8230.o ali1429.o headland.o intel_82335.o cs4031.o \
|
||||
intel_420ex.o intel_4x0.o intel_sio.o intel_piix.o ioapic.o \
|
||||
neat.o opti495.o opti895.o opti5x7.o scamp.o scat.o via_vt82c49x.o via_vt82c505.o \
|
||||
sis_85c310.o sis_85c4xx.o sis_85c496.o opti283.o opti291.o umc491.o \
|
||||
sis_85c310.o sis_85c4xx.o sis_85c496.o sis_85c50x.o opti283.o opti291.o umc491.o \
|
||||
via_apollo.o via_pipc.o wd76c10.o vl82c480.o
|
||||
|
||||
MCHOBJ := machine.o machine_table.o \
|
||||
|
||||
@@ -70,8 +70,11 @@ extern WCHAR wopenfilestring[512];
|
||||
|
||||
/* Local data. */
|
||||
static wchar_t wTitle[512];
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
static HHOOK hKeyboardHook;
|
||||
static int hook_enabled = 0, manager_wm = 0;
|
||||
static int hook_enabled = 0;
|
||||
#endif
|
||||
static int manager_wm = 0;
|
||||
static int save_window_pos = 0, pause_state = 0;
|
||||
static int dpi = 96;
|
||||
static int padded_frame = 0;
|
||||
@@ -295,6 +298,7 @@ ResetAllMenus(void)
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
static LRESULT CALLBACK
|
||||
LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@@ -326,6 +330,7 @@ LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
@@ -360,7 +365,9 @@ plat_power_off(void)
|
||||
run before the main thread is terminated */
|
||||
cycles -= 99999999;
|
||||
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
#endif
|
||||
|
||||
KillTimer(hwndMain, TIMER_1SEC);
|
||||
PostQuitMessage(0);
|
||||
|
||||
Reference in New Issue
Block a user