(MESS) mbee : fixed printer (nw)

This commit is contained in:
Robbbert 2015-02-14 15:02:56 +11:00
parent 6d541f19a2
commit 20b68364f7
3 changed files with 76 additions and 87 deletions

View File

@ -51,9 +51,10 @@
These early colour computers have a PROM to create the foreground palette.
Notes about the printer:
- When computer turned on, defaults to 1200 baud serial printer
- Change it to parallel by entering OUTL#1
- After you mount/create a printfile, you can LPRINT and LLIST.
- Older models default to a 1200 baud serial printer, which we do not support.
- You need to change it to parallel by entering OUTL#1 while in Basic.
- After you mount/create a printfile, you can LPRINT and LLIST in Basic,
or by using the printing option in other apps.
Notes about Telcom:
- On the older models, Telcom is called up by entering NET from within Basic. Models
@ -91,13 +92,11 @@
TODO/not working:
- Printer needs to be understood and fixed.
- 256tc: Paste ignores shift key
- All others: Paste drops most characters, shift operates randomly.
- various fdc issues:
- B drive doesn't work.
- B drive doesn't work with most disks.
- some disks cause MESS to freeze.
- ENMF pin missing from wd_fdc.
- incorrect timing for track register causes 256tc failure to boot a disk.
@ -287,7 +286,7 @@ static ADDRESS_MAP_START(mbee56_io, AS_IO, 8, mbee_state)
AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
AM_RANGE(0x48, 0x4f) AM_READWRITE(mbee_fdc_status_r, mbee_fdc_motor_w)
AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START(mbee128_io, AS_IO, 8, mbee_state)
@ -303,7 +302,7 @@ static ADDRESS_MAP_START(mbee128_io, AS_IO, 8, mbee_state)
AM_RANGE(0x0d, 0x0d) AM_READWRITE(m6545_data_r, m6545_data_w)
AM_RANGE(0x1c, 0x1f) AM_READWRITE(mbeeppc_1c_r, mbee256_1c_w)
AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
AM_RANGE(0x48, 0x4f) AM_READWRITE(mbee_fdc_status_r, mbee_fdc_motor_w)
AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
AM_RANGE(0x50, 0x57) AM_WRITE(mbee128_50_w)
ADDRESS_MAP_END
@ -323,7 +322,7 @@ static ADDRESS_MAP_START(mbee256_io, AS_IO, 8, mbee_state)
AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(mbee256_18_r)
AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(mbeeppc_1c_r, mbee256_1c_w)
AM_RANGE(0x0044, 0x0047) AM_MIRROR(0xff00) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
AM_RANGE(0x0048, 0x004f) AM_MIRROR(0xff00) AM_READWRITE(mbee_fdc_status_r, mbee_fdc_motor_w)
AM_RANGE(0x0048, 0x004f) AM_MIRROR(0xff00) AM_READWRITE(fdc_status_r, fdc_motor_w)
AM_RANGE(0x0050, 0x0057) AM_MIRROR(0xff00) AM_WRITE(mbee256_50_w)
// AM_RANGE(0x0058, 0x005f) AM_MIRROR(0xff00) External options: floppy drive, hard drive and keyboard
// AM_RANGE(0x0060, 0x0067) AM_MIRROR(0xff00) Reserved for file server selection (unused)
@ -635,7 +634,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL_12MHz / 6)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_Z80PIO_OUT_PA_CB(WRITE8(mbee_state, pio_port_a_w))
MCFG_Z80PIO_OUT_PA_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(mbee_state, pio_ardy))
MCFG_Z80PIO_IN_PB_CB(READ8(mbee_state, pio_port_b_r))
MCFG_Z80PIO_OUT_PB_CB(WRITE8(mbee_state, pio_port_b_w))
@ -671,6 +670,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("z80pio", z80pio_device, strobe_a))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
@ -691,7 +691,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
MCFG_DEVICE_ADD("z80pio", Z80PIO, 3375000)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_Z80PIO_OUT_PA_CB(WRITE8(mbee_state, pio_port_a_w))
MCFG_Z80PIO_OUT_PA_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(mbee_state, pio_ardy))
MCFG_Z80PIO_IN_PB_CB(READ8(mbee_state, pio_port_b_r))
MCFG_Z80PIO_OUT_PB_CB(WRITE8(mbee_state, pio_port_b_w))
@ -729,6 +729,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("z80pio", z80pio_device, strobe_a))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")

