diff options
author | 2016-01-04 04:06:13 +0000 | |
---|---|---|
committer | 2016-01-04 04:06:13 +0000 | |
commit | cc00b13b9259fc957d7f1698db49f283037298af (patch) | |
tree | 8ead5074561428ad20c5cd0fdaa92c804f34310e /src | |
parent | 823a779de2763f6834eb3f5db727348ddf09ac85 (diff) | |
parent | a3f2c5abcd892fec0aeffbb0d661490bcf295108 (diff) |
Merge branch 'master' of https://github.com/mamedev/mame
Diffstat (limited to 'src')
29 files changed, 1172 insertions, 484 deletions
diff --git a/src/devices/bus/cbm2/hrg.cpp b/src/devices/bus/cbm2/hrg.cpp index 512c50be0c0..e0e9bf667ba 100644 --- a/src/devices/bus/cbm2/hrg.cpp +++ b/src/devices/bus/cbm2/hrg.cpp @@ -14,6 +14,7 @@ - version A (EF9365, 512x512 interlaced, 1 page) - version B (EF9366, 512x256 non-interlaced, 2 pages) + - 256KB version ROM */ @@ -35,8 +36,8 @@ // DEVICE DEFINITIONS //************************************************************************** -const device_type CBM2_HRG_A = &device_creator<cbm2_graphic_cartridge_a_device>; -const device_type CBM2_HRG_B = &device_creator<cbm2_graphic_cartridge_b_device>; +const device_type CBM2_HRG_A = &device_creator<cbm2_hrg_a_t>; +const device_type CBM2_HRG_B = &device_creator<cbm2_hrg_b_t>; //------------------------------------------------- @@ -53,13 +54,33 @@ ROM_END // rom_region - device-specific ROM region //------------------------------------------------- -const rom_entry *cbm2_graphic_cartridge_device::device_rom_region() const +const rom_entry *cbm2_hrg_t::device_rom_region() const { return ROM_NAME( cbm2_hrg ); } //------------------------------------------------- +// ADDRESS_MAP( hrg_a_map ) +//------------------------------------------------- + +static ADDRESS_MAP_START( hrg_a_map, AS_0, 8, cbm2_hrg_a_t ) + ADDRESS_MAP_GLOBAL_MASK(0x7fff) + AM_RANGE(0x0000, 0x7fff) AM_RAM +ADDRESS_MAP_END + + +//------------------------------------------------- +// ADDRESS_MAP( hrg_b_map ) +//------------------------------------------------- + +static ADDRESS_MAP_START( hrg_b_map, AS_0, 8, cbm2_hrg_b_t ) + ADDRESS_MAP_GLOBAL_MASK(0x3fff) + AM_RANGE(0x0000, 0x3fff) AM_RAM +ADDRESS_MAP_END + + +//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( cbm2_hrg_a ) //------------------------------------------------- @@ -69,9 +90,11 @@ static MACHINE_CONFIG_FRAGMENT( cbm2_hrg_a ) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1) MCFG_SCREEN_REFRESH_RATE(25) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") MCFG_DEVICE_ADD(EF9365_TAG, EF9365, 1750000) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) + MCFG_DEVICE_ADDRESS_MAP(AS_0, hrg_a_map) MCFG_EF936X_PALETTE("palette") MCFG_EF936X_BITPLANES_CNT(1); MCFG_EF936X_DISPLAYMODE(EF936X_512x512_DISPLAY_MODE); @@ -88,9 +111,11 @@ static MACHINE_CONFIG_FRAGMENT( cbm2_hrg_b ) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_REFRESH_RATE(50) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") MCFG_DEVICE_ADD(EF9366_TAG, EF9365, 1750000) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) + MCFG_DEVICE_ADDRESS_MAP(AS_0, hrg_b_map) MCFG_EF936X_PALETTE("palette") MCFG_EF936X_BITPLANES_CNT(1); MCFG_EF936X_DISPLAYMODE(EF936X_512x256_DISPLAY_MODE); @@ -102,12 +127,12 @@ MACHINE_CONFIG_END // machine configurations //------------------------------------------------- -machine_config_constructor cbm2_graphic_cartridge_a_device::device_mconfig_additions() const +machine_config_constructor cbm2_hrg_a_t::device_mconfig_additions() const { return MACHINE_CONFIG_NAME( cbm2_hrg_a ); } -machine_config_constructor cbm2_graphic_cartridge_b_device::device_mconfig_additions() const +machine_config_constructor cbm2_hrg_b_t::device_mconfig_additions() const { return MACHINE_CONFIG_NAME( cbm2_hrg_b ); } @@ -119,10 +144,10 @@ machine_config_constructor cbm2_graphic_cartridge_b_device::device_mconfig_addit //************************************************************************** //------------------------------------------------- -// cbm2_graphic_cartridge_device - constructor +// cbm2_hrg_t - constructor //------------------------------------------------- -cbm2_graphic_cartridge_device::cbm2_graphic_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +cbm2_hrg_t::cbm2_hrg_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_cbm2_expansion_card_interface(mconfig, *this), m_gdc(*this, EF9366_TAG), @@ -130,13 +155,13 @@ cbm2_graphic_cartridge_device::cbm2_graphic_cartridge_device(const machine_confi { } -cbm2_graphic_cartridge_a_device::cbm2_graphic_cartridge_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - cbm2_graphic_cartridge_device(mconfig, CBM2_HRG_A, "CBM 500/600/700 High Resolution Graphics (A)", tag, owner, clock, "cbm2_hrga", __FILE__) +cbm2_hrg_a_t::cbm2_hrg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + cbm2_hrg_t(mconfig, CBM2_HRG_A, "CBM 500/600/700 High Resolution Graphics (A)", tag, owner, clock, "cbm2_hrga", __FILE__) { } -cbm2_graphic_cartridge_b_device::cbm2_graphic_cartridge_b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - cbm2_graphic_cartridge_device(mconfig, CBM2_HRG_B, "CBM 500/600/700 High Resolution Graphics (B)", tag, owner, clock, "cbm2_hrgb", __FILE__) +cbm2_hrg_b_t::cbm2_hrg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + cbm2_hrg_t(mconfig, CBM2_HRG_B, "CBM 500/600/700 High Resolution Graphics (B)", tag, owner, clock, "cbm2_hrgb", __FILE__) { } @@ -145,10 +170,8 @@ cbm2_graphic_cartridge_b_device::cbm2_graphic_cartridge_b_device(const machine_c // device_start - device-specific startup //------------------------------------------------- -void cbm2_graphic_cartridge_device::device_start() +void cbm2_hrg_t::device_start() { - m_gdc->set_color_entry(0, 0, 0, 0); - m_gdc->set_color_entry(1, 0, 0xff, 00); } @@ -156,7 +179,7 @@ void cbm2_graphic_cartridge_device::device_start() // device_reset - device-specific reset //------------------------------------------------- -void cbm2_graphic_cartridge_device::device_reset() +void cbm2_hrg_t::device_reset() { m_gdc->reset(); } @@ -166,7 +189,7 @@ void cbm2_graphic_cartridge_device::device_reset() // cbm2_bd_r - cartridge data read //------------------------------------------------- -UINT8 cbm2_graphic_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +UINT8 cbm2_hrg_t::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) { if (!csbank3) { @@ -197,7 +220,7 @@ UINT8 cbm2_graphic_cartridge_device::cbm2_bd_r(address_space &space, offs_t offs } else if (offset >= 0x7ff0) { - data = m_gdc->data_r(space, offset & 0x07); + data = m_gdc->data_r(space, offset & 0x0f); } } @@ -209,7 +232,7 @@ UINT8 cbm2_graphic_cartridge_device::cbm2_bd_r(address_space &space, offs_t offs // cbm2_bd_w - cartridge data write //------------------------------------------------- -void cbm2_graphic_cartridge_device::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +void cbm2_hrg_t::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) { if (!csbank3) { @@ -232,7 +255,7 @@ void cbm2_graphic_cartridge_device::cbm2_bd_w(address_space &space, offs_t offse } else if (offset >= 0x7ff0) { - m_gdc->data_w(space, offset & 0x07, data); + m_gdc->data_w(space, offset & 0x0f, data); } } } diff --git a/src/devices/bus/cbm2/hrg.h b/src/devices/bus/cbm2/hrg.h index fc759049cf6..67e0f25ad90 100644 --- a/src/devices/bus/cbm2/hrg.h +++ b/src/devices/bus/cbm2/hrg.h @@ -21,14 +21,14 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> cbm2_graphic_cartridge_device +// ======================> cbm2_hrg_t -class cbm2_graphic_cartridge_device : public device_t, - public device_cbm2_expansion_card_interface +class cbm2_hrg_t : public device_t, + public device_cbm2_expansion_card_interface { public: // construction/destruction - cbm2_graphic_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + cbm2_hrg_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); // optional information overrides virtual const rom_entry *device_rom_region() const override; @@ -48,26 +48,26 @@ private: }; -// ======================> cbm2_graphic_cartridge_a_device +// ======================> cbm2_hrg_a_t -class cbm2_graphic_cartridge_a_device : public cbm2_graphic_cartridge_device +class cbm2_hrg_a_t : public cbm2_hrg_t { public: // construction/destruction - cbm2_graphic_cartridge_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_hrg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; }; -// ======================> cbm2_graphic_cartridge_b_device +// ======================> cbm2_hrg_b_t -class cbm2_graphic_cartridge_b_device : public cbm2_graphic_cartridge_device +class cbm2_hrg_b_t : public cbm2_hrg_t { public: // construction/destruction - cbm2_graphic_cartridge_b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_hrg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/pet/hsg.cpp b/src/devices/bus/pet/hsg.cpp index 117100bafe7..2a90008c307 100644 --- a/src/devices/bus/pet/hsg.cpp +++ b/src/devices/bus/pet/hsg.cpp @@ -63,6 +63,26 @@ const rom_entry *cbm8000_hsg_t::device_rom_region() const //------------------------------------------------- +// ADDRESS_MAP( hsg_a_map ) +//------------------------------------------------- + +static ADDRESS_MAP_START( hsg_a_map, AS_0, 8, cbm8000_hsg_a_t ) + ADDRESS_MAP_GLOBAL_MASK(0x7fff) + AM_RANGE(0x0000, 0x7fff) AM_RAM +ADDRESS_MAP_END + + +//------------------------------------------------- +// ADDRESS_MAP( hsg_b_map ) +//------------------------------------------------- + +static ADDRESS_MAP_START( hsg_b_map, AS_0, 8, cbm8000_hsg_b_t ) + ADDRESS_MAP_GLOBAL_MASK(0x3fff) + AM_RANGE(0x0000, 0x3fff) AM_RAM +ADDRESS_MAP_END + + +//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( cbm8000_hsg_a ) //------------------------------------------------- @@ -72,9 +92,11 @@ static MACHINE_CONFIG_FRAGMENT( cbm8000_hsg_a ) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1) MCFG_SCREEN_REFRESH_RATE(25) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") MCFG_DEVICE_ADD(EF9365_TAG, EF9365, 1750000) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) + MCFG_DEVICE_ADDRESS_MAP(AS_0, hsg_a_map) MCFG_EF936X_PALETTE("palette") MCFG_EF936X_BITPLANES_CNT(1); MCFG_EF936X_DISPLAYMODE(EF936X_512x512_DISPLAY_MODE); @@ -91,9 +113,11 @@ static MACHINE_CONFIG_FRAGMENT( cbm8000_hsg_b ) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_REFRESH_RATE(50) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") MCFG_DEVICE_ADD(EF9366_TAG, EF9365, 1750000) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) + MCFG_DEVICE_ADDRESS_MAP(AS_0, hsg_b_map) MCFG_EF936X_PALETTE("palette") MCFG_EF936X_BITPLANES_CNT(1); MCFG_EF936X_DISPLAYMODE(EF936X_512x256_DISPLAY_MODE); @@ -151,8 +175,6 @@ cbm8000_hsg_b_t::cbm8000_hsg_b_t(const machine_config &mconfig, const char *tag, void cbm8000_hsg_t::device_start() { - m_gdc->set_color_entry(0, 0, 0, 0); - m_gdc->set_color_entry(1, 0, 0xff, 00); } diff --git a/src/devices/cpu/tlcs900/tlcs900.cpp b/src/devices/cpu/tlcs900/tlcs900.cpp index e0c174a9082..03f7a014c56 100644 --- a/src/devices/cpu/tlcs900/tlcs900.cpp +++ b/src/devices/cpu/tlcs900/tlcs900.cpp @@ -110,7 +110,15 @@ tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *ta m_portd_read(*this), m_portd_write(*this), m_porte_read(*this), - m_porte_write(*this) + m_porte_write(*this), + m_an0_read(*this), + m_an1_read(*this), + m_an2_read(*this), + m_an3_read(*this), + m_an4_read(*this), + m_an5_read(*this), + m_an6_read(*this), + m_an7_read(*this) { } @@ -1732,7 +1740,151 @@ void tmp95c063_device::tlcs900_check_irqs() void tmp95c063_device::tlcs900_handle_ad() { - // TODO + if ( m_ad_cycles_left > 0 ) + { + m_ad_cycles_left -= m_cycles; + if ( m_ad_cycles_left <= 0 ) + { + int ad_value; + + /* Store A/D converted value */ + if ((m_reg[TMP95C063_ADMOD1] & 0x10) == 0) // conversion channel fixed + { + switch( m_reg[TMP95C063_ADMOD2] & 0x07 ) + { + case 0x00: // AN0 + ad_value = m_an0_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + break; + case 0x01: // AN1 + ad_value = m_an1_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + break; + case 0x02: // AN2 + ad_value = m_an2_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + break; + case 0x03: // AN3 + ad_value = m_an3_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG37L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG37H] = (ad_value >> 2) & 0xff; + break; + case 0x04: // AN4 + ad_value = m_an4_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + break; + case 0x05: // AN5 + ad_value = m_an5_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + break; + case 0x06: // AN6 + ad_value = m_an6_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + break; + case 0x07: // AN7 + ad_value = m_an7_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG37L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG37H] = (ad_value >> 2) & 0xff; + break; + } + } + else // conversion channel sweep + { + switch( m_reg[TMP95C063_ADMOD2] & 0x07 ) + { + case 0x00: // AN0 + ad_value = m_an0_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + break; + case 0x01: // AN0 -> AN1 + ad_value = m_an0_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an1_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + break; + case 0x02: // AN0 -> AN1 -> AN2 + ad_value = m_an0_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an1_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + ad_value = m_an2_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + break; + case 0x03: // AN0 -> AN1 -> AN2 -> AN3 + ad_value = m_an0_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an1_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + ad_value = m_an2_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + ad_value = m_an3_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG37L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG37H] = (ad_value >> 2) & 0xff; + break; + case 0x04: // AN4 + ad_value = m_an4_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + break; + case 0x05: // AN4 -> AN5 + ad_value = m_an4_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an5_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + break; + case 0x06: // AN4 -> AN5 -> AN6 + ad_value = m_an4_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an5_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + ad_value = m_an6_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + break; + case 0x07: // AN4 -> AN5 -> AN6 -> AN7 + ad_value = m_an4_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG04L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG04H] = (ad_value >> 2) & 0xff; + ad_value = m_an5_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG15L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG15H] = (ad_value >> 2) & 0xff; + ad_value = m_an6_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG26L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG26H] = (ad_value >> 2) & 0xff; + ad_value = m_an7_read(0) & 0x3ff; + m_reg[TMP95C063_ADREG37L] = (ad_value & 0x3) << 6; + m_reg[TMP95C063_ADREG37H] = (ad_value >> 2) & 0xff; + break; + } + } + + /* Clear BUSY flag, set END flag */ + m_reg[TMP95C063_ADMOD1] &= ~ 0x40; + m_reg[TMP95C063_ADMOD1] |= 0x80; + + m_reg[TMP95C063_INTE0AD] |= 0x80; + m_check_irqs = 1; + } + } } @@ -1762,6 +1914,14 @@ void tmp95c063_device::device_start() m_portd_write.resolve_safe(); m_porte_read.resolve_safe(0); m_porte_write.resolve_safe(); + m_an0_read.resolve_safe(0); + m_an1_read.resolve_safe(0); + m_an2_read.resolve_safe(0); + m_an3_read.resolve_safe(0); + m_an4_read.resolve_safe(0); + m_an5_read.resolve_safe(0); + m_an6_read.resolve_safe(0); + m_an7_read.resolve_safe(0); } void tmp95c063_device::device_reset() @@ -2050,6 +2210,26 @@ WRITE8_MEMBER( tmp95c063_device::internal_w ) case TMP95C063_IIMC: break; + case TMP95C063_ADMOD1: + // conversion start + if (data & 0x04) + { + data &= ~0x04; + data |= 0x40; + + switch ((m_reg[TMP95C063_ADMOD2] >> 4) & 3) + { + case 0: m_ad_cycles_left = 160; break; + case 1: m_ad_cycles_left = 320; break; + case 2: m_ad_cycles_left = 640; break; + case 3: m_ad_cycles_left = 1280; break; + } + } + break; + + case TMP95C063_ADMOD2: + break; + default: break; } diff --git a/src/devices/cpu/tlcs900/tlcs900.h b/src/devices/cpu/tlcs900/tlcs900.h index 515a25b58e5..c095c848cf1 100644 --- a/src/devices/cpu/tlcs900/tlcs900.h +++ b/src/devices/cpu/tlcs900/tlcs900.h @@ -743,6 +743,14 @@ private: #define MCFG_TMP95C063_PORTD_WRITE( _port_write ) tmp95c063_device::set_portd_write( *device, DEVCB_##_port_write ); #define MCFG_TMP95C063_PORTE_READ( _port_read ) tmp95c063_device::set_porte_read( *device, DEVCB_##_port_read ); #define MCFG_TMP95C063_PORTE_WRITE( _port_write ) tmp95c063_device::set_porte_write( *device, DEVCB_##_port_write ); +#define MCFG_TMP95C063_AN0_READ( _port_read ) tmp95c063_device::set_an0_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN1_READ( _port_read ) tmp95c063_device::set_an1_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN2_READ( _port_read ) tmp95c063_device::set_an2_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN3_READ( _port_read ) tmp95c063_device::set_an3_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN4_READ( _port_read ) tmp95c063_device::set_an4_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN5_READ( _port_read ) tmp95c063_device::set_an5_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN6_READ( _port_read ) tmp95c063_device::set_an6_read( *device, DEVCB_##_port_read ); +#define MCFG_TMP95C063_AN7_READ( _port_read ) tmp95c063_device::set_an7_read( *device, DEVCB_##_port_read ); class tmp95c063_device : public tlcs900h_device { @@ -776,6 +784,14 @@ public: template<class _Object> static devcb_base &set_portd_write(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_portd_write.set_callback(object); } template<class _Object> static devcb_base &set_porte_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_porte_read.set_callback(object); } template<class _Object> static devcb_base &set_porte_write(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_porte_write.set_callback(object); } + template<class _Object> static devcb_base &set_an0_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an0_read.set_callback(object); } + template<class _Object> static devcb_base &set_an1_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an1_read.set_callback(object); } + template<class _Object> static devcb_base &set_an2_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an2_read.set_callback(object); } + template<class _Object> static devcb_base &set_an3_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an3_read.set_callback(object); } + template<class _Object> static devcb_base &set_an4_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an4_read.set_callback(object); } + template<class _Object> static devcb_base &set_an5_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an5_read.set_callback(object); } + template<class _Object> static devcb_base &set_an6_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an6_read.set_callback(object); } + template<class _Object> static devcb_base &set_an7_read(device_t &device, _Object object) { return downcast<tmp95c063_device &>(device).m_an7_read.set_callback(object); } protected: virtual void device_config_complete() override; @@ -834,6 +850,16 @@ private: // Port E: 8 bit I/O. devcb_read8 m_porte_read; devcb_write8 m_porte_write; + + // analogue inputs, sampled at 10 bits + devcb_read16 m_an0_read; + devcb_read16 m_an1_read; + devcb_read16 m_an2_read; + devcb_read16 m_an3_read; + devcb_read16 m_an4_read; + devcb_read16 m_an5_read; + devcb_read16 m_an6_read; + devcb_read16 m_an7_read; }; #endif diff --git a/src/devices/machine/tms6100.cpp b/src/devices/machine/tms6100.cpp index 402ba1ad7ca..67eb9d17a14 100644 --- a/src/devices/machine/tms6100.cpp +++ b/src/devices/machine/tms6100.cpp @@ -1,93 +1,29 @@ // license:BSD-3-Clause -// copyright-holders:Couriersud +// copyright-holders:hap, Couriersud /********************************************************************************************** Texas Instruments TMS6100 Voice Synthesis Memory (VSM) - - Written for MAME by Couriersud - - Todo: - - implement CS - - implement clock pin(CLK) and gating(RCK) properly - - implement chip addressing (0-15 mask programmed) - - TMS6100: - - +-----------------+ - VDD | 1 28 | NC - NC | 2 27 | NC - DATA/ADD1 | 3 26 | NC - DATA/ADD2 | 4 25 | NC - DATA/ADD4 | 5 24 | NC - DATA/ADD8 | 6 23 | NC - CLK | 7 22 | NC - NC | 8 21 | NC - NC | 9 20 | NC - M0 | 10 19 | NC - M1 | 11 18 | NC - NC | 12 17 | NC - /CS | 13 16 | NC - VSS | 14 15 | NC - +-----------------+ - - TMS6125: - - +---------+ - DATA/ADD1 | 1 16 | NC - DATA/ADD2 | 2 15 | NC - DATA/ADD4 | 3 14 | NC - RCK | 4 13 | NC - CLK | 5 12 | VDD - DATA/ADD8 | 6 11 | CS - NC | 7 10 | M1 - M0 | 8 9 | VSS - +---------+ - - Mitsubishi M58819S EPROM Interface: - - +-----------------+ - AD0 | 1 40 | AD1 - VDDl | 2 39 | AD2 - VDD | 3 38 | AD3 - A0 | 4 37 | NC - NC | 5 36 | AD4 - NC | 6 35 | AD5 - A1 | 7 34 | AD6 - A2 | 8 33 | AD7 - A3/Q | 9 32 | AD8 - CLK | 10 31 | AD9 - POW | 11 30 | AD10 - SL | 12 29 | AD11 - C0 | 13 28 | AD12 - C1 | 14 27 | AD13 - NC | 15 26 | D7 - NC | 16 25 | NC - VSS | 17 24 | D6 - D0 | 18 23 | D5 - D1 | 19 22 | D4 - D2 | 20 21 | D3 - +-----------------+ - - The M58819S is used as an interface to external speech eproms. - Other than not having its ROM internal, it is a clone of TMS6100. - C0/C1 = command pins, equal to M0/M1 - SL = PROM expansion input - POC = power-on clear (think reset) + + References: + - TMS 6100 Voice Synthesis Memory Data Manual + - TMS 6125 Voice Synthesis Memory Data Manual + - Speak & Spell patent US4189779 for low-level documentation + - 1982 Mitsubishi Data Book (M58819S section) + + TODO: + - implement clock pin(CLK) properly, xtal/timer + - command processing timing is not accurate, on the real chip it will take a few microseconds + - current implementation does not regard multi-chip configuration and pretends it is 1 chip, + this will work fine under normal circumstances since CS would be disabled on invalid address + - implement chip addressing (0-15 mask programmed, see above) + - M58819S pins SL(PROM expansion input), POC(reset) ***********************************************************************************************/ #include "tms6100.h" -#define VERBOSE (0) - -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif -#define TMS6100_READ_PENDING 0x01 -#define TMS6100_NEXT_READ_IS_DUMMY 0x02 +// device definitions const device_type TMS6100 = &device_creator<tms6100_device>; @@ -95,7 +31,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_rom(*this, DEVICE_SELF), m_reverse_bits(false), - m_4bit_read(false) + m_4bit_mode(false) { } @@ -103,7 +39,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock, "tms6100", __FILE__), m_rom(*this, DEVICE_SELF), m_reverse_bits(false), - m_4bit_read(false) + m_4bit_mode(false) { } @@ -114,33 +50,43 @@ m58819_device::m58819_device(const machine_config &mconfig, const char *tag, dev { } + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void tms6100_device::device_start() { + m_rommask = m_rom.bytes() - 1; + // zerofill - m_addr_bits = 0; m_address = 0; - m_address_latch = 0; - m_loadptr = 0; + m_sa = 0; + m_count = 0; + m_prev_cmd = 0; + m_prev_m = 0; + + m_add = 0; + m_data = 0; m_m0 = 0; m_m1 = 0; - m_state = 0; - m_data = 0; - m_tms_clock = 0; + m_cs = 1; + m_clk = 0; + m_rck = 0; - // save device variables - save_item(NAME(m_addr_bits)); + // register for savestates save_item(NAME(m_address)); - save_item(NAME(m_address_latch)); - save_item(NAME(m_loadptr)); + save_item(NAME(m_sa)); + save_item(NAME(m_count)); + save_item(NAME(m_prev_cmd)); + save_item(NAME(m_prev_m)); + save_item(NAME(m_add)); + save_item(NAME(m_data)); save_item(NAME(m_m0)); save_item(NAME(m_m1)); - save_item(NAME(m_state)); - save_item(NAME(m_data)); - save_item(NAME(m_tms_clock)); + save_item(NAME(m_cs)); + save_item(NAME(m_clk)); + save_item(NAME(m_rck)); } void m58819_device::device_start() @@ -162,94 +108,153 @@ WRITE_LINE_MEMBER(tms6100_device::m1_w) m_m1 = (state) ? 1 : 0; } -WRITE8_MEMBER(tms6100_device::addr_w) +WRITE_LINE_MEMBER(tms6100_device::cs_w) +{ + // chip select pin + m_cs = (state) ? 1 : 0; +} + +WRITE_LINE_MEMBER(tms6100_device::rck_w) { - m_addr_bits = data & 0xf; + // gate/mask for clk + m_rck = (state) ? 1 : 0; +} + +WRITE8_MEMBER(tms6100_device::add_w) +{ + m_add = data & 0xf; } READ8_MEMBER(tms6100_device::data_r) { - return m_data; + return m_data & 0xf; } READ_LINE_MEMBER(tms6100_device::data_line_r) { // DATA/ADD8 - return m_data; + return (m_data & 8) ? 1 : 0; } - -// CLK/RCK pin - -WRITE_LINE_MEMBER(tms6100_device::romclock_w) +WRITE_LINE_MEMBER(tms6100_device::clk_w) { // process on falling edge - if (m_tms_clock && !state) + if (m_clk && !m_rck && !state) { - switch (m_m1 << 1 | m_m0) + if (m_cs) { - case 0x00: - // NOP in datasheet, not really ... - if (m_state & TMS6100_READ_PENDING) + // new command enabled on rising edge of m0/m1 + UINT8 m = m_m1 << 1 | m_m0; + if ((m & ~m_prev_m & 1) || (m & ~m_prev_m & 2)) + handle_command(m); + + m_prev_m = m; + } + } + + m_clk = (state) ? 1 : 0; +} + + +// m0/m1 commands + +void tms6100_device::handle_command(UINT8 cmd) +{ + enum + { + M_NOP = 0, M_TB, M_LA, M_RB + }; + + switch (cmd) + { + // TB: transfer bit (read) + case M_TB: + if (m_prev_cmd == M_LA) + { + // dummy read after LA + m_count = 0; + } + else { - if (m_state & TMS6100_NEXT_READ_IS_DUMMY) + // load new data from rom + if (m_count == 0) { - LOG(("loaded address %08x\n", m_address_latch)); - m_address = (m_address_latch << 3); - m_address_latch = 0; - m_loadptr = 0; - m_state &= ~TMS6100_NEXT_READ_IS_DUMMY; + m_sa = m_rom[m_address & m_rommask]; + + // M58819S reads serial data reversed + if (m_reverse_bits) + m_sa = BITSWAP8(m_sa,0,1,2,3,4,5,6,7); } else { - // read bit(s) at address - UINT8 word = m_rom[m_address >> 3]; - if (m_reverse_bits) - word = BITSWAP8(word,0,1,2,3,4,5,6,7); - - if (m_4bit_read) - { - m_data = word >> (m_address & 4) & 0xf; - m_address += 4; - } + // or shift(rotate) right + m_sa = (m_sa >> 1) | (m_sa << 7 & 0x80); + } + + // output to DATA pin(s) + if (!m_4bit_mode) + { + // 1-bit mode: SA0 to ADD8/DATA + m_data = m_sa << 3 & 8; + } + else + { + // 4-bit mode: SA0-3 or SA3-6(!) to DATA + if (m_count & 1) + m_data = m_sa >> 3 & 0xf; else - { - m_data = word >> (m_address & 7) & 1; - m_address++; - } + m_data = m_sa & 0xf; } - m_state &= ~TMS6100_READ_PENDING; + + // 8 bits in 1-bit mode, otherwise 2 nybbles + m_count = (m_count + 1) & (m_4bit_mode ? 1 : 7); + + // TB8 + if (m_count == 0) + m_address++; // CS bits too } break; - - case 0x01: - // READ - m_state |= TMS6100_READ_PENDING; - break; - - case 0x02: - // LOAD ADDRESS - m_state |= TMS6100_NEXT_READ_IS_DUMMY; - m_address_latch |= (m_addr_bits << m_loadptr); - LOG(("loaded address latch %08x\n", m_address_latch)); - m_loadptr += 4; + + // LA: load address + case M_LA: + if (m_prev_cmd == M_TB) + { + // start LA after TB + m_address = (m_address & ~0xf) | m_add; + m_count = 0; + } + else if (m_prev_cmd == M_LA) + { + // load consecutive address bits (including CS bits) + // the 8-step counter PLA is shared between LA and TB + if (m_count < 4) + { + const UINT8 shift = 4 * (m_count+1); + m_address = (m_address & ~(0xf << shift)) | (m_add << shift); + } + + m_count = (m_count + 1) & 7; + } break; - case 0x03: - // READ AND BRANCH - if (m_state & TMS6100_NEXT_READ_IS_DUMMY) + // RB: read and branch + case M_RB: + // process RB after LA or TB8 + if (m_prev_cmd == M_LA || (m_prev_cmd == M_TB && m_count == 0)) { - m_state |= TMS6100_READ_PENDING; - m_state &= ~TMS6100_NEXT_READ_IS_DUMMY; // clear - no dummy read according to datasheet - m_address = m_rom[m_address_latch] | (m_rom[m_address_latch+1] << 8); - m_address &= 0x3fff; // 14 bits - LOG(("loaded indirect address %04x\n", m_address)); - m_address = (m_address << 3); - m_address_latch = 0; - m_loadptr = 0; + m_count = 0; + + // load new address bits (14 bits on TMS6100) + UINT16 rb = m_rom[m_address & m_rommask]; + m_address++; + rb |= (m_rom[m_address & m_rommask] << 8); + m_address = (m_address & ~0x3fff) | (rb & 0x3fff); } break; - } + + default: + break; } - m_tms_clock = state; + + m_prev_cmd = cmd; } diff --git a/src/devices/machine/tms6100.h b/src/devices/machine/tms6100.h index e366e8cdd13..cd802bab7d2 100644 --- a/src/devices/machine/tms6100.h +++ b/src/devices/machine/tms6100.h @@ -1,9 +1,10 @@ // license:BSD-3-Clause -// copyright-holders:Couriersud +// copyright-holders:hap, Couriersud +/********************************************************************************************** -/* TMS 6100 memory controller */ + Texas Instruments TMS6100 Voice Synthesis Memory (VSM) -#pragma once +***********************************************************************************************/ #ifndef __TMS6100_H__ #define __TMS6100_H__ @@ -11,7 +12,6 @@ #include "emu.h" - //************************************************************************** // INTERFACE CONFIGURATION MACROS //************************************************************************** @@ -23,6 +23,69 @@ tms6100_device::enable_4bit_mode(*device); +// pinout reference + +/* + TMS6100: + +-----------------+ + VDD | 1 28 | NC + NC | 2 27 | NC + DATA/ADD1 | 3 26 | NC + DATA/ADD2 | 4 25 | NC + DATA/ADD4 | 5 24 | NC + DATA/ADD8 | 6 23 | NC + CLK | 7 22 | NC + NC | 8 21 | NC + NC | 9 20 | NC + M0 | 10 19 | NC + M1 | 11 18 | NC + NC | 12 17 | NC + /CS | 13 16 | NC + VSS | 14 15 | NC + +-----------------+ + + + TMS6125: two types known + + +---------+ +---------+ + DATA/ADD1 | 1 16 | NC DATA/ADD1 | 1 16 | NC + DATA/ADD2 | 2 15 | NC DATA/ADD2 | 2 15 | NC + DATA/ADD4 | 3 14 | NC DATA/ADD4 | 3 14 | NC + RCK | 4 13 | NC DATA/ADD8 | 4 13 | NC + CLK | 5 12 | VDD CLK | 5 12 | VDD + DATA/ADD8 | 6 11 | CS NC | 6 11 | /CS + NC | 7 10 | M1 NC | 7 10 | M1 + M0 | 8 9 | VSS M0 | 8 9 | VSS + +---------+ +---------+ + + + Mitsubishi M58819S EPROM Interface: + It is a clone of TMS6100, but external EPROM instead + + +-----------------+ + AD0 | 1 40 | AD1 + VDDl | 2 39 | AD2 + VDD | 3 38 | AD3 + A0 | 4 37 | NC + NC | 5 36 | AD4 + NC | 6 35 | AD5 + A1 | 7 34 | AD6 + A2 | 8 33 | AD7 + A3/Q | 9 32 | AD8 + CLK | 10 31 | AD9 + POW | 11 30 | AD10 + SL | 12 29 | AD11 + C0 | 13 28 | AD12 + C1 | 14 27 | AD13 + NC | 15 26 | D7 + NC | 16 25 | NC + VSS | 17 24 | D6 + D0 | 18 23 | D5 + D1 | 19 22 | D4 + D2 | 20 21 | D3 + +-----------------+ +*/ + //************************************************************************** // TYPE DEFINITIONS @@ -34,36 +97,45 @@ public: tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - static void enable_4bit_mode(device_t &device) { downcast<tms6100_device &>(device).m_4bit_read = true; } + static void enable_4bit_mode(device_t &device) { downcast<tms6100_device &>(device).m_4bit_mode = true; } DECLARE_WRITE_LINE_MEMBER(m0_w); DECLARE_WRITE_LINE_MEMBER(m1_w); - DECLARE_WRITE_LINE_MEMBER(romclock_w); + DECLARE_WRITE_LINE_MEMBER(rck_w); + DECLARE_WRITE_LINE_MEMBER(cs_w); + DECLARE_WRITE_LINE_MEMBER(clk_w); - DECLARE_WRITE8_MEMBER(addr_w); + DECLARE_WRITE8_MEMBER(add_w); DECLARE_READ8_MEMBER(data_r); // 4bit DECLARE_READ_LINE_MEMBER(data_line_r); protected: // device-level overrides virtual void device_start() override; + + void handle_command(UINT8 cmd); // internal state required_region_ptr<UINT8> m_rom; bool m_reverse_bits; - bool m_4bit_read; - UINT32 m_address; - UINT32 m_address_latch; - UINT8 m_loadptr; + bool m_4bit_mode; + + UINT32 m_rommask; + UINT32 m_address; // internal address + chipselect + UINT8 m_sa; // romdata shift register + UINT8 m_count; // TB/LA counter (-> PLA) + UINT8 m_prev_cmd; // previous handled command + UINT8 m_prev_m; // previous valid m0/m1 state + + UINT8 m_add; // ADD/DATA pins input + UINT8 m_data; // ADD/DATA pins output int m_m0; int m_m1; - UINT8 m_addr_bits; - int m_tms_clock; - UINT8 m_data; - UINT8 m_state; + int m_cs; // chipselect pin + int m_clk; // CLK pin + int m_rck; // RCK pin (mask/gate to CLK?) }; -extern const device_type TMS6100; class m58819_device : public tms6100_device { @@ -75,6 +147,8 @@ protected: virtual void device_start() override; }; + +extern const device_type TMS6100; extern const device_type M58819; diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index 7a4bb506aa3..23548f1ecd7 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -1623,10 +1623,10 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip Quarth (PC-98xx) doesn't seem to use pitch here and it definitely wants bsy to be /2 to make scrolling to work. Xevious (PC-98xx) wants the pitch to be fixed at 80, and wants bsy to be /1 Dragon Buster (PC-98xx) contradicts with Xevious with regards of the pitch tho ... */ - addr = ((sad << 1) & 0x3ffff) + (y * (m_pitch << (im ? 0 : 1))); + addr = ((sad << 1) & 0x3ffff) + ((y / (mixed ? 1 : m_lr)) * (m_pitch << (im ? 0 : 1))); if (!m_display_cb.isnull()) - draw_graphics_line(bitmap, addr, y + ((bsy + m_vbp) / (mixed ? 1 : m_lr)), wd, (m_pitch << interlace)); + draw_graphics_line(bitmap, addr, y + bsy + m_vbp, wd, (m_pitch << interlace)); } } else diff --git a/src/emu/clifront.cpp b/src/emu/clifront.cpp index 96f21ba27e2..465ad6f0981 100644 --- a/src/emu/clifront.cpp +++ b/src/emu/clifront.cpp @@ -1612,7 +1612,7 @@ void cli_frontend::execute_commands(const char *exename) validity_checker valid(m_options); bool result = valid.check_all(); if (!result) - throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed!\n"); + throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed (%d errors, %d warnings in total)\n", valid.errors(), valid.warnings()); return; } diff --git a/src/emu/mame.cpp b/src/emu/mame.cpp index f3ca9059a8d..b952c7ef624 100644 --- a/src/emu/mame.cpp +++ b/src/emu/mame.cpp @@ -194,6 +194,7 @@ int machine_manager::execute() if (system != nullptr) { validity_checker valid(m_options); + valid.set_verbose(false); valid.check_shared_source(*system); } diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index 345b47d010c..cd33ed1bc43 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -125,6 +125,7 @@ validity_checker::validity_checker(emu_options &options) : m_drivlist(options), m_errors(0), m_warnings(0), + m_print_verbose(options.verbose()), m_current_driver(nullptr), m_current_config(nullptr), m_current_device(nullptr), @@ -194,19 +195,15 @@ bool validity_checker::check_all() validate_inlines(); // if we had warnings or errors, output - if (m_errors > 0 || m_warnings > 0) + if (m_errors > 0 || m_warnings > 0 || !m_verbose_text.empty()) { output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Core: %d errors, %d warnings\n", m_errors, m_warnings); if (m_errors > 0) - { - strreplace(m_error_text, "\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str()); - } + output_indented_errors(m_error_text, "Errors"); if (m_warnings > 0) - { - strreplace(m_warning_text, "\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str()); - } + output_indented_errors(m_warning_text, "Warnings"); + if (!m_verbose_text.empty()) + output_indented_errors(m_verbose_text, "Messages"); output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n"); } @@ -277,6 +274,7 @@ void validity_checker::validate_one(const game_driver &driver) int start_warnings = m_warnings; m_error_text.clear(); m_warning_text.clear(); + m_verbose_text.clear(); // wrap in try/except to catch fatalerrors try @@ -295,20 +293,16 @@ void validity_checker::validate_one(const game_driver &driver) } // if we had warnings or errors, output - if (m_errors > start_errors || m_warnings > start_warnings) + if (m_errors > start_errors || m_warnings > start_warnings || !m_verbose_text.empty()) { std::string tempstr; output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Driver %s (file %s): %d errors, %d warnings\n", driver.name, core_filename_extract_base(tempstr, driver.source_file).c_str(), m_errors - start_errors, m_warnings - start_warnings); if (m_errors > start_errors) - { - strreplace(m_error_text, "\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Errors:\n %s", m_error_text.c_str()); - } + output_indented_errors(m_error_text, "Errors"); if (m_warnings > start_warnings) - { - strreplace(m_warning_text, "\n", "\n "); - output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "Warnings:\n %s", m_warning_text.c_str()); - } + output_indented_errors(m_warning_text, "Warnings"); + if (!m_verbose_text.empty()) + output_indented_errors(m_verbose_text, "Messages"); output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n"); } @@ -615,8 +609,8 @@ void validity_checker::validate_roms() device_iterator deviter(m_current_config->root_device()); for (device_t *device = deviter.first(); device != nullptr; device = deviter.next()) { - // for non-root devices, track the current device - m_current_device = (device->owner() == nullptr) ? nullptr : device; + // track the current device + m_current_device = device; // scan the ROM entries for this device const char *last_region_name = "???"; @@ -880,8 +874,8 @@ void validity_checker::validate_inputs() if (device->input_ports() == nullptr) continue; - // for non-root devices, track the current device - m_current_device = (device == &m_current_config->root_device()) ? nullptr : device; + // track the current device + m_current_device = device; // allocate the input ports ioport_list portlist; @@ -983,8 +977,8 @@ void validity_checker::validate_devices() device_iterator iter(m_current_config->root_device()); for (const device_t *device = iter.first(); device != nullptr; device = iter.next()) { - // for non-root devices, track the current device - m_current_device = (device == &m_current_config->root_device()) ? nullptr : device; + // track the current device + m_current_device = device; // validate the device tag validate_tag(device->basetag()); @@ -1048,9 +1042,9 @@ void validity_checker::build_output_prefix(std::string &str) // start empty str.clear(); - // if we have a current device, indicate that - if (m_current_device != nullptr) - str.append(m_current_device->name()).append(" device '").append(m_current_device->tag()).append("': "); + // if we have a current (non-root) device, indicate that + if (m_current_device != nullptr && m_current_device->owner() != nullptr) + str.append(m_current_device->name()).append(" device '").append(m_current_device->tag()+1).append("': "); // if we have a current port, indicate that as well if (m_current_ioport != nullptr) @@ -1089,6 +1083,17 @@ void validity_checker::output_callback(osd_output_channel channel, const char *m strcatvprintf(output, msg, args); m_warning_text.append(output); break; + case OSD_OUTPUT_CHANNEL_VERBOSE: + // if we're not verbose, skip it + if (!m_print_verbose) break; + + // output the source(driver) device 'tag' + build_output_prefix(output); + + // generate the string and output to the original target + strcatvprintf(output, msg, args); + m_verbose_text.append(output); + break; default: chain_output(channel, msg, args); break; @@ -1110,3 +1115,16 @@ void validity_checker::output_via_delegate(osd_output_channel channel, const cha this->chain_output(channel, format, argptr); va_end(argptr); } + +//------------------------------------------------- +// output_indented_errors - helper to output error +// and warning messages with header and indents +//------------------------------------------------- +void validity_checker::output_indented_errors(std::string &text, const char *header) +{ + // remove trailing newline + if (text[text.size()-1] == '\n') + text.erase(text.size()-1, 1); + strreplace(text, "\n", "\n "); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "%s:\n %s\n", header, text.c_str()); +} diff --git a/src/emu/validity.h b/src/emu/validity.h index fa38bb20f93..5a9ea204f59 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -40,6 +40,9 @@ public: int errors() const { return m_errors; } int warnings() const { return m_warnings; } + // setter + void set_verbose(bool verbose) { m_print_verbose = verbose; } + // operations void check_driver(const game_driver &driver); void check_shared_source(const game_driver &driver); @@ -81,6 +84,7 @@ private: // output helpers void build_output_prefix(std::string &str); void output_via_delegate(osd_output_channel channel, const char *format, ...) ATTR_PRINTF(3,4); + void output_indented_errors(std::string &text, const char *header); // internal driver list driver_enumerator m_drivlist; @@ -88,8 +92,10 @@ private: // error tracking int m_errors; int m_warnings; + bool m_print_verbose; std::string m_error_text; std::string m_warning_text; + std::string m_verbose_text; // maps for finding duplicates game_driver_map m_names_map; diff --git a/src/lib/util/corealloc.cpp b/src/lib/util/corealloc.cpp index 38f21846f96..eaf0ff40420 100644 --- a/src/lib/util/corealloc.cpp +++ b/src/lib/util/corealloc.cpp @@ -222,6 +222,44 @@ void free_file_line(void *memory, const char *file, int line, bool array) osd_free(memory); } +void *realloc_internal(void *memory, size_t size, const char *file, int line, bool array) +{ + fprintf(stderr, "realloc_internal called for %p in %s(%d)!\n", memory, file, line); + if(size == 0) { + return nullptr; + } + if(memory == nullptr) { + return malloc_file_line(size, file, line, array, false, false); + } + // find the memory entry + memory_entry *entry = memory_entry::find(memory); + + // warn about untracked reallocs + if (entry == nullptr) + { + fprintf(stderr, "Error: attempt to realloc untracked memory %p in %s(%d)!\n", memory, file, line); + osd_break_into_debugger("Error: attempt to realloc untracked memory"); + return memory; + } + + // this is used internally and should always be an array + if(!array || !entry->m_array) + { + fprintf(stderr, "Error: attempt to realloc non-array memory %p in %s(%d). realloc_internal should never be called directly!\n", memory, file, line); + osd_break_into_debugger("Error: attempt to realloc non-array memory"); + } + + size_t o_size = entry->m_size; + void *new_buf = malloc_file_line(size, file, line, array, false, false); + if(new_buf == nullptr) { + fprintf(stderr, "Error: realloc: unable to allocate new buffer %p in %s(%d)!\n", memory, file, line); + return nullptr; + } + memcpy(new_buf, memory, (o_size < size) ? o_size : size); + free_file_line(memory, file, line, array); + return new_buf; +} + //------------------------------------------------- // track_memory - enables or disables the memory diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 5cd481824ed..c4d6793562d 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -43,6 +43,10 @@ void *malloc_file_line(size_t size, const char *file, int line, bool array, bool void free_file_line(void *memory, const char *file, int line, bool array); inline void free_file_line(const void *memory, const char *file, int line, bool array) { free_file_line(const_cast<void *>(memory), file, line, array); } +// realloc with file and line number info for internal use +void *realloc_internal(void *memory, size_t size, const char *file, int line, bool array); + + // called from the exit path of any code that wants to check for unfreed memory void track_memory(bool track); UINT64 next_memory_id(); @@ -91,7 +95,7 @@ extern const zeromem_t zeromem; #undef free #define malloc(x) malloc_file_line(x, __FILE__, __LINE__, true, false, false) -#define realloc(x,y) __error_realloc_is_dangerous__ +#define realloc(x,y) realloc_internal(x, y, __FILE__, __LINE__, true, false) #define free(x) free_file_line(x, __FILE__, __LINE__, true) #if !defined(_MSC_VER) || _MSC_VER < 1900 // < VS2015 diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp index 727b19cbe72..8ca9f121dda 100644 --- a/src/mame/audio/dkong.cpp +++ b/src/mame/audio/dkong.cpp @@ -1387,9 +1387,9 @@ MACHINE_CONFIG_DERIVED( radarscp1_audio, radarscp_audio ) MCFG_SOUND_ADD("tms", M58817, XTAL_640kHz) MCFG_TMS5110_M0_CB(DEVWRITELINE("m58819", tms6100_device, m0_w)) MCFG_TMS5110_M1_CB(DEVWRITELINE("m58819", tms6100_device, m1_w)) - MCFG_TMS5110_ADDR_CB(DEVWRITE8("m58819", tms6100_device, addr_w)) + MCFG_TMS5110_ADDR_CB(DEVWRITE8("m58819", tms6100_device, add_w)) MCFG_TMS5110_DATA_CB(DEVREADLINE("m58819", tms6100_device, data_line_r)) - MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("m58819", tms6100_device, romclock_w)) + MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("m58819", tms6100_device, clk_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 465abdc9b80..99bc10dc341 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -314,6 +314,8 @@ public: DECLARE_READ8_MEMBER(c400_int_bank_r); DECLARE_WRITE8_MEMBER(c400_w); DECLARE_READ8_MEMBER(c800_r); + DECLARE_READ8_MEMBER(c800_int_r); + DECLARE_READ8_MEMBER(c800_b2_int_r); DECLARE_WRITE8_MEMBER(c800_w); DECLARE_READ8_MEMBER(inh_r); DECLARE_WRITE8_MEMBER(inh_w); @@ -1963,6 +1965,40 @@ READ8_MEMBER(apple2e_state::c800_r) return read_floatingbus(); } +READ8_MEMBER(apple2e_state::c800_int_r) +{ + if ((m_isiicplus) && (offset >= 0x600)) + { + return m_iicplus_ce00[offset-0x600]; + } + + if (offset == 0x7ff) + { + m_cnxx_slot = CNXX_UNCLAIMED; + update_slotrom_banks(); + return 0xff; + } + + return m_rom_ptr[0x800 + offset]; +} + +READ8_MEMBER(apple2e_state::c800_b2_int_r) +{ + if ((m_isiicplus) && (offset >= 0x600)) + { + return m_iicplus_ce00[offset-0x600]; + } + + if (offset == 0x7ff) + { + m_cnxx_slot = CNXX_UNCLAIMED; + update_slotrom_banks(); + return 0xff; + } + + return m_rom_ptr[0x4800 + offset]; +} + WRITE8_MEMBER(apple2e_state::c800_w) { if ((m_isiicplus) && (offset >= 0x600)) @@ -2385,8 +2421,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( c800bank_map, AS_PROGRAM, 8, apple2e_state ) AM_RANGE(0x0000, 0x07ff) AM_READWRITE(c800_r, c800_w) - AM_RANGE(0x0800, 0x0fff) AM_ROM AM_REGION("maincpu", 0x800) - AM_RANGE(0x1000, 0x17ff) AM_ROM AM_REGION("maincpu", 0x4800) + AM_RANGE(0x0800, 0x0fff) AM_READWRITE(c800_int_r, c800_w) + AM_RANGE(0x1000, 0x17ff) AM_READWRITE(c800_b2_int_r, c800_w) ADDRESS_MAP_END static ADDRESS_MAP_START( inhbank_map, AS_PROGRAM, 8, apple2e_state ) diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index fbb92009889..919e59b54cc 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -658,103 +658,72 @@ static MACHINE_CONFIG_START( dc, dc_cons_state ) MCFG_SLOT_DEFAULT_OPTION("gdrom") MACHINE_CONFIG_END -/* -PsyMan notes: - -Here's a basic report on the Dreamcast boot files used in MAME (BIOS+Flash pairs): - ------ - -"dc101d_us.bin", 0x000000, 0x200000, CRC(89f2b1a1) SHA1(8951d1bb219ab2ff8583033d2119c899cc81f18c) ) // BIOS -This is a proper European and USA BIOS. It's even possible that it was used at a later point for Japanese systems. -It only has minor differences compared to BIOS 1.01c. - - -"dcus_ntsc.bin", 0x000000, 0x020000, BAD_DUMP CRC(c611b498) SHA1(94d44d7f9529ec1642ba3771ed3c5f756d5bc872) ) // Flash -Checking at 0x0001A000 and the mirrored data at 0x0001A0A0 gives away that this is hacked from a PAL/European flash file. -The broadcast (0x0001A004) is also set at 50Hz which is a PAL standard. - - -"dc101d_eu.bin", 0x000000, 0x200000, CRC(a2564fad) SHA1(edc5d3d70a93c935703d26119b37731fd317d2bf),ROM_BIOS(1)) // BIOS -This BIOS has Chinese language added. So either this is a bad BIOS or Dreamcast was actually officially released there. - - -"dc101c_eu.bin", 0x000000, 0x200000, CRC(2f551bc5) SHA1(1ede8d5be49116a4c6f3fe0961175469537a0434),ROM_BIOS(2)) // BIOS -This seems to be a proper European and USA BIOS. It's even possible that it was used at a later point for Japanese systems. -It only has minor differences compared to BIOS 1.01d. - - - -"dceu_pal.bin", 0x000000, 0x020000, BAD_DUMP CRC(b7e5aeeb) SHA1(11e02433e13b793ec7ffe0ae2356750bb8a575b4) ) // Flash -This appears to be a valid PAL/European flash. It's unknown if the data at 0x0001A0A0 (from 0x0001A000) should be mirrored there. -Maybe a game does this mirroring or maybe it's there by default. It's certain that some games wrote to this flash though. - -"dc1004jp.bin", 0x000000, 0x200000, CRC(5454841f) SHA1(1ea132c0fbbf07ef76789eadc07908045c089bd6) ) // BIOS -This seems to be a proper Japanese BIOS. This BIOS was used at least by early Japanese Dreamcast models. -Code-wise, it has major differences compared to later BIOS versions. +#define ROM_LOAD_BIOS(bios,name,offset,length,hash) \ + ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) +// actual mask rom labels can have -X1 or -X2 added, presumable depending on mobo revision and/or type of rom used (5v or 3.3v), contents is the same +// known to exists undumped MPR-21086 (VA0 NTSC-J 3010) and MPR-21933 (VA0 US) boot roms -"dcjp_ntsc.bin", 0x000000, 0x020000, CRC(5f92bf76) SHA1(be78b834f512ab2cf3d67b96e377c9f3093ff82a) ) // Flash -Checking at 0x0001A000 and the mirrored data at 0x0001A0A0 gives away that this is hacked from a PAL/European flash file. -The broadcast (0x0001A004) is also set at 50Hz which is a PAL standard. - ------ - - -From all the aforementioned files the only personally verified one is "dc101d_us.bin", CRC(89f2b1a1). -The resulting file was dumped twice, once from an NTSC/USA system and once from a PAL/EUR system. Both files had a side by side byte match. -*/ +#define DREAMCAST_COMMON_BIOS \ + ROM_REGION(0x200000, "maincpu", 0) \ + ROM_SYSTEM_BIOS(0, "101d", "v1.01d (World)") \ + ROM_LOAD_BIOS(0, "mpr-21931.ic501", 0x000000, 0x200000, CRC(89f2b1a1) SHA1(8951d1bb219ab2ff8583033d2119c899cc81f18c) ) \ + ROM_SYSTEM_BIOS(1, "1022", "v1.022 (World)") \ + ROM_LOAD_BIOS(1, "mpr-23588.ic501", 0x000000, 0x200000, CRC(786168f9) SHA1(ba8bbb90fdb29525f24f17055dc2c7b2d7674437) ) \ + ROM_SYSTEM_BIOS(2, "101c", "v1.01c (World)") \ + ROM_LOAD_BIOS(2, "mpr-21871.ic501", 0x000000, 0x200000, CRC(2f551bc5) SHA1(1ede8d5be49116a4c6f3fe0961175469537a0434) ) \ + ROM_SYSTEM_BIOS(3, "101dch", "v1.01d (Chinese hack)") \ + ROM_LOAD_BIOS(3, "dc101d_ch.bin", 0x000000, 0x200000, CRC(a2564fad) SHA1(edc5d3d70a93c935703d26119b37731fd317d2bf) ) +// ^^^ dc101d_eu.bin ^^^ is selfmade chinese translation, doesn't work on real hardware, does it must be here at all ? ROM_START(dc) - ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD( "dc101d_us.bin", 0x000000, 0x200000, CRC(89f2b1a1) SHA1(8951d1bb219ab2ff8583033d2119c899cc81f18c) ) // BIOS + DREAMCAST_COMMON_BIOS ROM_REGION(0x020000, "dcflash", 0) - ROM_LOAD( "dcus_ntsc.bin", 0x000000, 0x020000, BAD_DUMP CRC(c611b498) SHA1(94d44d7f9529ec1642ba3771ed3c5f756d5bc872) ) // Flash - ROM_FILL( 0x1a004, 1, 0x30 ) // patch broadcast back to NTSC + ROM_LOAD( "dcus_ntsc.bin", 0x000000, 0x020000, BAD_DUMP CRC(e6862dd0) SHA1(24875ce85c011600e73b1c3fd2b341824cbf8544) ) // dumped from VA2.4 mobo with 1.022 BIOS ROM_END ROM_START( dceu ) - ROM_REGION(0x200000, "maincpu", 0) - ROM_SYSTEM_BIOS(0, "101d", "v1.01d") - ROMX_LOAD( "dc101d_eu.bin", 0x000000, 0x200000, CRC(a2564fad) SHA1(edc5d3d70a93c935703d26119b37731fd317d2bf),ROM_BIOS(1)) // BIOS - ROM_SYSTEM_BIOS(1, "101c", "v1.01c") - ROMX_LOAD( "dc101c_eu.bin", 0x000000, 0x200000, CRC(2f551bc5) SHA1(1ede8d5be49116a4c6f3fe0961175469537a0434),ROM_BIOS(2)) // BIOS + DREAMCAST_COMMON_BIOS ROM_REGION(0x020000, "dcflash", 0) - ROM_LOAD( "dceu_pal.bin", 0x000000, 0x020000, BAD_DUMP CRC(b7e5aeeb) SHA1(11e02433e13b793ec7ffe0ae2356750bb8a575b4) ) // Flash + ROM_LOAD( "dceu_pal.bin", 0x000000, 0x020000, BAD_DUMP CRC(b7e5aeeb) SHA1(11e02433e13b793ec7ffe0ae2356750bb8a575b4) ) ROM_END ROM_START( dcjp ) - ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD( "dc1004jp.bin", 0x000000, 0x200000, CRC(5454841f) SHA1(1ea132c0fbbf07ef76789eadc07908045c089bd6) ) // BIOS + DREAMCAST_COMMON_BIOS + ROM_SYSTEM_BIOS(4, "1004", "v1.004 (Japan)") // oldest known mass production version, supports Japan region only + ROM_LOAD_BIOS(4, "mpr-21068.ic501", 0x000000, 0x200000, CRC(5454841f) SHA1(1ea132c0fbbf07ef76789eadc07908045c089bd6) ) ROM_REGION(0x020000, "dcflash", 0) /* ROM_LOAD( "dcjp_ntsc.bad", 0x000000, 0x020000, BAD_DUMP CRC(307a7035) SHA1(1411423a9d071340ea52c56e19c1aafc4e1309ee) ) // Hacked Flash */ - ROM_LOAD( "dcjp_ntsc.bin", 0x000000, 0x020000, BAD_DUMP CRC(5f92bf76) SHA1(be78b834f512ab2cf3d67b96e377c9f3093ff82a) ) // Flash + ROM_LOAD( "dcjp_ntsc.bin", 0x000000, 0x020000, BAD_DUMP CRC(5f92bf76) SHA1(be78b834f512ab2cf3d67b96e377c9f3093ff82a) ) // hacked PAL flash ROM_FILL( 0x1a004, 1, 0x30 ) // patch broadcast back to NTSC ROM_END +// normally, with DIP switch 4 off, HKT-100/110/120 AKA "Katana Set 5.xx", will be booted from flash ROM IC507 (first 2 dumps below) +// otherwise it boots from EPROM which contain system checker software (last dump) ROM_START( dcdev ) ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD( "hkt-0120.bin", 0x000000, 0x200000, CRC(2186e0e5) SHA1(6bd18fb83f8fdb56f1941e079580e5dd672a6dad) ) // BIOS - - ROM_REGION(0x020000, "dcflash", 0) - ROM_LOAD( "hkt-0120-flash.bin", 0x000000, 0x020000, CRC(7784c304) SHA1(31ef57f550d8cd13e40263cbc657253089e53034) ) // Flash -ROM_END - -ROM_START( dcprt ) - ROM_REGION(0x200000, "maincpu", 0) - ROM_LOAD( "katana-set5-v0.41-98-08-27.bin", 0x000000, 0x200000, CRC(485877bd) SHA1(dc1af1f1248ffa87d57bc5ef2ea41aac95ecfc5e) ) // BIOS + ROM_SYSTEM_BIOS(0, "1011", "Katana Set5 v1.011 (World)") // BOOT flash rom update from Katana SDK R9-R11, WinCE SDK v2.1 + ROM_LOAD_BIOS(0, "set5v1.011.ic507", 0x000000, 0x200000, CRC(2186e0e5) SHA1(6bd18fb83f8fdb56f1941e079580e5dd672a6dad) ) + ROM_SYSTEM_BIOS(1, "1001", "Katana Set5 v1.001 (Japan)") // BOOT flash rom update from WinCE SDK v1.0 + ROM_LOAD_BIOS(1, "set5v1.001.ic507", 0x000000, 0x200000, CRC(5702d38f) SHA1(ea7a3ae1de73683008dd795c252941a4fc81b42e) ) + + // 27C160 EPROM (DIP42) IC??? labeled + // SET5 FC52 + // V0.41 98/08/27 + // also known to exists v0.71 98/11/13 + ROM_SYSTEM_BIOS(2, "041", "Katana Set5 Checker v0.41") + ROM_LOAD_BIOS(2, "set5v0.41.bin", 0x000000, 0x200000, CRC(485877bd) SHA1(dc1af1f1248ffa87d57bc5ef2ea41aac95ecfc5e) ) ROM_REGION(0x020000, "dcflash", 0) - ROM_LOAD( "dcjp_ntsc.bin", 0x000000, 0x020000, CRC(5f92bf76) SHA1(be78b834f512ab2cf3d67b96e377c9f3093ff82a) ) // Flash + ROM_LOAD( "hkt-0120-flash.bin", 0x000000, 0x020000, CRC(7784c304) SHA1(31ef57f550d8cd13e40263cbc657253089e53034) ) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ CONS( 1999, dc, dcjp, 0, dc, dc, dc_cons_state, dcus, "Sega", "Dreamcast (USA, NTSC)", MACHINE_NOT_WORKING ) CONS( 1998, dcjp, 0, 0, dc, dc, dc_cons_state, dcjp, "Sega", "Dreamcast (Japan, NTSC)", MACHINE_NOT_WORKING ) CONS( 1999, dceu, dcjp, 0, dc, dc, dc_cons_state, dcus, "Sega", "Dreamcast (Europe, PAL)", MACHINE_NOT_WORKING ) -CONS( 1998, dcdev, dcjp, 0, dc, dc, dc_cons_state, dc, "Sega", "HKT-0120 Sega Dreamcast Development Box", MACHINE_NOT_WORKING ) -CONS( 1998, dcprt, dcjp, 0, dc, dc, dc_cons_state, dcjp, "Sega", "Katana Set 5 Prototype", MACHINE_NOT_WORKING ) +CONS( 1998, dcdev, 0, 0, dc, dc, dc_cons_state, dc, "Sega", "HKT-0120 Sega Dreamcast Development Box", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index 8c151817379..16c34dc56ba 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -488,7 +488,7 @@ public: optional_device<ata_interface_device> m_ide; required_shared_ptr<UINT16> m_video_ram_1; required_shared_ptr<UINT16> m_video_ram_2; - optional_shared_ptr<UINT16> m_ext_gvram; + optional_shared_ptr<UINT32> m_ext_gvram; required_device<beep_device> m_beeper; optional_device<ram_device> m_ram; required_device<gfxdecode_device> m_gfxdecode; @@ -772,32 +772,24 @@ UPD7220_DISPLAY_PIXELS_MEMBER( pc9801_state::hgdc_display_pixels ) int xi; int res_x,res_y; UINT8 pen; - UINT8 interlace_on; UINT8 colors16_mode; if(m_video_ff[DISPLAY_REG] == 0) //screen is off return; -// popmessage("%02x %d",m_video_ff[INTERLACE_REG],machine().first_screen()->visible_area().max_y + 1); -// interlace_on = ((machine().first_screen()->visible_area().max_y + 1) >= 400) ? 1 : 0; - interlace_on = m_video_ff[INTERLACE_REG]; colors16_mode = (m_ex_video_ff[ANALOG_16_MODE]) ? 16 : 8; if(m_ex_video_ff[ANALOG_256_MODE]) { + UINT8 *ext_gvram = (UINT8 *)m_ext_gvram.target(); for(xi=0;xi<16;xi++) { res_x = x + xi; res_y = y; - if(!m_screen->visible_area().contains(res_x, res_y*2+0)) - return; - - pen = m_ext_gvram[((address*16+xi)+(m_vram_disp*0x40000)) >> 1]; + pen = ext_gvram[(address >> 1)*16+xi+(m_vram_disp*0x20000)]; - bitmap.pix32(res_y*2+0, res_x) = palette[pen + 0x20]; - if(m_screen->visible_area().contains(res_x, res_y*2+1)) - bitmap.pix32(res_y*2+1, res_x) = palette[pen + 0x20]; + bitmap.pix32(res_y, res_x) = palette[pen + 0x20]; } } else @@ -812,17 +804,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( pc9801_state::hgdc_display_pixels ) pen|= ((m_video_ram_2[((address & 0x7fff) + (0x18000) + (m_vram_disp*0x20000)) >> 1] >> xi) & 1) ? 4 : 0; if(m_ex_video_ff[ANALOG_16_MODE]) pen|= ((m_video_ram_2[((address & 0x7fff) + (0) + (m_vram_disp*0x20000)) >> 1] >> xi) & 1) ? 8 : 0; - - if(interlace_on) - { - if(m_screen->visible_area().contains(res_x, res_y*2+0)) - bitmap.pix32(res_y*2+0, res_x) = palette[pen + colors16_mode]; - /* TODO: it looks like that PC-98xx can only display even lines ... */ - if(m_screen->visible_area().contains(res_x, res_y*2+1)) - bitmap.pix32(res_y*2+1, res_x) = palette[pen + colors16_mode]; - } - else - bitmap.pix32(res_y, res_x) = palette[pen + colors16_mode]; + bitmap.pix32(res_y, res_x) = palette[pen + colors16_mode]; } } } diff --git a/src/mame/drivers/r9751.cpp b/src/mame/drivers/r9751.cpp index fd8f0e5c9a0..5ca1d8d153a 100644 --- a/src/mame/drivers/r9751.cpp +++ b/src/mame/drivers/r9751.cpp @@ -67,8 +67,8 @@ public: DECLARE_READ32_MEMBER(r9751_mmio_5ff_r); DECLARE_WRITE32_MEMBER(r9751_mmio_5ff_w); - DECLARE_READ32_MEMBER(r9751_mmio_ff05_r); - DECLARE_WRITE32_MEMBER(r9751_mmio_ff05_w); + DECLARE_READ32_MEMBER(r9751_mmio_ff05_r); + DECLARE_WRITE32_MEMBER(r9751_mmio_ff05_w); DECLARE_READ32_MEMBER(r9751_mmio_fff8_r); DECLARE_WRITE32_MEMBER(r9751_mmio_fff8_w); @@ -77,7 +77,6 @@ public: DECLARE_DRIVER_INIT(r9751); - //DECLARE_FLOPPY_FORMATS( floppy_formats ); private: required_device<cpu_device> m_maincpu; required_device<pdc_device> m_pdc; @@ -87,14 +86,13 @@ private: // Begin registers UINT32 reg_ff050004; - UINT32 reg_ff050320; // Counter? UINT32 reg_fff80040; UINT32 fdd_dest_address; // 5FF080B0 UINT32 fdd_cmd_complete; UINT32 smioc_out_addr; + attotime timer_32khz_last; // End registers -// UINT32 fdd_scsi_command; address_space *m_mem; // functions @@ -117,14 +115,12 @@ READ8_MEMBER(r9751_state::pdc_dma_r) WRITE8_MEMBER(r9751_state::pdc_dma_w) { - /* NOTE: This needs to be changed to a function that accepts an address and data */ m_maincpu->space(AS_PROGRAM).write_byte(m_pdc->fdd_68k_dma_address,data); } DRIVER_INIT_MEMBER(r9751_state,r9751) { reg_ff050004 = 0; - reg_ff050320 = 1; reg_fff80040 = 0; fdd_dest_address = 0; // fdd_scsi_command = 0; @@ -158,20 +154,16 @@ READ32_MEMBER( r9751_state::r9751_mmio_5ff_r ) /* PDC HDD region (0x24, device 9) */ case 0x5FF00824: /* HDD Command result code */ return 0x10; - break; case 0x5FF03024: /* HDD SCSI command completed successfully */ data = 0x1; if(TRACE_HDC) logerror("SCSI HDD command completion status - Read: %08X, From: %08X, Register: %08X\n", data, space.machine().firstcpu->pc(), address); return data; - break; /* SMIOC region (0x98, device 26) */ case 0x5FF00898: /* Serial status or DMA status */ return 0x40; - break; /* PDC FDD region (0xB0, device 44 */ case 0x5FF008B0: /* FDD Command result code */ return 0x10; - break; case 0x5FF010B0: /* Clear 5FF030B0 ?? */ if(TRACE_FDC) logerror("--- FDD 0x5FF010B0 READ (0)\n"); return 0; @@ -179,7 +171,6 @@ READ32_MEMBER( r9751_state::r9751_mmio_5ff_r ) data = (m_pdc->reg_p5 << 8) + m_pdc->reg_p4; if(TRACE_FDC) logerror("--- SCSI FDD command completion status - Read: %08X, From: %08X, Register: %08X\n", data, space.machine().firstcpu->pc(), address); return data; - break; default: if(TRACE_FDC || TRACE_HDC || TRACE_SMIOC) logerror("Instruction: %08x READ MMIO(%08x): %08x & %08x\n", space.machine().firstcpu->pc(), address, 0, mem_mask); return 0; @@ -306,23 +297,16 @@ READ32_MEMBER( r9751_state::r9751_mmio_ff05_r ) { case 0xFF050004: return reg_ff050004; - break; case 0xFF050300: return 0x1B | (1<<0x14); - break; case 0xFF050320: /* Some type of counter */ - reg_ff050320++; - return reg_ff050320; - break; + return (machine().time() - timer_32khz_last).as_ticks(32768) & 0xFFFF; case 0xFF050584: return 0; - break; case 0xFF050610: return 0xabacabac; - break; case 0xFF060014: return 0x80; - break; default: data = 0; if(TRACE_CPU_REG) logerror("Instruction: %08x READ MMIO(%08x): %08x & %08x\n", space.machine().firstcpu->pc(), address, data, mem_mask); @@ -339,11 +323,11 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_ff05_w ) case 0xFF050004: reg_ff050004 = data; return; - break; case 0xFF05000C: /* CPU LED hex display indicator */ if(TRACE_LED) logerror("\n*** LED: %02x, Instruction: %08x ***\n\n", data, space.machine().firstcpu->pc()); return; - break; + case 0xFF050320: + timer_32khz_last = machine().time(); default: if(TRACE_CPU_REG) logerror("Instruction: %08x WRITE MMIO(%08x): %08x & %08x\n", space.machine().firstcpu->pc(), address, data, mem_mask); return; @@ -359,7 +343,6 @@ READ32_MEMBER( r9751_state::r9751_mmio_fff8_r ) { case 0xFFF80040: return reg_fff80040; - break; default: data = 0; if(TRACE_CPU_REG) logerror("Instruction: %08x READ MMIO(%08x): %08x & %08x\n", space.machine().firstcpu->pc(), address, data, mem_mask); @@ -376,7 +359,6 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_fff8_w ) case 0xFFF80040: reg_fff80040 = data; return; - break; default: if(TRACE_CPU_REG) logerror("Instruction: %08x WRITE MMIO(%08x): %08x & %08x\n", space.machine().firstcpu->pc(), address, data, mem_mask); } @@ -389,10 +371,9 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_fff8_w ) static ADDRESS_MAP_START(r9751_mem, AS_PROGRAM, 32, r9751_state) //ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x00000000,0x00ffffff) AM_RAM AM_SHARE("main_ram") // 16MB - //AM_RANGE(0x01000000,0x07ffffff) AM_NOP AM_RANGE(0x08000000,0x0800ffff) AM_ROM AM_REGION("prom", 0) - AM_RANGE(0x5FF00000,0x5FFFFFFF) AM_READWRITE(r9751_mmio_5ff_r, r9751_mmio_5ff_w) - AM_RANGE(0xFF050000,0xFF06FFFF) AM_READWRITE(r9751_mmio_ff05_r, r9751_mmio_ff05_w) + AM_RANGE(0x5FF00000,0x5FFFFFFF) AM_READWRITE(r9751_mmio_5ff_r, r9751_mmio_5ff_w) + AM_RANGE(0xFF050000,0xFF06FFFF) AM_READWRITE(r9751_mmio_ff05_r, r9751_mmio_ff05_w) AM_RANGE(0xFFF80000,0xFFF8FFFF) AM_READWRITE(r9751_mmio_fff8_r, r9751_mmio_fff8_w) //AM_RANGE(0xffffff00,0xffffffff) AM_RAM // Unknown area ADDRESS_MAP_END diff --git a/src/mame/drivers/raiden2.cpp b/src/mame/drivers/raiden2.cpp index d6c01448171..d8adf647efb 100644 --- a/src/mame/drivers/raiden2.cpp +++ b/src/mame/drivers/raiden2.cpp @@ -1582,7 +1582,7 @@ ROM_START( raiden2 ) ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ ROM_LOAD( "jj4b02__ami18cv8-15.u0342.jed", 0x0000, 0x288, NO_DUMP) - ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x335, CRC(d1a039af) SHA1(f88ff8674d5be17ae9085b51aefcf6abf0574883) ) ROM_END @@ -1622,7 +1622,7 @@ ROM_START( raiden2sw ) // original board with serial # 0008307 ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ ROM_LOAD( "jj4b02__ami18cv8-15.u0342.jed", 0x0000, 0x288, NO_DUMP) - ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x335, CRC(d1a039af) SHA1(f88ff8674d5be17ae9085b51aefcf6abf0574883) ) ROM_END /* @@ -1679,8 +1679,8 @@ ROM_START( raiden2hk ) ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ ROM_LOAD( "jj4b02__ami18cv8-15.u0342.jed", 0x0000, 0x288, NO_DUMP) - ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x288, NO_DUMP) - ROM_END + ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x335, CRC(d1a039af) SHA1(f88ff8674d5be17ae9085b51aefcf6abf0574883) ) +ROM_END /* @@ -1753,8 +1753,8 @@ ROM_START( raiden2j ) ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ ROM_LOAD( "jj4b02__ami18cv8-15.u0342.jed", 0x0000, 0x288, NO_DUMP) - ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x288, NO_DUMP) - ROM_END + ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x335, CRC(d1a039af) SHA1(f88ff8674d5be17ae9085b51aefcf6abf0574883) ) +ROM_END ROM_START( raiden2i ) ROM_REGION( 0x200000, "maincpu", 0 ) /* v30 main cpu */ @@ -1792,8 +1792,8 @@ ROM_START( raiden2i ) ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ ROM_LOAD( "jj4b02__ami18cv8-15.u0342.jed", 0x0000, 0x288, NO_DUMP) - ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x288, NO_DUMP) - ROM_END + ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341.jed", 0x0000, 0x335, CRC(d1a039af) SHA1(f88ff8674d5be17ae9085b51aefcf6abf0574883) ) +ROM_END /* diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp index f61a97cc71c..e94210e21fb 100644 --- a/src/mame/drivers/sfkick.cpp +++ b/src/mame/drivers/sfkick.cpp @@ -44,13 +44,112 @@ Board # CBK1029 CN1: 40 PIN Connector (Epoxy Block ) CN2: 8 PIN Connector (Epoxy Block) -1UP: 4 PIN Connector (Analog Controls ?) -2UP: 4 PIN Connector (Analog Controls ?) +1UP: 4 PIN Connector (Analog Controls) +2UP: 4 PIN Connector (Analog Controls) Z8400A (x2) UM82C55A-PC YM2203C +Documentation as per manual: + + Main Jamma Connector + Solder Side | Parts Side +------------------------------------------------------------------ + GND | A | 1 | GND + GND | B | 2 | GND + +5 | C | 3 | +5 + +5 | D | 4 | +5 + | E | 5 | + +12 | F | 6 | +12 +----- KEY -----| H | 7 |----- KEY ----- + | J | 8 | + | K | 9 | + Speaker (-) | L | 10| Speaker (+) + | M | 11| + Video Green | N | 12| Video Red + Video Sync | P | 13| Video Blue + Player 1 Left | R | 14| Player 2 Right +Player 1 Right | S | 15| Player 2 Left + Coin Switch 2 | T | 16| Coin Switch 1 +Player 2 Start | U | 17| Player 1 Start + | V | 18| + | W | 19| + | X | 20| + | Y | 21| +Player 2 Shoot | Z | 22| Player 1 Shoot + | a | 23| + | b | 24| + | c | 25| + | d | 26| + GND | e | 27| GND + GND | f | 28| GND + + ____ + / \ + | Dial | + \____/ + /| |\ + / | | \ + Blue Red Black Yellow + / | | \ +Left +5v GND Right + + +DIPSW-1 +------------------------------------------------------------------ + DipSwitch Title | Function | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | +------------------------------------------------------------------ + Cabinet Style | Upright |off| | + | Cocktail |on | | +------------------------------------------------------------------ + Stage Select | Off | |off| | + | On | |on | | +------------------------------------------------------------------ + Freeze Screen | Off | |off| | + | On | |on | | +------------------------------------------------------------------ + Test / Game Mode | Game | |off| | + | Test | |on | | +------------------------------------------------------------------ + Allow Continue | Off | |off| | + | On | |on | | +------------------------------------------------------------------ + | 1cn/1cr | |off|off|off| + | 1cn/2cr | |on |off|off| + | 1cn/3cr | |off|on |off| + Coinage | 1cn/5cr | |on |on |off| + | 2cn/1cr | |off|off|on | + | 2cn/3cr | |on |off|on | + | 3cn/1cr | |off|on |on | + | 3cn/2cr | |on |on |on | +------------------------------------------------------------------ + +DIPSW-2 +------------------------------------------------------------------ + DipSwitch Title | Function | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | +------------------------------------------------------------------ + No Comment | N/A |off| | +------------------------------------------------------------------ + Demo Sounds | Yes | |off| | + | No | |on | | +------------------------------------------------------------------ + | 1 | |off|off| | + Players Count | 2 | |on |off| | + | 3 | |off|on | | + | 5 | |on |on | | +----------------------------------------------------------------- + | None | |off|off| | + Bonus |Every 20K | |on |off| | + |20K & 50K | |off|on | | + |Every 50K | |on |on | | +------------------------------------------------------------------ + | Easy | |off|off| + Difficulty | Normal | |on |off| + | Hard | |off|on | + | V.Hard | |on |on | +------------------------------------------------------------------ + */ #include "emu.h" @@ -137,8 +236,8 @@ READ8_MEMBER(sfkick_state::ppi_port_b_r) case 0: return m_in0->read(); case 1: return m_in1->read(); case 2: return BITSWAP8(m_dial->read(),4,5,6,7,3,2,1,0); - case 3: return m_dsw2->read(); - case 4: return m_dsw1->read(); + case 3: return m_dsw1->read(); + case 4: return m_dsw2->read(); } return 0xff; } @@ -411,41 +510,22 @@ static INPUT_PORTS_START( sfkick ) PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(-20) PORT_START("DSW1") /* bitswapped at read! 76543210 -> 45673210 */ - PORT_DIPNAME( 0x82, 0x02, DEF_STR( Unknown ) ) /* unknown, code @ $98a8 */ - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x02, "2" ) - PORT_DIPSETTING( 0x80, "1" ) - PORT_DIPSETTING( 0x82, "0" ) - PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Difficulty ) ) /* not sure, code @ $9877 */ - PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* unused ? */ - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x41, 0x01, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPSETTING( 0x40, "2" ) - PORT_DIPSETTING( 0x41, "1" ) - - PORT_START("DSW2") /* bitswapped at read! 76543210 -> 45673210 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* unused ? */ - PORT_DIPNAME( 0x02, 0x02, "Test Mode" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x10, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x20, 0x20, "Freeze" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) + PORT_DIPNAME( 0x01, 0x01, "Stage Select" ) PORT_DIPLOCATION("SW1:2") /* How does this work?? */ + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Freeze" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Test Mode" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x8c, 0x8c, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x8c, 0x8c, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:6,8,7") PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x84, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 3C_2C ) ) @@ -454,6 +534,27 @@ static INPUT_PORTS_START( sfkick ) PORT_DIPSETTING( 0x88, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) ) + + PORT_START("DSW2") /* bitswapped at read! 76543210 -> 45673210 */ + PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:1" ) /* Manual states "No Comment" */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x41, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x41, "1" ) + PORT_DIPSETTING( 0x40, "2" ) + PORT_DIPSETTING( 0x01, "3" ) + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPNAME( 0x82, 0x02, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x80, "Every 20,000" ) + PORT_DIPSETTING( 0x02, "20,000 & 50,000" ) + PORT_DIPSETTING( 0x00, "Every 50,000" ) + PORT_DIPSETTING( 0x82, DEF_STR( None ) ) + PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) INPUT_PORTS_END WRITE_LINE_MEMBER(sfkick_state::sfkick_vdp_interrupt) diff --git a/src/mame/drivers/taitopjc.cpp b/src/mame/drivers/taitopjc.cpp index 3326bfa9cd3..c9e6807add9 100644 --- a/src/mame/drivers/taitopjc.cpp +++ b/src/mame/drivers/taitopjc.cpp @@ -106,7 +106,8 @@ public: m_dsp(*this, "dsp"), m_tc0780fpa(*this, "tc0780fpa"), m_palette(*this, "palette"), - m_polyrom(*this, "poly") + m_polyrom(*this, "poly"), + m_gfxdecode(*this, "gfxdecode") { } required_device<cpu_device> m_maincpu; @@ -116,6 +117,7 @@ public: required_device<tc0780fpa_device> m_tc0780fpa; required_device<palette_device> m_palette; required_memory_region m_polyrom; + required_device<gfxdecode_device> m_gfxdecode; DECLARE_READ64_MEMBER(video_r); DECLARE_WRITE64_MEMBER(video_w); @@ -141,6 +143,9 @@ public: void videochip_w(offs_t address, UINT32 data); void video_exit(); void print_display_list(); + TILE_GET_INFO_MEMBER(tile_get_info); + TILEMAP_MAPPER_MEMBER(tile_scan_layer0); + TILEMAP_MAPPER_MEMBER(tile_scan_layer1); DECLARE_DRIVER_INIT(optiger); @@ -150,6 +155,8 @@ public: std::unique_ptr<UINT32[]> m_screen_ram; std::unique_ptr<UINT32[]> m_pal_ram; + tilemap_t *m_tilemap[2]; + UINT32 m_video_address; UINT32 m_dsp_rom_address; @@ -183,50 +190,66 @@ void taitopjc_state::video_exit() #endif } -void taitopjc_state::video_start() +TILE_GET_INFO_MEMBER(taitopjc_state::tile_get_info) { - m_screen_ram = std::make_unique<UINT32[]>(0x40000); - m_pal_ram = std::make_unique<UINT32[]>(0x8000); + UINT32 val = m_screen_ram[0x3f000 + (tile_index/2)]; - machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitopjc_state::video_exit), this)); + if (!(tile_index & 1)) + val >>= 16; + + int color = (val >> 12) & 0xf; + int tile = (val & 0xfff); + int flags = 0; + + SET_TILE_INFO_MEMBER(0, tile, color, flags); } -UINT32 taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +TILEMAP_MAPPER_MEMBER(taitopjc_state::tile_scan_layer0) { - UINT8 *s = (UINT8*)m_screen_ram.get(); - int x,y,t,u; - - bitmap.fill(0x000000, cliprect); + /* logical (col,row) -> memory offset */ + return (row * 64) + col; +} - UINT16 *s16 = (UINT16*)m_screen_ram.get(); +TILEMAP_MAPPER_MEMBER(taitopjc_state::tile_scan_layer1) +{ + /* logical (col,row) -> memory offset */ + return (row * 64) + col + 32; +} - for (u=0; u < 24; u++) +void taitopjc_state::video_start() +{ + static const gfx_layout char_layout = { - for (t=0; t < 32; t++) - { - UINT16 tile = s16[(0x7e000 + (u*64) + t) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)]; + 16, 16, + 4032, + 8, + { 0,1,2,3,4,5,6,7 }, + { 3*8, 2*8, 1*8, 0*8, 7*8, 6*8, 5*8, 4*8, 11*8, 10*8, 9*8, 8*8, 15*8, 14*8, 13*8, 12*8 }, + { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 }, + 8*256 + }; - int palette = (tile >> 12) & 0xf; + m_screen_ram = std::make_unique<UINT32[]>(0x40000); + m_pal_ram = std::make_unique<UINT32[]>(0x8000); - tile &= 0xfff; + m_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taitopjc_state::tile_get_info),this), tilemap_mapper_delegate(FUNC(taitopjc_state::tile_scan_layer0),this), 16, 16, 32, 32); + m_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taitopjc_state::tile_get_info),this), tilemap_mapper_delegate(FUNC(taitopjc_state::tile_scan_layer1),this), 16, 16, 32, 32); + m_tilemap[0]->set_transparent_pen(0); + m_tilemap[1]->set_transparent_pen(1); + + m_gfxdecode->set_gfx(0, std::make_unique<gfx_element>(m_palette, char_layout, (UINT8*)m_screen_ram.get(), 0, m_palette->entries() / 256, 0)); - for (y=0; y < 16; y++) - { - UINT16 *fb = &bitmap.pix16(y+(u*16)); - for (x=0; x < 16; x++) - { - UINT8 p = s[((tile*256) + ((y*16)+x)) ^ NATIVE_ENDIAN_VALUE_LE_BE(3,0)]; - if (p != 0) - { - fb[x+(t*16)] = (palette << 8) + p; - } - } - } - } - } + machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitopjc_state::video_exit), this)); +} + +UINT32 taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0x000000, cliprect); m_tc0780fpa->draw(bitmap, cliprect); + m_tilemap[0]->draw(screen, bitmap, cliprect, 0); + return 0; } @@ -255,7 +278,19 @@ void taitopjc_state::videochip_w(offs_t address, UINT32 data) } else if (address >= 0x10000000 && address < 0x10040000) { - m_screen_ram[address - 0x10000000] = data; + UINT32 addr = address - 0x10000000; + m_screen_ram[addr] = data; + + if (address >= 0x1003f000) + { + UINT32 a = address - 0x1003f000; + m_tilemap[0]->mark_tile_dirty((a*2)); + m_tilemap[0]->mark_tile_dirty((a*2)+1); + } + else + { + m_gfxdecode->gfx(0)->mark_dirty(addr / 64); + } } else { @@ -687,16 +722,16 @@ static INPUT_PORTS_START( taitopjc ) PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("ANALOG1") // Player 1 X - PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X ) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X ) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(30) PORT_START("ANALOG2") // Player 1 Y - PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y ) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y ) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(30) PORT_START("ANALOG3") // Player 2 X - PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X ) PORT_PLAYER(2) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_X ) PORT_PLAYER(2) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(30) PORT_START("ANALOG4") // Player 2 Y - PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y ) PORT_PLAYER(2) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) + PORT_BIT( 0x3ff, 0x200, IPT_AD_STICK_Y ) PORT_PLAYER(2) PORT_MINMAX(0x000,0x3ff) PORT_SENSITIVITY(35) PORT_KEYDELTA(30) INPUT_PORTS_END @@ -727,6 +762,10 @@ static MACHINE_CONFIG_START( taitopjc, taitopjc_state ) MCFG_TMP95C063_PORT5_READ(IOPORT("INPUTS1")) MCFG_TMP95C063_PORTD_READ(IOPORT("INPUTS2")) MCFG_TMP95C063_PORTE_READ(IOPORT("INPUTS3")) + MCFG_TMP95C063_AN0_READ(IOPORT("ANALOG1")) + MCFG_TMP95C063_AN1_READ(IOPORT("ANALOG2")) + MCFG_TMP95C063_AN2_READ(IOPORT("ANALOG3")) + MCFG_TMP95C063_AN3_READ(IOPORT("ANALOG4")) MCFG_CPU_PROGRAM_MAP(tlcs900h_mem) MCFG_CPU_VBLANK_INT_DRIVER("screen", taitopjc_state, taitopjc_vbi) @@ -753,6 +792,8 @@ static MACHINE_CONFIG_START( taitopjc, taitopjc_state ) MCFG_PALETTE_ADD("palette", 32768) + MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) + MCFG_DEVICE_ADD("tc0780fpa", TC0780FPA, 0) MACHINE_CONFIG_END @@ -765,6 +806,12 @@ DRIVER_INIT_MEMBER(taitopjc_state, optiger) // skip sound check rom[0x217] = 0x00; rom[0x218] = 0x00; + +#if 0 + UINT32 *mr = (UINT32*)memregion("user1")->base(); + //mr[(0x23a5c^4)/4] = 0x60000000; + mr[((0x513b0-0x40000)^4)/4] = 0x38600001; +#endif } diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index e98514b41bb..163501bb9ff 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -917,9 +917,9 @@ static MACHINE_CONFIG_FRAGMENT( tms5110_route ) /* sound hardware */ MCFG_TMS5110_M0_CB(DEVWRITELINE("tms6100", tms6100_device, m0_w)) MCFG_TMS5110_M1_CB(DEVWRITELINE("tms6100", tms6100_device, m1_w)) - MCFG_TMS5110_ADDR_CB(DEVWRITE8("tms6100", tms6100_device, addr_w)) + MCFG_TMS5110_ADDR_CB(DEVWRITE8("tms6100", tms6100_device, add_w)) MCFG_TMS5110_DATA_CB(DEVREADLINE("tms6100", tms6100_device, data_line_r)) - MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("tms6100", tms6100_device, romclock_w)) + MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("tms6100", tms6100_device, clk_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MACHINE_CONFIG_END @@ -1071,7 +1071,7 @@ ROM_START( snspell ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge ROM_LOAD( "tmc0351nl.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) ) ROM_LOAD( "tmc0352nl.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) ) ROM_END @@ -1087,7 +1087,7 @@ ROM_START( snspella ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge ROM_LOAD( "tmc0351n2l.vsm", 0x0000, 0x4000, CRC(2d03b292) SHA1(a3e9a365307ae936c7472f720a7a8240741531d6) ) ROM_LOAD( "tmc0352n2l.vsm", 0x4000, 0x4000, CRC(a6d56883) SHA1(eebf9c07f2f9001679dec06c2367d4a50596d04b) ) ROM_END @@ -1103,7 +1103,7 @@ ROM_START( snspellb ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge ROM_LOAD( "cd2350a.vsm", 0x0000, 0x4000, CRC(2adda742) SHA1(3f868ed8284b723c815a30343057e03467c043b5) ) ROM_END @@ -1118,7 +1118,7 @@ ROM_START( snspelluk ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge ROM_LOAD( "cd2303.vsm", 0x0000, 0x4000, CRC(0fae755c) SHA1(b68c3120a63a61db474feb5d71a6e5dd67910d80) ) ROM_LOAD( "cd2304.vsm", 0x4000, 0x4000, CRC(e2a270eb) SHA1(c13c95ad15f1923a4841f66504e0f22646e71d99) ) ROM_END @@ -1134,7 +1134,7 @@ ROM_START( snspelluka ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge ROM_LOAD( "cd62175.vsm", 0x0000, 0x4000, CRC(6e1063d4) SHA1(b5c66c51148c5921ecb8ffccd7a460ae639cdb68) ) ROM_END @@ -1149,7 +1149,7 @@ ROM_START( snspelljp ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge ROM_LOAD( "cd2321.vsm", 0x0000, 0x4000, CRC(ac010cce) SHA1(c0200d857b62be696248ac2d684a390c66ab0c31) ) ROM_LOAD( "cd2322.vsm", 0x4000, 0x4000, CRC(b6f4bba4) SHA1(65d686a9385b5ef3f080a5f47c6b2418bb9455b0) ) ROM_END @@ -1165,7 +1165,7 @@ ROM_START( snspellfr ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, BAD_DUMP CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) // placeholder, use the one we have - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge ROM_LOAD( "cd2352.vsm", 0x0000, 0x4000, CRC(181a239e) SHA1(e16043766c385e152b7005c1c010be4c5fccdd9b) ) ROM_END @@ -1180,7 +1180,7 @@ ROM_START( snspellit ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_output.pla", 0, 1246, BAD_DUMP CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) // placeholder, use the one we have - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // uses only 1 rom, 8000-bfff = space reserved for cartridge ROM_LOAD( "cd62190.vsm", 0x0000, 0x4000, CRC(63832002) SHA1(ea8124b2bf0f5908c5f1a56d60063f2468a10143) ) ROM_END @@ -1234,7 +1234,7 @@ ROM_START( snread ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_cd2705_output.pla", 0, 1246, CRC(bf859848) SHA1(66b297fbf534968fa6db7413b99ef0e81cc35ddc) ) - ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge ROM_LOAD( "cd2394a.vsm", 0x0000, 0x4000, CRC(cbb0e2b1) SHA1(5e322c683baf806523de171310258ae371671327) ) ROM_LOAD( "cd2395a.vsm", 0x4000, 0x4000, CRC(3d519504) SHA1(76b19ba5a9a3486005e09c98e8a6abc8b88288dd) ) ROM_END diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp index 4f1ba13968b..e1c7568986c 100644 --- a/src/mame/drivers/tispellb.cpp +++ b/src/mame/drivers/tispellb.cpp @@ -51,7 +51,6 @@ TODO: - spellb fetches wrong word sometimes (on lv1 SPOON and ANT) - roms were doublechecked - - mrchalgr wrong sound, need more accurate tms6100 emulation ***************************************************************************/ @@ -222,13 +221,11 @@ WRITE16_MEMBER(tispellb_state::rev2_write_r) // R12: TMC0355 CS // R4: TMC0355 M1 // R6: TMC0355 M0 - if (data & 0x1000) - { - m_tms6100->m1_w(data >> 4 & 1); - m_tms6100->m0_w(data >> 6 & 1); - m_tms6100->romclock_w(1); - m_tms6100->romclock_w(0); - } + m_tms6100->cs_w(data >> 12 & 1); + m_tms6100->m1_w(data >> 4 & 1); + m_tms6100->m0_w(data >> 6 & 1); + m_tms6100->clk_w(1); + m_tms6100->clk_w(0); // rest is same as rev1 main_write_r(space, offset, data); @@ -372,7 +369,7 @@ static MACHINE_CONFIG_START( rev2, tispellb_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispellb_state, rev2_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tispellb_state, rev2_write_r)) MCFG_TMS0270_READ_CTL_CB(DEVREAD8("tms6100", tms6100_device, data_r)) - MCFG_TMS0270_WRITE_CTL_CB(DEVWRITE8("tms6100", tms6100_device, addr_w)) + MCFG_TMS0270_WRITE_CTL_CB(DEVWRITE8("tms6100", tms6100_device, add_w)) MCFG_DEVICE_ADD("tms6100", TMS6100, 350000) MCFG_TMS6100_4BIT_MODE() @@ -428,7 +425,7 @@ ROM_START( mrchalgr ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_mrchalgr_output.pla", 0, 1246, CRC(4785289c) SHA1(60567af0ea120872a4ccf3128e1365fe84722aa8) ) - ROM_REGION( 0x4000, "tms6100", ROMREGION_ERASEFF ) + ROM_REGION( 0x1000, "tms6100", 0 ) ROM_LOAD( "cd2601.vsm", 0x0000, 0x1000, CRC(a9fbe7e9) SHA1(9d480cb30313b8cbce2d048140c1e5e6c5b92452) ) ROM_END diff --git a/src/mame/mess.lst b/src/mame/mess.lst index b897cb18d8b..d7478eea078 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -116,7 +116,6 @@ dcjp // 1998 Sega Dreamcast (Japan) dc // 1999 Sega Dreamcast (USA) dceu // 1999 Sega Dreamcast (Europe) dcdev // 1998 Sega HKT-0120 Sega Dreamcast Development Box -dcprt // 1998 Sega Katana Set 5 Prototype svmu // 1998 Sega Visual Memory Unit diff --git a/src/osd/modules/debugger/debugint.cpp b/src/osd/modules/debugger/debugint.cpp index 87ad2cf7dc2..9cc50230d88 100644 --- a/src/osd/modules/debugger/debugint.cpp +++ b/src/osd/modules/debugger/debugint.cpp @@ -1398,26 +1398,26 @@ static void CreateMainMenu(running_machine &machine) /* add input menu items */ - menu->item_append("New Memory Window", nullptr, 0, (void *)on_memory_window_activate); - menu->item_append("New Disassembly Window", nullptr, 0, (void *)on_disassembly_window_activate); - menu->item_append("New Error Log Window", nullptr, 0, (void *)on_log_window_activate); - menu->item_append("New Breakpoints Window", nullptr, 0, (void *)on_bp_window_activate); - menu->item_append("New Watchpoints Window", nullptr, 0, (void *)on_wp_window_activate); + menu->item_append("New Memory Window", "[Ctrl+M]", 0, (void *)on_memory_window_activate); + menu->item_append("New Disassembly Window", "[Ctrl+D]", 0, (void *)on_disassembly_window_activate); + menu->item_append("New Error Log Window", "[Ctrl+L]", 0, (void *)on_log_window_activate); + menu->item_append("New Breakpoints Window", "[Ctrl+B]", 0, (void *)on_bp_window_activate); + menu->item_append("New Watchpoints Window", "[Ctrl+W]", 0, (void *)on_wp_window_activate); menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); - menu->item_append("Run", nullptr, 0, (void *)on_run_activate); - menu->item_append("Run and Hide Debugger", nullptr, 0, (void *)on_run_h_activate); - menu->item_append("Run to Next CPU", nullptr, 0, (void *)on_run_cpu_activate); - menu->item_append("Run until Next Interrupt on This CPU", nullptr, 0, (void *)on_run_irq_activate); - menu->item_append("Run until Next VBLANK", nullptr, 0, (void *)on_run_vbl_activate); + menu->item_append("Run", "[F5]", 0, (void *)on_run_activate); + menu->item_append("Run and Hide Debugger", "[F12]", 0, (void *)on_run_h_activate); + menu->item_append("Run to Next CPU", "[F6]", 0, (void *)on_run_cpu_activate); + menu->item_append("Run until Next Interrupt on This CPU", "[F7]", 0, (void *)on_run_irq_activate); + menu->item_append("Run until Next VBLANK", "[F8]", 0, (void *)on_run_vbl_activate); menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); - menu->item_append("Step Into", nullptr, 0, (void *)on_step_into_activate); - menu->item_append("Step Over", nullptr, 0, (void *)on_step_over_activate); + menu->item_append("Step Into", "[F11]", 0, (void *)on_step_into_activate); + menu->item_append("Step Over", "[F10]", 0, (void *)on_step_over_activate); menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); - menu->item_append("Soft Reset", nullptr, 0, (void *)on_soft_reset_activate); - menu->item_append("Hard Reset", nullptr, 0, (void *)on_hard_reset_activate); + menu->item_append("Soft Reset", "[F3]", 0, (void *)on_soft_reset_activate); + menu->item_append("Hard Reset", "[Shift+F3]", 0, (void *)on_hard_reset_activate); menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU)) - menu->item_append("Close Window", nullptr, 0, (void *)on_close_activate); + menu->item_append("Close Window", "[Shift+F4]", 0, (void *)on_close_activate); menu->item_append("Exit", nullptr, 0, (void *)on_exit_activate); } @@ -1470,6 +1470,186 @@ static void handle_mouse(running_machine &machine) } } +static void handle_keys(running_machine &machine) +{ + if (menu != nullptr) + return; + + // global keys + if(machine.input().code_pressed_once(KEYCODE_F3)) + { + if(machine.input().code_pressed(KEYCODE_LSHIFT)) + machine.schedule_hard_reset(); + else + { + machine.schedule_soft_reset(); + debug_cpu_get_visible_cpu(machine)->debug()->go(); + } + } + + if(machine.input().code_pressed_once(KEYCODE_F5)) + debug_cpu_get_visible_cpu(machine)->debug()->go(); + if(machine.input().code_pressed_once(KEYCODE_F6)) + debug_cpu_get_visible_cpu(machine)->debug()->go_next_device(); + if(machine.input().code_pressed_once(KEYCODE_F7)) + debug_cpu_get_visible_cpu(machine)->debug()->go_interrupt(); + if(machine.input().code_pressed_once(KEYCODE_F8)) + debug_cpu_get_visible_cpu(machine)->debug()->go_vblank(); + if(machine.input().code_pressed_once(KEYCODE_F10)) + debug_cpu_get_visible_cpu(machine)->debug()->single_step_over(); + if(machine.input().code_pressed_once(KEYCODE_F11)) + debug_cpu_get_visible_cpu(machine)->debug()->single_step(); + if(machine.input().code_pressed_once(KEYCODE_F12)) + { + debug_hide_all(); + debug_cpu_get_visible_cpu(machine)->debug()->go(); + } + + // TODO: make common functions to be shared here and with the menu callbacks + if(machine.input().code_pressed_once(KEYCODE_D)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + { + DView *ndv; + render_target *target; + const debug_view_source *source; + + target = &machine.render().ui_target(); + + ndv = dview_alloc(target, machine, DVT_DISASSEMBLY, 0); + ndv->editor.active = TRUE; + ndv->editor.container = &machine.render().ui_container(); + source = ndv->view->source(); + dview_set_title(ndv, source->name()); + ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT; + win_count++; + set_focus_view(ndv); + } + } + if(machine.input().code_pressed_once(KEYCODE_M)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + { + DView *ndv; + render_target *target; + const debug_view_source *source; + + target = &machine.render().ui_target(); + + ndv = dview_alloc(target, machine, DVT_MEMORY, 0); + ndv->editor.active = TRUE; + ndv->editor.container = &machine.render().ui_container(); + source = ndv->view->source(); + dview_set_title(ndv, source->name()); + ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT; + ndv->bounds.setx(0,500); + win_count++; + + set_focus_view(ndv); + } + } + if(machine.input().code_pressed_once(KEYCODE_L)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + { + DView *ndv; + render_target *target; + + target = &machine.render().ui_target(); + ndv = dview_alloc(target, machine, DVT_LOG, 0); + dview_set_title(ndv, "Log"); + ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT; + ndv->bounds.setx(0,600); + win_count++; + set_focus_view(ndv); + } + } + if(machine.input().code_pressed_once(KEYCODE_B)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + { + DView *ndv; + render_target *target; + + target = &machine.render().ui_target(); + ndv = dview_alloc(target, machine, DVT_BREAK_POINTS, 0); + dview_set_title(ndv, "Breakpoints"); + ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT; + ndv->bounds.setx(0,600); + win_count++; + set_focus_view(ndv); + } + } + if(machine.input().code_pressed_once(KEYCODE_W)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + { + DView *ndv; + render_target *target; + + target = &machine.render().ui_target(); + ndv = dview_alloc(target, machine, DVT_WATCH_POINTS, 0); + dview_set_title(ndv, "Watchpoints"); + ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT; + ndv->bounds.setx(0,600); + win_count++; + set_focus_view(ndv); + } + } + if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU)) + { + if(machine.input().code_pressed_once(KEYCODE_F4)) + { + if(machine.input().code_pressed(KEYCODE_LSHIFT)) // use shift+F4, as ctrl+F4 is used to toggle keepaspect. + { + DView* dv = focus_view; + set_focus_view(focus_view->next); + win_count--; + dview_free(dv); + } + } + } + + + // pass keypresses to debug view with focus + if(machine.input().code_pressed_once(KEYCODE_UP)) + focus_view->view->process_char(DCH_UP); + if(machine.input().code_pressed_once(KEYCODE_DOWN)) + focus_view->view->process_char(DCH_DOWN); + if(machine.input().code_pressed_once(KEYCODE_LEFT)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + focus_view->view->process_char(DCH_CTRLLEFT); + else + focus_view->view->process_char(DCH_LEFT); + } + if(machine.input().code_pressed_once(KEYCODE_RIGHT)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + focus_view->view->process_char(DCH_CTRLRIGHT); + else + focus_view->view->process_char(DCH_RIGHT); + } + if(machine.input().code_pressed_once(KEYCODE_PGUP)) + focus_view->view->process_char(DCH_PUP); + if(machine.input().code_pressed_once(KEYCODE_PGDN)) + focus_view->view->process_char(DCH_PDOWN); + if(machine.input().code_pressed_once(KEYCODE_HOME)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + focus_view->view->process_char(DCH_CTRLHOME); + else + focus_view->view->process_char(DCH_HOME); + } + if(machine.input().code_pressed_once(KEYCODE_END)) + { + if(machine.input().code_pressed(KEYCODE_LCONTROL)) + focus_view->view->process_char(DCH_CTRLEND); + else + focus_view->view->process_char(DCH_END); + } +} + /*------------------------------------------------- handle_editor - handle the editor @@ -1661,6 +1841,7 @@ void debug_internal::wait_for_debugger(device_t &device, bool firststop) device.machine().osd().update(false); handle_menus(device.machine()); handle_mouse(device.machine()); + handle_keys(device.machine()); //osd_sleep(osd_ticks_per_second()/60); } diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 39767eb6210..f6dc6aabdae 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -13,8 +13,6 @@ #include "osdepend.h" #include "modules/lib/osdobj_common.h" -extern bool g_print_verbose; - const options_entry osd_options::s_option_entries[] = { { NULL, NULL, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" }, @@ -155,6 +153,7 @@ osd_options::osd_options() osd_common_t::osd_common_t(osd_options &options) : osd_output(), m_machine(NULL), m_options(options), + m_print_verbose(false), m_sound(NULL), m_debugger(NULL) { @@ -278,10 +277,12 @@ void osd_common_t::output_callback(osd_output_channel channel, const char *msg, vfprintf(stderr, msg, args); break; case OSD_OUTPUT_CHANNEL_INFO: - case OSD_OUTPUT_CHANNEL_VERBOSE: case OSD_OUTPUT_CHANNEL_LOG: vfprintf(stdout, msg, args); break; + case OSD_OUTPUT_CHANNEL_VERBOSE: + if (verbose()) vfprintf(stdout, msg, args); + break; case OSD_OUTPUT_CHANNEL_DEBUG: #ifdef MAME_DEBUG vfprintf(stdout, msg, args); @@ -333,7 +334,7 @@ void osd_common_t::init(running_machine &machine) osd_options &options = downcast<osd_options &>(machine.options()); // extract the verbose printing option if (options.verbose()) - g_print_verbose = true; + set_verbose(true); // ensure we get called on the way out machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(osd_common_t::osd_exit), this)); diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index d1aca5f4e43..a73931f3fa1 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -202,7 +202,6 @@ public: // getters running_machine &machine() { assert(m_machine != nullptr); return *m_machine; } - virtual void debugger_update(); virtual void init_subsystems(); @@ -228,6 +227,8 @@ public: // osd_output interface ... virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override; + bool verbose() const { return m_print_verbose; } + void set_verbose(bool print_verbose) { m_print_verbose = print_verbose; } protected: virtual bool input_init(); @@ -238,6 +239,8 @@ private: running_machine * m_machine; osd_options& m_options; + bool m_print_verbose; + osd_module_manager m_mod_man; font_module *m_font_module; diff --git a/src/osd/osdcore.cpp b/src/osd/osdcore.cpp index 91ba3fc4266..632124e2e7c 100644 --- a/src/osd/osdcore.cpp +++ b/src/osd/osdcore.cpp @@ -3,8 +3,6 @@ #include "osdcore.h" -bool g_print_verbose = false; - static const int MAXSTACK = 10; static osd_output *m_stack[MAXSTACK]; static int m_ptr = -1; @@ -104,10 +102,6 @@ void CLIB_DECL osd_printf_verbose(const char *format, ...) { va_list argptr; - /* if we're not verbose, skip it */ - if (!g_print_verbose) - return; - /* do the output */ va_start(argptr, format); if (m_ptr >= 0) m_stack[m_ptr]->output_callback(OSD_OUTPUT_CHANNEL_VERBOSE, format, argptr); |