mirror of
https://github.com/holub/mame
synced 2025-05-28 08:33:05 +03:00
Apollo changes: [Hans Ostermeyer]
- fixed the Apollo floppy disk emulation - added the media option -node_id resp. -ni to set the node ID from a node ID rom image file - fixed the unmapped ISA Bus access to return 0xff instead of 0x00 - removed excessive log entries from unmapped ISA Bus access - fixed date (and some other issues) in mc146818 (new in MAME 0166)
This commit is contained in:
parent
e0297123c2
commit
bd5fca7042
@ -215,7 +215,8 @@ MACHINE_CONFIG_FRAGMENT( omti_disk )
|
||||
MCFG_PC_FDC_INTRQ_CALLBACK(WRITELINE(omti8621_device, fdc_irq_w))
|
||||
MCFG_PC_FDC_DRQ_CALLBACK(WRITELINE(omti8621_device, fdc_drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD(OMTI_FDC_TAG":0", pc_hd_floppies, "525hd", omti8621_device::floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD(OMTI_FDC_TAG":1", pc_hd_floppies, "525hd", omti8621_device::floppy_formats)
|
||||
// Apollo workstations never have more then 1 floppy drive
|
||||
// MCFG_FLOPPY_DRIVE_ADD(OMTI_FDC_TAG":1", pc_hd_floppies, "525hd", omti8621_device::floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
FLOPPY_FORMATS_MEMBER( omti8621_device::floppy_formats )
|
||||
@ -231,8 +232,12 @@ ROM_START( omti8621 )
|
||||
ROM_REGION(0x4000, OMTI_CPU_REGION, 0) // disassembles fine as Z8 code
|
||||
ROM_LOAD( "omti_8621_102640-b.bin", 0x000000, 0x004000, CRC(e6f20dbb) SHA1(cf1990ad72eac6b296485410f5fa3309a0d6d078) )
|
||||
|
||||
#if 1
|
||||
// OMTI 8621 boards for Apollo workstations never use a BIOS ROM
|
||||
// They don't even have a socket for the BIOS ROM
|
||||
ROM_REGION(0x1000, OMTI_BIOS_REGION, 0)
|
||||
ROM_LOAD("omti_bios", 0x0000, 0x1000, NO_DUMP)
|
||||
ROM_LOAD_OPTIONAL("omti_bios", 0x0000, 0x1000, NO_DUMP)
|
||||
#endif
|
||||
ROM_END
|
||||
|
||||
static INPUT_PORTS_START( omti_port )
|
||||
@ -280,6 +285,8 @@ ioport_constructor omti8621_device::device_input_ports() const
|
||||
|
||||
void omti8621_device::device_start()
|
||||
{
|
||||
LOG2(("device_start"));
|
||||
|
||||
set_isa_device();
|
||||
|
||||
m_installed = false;
|
||||
@ -300,7 +307,7 @@ void omti8621_device::device_reset()
|
||||
{
|
||||
static const int io_bases[8] = { 0x320, 0x324, 0x328, 0x32c, 0x1a0, 0x1a4, 0x1a8, 0x1ac };
|
||||
|
||||
LOG2(("device_reset_omti8621"));
|
||||
LOG2(("device_reset"));
|
||||
|
||||
// you can't read I/O ports in device_start() even if they're required_ioport<> in your class!
|
||||
if (!m_installed)
|
||||
@ -1201,11 +1208,13 @@ void omti8621_device::set_verbose(int on_off)
|
||||
get_sector - get sector diskaddr of logical unit lun into data_buffer
|
||||
***************************************************************************/
|
||||
|
||||
// FIXME: this will work, but is not supported by MESS
|
||||
#if 0 // APOLLO_XXL
|
||||
UINT32 omti8621_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun)
|
||||
{
|
||||
omti_disk_image_device *disk = our_disks[lun];
|
||||
omti_disk_image_device *disk = omti8621_device_1->our_disks[lun];
|
||||
|
||||
if (disk->m_image == NULL || !disk->m_image->exists())
|
||||
if (disk == NULL || disk->m_image == NULL || !disk->m_image->exists())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -1222,7 +1231,7 @@ UINT32 omti8621_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 le
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/***************************************************************************
|
||||
omti_set_jumper - set OMI jumpers
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
static void set_verbose(int on_off);
|
||||
|
||||
// get sector diskaddr of logical unit lun into data_buffer
|
||||
UINT32 get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun);
|
||||
static UINT32 get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun);
|
||||
|
||||
required_device<pc_fdc_interface> m_fdc;
|
||||
required_ioport m_iobase;
|
||||
|
@ -206,9 +206,9 @@ void mc146818_device::nvram_default()
|
||||
}
|
||||
|
||||
if(m_binary)
|
||||
m_data[0x0b] |= REG_B_DM;
|
||||
m_data[REG_B] |= REG_B_DM;
|
||||
if(m_hour)
|
||||
m_data[0x0b] |= REG_B_24_12;
|
||||
m_data[REG_B] |= REG_B_24_12;
|
||||
|
||||
set_base_datetime();
|
||||
update_timer();
|
||||
@ -402,7 +402,7 @@ void mc146818_device::set_base_datetime()
|
||||
set_dayofweek(current_time.weekday + 1);
|
||||
set_dayofmonth(current_time.mday);
|
||||
set_month(current_time.month + 1);
|
||||
set_year((current_time.year - m_epoch) % (m_data[0x0b] & REG_B_DM ? 0x100 : 100));
|
||||
set_year((current_time.year - m_epoch) % 100);
|
||||
|
||||
if (m_century_index >= 0)
|
||||
m_data[m_century_index] = to_ram(current_time.year / 100);
|
||||
|
@ -45,3 +45,12 @@ const apollo_format::format apollo_format::formats[] = {
|
||||
};
|
||||
|
||||
const floppy_format_type FLOPPY_APOLLO_FORMAT = &floppy_image_format_creator<apollo_format>;
|
||||
|
||||
int apollo_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
UINT64 size = io_generic_size(io);
|
||||
UINT32 expected_size = 77*2*8*1024;
|
||||
|
||||
return ((size == expected_size) || (size == 0)) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ class apollo_format : public upd765_format {
|
||||
public:
|
||||
apollo_format();
|
||||
|
||||
virtual int identify(io_generic *io, UINT32 form_factor);
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
|
@ -109,11 +109,6 @@ static int parity_error_handler_install_counter = 0;
|
||||
static UINT16 latch_page_on_parity_error_register = 0x0000;
|
||||
static UINT16 master_req_register = 0x0000;
|
||||
|
||||
// DN3000: Node Id 1D117 at 0x9600 - 0x961f
|
||||
// DN3500: Node Id 2616D at 0x11200 - 0x1121f
|
||||
|
||||
static UINT32 node_id = DEFAULT_NODE_ID;
|
||||
|
||||
static UINT32 ram_base_address;
|
||||
static UINT32 ram_end_address;
|
||||
|
||||
@ -210,14 +205,6 @@ UINT8 apollo_get_ram_config_byte(void) {
|
||||
return ram_config_byte;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
apollo_get_node_id - get the node id
|
||||
***************************************************************************/
|
||||
|
||||
UINT32 apollo_get_node_id(void) {
|
||||
return node_id;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
apollo_instruction_hook
|
||||
must be called by the CPU core before executing each instruction
|
||||
@ -351,38 +338,6 @@ READ8_MEMBER(apollo_state::task_alias_register_r){
|
||||
return data;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
DN3000/DN3500 Node Id PROM at 0x9600/0x11200
|
||||
***************************************************************************/
|
||||
|
||||
WRITE16_MEMBER(apollo_state::apollo_node_id_w){
|
||||
SLOG1(("Error: writing node id ROM at offset %02x = %04x & %04x", offset, data, mem_mask));
|
||||
}
|
||||
|
||||
READ16_MEMBER(apollo_state::apollo_node_id_r){
|
||||
UINT16 data;
|
||||
switch (offset & 0x0f) {
|
||||
case 1: // msb
|
||||
data = (node_id >> 16) & 0xff;
|
||||
break;
|
||||
case 2:
|
||||
data = (node_id >> 8) & 0xff;
|
||||
break;
|
||||
case 3: // lsb
|
||||
data = node_id & 0xff;
|
||||
break;
|
||||
case 15: // checksum
|
||||
data = ((node_id >> 16) + (node_id >> 8) + node_id) & 0xff;
|
||||
break;
|
||||
default:
|
||||
data = 0;
|
||||
break;
|
||||
}
|
||||
data <<= 8;
|
||||
SLOG2(("reading node id ROM at offset %02x = %04x & %04x", offset, data, mem_mask));
|
||||
return data;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
DN3000/DN3500 Latch Page on Parity Error Register at 0x9300/0x11300
|
||||
***************************************************************************/
|
||||
@ -576,7 +531,7 @@ READ16_MEMBER(apollo_state::apollo_atbus_io_r)
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
UINT16 data = m_isa->io16_swap_r(space, isa_addr, mem_mask);
|
||||
|
||||
SLOG2(("apollo_atbus_io_r at %08x -> %04x = %04x & %04x", offset*2, isa_addr*2, data, mem_mask));
|
||||
SLOG2(("apollo_atbus_io_r at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask));
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -585,7 +540,7 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_io_w)
|
||||
{
|
||||
UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7);
|
||||
|
||||
SLOG2(("apollo_atbus_io_w at %08x -> %04x = %04x & %04x", offset*2, isa_addr*2, data, mem_mask));
|
||||
SLOG2(("apollo_atbus_io_w at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask));
|
||||
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
m_isa->io16_swap_w(space, isa_addr, data, mem_mask);
|
||||
@ -597,22 +552,55 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_io_w)
|
||||
|
||||
READ16_MEMBER(apollo_state::apollo_atbus_memory_r)
|
||||
{
|
||||
UINT16 data;
|
||||
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
UINT16 data = m_isa->prog16_swap_r(space, offset, mem_mask);
|
||||
|
||||
SLOG2(("apollo_atbus_memory_r at %08x = %04x & %04x", offset*2, data, mem_mask));
|
||||
data = m_isa->prog16_swap_r(space, offset, mem_mask);
|
||||
|
||||
SLOG2(("apollo_atbus_memory_r at %08x = %04x & %04x", ATBUS_MEMORY_BASE + offset * 2, data, mem_mask));
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(apollo_state::apollo_atbus_memory_w)
|
||||
{
|
||||
SLOG2(("apollo_atbus_memory_w at %08x = %04x & %04x", offset*2, data, mem_mask));
|
||||
SLOG2(("apollo_atbus_memory_w at %08x = %04x & %04x", ATBUS_MEMORY_BASE + offset*2, data, mem_mask));
|
||||
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
m_isa->prog16_swap_w(space, offset, data, mem_mask);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
DN3000/DN3500 AT Bus unmapped read/write
|
||||
***************************************************************************/
|
||||
|
||||
READ16_MEMBER(apollo_state::apollo_atbus_unmap_io_r)
|
||||
{
|
||||
// ISA bus has 0xff for unmapped addresses
|
||||
UINT16 data = 0xffff;
|
||||
UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7);
|
||||
SLOG1(("apollo_atbus_unmap_io_r at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask));
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(apollo_state::apollo_atbus_unmap_io_w)
|
||||
{
|
||||
UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7);
|
||||
SLOG1(("apollo_atbus_unmap_io_w at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask));
|
||||
}
|
||||
|
||||
READ8_MEMBER(apollo_state::apollo_atbus_unmap_r)
|
||||
{
|
||||
// ISA bus has 0xff for unmapped addresses
|
||||
UINT8 data = 0xff;
|
||||
SLOG2(("apollo_atbus_unmap_r at %08x = %02x & %02x", ATBUS_MEMORY_BASE + offset, data, mem_mask));
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(apollo_state::apollo_atbus_unmap_w)
|
||||
{
|
||||
SLOG1(("apollo_atbus_unmap_w at %08x = %02x & %02x", ATBUS_MEMORY_BASE + offset, data, mem_mask));
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
DN5500 Memory Present Register at 0x11400-0x114ff
|
||||
Strange: documented but not used
|
||||
@ -697,7 +685,7 @@ static ADDRESS_MAP_START(dn3500_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
|
||||
AM_RANGE(0x011000, 0x0110ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011100, 0x0111ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011300, 0x0113ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011600, 0x0116ff) AM_READWRITE8(master_req_register_r, master_req_register_w, 0xffffffff)
|
||||
|
||||
@ -741,7 +729,7 @@ static ADDRESS_MAP_START(dsp3500_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
|
||||
AM_RANGE(0x011000, 0x0110ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011100, 0x0111ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011300, 0x0113ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011600, 0x0116ff) AM_READWRITE8(master_req_register_r, master_req_register_w, 0xffffffff)
|
||||
|
||||
@ -772,7 +760,7 @@ static ADDRESS_MAP_START(dn3000_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x009300, 0x0093ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x009400, 0x0094ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x009500, 0x0095ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x009600, 0x0096ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x009600, 0x0096ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
|
||||
AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
|
||||
@ -806,7 +794,7 @@ static ADDRESS_MAP_START(dsp3000_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x009300, 0x0093ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x009400, 0x0094ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x009500, 0x0095ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x009600, 0x0096ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x009600, 0x0096ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
@ -835,7 +823,7 @@ static ADDRESS_MAP_START(dn5500_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
|
||||
AM_RANGE(0x011000, 0x0110ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011100, 0x0111ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011300, 0x0113ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011400, 0x0114ff) AM_READWRITE8(dn5500_memory_present_register_r, dn5500_memory_present_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011500, 0x0115ff) AM_READWRITE8(dn5500_11500_r, dn5500_11500_w, 0xffffffff )
|
||||
@ -882,7 +870,7 @@ static ADDRESS_MAP_START(dsp5500_map, AS_PROGRAM, 32, apollo_state )
|
||||
AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
|
||||
AM_RANGE(0x011000, 0x0110ff) AM_DEVREADWRITE8(APOLLO_PIC1_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011100, 0x0111ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
|
||||
AM_RANGE(0x011200, 0x0112ff) AM_DEVREADWRITE16(APOLLO_NI_TAG, apollo_ni, read, write, 0xffffffff)
|
||||
AM_RANGE(0x011300, 0x0113ff) AM_READWRITE16(latch_page_on_parity_error_register_r, latch_page_on_parity_error_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011400, 0x0114ff) AM_READWRITE8(dn5500_memory_present_register_r, dn5500_memory_present_register_w, 0xffffffff )
|
||||
AM_RANGE(0x011500, 0x0115ff) AM_READWRITE8(dn5500_11500_r, dn5500_11500_w, 0xffffffff )
|
||||
@ -909,34 +897,21 @@ ADDRESS_MAP_END
|
||||
|
||||
void apollo_state::machine_reset()
|
||||
{
|
||||
//MLOG1(("machine_reset_dn3500"));
|
||||
MLOG1(("machine_reset"));
|
||||
|
||||
MACHINE_RESET_CALL_MEMBER(apollo);
|
||||
|
||||
// we can't do this any more
|
||||
#if 0
|
||||
#ifdef APOLLO_XXL
|
||||
// set configuration
|
||||
omti8621_device::set_verbose(apollo_config(APOLLO_CONF_DISK_TRACE));
|
||||
threecom3c505_device::set_verbose(apollo_config(APOLLO_CONF_NET_TRACE));
|
||||
|
||||
if (apollo_config(APOLLO_CONF_NODE_ID))
|
||||
{
|
||||
UINT8 db[0x50];
|
||||
UINT16 sector1 = apollo_is_dn5500() ? 4 : 1;
|
||||
|
||||
// check label of physical volume and get sector data of logical volume 1
|
||||
// Note: sector data starts with 32 byte block header
|
||||
if (omti8621_get_sector(machine().device(APOLLO_WDC_TAG), 0, db, sizeof(db), 0) == sizeof(db) &&
|
||||
memcmp (db+0x22, "APOLLO", 6) == 0 &&
|
||||
omti8621_get_sector(machine().device(APOLLO_WDC_TAG), sector1, db, sizeof(db), 0) == sizeof(db))
|
||||
{
|
||||
// set node_id from UID of logical volume 1 of logical unit 0
|
||||
node_id = (((db[0x49] << 8) | db[0x4a]) << 8) | db[0x4b];
|
||||
|
||||
MLOG2(("machine_reset_dn3500: node ID is %06X (from disk)", node_id));
|
||||
}
|
||||
// set node ID from UID of logical volume 1 of logical unit 0
|
||||
m_node_id->set_node_id_from_disk();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_maincpu->set_instruction_hook(read32_delegate(FUNC(apollo_state::apollo_instruction_hook),this));
|
||||
}
|
||||
@ -955,6 +930,9 @@ WRITE_LINE_MEMBER(apollo_state::apollo_reset_instr_callback)
|
||||
{
|
||||
machine().device(APOLLO_SCREEN_TAG)->reset();
|
||||
machine().device(APOLLO_KBD_TAG )->reset();
|
||||
#ifdef APOLLO_XXL
|
||||
machine().device(APOLLO_STDIO_TAG )->reset();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -970,6 +948,10 @@ void apollo_state::machine_start(){
|
||||
memset(messram->ptr(), 0x55, messram->bytes());
|
||||
|
||||
MACHINE_START_CALL_MEMBER(apollo);
|
||||
|
||||
// install nop handlers for unmapped ISA bus addresses
|
||||
m_isa->install16_device(0, ATBUS_IO_END, 0, 0, read16_delegate(FUNC(apollo_state::apollo_atbus_unmap_io_r), this), write16_delegate(FUNC(apollo_state::apollo_atbus_unmap_io_w), this));
|
||||
m_isa->install_memory(0, ATBUS_MEMORY_END, 0, 0, read8_delegate(FUNC(apollo_state::apollo_atbus_unmap_r), this), write8_delegate(FUNC(apollo_state::apollo_atbus_unmap_w), this));
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -1078,6 +1060,11 @@ static MACHINE_CONFIG_START( dn3500, apollo_state )
|
||||
MCFG_RAM_ADD("messram")
|
||||
MCFG_RAM_DEFAULT_SIZE("8M")
|
||||
MCFG_RAM_EXTRA_OPTIONS("4M,8M,16M,32M")
|
||||
|
||||
#ifdef APOLLO_XXL
|
||||
MCFG_DEVICE_ADD(APOLLO_STDIO_TAG, APOLLO_STDIO, 0)
|
||||
MCFG_APOLLO_STDIO_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, apollo_sio, rx_b_w))
|
||||
#endif
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_START( dsp3500, apollo_state )
|
||||
@ -1220,8 +1207,6 @@ ROM_START( dn3500 )
|
||||
// Note: this duplicates boot rom md7c-rev-8.00-1989-08-16-17-23-52.bin
|
||||
ROM_SYSTEM_BIOS( 0, "md7c-rev-8.00", "MD7C REV 8.00, 1989/08/16.17:23:52" )
|
||||
ROMX_LOAD( "3500_boot_12191_7.bin", 0x00000, 0x10000, CRC(3132067d) SHA1(36f3c83d9f2df42f2537b09ca2f051a8c9dfbfc2) , ROM_BIOS(1) )
|
||||
|
||||
ROM_LOAD_OPTIONAL( "3000_3c505_010728-00.bin", 0x80000, 0x02000, CRC(69b77ec6) SHA1(7ac36cc6fc90b90ddfc56c45303b514cbe18ae58) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( dn5500 )
|
||||
@ -1230,8 +1215,6 @@ ROM_START( dn5500 )
|
||||
|
||||
ROM_SYSTEM_BIOS( 0, "md7c-rev-8.00", "MD7C REV 8.00, 1989/08/16.17:23:52" )
|
||||
ROMX_LOAD( "5500_boot_a1631-80046_1-30-92.bin", 0x00000, 0x10000, CRC(7b9ed610) SHA1(7315a884ec4551c44433c6079cc06509223cb02b) , ROM_BIOS(1) )
|
||||
|
||||
ROM_LOAD_OPTIONAL( "3000_3c505_010728-00.bin", 0x80000, 0x02000, CRC(69b77ec6) SHA1(7ac36cc6fc90b90ddfc56c45303b514cbe18ae58) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( dn3000)
|
||||
@ -1239,8 +1222,6 @@ ROM_START( dn3000)
|
||||
|
||||
ROM_SYSTEM_BIOS( 0, "md8-rev-7.0", "MD8 REV 7.0, 1988/08/16.15:14:39" )
|
||||
ROMX_LOAD( "3000_boot_8475_7.bin", 0x00000, 0x08000, CRC(0fe2d471) SHA1(6c383d2266719a3d069b7bf015f6945179395e7a), ROM_BIOS(1) )
|
||||
|
||||
ROM_LOAD_OPTIONAL( "3000_3c505_010728-00.bin", 0x80000, 0x02000, CRC(69b77ec6) SHA1(7ac36cc6fc90b90ddfc56c45303b514cbe18ae58) )
|
||||
ROM_END
|
||||
|
||||
#define rom_dsp3500 rom_dn3500
|
||||
|
@ -46,12 +46,16 @@
|
||||
#define MLOG(x) { logerror ("%s: ", apollo_cpu_context(machine().device(MAINCPU))); LOG(x) }
|
||||
#define MLOG1(x) { if (VERBOSE > 0) MLOG(x) }
|
||||
#define MLOG2(x) { if (VERBOSE > 1) MLOG(x) }
|
||||
#define SLOG(x) { logerror ("%s: ", apollo_cpu_context(&space.device())); LOG(x) }
|
||||
#define SLOG(x) { logerror ("%s: ", apollo_cpu_context(m_maincpu)); LOG(x) }
|
||||
#define SLOG1(x) { if (VERBOSE > 0) SLOG(x) }
|
||||
#define SLOG2(x) { if (VERBOSE > 1) SLOG(x) }
|
||||
|
||||
#define MAINCPU "maincpu"
|
||||
|
||||
// Enabling this is >NOT< supported by MESSdev
|
||||
// Do *not* report any issues on Mametesters if this is enabled!
|
||||
// #define APOLLO_XXL
|
||||
|
||||
/*----------- machine/apollo_dbg.c -----------*/
|
||||
|
||||
int apollo_debug_instruction_hook(m68000_base_device *device, offs_t curpc);
|
||||
@ -70,6 +74,9 @@ void apollo_check_log();
|
||||
// return 1 if node is DN3000 or DSP3000, 0 otherwise
|
||||
int apollo_is_dn3000(void);
|
||||
|
||||
// return 1 if node is DN5500 or DSP5500, 0 otherwise
|
||||
int apollo_is_dn5500(void);
|
||||
|
||||
// return 1 if node is DSP3000 or DSP3500, 0 otherwise
|
||||
int apollo_is_dsp3x00(void);
|
||||
|
||||
@ -98,10 +105,12 @@ void apollo_set_cache_status_register(UINT8 mask, UINT8 data);
|
||||
#define APOLLO_SIO_TAG "sio"
|
||||
#define APOLLO_SIO2_TAG "sio2"
|
||||
#define APOLLO_ETH_TAG "3c505"
|
||||
#define APOLLO_NI_TAG "node_id"
|
||||
#define APOLLO_ISA_TAG "isabus"
|
||||
|
||||
// forward declaration
|
||||
class apollo_sio;
|
||||
class apollo_ni;
|
||||
|
||||
class apollo_state : public driver_device
|
||||
{
|
||||
@ -118,6 +127,7 @@ public:
|
||||
m_sio(*this, APOLLO_SIO_TAG),
|
||||
m_sio2(*this, APOLLO_SIO2_TAG),
|
||||
m_rtc(*this, APOLLO_RTC_TAG),
|
||||
m_node_id(*this, APOLLO_NI_TAG),
|
||||
m_isa(*this, APOLLO_ISA_TAG)
|
||||
{ }
|
||||
|
||||
@ -132,6 +142,7 @@ public:
|
||||
required_device<apollo_sio> m_sio;
|
||||
optional_device<apollo_sio> m_sio2;
|
||||
required_device<mc146818_device> m_rtc;
|
||||
required_device<apollo_ni> m_node_id;
|
||||
required_device<isa16_device> m_isa;
|
||||
|
||||
DECLARE_WRITE16_MEMBER(apollo_csr_status_register_w);
|
||||
@ -173,6 +184,10 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(apollo_atbus_io_w);
|
||||
DECLARE_READ16_MEMBER(apollo_atbus_memory_r);
|
||||
DECLARE_WRITE16_MEMBER(apollo_atbus_memory_w);
|
||||
DECLARE_READ16_MEMBER(apollo_atbus_unmap_io_r);
|
||||
DECLARE_WRITE16_MEMBER(apollo_atbus_unmap_io_w);
|
||||
DECLARE_READ8_MEMBER(apollo_atbus_unmap_r);
|
||||
DECLARE_WRITE8_MEMBER(apollo_atbus_unmap_w);
|
||||
DECLARE_WRITE8_MEMBER(dn5500_memory_present_register_w);
|
||||
DECLARE_READ8_MEMBER(dn5500_memory_present_register_r);
|
||||
DECLARE_WRITE8_MEMBER(dn5500_11500_w);
|
||||
@ -335,6 +350,55 @@ private:
|
||||
|
||||
extern const device_type APOLLO_SIO;
|
||||
|
||||
/*----------- machine/apollo_ni.c -----------*/
|
||||
|
||||
#define MCFG_APOLLO_NI_ADD(_tag, _xtal) \
|
||||
MCFG_DEVICE_ADD(_tag, APOLLO_NI, _xtal)
|
||||
|
||||
/*** Apollo Node ID device ***/
|
||||
|
||||
class apollo_ni: public device_t, public device_image_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
apollo_ni(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~apollo_ni();
|
||||
|
||||
virtual iodevice_t image_type() const { return IO_ROM; }
|
||||
|
||||
virtual bool is_readable() const { return 1; }
|
||||
virtual bool is_writeable() const { return 1; }
|
||||
virtual bool is_creatable() const { return 1; }
|
||||
virtual bool must_be_loaded() const { return 0; }
|
||||
virtual bool is_reset_on_load() const { return 0; }
|
||||
virtual const char *image_interface() const { return NULL; }
|
||||
virtual const char *file_extensions() const { return "ani,bin"; }
|
||||
virtual const option_guide *create_option_guide() const { return NULL; }
|
||||
|
||||
DECLARE_WRITE16_MEMBER(write);
|
||||
DECLARE_READ16_MEMBER(read);
|
||||
|
||||
// image-level overrides
|
||||
virtual bool call_load();
|
||||
virtual bool call_create(int format_type, option_resolution *format_options);
|
||||
virtual void call_unload();
|
||||
|
||||
void set_node_id_from_disk();
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete() ;
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
private:
|
||||
void set_node_id(UINT32 node_id);
|
||||
UINT32 m_node_id;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
extern const device_type APOLLO_NI;
|
||||
|
||||
/*----------- video/apollo.c -----------*/
|
||||
|
||||
#define APOLLO_SCREEN_TAG "apollo_screen"
|
||||
@ -599,4 +663,62 @@ extern const device_type APOLLO_MONO19I;
|
||||
|
||||
MACHINE_CONFIG_EXTERN( apollo_mono19i );
|
||||
|
||||
#ifdef APOLLO_XXL
|
||||
|
||||
/*----------- machine/apollo_stdio.c -----------*/
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_APOLLO_STDIO_TX_CALLBACK(_cb) \
|
||||
devcb = &apollo_stdio_device::set_tx_cb(*device, DEVCB_##_cb);
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> apollo_stdio_device
|
||||
|
||||
class apollo_stdio_device: public device_t, public device_serial_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
apollo_stdio_device(const machine_config &mconfig, const char *tag,
|
||||
device_t *owner, UINT32 clock);
|
||||
|
||||
template<class _Object> static devcb_base &set_tx_cb(device_t &device, _Object object)
|
||||
{
|
||||
return downcast<apollo_stdio_device &> (device).m_tx_w.set_callback(object);
|
||||
}
|
||||
|
||||
devcb_write_line m_tx_w;
|
||||
|
||||
private:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
// serial overrides
|
||||
virtual void rcv_complete(); // Rx completed receiving byte
|
||||
virtual void tra_complete(); // Tx completed sending byte
|
||||
virtual void tra_callback(); // Tx send bit
|
||||
|
||||
TIMER_CALLBACK_MEMBER( poll_timer );
|
||||
void xmit_char(UINT8 data);
|
||||
|
||||
static const int XMIT_RING_SIZE = 64;
|
||||
|
||||
UINT8 m_xmitring[XMIT_RING_SIZE];
|
||||
int m_xmit_read, m_xmit_write;
|
||||
bool m_tx_busy;
|
||||
|
||||
emu_timer* m_poll_timer;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
extern const device_type APOLLO_STDIO;
|
||||
#endif /* APOLLO_XXL */
|
||||
|
||||
#endif /* APOLLO_H_ */
|
||||
|
@ -95,11 +95,11 @@ INPUT_PORTS_START( apollo_config )
|
||||
PORT_CONFNAME(APOLLO_CONF_25_YEARS_AGO, APOLLO_CONF_25_YEARS_AGO, "25 Years Ago ...")
|
||||
PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
PORT_CONFSETTING(APOLLO_CONF_25_YEARS_AGO, DEF_STR ( On ) )
|
||||
|
||||
// PORT_CONFNAME(APOLLO_CONF_NODE_ID, APOLLO_CONF_NODE_ID, "Node ID from Disk")
|
||||
// PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
// PORT_CONFSETTING(APOLLO_CONF_NODE_ID, DEF_STR ( On ) )
|
||||
|
||||
#ifdef APOLLO_XXL
|
||||
PORT_CONFNAME(APOLLO_CONF_NODE_ID, APOLLO_CONF_NODE_ID, "Node ID from Disk")
|
||||
PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
PORT_CONFSETTING(APOLLO_CONF_NODE_ID, DEF_STR ( On ) )
|
||||
#endif
|
||||
// PORT_CONFNAME(APOLLO_CONF_IDLE_SLEEP, 0x00, "Idle Sleep")
|
||||
// PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
// PORT_CONFSETTING(APOLLO_CONF_IDLE_SLEEP, DEF_STR ( On ) )
|
||||
@ -111,15 +111,15 @@ INPUT_PORTS_START( apollo_config )
|
||||
PORT_CONFNAME(APOLLO_CONF_FPU_TRACE, 0x00, "FPU Trace")
|
||||
PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
PORT_CONFSETTING(APOLLO_CONF_FPU_TRACE, DEF_STR ( On ) )
|
||||
#ifdef APOLLO_XXL
|
||||
PORT_CONFNAME(APOLLO_CONF_DISK_TRACE, 0x00, "Disk Trace")
|
||||
PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
PORT_CONFSETTING(APOLLO_CONF_DISK_TRACE, DEF_STR ( On ) )
|
||||
|
||||
// PORT_CONFNAME(APOLLO_CONF_DISK_TRACE, 0x00, "Disk Trace")
|
||||
// PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
// PORT_CONFSETTING(APOLLO_CONF_DISK_TRACE, DEF_STR ( On ) )
|
||||
|
||||
// PORT_CONFNAME(APOLLO_CONF_NET_TRACE, 0x00, "Network Trace")
|
||||
// PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
// PORT_CONFSETTING(APOLLO_CONF_NET_TRACE, DEF_STR ( On ) )
|
||||
|
||||
PORT_CONFNAME(APOLLO_CONF_NET_TRACE, 0x00, "Network Trace")
|
||||
PORT_CONFSETTING(0x00, DEF_STR ( Off ) )
|
||||
PORT_CONFSETTING(APOLLO_CONF_NET_TRACE, DEF_STR ( On ) )
|
||||
#endif
|
||||
INPUT_PORTS_END
|
||||
|
||||
class apollo_config_device : public device_t
|
||||
@ -856,6 +856,216 @@ WRITE_LINE_MEMBER(apollo_state::sio2_irq_handler)
|
||||
apollo_pic_set_irq_line(APOLLO_IRQ_SIO2, state);
|
||||
}
|
||||
|
||||
//##########################################################################
|
||||
// machine/apollo_ni.c - APOLLO DS3500 node ID
|
||||
//##########################################################################
|
||||
|
||||
#undef VERBOSE
|
||||
#define VERBOSE 0
|
||||
|
||||
#define DEFAULT_NODE_ID 0x12345
|
||||
|
||||
/***************************************************************************
|
||||
IMPLEMENTATION
|
||||
***************************************************************************/
|
||||
|
||||
/*** Apollo Node ID device ***/
|
||||
|
||||
// device type definition
|
||||
const device_type APOLLO_NI = &device_creator<apollo_ni> ;
|
||||
|
||||
//-------------------------------------------------
|
||||
// apollo_ni - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
apollo_ni::apollo_ni(const machine_config &mconfig, const char *tag,
|
||||
device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, APOLLO_NI, "Node ID", tag, owner, clock, "node ID",
|
||||
__FILE__), device_image_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// apollo_ni - destructor
|
||||
//-------------------------------------------------
|
||||
|
||||
apollo_ni::~apollo_ni()
|
||||
{
|
||||
}
|
||||
|
||||
void apollo_ni::device_config_complete()
|
||||
{
|
||||
update_names(APOLLO_NI, "node_id", "ni");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_ni::device_start()
|
||||
{
|
||||
CLOG1(("apollo_ni::device_start"));
|
||||
set_node_id(DEFAULT_NODE_ID);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_ni::device_reset()
|
||||
{
|
||||
CLOG1(("apollo_ni::device_reset"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// set node ID
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_ni::set_node_id(UINT32 node_id)
|
||||
{
|
||||
m_node_id = node_id;
|
||||
CLOG1(("apollo_ni::set_node_id: node ID is %x", node_id));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read/write
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE16_MEMBER(apollo_ni::write)
|
||||
{
|
||||
CLOG1(("Error: writing node id ROM at offset %02x = %04x & %04x", offset, data, mem_mask));
|
||||
}
|
||||
|
||||
READ16_MEMBER(apollo_ni::read)
|
||||
{
|
||||
UINT16 data = 0;
|
||||
switch (offset & 0x0f)
|
||||
{
|
||||
case 1: // msb
|
||||
data = (m_node_id >> 16) & 0xff;
|
||||
break;
|
||||
case 2:
|
||||
data = (m_node_id >> 8) & 0xff;
|
||||
break;
|
||||
case 3: // lsb
|
||||
data = m_node_id & 0xff;
|
||||
break;
|
||||
case 15: // checksum
|
||||
data = ((m_node_id >> 16) + (m_node_id >> 8) + m_node_id) & 0xff;
|
||||
break;
|
||||
default:
|
||||
data = 0;
|
||||
break;
|
||||
}
|
||||
data <<= 8;
|
||||
CLOG2(("reading node id ROM at offset %02x = %04x & %04x", offset, data, mem_mask));
|
||||
return data;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_LOAD( rom )
|
||||
-------------------------------------------------*/
|
||||
bool apollo_ni::call_load()
|
||||
{
|
||||
CLOG1(("apollo_ni::call_load: %s", filename()));
|
||||
|
||||
UINT64 size = length();
|
||||
if (size != 32)
|
||||
{
|
||||
CLOG(("apollo_ni::call_load: %s has unexpected file size %lld", filename(), size));
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 data[32];
|
||||
fread(data, sizeof(data));
|
||||
|
||||
UINT8 checksum = data[2] + data[4] + data[6];
|
||||
if (checksum != data[30])
|
||||
{
|
||||
CLOG(("apollo_ni::call_load: checksum is %02x - should be %02x", checksum, data[30]));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_node_id = (((data[2] << 8) | data[4]) << 8) | (data[6]);
|
||||
CLOG1(("apollo_ni::call_load: node ID is %x", m_node_id));
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
}
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_CREATE( rom )
|
||||
-------------------------------------------------*/
|
||||
|
||||
bool apollo_ni::call_create(int format_type, option_resolution *format_options)
|
||||
{
|
||||
CLOG1(("apollo_ni::call_create:"));
|
||||
|
||||
if (length() > 0)
|
||||
{
|
||||
CLOG(("apollo_ni::call_create: %s already exists", filename()));
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT32 node_id = 0;
|
||||
sscanf(basename_noext(), "%x", &node_id);
|
||||
if (node_id == 0 || node_id > 0xfffff)
|
||||
{
|
||||
CLOG(("apollo_ni::call_create: filename %s is no valid node ID", basename()));
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 data[32];
|
||||
memset(data, 0, sizeof(data));
|
||||
data[2] = node_id >> 16;
|
||||
data[4] = node_id >> 8;
|
||||
data[6] = node_id;
|
||||
data[30] = data[2] + data[4] + data[6];
|
||||
fwrite(data, sizeof(data));
|
||||
CLOG(("apollo_ni::call_create: created %s with node ID %x", filename(), node_id));
|
||||
set_node_id(node_id);
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
}
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_UNLOAD( rom )
|
||||
-------------------------------------------------*/
|
||||
void apollo_ni::call_unload()
|
||||
{
|
||||
CLOG1(("apollo_ni::call_unload:"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// set node ID from disk
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_ni::set_node_id_from_disk()
|
||||
{
|
||||
#ifdef APOLLO_XXL
|
||||
// set node ID from UID of logical volume 1 of logical unit 0
|
||||
UINT8 db[0x50];
|
||||
|
||||
// check label of physical volume and get sector data of logical volume 1
|
||||
// Note: sector data starts with 32 byte block header
|
||||
if (omti8621_device::get_sector(0, db, sizeof(db), 0) == sizeof(db)
|
||||
&& memcmp(db + 0x22, "APOLLO", 6) == 0)
|
||||
{
|
||||
UINT16 sector1 = apollo_is_dn5500() ? 4 : 1;
|
||||
|
||||
if (omti8621_device::get_sector(sector1, db, sizeof(db), 0) == sizeof(db))
|
||||
{
|
||||
// set node_id from UID of logical volume 1 of logical unit 0
|
||||
m_node_id = (((db[0x49] << 8) | db[0x4a]) << 8) | db[0x4b];
|
||||
CLOG1(("apollo_ni::set_node_id_from_disk: node ID is %x", m_node_id));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//##########################################################################
|
||||
// machine/apollo.c - APOLLO DS3500 CPU Board
|
||||
//##########################################################################
|
||||
@ -916,6 +1126,11 @@ MACHINE_CONFIG_FRAGMENT( common )
|
||||
|
||||
MCFG_MC146818_ADD( APOLLO_RTC_TAG, XTAL_32_768kHz )
|
||||
MCFG_MC146818_UTC( true )
|
||||
MCFG_MC146818_BINARY( false )
|
||||
MCFG_MC146818_24_12( false )
|
||||
MCFG_MC146818_EPOCH( 0 )
|
||||
|
||||
MCFG_APOLLO_NI_ADD( APOLLO_NI_TAG, 0 )
|
||||
|
||||
MCFG_APOLLO_SIO_ADD( APOLLO_SIO2_TAG, XTAL_3_6864MHz )
|
||||
MCFG_APOLLO_SIO_IRQ_CALLBACK(WRITELINE(apollo_state, sio2_irq_handler))
|
||||
@ -959,6 +1174,10 @@ MACHINE_CONFIG_FRAGMENT( apollo )
|
||||
MCFG_APOLLO_SIO_IRQ_CALLBACK(WRITELINE(apollo_state, sio_irq_handler))
|
||||
MCFG_APOLLO_SIO_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output))
|
||||
MCFG_APOLLO_SIO_A_TX_CALLBACK(DEVWRITELINE(APOLLO_KBD_TAG, apollo_kbd_device, rx_w))
|
||||
|
||||
#ifdef APOLLO_XXL
|
||||
MCFG_APOLLO_SIO_B_TX_CALLBACK(DEVWRITELINE(APOLLO_STDIO_TAG, apollo_stdio_device, rx_w))
|
||||
#endif
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static DEVICE_INPUT_DEFAULTS_START( apollo_terminal )
|
||||
@ -1015,20 +1234,20 @@ MACHINE_RESET_MEMBER(apollo_state,apollo)
|
||||
apollo_csr_set_servicemode(apollo_config(APOLLO_CONF_SERVICE_MODE));
|
||||
|
||||
// change year according to configuration settings
|
||||
if (year < 20 && apollo_config(APOLLO_CONF_20_YEARS_AGO))
|
||||
{
|
||||
year+=80;
|
||||
apollo_rtc_w(space, 9, year);
|
||||
}
|
||||
else if (year < 25 && apollo_config(APOLLO_CONF_25_YEARS_AGO))
|
||||
if (year < 25 && apollo_config(APOLLO_CONF_25_YEARS_AGO))
|
||||
{
|
||||
year += 75;
|
||||
apollo_rtc_w(space, 9, year);
|
||||
}
|
||||
else if (year < 20 && apollo_config(APOLLO_CONF_20_YEARS_AGO))
|
||||
{
|
||||
year += 80;
|
||||
apollo_rtc_w(space, 9, year);
|
||||
}
|
||||
else if (year >= 80 && !apollo_config(APOLLO_CONF_20_YEARS_AGO)
|
||||
&& !apollo_config(APOLLO_CONF_25_YEARS_AGO))
|
||||
{
|
||||
year -=80;
|
||||
year -= 80;
|
||||
apollo_rtc_w(space, 9, year);
|
||||
}
|
||||
|
||||
@ -1040,3 +1259,154 @@ MACHINE_RESET_MEMBER(apollo_state,apollo)
|
||||
m_dn3000_timer->adjust(attotime::from_hz(2), 0, attotime::from_hz(2));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef APOLLO_XXL
|
||||
|
||||
//##########################################################################
|
||||
// machine/apollo_stdio.c - stdio terminal for mess
|
||||
//##########################################################################
|
||||
|
||||
#undef VERBOSE
|
||||
#define VERBOSE 0
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/***************************************************************************
|
||||
IMPLEMENTATION
|
||||
***************************************************************************/
|
||||
|
||||
// device type definition
|
||||
const device_type APOLLO_STDIO = &device_creator<apollo_stdio_device> ;
|
||||
|
||||
//-------------------------------------------------
|
||||
// apollo_stdio_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
apollo_stdio_device::apollo_stdio_device(const machine_config &mconfig,
|
||||
const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, APOLLO_STDIO, "Apollo STDIO", tag, owner, clock,
|
||||
"apollo_stdio", __FILE__), device_serial_interface(mconfig, *this),
|
||||
m_tx_w(*this)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_stdio_device::device_start()
|
||||
{
|
||||
CLOG1(("device_start"));
|
||||
|
||||
m_tx_w.resolve_safe();
|
||||
|
||||
m_poll_timer = machine().scheduler().timer_alloc(timer_expired_delegate(
|
||||
FUNC(apollo_stdio_device::poll_timer), this));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void apollo_stdio_device::device_reset()
|
||||
{
|
||||
CLOG1(("device_reset"));
|
||||
|
||||
// comms is at 8N1, 9600 baud
|
||||
set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
|
||||
set_rcv_rate(9600);
|
||||
set_tra_rate(9600);
|
||||
|
||||
m_tx_busy = false;
|
||||
m_xmit_read = m_xmit_write = 0;
|
||||
|
||||
#if defined(__linux__)
|
||||
// FIXME: unavailable in mingw
|
||||
// set stdin to nonblocking to allow polling
|
||||
fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
// start timer
|
||||
m_poll_timer->adjust(attotime::zero, 0, attotime::from_msec(1)); // every 1ms
|
||||
}
|
||||
|
||||
void apollo_stdio_device::device_timer(emu_timer &timer, device_timer_id id,
|
||||
int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void apollo_stdio_device::rcv_complete() // Rx completed receiving byte
|
||||
{
|
||||
receive_register_extract();
|
||||
UINT8 data = get_received_char();
|
||||
|
||||
// output data to stdout (FIXME: '\r' may confuse ceterm)
|
||||
if (data != '\r')
|
||||
{
|
||||
::putchar(data);
|
||||
::fflush(stdout);
|
||||
}
|
||||
CLOG1(("rcv_complete %02x - %c", data, data));
|
||||
}
|
||||
|
||||
void apollo_stdio_device::tra_complete() // Tx completed sending byte
|
||||
{
|
||||
// is there more waiting to send?
|
||||
if (m_xmit_read != m_xmit_write)
|
||||
{
|
||||
transmit_register_setup(m_xmitring[m_xmit_read++]);
|
||||
if (m_xmit_read >= XMIT_RING_SIZE)
|
||||
{
|
||||
m_xmit_read = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tx_busy = false;
|
||||
}
|
||||
}
|
||||
|
||||
void apollo_stdio_device::tra_callback() // Tx send bit
|
||||
{
|
||||
int bit = transmit_register_get_data_bit();
|
||||
m_tx_w(bit);
|
||||
|
||||
CLOG2(("tra_callback %02x", bit));
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(apollo_stdio_device::poll_timer)
|
||||
{
|
||||
#if defined(__linux__)
|
||||
UINT8 data;
|
||||
while (::read(STDIN_FILENO, &data, 1) == 1)
|
||||
{
|
||||
xmit_char(data == '\n' ? '\r' : data);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void apollo_stdio_device::xmit_char(UINT8 data)
|
||||
{
|
||||
CLOG1(("xmit_char %02x - %c", data, data));
|
||||
|
||||
// if tx is busy it'll pick this up automatically when it completes
|
||||
if (!m_tx_busy)
|
||||
{
|
||||
m_tx_busy = true;
|
||||
transmit_register_setup(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
// tx is busy, it'll pick this up next time
|
||||
m_xmitring[m_xmit_write++] = data;
|
||||
if (m_xmit_write >= XMIT_RING_SIZE)
|
||||
{
|
||||
m_xmit_write = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -49,7 +49,8 @@ osd_netdev::osd_netdev(class device_network_interface *ifdev, int rate)
|
||||
osd_netdev::~osd_netdev()
|
||||
{
|
||||
m_stop = true;
|
||||
m_timer->reset();
|
||||
// nasty hack to prevent Segmentation fault on emulation stop
|
||||
// m_timer->reset();
|
||||
}
|
||||
|
||||
int osd_netdev::send(UINT8 *buf, int len)
|
||||
|
Loading…
Reference in New Issue
Block a user