View File

@ -18,7 +18,6 @@
#include "sound/speaker.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "machine/mc146818.h"
#include "sound/wave.h"
#include "machine/wd_fdc.h"
@ -28,9 +27,9 @@ class mbee_state : public driver_device
public:
enum
{
TIMER_MBEE256_KBD,
TIMER_MBEE_NEWKB,
TIMER_MBEE_RTC_IRQ,
TIMER_MBEE_RESET
TIMER_MBEE_BOOT
};
mbee_state(const machine_config &mconfig, device_type type, const char *tag)
@ -69,7 +68,6 @@ public:
DECLARE_READ8_MEMBER(mbee256_speed_low_r);
DECLARE_READ8_MEMBER(mbee256_speed_high_r);
DECLARE_READ8_MEMBER(mbee256_18_r);
DECLARE_WRITE8_MEMBER(mbee64_50_w);
DECLARE_WRITE8_MEMBER(mbee128_50_w);
DECLARE_WRITE8_MEMBER(mbee256_50_w);
DECLARE_READ8_MEMBER(m6545_status_r);
@ -93,13 +91,12 @@ public:
DECLARE_READ8_MEMBER(mbeeppc_high_r);
DECLARE_WRITE8_MEMBER(mbeeppc_high_w);
DECLARE_WRITE8_MEMBER(mbeeppc_low_w);
DECLARE_WRITE8_MEMBER(pio_port_a_w);
DECLARE_WRITE8_MEMBER(pio_port_b_w);
DECLARE_READ8_MEMBER(pio_port_b_r);
DECLARE_WRITE_LINE_MEMBER(pio_ardy);
DECLARE_WRITE_LINE_MEMBER(crtc_vs);
DECLARE_READ8_MEMBER(mbee_fdc_status_r);
DECLARE_WRITE8_MEMBER(mbee_fdc_motor_w);
DECLARE_READ8_MEMBER(fdc_status_r);
DECLARE_WRITE8_MEMBER(fdc_motor_w);
DECLARE_DRIVER_INIT(mbeepc85);
DECLARE_DRIVER_INIT(mbee256);
DECLARE_DRIVER_INIT(mbee56);
@ -121,10 +118,9 @@ public:
DECLARE_MACHINE_RESET(mbee256);
DECLARE_MACHINE_RESET(mbeett);
UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mbee_interrupt);
TIMER_CALLBACK_MEMBER(mbee256_kbd);
TIMER_CALLBACK_MEMBER(mbee_rtc_irq);
TIMER_CALLBACK_MEMBER(mbee_reset);
TIMER_CALLBACK_MEMBER(timer_newkb);
TIMER_CALLBACK_MEMBER(timer_rtc_irq);
TIMER_CALLBACK_MEMBER(timer_boot);
DECLARE_QUICKLOAD_LOAD_MEMBER(mbee);
DECLARE_QUICKLOAD_LOAD_MEMBER(mbee_z80bin);
WRITE_LINE_MEMBER(fdc_intrq_w);
@ -151,6 +147,7 @@ private:
bool m_b7_rtc;
bool m_b7_vs;
bool m_b2;
bool m_is_mbeett;
UINT8 m_mbee256_was_pressed[15];
UINT8 m_mbee256_q[20];
UINT8 m_mbee256_q_pos;

View File

