mirror of
https://github.com/holub/mame
synced 2025-06-04 11:56:28 +03:00
imds2: printer output completed, seems OK
This commit is contained in:
parent
5f5b432cc6
commit
a7402d0c96
@ -35,7 +35,7 @@
|
||||
//
|
||||
// This board acts as a controller for all I/O of the system.
|
||||
// It is structured as if it were 2 boards in one:
|
||||
// One part (around 8080) controls Keyboard, CRT & floppy, the other part (around PIO 8741) controls all parallel I/Os
|
||||
// One part (around 8080) controls Keyboard, CRT & floppy, the other part (around PIO 8041A) controls all parallel I/Os
|
||||
// (Line printer, Paper tape puncher, Paper tape reader, I/O to PROM programmer).
|
||||
// Both parts are interfaced to IPC through a bidirectional 8-bit bus.
|
||||
// IOC is composed of these parts:
|
||||
@ -51,7 +51,7 @@
|
||||
// A20 8275 CRT controller
|
||||
// A19 2708 Character generator ROM
|
||||
// LS1 3.3 kHz beeper
|
||||
//*A72 8741-4 CPU @ 6 MHz (PIO: parallel I/O)
|
||||
// A72 8041A CPU @ 6 MHz (PIO: parallel I/O)
|
||||
//
|
||||
// **********
|
||||
// Keyboard controller
|
||||
@ -63,8 +63,6 @@
|
||||
// ICs that are not emulated yet are marked with "*"
|
||||
//
|
||||
// TODO:
|
||||
// - Emulate PIO. No known dumps of its ROM are available, though.
|
||||
// - Emulate line printer output on PIO
|
||||
// - Emulate serial channels on IPC
|
||||
// - Emulate PIT on IPC
|
||||
// - Adjust speed of processors. Wait states are not accounted for yet.
|
||||
@ -86,8 +84,6 @@
|
||||
// should be mounted and the system reset. After a few seconds the ISIS-II
|
||||
// prompt should appear. A command that could be tried is "DIR" that lists
|
||||
// the content of floppy disk.
|
||||
// Please note that the message "FAILURE -- PIO NOT RESPONDING" is normal
|
||||
// as the support for PIO isn't implemented yet
|
||||
|
||||
#include "includes/imds2.h"
|
||||
|
||||
@ -174,6 +170,7 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const
|
||||
m_palette(*this , "palette"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_floppy0(*this , FLOPPY_0),
|
||||
m_centronics(*this , "centronics"),
|
||||
m_io_key0(*this , "KEY0"),
|
||||
m_io_key1(*this , "KEY1"),
|
||||
m_io_key2(*this , "KEY2"),
|
||||
@ -182,7 +179,8 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const
|
||||
m_io_key5(*this , "KEY5"),
|
||||
m_io_key6(*this , "KEY6"),
|
||||
m_io_key7(*this , "KEY7"),
|
||||
m_ioc_options(*this , "IOC_OPTS")
|
||||
m_ioc_options(*this , "IOC_OPTS"),
|
||||
m_device_status_byte(0xff)
|
||||
{
|
||||
}
|
||||
|
||||
@ -439,8 +437,13 @@ WRITE8_MEMBER(imds2_state::imds2_ioc_mem_w)
|
||||
|
||||
READ8_MEMBER(imds2_state::imds2_pio_port_p1_r)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
// If STATUS ENABLE/ == 0 return inverted device status byte, else return 0xff
|
||||
// STATUS ENABLE/ == 0 when P23-P20 == 12 & P24 == 0 & P25 = 1 & P26 = 1
|
||||
if ((m_pio_port2 & 0x7f) == 0x6c) {
|
||||
return ~m_device_status_byte;
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(imds2_state::imds2_pio_port_p1_w)
|
||||
@ -462,6 +465,34 @@ WRITE8_MEMBER(imds2_state::imds2_pio_port_p2_w)
|
||||
m_ipclocpic->ir5_w(BIT(data , 7));
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_ack_w)
|
||||
{
|
||||
if (state) {
|
||||
m_device_status_byte |= 0x20;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x20;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_busy_w)
|
||||
{
|
||||
// Busy is active high in centronics_device whereas it's active low in MDS
|
||||
if (!state) {
|
||||
m_device_status_byte |= 0x10;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x10;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_select_w)
|
||||
{
|
||||
if (state) {
|
||||
m_device_status_byte |= 0x40;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x40;
|
||||
}
|
||||
}
|
||||
|
||||
I8275_DRAW_CHARACTER_MEMBER(imds2_state::crtc_display_pixels)
|
||||
{
|
||||
unsigned i;
|
||||
@ -574,7 +605,24 @@ void imds2_state::imds2_update_beeper(void)
|
||||
|
||||
void imds2_state::imds2_update_printer(void)
|
||||
{
|
||||
// TODO
|
||||
// Data to printer is ~P1 when STATUS ENABLE/==1, else 0xff (assuming pull-ups on printer)
|
||||
UINT8 printer_data;
|
||||
if ((m_pio_port2 & 0x7f) == 0x6c) {
|
||||
printer_data = 0xff;
|
||||
} else {
|
||||
printer_data = ~m_pio_port1;
|
||||
}
|
||||
m_centronics->write_data0(BIT(printer_data , 0));
|
||||
m_centronics->write_data1(BIT(printer_data , 1));
|
||||
m_centronics->write_data2(BIT(printer_data , 2));
|
||||
m_centronics->write_data3(BIT(printer_data , 3));
|
||||
m_centronics->write_data4(BIT(printer_data , 4));
|
||||
m_centronics->write_data5(BIT(printer_data , 5));
|
||||
m_centronics->write_data6(BIT(printer_data , 6));
|
||||
m_centronics->write_data7(BIT(printer_data , 7));
|
||||
|
||||
// LPT DATA STROBE/ == 0 when P23-P20 == 9 & P24 == 0
|
||||
m_centronics->write_strobe((m_pio_port2 & 0x1f) != 0x09);
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START(imds2)
|
||||
@ -773,6 +821,11 @@ static MACHINE_CONFIG_START(imds2 , imds2_state)
|
||||
MCFG_CPU_ADD("kbcpu", I8741, XTAL_3_579545MHz) /* 3.579545 MHz */
|
||||
MCFG_CPU_IO_MAP(kb_io_map)
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(100))
|
||||
|
||||
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
|
||||
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_ack_w))
|
||||
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_busy_w))
|
||||
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_select_w))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START(imds2)
|
||||
@ -789,7 +842,7 @@ ROM_START(imds2)
|
||||
|
||||
// ROM definition of PIO controller (8041A)
|
||||
ROM_REGION(0x400 , "iocpio" , 0)
|
||||
ROM_LOAD("pio_a72.bin" , 0 , 0x400 , CRC(c1eabf25))
|
||||
ROM_LOAD("pio_a72.bin" , 0 , 0x400 , BAD_DUMP CRC(9a446534))
|
||||
|
||||
// ROM definition of keyboard controller (8741)
|
||||
ROM_REGION(0x400 , "kbcpu" , 0)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "machine/pic8259.h"
|
||||
#include "machine/i8271.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
class imds2_state : public driver_device
|
||||
{
|
||||
@ -57,6 +58,9 @@ class imds2_state : public driver_device
|
||||
DECLARE_WRITE8_MEMBER(imds2_pio_port_p1_w);
|
||||
DECLARE_READ8_MEMBER(imds2_pio_port_p2_r);
|
||||
DECLARE_WRITE8_MEMBER(imds2_pio_port_p2_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_ack_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_busy_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_select_w);
|
||||
|
||||
I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels);
|
||||
|
||||
@ -80,6 +84,7 @@ class imds2_state : public driver_device
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<legacy_floppy_image_device> m_floppy0;
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_ioport m_io_key0;
|
||||
required_ioport m_io_key1;
|
||||
required_ioport m_io_key2;
|
||||
@ -129,6 +134,9 @@ class imds2_state : public driver_device
|
||||
|
||||
// PIO port 2
|
||||
UINT8 m_pio_port2;
|
||||
|
||||
// PIO device status byte
|
||||
UINT8 m_device_status_byte;
|
||||
};
|
||||
|
||||
#endif /* _IMDS2_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user