Honor the composite mode of the PCjr and Tandy 1000
And actually fix the way it's activated.
This commit is contained in:
@@ -1438,6 +1438,34 @@ speed_changed(void *priv)
|
|||||||
recalc_timings(pcjr);
|
recalc_timings(pcjr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
pcjr_vid_init(pcjr_t *pcjr)
|
||||||
|
{
|
||||||
|
int display_type;
|
||||||
|
|
||||||
|
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_dram);
|
||||||
|
|
||||||
|
pcjr->memctrl = -1;
|
||||||
|
if (mem_size < 128)
|
||||||
|
pcjr->memctrl &= ~0x24;
|
||||||
|
|
||||||
|
display_type = device_get_config_int("display_type");
|
||||||
|
pcjr->composite = (display_type != PCJR_RGB);
|
||||||
|
pcjr->apply_hd = device_get_config_int("apply_hd");
|
||||||
|
overscan_x = 256;
|
||||||
|
overscan_y = 32;
|
||||||
|
|
||||||
|
mem_mapping_add(&pcjr->mapping, 0xb8000, 0x08000,
|
||||||
|
vid_read, NULL, NULL,
|
||||||
|
vid_write, NULL, NULL, NULL, 0, pcjr);
|
||||||
|
io_sethandler(0x03d0, 16,
|
||||||
|
vid_in, NULL, NULL, vid_out, NULL, NULL, pcjr);
|
||||||
|
timer_add(&pcjr->timer, vid_poll, pcjr, 1);
|
||||||
|
|
||||||
|
cga_palette = 0;
|
||||||
|
cgapal_rebuild();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pit_irq0_timer_pcjr(int new_out, int old_out, UNUSED(void *priv))
|
pit_irq0_timer_pcjr(int new_out, int old_out, UNUSED(void *priv))
|
||||||
{
|
{
|
||||||
@@ -1494,7 +1522,6 @@ const device_t pcjr_device = {
|
|||||||
int
|
int
|
||||||
machine_pcjr_init(UNUSED(const machine_t *model))
|
machine_pcjr_init(UNUSED(const machine_t *model))
|
||||||
{
|
{
|
||||||
int display_type;
|
|
||||||
pcjr_t *pcjr;
|
pcjr_t *pcjr;
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
@@ -1507,14 +1534,6 @@ machine_pcjr_init(UNUSED(const machine_t *model))
|
|||||||
|
|
||||||
pcjr = malloc(sizeof(pcjr_t));
|
pcjr = malloc(sizeof(pcjr_t));
|
||||||
memset(pcjr, 0x00, sizeof(pcjr_t));
|
memset(pcjr, 0x00, sizeof(pcjr_t));
|
||||||
pcjr->memctrl = -1;
|
|
||||||
if (mem_size < 128)
|
|
||||||
pcjr->memctrl &= ~0x24;
|
|
||||||
display_type = machine_get_config_int("display_type");
|
|
||||||
pcjr->composite = (display_type != PCJR_RGB);
|
|
||||||
pcjr->apply_hd = machine_get_config_int("apply_hd");
|
|
||||||
overscan_x = 256;
|
|
||||||
overscan_y = 32;
|
|
||||||
|
|
||||||
pic_init_pcjr();
|
pic_init_pcjr();
|
||||||
pit_common_init(0, pit_irq0_timer_pcjr, NULL);
|
pit_common_init(0, pit_irq0_timer_pcjr, NULL);
|
||||||
@@ -1524,16 +1543,10 @@ machine_pcjr_init(UNUSED(const machine_t *model))
|
|||||||
/* Initialize the video controller. */
|
/* Initialize the video controller. */
|
||||||
video_reset(gfxcard[0]);
|
video_reset(gfxcard[0]);
|
||||||
loadfont("roms/video/mda/mda.rom", 0);
|
loadfont("roms/video/mda/mda.rom", 0);
|
||||||
mem_mapping_add(&pcjr->mapping, 0xb8000, 0x08000,
|
device_context(&pcjr_device);
|
||||||
vid_read, NULL, NULL,
|
pcjr_vid_init(pcjr);
|
||||||
vid_write, NULL, NULL, NULL, 0, pcjr);
|
device_context_restore();
|
||||||
io_sethandler(0x03d0, 16,
|
|
||||||
vid_in, NULL, NULL, vid_out, NULL, NULL, pcjr);
|
|
||||||
timer_add(&pcjr->timer, vid_poll, pcjr, 1);
|
|
||||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_dram);
|
|
||||||
device_add_ex(&pcjr_device, pcjr);
|
device_add_ex(&pcjr_device, pcjr);
|
||||||
cga_palette = 0;
|
|
||||||
cgapal_rebuild();
|
|
||||||
|
|
||||||
/* Initialize the keyboard. */
|
/* Initialize the keyboard. */
|
||||||
keyboard_scan = 1;
|
keyboard_scan = 1;
|
||||||
|
@@ -1328,11 +1328,10 @@ vid_init(tandy_t *dev)
|
|||||||
vid = malloc(sizeof(t1kvid_t));
|
vid = malloc(sizeof(t1kvid_t));
|
||||||
memset(vid, 0x00, sizeof(t1kvid_t));
|
memset(vid, 0x00, sizeof(t1kvid_t));
|
||||||
vid->memctrl = -1;
|
vid->memctrl = -1;
|
||||||
dev->vid = vid;
|
|
||||||
|
|
||||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_dram);
|
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_dram);
|
||||||
|
|
||||||
display_type = machine_get_config_int("display_type");
|
display_type = device_get_config_int("display_type");
|
||||||
vid->composite = (display_type != TANDY_RGB);
|
vid->composite = (display_type != TANDY_RGB);
|
||||||
|
|
||||||
cga_comp_init(1);
|
cga_comp_init(1);
|
||||||
@@ -1345,11 +1344,14 @@ vid_init(tandy_t *dev)
|
|||||||
io_sethandler(0x0065, 1, vid_in, NULL, NULL, vid_out, NULL, NULL, dev);
|
io_sethandler(0x0065, 1, vid_in, NULL, NULL, vid_out, NULL, NULL, dev);
|
||||||
} else
|
} else
|
||||||
vid->b8000_mask = 0x3fff;
|
vid->b8000_mask = 0x3fff;
|
||||||
|
|
||||||
timer_add(&vid->timer, vid_poll, dev, 1);
|
timer_add(&vid->timer, vid_poll, dev, 1);
|
||||||
mem_mapping_add(&vid->mapping, 0xb8000, 0x08000,
|
mem_mapping_add(&vid->mapping, 0xb8000, 0x08000,
|
||||||
vid_read, NULL, NULL, vid_write, NULL, NULL, NULL, 0, dev);
|
vid_read, NULL, NULL, vid_write, NULL, NULL, NULL, 0, dev);
|
||||||
io_sethandler(0x03d0, 16,
|
io_sethandler(0x03d0, 16,
|
||||||
vid_in, NULL, NULL, vid_out, NULL, NULL, dev);
|
vid_in, NULL, NULL, vid_out, NULL, NULL, dev);
|
||||||
|
|
||||||
|
dev->vid = vid;
|
||||||
}
|
}
|
||||||
|
|
||||||
const device_config_t vid_config[] = {
|
const device_config_t vid_config[] = {
|
||||||
@@ -1771,7 +1773,9 @@ machine_tandy1k_init(const machine_t *model, int type)
|
|||||||
keyboard_set_table(scancode_tandy);
|
keyboard_set_table(scancode_tandy);
|
||||||
io_sethandler(0x00a0, 1,
|
io_sethandler(0x00a0, 1,
|
||||||
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
||||||
|
device_context(&vid_device);
|
||||||
vid_init(dev);
|
vid_init(dev);
|
||||||
|
device_context_restore();
|
||||||
device_add_ex(&vid_device, dev);
|
device_add_ex(&vid_device, dev);
|
||||||
device_add((type == TYPE_TANDY1000SX) ? &ncr8496_device : &sn76489_device);
|
device_add((type == TYPE_TANDY1000SX) ? &ncr8496_device : &sn76489_device);
|
||||||
break;
|
break;
|
||||||
@@ -1781,8 +1785,10 @@ machine_tandy1k_init(const machine_t *model, int type)
|
|||||||
keyboard_set_table(scancode_tandy);
|
keyboard_set_table(scancode_tandy);
|
||||||
io_sethandler(0x00a0, 1,
|
io_sethandler(0x00a0, 1,
|
||||||
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
||||||
|
device_context(&vid_device_hx);
|
||||||
vid_init(dev);
|
vid_init(dev);
|
||||||
device_add_ex(&vid_device, dev);
|
device_context_restore();
|
||||||
|
device_add_ex(&vid_device_hx, dev);
|
||||||
device_add(&ncr8496_device);
|
device_add(&ncr8496_device);
|
||||||
device_add(&eep_1000hx_device);
|
device_add(&eep_1000hx_device);
|
||||||
break;
|
break;
|
||||||
@@ -1792,7 +1798,9 @@ machine_tandy1k_init(const machine_t *model, int type)
|
|||||||
init_rom(dev);
|
init_rom(dev);
|
||||||
io_sethandler(0xffe8, 8,
|
io_sethandler(0xffe8, 8,
|
||||||
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
tandy_read, NULL, NULL, tandy_write, NULL, NULL, dev);
|
||||||
|
device_context(&vid_device_sl);
|
||||||
vid_init(dev);
|
vid_init(dev);
|
||||||
|
device_context_restore();
|
||||||
device_add_ex(&vid_device_sl, dev);
|
device_add_ex(&vid_device_sl, dev);
|
||||||
device_add(&pssj_device);
|
device_add(&pssj_device);
|
||||||
device_add(&eep_1000sl2_device);
|
device_add(&eep_1000sl2_device);
|
||||||
|
Reference in New Issue
Block a user