@ -5,6 +5,7 @@
machine driver
Juergen Buchmueller <pullmoll@t-online.de>, Jan 2000
Rewritten by Robbbert
****************************************************************************/
@ -16,14 +17,14 @@ void mbee_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
{
switch (id)
{
case TIMER_MBEE256_KBD:
mbee256_kbd(ptr, param);
case TIMER_MBEE_NEWKB:
timer_newkb(ptr, param);
break;
case TIMER_MBEE_RTC_IRQ:
mbee_rtc_irq(ptr, param);
timer_rtc_irq(ptr, param);
break;
case TIMER_MBEE_RESET:
mbee_reset(ptr, param);
case TIMER_MBEE_BOOT:
timer_boot(ptr, param);
break;
default:
assert_always(FALSE, "Unknown id in mbee_state::device_timer");
@ -42,13 +43,6 @@ WRITE_LINE_MEMBER( mbee_state::pio_ardy )
m_centronics->write_strobe((state) ? 0 : 1);
}
WRITE8_MEMBER( mbee_state::pio_port_a_w )
{
/* hardware strobe driven by PIO ARDY, bit 7..0 = data */
m_pio->strobe_a(1); /* needed - otherwise nothing prints */
m_cent_data_out->write(space, 0, data);
};
WRITE8_MEMBER( mbee_state::pio_port_b_w )
{
/* PIO port B - d5..d2 not emulated
@ -72,27 +66,37 @@ READ8_MEMBER( mbee_state::pio_port_b_r )
if (m_cassette->input() > 0.03) data |= 1;
switch (m_io_config->read() & 0xc0)
{
case 0x00:
data |= (UINT8)m_b7_vs << 7;
break;
case 0x40:
data |= (UINT8)m_b7_rtc << 7;
break;
case 0x80:
data |= 0x80;
break;
case 0xc0:
data |= 0x80; // centronics busy line - FIXME
break;
}
data |= (UINT8)m_b2 << 1; // key pressed on new keyboard
data |= 8; // CTS held high via resistor. If low, the disk-based models think a mouse is plugged in.
if (m_is_mbeett)
{
if (m_b2)
data |= 0x82;
else
data |= 0x80;
}
else
{
switch (m_io_config->read() & 0xc0)
{
case 0x00:
data |= (UINT8)m_b7_vs << 7;
break;
case 0x40:
data |= (UINT8)m_b7_rtc << 7;
break;
case 0x80:
data |= 0x80;
break;
case 0xc0:
data |= 0x80; // centronics busy line - FIXME
break;
}
data |= (UINT8)m_b2 << 1; // key pressed on new keyboard
}
return data;
};
}
/*************************************************************************************
@ -113,7 +117,7 @@ WRITE_LINE_MEMBER( mbee_state::fdc_drq_w )
m_fdc_rq = (m_fdc_rq & 1) | (state << 1);
}
READ8_MEMBER( mbee_state::mbee_fdc_status_r )
READ8_MEMBER( mbee_state::fdc_status_r )
{
/* d7 indicate if IRQ or DRQ is occurring (1=happening)
d6..d0 not used */
@ -121,7 +125,7 @@ READ8_MEMBER( mbee_state::mbee_fdc_status_r )
return m_fdc_rq ? 0xff : 0x7f;
}
WRITE8_MEMBER( mbee_state::mbee_fdc_motor_w )
WRITE8_MEMBER( mbee_state::fdc_motor_w )
{
/* d7..d4 not used
d3 density (1=MFM)
@ -152,7 +156,7 @@ WRITE8_MEMBER( mbee_state::mbee_fdc_motor_w )
************************************************************/
TIMER_CALLBACK_MEMBER(mbee_state::mbee256_kbd)
TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb )
{
/* Keyboard scanner is a Mostek M3870 chip. Its speed of operation is determined by a 15k resistor on
pin 2 (XTL2) and is therefore 2MHz. If a key change is detected (up or down), the /strobe
@ -179,7 +183,8 @@ TIMER_CALLBACK_MEMBER(mbee_state::mbee256_kbd)
if (BIT(pressed^m_mbee256_was_pressed[i], j))
{
// put it in the queue
m_mbee256_q[m_mbee256_q_pos] = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0);
UINT8 code = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0);
m_mbee256_q[m_mbee256_q_pos] = code;
if (m_mbee256_q_pos < 19) m_mbee256_q_pos++;
}
}
@ -194,7 +199,7 @@ TIMER_CALLBACK_MEMBER(mbee_state::mbee256_kbd)
//breaks keyboard m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
}
timer_set(attotime::from_hz(25), TIMER_MBEE256_KBD);
timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB);
}
READ8_MEMBER( mbee_state::mbee256_18_r )
@ -254,7 +259,7 @@ READ8_MEMBER( mbee_state::mbee_07_r ) // read
}
// This doesn't seem to do anything; the time works without it.
TIMER_CALLBACK_MEMBER( mbee_state::mbee_rtc_irq )
TIMER_CALLBACK_MEMBER( mbee_state::timer_rtc_irq )
{
if (!m_rtc)
return;
@ -467,7 +472,7 @@ READ8_MEMBER( mbee_state::mbeepc_telcom_high_r )
/* after the first 4 bytes have been read from ROM, switch the ram back in */
TIMER_CALLBACK_MEMBER( mbee_state::mbee_reset )
TIMER_CALLBACK_MEMBER( mbee_state::timer_boot )
{
m_boot->set_entry(0);
}
@ -480,14 +485,14 @@ void mbee_state::machine_reset_common_disk()
MACHINE_RESET_MEMBER( mbee_state, mbee )
{
m_boot->set_entry(1);
timer_set(attotime::from_usec(4), TIMER_MBEE_RESET);
timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
}
MACHINE_RESET_MEMBER( mbee_state, mbee56 )
{
machine_reset_common_disk();
m_boot->set_entry(1);
timer_set(attotime::from_usec(4), TIMER_MBEE_RESET);
timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
}
MACHINE_RESET_MEMBER( mbee_state, mbee128 )
@ -513,30 +518,7 @@ MACHINE_RESET_MEMBER( mbee_state, mbeett )
for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0;
m_mbee256_q_pos = 0;
m_boot->set_entry(1);
timer_set(attotime::from_usec(4), TIMER_MBEE_RESET);
}
INTERRUPT_GEN_MEMBER( mbee_state::mbee_interrupt )
{
// Due to the uncertainly and hackage here, this is commented out for now - Robbbert - 05-Oct-2010
#if 0
//address_space &space = m_maincpu->space(AS_PROGRAM);
/* The printer status connects to the pio ASTB pin, and the printer changing to not
busy should signal an interrupt routine at B61C, (next line) but this doesn't work.
The line below does what the interrupt should be doing. */
/* But it would break any program loaded to that area of memory, such as CP/M programs */
//m_z80pio->strobe_a(centronics_busy_r(m_centronics)); /* signal int when not busy (L->H) */
//space.write_byte(0x109, centronics_busy_r(m_centronics));
/* once per frame, pulse the PIO B bit 7 - it is in the schematic as an option,
but need to find out what it does */
m_b7_busy = 0x80;
irq0_line_hold(device);
#endif
timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
}
DRIVER_INIT_MEMBER( mbee_state, mbee )
@ -545,6 +527,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbee )
m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
m_size = 0x4000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbeeic )
@ -558,6 +541,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeeic )
m_pak->set_entry(0);
m_size = 0x8000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbeepc )
@ -575,6 +559,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeepc )
m_telcom->set_entry(0);
m_size = 0x8000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbeepc85 )
@ -592,6 +577,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeepc85 )
m_telcom->set_entry(0);
m_size = 0x8000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbeeppc )
@ -614,6 +600,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbeeppc )
m_basic->set_entry(0);
m_size = 0x8000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbee56 )
@ -622,6 +609,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbee56 )
m_boot->configure_entries(0, 2, &RAM[0x0000], 0xe000);
m_size = 0xe000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbee128 )
@ -645,6 +633,7 @@ DRIVER_INIT_MEMBER( mbee_state, mbee128 )
m_size = 0x8000;
m_has_oldkb = 1;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbee256 )
@ -665,10 +654,11 @@ DRIVER_INIT_MEMBER( mbee_state, mbee256 )
}
timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ); /* timer for rtc */
timer_set(attotime::from_hz(50), TIMER_MBEE256_KBD); /* timer for kbd */
timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB); /* timer for kbd */
m_size = 0x8000;
m_has_oldkb = 0;
m_is_mbeett = 0;
}
DRIVER_INIT_MEMBER( mbee_state, mbeett )
@ -686,10 +676,11 @@ DRIVER_INIT_MEMBER( mbee_state, mbeett )
m_telcom->set_entry(0);
timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ); /* timer for rtc */
timer_set(attotime::from_hz(25), TIMER_MBEE256_KBD); /* timer for kbd */
timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB); /* timer for kbd */
m_size = 0x8000;
m_has_oldkb = 0;
m_is_mbeett = 1;
}