mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
apollo: cleanups and enhancements [Hans Ostermeyer]
- Split OMTI8621 ISA device into PC and Apollo versions (Apollo doesn't have a BIOS extension ROM, PC does) - Cleaned up OMTI8621 logging - Forced slot # of OMTI board so we can look it up and auto-set the node ID - Adjusted mouse sensitivity
This commit is contained in:
parent
adbeddccde
commit
a6cf249956
@ -231,13 +231,8 @@ FLOPPY_FORMATS_END
|
||||
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_OPTIONAL("omti_bios", 0x0000, 0x1000, NO_DUMP)
|
||||
#endif
|
||||
ROM_END
|
||||
|
||||
static INPUT_PORTS_START( omti_port )
|
||||
@ -274,6 +269,13 @@ const rom_entry *omti8621_device::device_rom_region() const
|
||||
return ROM_NAME( omti8621 );
|
||||
}
|
||||
|
||||
const rom_entry *omti8621_apollo_device::device_rom_region() const
|
||||
{
|
||||
// OMTI 8621 boards for Apollo workstations never use a BIOS ROM
|
||||
// They don't even have a socket for the BIOS ROM
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ioport_constructor omti8621_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( omti_port );
|
||||
@ -369,10 +371,22 @@ void omti8621_device::device_reset()
|
||||
alternate_track_address[1] = 0;
|
||||
}
|
||||
|
||||
const device_type ISA16_OMTI8621 = &device_creator<omti8621_device>;
|
||||
const device_type ISA16_OMTI8621 = &device_creator<omti8621_pc_device>;
|
||||
|
||||
omti8621_device::omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, ISA16_OMTI8621, "OMTI 8621 ESDI/floppy controller", tag, owner, clock, "omti8621", __FILE__),
|
||||
omti8621_pc_device::omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: omti8621_device(mconfig, ISA16_OMTI8621, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
const device_type ISA16_OMTI8621_APOLLO = &device_creator<omti8621_apollo_device>;
|
||||
|
||||
omti8621_apollo_device::omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: omti8621_device(mconfig, ISA16_OMTI8621_APOLLO, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
omti8621_device::omti8621_device(const machine_config &mconfig, device_type type,const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, type, "OMTI 8621 ESDI/floppy controller", tag, owner, clock, "omti8621", __FILE__),
|
||||
device_isa16_card_interface(mconfig, *this),
|
||||
m_fdc(*this, OMTI_FDC_TAG),
|
||||
m_iobase(*this, "IO_BASE"),
|
||||
@ -679,80 +693,83 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
|
||||
{
|
||||
if (verbose > 0) {
|
||||
int i;
|
||||
logerror("%s: OMTI command ", cpu_context(this));
|
||||
char sb[100];
|
||||
std::string text(cpu_context(this));
|
||||
text += ": OMTI command ";
|
||||
switch (cdb[0]) {
|
||||
case OMTI_CMD_TEST_DRIVE_READY: // 0x00
|
||||
logerror("Test Drive Ready");
|
||||
text += "Test Drive Ready";
|
||||
break;
|
||||
case OMTI_CMD_RECALIBRATE: // 0x01
|
||||
logerror("Recalibrate");
|
||||
text += "Recalibrate";
|
||||
break;
|
||||
case OMTI_CMD_REQUEST_SENSE: // 0x03
|
||||
logerror("Request Sense");
|
||||
text += "Request Sense";
|
||||
break;
|
||||
case OMTI_CMD_READ_VERIFY: // 0x05
|
||||
logerror("Read Verify");
|
||||
text += "Read Verify";
|
||||
break;
|
||||
case OMTI_CMD_FORMAT_TRACK: // 0x06
|
||||
logerror("Format Track");
|
||||
text += "Format Track";
|
||||
break;
|
||||
case OMTI_CMD_FORMAT_BAD_TRACK: // 0x07
|
||||
logerror("Format Bad Track");
|
||||
text += "Format Bad Track";
|
||||
break;
|
||||
case OMTI_CMD_READ: // 0x08
|
||||
logerror("Read");
|
||||
text += "Read";
|
||||
break;
|
||||
case OMTI_CMD_WRITE: // 0x0A
|
||||
logerror("Write");
|
||||
text += "Write";
|
||||
break;
|
||||
case OMTI_CMD_SEEK: // 0x0B
|
||||
logerror("Seek");
|
||||
text += "Seek";
|
||||
break;
|
||||
case OMTI_CMD_READ_SECTOR_BUFFER: // 0x0E
|
||||
logerror("Read Sector Buffer");
|
||||
text += "Read Sector Buffer";
|
||||
break;
|
||||
case OMTI_CMD_WRITE_SECTOR_BUFFER: // 0x0F
|
||||
logerror("Write Sector Buffer");
|
||||
text += "Write Sector Buffer";
|
||||
break;
|
||||
case OMTI_CMD_ASSIGN_ALTERNATE_TRACK: // 0x11
|
||||
logerror("Assign Alternate Track");
|
||||
text += "Assign Alternate Track";
|
||||
break;
|
||||
case OMTI_CMD_READ_DATA_TO_BUFFER: // 0x1E
|
||||
logerror("Read Data to Buffer");
|
||||
text += "Read Data to Buffer";
|
||||
break;
|
||||
case OMTI_CMD_WRITE_DATA_FROM_BUFFER: // 0x1F
|
||||
logerror("Write Data from Buffer");
|
||||
text += "Write Data from Buffer";
|
||||
break;
|
||||
case OMTI_CMD_COPY: // 0x20
|
||||
logerror("Copy");
|
||||
text += "Copy";
|
||||
break;
|
||||
case OMTI_CMD_READ_ESDI_DEFECT_LIST: // 0x37
|
||||
logerror("Read ESDI Defect List");
|
||||
text += "Read ESDI Defect List";
|
||||
break;
|
||||
case OMTI_CMD_RAM_DIAGNOSTICS: // 0xE0
|
||||
logerror("RAM. Diagnostic");
|
||||
text += "RAM. Diagnostic";
|
||||
break;
|
||||
case OMTI_CMD_CONTROLLER_INT_DIAGNOSTIC: // 0xE4
|
||||
logerror("Controller Int. Diagnostic");
|
||||
text += "Controller Int. Diagnostic";
|
||||
break;
|
||||
case OMTI_CMD_READ_LONG: // 0xE5
|
||||
logerror("Read Long");
|
||||
text += "Read Long";
|
||||
break;
|
||||
case OMTI_CMD_WRITE_LONG: // 0xE6
|
||||
logerror("Write Long");
|
||||
text += "Write Long";
|
||||
break;
|
||||
case OMTI_CMD_READ_CONFIGURATION: // 0xEC
|
||||
logerror("Read Configuration");
|
||||
text += "Read Configuration";
|
||||
break;
|
||||
case OMTI_CMD_INVALID_COMMAND: // 0xFF
|
||||
logerror("Invalid Command");
|
||||
text += "Invalid Command";
|
||||
break;
|
||||
default:
|
||||
logerror("!!! Unexpected Command !!!");
|
||||
text += "!!! Unexpected Command !!!";
|
||||
}
|
||||
// logerror(" (%02x, length=%02x)", cdb[0], cdb_length);
|
||||
for (i = 0; i < cdb_length; i++) {
|
||||
logerror(" %02x", cdb[i]);
|
||||
sprintf(sb, " %02x", cdb[i]);
|
||||
text += sb;
|
||||
}
|
||||
|
||||
switch (cdb[0]) {
|
||||
@ -763,10 +780,12 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
|
||||
case OMTI_CMD_READ_DATA_TO_BUFFER: // 0x1E
|
||||
case OMTI_CMD_WRITE_DATA_FROM_BUFFER: // 0x1F
|
||||
case OMTI_CMD_COPY: // 0x20
|
||||
logerror(" (diskaddr=%x count=%x)", get_disk_address(cdb), cdb[4]);
|
||||
sprintf(sb, " (diskaddr=%x count=%x)", get_disk_address(cdb), cdb[4]);
|
||||
text += sb;
|
||||
break;
|
||||
}
|
||||
logerror("\n");
|
||||
text += "\n";
|
||||
logerror(text.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -776,18 +795,25 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
|
||||
|
||||
void omti8621_device::log_data()
|
||||
{
|
||||
if (verbose > 0) {
|
||||
if (verbose > 0)
|
||||
{
|
||||
int i;
|
||||
logerror("%s: OMTI data (length=%02x)", cpu_context(this),
|
||||
char sb[100];
|
||||
sprintf(sb, "%s: OMTI data (length=%02x)", cpu_context(this),
|
||||
data_length);
|
||||
for (i = 0; i < data_length && i < OMTI_DISK_SECTOR_SIZE; i++) {
|
||||
logerror(" %02x", data_buffer[i]);
|
||||
std::string text(sb);
|
||||
for (i = 0; i < data_length && i < OMTI_DISK_SECTOR_SIZE; i++)
|
||||
{
|
||||
sprintf(sb, " %02x", data_buffer[i]);
|
||||
text += sb;
|
||||
}
|
||||
|
||||
if (i < data_length) {
|
||||
logerror(" ...");
|
||||
if (i < data_length)
|
||||
{
|
||||
text += " ...";
|
||||
}
|
||||
logerror("\n");
|
||||
text += "\n";
|
||||
logerror(text.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1209,11 +1235,9 @@ 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)
|
||||
UINT32 omti8621_apollo_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun)
|
||||
{
|
||||
omti_disk_image_device *disk = omti8621_device_1->our_disks[lun];
|
||||
omti_disk_image_device *disk = our_disks[lun];
|
||||
|
||||
if (disk == NULL || disk->m_image == NULL || !disk->m_image->exists())
|
||||
{
|
||||
@ -1232,10 +1256,9 @@ UINT32 omti8621_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 le
|
||||
return length;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************
|
||||
omti_set_jumper - set OMI jumpers
|
||||
omti_set_jumper - set OMTI jumpers
|
||||
***************************************************************************/
|
||||
|
||||
void omti8621_device::set_jumper(UINT16 disk_type)
|
||||
|
@ -33,7 +33,7 @@ class omti_disk_image_device;
|
||||
class omti8621_device : public device_t, public device_isa16_card_interface
|
||||
{
|
||||
public:
|
||||
omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
omti8621_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
|
||||
~omti8621_device() {}
|
||||
|
||||
DECLARE_READ16_MEMBER(read);
|
||||
@ -41,9 +41,6 @@ public:
|
||||
|
||||
static void set_verbose(int on_off);
|
||||
|
||||
// get sector diskaddr of logical unit lun into data_buffer
|
||||
static UINT32 get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun);
|
||||
|
||||
required_device<pc_fdc_interface> m_fdc;
|
||||
required_ioport m_iobase;
|
||||
required_ioport m_biosopts;
|
||||
@ -68,9 +65,9 @@ protected:
|
||||
|
||||
void set_interrupt(enum line_state line_state);
|
||||
|
||||
private:
|
||||
omti_disk_image_device *our_disks[OMTI_MAX_LUN+1];
|
||||
|
||||
private:
|
||||
UINT16 jumper;
|
||||
|
||||
UINT8 omti_state;
|
||||
@ -128,8 +125,31 @@ private:
|
||||
DECLARE_WRITE8_MEMBER(write8);
|
||||
};
|
||||
|
||||
/* ----- omti8621 for PC device interface ----- */
|
||||
|
||||
class omti8621_pc_device : public omti8621_device
|
||||
{
|
||||
public:
|
||||
omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
};
|
||||
|
||||
extern const device_type ISA16_OMTI8621;
|
||||
|
||||
/* ----- omti8621 for apollo device interface ----- */
|
||||
|
||||
class omti8621_apollo_device : public omti8621_device
|
||||
{
|
||||
public:
|
||||
omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// get sector diskaddr of logical unit lun into data_buffer
|
||||
UINT32 get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun);
|
||||
protected:
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
};
|
||||
|
||||
extern const device_type ISA16_OMTI8621_APOLLO;
|
||||
|
||||
//###############################################################
|
||||
|
||||
#endif /* OMTI8621_H_ */
|
||||
|
@ -1681,7 +1681,7 @@ static void fmove_fpcr(m68000_base_device *m68k, UINT16 w2)
|
||||
int rnd = (REG_FPCR(m68k) >> 4) & 3;
|
||||
int prec = (REG_FPCR(m68k) >> 6) & 3;
|
||||
|
||||
m68k->logerror("m68k_fpsp:fmove_fpcr fpcr=%04x prec=%d rnd=%d\n", REG_FPCR(m68k), prec, rnd);
|
||||
// m68k->logerror("m68k_fpsp:fmove_fpcr fpcr=%04x prec=%d rnd=%d\n", REG_FPCR(m68k), prec, rnd);
|
||||
|
||||
#ifdef FLOATX80
|
||||
switch (prec)
|
||||
|
@ -905,13 +905,13 @@ void apollo_state::machine_reset()
|
||||
// set configuration
|
||||
omti8621_device::set_verbose(apollo_config(APOLLO_CONF_DISK_TRACE));
|
||||
threecom3c505_device::set_verbose(apollo_config(APOLLO_CONF_NET_TRACE));
|
||||
#endif
|
||||
|
||||
if (apollo_config(APOLLO_CONF_NODE_ID))
|
||||
{
|
||||
// set node ID from UID of logical volume 1 of logical unit 0
|
||||
m_node_id->set_node_id_from_disk();
|
||||
}
|
||||
#endif
|
||||
|
||||
m_maincpu->set_instruction_hook(read32_delegate(FUNC(apollo_state::apollo_instruction_hook),this));
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "machine/am9517a.h"
|
||||
#include "machine/pic8259.h"
|
||||
#include "machine/mc146818.h"
|
||||
#include "machine/apollo_dbg.h"
|
||||
#include "machine/apollo_kbd.h"
|
||||
#include "machine/clock.h"
|
||||
#include "bus/isa/isa.h"
|
||||
@ -56,10 +57,6 @@
|
||||
// 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);
|
||||
|
||||
/*----------- drivers/apollo.c -----------*/
|
||||
|
||||
// return the current CPU context for log file entries
|
||||
|
@ -97,11 +97,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 ) )
|
||||
#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 ) )
|
||||
@ -1047,25 +1047,25 @@ void apollo_ni::call_unload()
|
||||
|
||||
void apollo_ni::set_node_id_from_disk()
|
||||
{
|
||||
#ifdef APOLLO_XXL
|
||||
// set node ID from UID of logical volume 1 of logical unit 0
|
||||
omti8621_apollo_device *omti8621 = machine().device<omti8621_apollo_device>("isa1:wdc");
|
||||
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)
|
||||
// set node ID from UID of logical volume 1 of logical unit 0
|
||||
if (omti8621
|
||||
&& omti8621->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))
|
||||
if (omti8621->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
|
||||
}
|
||||
|
||||
//##########################################################################
|
||||
@ -1076,7 +1076,7 @@ void apollo_ni::set_node_id_from_disk()
|
||||
#define VERBOSE 0
|
||||
|
||||
static SLOT_INTERFACE_START(apollo_isa_cards)
|
||||
SLOT_INTERFACE("wdc", ISA16_OMTI8621) // Combo ESDI/AT floppy controller
|
||||
SLOT_INTERFACE("wdc", ISA16_OMTI8621_APOLLO) // Combo ESDI/AT floppy controller
|
||||
SLOT_INTERFACE("ctape", ISA8_SC499) // Archive SC499 cartridge tape
|
||||
SLOT_INTERFACE("3c505", ISA16_3C505) // 3Com 3C505 Ethernet card
|
||||
SLOT_INTERFACE_END
|
||||
|
@ -977,10 +977,14 @@ INPUT_PORTS_START( apollo_kbd )
|
||||
PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Right mouse button") PORT_CODE(MOUSECODE_BUTTON3)
|
||||
PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Center mouse button") PORT_CODE(MOUSECODE_BUTTON2)
|
||||
|
||||
// FIXME:
|
||||
// PORT_SENSITIVITY(50) would be perfect for SDL2
|
||||
// PORT_SENSITIVITY(200) would be perfect for SDL1.2
|
||||
|
||||
PORT_START("mouse2") // X-axis
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("mouse3") // Y-axis
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
Loading…
Reference in New Issue
Block a user