mirror of
https://github.com/holub/mame
synced 2025-10-08 17:37:56 +03:00
Cleanups and version bump
This commit is contained in:
parent
13b862c4fa
commit
26e7a17b63
@ -38,8 +38,8 @@
|
|||||||
<publisher>Texas Instruments</publisher>
|
<publisher>Texas Instruments</publisher>
|
||||||
<part name="cart" interface="lantutor">
|
<part name="cart" interface="lantutor">
|
||||||
<dataarea name="rom" size="0x10000">
|
<dataarea name="rom" size="0x10000">
|
||||||
<!-- <rom name="cd2315.vsm" size="0x4000" crc="" sha1="" offset="0x0000" /> -->
|
<!-- <rom name="cd2315.vsm" size="0x4000" crc="" sha1="" offset="0x0000" /> -->
|
||||||
<!-- <rom name="cd2316.vsm" size="0x4000" crc="" sha1="" offset="0x4000" /> -->
|
<!-- <rom name="cd2316.vsm" size="0x4000" crc="" sha1="" offset="0x4000" /> -->
|
||||||
<rom name="cd2317.vsm" size="0x4000" crc="53231c0b" sha1="472117c3d0e28437fa8faa054f98088e06efc2a1" offset="0x8000" />
|
<rom name="cd2317.vsm" size="0x4000" crc="53231c0b" sha1="472117c3d0e28437fa8faa054f98088e06efc2a1" offset="0x8000" />
|
||||||
<rom name="cd2318.vsm" size="0x4000" crc="6c0727bc" sha1="132e39755b122f2cbec6f3e767f5d256a9c1e7ae" offset="0xc000" />
|
<rom name="cd2318.vsm" size="0x4000" crc="6c0727bc" sha1="132e39755b122f2cbec6f3e767f5d256a9c1e7ae" offset="0xc000" />
|
||||||
</dataarea>
|
</dataarea>
|
||||||
|
@ -217,4 +217,3 @@ WRITE_LINE_MEMBER( device_a8sio_card_interface::motor_w )
|
|||||||
SLOT_INTERFACE_START(a8sio_cards)
|
SLOT_INTERFACE_START(a8sio_cards)
|
||||||
SLOT_INTERFACE("cassette", A8SIO_CASSETTE)
|
SLOT_INTERFACE("cassette", A8SIO_CASSETTE)
|
||||||
SLOT_INTERFACE_END
|
SLOT_INTERFACE_END
|
||||||
|
|
||||||
|
@ -115,4 +115,3 @@ void a8sio_cassette_device::device_timer(emu_timer &timer, device_timer_id id, i
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,9 +105,9 @@ UINT8 nes_vaus_device::read_bit34()
|
|||||||
UINT8 nes_vausfc_device::read_exp(offs_t offset)
|
UINT8 nes_vausfc_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
ret = m_button->read() << 1;
|
ret = m_button->read() << 1;
|
||||||
else //$4017
|
else //$4017
|
||||||
{
|
{
|
||||||
ret = (m_latch & 0x80) >> 6;
|
ret = (m_latch & 0x80) >> 6;
|
||||||
m_latch <<= 1;
|
m_latch <<= 1;
|
||||||
|
@ -184,7 +184,7 @@ int nes_bcbattle_device::read_current_bit()
|
|||||||
UINT8 nes_bcbattle_device::read_exp(offs_t offset)
|
UINT8 nes_bcbattle_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) //$4017
|
if (offset == 1) //$4017
|
||||||
{
|
{
|
||||||
ret |= read_current_bit() << 2;
|
ret |= read_current_bit() << 2;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ SLOT_INTERFACE_START( nes_control_port1_devices )
|
|||||||
SLOT_INTERFACE("joypad", NES_JOYPAD)
|
SLOT_INTERFACE("joypad", NES_JOYPAD)
|
||||||
SLOT_INTERFACE("zapper", NES_ZAPPER)
|
SLOT_INTERFACE("zapper", NES_ZAPPER)
|
||||||
SLOT_INTERFACE("4score_p1p3", NES_4SCORE_P1P3)
|
SLOT_INTERFACE("4score_p1p3", NES_4SCORE_P1P3)
|
||||||
// SLOT_INTERFACE("miracle_piano", NES_MIRACLE)
|
// SLOT_INTERFACE("miracle_piano", NES_MIRACLE)
|
||||||
SLOT_INTERFACE_END
|
SLOT_INTERFACE_END
|
||||||
|
|
||||||
SLOT_INTERFACE_START( nes_control_port2_devices )
|
SLOT_INTERFACE_START( nes_control_port2_devices )
|
||||||
|
@ -183,7 +183,7 @@ void nes_fckeybrd_device::device_reset()
|
|||||||
UINT8 nes_fckeybrd_device::read_exp(offs_t offset)
|
UINT8 nes_fckeybrd_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
{
|
{
|
||||||
// FC Keyboard: tape input
|
// FC Keyboard: tape input
|
||||||
if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
|
if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
|
||||||
@ -195,7 +195,7 @@ UINT8 nes_fckeybrd_device::read_exp(offs_t offset)
|
|||||||
ret |= 0x02;
|
ret |= 0x02;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //$4017
|
else //$4017
|
||||||
{
|
{
|
||||||
// FC Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4
|
// FC Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4
|
||||||
if (m_fck_scan < 9)
|
if (m_fck_scan < 9)
|
||||||
|
@ -119,7 +119,7 @@ void nes_ftrainer_device::device_reset()
|
|||||||
UINT8 nes_ftrainer_device::read_exp(offs_t offset)
|
UINT8 nes_ftrainer_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) //$4017
|
if (offset == 1) //$4017
|
||||||
{
|
{
|
||||||
if (!BIT(m_row_scan, 0))
|
if (!BIT(m_row_scan, 0))
|
||||||
{
|
{
|
||||||
|
@ -117,9 +117,9 @@ nes_hori4p_device::nes_hori4p_device(const machine_config &mconfig, const char *
|
|||||||
UINT8 nes_horitwin_device::read_exp(offs_t offset)
|
UINT8 nes_horitwin_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
ret |= (m_port1->read_bit0() << 1);
|
ret |= (m_port1->read_bit0() << 1);
|
||||||
else //$4017
|
else //$4017
|
||||||
ret |= (m_port2->read_bit0() << 1);
|
ret |= (m_port2->read_bit0() << 1);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -127,21 +127,21 @@ UINT8 nes_horitwin_device::read_exp(offs_t offset)
|
|||||||
UINT8 nes_hori4p_device::read_exp(offs_t offset)
|
UINT8 nes_hori4p_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (m_cfg->read() == 0) // 2P
|
if (m_cfg->read() == 0) // 2P
|
||||||
{
|
{
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
ret |= (m_port1->read_bit0() << 1);
|
ret |= (m_port1->read_bit0() << 1);
|
||||||
else //$4017
|
else //$4017
|
||||||
ret |= (m_port2->read_bit0() << 1);
|
ret |= (m_port2->read_bit0() << 1);
|
||||||
}
|
}
|
||||||
else // 4P
|
else // 4P
|
||||||
{
|
{
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
{
|
{
|
||||||
ret |= (m_port1->read_bit0() << 0);
|
ret |= (m_port1->read_bit0() << 0);
|
||||||
ret |= (m_port3->read_bit0() << 1);
|
ret |= (m_port3->read_bit0() << 1);
|
||||||
}
|
}
|
||||||
else //$4017
|
else //$4017
|
||||||
{
|
{
|
||||||
ret |= (m_port2->read_bit0() << 0);
|
ret |= (m_port2->read_bit0() << 0);
|
||||||
ret |= (m_port4->read_bit0() << 1);
|
ret |= (m_port4->read_bit0() << 1);
|
||||||
|
@ -103,14 +103,14 @@ static INPUT_PORTS_START( nes_arcstick )
|
|||||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B")
|
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B")
|
||||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
|
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
|
||||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
|
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
|
||||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
||||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
||||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
||||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
|
||||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
||||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
||||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
||||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
|
||||||
INPUT_PORTS_END
|
INPUT_PORTS_END
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -245,7 +245,7 @@ UINT8 nes_joypad_device::read_bit0()
|
|||||||
UINT8 nes_fcpad2_device::read_exp(offs_t offset)
|
UINT8 nes_fcpad2_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (!offset) // microphone input
|
if (!offset) // microphone input
|
||||||
ret |= m_joypad->read() & 0x04;
|
ret |= m_joypad->read() & 0x04;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -260,9 +260,9 @@ UINT8 nes_fcpad2_device::read_exp(offs_t offset)
|
|||||||
UINT8 nes_arcstick_device::read_exp(offs_t offset)
|
UINT8 nes_arcstick_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
{
|
{
|
||||||
if ((m_cfg->read() & 2) == 0) // we are P1 input
|
if ((m_cfg->read() & 2) == 0) // we are P1 input
|
||||||
{
|
{
|
||||||
ret |= (m_latch & 1) << 1;
|
ret |= (m_latch & 1) << 1;
|
||||||
m_latch >>= 1;
|
m_latch >>= 1;
|
||||||
@ -270,9 +270,9 @@ UINT8 nes_arcstick_device::read_exp(offs_t offset)
|
|||||||
else
|
else
|
||||||
ret |= m_daisychain->read_exp(0);
|
ret |= m_daisychain->read_exp(0);
|
||||||
}
|
}
|
||||||
else //$4017
|
else //$4017
|
||||||
{
|
{
|
||||||
if ((m_cfg->read() & 2) == 2) // we are P2 input
|
if ((m_cfg->read() & 2) == 2) // we are P2 input
|
||||||
{
|
{
|
||||||
ret |= (m_latch & 1) << 1;
|
ret |= (m_latch & 1) << 1;
|
||||||
m_latch >>= 1;
|
m_latch >>= 1;
|
||||||
@ -314,4 +314,3 @@ void nes_arcstick_device::write(UINT8 data)
|
|||||||
|
|
||||||
m_latch = m_joypad->read();
|
m_latch = m_joypad->read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ void nes_konamihs_device::device_reset()
|
|||||||
UINT8 nes_konamihs_device::read_exp(offs_t offset)
|
UINT8 nes_konamihs_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) //$4017
|
if (offset == 1) //$4017
|
||||||
{
|
{
|
||||||
ret |= m_latch_p1 << 1;
|
ret |= m_latch_p1 << 1;
|
||||||
ret |= m_latch_p2 << 3;
|
ret |= m_latch_p2 << 3;
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
#include "miracle.h"
|
#include "miracle.h"
|
||||||
|
|
||||||
#define MIRACLE_MIDI_WAITING 0
|
#define MIRACLE_MIDI_WAITING 0
|
||||||
#define MIRACLE_MIDI_RECEIVE 1 // receive byte from piano
|
#define MIRACLE_MIDI_RECEIVE 1 // receive byte from piano
|
||||||
#define MIRACLE_MIDI_SEND 2 // send byte to piano
|
#define MIRACLE_MIDI_SEND 2 // send byte to piano
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// DEVICE DEFINITIONS
|
// DEVICE DEFINITIONS
|
||||||
@ -129,7 +129,7 @@ UINT8 nes_miracle_device::read_bit0()
|
|||||||
|
|
||||||
void nes_miracle_device::write(UINT8 data)
|
void nes_miracle_device::write(UINT8 data)
|
||||||
{
|
{
|
||||||
// printf("write: %d (%d %02x %d)\n", data & 1, m_sent_bits, m_data_sent, m_midi_mode);
|
// printf("write: %d (%d %02x %d)\n", data & 1, m_sent_bits, m_data_sent, m_midi_mode);
|
||||||
|
|
||||||
if (m_midi_mode == MIRACLE_MIDI_SEND)
|
if (m_midi_mode == MIRACLE_MIDI_SEND)
|
||||||
{
|
{
|
||||||
@ -142,7 +142,7 @@ void nes_miracle_device::write(UINT8 data)
|
|||||||
// then we go back to waiting
|
// then we go back to waiting
|
||||||
if (m_sent_bits == 8)
|
if (m_sent_bits == 8)
|
||||||
{
|
{
|
||||||
// printf("xmit MIDI byte %02x\n", m_data_sent);
|
// printf("xmit MIDI byte %02x\n", m_data_sent);
|
||||||
xmit_char(m_data_sent);
|
xmit_char(m_data_sent);
|
||||||
m_midi_mode = MIRACLE_MIDI_WAITING;
|
m_midi_mode = MIRACLE_MIDI_WAITING;
|
||||||
m_sent_bits = 0;
|
m_sent_bits = 0;
|
||||||
@ -163,7 +163,7 @@ void nes_miracle_device::write(UINT8 data)
|
|||||||
// was timer running?
|
// was timer running?
|
||||||
if (m_strobe_clock > 0)
|
if (m_strobe_clock > 0)
|
||||||
{
|
{
|
||||||
// printf("got strobe at %d clocks\n", m_strobe_clock);
|
// printf("got strobe at %d clocks\n", m_strobe_clock);
|
||||||
|
|
||||||
if (m_strobe_clock < 66 && data == 0)
|
if (m_strobe_clock < 66 && data == 0)
|
||||||
{
|
{
|
||||||
@ -199,7 +199,7 @@ void nes_miracle_device::write(UINT8 data)
|
|||||||
void nes_miracle_device::rcv_complete() // Rx completed receiving byte
|
void nes_miracle_device::rcv_complete() // Rx completed receiving byte
|
||||||
{
|
{
|
||||||
receive_register_extract();
|
receive_register_extract();
|
||||||
// UINT8 rcv = get_received_char();
|
// UINT8 rcv = get_received_char();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nes_miracle_device::tra_complete() // Tx completed sending byte
|
void nes_miracle_device::tra_complete() // Tx completed sending byte
|
||||||
@ -247,4 +247,3 @@ void nes_miracle_device::xmit_char(UINT8 data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ UINT8 nes_pachinko_device::read_exp(offs_t offset)
|
|||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
// this controller behaves like a standard P3 joypad, with longer stream of inputs
|
// this controller behaves like a standard P3 joypad, with longer stream of inputs
|
||||||
if (offset == 0) //$4016
|
if (offset == 0) //$4016
|
||||||
{
|
{
|
||||||
ret |= (m_latch & 1) << 1;
|
ret |= (m_latch & 1) << 1;
|
||||||
m_latch >>= 1;
|
m_latch >>= 1;
|
||||||
|
@ -81,7 +81,7 @@ void nes_partytap_device::device_reset()
|
|||||||
UINT8 nes_partytap_device::read_exp(offs_t offset)
|
UINT8 nes_partytap_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) //$4017
|
if (offset == 1) //$4017
|
||||||
{
|
{
|
||||||
ret |= m_latch & 0x1c;
|
ret |= m_latch & 0x1c;
|
||||||
m_latch >>= 3;
|
m_latch >>= 3;
|
||||||
|
@ -198,7 +198,7 @@ void nes_suborkey_device::device_reset()
|
|||||||
UINT8 nes_suborkey_device::read_exp(offs_t offset)
|
UINT8 nes_suborkey_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) //$4017
|
if (offset == 1) //$4017
|
||||||
{
|
{
|
||||||
// Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4
|
// Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4
|
||||||
if (m_fck_scan < 13)
|
if (m_fck_scan < 13)
|
||||||
|
@ -91,7 +91,7 @@ UINT8 nes_zapper_device::read_bit34()
|
|||||||
UINT8 nes_zapper_device::read_exp(offs_t offset)
|
UINT8 nes_zapper_device::read_exp(offs_t offset)
|
||||||
{
|
{
|
||||||
UINT8 ret = 0;
|
UINT8 ret = 0;
|
||||||
if (offset == 1) // $4017
|
if (offset == 1) // $4017
|
||||||
ret |= nes_zapper_device::read_bit34();
|
ret |= nes_zapper_device::read_bit34();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -36,27 +36,27 @@
|
|||||||
class media_identifier
|
class media_identifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
media_identifier(cli_options &options);
|
media_identifier(cli_options &options);
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
int total() const { return m_total; }
|
int total() const { return m_total; }
|
||||||
int matches() const { return m_matches; }
|
int matches() const { return m_matches; }
|
||||||
int nonroms() const { return m_nonroms; }
|
int nonroms() const { return m_nonroms; }
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
void reset() { m_total = m_matches = m_nonroms = 0; }
|
void reset() { m_total = m_matches = m_nonroms = 0; }
|
||||||
void identify(const char *name);
|
void identify(const char *name);
|
||||||
void identify_file(const char *name);
|
void identify_file(const char *name);
|
||||||
void identify_data(const char *name, const UINT8 *data, int length);
|
void identify_data(const char *name, const UINT8 *data, int length);
|
||||||
int find_by_hash(const hash_collection &hashes, int length);
|
int find_by_hash(const hash_collection &hashes, int length);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
driver_enumerator m_drivlist;
|
driver_enumerator m_drivlist;
|
||||||
int m_total;
|
int m_total;
|
||||||
int m_matches;
|
int m_matches;
|
||||||
int m_nonroms;
|
int m_nonroms;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1619,8 +1619,8 @@ void cli_frontend::execute_commands(const char *exename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_osd.execute_command(m_options.command()))
|
if (!m_osd.execute_command(m_options.command()))
|
||||||
// if we get here, we don't know what has been requested
|
// if we get here, we don't know what has been requested
|
||||||
throw emu_fatalerror(MAMERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command());
|
throw emu_fatalerror(MAMERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,6 +60,5 @@ const options_entry cli_options::s_option_entries[] =
|
|||||||
cli_options::cli_options()
|
cli_options::cli_options()
|
||||||
: emu_options()
|
: emu_options()
|
||||||
{
|
{
|
||||||
add_entries(cli_options::s_option_entries);
|
add_entries(cli_options::s_option_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,17 +184,17 @@ protected:
|
|||||||
ARCOMPACT_RETTYPE arcompact_handle04_1c(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_1c(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_1d(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_1d(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_20(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_20(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_21(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_21(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_22(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_22(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_23(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_23(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_28(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_28(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_29(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_29(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_2a(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_2a(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_2b(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_2b(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_2f_00(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_2f_00(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_2f_01(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_2f_01(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_2f_02(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_2f_02(OPS_32);
|
||||||
// ARCOMPACT_RETTYPE arcompact_handle04_2f_03(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_2f_03(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_2f_04(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_2f_04(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_2f_05(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_2f_05(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_2f_06(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_2f_06(OPS_32);
|
||||||
|
@ -2142,7 +2142,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p11_m0(OPS_32) // Jcc.
|
|||||||
size = 8;
|
size = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// c = limm;
|
// c = limm;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2151,7 +2151,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p11_m0(OPS_32) // Jcc.
|
|||||||
// Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ
|
// Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ
|
||||||
// no conditional links to ILINK1, ILINK2?
|
// no conditional links to ILINK1, ILINK2?
|
||||||
|
|
||||||
// c = m_regs[creg];
|
// c = m_regs[creg];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check_condition(condition))
|
if (!check_condition(condition))
|
||||||
|
@ -98,7 +98,7 @@ enum
|
|||||||
#define ALWAYS64 0x400
|
#define ALWAYS64 0x400
|
||||||
#define SPECIAL64 0x800
|
#define SPECIAL64 0x800
|
||||||
#define SPECIAL64_ENT(x) (SPECIAL64 | ((x) << 24))
|
#define SPECIAL64_ENT(x) (SPECIAL64 | ((x) << 24))
|
||||||
#define GROUP_MOD 0x1000
|
#define GROUP_MOD 0x1000
|
||||||
|
|
||||||
struct I386_OPCODE {
|
struct I386_OPCODE {
|
||||||
const char *mnemonic;
|
const char *mnemonic;
|
||||||
@ -1953,7 +1953,7 @@ static const GROUP_OP group_op_table[] =
|
|||||||
{ "group0F0D", group0F0D_table },
|
{ "group0F0D", group0F0D_table },
|
||||||
{ "group0F12", group0F12_table },
|
{ "group0F12", group0F12_table },
|
||||||
{ "group0F16", group0F16_table },
|
{ "group0F16", group0F16_table },
|
||||||
{ "group0F18", group0F18_table },
|
{ "group0F18", group0F18_table },
|
||||||
{ "group0F71", group0F71_table },
|
{ "group0F71", group0F71_table },
|
||||||
{ "group0F72", group0F72_table },
|
{ "group0F72", group0F72_table },
|
||||||
{ "group0F73", group0F73_table },
|
{ "group0F73", group0F73_table },
|
||||||
|
@ -2177,11 +2177,11 @@ void m68881_ftrap(m68000_base_device *m68k)
|
|||||||
// trap here
|
// trap here
|
||||||
m68ki_exception_trap(m68k, EXCEPTION_TRAPV);
|
m68ki_exception_trap(m68k, EXCEPTION_TRAPV);
|
||||||
}
|
}
|
||||||
else // fall through, requires eating the operand
|
else // fall through, requires eating the operand
|
||||||
{
|
{
|
||||||
switch (m68k->ir & 0x7)
|
switch (m68k->ir & 0x7)
|
||||||
{
|
{
|
||||||
case 2: // word operand
|
case 2: // word operand
|
||||||
OPER_I_16(m68k);
|
OPER_I_16(m68k);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2189,9 +2189,8 @@ void m68881_ftrap(m68000_base_device *m68k)
|
|||||||
OPER_I_32(m68k);
|
OPER_I_32(m68k);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // no operand
|
case 4: // no operand
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,12 +114,12 @@ bool finder_base::report_missing(bool found, const char *objname, bool required)
|
|||||||
|
|
||||||
void finder_base::printf_warning(const char *format, ...)
|
void finder_base::printf_warning(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
|
|
||||||
/* do the output */
|
/* do the output */
|
||||||
va_start(argptr, format);
|
va_start(argptr, format);
|
||||||
vsnprintf(buffer, 1024, format, argptr);
|
vsnprintf(buffer, 1024, format, argptr);
|
||||||
osd_printf_warning("%s", buffer);
|
osd_printf_warning("%s", buffer);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ protected:
|
|||||||
void *find_memshare(UINT8 width, size_t &bytes, bool required);
|
void *find_memshare(UINT8 width, size_t &bytes, bool required);
|
||||||
bool report_missing(bool found, const char *objname, bool required);
|
bool report_missing(bool found, const char *objname, bool required);
|
||||||
|
|
||||||
void printf_warning(const char *format, ...) ATTR_PRINTF(2,3);
|
void printf_warning(const char *format, ...) ATTR_PRINTF(2,3);
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
finder_base *m_next;
|
finder_base *m_next;
|
||||||
|
@ -89,7 +89,7 @@ device_state_entry::device_state_entry(int index, const char *symbol, void *data
|
|||||||
|
|
||||||
device_state_entry::device_state_entry(int index, device_state_interface *dev)
|
device_state_entry::device_state_entry(int index, device_state_interface *dev)
|
||||||
: m_device_state(dev),
|
: m_device_state(dev),
|
||||||
m_next(NULL),
|
m_next(NULL),
|
||||||
m_index(index),
|
m_index(index),
|
||||||
m_dataptr(NULL),
|
m_dataptr(NULL),
|
||||||
m_datamask(0),
|
m_datamask(0),
|
||||||
|
@ -17,61 +17,61 @@
|
|||||||
emu_fatalerror::emu_fatalerror(const char *format, ...)
|
emu_fatalerror::emu_fatalerror(const char *format, ...)
|
||||||
: code(0)
|
: code(0)
|
||||||
{
|
{
|
||||||
if (format == NULL)
|
if (format == NULL)
|
||||||
{
|
{
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
osd_break_into_debugger(text);
|
osd_break_into_debugger(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
emu_fatalerror::emu_fatalerror(const char *format, va_list ap)
|
emu_fatalerror::emu_fatalerror(const char *format, va_list ap)
|
||||||
: code(0)
|
: code(0)
|
||||||
{
|
{
|
||||||
if (format == NULL)
|
if (format == NULL)
|
||||||
{
|
{
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
}
|
}
|
||||||
osd_break_into_debugger(text);
|
osd_break_into_debugger(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, ...)
|
emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, ...)
|
||||||
: code(_exitcode)
|
: code(_exitcode)
|
||||||
{
|
{
|
||||||
if (format == NULL)
|
if (format == NULL)
|
||||||
{
|
{
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, va_list ap)
|
emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, va_list ap)
|
||||||
: code(_exitcode)
|
: code(_exitcode)
|
||||||
{
|
{
|
||||||
if (format == NULL)
|
if (format == NULL)
|
||||||
{
|
{
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -89,18 +89,18 @@ void report_bad_device_cast(const device_t *dev, const std::type_info &src_type,
|
|||||||
|
|
||||||
void fatalerror(const char *format, ...)
|
void fatalerror(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
emu_fatalerror error(format, ap);
|
emu_fatalerror error(format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...)
|
void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
emu_fatalerror error(exitcode, format, ap);
|
emu_fatalerror error(exitcode, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
@ -150,10 +150,10 @@ const options_entry emu_options::s_option_entries[] =
|
|||||||
|
|
||||||
// debugging options
|
// debugging options
|
||||||
{ NULL, NULL, OPTION_HEADER, "CORE DEBUGGING OPTIONS" },
|
{ NULL, NULL, OPTION_HEADER, "CORE DEBUGGING OPTIONS" },
|
||||||
{ OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" },
|
{ OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" },
|
||||||
{ OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" },
|
{ OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" },
|
||||||
{ OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" },
|
{ OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" },
|
||||||
{ OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" },
|
{ OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" },
|
||||||
{ OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" },
|
{ OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" },
|
||||||
{ OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" },
|
{ OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" },
|
||||||
|
|
||||||
|
@ -318,11 +318,11 @@ public:
|
|||||||
bool joystick_contradictory() const { return bool_value(OPTION_JOYSTICK_CONTRADICTORY); }
|
bool joystick_contradictory() const { return bool_value(OPTION_JOYSTICK_CONTRADICTORY); }
|
||||||
int coin_impulse() const { return int_value(OPTION_COIN_IMPULSE); }
|
int coin_impulse() const { return int_value(OPTION_COIN_IMPULSE); }
|
||||||
|
|
||||||
// core debugging options
|
// core debugging options
|
||||||
bool log() const { return bool_value(OPTION_LOG); }
|
bool log() const { return bool_value(OPTION_LOG); }
|
||||||
bool debug() const { return bool_value(OPTION_DEBUG); }
|
bool debug() const { return bool_value(OPTION_DEBUG); }
|
||||||
bool verbose() const { return bool_value(OPTION_VERBOSE); }
|
bool verbose() const { return bool_value(OPTION_VERBOSE); }
|
||||||
bool oslog() const { return bool_value(OPTION_OSLOG); }
|
bool oslog() const { return bool_value(OPTION_OSLOG); }
|
||||||
const char *debug_script() const { return value(OPTION_DEBUGSCRIPT); }
|
const char *debug_script() const { return value(OPTION_DEBUGSCRIPT); }
|
||||||
bool update_in_pause() const { return bool_value(OPTION_UPDATEINPAUSE); }
|
bool update_in_pause() const { return bool_value(OPTION_UPDATEINPAUSE); }
|
||||||
|
|
||||||
|
@ -714,8 +714,8 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
|
|||||||
render_container &rc = sc->container();
|
render_container &rc = sc->container();
|
||||||
ui_manager &ui = sc->machine().ui();
|
ui_manager &ui = sc->machine().ui();
|
||||||
ui.draw_text_full(&rc, msg, x, y , (1.0f - x),
|
ui.draw_text_full(&rc, msg, x, y , (1.0f - x),
|
||||||
JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR,
|
JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR,
|
||||||
UI_TEXT_BG_COLOR, NULL, NULL);
|
UI_TEXT_BG_COLOR, NULL, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ static char giant_string_buffer[65536] = { 0 };
|
|||||||
|
|
||||||
osd_interface &running_machine::osd() const
|
osd_interface &running_machine::osd() const
|
||||||
{
|
{
|
||||||
return m_manager.osd();
|
return m_manager.osd();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
@ -253,7 +253,7 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type
|
|||||||
m_size = 0x400000;
|
m_size = 0x400000;
|
||||||
m_maker_id = MFG_INTEL;
|
m_maker_id = MFG_INTEL;
|
||||||
m_device_id = 0x14;
|
m_device_id = 0x14;
|
||||||
// m_sector_is_4k = true; 128kb?
|
// m_sector_is_4k = true; 128kb?
|
||||||
map = ADDRESS_MAP_NAME( memory_map16_32Mb );
|
map = ADDRESS_MAP_NAME( memory_map16_32Mb );
|
||||||
break;
|
break;
|
||||||
case FLASH_SST_39VF020:
|
case FLASH_SST_39VF020:
|
||||||
|
@ -50,15 +50,15 @@ void jvs_host::commit_raw()
|
|||||||
if(send_size < 3 || send_buffer[0] == 0x00 || send_buffer[1] != send_size-1) {
|
if(send_size < 3 || send_buffer[0] == 0x00 || send_buffer[1] != send_size-1) {
|
||||||
logerror("JVS checksum error\n");
|
logerror("JVS checksum error\n");
|
||||||
} /*
|
} /*
|
||||||
Naomi suchie3 have bad working controls with this
|
Naomi suchie3 have bad working controls with this
|
||||||
|
|
||||||
// "This message is crap" doesn't exist so call it checksum error
|
// "This message is crap" doesn't exist so call it checksum error
|
||||||
recv_buffer[0] = 0x00;
|
recv_buffer[0] = 0x00;
|
||||||
recv_buffer[1] = 0x02;
|
recv_buffer[1] = 0x02;
|
||||||
recv_buffer[2] = 0x03;
|
recv_buffer[2] = 0x03;
|
||||||
recv_size = 3;
|
recv_size = 3;
|
||||||
|
|
||||||
} else */ {
|
} else */ {
|
||||||
if(first_device) {
|
if(first_device) {
|
||||||
first_device->message(send_buffer[0], send_buffer+2, send_size-2, recv_buffer+2, recv_size);
|
first_device->message(send_buffer[0], send_buffer+2, send_size-2, recv_buffer+2, recv_size);
|
||||||
recv_is_encoded = false;
|
recv_is_encoded = false;
|
||||||
|
@ -440,12 +440,12 @@ ATTR_COLD void netlist_mame_device_t::save_state()
|
|||||||
if (td != NULL) save_pointer(td, s->m_name, s->m_count);
|
if (td != NULL) save_pointer(td, s->m_name, s->m_count);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DT_FLOAT:
|
case DT_FLOAT:
|
||||||
{
|
{
|
||||||
float *td = s->resolved<float>();
|
float *td = s->resolved<float>();
|
||||||
if (td != NULL) save_pointer(td, s->m_name, s->m_count);
|
if (td != NULL) save_pointer(td, s->m_name, s->m_count);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DT_INT64:
|
case DT_INT64:
|
||||||
save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
|
save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
|
||||||
break;
|
break;
|
||||||
|
@ -94,7 +94,7 @@ machine_manager* machine_manager::m_manager = NULL;
|
|||||||
|
|
||||||
osd_interface &machine_manager::osd() const
|
osd_interface &machine_manager::osd() const
|
||||||
{
|
{
|
||||||
return m_osd;
|
return m_osd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class netlist_matrix_solver_direct_t: public netlist_matrix_solver_t
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
netlist_matrix_solver_direct_t(const netlist_solver_parameters_t ¶ms, int size);
|
netlist_matrix_solver_direct_t(const netlist_solver_parameters_t ¶ms, int size);
|
||||||
netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t ¶ms, int size);
|
netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t ¶ms, int size);
|
||||||
|
|
||||||
virtual ~netlist_matrix_solver_direct_t();
|
virtual ~netlist_matrix_solver_direct_t();
|
||||||
|
|
||||||
@ -69,13 +69,13 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::~netlist_matrix_solver_direct_t
|
|||||||
{
|
{
|
||||||
//delete[] m_A[k];
|
//delete[] m_A[k];
|
||||||
}
|
}
|
||||||
for (int k = 0; k < N(); k++)
|
for (int k = 0; k < N(); k++)
|
||||||
{
|
{
|
||||||
nl_free(m_terms[k]);
|
nl_free(m_terms[k]);
|
||||||
nl_free(m_row_ops[k]);
|
nl_free(m_row_ops[k]);
|
||||||
}
|
}
|
||||||
nl_free(m_row_ops[N()]);
|
nl_free(m_row_ops[N()]);
|
||||||
//delete[] m_last_RHS;
|
//delete[] m_last_RHS;
|
||||||
//delete[] m_RHS;
|
//delete[] m_RHS;
|
||||||
nl_free_array(m_terms);
|
nl_free_array(m_terms);
|
||||||
nl_free_array(m_rails_temp);
|
nl_free_array(m_rails_temp);
|
||||||
@ -193,17 +193,17 @@ ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::vsetup(netlist_a
|
|||||||
* Sorting as a general matrix pre-conditioning is mentioned in
|
* Sorting as a general matrix pre-conditioning is mentioned in
|
||||||
* literature but I have found no articles about Gauss Seidel.
|
* literature but I have found no articles about Gauss Seidel.
|
||||||
*
|
*
|
||||||
* For Gaussian Elimination however increasing order is better suited.
|
* For Gaussian Elimination however increasing order is better suited.
|
||||||
* FIXME: Even better would be to sort on elements right of the matrix diagonal.
|
* FIXME: Even better would be to sort on elements right of the matrix diagonal.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int sort_order = (type() == GAUSS_SEIDEL ? 1 : -1);
|
int sort_order = (type() == GAUSS_SEIDEL ? 1 : -1);
|
||||||
|
|
||||||
for (int k = 0; k < N() / 2; k++)
|
for (int k = 0; k < N() / 2; k++)
|
||||||
for (int i = 0; i < N() - 1; i++)
|
for (int i = 0; i < N() - 1; i++)
|
||||||
{
|
{
|
||||||
if ((m_terms[i]->m_railstart - m_terms[i+1]->m_railstart) * sort_order < 0)
|
if ((m_terms[i]->m_railstart - m_terms[i+1]->m_railstart) * sort_order < 0)
|
||||||
{
|
{
|
||||||
std::swap(m_terms[i],m_terms[i+1]);
|
std::swap(m_terms[i],m_terms[i+1]);
|
||||||
m_nets.swap(i, i+1);
|
m_nets.swap(i, i+1);
|
||||||
@ -475,15 +475,15 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t(
|
|||||||
, m_dim(size)
|
, m_dim(size)
|
||||||
, m_lp_fact(0)
|
, m_lp_fact(0)
|
||||||
{
|
{
|
||||||
m_terms = nl_alloc_array(terms_t *, N());
|
m_terms = nl_alloc_array(terms_t *, N());
|
||||||
m_rails_temp = nl_alloc_array(terms_t, N());
|
m_rails_temp = nl_alloc_array(terms_t, N());
|
||||||
|
|
||||||
for (int k = 0; k < N(); k++)
|
for (int k = 0; k < N(); k++)
|
||||||
{
|
{
|
||||||
m_terms[k] = nl_alloc(terms_t);
|
m_terms[k] = nl_alloc(terms_t);
|
||||||
m_row_ops[k] = vector_ops_t::create_ops(k);
|
m_row_ops[k] = vector_ops_t::create_ops(k);
|
||||||
}
|
}
|
||||||
m_row_ops[N()] = vector_ops_t::create_ops(N());
|
m_row_ops[N()] = vector_ops_t::create_ops(N());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,16 +17,16 @@ class ATTR_ALIGNED(64) netlist_matrix_solver_gauss_seidel_t: public netlist_matr
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
netlist_matrix_solver_gauss_seidel_t(const netlist_solver_parameters_t ¶ms, int size)
|
netlist_matrix_solver_gauss_seidel_t(const netlist_solver_parameters_t ¶ms, int size)
|
||||||
: netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size)
|
: netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size)
|
||||||
, m_lp_fact(0)
|
, m_lp_fact(0)
|
||||||
, m_gs_fail(0)
|
, m_gs_fail(0)
|
||||||
, m_gs_total(0)
|
, m_gs_total(0)
|
||||||
{
|
{
|
||||||
const char *p = osd_getenv("NETLIST_STATS");
|
const char *p = osd_getenv("NETLIST_STATS");
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
m_log_stats = (bool) atoi(p);
|
m_log_stats = (bool) atoi(p);
|
||||||
else
|
else
|
||||||
m_log_stats = false;
|
m_log_stats = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~netlist_matrix_solver_gauss_seidel_t() {}
|
virtual ~netlist_matrix_solver_gauss_seidel_t() {}
|
||||||
@ -52,21 +52,21 @@ private:
|
|||||||
template <int m_N, int _storage_N>
|
template <int m_N, int _storage_N>
|
||||||
void netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::log_stats()
|
void netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::log_stats()
|
||||||
{
|
{
|
||||||
if (this->m_stat_calculations != 0 && m_log_stats)
|
if (this->m_stat_calculations != 0 && m_log_stats)
|
||||||
{
|
{
|
||||||
printf("==============================================\n");
|
printf("==============================================\n");
|
||||||
printf("Solver %s\n", this->name().cstr());
|
printf("Solver %s\n", this->name().cstr());
|
||||||
printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
|
printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
|
||||||
printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic");
|
printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic");
|
||||||
printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep");
|
printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep");
|
||||||
printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
|
printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
|
||||||
printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n",
|
printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n",
|
||||||
this->m_stat_calculations,
|
this->m_stat_calculations,
|
||||||
this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
|
this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
|
||||||
this->m_gs_fail,
|
this->m_gs_fail,
|
||||||
100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
|
100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
|
||||||
(double) this->m_gs_total / (double) this->m_stat_calculations);
|
(double) this->m_gs_total / (double) this->m_stat_calculations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int m_N, int _storage_N>
|
template <int m_N, int _storage_N>
|
||||||
@ -299,7 +299,7 @@ ATTR_HOT inline int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::vsolv
|
|||||||
//if (fabs(gabs_t - fabs(gtot_t)) > 1e-20)
|
//if (fabs(gabs_t - fabs(gtot_t)) > 1e-20)
|
||||||
// printf("%d %e abs: %f tot: %f\n",k, gabs_t / gtot_t -1.0, gabs_t, gtot_t);
|
// printf("%d %e abs: %f tot: %f\n",k, gabs_t / gtot_t -1.0, gabs_t, gtot_t);
|
||||||
|
|
||||||
gabs_t *= 0.95; // avoid rounding issues
|
gabs_t *= 0.95; // avoid rounding issues
|
||||||
if (!USE_GABS || gabs_t <= gtot_t)
|
if (!USE_GABS || gabs_t <= gtot_t)
|
||||||
{
|
{
|
||||||
w[k] = ws / gtot_t;
|
w[k] = ws / gtot_t;
|
||||||
@ -343,7 +343,7 @@ ATTR_HOT inline int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::vsolv
|
|||||||
this->m_nets[k]->m_cur_Analog = new_V[k];
|
this->m_nets[k]->m_cur_Analog = new_V[k];
|
||||||
|
|
||||||
this->m_gs_total += resched_cnt;
|
this->m_gs_total += resched_cnt;
|
||||||
this->m_stat_calculations++;
|
this->m_stat_calculations++;
|
||||||
|
|
||||||
if (resched)
|
if (resched)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ NETLIST_START(opamp_lm3900)
|
|||||||
NET_C(R1.2, R2.2, G1.ON)
|
NET_C(R1.2, R2.2, G1.ON)
|
||||||
VCVS(G1)
|
VCVS(G1)
|
||||||
PARAM(G1.G, 10000000)
|
PARAM(G1.G, 10000000)
|
||||||
//PARAM(G1.RI, 1)
|
//PARAM(G1.RI, 1)
|
||||||
PARAM(G1.RO, RES_K(8))
|
PARAM(G1.RO, RES_K(8))
|
||||||
|
|
||||||
NETLIST_END()
|
NETLIST_END()
|
||||||
|
@ -99,11 +99,11 @@ ATTR_COLD void terms_t::set_pointers()
|
|||||||
|
|
||||||
ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms)
|
ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms)
|
||||||
: m_stat_calculations(0),
|
: m_stat_calculations(0),
|
||||||
m_stat_newton_raphson(0),
|
m_stat_newton_raphson(0),
|
||||||
m_stat_vsolver_calls(0),
|
m_stat_vsolver_calls(0),
|
||||||
m_params(params),
|
m_params(params),
|
||||||
m_cur_ts(0),
|
m_cur_ts(0),
|
||||||
m_type(type)
|
m_type(type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta)
|
|||||||
template<class C >
|
template<class C >
|
||||||
void netlist_matrix_solver_t::solve_base(C *p)
|
void netlist_matrix_solver_t::solve_base(C *p)
|
||||||
{
|
{
|
||||||
m_stat_vsolver_calls++;
|
m_stat_vsolver_calls++;
|
||||||
if (is_dynamic())
|
if (is_dynamic())
|
||||||
{
|
{
|
||||||
int this_resched;
|
int this_resched;
|
||||||
@ -270,7 +270,7 @@ void netlist_matrix_solver_t::solve_base(C *p)
|
|||||||
newton_loops++;
|
newton_loops++;
|
||||||
} while (this_resched > 1 && newton_loops < m_params.m_nr_loops);
|
} while (this_resched > 1 && newton_loops < m_params.m_nr_loops);
|
||||||
|
|
||||||
m_stat_newton_raphson += newton_loops;
|
m_stat_newton_raphson += newton_loops;
|
||||||
// reschedule ....
|
// reschedule ....
|
||||||
if (this_resched > 1 && !m_Q_sync.net().is_queued())
|
if (this_resched > 1 && !m_Q_sync.net().is_queued())
|
||||||
{
|
{
|
||||||
@ -438,7 +438,7 @@ netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int
|
|||||||
return nl_alloc(netlist_matrix_solver_direct2_t, m_params);
|
return nl_alloc(netlist_matrix_solver_direct2_t, m_params);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typedef netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N> solver_N;
|
typedef netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N> solver_N;
|
||||||
if (size >= gs_threshold)
|
if (size >= gs_threshold)
|
||||||
return nl_alloc(solver_N, m_params, size);
|
return nl_alloc(solver_N, m_params, size);
|
||||||
else
|
else
|
||||||
|
@ -197,8 +197,8 @@ public:
|
|||||||
|
|
||||||
enum eSolverType
|
enum eSolverType
|
||||||
{
|
{
|
||||||
GAUSSIAN_ELIMINATION,
|
GAUSSIAN_ELIMINATION,
|
||||||
GAUSS_SEIDEL
|
GAUSS_SEIDEL
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms);
|
ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms);
|
||||||
@ -243,9 +243,9 @@ protected:
|
|||||||
plinearlist_t<netlist_analog_net_t *> m_nets;
|
plinearlist_t<netlist_analog_net_t *> m_nets;
|
||||||
plinearlist_t<netlist_analog_output_t *> m_inps;
|
plinearlist_t<netlist_analog_output_t *> m_inps;
|
||||||
|
|
||||||
int m_stat_calculations;
|
int m_stat_calculations;
|
||||||
int m_stat_newton_raphson;
|
int m_stat_newton_raphson;
|
||||||
int m_stat_vsolver_calls;
|
int m_stat_vsolver_calls;
|
||||||
|
|
||||||
const netlist_solver_parameters_t &m_params;
|
const netlist_solver_parameters_t &m_params;
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ private:
|
|||||||
|
|
||||||
ATTR_HOT void update_inputs();
|
ATTR_HOT void update_inputs();
|
||||||
|
|
||||||
const eSolverType m_type;
|
const eSolverType m_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void nl_initialize_factory(netlist_factory_t &factory)
|
|||||||
ENTRY(VCCS, VCCS, "-")
|
ENTRY(VCCS, VCCS, "-")
|
||||||
ENTRY(CCCS, CCCS, "-")
|
ENTRY(CCCS, CCCS, "-")
|
||||||
ENTRY(dummy_input, DUMMY_INPUT, "-")
|
ENTRY(dummy_input, DUMMY_INPUT, "-")
|
||||||
ENTRY(frontier, FRONTIER, "+I,Q")
|
ENTRY(frontier, FRONTIER, "+I,Q")
|
||||||
ENTRY(QBJT_EB, QBJT_EB, "model")
|
ENTRY(QBJT_EB, QBJT_EB, "model")
|
||||||
ENTRY(QBJT_switch, QBJT_SW, "model")
|
ENTRY(QBJT_switch, QBJT_SW, "model")
|
||||||
ENTRY(ttl_input, TTL_INPUT, "IN")
|
ENTRY(ttl_input, TTL_INPUT, "IN")
|
||||||
@ -148,4 +148,3 @@ void nl_initialize_factory(netlist_factory_t &factory)
|
|||||||
ENTRY(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2")
|
ENTRY(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2")
|
||||||
ENTRY(NE555_dip, NE555_DIP, "-")
|
ENTRY(NE555_dip, NE555_DIP, "-")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ NETLIB_START(4020_sub)
|
|||||||
register_output("Q5", m_Q[4]);
|
register_output("Q5", m_Q[4]);
|
||||||
register_output("Q6", m_Q[5]);
|
register_output("Q6", m_Q[5]);
|
||||||
register_output("Q7", m_Q[6]);
|
register_output("Q7", m_Q[6]);
|
||||||
register_output("Q8", m_Q[7]);
|
register_output("Q8", m_Q[7]);
|
||||||
register_output("Q9", m_Q[8]);
|
register_output("Q9", m_Q[8]);
|
||||||
register_output("Q10", m_Q[9]);
|
register_output("Q10", m_Q[9]);
|
||||||
register_output("Q11", m_Q[10]);
|
register_output("Q11", m_Q[10]);
|
||||||
|
@ -21,11 +21,11 @@ class nld_vdd_vss : public netlist_device_t
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
ATTR_HOT void update() {};
|
ATTR_HOT void update() {};
|
||||||
ATTR_HOT void start()
|
ATTR_HOT void start()
|
||||||
{
|
{
|
||||||
register_input("VDD,", m_vdd);
|
register_input("VDD,", m_vdd);
|
||||||
register_input("VSS,", m_vss);
|
register_input("VSS,", m_vss);
|
||||||
};
|
};
|
||||||
ATTR_HOT void reset() {};
|
ATTR_HOT void reset() {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -40,10 +40,9 @@
|
|||||||
NET_REGISTER_DEV(dummy_input, _name)
|
NET_REGISTER_DEV(dummy_input, _name)
|
||||||
|
|
||||||
#define FRONTIER(_name, _IN, _OUT) \
|
#define FRONTIER(_name, _IN, _OUT) \
|
||||||
NET_REGISTER_DEV(frontier, _name) \
|
NET_REGISTER_DEV(frontier, _name) \
|
||||||
NET_C(_IN, _name.I) \
|
NET_C(_IN, _name.I) \
|
||||||
NET_C(_OUT, _name.Q) \
|
NET_C(_OUT, _name.Q)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// mainclock
|
// mainclock
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@ -159,31 +158,31 @@ private:
|
|||||||
class NETLIB_NAME(frontier) : public netlist_device_t
|
class NETLIB_NAME(frontier) : public netlist_device_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ATTR_COLD NETLIB_NAME(frontier)()
|
ATTR_COLD NETLIB_NAME(frontier)()
|
||||||
: netlist_device_t(DUMMY) { }
|
: netlist_device_t(DUMMY) { }
|
||||||
|
|
||||||
ATTR_COLD virtual ~NETLIB_NAME(frontier)() {}
|
ATTR_COLD virtual ~NETLIB_NAME(frontier)() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
ATTR_COLD void start()
|
ATTR_COLD void start()
|
||||||
{
|
{
|
||||||
register_input("I", m_I);
|
register_input("I", m_I);
|
||||||
register_output("Q", m_Q);
|
register_output("Q", m_Q);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTR_COLD void reset()
|
ATTR_COLD void reset()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTR_HOT ATTR_ALIGN void update()
|
ATTR_HOT ATTR_ALIGN void update()
|
||||||
{
|
{
|
||||||
OUTANALOG(m_Q, INPANALOG(m_I));
|
OUTANALOG(m_Q, INPANALOG(m_I));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
netlist_analog_input_t m_I;
|
netlist_analog_input_t m_I;
|
||||||
netlist_analog_output_t m_Q;
|
netlist_analog_output_t m_Q;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1001,4 +1001,3 @@ NETLIB_UPDATE(mainclock)
|
|||||||
net.toggle_new_Q();
|
net.toggle_new_Q();
|
||||||
net.set_time(netlist().time() + m_inc);
|
net.set_time(netlist().time() + m_inc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ public:
|
|||||||
CAPACITOR, // Capacitor
|
CAPACITOR, // Capacitor
|
||||||
DIODE, // Diode
|
DIODE, // Diode
|
||||||
DUMMY, // DUMMY device without function
|
DUMMY, // DUMMY device without function
|
||||||
FRONTIER, // Net frontier
|
FRONTIER, // Net frontier
|
||||||
BJT_EB, // BJT(Ebers-Moll)
|
BJT_EB, // BJT(Ebers-Moll)
|
||||||
BJT_SWITCH, // BJT(Switch)
|
BJT_SWITCH, // BJT(Switch)
|
||||||
VCVS, // Voltage controlled voltage source
|
VCVS, // Voltage controlled voltage source
|
||||||
@ -1268,13 +1268,13 @@ ATTR_HOT inline netlist_logic_net_t & RESTRICT netlist_net_t::as_logic()
|
|||||||
|
|
||||||
ATTR_HOT inline const netlist_logic_net_t & RESTRICT netlist_net_t::as_logic() const
|
ATTR_HOT inline const netlist_logic_net_t & RESTRICT netlist_net_t::as_logic() const
|
||||||
{
|
{
|
||||||
nl_assert(family() == LOGIC);
|
nl_assert(family() == LOGIC);
|
||||||
return static_cast<const netlist_logic_net_t &>(*this);
|
return static_cast<const netlist_logic_net_t &>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTR_HOT inline netlist_analog_net_t & RESTRICT netlist_net_t::as_analog()
|
ATTR_HOT inline netlist_analog_net_t & RESTRICT netlist_net_t::as_analog()
|
||||||
{
|
{
|
||||||
nl_assert(family() == ANALOG);
|
nl_assert(family() == ANALOG);
|
||||||
return static_cast<netlist_analog_net_t &>(*this);
|
return static_cast<netlist_analog_net_t &>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,21 +121,21 @@
|
|||||||
class nl_fatalerror : public std::exception
|
class nl_fatalerror : public std::exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3)
|
nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3)
|
||||||
{
|
{
|
||||||
char text[1024];
|
char text[1024];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
osd_printf_error("%s\n", text);
|
osd_printf_error("%s\n", text);
|
||||||
}
|
}
|
||||||
nl_fatalerror(const char *format, va_list ap)
|
nl_fatalerror(const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
char text[1024];
|
char text[1024];
|
||||||
vsprintf(text, format, ap);
|
vsprintf(text, format, ap);
|
||||||
osd_printf_error("%s\n", text);
|
osd_printf_error("%s\n", text);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
|
@ -56,18 +56,18 @@
|
|||||||
|
|
||||||
ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::term_param_list()
|
ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::term_param_list()
|
||||||
{
|
{
|
||||||
if (m_def_param.startsWith("+"))
|
if (m_def_param.startsWith("+"))
|
||||||
return nl_util::split(m_def_param.substr(1), ",");
|
return nl_util::split(m_def_param.substr(1), ",");
|
||||||
else
|
else
|
||||||
return nl_util::pstring_list();
|
return nl_util::pstring_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::def_params()
|
ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::def_params()
|
||||||
{
|
{
|
||||||
if (m_def_param.startsWith("+") || m_def_param.equals("-"))
|
if (m_def_param.startsWith("+") || m_def_param.equals("-"))
|
||||||
return nl_util::pstring_list();
|
return nl_util::pstring_list();
|
||||||
else
|
else
|
||||||
return nl_util::split(m_def_param, ",");
|
return nl_util::split(m_def_param, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,10 +97,10 @@ netlist_device_t *netlist_setup_t::register_dev(netlist_device_t *dev, const pst
|
|||||||
|
|
||||||
netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const pstring &name)
|
netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const pstring &name)
|
||||||
{
|
{
|
||||||
netlist_device_t *dev = factory().new_device_by_classname(classname);
|
netlist_device_t *dev = factory().new_device_by_classname(classname);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
netlist().error("Class %s not found!\n", classname.cstr());
|
netlist().error("Class %s not found!\n", classname.cstr());
|
||||||
return register_dev(dev, name);
|
return register_dev(dev, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -697,7 +697,7 @@ void netlist_setup_t::resolve_inputs()
|
|||||||
|
|
||||||
void netlist_setup_t::start_devices()
|
void netlist_setup_t::start_devices()
|
||||||
{
|
{
|
||||||
//FIXME: we need a nl_getenv
|
//FIXME: we need a nl_getenv
|
||||||
if (getenv("NL_LOGS"))
|
if (getenv("NL_LOGS"))
|
||||||
{
|
{
|
||||||
NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
|
NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
|
||||||
|
@ -146,13 +146,13 @@ public:
|
|||||||
void namespace_push(const pstring &aname);
|
void namespace_push(const pstring &aname);
|
||||||
void namespace_pop();
|
void namespace_pop();
|
||||||
|
|
||||||
netlist_factory_t &factory() { return *m_factory; }
|
netlist_factory_t &factory() { return *m_factory; }
|
||||||
const netlist_factory_t &factory() const { return *m_factory; }
|
const netlist_factory_t &factory() const { return *m_factory; }
|
||||||
|
|
||||||
/* not ideal, but needed for save_state */
|
/* not ideal, but needed for save_state */
|
||||||
tagmap_terminal_t m_terminals;
|
tagmap_terminal_t m_terminals;
|
||||||
|
|
||||||
void print_stats() const;
|
void print_stats() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
ATTR_COLD ~plinearlist_t()
|
ATTR_COLD ~plinearlist_t()
|
||||||
{
|
{
|
||||||
if (m_list != NULL)
|
if (m_list != NULL)
|
||||||
nl_free_array(m_list);
|
nl_free_array(m_list);
|
||||||
m_list = NULL;
|
m_list = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_list != NULL)
|
if (m_list != NULL)
|
||||||
nl_free_array(m_list);
|
nl_free_array(m_list);
|
||||||
m_list = NULL;
|
m_list = NULL;
|
||||||
m_count = 0;
|
m_count = 0;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
|
|||||||
"DT_INT8",
|
"DT_INT8",
|
||||||
"DT_INT",
|
"DT_INT",
|
||||||
"DT_BOOLEAN",
|
"DT_BOOLEAN",
|
||||||
"DT_FLOAT"
|
"DT_FLOAT"
|
||||||
};
|
};
|
||||||
|
|
||||||
NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr));
|
NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr));
|
||||||
@ -64,8 +64,8 @@ ATTR_COLD void pstate_manager_t::post_load()
|
|||||||
|
|
||||||
template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname)
|
template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname)
|
||||||
{
|
{
|
||||||
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
||||||
pstate_entry_t *p = nl_alloc(pstate_entry_t, stname, owner, &state);
|
pstate_entry_t *p = nl_alloc(pstate_entry_t, stname, owner, &state);
|
||||||
m_save.add(p);
|
m_save.add(p);
|
||||||
state.register_state(*this, stname);
|
state.register_state(*this, stname);
|
||||||
}
|
}
|
||||||
|
@ -24,4 +24,3 @@ void parameters_manager::add(astring tag, astring value)
|
|||||||
{
|
{
|
||||||
m_parameters.add(tag, value);
|
m_parameters.add(tag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
288
src/emu/render.c
288
src/emu/render.c
@ -207,62 +207,62 @@ inline item_layer get_layer_and_blendmode(const layout_view &view, int index, in
|
|||||||
|
|
||||||
render_texinfo &render_texinfo::operator=(const render_texinfo &src)
|
render_texinfo &render_texinfo::operator=(const render_texinfo &src)
|
||||||
{
|
{
|
||||||
free_palette();
|
free_palette();
|
||||||
base = src.base;
|
base = src.base;
|
||||||
rowpixels = src.rowpixels;
|
rowpixels = src.rowpixels;
|
||||||
width = src.width;
|
width = src.width;
|
||||||
height = src.height;
|
height = src.height;
|
||||||
seqid = src.seqid;
|
seqid = src.seqid;
|
||||||
osddata = src.osddata;
|
osddata = src.osddata;
|
||||||
m_palette = src.m_palette;
|
m_palette = src.m_palette;
|
||||||
if (m_palette != NULL)
|
if (m_palette != NULL)
|
||||||
{
|
{
|
||||||
m_palette->ref_count++;
|
m_palette->ref_count++;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
render_texinfo::render_texinfo(const render_texinfo &src)
|
render_texinfo::render_texinfo(const render_texinfo &src)
|
||||||
{
|
{
|
||||||
base = src.base;
|
base = src.base;
|
||||||
rowpixels = src.rowpixels;
|
rowpixels = src.rowpixels;
|
||||||
width = src.width;
|
width = src.width;
|
||||||
height = src.height;
|
height = src.height;
|
||||||
seqid = src.seqid;
|
seqid = src.seqid;
|
||||||
osddata = src.osddata;
|
osddata = src.osddata;
|
||||||
m_palette = src.m_palette;
|
m_palette = src.m_palette;
|
||||||
if (m_palette != NULL)
|
if (m_palette != NULL)
|
||||||
{
|
{
|
||||||
m_palette->ref_count++;
|
m_palette->ref_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void render_texinfo::set_palette(const dynamic_array<rgb_t> *source)
|
void render_texinfo::set_palette(const dynamic_array<rgb_t> *source)
|
||||||
{
|
{
|
||||||
free_palette();
|
free_palette();
|
||||||
if (source != NULL)
|
if (source != NULL)
|
||||||
{
|
{
|
||||||
m_palette = global_alloc(render_palette_copy);
|
m_palette = global_alloc(render_palette_copy);
|
||||||
m_palette->palette.copyfrom(*source);
|
m_palette->palette.copyfrom(*source);
|
||||||
m_palette->ref_count = 1;
|
m_palette->ref_count = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_palette = NULL;
|
m_palette = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void render_texinfo::free_palette()
|
void render_texinfo::free_palette()
|
||||||
{
|
{
|
||||||
if (m_palette != NULL)
|
if (m_palette != NULL)
|
||||||
{
|
{
|
||||||
m_palette->ref_count--;
|
m_palette->ref_count--;
|
||||||
if (m_palette->ref_count == 0)
|
if (m_palette->ref_count == 0)
|
||||||
{
|
{
|
||||||
global_free(m_palette);
|
global_free(m_palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_palette = NULL;
|
m_palette = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -277,31 +277,31 @@ void render_texinfo::free_palette()
|
|||||||
|
|
||||||
void render_primitive::reset()
|
void render_primitive::reset()
|
||||||
{
|
{
|
||||||
// public state
|
// public state
|
||||||
type = INVALID;
|
type = INVALID;
|
||||||
bounds.x0 = 0;
|
bounds.x0 = 0;
|
||||||
bounds.y0 = 0;
|
bounds.y0 = 0;
|
||||||
bounds.x1 = 0;
|
bounds.x1 = 0;
|
||||||
bounds.y1 = 0;
|
bounds.y1 = 0;
|
||||||
color.a = 0;
|
color.a = 0;
|
||||||
color.r = 0;
|
color.r = 0;
|
||||||
color.g = 0;
|
color.g = 0;
|
||||||
color.b = 0;
|
color.b = 0;
|
||||||
flags = 0;
|
flags = 0;
|
||||||
width = 0.0f;
|
width = 0.0f;
|
||||||
texture.set_palette(NULL);
|
texture.set_palette(NULL);
|
||||||
texture = render_texinfo();
|
texture = render_texinfo();
|
||||||
texcoords.bl.u = 0.0f;
|
texcoords.bl.u = 0.0f;
|
||||||
texcoords.bl.v = 0.0f;
|
texcoords.bl.v = 0.0f;
|
||||||
texcoords.br.u = 0.0f;
|
texcoords.br.u = 0.0f;
|
||||||
texcoords.br.v = 0.0f;
|
texcoords.br.v = 0.0f;
|
||||||
texcoords.tl.u = 0.0f;
|
texcoords.tl.u = 0.0f;
|
||||||
texcoords.tl.v = 0.0f;
|
texcoords.tl.v = 0.0f;
|
||||||
texcoords.tr.u = 0.0f;
|
texcoords.tr.u = 0.0f;
|
||||||
texcoords.tr.v = 0.0f;
|
texcoords.tr.v = 0.0f;
|
||||||
|
|
||||||
// do not clear m_next!
|
// do not clear m_next!
|
||||||
// memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type));
|
// memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -556,63 +556,63 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
|
|||||||
texinfo.width = swidth;
|
texinfo.width = swidth;
|
||||||
texinfo.height = sheight;
|
texinfo.height = sheight;
|
||||||
// will be set later
|
// will be set later
|
||||||
texinfo.set_palette(NULL);
|
texinfo.set_palette(NULL);
|
||||||
texinfo.seqid = ++m_curseq;
|
texinfo.seqid = ++m_curseq;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// make sure we can recover the original argb32 bitmap
|
// make sure we can recover the original argb32 bitmap
|
||||||
bitmap_argb32 dummy;
|
bitmap_argb32 dummy;
|
||||||
bitmap_argb32 &srcbitmap = (m_bitmap != NULL) ? downcast<bitmap_argb32 &>(*m_bitmap) : dummy;
|
bitmap_argb32 &srcbitmap = (m_bitmap != NULL) ? downcast<bitmap_argb32 &>(*m_bitmap) : dummy;
|
||||||
|
|
||||||
// is it a size we already have?
|
// is it a size we already have?
|
||||||
scaled_texture *scaled = NULL;
|
scaled_texture *scaled = NULL;
|
||||||
int scalenum;
|
int scalenum;
|
||||||
for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
|
for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
|
||||||
{
|
{
|
||||||
scaled = &m_scaled[scalenum];
|
scaled = &m_scaled[scalenum];
|
||||||
|
|
||||||
// we need a non-NULL bitmap with matching dest size
|
// we need a non-NULL bitmap with matching dest size
|
||||||
if (scaled->bitmap != NULL && dwidth == scaled->bitmap->width() && dheight == scaled->bitmap->height())
|
if (scaled->bitmap != NULL && dwidth == scaled->bitmap->width() && dheight == scaled->bitmap->height())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// did we get one?
|
// did we get one?
|
||||||
if (scalenum == ARRAY_LENGTH(m_scaled))
|
if (scalenum == ARRAY_LENGTH(m_scaled))
|
||||||
{
|
{
|
||||||
int lowest = -1;
|
int lowest = -1;
|
||||||
|
|
||||||
// didn't find one -- take the entry with the lowest seqnum
|
// didn't find one -- take the entry with the lowest seqnum
|
||||||
for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
|
for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
|
||||||
if ((lowest == -1 || m_scaled[scalenum].seqid < m_scaled[lowest].seqid) && !primlist.has_reference(m_scaled[scalenum].bitmap))
|
if ((lowest == -1 || m_scaled[scalenum].seqid < m_scaled[lowest].seqid) && !primlist.has_reference(m_scaled[scalenum].bitmap))
|
||||||
lowest = scalenum;
|
lowest = scalenum;
|
||||||
assert_always(lowest != -1, "Too many live texture instances!");
|
assert_always(lowest != -1, "Too many live texture instances!");
|
||||||
|
|
||||||
// throw out any existing entries
|
// throw out any existing entries
|
||||||
scaled = &m_scaled[lowest];
|
scaled = &m_scaled[lowest];
|
||||||
if (scaled->bitmap != NULL)
|
if (scaled->bitmap != NULL)
|
||||||
{
|
{
|
||||||
m_manager->invalidate_all(scaled->bitmap);
|
m_manager->invalidate_all(scaled->bitmap);
|
||||||
global_free(scaled->bitmap);
|
global_free(scaled->bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate a new bitmap
|
// allocate a new bitmap
|
||||||
scaled->bitmap = global_alloc(bitmap_argb32(dwidth, dheight));
|
scaled->bitmap = global_alloc(bitmap_argb32(dwidth, dheight));
|
||||||
scaled->seqid = ++m_curseq;
|
scaled->seqid = ++m_curseq;
|
||||||
|
|
||||||
// let the scaler do the work
|
// let the scaler do the work
|
||||||
(*m_scaler)(*scaled->bitmap, srcbitmap, m_sbounds, m_param);
|
(*m_scaler)(*scaled->bitmap, srcbitmap, m_sbounds, m_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally fill out the new info
|
// finally fill out the new info
|
||||||
primlist.add_reference(scaled->bitmap);
|
primlist.add_reference(scaled->bitmap);
|
||||||
texinfo.base = &scaled->bitmap->pix32(0);
|
texinfo.base = &scaled->bitmap->pix32(0);
|
||||||
texinfo.rowpixels = scaled->bitmap->rowpixels();
|
texinfo.rowpixels = scaled->bitmap->rowpixels();
|
||||||
texinfo.width = dwidth;
|
texinfo.width = dwidth;
|
||||||
texinfo.height = dheight;
|
texinfo.height = dheight;
|
||||||
// will be set later
|
// will be set later
|
||||||
texinfo.set_palette(NULL);
|
texinfo.set_palette(NULL);
|
||||||
texinfo.seqid = scaled->seqid;
|
texinfo.seqid = scaled->seqid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1817,26 +1817,26 @@ void render_target::add_container_primitives(render_primitive_list &list, const
|
|||||||
height = MIN(height, m_maxtexheight);
|
height = MIN(height, m_maxtexheight);
|
||||||
|
|
||||||
curitem->texture()->get_scaled(width, height, prim->texture, list);
|
curitem->texture()->get_scaled(width, height, prim->texture, list);
|
||||||
// set the palette
|
// set the palette
|
||||||
#if 1
|
#if 1
|
||||||
const dynamic_array<rgb_t> *adjusted_pal = curitem->texture()->get_adjusted_palette(container);
|
const dynamic_array<rgb_t> *adjusted_pal = curitem->texture()->get_adjusted_palette(container);
|
||||||
prim->texture.set_palette(adjusted_pal);
|
prim->texture.set_palette(adjusted_pal);
|
||||||
#else
|
#else
|
||||||
prim->texture.palette = curitem->texture()->get_adjusted_palette(container);
|
prim->texture.palette = curitem->texture()->get_adjusted_palette(container);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// determine UV coordinates and apply clipping
|
// determine UV coordinates and apply clipping
|
||||||
prim->texcoords = oriented_texcoords[finalorient];
|
prim->texcoords = oriented_texcoords[finalorient];
|
||||||
clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords);
|
clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords);
|
||||||
|
|
||||||
// apply the final orientation from the quad flags and then build up the final flags
|
// apply the final orientation from the quad flags and then build up the final flags
|
||||||
prim->flags = (curitem->flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) |
|
prim->flags = (curitem->flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) |
|
||||||
PRIMFLAG_TEXORIENT(finalorient) |
|
PRIMFLAG_TEXORIENT(finalorient) |
|
||||||
PRIMFLAG_TEXFORMAT(curitem->texture()->format());
|
PRIMFLAG_TEXFORMAT(curitem->texture()->format());
|
||||||
if (blendmode != -1)
|
if (blendmode != -1)
|
||||||
prim->flags |= PRIMFLAG_BLENDMODE(blendmode);
|
prim->flags |= PRIMFLAG_BLENDMODE(blendmode);
|
||||||
else
|
else
|
||||||
prim->flags |= PRIMFLAG_BLENDMODE(PRIMFLAG_GET_BLENDMODE(curitem->flags()));
|
prim->flags |= PRIMFLAG_BLENDMODE(PRIMFLAG_GET_BLENDMODE(curitem->flags()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1876,15 +1876,15 @@ void render_target::add_container_primitives(render_primitive_list &list, const
|
|||||||
(container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, prim->texture, list);
|
(container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, prim->texture, list);
|
||||||
|
|
||||||
// determine UV coordinates
|
// determine UV coordinates
|
||||||
prim->texcoords = oriented_texcoords[container_xform.orientation];
|
prim->texcoords = oriented_texcoords[container_xform.orientation];
|
||||||
|
|
||||||
// set the flags and add it to the list
|
// set the flags and add it to the list
|
||||||
prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) |
|
prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) |
|
||||||
PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) |
|
PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) |
|
||||||
PRIMFLAG_TEXFORMAT(container.overlay()->format()) |
|
PRIMFLAG_TEXFORMAT(container.overlay()->format()) |
|
||||||
PRIMFLAG_TEXSHADE(1);
|
PRIMFLAG_TEXSHADE(1);
|
||||||
|
|
||||||
list.append_or_return(*prim, false);
|
list.append_or_return(*prim, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1925,17 +1925,17 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob
|
|||||||
|
|
||||||
texture->get_scaled(width, height, prim->texture, list);
|
texture->get_scaled(width, height, prim->texture, list);
|
||||||
|
|
||||||
// compute the clip rect
|
// compute the clip rect
|
||||||
render_bounds cliprect;
|
render_bounds cliprect;
|
||||||
cliprect.x0 = render_round_nearest(xform.xoffs);
|
cliprect.x0 = render_round_nearest(xform.xoffs);
|
||||||
cliprect.y0 = render_round_nearest(xform.yoffs);
|
cliprect.y0 = render_round_nearest(xform.yoffs);
|
||||||
cliprect.x1 = render_round_nearest(xform.xoffs + xform.xscale);
|
cliprect.x1 = render_round_nearest(xform.xoffs + xform.xscale);
|
||||||
cliprect.y1 = render_round_nearest(xform.yoffs + xform.yscale);
|
cliprect.y1 = render_round_nearest(xform.yoffs + xform.yscale);
|
||||||
sect_render_bounds(&cliprect, &m_bounds);
|
sect_render_bounds(&cliprect, &m_bounds);
|
||||||
|
|
||||||
// determine UV coordinates and apply clipping
|
// determine UV coordinates and apply clipping
|
||||||
prim->texcoords = oriented_texcoords[xform.orientation];
|
prim->texcoords = oriented_texcoords[xform.orientation];
|
||||||
bool clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords);
|
bool clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords);
|
||||||
|
|
||||||
// add to the list or free if we're clipped out
|
// add to the list or free if we're clipped out
|
||||||
list.append_or_return(*prim, clipped);
|
list.append_or_return(*prim, clipped);
|
||||||
|
@ -213,26 +213,26 @@ struct render_quad_texuv
|
|||||||
|
|
||||||
struct render_palette_copy
|
struct render_palette_copy
|
||||||
{
|
{
|
||||||
int ref_count;
|
int ref_count;
|
||||||
dynamic_array<rgb_t> palette;
|
dynamic_array<rgb_t> palette;
|
||||||
};
|
};
|
||||||
|
|
||||||
class render_texinfo
|
class render_texinfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
render_texinfo()
|
render_texinfo()
|
||||||
: base(NULL), rowpixels(0), width(0), height(0),
|
: base(NULL), rowpixels(0), width(0), height(0),
|
||||||
seqid(0), osddata(0), m_palette(NULL)
|
seqid(0), osddata(0), m_palette(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
render_texinfo(const render_texinfo &src);
|
render_texinfo(const render_texinfo &src);
|
||||||
|
|
||||||
~render_texinfo()
|
~render_texinfo()
|
||||||
{
|
{
|
||||||
free_palette();
|
free_palette();
|
||||||
}
|
}
|
||||||
|
|
||||||
render_texinfo &operator=(const render_texinfo &src);
|
render_texinfo &operator=(const render_texinfo &src);
|
||||||
|
|
||||||
void * base; // base of the data
|
void * base; // base of the data
|
||||||
UINT32 rowpixels; // pixels per row
|
UINT32 rowpixels; // pixels per row
|
||||||
@ -241,14 +241,14 @@ public:
|
|||||||
UINT32 seqid; // sequence ID
|
UINT32 seqid; // sequence ID
|
||||||
UINT64 osddata; // aux data to pass to osd
|
UINT64 osddata; // aux data to pass to osd
|
||||||
|
|
||||||
const rgb_t * palette() const { return ((m_palette == NULL) ? NULL : &m_palette->palette[0]); }
|
const rgb_t * palette() const { return ((m_palette == NULL) ? NULL : &m_palette->palette[0]); }
|
||||||
|
|
||||||
void set_palette(const dynamic_array<rgb_t> *source);
|
void set_palette(const dynamic_array<rgb_t> *source);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void free_palette();
|
void free_palette();
|
||||||
|
|
||||||
render_palette_copy *m_palette; // palette for PALETTE16 textures, LUTs for RGB15/RGB32
|
render_palette_copy *m_palette; // palette for PALETTE16 textures, LUTs for RGB15/RGB32
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,14 +92,14 @@ render_font::render_font(render_manager &manager, const char *filename)
|
|||||||
m_osdfont = manager.machine().osd().font_alloc();
|
m_osdfont = manager.machine().osd().font_alloc();
|
||||||
if (m_osdfont != NULL)
|
if (m_osdfont != NULL)
|
||||||
{
|
{
|
||||||
if (m_osdfont->open(manager.machine().options().font_path(), filename, m_height))
|
if (m_osdfont->open(manager.machine().options().font_path(), filename, m_height))
|
||||||
{
|
{
|
||||||
m_scale = 1.0f / (float)m_height;
|
m_scale = 1.0f / (float)m_height;
|
||||||
m_format = FF_OSD;
|
m_format = FF_OSD;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
global_free(m_osdfont);
|
global_free(m_osdfont);
|
||||||
m_osdfont = NULL;
|
m_osdfont = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,8 +136,8 @@ render_font::~render_font()
|
|||||||
// release the OSD font
|
// release the OSD font
|
||||||
if (m_osdfont != NULL)
|
if (m_osdfont != NULL)
|
||||||
{
|
{
|
||||||
m_osdfont->close();
|
m_osdfont->close();
|
||||||
global_free(m_osdfont);
|
global_free(m_osdfont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,9 +109,9 @@ void ui_menu_device_config::populate()
|
|||||||
const rectangle &visarea = screen->visible_area();
|
const rectangle &visarea = screen->visible_area();
|
||||||
|
|
||||||
string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
|
string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
|
||||||
visarea.width(), visarea.height(),
|
visarea.width(), visarea.height(),
|
||||||
(machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
|
(machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
|
||||||
ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
|
ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ void ui_menu_device_config::populate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + bios + dips + confs
|
if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + bios + dips + confs
|
||||||
+ input + input_mj + input_hana + input_gamble + input_analog + input_adjust + input_keypad + input_keyboard) == 0)
|
+ input + input_mj + input_hana + input_gamble + input_analog + input_adjust + input_keypad + input_keyboard) == 0)
|
||||||
string.cat("[None]\n");
|
string.cat("[None]\n");
|
||||||
|
|
||||||
const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name());
|
const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name());
|
||||||
|
@ -83,9 +83,9 @@ void ui_menu_tape_control::populate()
|
|||||||
(state & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED
|
(state & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED
|
||||||
? "stopped"
|
? "stopped"
|
||||||
: ((state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY
|
: ((state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY
|
||||||
? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "playing" : "(playing)")
|
? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "playing" : "(playing)")
|
||||||
: ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "recording" : "(recording)")
|
: ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "recording" : "(recording)")
|
||||||
),
|
),
|
||||||
timepos,
|
timepos,
|
||||||
tapeflags,
|
tapeflags,
|
||||||
TAPECMD_SLIDER);
|
TAPECMD_SLIDER);
|
||||||
|
@ -100,12 +100,12 @@ public:
|
|||||||
void resize_keep_and_clear_new(int count, UINT8 data = 0) { int oldcount = m_count; resize_keep(count); if (oldcount < m_count) clear_internal(oldcount, m_count - oldcount, data); }
|
void resize_keep_and_clear_new(int count, UINT8 data = 0) { int oldcount = m_count; resize_keep(count); if (oldcount < m_count) clear_internal(oldcount, m_count - oldcount, data); }
|
||||||
|
|
||||||
// batch operations
|
// batch operations
|
||||||
void copyfrom(const dynamic_array<_ElementType> &source)
|
void copyfrom(const dynamic_array<_ElementType> &source)
|
||||||
{
|
{
|
||||||
resize(source.count());
|
resize(source.count());
|
||||||
for (int i=0; i < source.count(); i++)
|
for (int i=0; i < source.count(); i++)
|
||||||
m_array[i] = source[i];
|
m_array[i] = source[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal helpers
|
// internal helpers
|
||||||
|
@ -171,7 +171,7 @@ public:
|
|||||||
// entry list getters
|
// entry list getters
|
||||||
const rgb_t *entry_list_raw() const { return m_entry_color; }
|
const rgb_t *entry_list_raw() const { return m_entry_color; }
|
||||||
const dynamic_array<rgb_t> *entry_list_adjusted_darray() const { return &m_adjusted_color; }
|
const dynamic_array<rgb_t> *entry_list_adjusted_darray() const { return &m_adjusted_color; }
|
||||||
const rgb_t *entry_list_adjusted() const { return m_adjusted_color; }
|
const rgb_t *entry_list_adjusted() const { return m_adjusted_color; }
|
||||||
const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; }
|
const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; }
|
||||||
|
|
||||||
// group adjustments
|
// group adjustments
|
||||||
|
@ -46,47 +46,47 @@
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
static NETLIST_START(nl_mario_snd0)
|
static NETLIST_START(nl_mario_snd0)
|
||||||
|
|
||||||
RES(R17, RES_K(27)) /* 20 according to parts list */
|
RES(R17, RES_K(27)) /* 20 according to parts list */
|
||||||
/* 27 verified, 30K in schematics */
|
/* 27 verified, 30K in schematics */
|
||||||
CAP(C14, CAP_U(4.7)) /* verified */
|
CAP(C14, CAP_U(4.7)) /* verified */
|
||||||
|
|
||||||
TTL_74123(2H_A)
|
TTL_74123(2H_A)
|
||||||
NET_C(2H_A.VCC, V5)
|
NET_C(2H_A.VCC, V5)
|
||||||
NET_C(2H_A.GND, GND)
|
NET_C(2H_A.GND, GND)
|
||||||
NET_C(SOUND0.Q, 2H_A.B)
|
NET_C(SOUND0.Q, 2H_A.B)
|
||||||
NET_C(GND, 2H_A.A)
|
NET_C(GND, 2H_A.A)
|
||||||
NET_C(2H_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */
|
NET_C(2H_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */
|
||||||
DIODE(D1, "1N4148") /* FIXME: try to identify */
|
DIODE(D1, "1N4148") /* FIXME: try to identify */
|
||||||
TTL_7404_INVERT(1H_A, 2H_A.QQ)
|
TTL_7404_INVERT(1H_A, 2H_A.QQ)
|
||||||
NET_C(R17.1, V5)
|
NET_C(R17.1, V5)
|
||||||
NET_C(R17.2, D1.A, C14.1)
|
NET_C(R17.2, D1.A, C14.1)
|
||||||
NET_C(D1.K, 2H_A.RC)
|
NET_C(D1.K, 2H_A.RC)
|
||||||
NET_C(C14.2, 2H_A.C)
|
NET_C(C14.2, 2H_A.C)
|
||||||
|
|
||||||
RES(R6, RES_K(4.7)) /* verified */
|
RES(R6, RES_K(4.7)) /* verified */
|
||||||
CAP(C3, CAP_U(10)) /* verified */
|
CAP(C3, CAP_U(10)) /* verified */
|
||||||
|
|
||||||
NET_C(1H_A.Q, R6.1)
|
NET_C(1H_A.Q, R6.1)
|
||||||
NET_C(R6.2, C3.1, 1J_A.FC)
|
NET_C(R6.2, C3.1, 1J_A.FC)
|
||||||
NET_C(R6.2, 2J_A.FC)
|
NET_C(R6.2, 2J_A.FC)
|
||||||
NET_C(C3.2, GND)
|
NET_C(C3.2, GND)
|
||||||
|
|
||||||
//#define MR_C6 CAP_N(3.9) /* verified */
|
//#define MR_C6 CAP_N(3.9) /* verified */
|
||||||
|
|
||||||
SN74LS629(1J_A, CAP_N(3.9))
|
SN74LS629(1J_A, CAP_N(3.9))
|
||||||
NET_C(1J_A.RNG, V5)
|
NET_C(1J_A.RNG, V5)
|
||||||
NET_C(1J_A.ENQ, ttllow)
|
NET_C(1J_A.ENQ, ttllow)
|
||||||
NET_C(GND, 1J_A.GND)
|
NET_C(GND, 1J_A.GND)
|
||||||
|
|
||||||
//#define MR_C17 CAP_N(22) /* verified */
|
//#define MR_C17 CAP_N(22) /* verified */
|
||||||
|
|
||||||
SN74LS629(2J_A, CAP_N(22))
|
SN74LS629(2J_A, CAP_N(22))
|
||||||
NET_C(2J_A.RNG, V5)
|
NET_C(2J_A.RNG, V5)
|
||||||
NET_C(2J_A.ENQ, ttllow)
|
NET_C(2J_A.ENQ, ttllow)
|
||||||
NET_C(GND, 2J_A.GND)
|
NET_C(GND, 2J_A.GND)
|
||||||
|
|
||||||
TTL_7486_XOR(1K_A, 1J_A.Y, 2J_A.Y)
|
TTL_7486_XOR(1K_A, 1J_A.Y, 2J_A.Y)
|
||||||
TTL_7408_AND(2K_A, 2H_A.Q, 1K_A)
|
TTL_7408_AND(2K_A, 2H_A.Q, 1K_A)
|
||||||
NETLIST_END()
|
NETLIST_END()
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -96,49 +96,49 @@ NETLIST_END()
|
|||||||
// FIXME: Diodes are 1S953
|
// FIXME: Diodes are 1S953
|
||||||
static NETLIST_START(nl_mario_snd7)
|
static NETLIST_START(nl_mario_snd7)
|
||||||
|
|
||||||
RES(R61, RES_K(47))
|
RES(R61, RES_K(47))
|
||||||
CAP(C41, CAP_U(4.7)) /* verified */
|
CAP(C41, CAP_U(4.7)) /* verified */
|
||||||
|
|
||||||
TTL_74123(4L_A)
|
TTL_74123(4L_A)
|
||||||
NET_C(4L_A.VCC, V5)
|
NET_C(4L_A.VCC, V5)
|
||||||
NET_C(4L_A.GND, GND)
|
NET_C(4L_A.GND, GND)
|
||||||
NET_C(SOUND7.Q, 4L_A.B)
|
NET_C(SOUND7.Q, 4L_A.B)
|
||||||
NET_C(GND, 4L_A.A)
|
NET_C(GND, 4L_A.A)
|
||||||
NET_C(4L_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */
|
NET_C(4L_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */
|
||||||
DIODE(D10, "1N4148") /* FIXME: try to identify */
|
DIODE(D10, "1N4148") /* FIXME: try to identify */
|
||||||
TTL_7404_INVERT(4J_A, 4L_A.Q)
|
TTL_7404_INVERT(4J_A, 4L_A.Q)
|
||||||
NET_C(R61.1, V5)
|
NET_C(R61.1, V5)
|
||||||
NET_C(R61.2, D10.A, C41.1)
|
NET_C(R61.2, D10.A, C41.1)
|
||||||
NET_C(D10.K, 4L_A.RC)
|
NET_C(D10.K, 4L_A.RC)
|
||||||
NET_C(C41.2, 4L_A.C)
|
NET_C(C41.2, 4L_A.C)
|
||||||
|
|
||||||
RES(R65, RES_K(10))
|
RES(R65, RES_K(10))
|
||||||
CAP(C44, CAP_U(3.3)) /* verified */
|
CAP(C44, CAP_U(3.3)) /* verified */
|
||||||
|
|
||||||
SN74LS629(4K_A, CAP_U(0.022))
|
SN74LS629(4K_A, CAP_U(0.022))
|
||||||
NET_C(4K_A.RNG, V5)
|
NET_C(4K_A.RNG, V5)
|
||||||
NET_C(4K_A.ENQ, ttllow)
|
NET_C(4K_A.ENQ, ttllow)
|
||||||
NET_C(GND, 4K_A.GND)
|
NET_C(GND, 4K_A.GND)
|
||||||
NET_C(R65.1, 4J_A.Q)
|
NET_C(R65.1, 4J_A.Q)
|
||||||
NET_C(R65.2, 4K_A.FC, C44.1)
|
NET_C(R65.2, 4K_A.FC, C44.1)
|
||||||
NET_C(C44.2, GND)
|
NET_C(C44.2, GND)
|
||||||
|
|
||||||
CD_4020(3H, 4K_B.Y, ttllow, V5, GND)
|
CD_4020(3H, 4K_B.Y, ttllow, V5, GND)
|
||||||
TTL_7404_INVERT(4J_B, 3H.Q12)
|
TTL_7404_INVERT(4J_B, 3H.Q12)
|
||||||
|
|
||||||
RES(R64, RES_K(20))
|
RES(R64, RES_K(20))
|
||||||
CAP(C43, CAP_U(3.3)) /* verified */
|
CAP(C43, CAP_U(3.3)) /* verified */
|
||||||
|
|
||||||
SN74LS629(4K_B, CAP_U(0.0047))
|
SN74LS629(4K_B, CAP_U(0.0047))
|
||||||
NET_C(4K_B.RNG, V5)
|
NET_C(4K_B.RNG, V5)
|
||||||
NET_C(4K_B.ENQ, ttllow)
|
NET_C(4K_B.ENQ, ttllow)
|
||||||
NET_C(GND, 4K_B.GND)
|
NET_C(GND, 4K_B.GND)
|
||||||
NET_C(R64.1, 4J_B.Q)
|
NET_C(R64.1, 4J_B.Q)
|
||||||
NET_C(R64.2, 4K_B.FC, C43.1)
|
NET_C(R64.2, 4K_B.FC, C43.1)
|
||||||
NET_C(C43.2, GND)
|
NET_C(C43.2, GND)
|
||||||
|
|
||||||
TTL_7486_XOR(1K_C, 3H.Q4, 4K_A.Y)
|
TTL_7486_XOR(1K_C, 3H.Q4, 4K_A.Y)
|
||||||
TTL_7408_AND(2K_C, 4L_A.Q, 1K_C)
|
TTL_7408_AND(2K_C, 4L_A.Q, 1K_C)
|
||||||
|
|
||||||
NETLIST_END()
|
NETLIST_END()
|
||||||
|
|
||||||
@ -146,140 +146,140 @@ NETLIST_END()
|
|||||||
/* DAC sound */
|
/* DAC sound */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
static NETLIST_START(nl_mario_dac)
|
static NETLIST_START(nl_mario_dac)
|
||||||
RES(R34, RES_M(2))
|
RES(R34, RES_M(2))
|
||||||
RES(R35, RES_M(1))
|
RES(R35, RES_M(1))
|
||||||
RES(R36, RES_M(1.8))
|
RES(R36, RES_M(1.8))
|
||||||
LM3900(3M_1)
|
LM3900(3M_1)
|
||||||
NET_C(3M_1.VM, GND)
|
NET_C(3M_1.VM, GND)
|
||||||
NET_C(3M_1.VP, V5)
|
NET_C(3M_1.VP, V5)
|
||||||
|
|
||||||
NET_C(DAC.VOUT, R34.1)
|
NET_C(DAC.VOUT, R34.1)
|
||||||
NET_C(3M_1.MINUS, R34.2, R35.2)
|
NET_C(3M_1.MINUS, R34.2, R35.2)
|
||||||
NET_C(3M_1.OUT, R35.1)
|
NET_C(3M_1.OUT, R35.1)
|
||||||
NET_C(3M_1.PLUS, R36.1)
|
NET_C(3M_1.PLUS, R36.1)
|
||||||
NET_C(R36.2, GND)
|
NET_C(R36.2, GND)
|
||||||
|
|
||||||
RES(R21, RES_M(1.8))
|
RES(R21, RES_M(1.8))
|
||||||
RES(R23, RES_K(10))
|
RES(R23, RES_K(10))
|
||||||
RES(R25, RES_K(10))
|
RES(R25, RES_K(10))
|
||||||
RES(R37, RES_K(750))
|
RES(R37, RES_K(750))
|
||||||
RES(R38, RES_K(360))
|
RES(R38, RES_K(360))
|
||||||
RES(R39, RES_K(750))
|
RES(R39, RES_K(750))
|
||||||
|
|
||||||
CAP(C18, CAP_P(100))
|
CAP(C18, CAP_P(100))
|
||||||
CAP(C19, CAP_U(10))
|
CAP(C19, CAP_U(10))
|
||||||
CAP(C20, CAP_U(1))
|
CAP(C20, CAP_U(1))
|
||||||
CAP(C30, CAP_P(100))
|
CAP(C30, CAP_P(100))
|
||||||
|
|
||||||
LM3900(3M_2)
|
LM3900(3M_2)
|
||||||
NET_C(3M_2.VM, GND)
|
NET_C(3M_2.VM, GND)
|
||||||
NET_C(3M_2.VP, V5)
|
NET_C(3M_2.VP, V5)
|
||||||
|
|
||||||
NET_C(R35.1, C20.1)
|
NET_C(R35.1, C20.1)
|
||||||
NET_C(C20.2, R37.1)
|
NET_C(C20.2, R37.1)
|
||||||
NET_C(R37.2, R38.2, C18.1, R39.2)
|
NET_C(R37.2, R38.2, C18.1, R39.2)
|
||||||
|
|
||||||
NET_C(C18.2, GND)
|
NET_C(C18.2, GND)
|
||||||
NET_C(R38.1, C30.2, 3M_2.MINUS)
|
NET_C(R38.1, C30.2, 3M_2.MINUS)
|
||||||
NET_C(3M_2.OUT, R39.1, C30.1)
|
NET_C(3M_2.OUT, R39.1, C30.1)
|
||||||
|
|
||||||
NET_C(R21.1, 3M_2.PLUS)
|
NET_C(R21.1, 3M_2.PLUS)
|
||||||
NET_C(R21.2, C19.1, R25.2, R23.1)
|
NET_C(R21.2, C19.1, R25.2, R23.1)
|
||||||
NET_C(C19.2, R23.2, GND)
|
NET_C(C19.2, R23.2, GND)
|
||||||
NET_C(R25.1, V5)
|
NET_C(R25.1, V5)
|
||||||
NETLIST_END()
|
NETLIST_END()
|
||||||
|
|
||||||
static NETLIST_START(nl_mario)
|
static NETLIST_START(nl_mario)
|
||||||
|
|
||||||
/* Standard stuff */
|
/* Standard stuff */
|
||||||
|
|
||||||
SOLVER(Solver, 48000)
|
SOLVER(Solver, 48000)
|
||||||
PARAM(Solver.ACCURACY, 1e-8)
|
PARAM(Solver.ACCURACY, 1e-8)
|
||||||
PARAM(Solver.SOR_FACTOR, 1.0)
|
PARAM(Solver.SOR_FACTOR, 1.0)
|
||||||
PARAM(Solver.GS_THRESHOLD, 5)
|
PARAM(Solver.GS_THRESHOLD, 5)
|
||||||
PARAM(Solver.GS_LOOPS, 4)
|
PARAM(Solver.GS_LOOPS, 4)
|
||||||
//PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control
|
//PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control
|
||||||
PARAM(Solver.DYNAMIC_TS, 0)
|
PARAM(Solver.DYNAMIC_TS, 0)
|
||||||
ANALOG_INPUT(V5, 5)
|
ANALOG_INPUT(V5, 5)
|
||||||
|
|
||||||
TTL_INPUT(SOUND0, 1)
|
TTL_INPUT(SOUND0, 1)
|
||||||
INCLUDE(nl_mario_snd0)
|
INCLUDE(nl_mario_snd0)
|
||||||
|
|
||||||
TTL_INPUT(SOUND7, 1)
|
TTL_INPUT(SOUND7, 1)
|
||||||
INCLUDE(nl_mario_snd7)
|
INCLUDE(nl_mario_snd7)
|
||||||
|
|
||||||
R2R_DAC(DAC, 3.4, 10000.0, 8)
|
R2R_DAC(DAC, 3.4, 10000.0, 8)
|
||||||
NET_C(DAC.VGND, GND)
|
NET_C(DAC.VGND, GND)
|
||||||
|
|
||||||
INCLUDE(nl_mario_dac)
|
INCLUDE(nl_mario_dac)
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* mixing */
|
/* mixing */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
RES(R20, RES_K(22)) /* verified */
|
RES(R20, RES_K(22)) /* verified */
|
||||||
RES(R19, RES_K(22)) /* verified */
|
RES(R19, RES_K(22)) /* verified */
|
||||||
RES(R40, RES_K(22)) /* verified */
|
RES(R40, RES_K(22)) /* verified */
|
||||||
RES(R41, RES_K(100)) /* verified */
|
RES(R41, RES_K(100)) /* verified */
|
||||||
CAP(C31, CAP_U(0.022)) /* */
|
CAP(C31, CAP_U(0.022)) /* */
|
||||||
|
|
||||||
NET_C(2K_A.Q, R20.1)
|
NET_C(2K_A.Q, R20.1)
|
||||||
NET_C(GND, R19.1) //FIXME
|
NET_C(GND, R19.1) //FIXME
|
||||||
NET_C(2K_C.Q, R41.1)
|
NET_C(2K_C.Q, R41.1)
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
RES(DUM, RES_K(22))
|
RES(DUM, RES_K(22))
|
||||||
NET_C(R39.1, DUM.1)
|
NET_C(R39.1, DUM.1)
|
||||||
NET_C(DUM.2, GND)
|
NET_C(DUM.2, GND)
|
||||||
FRONTIER(front1, R39.1, R40.1)
|
FRONTIER(front1, R39.1, R40.1)
|
||||||
#else
|
#else
|
||||||
NET_C(R39.1, R40.1)
|
NET_C(R39.1, R40.1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NET_C(R20.2, R19.2, R40.2, R41.2, C31.1)
|
NET_C(R20.2, R19.2, R40.2, R41.2, C31.1)
|
||||||
NET_C(C31.2, GND)
|
NET_C(C31.2, GND)
|
||||||
|
|
||||||
CAP(C32, CAP_U(1)) /* verified */
|
CAP(C32, CAP_U(1)) /* verified */
|
||||||
RES(R42, RES_K(43)) /* verified */
|
RES(R42, RES_K(43)) /* verified */
|
||||||
RES(R43, RES_K(100)) /* verified */
|
RES(R43, RES_K(100)) /* verified */
|
||||||
|
|
||||||
NET_C(C31.1, C32.1)
|
NET_C(C31.1, C32.1)
|
||||||
NET_C(C32.2, R42.1, R43.2, Q10.B)
|
NET_C(C32.2, R42.1, R43.2, Q10.B)
|
||||||
//NET_C(C32.2, R42.1, R43.2)
|
//NET_C(C32.2, R42.1, R43.2)
|
||||||
NET_C(R43.1, V5)
|
NET_C(R43.1, V5)
|
||||||
NET_C(R42.2, GND)
|
NET_C(R42.2, GND)
|
||||||
#if 1
|
#if 1
|
||||||
RES(R63, RES_K(1)) /* */
|
RES(R63, RES_K(1)) /* */
|
||||||
RES(R62, 150) /* */
|
RES(R62, 150) /* */
|
||||||
|
|
||||||
QBJT_EB(Q10, "2SC1815")
|
QBJT_EB(Q10, "2SC1815")
|
||||||
|
|
||||||
NET_C(R62.2, GND)
|
NET_C(R62.2, GND)
|
||||||
NET_C(R62.1, Q10.E)
|
NET_C(R62.1, Q10.E)
|
||||||
|
|
||||||
NET_C(R63.1, V5)
|
NET_C(R63.1, V5)
|
||||||
NET_C(R63.2, Q10.C)
|
NET_C(R63.2, Q10.C)
|
||||||
|
|
||||||
CAP(C42, CAP_U(0.1))
|
CAP(C42, CAP_U(0.1))
|
||||||
CAP(C47, CAP_U(4.7))
|
CAP(C47, CAP_U(4.7))
|
||||||
RES(VR1, RES_K(10))
|
RES(VR1, RES_K(10))
|
||||||
|
|
||||||
NET_C(C42.1, C47.1, R62.1)
|
NET_C(C42.1, C47.1, R62.1)
|
||||||
NET_C(C42.2, GND)
|
NET_C(C42.2, GND)
|
||||||
NET_C(C47.2, VR1.1)
|
NET_C(C47.2, VR1.1)
|
||||||
NET_C(VR1.2, GND)
|
NET_C(VR1.2, GND)
|
||||||
#endif
|
#endif
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* Output */
|
/* Output */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
RES(ROUT, 1000000)
|
RES(ROUT, 1000000)
|
||||||
|
|
||||||
//NET_C(Q10.C, ROUT.1)
|
//NET_C(Q10.C, ROUT.1)
|
||||||
//NET_C(R43.2, ROUT.1)
|
//NET_C(R43.2, ROUT.1)
|
||||||
NET_C(VR1.1, ROUT.1)
|
NET_C(VR1.1, ROUT.1)
|
||||||
|
|
||||||
NET_C(GND, ROUT.2)
|
NET_C(GND, ROUT.2)
|
||||||
|
|
||||||
NETLIST_END()
|
NETLIST_END()
|
||||||
|
|
||||||
@ -790,7 +790,7 @@ WRITE8_MEMBER(mario_state::mario_sh1_w)
|
|||||||
#if OLD_SOUND
|
#if OLD_SOUND
|
||||||
m_discrete->write(space, DS_SOUND0_INP, 0);
|
m_discrete->write(space, DS_SOUND0_INP, 0);
|
||||||
#else
|
#else
|
||||||
m_audio_snd0->write(data);
|
m_audio_snd0->write(data);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,7 +835,7 @@ WRITE8_MEMBER(mario_state::mario_sh3_w)
|
|||||||
#if OLD_SOUND
|
#if OLD_SOUND
|
||||||
machine().device<discrete_device>("discrete")->write(space, DS_SOUND7_INP, data & 1);
|
machine().device<discrete_device>("discrete")->write(space, DS_SOUND7_INP, data & 1);
|
||||||
#else
|
#else
|
||||||
m_audio_snd7->write((data & 1) ^ 1);
|
m_audio_snd7->write((data & 1) ^ 1);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -891,16 +891,16 @@ MACHINE_CONFIG_FRAGMENT( mario_audio )
|
|||||||
MCFG_DISCRETE_INTF(mario)
|
MCFG_DISCRETE_INTF(mario)
|
||||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
|
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
|
||||||
#else
|
#else
|
||||||
MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
|
MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
|
||||||
MCFG_NETLIST_SETUP(nl_mario)
|
MCFG_NETLIST_SETUP(nl_mario)
|
||||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||||
|
|
||||||
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd0", "SOUND0.IN", 0, 1)
|
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd0", "SOUND0.IN", 0, 1)
|
||||||
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd7", "SOUND7.IN", 0, 1)
|
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd7", "SOUND7.IN", 0, 1)
|
||||||
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "dac", "DAC.VAL", 0, 255)
|
MCFG_NETLIST_LOGIC_INPUT("snd_nl", "dac", "DAC.VAL", 0, 255)
|
||||||
|
|
||||||
MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
|
MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
|
||||||
MCFG_NETLIST_ANALOG_MULT_OFFSET(150000.0, 0.0)
|
MCFG_NETLIST_ANALOG_MULT_OFFSET(150000.0, 0.0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
@ -178,8 +178,8 @@ class aleck64_state : public n64_state
|
|||||||
public:
|
public:
|
||||||
aleck64_state(const machine_config &mconfig, device_type type, const char *tag)
|
aleck64_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||||
: n64_state(mconfig, type, tag),
|
: n64_state(mconfig, type, tag),
|
||||||
m_e90_vram(*this,"e90vram"),
|
m_e90_vram(*this,"e90vram"),
|
||||||
m_e90_pal(*this,"e90pal"),
|
m_e90_pal(*this,"e90pal"),
|
||||||
m_dip_read_offset(0) { }
|
m_dip_read_offset(0) { }
|
||||||
|
|
||||||
optional_shared_ptr<UINT32> m_e90_vram;
|
optional_shared_ptr<UINT32> m_e90_vram;
|
||||||
@ -342,7 +342,7 @@ WRITE16_MEMBER(aleck64_state::e90_prot_w)
|
|||||||
if(data & 1) // 0 -> 1 transition
|
if(data & 1) // 0 -> 1 transition
|
||||||
{
|
{
|
||||||
//for(int i=0;i<0x1000;i+=4)
|
//for(int i=0;i<0x1000;i+=4)
|
||||||
// space.write_dword(0x007502f4+i,space.read_dword(0xd0000000+i));
|
// space.write_dword(0x007502f4+i,space.read_dword(0xd0000000+i));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//0x1e bit 0 probably enables the chip
|
//0x1e bit 0 probably enables the chip
|
||||||
|
@ -1940,7 +1940,7 @@ ROM_START( discof )
|
|||||||
ROM_LOAD( "w3-f.4a", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) )
|
ROM_LOAD( "w3-f.4a", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) )
|
||||||
ROM_LOAD( "w2-f.6a", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) )
|
ROM_LOAD( "w2-f.6a", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) )
|
||||||
ROM_LOAD( "w1-f.9a", 0xe000, 0x1000, CRC(a6ce9a19) SHA1(e8f380e17a21fb33504d6efe9d01d0f903fa25e1) )
|
ROM_LOAD( "w1-f.9a", 0xe000, 0x1000, CRC(a6ce9a19) SHA1(e8f380e17a21fb33504d6efe9d01d0f903fa25e1) )
|
||||||
// ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) // 0x7d3 is 0x10 instead of 0x00, 1 bit different, looks out of place, bad?
|
// ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) // 0x7d3 is 0x10 instead of 0x00, 1 bit different, looks out of place, bad?
|
||||||
ROM_LOAD( "w0-f.9a", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) )
|
ROM_LOAD( "w0-f.9a", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) )
|
||||||
|
|
||||||
ROM_REGION( 0x10000, "audiocpu", 0 )
|
ROM_REGION( 0x10000, "audiocpu", 0 )
|
||||||
|
@ -154,7 +154,7 @@ public:
|
|||||||
: dynax_state(mconfig, type, tag),
|
: dynax_state(mconfig, type, tag),
|
||||||
m_dsw_sel16(*this, "dsw_sel16"),
|
m_dsw_sel16(*this, "dsw_sel16"),
|
||||||
m_protection1(*this, "protection1"),
|
m_protection1(*this, "protection1"),
|
||||||
m_protection2(*this, "protection2") { }
|
m_protection2(*this, "protection2") { }
|
||||||
|
|
||||||
|
|
||||||
optional_shared_ptr<UINT16> m_dsw_sel16;
|
optional_shared_ptr<UINT16> m_dsw_sel16;
|
||||||
|
@ -356,7 +356,7 @@ ADDRESS_MAP_END
|
|||||||
static ADDRESS_MAP_START( flashbank_map, AS_PROGRAM, 32, funkball_state )
|
static ADDRESS_MAP_START( flashbank_map, AS_PROGRAM, 32, funkball_state )
|
||||||
AM_RANGE(0x00000000, 0x003fffff) AM_DEVREADWRITE16("u29", intel_28f320j5_device, read, write, 0xffffffff ) // needed to boot
|
AM_RANGE(0x00000000, 0x003fffff) AM_DEVREADWRITE16("u29", intel_28f320j5_device, read, write, 0xffffffff ) // needed to boot
|
||||||
AM_RANGE(0x00400000, 0x007fffff) AM_DEVREADWRITE16("u30", intel_28f320j5_device, read, write, 0xffffffff ) // i assume it maps directly after
|
AM_RANGE(0x00400000, 0x007fffff) AM_DEVREADWRITE16("u30", intel_28f320j5_device, read, write, 0xffffffff ) // i assume it maps directly after
|
||||||
// AM_RANGE(0x02000000, 0x023fffff) AM_DEVREADWRITE16("u3", intel_28f320j5_device, read, write, 0xffffffff ) // sound program, don't think it matters where we map it, might not even be visible in this space
|
// AM_RANGE(0x02000000, 0x023fffff) AM_DEVREADWRITE16("u3", intel_28f320j5_device, read, write, 0xffffffff ) // sound program, don't think it matters where we map it, might not even be visible in this space
|
||||||
/* it checks for 64MBit chips at 0x80000000 the way things are set up, they must return an intel Flash ID of 0x15 */
|
/* it checks for 64MBit chips at 0x80000000 the way things are set up, they must return an intel Flash ID of 0x15 */
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
@ -1499,8 +1499,8 @@ static ADDRESS_MAP_START( spactrai_map, AS_PROGRAM, 8, galaxian_state )
|
|||||||
AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
|
AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
|
||||||
AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r)
|
AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r)
|
||||||
AM_RANGE(0x4000, 0xbfff) AM_ROM
|
AM_RANGE(0x4000, 0xbfff) AM_ROM
|
||||||
// AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
|
// AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
|
||||||
// AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
|
// AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
static ADDRESS_MAP_START( anteaterg_map, AS_PROGRAM, 8, galaxian_state )
|
static ADDRESS_MAP_START( anteaterg_map, AS_PROGRAM, 8, galaxian_state )
|
||||||
|
@ -427,13 +427,13 @@ static ADDRESS_MAP_START( video_map, AS_PROGRAM, 8, caveman_state )
|
|||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
static ADDRESS_MAP_START( video_io_map, AS_IO, 8, caveman_state )
|
static ADDRESS_MAP_START( video_io_map, AS_IO, 8, caveman_state )
|
||||||
// AM_RANGE(0x000, 0x002) AM_READWRITE() // 8259 irq controller
|
// AM_RANGE(0x000, 0x002) AM_READWRITE() // 8259 irq controller
|
||||||
// AM_RANGE(0x100, 0x102) AM_READWRITE() // HD46505
|
// AM_RANGE(0x100, 0x102) AM_READWRITE() // HD46505
|
||||||
// AM_RANGE(0x200, 0x200) AM_READWRITE() // 8212 in, ?? out
|
// AM_RANGE(0x200, 0x200) AM_READWRITE() // 8212 in, ?? out
|
||||||
// AM_RANGE(0x300, 0x300) AM_READWRITE() // soundlatch (command?) in, ?? out
|
// AM_RANGE(0x300, 0x300) AM_READWRITE() // soundlatch (command?) in, ?? out
|
||||||
|
|
||||||
// AM_RANGE(0x400, 0x400) AM_READ() // joystick inputs
|
// AM_RANGE(0x400, 0x400) AM_READ() // joystick inputs
|
||||||
// AM_RANGE(0x500, 0x506) AM_WRITE() // palette
|
// AM_RANGE(0x500, 0x506) AM_WRITE() // palette
|
||||||
|
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
@ -2491,7 +2491,7 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
static MACHINE_CONFIG_DERIVED( model2a_0229, model2a )
|
static MACHINE_CONFIG_DERIVED( model2a_0229, model2a )
|
||||||
MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0)
|
MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0)
|
||||||
// MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback)
|
// MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback)
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
READ8_MEMBER(model2_state::driveio_port_r)
|
READ8_MEMBER(model2_state::driveio_port_r)
|
||||||
@ -2599,7 +2599,7 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
static MACHINE_CONFIG_DERIVED( model2b_0229, model2b )
|
static MACHINE_CONFIG_DERIVED( model2b_0229, model2b )
|
||||||
MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0)
|
MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0)
|
||||||
// MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback)
|
// MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback)
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
|
||||||
@ -5947,7 +5947,7 @@ WRITE32_MEMBER(model2_state::jaleco_network_w)
|
|||||||
|
|
||||||
DRIVER_INIT_MEMBER(model2_state,sgt24h)
|
DRIVER_INIT_MEMBER(model2_state,sgt24h)
|
||||||
{
|
{
|
||||||
// DRIVER_INIT_CALL(genprot);
|
// DRIVER_INIT_CALL(genprot);
|
||||||
|
|
||||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this));
|
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this));
|
||||||
|
|
||||||
|
@ -1696,11 +1696,11 @@ READ64_MEMBER(model3_state::model3_5881prot_r)
|
|||||||
{
|
{
|
||||||
UINT8* base;
|
UINT8* base;
|
||||||
retvalue = m_cryptdevice->do_decrypt(base);
|
retvalue = m_cryptdevice->do_decrypt(base);
|
||||||
// retvalue = ((retvalue & 0xff00) >> 8) | ((retvalue & 0x00ff) << 8); // don't endian swap the return value on this hardware
|
// retvalue = ((retvalue & 0xff00) >> 8) | ((retvalue & 0x00ff) << 8); // don't endian swap the return value on this hardware
|
||||||
retvalue <<= 16;
|
retvalue <<= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff));
|
// printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5584,8 +5584,8 @@ UINT16 model3_state::crypt_read_callback(UINT32 addr)
|
|||||||
dat = m_maincpu->space().read_word((0xf0180000 + 4 * addr)); // every other word is unused in this RAM, probably 32-bit ram on 64-bit bus?
|
dat = m_maincpu->space().read_word((0xf0180000 + 4 * addr)); // every other word is unused in this RAM, probably 32-bit ram on 64-bit bus?
|
||||||
}
|
}
|
||||||
|
|
||||||
// dat = ((dat & 0xff00) >> 8) | ((dat & 0x00ff) << 8);
|
// dat = ((dat & 0xff00) >> 8) | ((dat & 0x00ff) << 8);
|
||||||
// printf("reading %04x\n", dat);
|
// printf("reading %04x\n", dat);
|
||||||
|
|
||||||
return dat;
|
return dat;
|
||||||
}
|
}
|
||||||
@ -5629,7 +5629,7 @@ static void interleave_vroms(running_machine &machine)
|
|||||||
|
|
||||||
DRIVER_INIT_MEMBER(model3_state, genprot)
|
DRIVER_INIT_MEMBER(model3_state, genprot)
|
||||||
{
|
{
|
||||||
// astring key = parameter(":315_5881:key");
|
// astring key = parameter(":315_5881:key");
|
||||||
|
|
||||||
m_maincpu->space(AS_PROGRAM).install_ram(0xf0180000, 0xf019ffff, 0, 0x0e000000);
|
m_maincpu->space(AS_PROGRAM).install_ram(0xf0180000, 0xf019ffff, 0, 0x0e000000);
|
||||||
|
|
||||||
@ -5846,7 +5846,6 @@ DRIVER_INIT_MEMBER(model3_state,srally2)
|
|||||||
|
|
||||||
DRIVER_INIT_MEMBER(model3_state,swtrilgy)
|
DRIVER_INIT_MEMBER(model3_state,swtrilgy)
|
||||||
{
|
{
|
||||||
|
|
||||||
UINT32 *rom = (UINT32*)memregion("user1")->base();
|
UINT32 *rom = (UINT32*)memregion("user1")->base();
|
||||||
DRIVER_INIT_CALL(model3_20);
|
DRIVER_INIT_CALL(model3_20);
|
||||||
|
|
||||||
@ -5890,7 +5889,7 @@ DRIVER_INIT_MEMBER(model3_state,dirtdvls)
|
|||||||
|
|
||||||
DRIVER_INIT_MEMBER(model3_state,daytona2)
|
DRIVER_INIT_MEMBER(model3_state,daytona2)
|
||||||
{
|
{
|
||||||
// UINT32 *rom = (UINT32*)memregion("user1")->base();
|
// UINT32 *rom = (UINT32*)memregion("user1")->base();
|
||||||
DRIVER_INIT_CALL(model3_20);
|
DRIVER_INIT_CALL(model3_20);
|
||||||
|
|
||||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this));
|
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this));
|
||||||
@ -5906,17 +5905,17 @@ DRIVER_INIT_MEMBER(model3_state,daytona2)
|
|||||||
|
|
||||||
DRIVER_INIT_MEMBER(model3_state,dayto2pe)
|
DRIVER_INIT_MEMBER(model3_state,dayto2pe)
|
||||||
{
|
{
|
||||||
// UINT32 *rom = (UINT32*)memregion("user1")->base();
|
// UINT32 *rom = (UINT32*)memregion("user1")->base();
|
||||||
DRIVER_INIT_CALL(model3_20);
|
DRIVER_INIT_CALL(model3_20);
|
||||||
|
|
||||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this));
|
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this));
|
||||||
m_maincpu->space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
|
m_maincpu->space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
|
||||||
|
|
||||||
// rom[(0x606784^4)/4] = 0x60000000;
|
// rom[(0x606784^4)/4] = 0x60000000;
|
||||||
// rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code
|
// rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code
|
||||||
// rom[(0x618b28^4)/4] = 0x60000000; // jump to encrypted code
|
// rom[(0x618b28^4)/4] = 0x60000000; // jump to encrypted code
|
||||||
|
|
||||||
// rom[(0x64ca34^4)/4] = 0x60000000; // dec
|
// rom[(0x64ca34^4)/4] = 0x60000000; // dec
|
||||||
|
|
||||||
DRIVER_INIT_CALL(genprot);
|
DRIVER_INIT_CALL(genprot);
|
||||||
}
|
}
|
||||||
|
@ -947,4 +947,3 @@ ROM_END
|
|||||||
GAME( 1987, psychic5, 0, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (World)", 0 ) // "Oversea's version V2.00 CHANGED BY TAMIO NAKASATO" text present in ROM, various modifications (English names, more complete attract demo etc.)
|
GAME( 1987, psychic5, 0, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (World)", 0 ) // "Oversea's version V2.00 CHANGED BY TAMIO NAKASATO" text present in ROM, various modifications (English names, more complete attract demo etc.)
|
||||||
GAME( 1987, psychic5j, psychic5, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (Japan)", 0 )
|
GAME( 1987, psychic5j, psychic5, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (Japan)", 0 )
|
||||||
GAME( 1988, bombsa, 0, bombsa, bombsa, driver_device, 0, ROT270, "Jaleco", "Bombs Away", GAME_NOT_WORKING )
|
GAME( 1988, bombsa, 0, bombsa, bombsa, driver_device, 0, ROT270, "Jaleco", "Bombs Away", GAME_NOT_WORKING )
|
||||||
|
|
||||||
|
@ -1584,7 +1584,7 @@ static INPUT_PORTS_START( reelquak )
|
|||||||
PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) )
|
PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) )
|
||||||
PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" )
|
PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" )
|
||||||
|
|
||||||
PORT_START("DSW2") // $400302.w PORT_START("DSW2") // $400302.w
|
PORT_START("DSW2") // $400302.w PORT_START("DSW2") // $400302.w
|
||||||
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") // used
|
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") // used
|
||||||
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||||
|
@ -226,7 +226,7 @@ ROM_END
|
|||||||
MS06 M8 74s287 missile animated graphics
|
MS06 M8 74s287 missile animated graphics
|
||||||
MS05 11F IM5610 200pt tank R->L graphic
|
MS05 11F IM5610 200pt tank R->L graphic
|
||||||
MS05 11E IM5610 200pt tank L->R graphic
|
MS05 11E IM5610 200pt tank L->R graphic
|
||||||
MS04 N7 IM5610 player missile trajectory pattern
|
MS04 N7 IM5610 player missile trajectory pattern
|
||||||
MS03 F3 IM5610 anti-missile ack-ack graphics
|
MS03 F3 IM5610 anti-missile ack-ack graphics
|
||||||
MS02 L12 IM5610 missile left/right position
|
MS02 L12 IM5610 missile left/right position
|
||||||
MS01 D8 IM5610 100pt tanks graphics
|
MS01 D8 IM5610 100pt tanks graphics
|
||||||
|
@ -669,13 +669,13 @@ WRITE16_MEMBER(twinkle_state::serial_w)
|
|||||||
|
|
||||||
WRITE8_MEMBER(twinkle_state::shared_psx_w)
|
WRITE8_MEMBER(twinkle_state::shared_psx_w)
|
||||||
{
|
{
|
||||||
// printf("shared_psx_w: %04x, %04x, %04x\n", offset, data, mem_mask);
|
// printf("shared_psx_w: %04x, %04x, %04x\n", offset, data, mem_mask);
|
||||||
|
|
||||||
m_spu_shared[offset] = data;
|
m_spu_shared[offset] = data;
|
||||||
|
|
||||||
if (offset == 0x03fe && data == 0xff)
|
if (offset == 0x03fe && data == 0xff)
|
||||||
{
|
{
|
||||||
// printf("spu command %02x %02x\n", m_spu_shared[1], m_spu_shared[3]);
|
// printf("spu command %02x %02x\n", m_spu_shared[1], m_spu_shared[3]);
|
||||||
|
|
||||||
m_audiocpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
|
m_audiocpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
|
||||||
}
|
}
|
||||||
@ -808,21 +808,21 @@ READ16_MEMBER(twinkle_state::shared_68k_r)
|
|||||||
{
|
{
|
||||||
UINT16 result = m_spu_shared[offset];
|
UINT16 result = m_spu_shared[offset];
|
||||||
|
|
||||||
// printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask);
|
// printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE16_MEMBER(twinkle_state::shared_68k_w)
|
WRITE16_MEMBER(twinkle_state::shared_68k_w)
|
||||||
{
|
{
|
||||||
// printf("shared_68k_w: %04x, %04x, %04x\n", offset, data, mem_mask);
|
// printf("shared_68k_w: %04x, %04x, %04x\n", offset, data, mem_mask);
|
||||||
|
|
||||||
m_spu_shared[offset] = data & 0xff;
|
m_spu_shared[offset] = data & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ16_MEMBER(twinkle_state::unk_68k_r)
|
READ16_MEMBER(twinkle_state::unk_68k_r)
|
||||||
{
|
{
|
||||||
return 0xffff; // must return 0xff for 68000 POST to complete properly
|
return 0xffff; // must return 0xff for 68000 POST to complete properly
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, twinkle_state )
|
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, twinkle_state )
|
||||||
@ -840,7 +840,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, twinkle_state )
|
|||||||
AM_RANGE(0x34000e, 0x34000f) AM_WRITENOP
|
AM_RANGE(0x34000e, 0x34000f) AM_WRITENOP
|
||||||
AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("rfsnd", rf5c400_device, rf5c400_r, rf5c400_w)
|
AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("rfsnd", rf5c400_device, rf5c400_r, rf5c400_w)
|
||||||
AM_RANGE(0x800000, 0xbfffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w )
|
AM_RANGE(0x800000, 0xbfffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w )
|
||||||
AM_RANGE(0xfe0000, 0xffffff) AM_RAM // ...and the RAM test checks this last 128k (mirror of the work RAM at 0x100000?)
|
AM_RANGE(0xfe0000, 0xffffff) AM_RAM // ...and the RAM test checks this last 128k (mirror of the work RAM at 0x100000?)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
/* SCSI */
|
/* SCSI */
|
||||||
|
@ -3535,4 +3535,3 @@ GAME( 1980, digger, 0, digger, digger, driver_device, 0, ROT270
|
|||||||
GAME( 1981, pulsar, 0, pulsar, pulsar, driver_device, 0, ROT270, "Sega", "Pulsar", GAME_IMPERFECT_SOUND )
|
GAME( 1981, pulsar, 0, pulsar, pulsar, driver_device, 0, ROT270, "Sega", "Pulsar", GAME_IMPERFECT_SOUND )
|
||||||
GAME( 1979, heiankyo, 0, heiankyo, heiankyo, driver_device, 0, ROT270, "Denki Onkyo", "Heiankyo Alien", GAME_NO_SOUND )
|
GAME( 1979, heiankyo, 0, heiankyo, heiankyo, driver_device, 0, ROT270, "Denki Onkyo", "Heiankyo Alien", GAME_NO_SOUND )
|
||||||
GAME( 19??, alphaho, 0, alphaho, alphaho, driver_device, 0, ROT270, "Data East Corporation", "Alpha Fighter / Head On", GAME_WRONG_COLORS | GAME_NO_SOUND )
|
GAME( 19??, alphaho, 0, alphaho, alphaho, driver_device, 0, ROT270, "Data East Corporation", "Alpha Fighter / Head On", GAME_WRONG_COLORS | GAME_NO_SOUND )
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ public:
|
|||||||
m_discrete(*this, "discrete"),
|
m_discrete(*this, "discrete"),
|
||||||
#else
|
#else
|
||||||
m_audio_snd0(*this, "snd_nl:snd0"),
|
m_audio_snd0(*this, "snd_nl:snd0"),
|
||||||
m_audio_snd7(*this, "snd_nl:snd7"),
|
m_audio_snd7(*this, "snd_nl:snd7"),
|
||||||
m_audio_dac(*this, "snd_nl:dac"),
|
m_audio_dac(*this, "snd_nl:dac"),
|
||||||
#endif
|
#endif
|
||||||
m_spriteram(*this, "spriteram"),
|
m_spriteram(*this, "spriteram"),
|
||||||
m_videoram(*this, "videoram"),
|
m_videoram(*this, "videoram"),
|
||||||
@ -71,8 +71,8 @@ public:
|
|||||||
optional_device<discrete_device> m_discrete;
|
optional_device<discrete_device> m_discrete;
|
||||||
#else
|
#else
|
||||||
optional_device<netlist_mame_logic_input_t> m_audio_snd0;
|
optional_device<netlist_mame_logic_input_t> m_audio_snd0;
|
||||||
optional_device<netlist_mame_logic_input_t> m_audio_snd7;
|
optional_device<netlist_mame_logic_input_t> m_audio_snd7;
|
||||||
optional_device<netlist_mame_logic_input_t> m_audio_dac;
|
optional_device<netlist_mame_logic_input_t> m_audio_dac;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* memory pointers */
|
/* memory pointers */
|
||||||
|
@ -61,4 +61,3 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,5 +155,5 @@
|
|||||||
<screen index="0">
|
<screen index="0">
|
||||||
<bounds x="320" y="0" width="320" height="240" />
|
<bounds x="320" y="0" width="320" height="240" />
|
||||||
</screen>
|
</screen>
|
||||||
</view>
|
</view>
|
||||||
</mamelayout>
|
</mamelayout>
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
/* Sega Compression (and possibly encryption) device
|
/* Sega Compression (and possibly encryption) device
|
||||||
|
|
||||||
315-5838 - Decathlete (ST-V)
|
315-5838 - Decathlete (ST-V)
|
||||||
317-0229 - Dead or Alive (Model 2A)
|
317-0229 - Dead or Alive (Model 2A)
|
||||||
|
|
||||||
Package Type: TQFP100
|
Package Type: TQFP100
|
||||||
|
|
||||||
This appears to be a dual channel compression chip, used in 1996, predating the 5881.
|
This appears to be a dual channel compression chip, used in 1996, predating the 5881.
|
||||||
Decathlete uses it to compress ALL the game graphics, Dead or Alive uses it for a
|
Decathlete uses it to compress ALL the game graphics, Dead or Alive uses it for a
|
||||||
dumb security check, decompressing a single string.
|
dumb security check, decompressing a single string.
|
||||||
|
|
||||||
Each channel appears to be connected to a different set of ROMs, however there is
|
Each channel appears to be connected to a different set of ROMs, however there is
|
||||||
defintiely only a single 315-5838 chip. (could the different channels actually just
|
defintiely only a single 315-5838 chip. (could the different channels actually just
|
||||||
be mirror addresses, with part of the address determining the ROMs to use?)
|
be mirror addresses, with part of the address determining the ROMs to use?)
|
||||||
|
|
||||||
Dead of Alive only uses a single channel, and has the source data in RAM, not ROM.
|
Dead of Alive only uses a single channel, and has the source data in RAM, not ROM.
|
||||||
This is similar to how some 5881 games were set up, with the ST-V versions decrypting
|
This is similar to how some 5881 games were set up, with the ST-V versions decrypting
|
||||||
data directly from ROM and the Model 2 ones using a RAM source buffer.
|
data directly from ROM and the Model 2 ones using a RAM source buffer.
|
||||||
|
|
||||||
Looking at the values read I don't think there is any address based encryption, for
|
Looking at the values read I don't think there is any address based encryption, for
|
||||||
example many blocks where you'd expect a zero fill start with repeating patterns
|
example many blocks where you'd expect a zero fill start with repeating patterns
|
||||||
of 8f708f70 (different lengths) channel would appear to relate to compressed 0x00 data
|
of 8f708f70 (different lengths) channel would appear to relate to compressed 0x00 data
|
||||||
|
|
||||||
read addr 0071253c, blah_r 8f708f70 - read count count 00000004
|
read addr 0071253c, blah_r 8f708f70 - read count count 00000004
|
||||||
read addr 00712540, blah_r 8f708f70 - read count count 00000008
|
read addr 00712540, blah_r 8f708f70 - read count count 00000008
|
||||||
read addr 00712544, blah_r 8f708f70 - read count count 0000000c
|
read addr 00712544, blah_r 8f708f70 - read count count 0000000c
|
||||||
read addr 00712548, blah_r 8f708f70 - read count count 00000010
|
read addr 00712548, blah_r 8f708f70 - read count count 00000010
|
||||||
read addr 0071254c, blah_r 8f708f70 - read count count 00000014
|
read addr 0071254c, blah_r 8f708f70 - read count count 00000014
|
||||||
read addr 00712550, blah_r 8f708f70 - read count count 00000018
|
read addr 00712550, blah_r 8f708f70 - read count count 00000018
|
||||||
read addr 00712554, blah_r 8f708f70 - read count count 0000001c
|
read addr 00712554, blah_r 8f708f70 - read count count 0000001c
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -95,8 +95,8 @@ READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot2_r)
|
|||||||
|
|
||||||
UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int channel)
|
UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int channel)
|
||||||
{
|
{
|
||||||
// UINT32 *fake0 = (UINT32*)memregion( ":fake0" )->base();
|
// UINT32 *fake0 = (UINT32*)memregion( ":fake0" )->base();
|
||||||
// UINT32 retvalue = 0xffff;
|
// UINT32 retvalue = 0xffff;
|
||||||
|
|
||||||
switch (m_channel[channel].m_srcoffset)
|
switch (m_channel[channel].m_srcoffset)
|
||||||
{
|
{
|
||||||
@ -177,7 +177,7 @@ UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int ch
|
|||||||
|
|
||||||
void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int channel)
|
void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int channel)
|
||||||
{
|
{
|
||||||
// printf("set_prot_addr\n");
|
// printf("set_prot_addr\n");
|
||||||
COMBINE_DATA(&m_channel[channel].m_srcoffset);
|
COMBINE_DATA(&m_channel[channel].m_srcoffset);
|
||||||
|
|
||||||
//if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",channel, m_channel[channel].m_decathlt_lastcount*4);
|
//if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",channel, m_channel[channel].m_decathlt_lastcount*4);
|
||||||
@ -361,6 +361,6 @@ void sega_315_5838_comp_device::install_doa_protection()
|
|||||||
cpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_w), this));
|
cpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_w), this));
|
||||||
cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff0, 0x01d87ff3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address (always set 0, data is in RAM)
|
cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff0, 0x01d87ff3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address (always set 0, data is in RAM)
|
||||||
cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff4, 0x01d87ff7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w_doa), this)); // upload tab
|
cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff4, 0x01d87ff7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w_doa), this)); // upload tab
|
||||||
// cpu->space(AS_PROGRAM).install_read_handler(0x01d87ff8, 0x01d87ffb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data
|
// cpu->space(AS_PROGRAM).install_read_handler(0x01d87ff8, 0x01d87ffb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data
|
||||||
|
|
||||||
}
|
}
|
@ -176,15 +176,15 @@ is given by the following function:
|
|||||||
|
|
||||||
void key2label(uint32_t key)
|
void key2label(uint32_t key)
|
||||||
{
|
{
|
||||||
int bcd0 = ((BIT(key,17)<<3)|(BIT(key,7)<<2)|(BIT(key,14)<<1)|BIT(key,19))^9;
|
int bcd0 = ((BIT(key,17)<<3)|(BIT(key,7)<<2)|(BIT(key,14)<<1)|BIT(key,19))^9;
|
||||||
int bcd1 = ((BIT(key,20)<<3)|(BIT(key,1)<<2)|(BIT(key,4)<<1)|BIT(key,13))^5;
|
int bcd1 = ((BIT(key,20)<<3)|(BIT(key,1)<<2)|(BIT(key,4)<<1)|BIT(key,13))^5;
|
||||||
int bcd2 = (BIT(key,9)<<1)|BIT(key,22);
|
int bcd2 = (BIT(key,9)<<1)|BIT(key,22);
|
||||||
int bcd3 = ((BIT(key,9)<<2)|BIT(key,9))^5;
|
int bcd3 = ((BIT(key,9)<<2)|BIT(key,9))^5;
|
||||||
|
|
||||||
char chiplabel[13];
|
char chiplabel[13];
|
||||||
sprintf(chiplabel, "317-%d%d%d%d-%s", bcd3, bcd2, bcd1, bcd0, (BIT(key,5)?"JPN":"COM"));
|
sprintf(chiplabel, "317-%d%d%d%d-%s", bcd3, bcd2, bcd1, bcd0, (BIT(key,5)?"JPN":"COM"));
|
||||||
|
|
||||||
printf("%s", chiplabel);
|
printf("%s", chiplabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
Given the use of the BCD-encoded security module labels, it's expected that at least other 6 additional bits be present in the
|
Given the use of the BCD-encoded security module labels, it's expected that at least other 6 additional bits be present in the
|
||||||
@ -680,7 +680,7 @@ UINT16 sega_315_5881_crypt_device::get_decrypted_16()
|
|||||||
|
|
||||||
prot_cur_address ++;
|
prot_cur_address ++;
|
||||||
|
|
||||||
// printf("get_decrypted_16 %04x\n", res);
|
// printf("get_decrypted_16 %04x\n", res);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -694,7 +694,7 @@ void sega_315_5881_crypt_device::enc_start()
|
|||||||
|
|
||||||
if (buffer_bit2 != 15) // if we have remaining bits in the decompression buffer we shouldn't read the next word yet but should instead use the bits we have?? (twcup98) (might just be because we should be pulling bytes not words?)
|
if (buffer_bit2 != 15) // if we have remaining bits in the decompression buffer we shouldn't read the next word yet but should instead use the bits we have?? (twcup98) (might just be because we should be pulling bytes not words?)
|
||||||
{
|
{
|
||||||
// printf("buffer_bit2 is %d\n", buffer_bit2);
|
// printf("buffer_bit2 is %d\n", buffer_bit2);
|
||||||
dec_header = (buffer2a & 0x0003) << 16;
|
dec_header = (buffer2a & 0x0003) << 16;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -824,8 +824,8 @@ const UINT8 sega_315_5881_crypt_device::trees[9][2][32] = {
|
|||||||
|
|
||||||
int sega_315_5881_crypt_device::get_compressed_bit()
|
int sega_315_5881_crypt_device::get_compressed_bit()
|
||||||
{
|
{
|
||||||
// if(buffer_pos == BUFFER_SIZE)
|
// if(buffer_pos == BUFFER_SIZE)
|
||||||
// enc_fill();
|
// enc_fill();
|
||||||
|
|
||||||
if (buffer_bit2 == 15)
|
if (buffer_bit2 == 15)
|
||||||
{
|
{
|
||||||
@ -833,7 +833,7 @@ int sega_315_5881_crypt_device::get_compressed_bit()
|
|||||||
buffer2a = get_decrypted_16();
|
buffer2a = get_decrypted_16();
|
||||||
buffer2[0] = buffer2a;
|
buffer2[0] = buffer2a;
|
||||||
buffer2[1] = buffer2a >> 8;
|
buffer2[1] = buffer2a >> 8;
|
||||||
// block_pos+=2;
|
// block_pos+=2;
|
||||||
buffer_pos = 0;
|
buffer_pos = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -842,7 +842,7 @@ int sega_315_5881_crypt_device::get_compressed_bit()
|
|||||||
buffer_bit2++;
|
buffer_bit2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (buffer_bit ==7) printf("using byte %02x\n", buffer2[(buffer_pos&1) ^ 1]);
|
// if (buffer_bit ==7) printf("using byte %02x\n", buffer2[(buffer_pos&1) ^ 1]);
|
||||||
|
|
||||||
int res = (buffer2[(buffer_pos&1)^1] >> buffer_bit) & 1;
|
int res = (buffer2[(buffer_pos&1)^1] >> buffer_bit) & 1;
|
||||||
buffer_bit--;
|
buffer_bit--;
|
||||||
|
@ -209,7 +209,7 @@ batman2 // bootleg
|
|||||||
warofbug // (c) 1981 Armenia
|
warofbug // (c) 1981 Armenia
|
||||||
warofbugu // (c) 1981 Armenia
|
warofbugu // (c) 1981 Armenia
|
||||||
warofbugg // German Version
|
warofbugg // German Version
|
||||||
spactrai //
|
spactrai //
|
||||||
redufo // (c) Artic
|
redufo // (c) Artic
|
||||||
redufob // bootleg
|
redufob // bootleg
|
||||||
exodus // Subelectro - bootleg?
|
exodus // Subelectro - bootleg?
|
||||||
@ -2679,7 +2679,7 @@ snowbrosj // MIN16-02 (c) 1990 Toaplan
|
|||||||
snowbrosd // MIN16-02 (c) 1990 Toaplan + Dooyong license
|
snowbrosd // MIN16-02 (c) 1990 Toaplan + Dooyong license
|
||||||
wintbob // bootleg
|
wintbob // bootleg
|
||||||
snowbroswb //
|
snowbroswb //
|
||||||
toto //
|
toto //
|
||||||
// modified snowbros 'clone' hardware
|
// modified snowbros 'clone' hardware
|
||||||
honeydol // (c) 1995 Barko Corp
|
honeydol // (c) 1995 Barko Corp
|
||||||
twinadv // (c) 1995 Barko Corp
|
twinadv // (c) 1995 Barko Corp
|
||||||
@ -3414,7 +3414,7 @@ ddsomur1 // 09/02/1996 (c) 1996 (USA)
|
|||||||
ddsomjr1 // 06/02/1996 (c) 1996 (Japan)
|
ddsomjr1 // 06/02/1996 (c) 1996 (Japan)
|
||||||
ddsomj // 19/06/1996 (c) 1996 (Japan)
|
ddsomj // 19/06/1996 (c) 1996 (Japan)
|
||||||
ddsoma // 19/06/1996 (c) 1996 (Asia)
|
ddsoma // 19/06/1996 (c) 1996 (Asia)
|
||||||
ddsomar1 // 08/02/1996 (c) 1996 (Asia)
|
ddsomar1 // 08/02/1996 (c) 1996 (Asia)
|
||||||
ddsomh // 23/02/1996 (c) 1996 (Hispanic)
|
ddsomh // 23/02/1996 (c) 1996 (Hispanic)
|
||||||
ddsomb // 23/02/1996 (c) 1996 (Brazil)
|
ddsomb // 23/02/1996 (c) 1996 (Brazil)
|
||||||
sfa2 // 06/03/1996 (c) 1996 (Euro)
|
sfa2 // 06/03/1996 (c) 1996 (Euro)
|
||||||
@ -5381,7 +5381,7 @@ wwfroyal // 2000.11 WWF Royal Rumble
|
|||||||
sprtjam // 2000.11.13 Sports Jam
|
sprtjam // 2000.11.13 Sports Jam
|
||||||
pjustic // 2000.12 Moero Justice Gakuen / Project Justice
|
pjustic // 2000.12 Moero Justice Gakuen / Project Justice
|
||||||
samba2k // 2000.12 Samba de Amigo Ver.2000
|
samba2k // 2000.12 Samba de Amigo Ver.2000
|
||||||
shaktam // 2000.12.28 Shakatto Tambourine (Rev B)
|
shaktam // 2000.12.28 Shakatto Tambourine (Rev B)
|
||||||
// 2000.?? Boat Race Ocean Heats
|
// 2000.?? Boat Race Ocean Heats
|
||||||
csmash // 2000.?? Cosmic Smash
|
csmash // 2000.?? Cosmic Smash
|
||||||
csmasho // 2000.?? Cosmic Smash (original)
|
csmasho // 2000.?? Cosmic Smash (original)
|
||||||
@ -6710,7 +6710,7 @@ bmfinal // GXC01 (c) 2002 (Japan)
|
|||||||
popn1 // GX803 (c) 1998 (Asia)
|
popn1 // GX803 (c) 1998 (Asia)
|
||||||
//popn1j // GX803 (c) 1998 (Japan)
|
//popn1j // GX803 (c) 1998 (Japan)
|
||||||
popn2 // GX831 (c) 1998 (Japan)
|
popn2 // GX831 (c) 1998 (Japan)
|
||||||
popn3 // GX980 (c) 1999 (Japan)
|
popn3 // GX980 (c) 1999 (Japan)
|
||||||
//popnstex // GX970 (c) 1999 (Japan)
|
//popnstex // GX970 (c) 1999 (Japan)
|
||||||
|
|
||||||
// Firebeat games
|
// Firebeat games
|
||||||
@ -6964,7 +6964,7 @@ quantum // 136016 (c) 1982 // made by Gencomp
|
|||||||
quantum1 // 136016 (c) 1982 // made by Gencomp
|
quantum1 // 136016 (c) 1982 // made by Gencomp
|
||||||
quantump // 136016 (c) 1982 // made by Gencomp
|
quantump // 136016 (c) 1982 // made by Gencomp
|
||||||
bwidow // 136017 (c) 1982
|
bwidow // 136017 (c) 1982
|
||||||
bwidowp // (proto) (c) 1982
|
bwidowp // (proto) (c) 1982
|
||||||
starwars // 136021 (c) 1983
|
starwars // 136021 (c) 1983
|
||||||
starwars1 // 136021 (c) 1983
|
starwars1 // 136021 (c) 1983
|
||||||
starwarso // 136021 (c) 1983
|
starwarso // 136021 (c) 1983
|
||||||
|
@ -175,7 +175,7 @@ DEVICE_ADDRESS_MAP_START( map, 16, gp9001vdp_device )
|
|||||||
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(gp9001_fg_tmap_w) AM_SHARE("vram_fg")
|
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(gp9001_fg_tmap_w) AM_SHARE("vram_fg")
|
||||||
AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(gp9001_top_tmap_w) AM_SHARE("vram_top")
|
AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(gp9001_top_tmap_w) AM_SHARE("vram_top")
|
||||||
AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") AM_MIRROR(0x0800)
|
AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") AM_MIRROR(0x0800)
|
||||||
// AM_RANGE(0x3800, 0x3fff) AM_RAM // sprite mirror?
|
// AM_RANGE(0x3800, 0x3fff) AM_RAM // sprite mirror?
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ UINT32 banctec_state::screen_update_banctec(screen_device &screen, bitmap_ind16
|
|||||||
|
|
||||||
MC6845_ON_UPDATE_ADDR_CHANGED(banctec_state::crtc_addr)
|
MC6845_ON_UPDATE_ADDR_CHANGED(banctec_state::crtc_addr)
|
||||||
{
|
{
|
||||||
/* What is this function meant to do ? */
|
/* What is this function meant to do ? */
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************
|
/******************************
|
||||||
@ -103,7 +103,7 @@ static MACHINE_CONFIG_START( banctec, banctec_state )
|
|||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", banctec)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", banctec)
|
||||||
MCFG_PALETTE_ADD("palette", 2)
|
MCFG_PALETTE_ADD("palette", 2)
|
||||||
// MCFG_PALETTE_INIT_OWNER(banctec_state, banctec)
|
// MCFG_PALETTE_INIT_OWNER(banctec_state, banctec)
|
||||||
|
|
||||||
MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_20MHz) /* (?) */
|
MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_20MHz) /* (?) */
|
||||||
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
||||||
|
@ -240,7 +240,7 @@ J9: unpopulated DIL 40-pin straight connector for a ROM debug/expansion/RAM-shad
|
|||||||
/HICE is !a15
|
/HICE is !a15
|
||||||
/ROM_OE comes from pin 14 of DECODE_E pal, and is shorted to /ROM_OE' by the cuttable jumper B1 which is not cut
|
/ROM_OE comes from pin 14 of DECODE_E pal, and is shorted to /ROM_OE' by the cuttable jumper B1 which is not cut
|
||||||
/ROM_OE' goes to the two EPROMS
|
/ROM_OE' goes to the two EPROMS
|
||||||
DECODE_18 is DECODE_E pal pin 18
|
DECODE_18 is DECODE_E pal pin 18
|
||||||
pin 1 (GND) is in the lower left and the pins count low-high then to the right
|
pin 1 (GND) is in the lower left and the pins count low-high then to the right
|
||||||
(gnd N/C E_CLK R/W /ROM_OE a17 vcc a14 a13 a8 a9 a11 /ROM_OE' a10 a15 d7 d6 d5 d4 d3 )
|
(gnd N/C E_CLK R/W /ROM_OE a17 vcc a14 a13 a8 a9 a11 /ROM_OE' a10 a15 d7 d6 d5 d4 d3 )
|
||||||
(GND /IPL1 DECODE_18 /RESET gnd a16 vcc a12 a7 a6 a5 a4 a3 a2 a1 a0 d0 d1 d2 gnd)
|
(GND /IPL1 DECODE_18 /RESET gnd a16 vcc a12 a7 a6 a5 a4 a3 a2 a1 a0 d0 d1 d2 gnd)
|
||||||
|
@ -53,19 +53,19 @@ private:
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
UINT8 reg[8];
|
UINT8 reg[8];
|
||||||
struct {
|
struct {
|
||||||
bool write;
|
bool write;
|
||||||
bool page2; // else page1
|
bool page2; // else page1
|
||||||
UINT8 ypos, xpos/*tennis*/;
|
UINT8 ypos, xpos/*tennis*/;
|
||||||
UINT8 data[2][0x100][0x20];
|
UINT8 data[2][0x100][0x20];
|
||||||
} bitmap;
|
} bitmap;
|
||||||
UINT8 x, y;
|
UINT8 x, y;
|
||||||
bool y_increment;
|
bool y_increment;
|
||||||
} video;
|
} video;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool set;
|
bool set;
|
||||||
int bit_shifter;
|
int bit_shifter;
|
||||||
UINT8 cartridge_byte;
|
UINT8 cartridge_byte;
|
||||||
UINT16 address; // in reality something more like short local cartridge address offset
|
UINT16 address; // in reality something more like short local cartridge address offset
|
||||||
@ -90,7 +90,7 @@ private:
|
|||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::gamate_cart_protection_w )
|
WRITE8_MEMBER( gamate_state::gamate_cart_protection_w )
|
||||||
{
|
{
|
||||||
logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
|
logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
|
||||||
|
|
||||||
switch (offset) {
|
switch (offset) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -105,11 +105,10 @@ WRITE8_MEMBER( gamate_state::gamate_cart_protection_w )
|
|||||||
}
|
}
|
||||||
READ8_MEMBER( gamate_state::gamate_cart_protection_r )
|
READ8_MEMBER( gamate_state::gamate_cart_protection_r )
|
||||||
{
|
{
|
||||||
|
UINT8 ret=1;
|
||||||
UINT8 ret=1;
|
if (card_protection.bit_shifter==7 && card_protection.unprotected) {
|
||||||
if (card_protection.bit_shifter==7 && card_protection.unprotected) {
|
ret=m_cart_ptr[bank_multi*0x4000];
|
||||||
ret=m_cart_ptr[bank_multi*0x4000];
|
} else {
|
||||||
} else {
|
|
||||||
card_protection.bit_shifter++;
|
card_protection.bit_shifter++;
|
||||||
if (card_protection.bit_shifter==8) {
|
if (card_protection.bit_shifter==8) {
|
||||||
card_protection.bit_shifter=0;
|
card_protection.bit_shifter=0;
|
||||||
@ -118,62 +117,62 @@ READ8_MEMBER( gamate_state::gamate_cart_protection_r )
|
|||||||
}
|
}
|
||||||
ret=(card_protection.cartridge_byte&0x80)?2:0;
|
ret=(card_protection.cartridge_byte&0x80)?2:0;
|
||||||
if (card_protection.bit_shifter==7 && !card_protection.failed) { // now protection chip on cartridge activates cartridge chip select on cpu accesses
|
if (card_protection.bit_shifter==7 && !card_protection.failed) { // now protection chip on cartridge activates cartridge chip select on cpu accesses
|
||||||
// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working
|
// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working
|
||||||
}
|
}
|
||||||
card_protection.cartridge_byte<<=1;
|
card_protection.cartridge_byte<<=1;
|
||||||
}
|
}
|
||||||
logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
|
logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( gamate_state::protection_r ) { return card_protection.set? 3: 1; } // bits 0 and 1 checked
|
READ8_MEMBER( gamate_state::protection_r ) { return card_protection.set? 3: 1; } // bits 0 and 1 checked
|
||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::protection_reset )
|
WRITE8_MEMBER( gamate_state::protection_reset )
|
||||||
{
|
{
|
||||||
// writes 0x20
|
// writes 0x20
|
||||||
card_protection.address=0x6005-0x6001;
|
card_protection.address=0x6005-0x6001;
|
||||||
card_protection.bit_shifter=0;
|
card_protection.bit_shifter=0;
|
||||||
card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++];
|
card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++];
|
||||||
card_protection.failed=false;
|
card_protection.failed=false;
|
||||||
card_protection.unprotected=false;
|
card_protection.unprotected=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( gamate_state::newer_protection_set )
|
READ8_MEMBER( gamate_state::newer_protection_set )
|
||||||
{
|
{
|
||||||
card_protection.set=true;
|
card_protection.set=true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::gamate_video_w )
|
WRITE8_MEMBER( gamate_state::gamate_video_w )
|
||||||
{
|
{
|
||||||
video.reg[offset]=data;
|
video.reg[offset]=data;
|
||||||
switch (offset) {
|
switch (offset) {
|
||||||
case 1: video.bitmap.write=data&0xc0; // more addressing mode
|
case 1: video.bitmap.write=data&0xc0; // more addressing mode
|
||||||
video.y_increment=data&0x40;
|
video.y_increment=data&0x40;
|
||||||
break;
|
break;
|
||||||
case 2: video.bitmap.xpos=data;break; // at least 7 bits
|
case 2: video.bitmap.xpos=data;break; // at least 7 bits
|
||||||
case 3: video.bitmap.ypos=data;break; // at least 7 bits
|
case 3: video.bitmap.ypos=data;break; // at least 7 bits
|
||||||
case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break;
|
case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break;
|
||||||
case 5: video.y=data;break;
|
case 5: video.y=data;break;
|
||||||
case 7:
|
case 7:
|
||||||
if (video.bitmap.write) {
|
if (video.bitmap.write) {
|
||||||
if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
|
if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
|
||||||
video.bitmap.data[video.bitmap.page2][video.y][video.x]=data;
|
video.bitmap.data[video.bitmap.page2][video.y][video.x]=data;
|
||||||
else
|
else
|
||||||
logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x);
|
logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x);
|
||||||
} else {
|
} else {
|
||||||
video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data;
|
video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data;
|
||||||
}
|
}
|
||||||
if (video.y_increment) video.y++;
|
if (video.y_increment) video.y++;
|
||||||
else video.x++;
|
else video.x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w )
|
WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w )
|
||||||
{
|
{
|
||||||
bank_multi=data;
|
bank_multi=data;
|
||||||
membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1);
|
membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::cart_bankswitch_w )
|
WRITE8_MEMBER( gamate_state::cart_bankswitch_w )
|
||||||
@ -184,55 +183,55 @@ WRITE8_MEMBER( gamate_state::cart_bankswitch_w )
|
|||||||
READ8_MEMBER( gamate_state::gamate_video_r )
|
READ8_MEMBER( gamate_state::gamate_video_r )
|
||||||
{
|
{
|
||||||
if (offset!=6) return 0;
|
if (offset!=6) return 0;
|
||||||
UINT8 data=0;
|
UINT8 data=0;
|
||||||
if (video.bitmap.write) {
|
if (video.bitmap.write) {
|
||||||
if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
|
if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
|
||||||
data=video.bitmap.data[video.bitmap.page2][video.y][video.x];
|
data=video.bitmap.data[video.bitmap.page2][video.y][video.x];
|
||||||
else
|
else
|
||||||
logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x);
|
logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x);
|
||||||
} else {
|
} else {
|
||||||
data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)];
|
data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)];
|
||||||
}
|
}
|
||||||
if (m_maincpu->pc()<0xf000)
|
if (m_maincpu->pc()<0xf000)
|
||||||
logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data);
|
logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER( gamate_state::gamate_audio_w )
|
WRITE8_MEMBER( gamate_state::gamate_audio_w )
|
||||||
{
|
{
|
||||||
logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data);
|
logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data);
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( gamate_state::gamate_audio_r )
|
READ8_MEMBER( gamate_state::gamate_audio_r )
|
||||||
{
|
{
|
||||||
logerror("%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset);
|
logerror("%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ8_MEMBER( gamate_state::gamate_pad_r )
|
READ8_MEMBER( gamate_state::gamate_pad_r )
|
||||||
{
|
{
|
||||||
UINT8 data=m_io_joy->read();
|
UINT8 data=m_io_joy->read();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state )
|
static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state )
|
||||||
AM_RANGE(0x0000, 0x03ff) AM_RAM
|
AM_RANGE(0x0000, 0x03ff) AM_RAM
|
||||||
AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w)
|
AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w)
|
||||||
AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r)
|
AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r)
|
||||||
AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w)
|
AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w)
|
||||||
AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set)
|
AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set)
|
||||||
AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset)
|
AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset)
|
||||||
AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r)
|
AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r)
|
||||||
|
|
||||||
AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti")
|
AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti")
|
||||||
AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank")
|
AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank")
|
||||||
|
|
||||||
AM_RANGE(0x6000, 0x6000) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w)
|
AM_RANGE(0x6000, 0x6000) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w)
|
||||||
AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w)
|
AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w)
|
||||||
AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w)
|
AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w)
|
||||||
|
|
||||||
AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios")
|
AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios")
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
|
||||||
@ -251,30 +250,30 @@ INPUT_PORTS_END
|
|||||||
#ifdef USE_GFX
|
#ifdef USE_GFX
|
||||||
static const struct gfx_layout gamate_charlayout =
|
static const struct gfx_layout gamate_charlayout =
|
||||||
{
|
{
|
||||||
4, /* width of object */
|
4, /* width of object */
|
||||||
1, /* height of object */
|
1, /* height of object */
|
||||||
256,/* 256 characters */
|
256,/* 256 characters */
|
||||||
2, /* bits per pixel */
|
2, /* bits per pixel */
|
||||||
{ 0,4 }, /* no bitplanes */
|
{ 0,4 }, /* no bitplanes */
|
||||||
/* x offsets */
|
/* x offsets */
|
||||||
{ 0,1,2,3 },
|
{ 0,1,2,3 },
|
||||||
/* y offsets */
|
/* y offsets */
|
||||||
{ 0 },
|
{ 0 },
|
||||||
8*1 /* size of 1 object in bits */
|
8*1 /* size of 1 object in bits */
|
||||||
};
|
};
|
||||||
|
|
||||||
static GFXDECODE_START( gamate )
|
static GFXDECODE_START( gamate )
|
||||||
GFXDECODE_ENTRY( "gfx1", 0x0000, gamate_charlayout, 0, 0x100 )
|
GFXDECODE_ENTRY( "gfx1", 0x0000, gamate_charlayout, 0, 0x100 )
|
||||||
GFXDECODE_END
|
GFXDECODE_END
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* palette in red, green, blue tribles */
|
/* palette in red, green, blue tribles */
|
||||||
static const unsigned char gamate_colors[4][3] =
|
static const unsigned char gamate_colors[4][3] =
|
||||||
{
|
{
|
||||||
{ 255,255,255 },
|
{ 255,255,255 },
|
||||||
{ 0xa0, 0xa0, 0xa0 },
|
{ 0xa0, 0xa0, 0xa0 },
|
||||||
{ 0x60, 0x60, 0x60 },
|
{ 0x60, 0x60, 0x60 },
|
||||||
{ 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
PALETTE_INIT_MEMBER(gamate_state, gamate)
|
PALETTE_INIT_MEMBER(gamate_state, gamate)
|
||||||
@ -299,21 +298,21 @@ static void BlitPlane(UINT16* line, UINT8 plane1, UINT8 plane2)
|
|||||||
|
|
||||||
UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
int x, y, j;
|
int x, y, j;
|
||||||
for (y=0;y<152;y++) {
|
for (y=0;y<152;y++) {
|
||||||
for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) {
|
for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) {
|
||||||
UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
|
UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
|
||||||
UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
|
UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
|
||||||
#ifdef USE_GFX
|
#ifdef USE_GFX
|
||||||
m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1&0xf)|((d2&0xf)<<4), 0,0,0,x+4,y);
|
m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1&0xf)|((d2&0xf)<<4), 0,0,0,x+4,y);
|
||||||
m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1>>4)|(d2&0xf0),0,0,0,x,y);
|
m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1>>4)|(d2&0xf0),0,0,0,x,y);
|
||||||
#else
|
#else
|
||||||
BlitPlane(&bitmap.pix16(y, x+4), d1, d2);
|
BlitPlane(&bitmap.pix16(y, x+4), d1, d2);
|
||||||
BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4);
|
BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DRIVER_INIT_MEMBER(gamate_state,gamate)
|
DRIVER_INIT_MEMBER(gamate_state,gamate)
|
||||||
@ -332,12 +331,12 @@ void gamate_state::machine_start()
|
|||||||
{
|
{
|
||||||
m_cart_ptr = memregion("maincpu")->base() + 0x6000;
|
m_cart_ptr = memregion("maincpu")->base() + 0x6000;
|
||||||
if (m_cart->exists()) {
|
if (m_cart->exists()) {
|
||||||
// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r));
|
// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r));
|
||||||
m_cart_ptr = m_cart->get_rom_base();
|
m_cart_ptr = m_cart->get_rom_base();
|
||||||
membank("bankmulti")->set_base(m_cart->get_rom_base()+1);
|
membank("bankmulti")->set_base(m_cart->get_rom_base()+1);
|
||||||
membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset
|
membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset
|
||||||
}
|
}
|
||||||
// m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback
|
// m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback
|
||||||
card_protection.set=false;
|
card_protection.set=false;
|
||||||
bank_multi=0;
|
bank_multi=0;
|
||||||
card_protection.unprotected=false;
|
card_protection.unprotected=false;
|
||||||
@ -416,5 +415,3 @@ ROM_END
|
|||||||
|
|
||||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */
|
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */
|
||||||
CONS( 19??, gamate, 0, 0, gamate, gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_NO_SOUND)
|
CONS( 19??, gamate, 0, 0, gamate, gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_NO_SOUND)
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
MC68000 @ 10 MHz
|
MC68000 @ 10 MHz
|
||||||
MC68A45 CRTC
|
MC68A45 CRTC
|
||||||
Z0765A08PSC floppy controller (NEC765 type)
|
Z0765A08PSC floppy controller (NEC765 type)
|
||||||
TMS9914A GPIB bus interface
|
TMS9914A GPIB bus interface
|
||||||
SCN2661 DUART/timer
|
SCN2661 DUART/timer
|
||||||
|
|
||||||
16500b:
|
16500b:
|
||||||
@ -50,10 +50,10 @@
|
|||||||
#include "video/mc6845.h"
|
#include "video/mc6845.h"
|
||||||
#include "machine/mc68681.h"
|
#include "machine/mc68681.h"
|
||||||
|
|
||||||
#define MAINCPU_TAG "maincpu"
|
#define MAINCPU_TAG "maincpu"
|
||||||
#define CRTC_TAG "crtc"
|
#define CRTC_TAG "crtc"
|
||||||
#define SCREEN_TAG "screen"
|
#define SCREEN_TAG "screen"
|
||||||
#define DUART_TAG "duart"
|
#define DUART_TAG "duart"
|
||||||
|
|
||||||
class hp16500_state : public driver_device
|
class hp16500_state : public driver_device
|
||||||
{
|
{
|
||||||
|
@ -16,20 +16,20 @@
|
|||||||
MC68881 FPU
|
MC68881 FPU
|
||||||
|
|
||||||
330:
|
330:
|
||||||
MC68020 CPU @ 16.67 MHz
|
MC68020 CPU @ 16.67 MHz
|
||||||
MC68851 MMU
|
MC68851 MMU
|
||||||
MC68881 FPU
|
MC68881 FPU
|
||||||
|
|
||||||
340:
|
340:
|
||||||
MC68030 CPU @ 16.67 MHz w/built-in MMU
|
MC68030 CPU @ 16.67 MHz w/built-in MMU
|
||||||
MC68881 FPU
|
MC68881 FPU
|
||||||
|
|
||||||
380:
|
380:
|
||||||
MC68040 CPU @ 25 MHz w/built-in MMU and FPU
|
MC68040 CPU @ 25 MHz w/built-in MMU and FPU
|
||||||
|
|
||||||
382:
|
382:
|
||||||
MC68040 CPU @ 25? MHz w/built-in MMU and FPU
|
MC68040 CPU @ 25? MHz w/built-in MMU and FPU
|
||||||
Built-in VGA compatible video
|
Built-in VGA compatible video
|
||||||
|
|
||||||
All models have an MC6840 PIT on IRQ6 clocked at 250 kHz.
|
All models have an MC6840 PIT on IRQ6 clocked at 250 kHz.
|
||||||
|
|
||||||
@ -132,28 +132,28 @@ UINT32 hp9k3xx_state::hp98544_update(screen_device &screen, bitmap_rgb32 &bitmap
|
|||||||
|
|
||||||
// shared mappings for all 9000/3xx systems
|
// shared mappings for all 9000/3xx systems
|
||||||
static ADDRESS_MAP_START(hp9k3xx_common, AS_PROGRAM, 32, hp9k3xx_state)
|
static ADDRESS_MAP_START(hp9k3xx_common, AS_PROGRAM, 32, hp9k3xx_state)
|
||||||
AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED
|
AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED
|
||||||
|
|
||||||
AM_RANGE(0x00500000, 0x0050000f) AM_RAM // this is sufficient to pass the DMA test for now
|
AM_RANGE(0x00500000, 0x0050000f) AM_RAM // this is sufficient to pass the DMA test for now
|
||||||
|
|
||||||
AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display"
|
AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display"
|
||||||
AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics"
|
AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics"
|
||||||
AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor
|
AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor
|
||||||
AM_RANGE(0x005f8000, 0x005f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff00ff)
|
AM_RANGE(0x005f8000, 0x005f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff00ff)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
// 9000/310 - has onboard video that the graphics card used in other 3xxes conflicts with
|
// 9000/310 - has onboard video that the graphics card used in other 3xxes conflicts with
|
||||||
static ADDRESS_MAP_START(hp9k310_map, AS_PROGRAM, 16, hp9k3xx_state)
|
static ADDRESS_MAP_START(hp9k310_map, AS_PROGRAM, 16, hp9k3xx_state)
|
||||||
AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED
|
AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED
|
||||||
|
|
||||||
AM_RANGE(0x510000, 0x510003) AM_READWRITE(buserror16_r, buserror16_w) // no "Alpha display"
|
AM_RANGE(0x510000, 0x510003) AM_READWRITE(buserror16_r, buserror16_w) // no "Alpha display"
|
||||||
AM_RANGE(0x538000, 0x538003) AM_READWRITE(buserror16_r, buserror16_w) // no "Graphics"
|
AM_RANGE(0x538000, 0x538003) AM_READWRITE(buserror16_r, buserror16_w) // no "Graphics"
|
||||||
AM_RANGE(0x5c0000, 0x5c0003) AM_READWRITE(buserror16_r, buserror16_w) // no add-on FP coprocessor
|
AM_RANGE(0x5c0000, 0x5c0003) AM_READWRITE(buserror16_r, buserror16_w) // no add-on FP coprocessor
|
||||||
|
|
||||||
AM_RANGE(0x5f8000, 0x5f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff)
|
AM_RANGE(0x5f8000, 0x5f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff)
|
||||||
|
|
||||||
AM_RANGE(0x200000, 0x2fffff) AM_RAM AM_SHARE("vram16") // 98544 mono framebuffer
|
AM_RANGE(0x200000, 0x2fffff) AM_RAM AM_SHARE("vram16") // 98544 mono framebuffer
|
||||||
AM_RANGE(0x560000, 0x563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
AM_RANGE(0x560000, 0x563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
||||||
|
|
||||||
AM_RANGE(0x700000, 0x7fffff) AM_READWRITE(buserror16_r, buserror16_w)
|
AM_RANGE(0x700000, 0x7fffff) AM_READWRITE(buserror16_r, buserror16_w)
|
||||||
AM_RANGE(0x800000, 0xffffff) AM_RAM
|
AM_RANGE(0x800000, 0xffffff) AM_RAM
|
||||||
@ -161,8 +161,8 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
// 9000/320
|
// 9000/320
|
||||||
static ADDRESS_MAP_START(hp9k320_map, AS_PROGRAM, 32, hp9k3xx_state)
|
static ADDRESS_MAP_START(hp9k320_map, AS_PROGRAM, 32, hp9k3xx_state)
|
||||||
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
||||||
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
||||||
|
|
||||||
AM_RANGE(0xffe00000, 0xffefffff) AM_READWRITE(buserror_r, buserror_w)
|
AM_RANGE(0xffe00000, 0xffefffff) AM_READWRITE(buserror_r, buserror_w)
|
||||||
AM_RANGE(0xfff00000, 0xffffffff) AM_RAM
|
AM_RANGE(0xfff00000, 0xffffffff) AM_RAM
|
||||||
@ -172,8 +172,8 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
// 9000/330 and 9000/340
|
// 9000/330 and 9000/340
|
||||||
static ADDRESS_MAP_START(hp9k330_map, AS_PROGRAM, 32, hp9k3xx_state)
|
static ADDRESS_MAP_START(hp9k330_map, AS_PROGRAM, 32, hp9k3xx_state)
|
||||||
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
||||||
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
||||||
|
|
||||||
AM_RANGE(0xffb00000, 0xffbfffff) AM_READWRITE(buserror_r, buserror_w)
|
AM_RANGE(0xffb00000, 0xffbfffff) AM_READWRITE(buserror_r, buserror_w)
|
||||||
AM_RANGE(0xffc00000, 0xffffffff) AM_RAM
|
AM_RANGE(0xffc00000, 0xffffffff) AM_RAM
|
||||||
@ -183,8 +183,8 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
// 9000/370 - 8 MB RAM standard
|
// 9000/370 - 8 MB RAM standard
|
||||||
static ADDRESS_MAP_START(hp9k370_map, AS_PROGRAM, 32, hp9k3xx_state)
|
static ADDRESS_MAP_START(hp9k370_map, AS_PROGRAM, 32, hp9k3xx_state)
|
||||||
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer
|
||||||
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM
|
||||||
|
|
||||||
AM_RANGE(0xff700000, 0xff7fffff) AM_READWRITE(buserror_r, buserror_w)
|
AM_RANGE(0xff700000, 0xff7fffff) AM_READWRITE(buserror_r, buserror_w)
|
||||||
AM_RANGE(0xff800000, 0xffffffff) AM_RAM
|
AM_RANGE(0xff800000, 0xffffffff) AM_RAM
|
||||||
@ -292,7 +292,7 @@ static MACHINE_CONFIG_START( hp9k310, hp9k3xx_state )
|
|||||||
MCFG_CPU_PROGRAM_MAP(hp9k310_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k310_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -308,7 +308,7 @@ static MACHINE_CONFIG_START( hp9k320, hp9k3xx_state )
|
|||||||
MCFG_CPU_PROGRAM_MAP(hp9k320_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k320_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -324,7 +324,7 @@ static MACHINE_CONFIG_START( hp9k330, hp9k3xx_state )
|
|||||||
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -340,7 +340,7 @@ static MACHINE_CONFIG_START( hp9k340, hp9k3xx_state )
|
|||||||
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -356,7 +356,7 @@ static MACHINE_CONFIG_START( hp9k370, hp9k3xx_state )
|
|||||||
MCFG_CPU_PROGRAM_MAP(hp9k370_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k370_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -368,11 +368,11 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
static MACHINE_CONFIG_START( hp9k380, hp9k3xx_state )
|
static MACHINE_CONFIG_START( hp9k380, hp9k3xx_state )
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33?
|
MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33?
|
||||||
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k330_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
@ -384,11 +384,11 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
static MACHINE_CONFIG_START( hp9k382, hp9k3xx_state )
|
static MACHINE_CONFIG_START( hp9k382, hp9k3xx_state )
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33?
|
MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33?
|
||||||
MCFG_CPU_PROGRAM_MAP(hp9k382_map)
|
MCFG_CPU_PROGRAM_MAP(hp9k382_map)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0)
|
||||||
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840
|
||||||
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f)
|
||||||
|
|
||||||
MCFG_SCREEN_ADD( "screen", RASTER)
|
MCFG_SCREEN_ADD( "screen", RASTER)
|
||||||
|
@ -739,13 +739,13 @@ static ADDRESS_MAP_START( ngen_io, AS_IO, 16, ngen_state )
|
|||||||
AM_RANGE(0x0000, 0x0001) AM_READWRITE(xbus_r,xbus_w)
|
AM_RANGE(0x0000, 0x0001) AM_READWRITE(xbus_r,xbus_w)
|
||||||
|
|
||||||
// Floppy/Hard disk module
|
// Floppy/Hard disk module
|
||||||
// AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff) // a guess for now
|
// AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff) // a guess for now
|
||||||
// AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff)
|
// AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff)
|
||||||
// AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff)
|
// AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff)
|
||||||
// AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff) // X-Bus extended address register
|
// AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff) // X-Bus extended address register
|
||||||
// AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff)
|
// AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff)
|
||||||
// 0x0120-0x012f - WD1010 Winchester disk controller (unemulated)
|
// 0x0120-0x012f - WD1010 Winchester disk controller (unemulated)
|
||||||
// AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff)
|
// AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff)
|
||||||
|
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
@ -851,7 +851,7 @@ static MACHINE_CONFIG_START( ngen, ngen_state )
|
|||||||
|
|
||||||
// keyboard UART (patent says i8251 is used for keyboard communications, it is located on the video board)
|
// keyboard UART (patent says i8251 is used for keyboard communications, it is located on the video board)
|
||||||
MCFG_DEVICE_ADD("videouart", I8251, 0) // main clock unknown, Rx/Tx clocks are 19.53kHz
|
MCFG_DEVICE_ADD("videouart", I8251, 0) // main clock unknown, Rx/Tx clocks are 19.53kHz
|
||||||
// MCFG_I8251_TXEMPTY_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
|
// MCFG_I8251_TXEMPTY_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w))
|
||||||
MCFG_I8251_TXD_HANDLER(DEVWRITELINE("keyboard", rs232_port_device, write_txd))
|
MCFG_I8251_TXD_HANDLER(DEVWRITELINE("keyboard", rs232_port_device, write_txd))
|
||||||
MCFG_RS232_PORT_ADD("keyboard", keyboard, "ngen")
|
MCFG_RS232_PORT_ADD("keyboard", keyboard, "ngen")
|
||||||
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("videouart", i8251_device, write_rxd))
|
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("videouart", i8251_device, write_rxd))
|
||||||
|
@ -681,7 +681,7 @@ void pasogo_state::machine_reset()
|
|||||||
astring region_tag;
|
astring region_tag;
|
||||||
m_maincpu_rom = memregion("maincpu");
|
m_maincpu_rom = memregion("maincpu");
|
||||||
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
||||||
if (!m_cart_rom) // this should never happen, since we make carts mandatory!
|
if (!m_cart_rom) // this should never happen, since we make carts mandatory!
|
||||||
m_cart_rom = memregion("maincpu");
|
m_cart_rom = memregion("maincpu");
|
||||||
|
|
||||||
membank("bank27")->set_base(m_cart_rom->base());
|
membank("bank27")->set_base(m_cart_rom->base());
|
||||||
|
@ -291,9 +291,9 @@ public:
|
|||||||
INT32 m_adb_linestate;
|
INT32 m_adb_linestate;
|
||||||
bool m_adb_srqflag;
|
bool m_adb_srqflag;
|
||||||
#define kADBKeyBufSize 32
|
#define kADBKeyBufSize 32
|
||||||
UINT8 m_adb_keybuf[kADBKeyBufSize];
|
UINT8 m_adb_keybuf[kADBKeyBufSize];
|
||||||
UINT8 m_adb_keybuf_start;
|
UINT8 m_adb_keybuf_start;
|
||||||
UINT8 m_adb_keybuf_end;
|
UINT8 m_adb_keybuf_end;
|
||||||
|
|
||||||
// Portable/PB100 Power Manager IC comms (chapter 4, "Guide to the Macintosh Family Hardware", second edition)
|
// Portable/PB100 Power Manager IC comms (chapter 4, "Guide to the Macintosh Family Hardware", second edition)
|
||||||
UINT8 m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state;
|
UINT8 m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state;
|
||||||
|
@ -3034,7 +3034,7 @@ MACHINE_START_MEMBER(amstrad_state,plus)
|
|||||||
|
|
||||||
astring region_tag;
|
astring region_tag;
|
||||||
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
||||||
if (!m_region_cart) // this should never happen, since we make carts mandatory!
|
if (!m_region_cart) // this should never happen, since we make carts mandatory!
|
||||||
m_region_cart = memregion("maincpu");
|
m_region_cart = memregion("maincpu");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3078,7 +3078,7 @@ MACHINE_START_MEMBER(amstrad_state,gx4000)
|
|||||||
|
|
||||||
astring region_tag;
|
astring region_tag;
|
||||||
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
|
||||||
if (!m_region_cart) // this should never happen, since we make carts mandatory!
|
if (!m_region_cart) // this should never happen, since we make carts mandatory!
|
||||||
m_region_cart = memregion("maincpu");
|
m_region_cart = memregion("maincpu");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ void mac_state::adb_talk()
|
|||||||
{
|
{
|
||||||
if(m_adb_keybuf_start == m_adb_keybuf_end)
|
if(m_adb_keybuf_start == m_adb_keybuf_end)
|
||||||
{
|
{
|
||||||
// printf("%s: buffer empty\n", __func__);
|
// printf("%s: buffer empty\n", __func__);
|
||||||
m_adb_buffer[0] = 0xff;
|
m_adb_buffer[0] = 0xff;
|
||||||
m_adb_buffer[1] = 0xff;
|
m_adb_buffer[1] = 0xff;
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,11 @@ class debug_module
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~debug_module() { }
|
virtual ~debug_module() { }
|
||||||
|
|
||||||
virtual void init_debugger(running_machine &machine) = 0;
|
virtual void init_debugger(running_machine &machine) = 0;
|
||||||
virtual void wait_for_debugger(device_t &device, bool firststop) = 0;
|
virtual void wait_for_debugger(device_t &device, bool firststop) = 0;
|
||||||
virtual void debugger_update() = 0;
|
virtual void debugger_update() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,23 +27,23 @@
|
|||||||
class debug_internal : public osd_module, public debug_module
|
class debug_internal : public osd_module, public debug_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
debug_internal()
|
debug_internal()
|
||||||
: osd_module(OSD_DEBUG_PROVIDER, "internal"), debug_module(),
|
: osd_module(OSD_DEBUG_PROVIDER, "internal"), debug_module(),
|
||||||
m_machine(NULL)
|
m_machine(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~debug_internal() { }
|
virtual ~debug_internal() { }
|
||||||
|
|
||||||
virtual int init() { return 0;}
|
virtual int init() { return 0;}
|
||||||
virtual void exit();
|
virtual void exit();
|
||||||
|
|
||||||
virtual void init_debugger(running_machine &machine);
|
virtual void init_debugger(running_machine &machine);
|
||||||
virtual void wait_for_debugger(device_t &device, bool firststop);
|
virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||||
virtual void debugger_update();
|
virtual void debugger_update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
running_machine *m_machine;
|
running_machine *m_machine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,23 +37,23 @@
|
|||||||
class debug_qt : public osd_module, public debug_module
|
class debug_qt : public osd_module, public debug_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
debug_qt()
|
debug_qt()
|
||||||
: osd_module(OSD_DEBUG_PROVIDER, "qt"), debug_module(),
|
: osd_module(OSD_DEBUG_PROVIDER, "qt"), debug_module(),
|
||||||
m_machine(NULL)
|
m_machine(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~debug_qt() { }
|
virtual ~debug_qt() { }
|
||||||
|
|
||||||
virtual int init() { return 0;}
|
virtual int init() { return 0;}
|
||||||
virtual void exit() { }
|
virtual void exit() { }
|
||||||
|
|
||||||
virtual void init_debugger(running_machine &machine);
|
virtual void init_debugger(running_machine &machine);
|
||||||
virtual void wait_for_debugger(device_t &device, bool firststop);
|
virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||||
virtual void debugger_update();
|
virtual void debugger_update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
running_machine *m_machine;
|
running_machine *m_machine;
|
||||||
};
|
};
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
@ -357,7 +357,7 @@ void debug_qt::debugger_update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* SDLMAME_UNIX */
|
#else /* SDLMAME_UNIX */
|
||||||
MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt")
|
MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_DEFINITION(DEBUG_QT, debug_qt)
|
MODULE_DEFINITION(DEBUG_QT, debug_qt)
|
||||||
|
@ -44,23 +44,23 @@
|
|||||||
class debugger_windows : public osd_module, public debug_module
|
class debugger_windows : public osd_module, public debug_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
debugger_windows()
|
debugger_windows()
|
||||||
: osd_module(OSD_DEBUG_PROVIDER, "windows"), debug_module(),
|
: osd_module(OSD_DEBUG_PROVIDER, "windows"), debug_module(),
|
||||||
m_machine(NULL)
|
m_machine(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~debugger_windows() { }
|
virtual ~debugger_windows() { }
|
||||||
|
|
||||||
virtual int init() { return 0;}
|
virtual int init() { return 0;}
|
||||||
virtual void exit();
|
virtual void exit();
|
||||||
|
|
||||||
virtual void init_debugger(running_machine &machine);
|
virtual void init_debugger(running_machine &machine);
|
||||||
virtual void wait_for_debugger(device_t &device, bool firststop);
|
virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||||
virtual void debugger_update();
|
virtual void debugger_update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
running_machine *m_machine;
|
running_machine *m_machine;
|
||||||
};
|
};
|
||||||
//============================================================
|
//============================================================
|
||||||
// PARAMETERS
|
// PARAMETERS
|
||||||
@ -3094,7 +3094,7 @@ static void smart_show_all(BOOL show)
|
|||||||
smart_show_window(info->wnd, show);
|
smart_show_window(info->wnd, show);
|
||||||
}
|
}
|
||||||
#else /* not windows */
|
#else /* not windows */
|
||||||
MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows")
|
MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_DEFINITION(DEBUG_WINDOWS, debugger_windows)
|
MODULE_DEFINITION(DEBUG_WINDOWS, debugger_windows)
|
||||||
|
@ -12,28 +12,28 @@
|
|||||||
class debug_none : public osd_module, public debug_module
|
class debug_none : public osd_module, public debug_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
debug_none()
|
debug_none()
|
||||||
: osd_module(OSD_DEBUG_PROVIDER, "none"), debug_module(),
|
: osd_module(OSD_DEBUG_PROVIDER, "none"), debug_module(),
|
||||||
m_machine(NULL)
|
m_machine(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~debug_none() { }
|
virtual ~debug_none() { }
|
||||||
|
|
||||||
virtual int init() { return 0;}
|
virtual int init() { return 0;}
|
||||||
virtual void exit() { }
|
virtual void exit() { }
|
||||||
|
|
||||||
virtual void init_debugger(running_machine &machine);
|
virtual void init_debugger(running_machine &machine);
|
||||||
virtual void wait_for_debugger(device_t &device, bool firststop);
|
virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||||
virtual void debugger_update();
|
virtual void debugger_update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
running_machine *m_machine;
|
running_machine *m_machine;
|
||||||
};
|
};
|
||||||
|
|
||||||
void debug_none::init_debugger(running_machine &machine)
|
void debug_none::init_debugger(running_machine &machine)
|
||||||
{
|
{
|
||||||
m_machine = &machine;
|
m_machine = &machine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug_none::wait_for_debugger(device_t &device, bool firststop)
|
void debug_none::wait_for_debugger(device_t &device, bool firststop)
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
class font_module
|
class font_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~font_module() { }
|
virtual ~font_module() { }
|
||||||
virtual osd_font *font_alloc() = 0;
|
virtual osd_font *font_alloc() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
class osd_font_none : public osd_font
|
class osd_font_none : public osd_font
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~osd_font_none() {};
|
virtual ~osd_font_none() {};
|
||||||
|
|
||||||
virtual bool open(const char *font_path, const char *name, int &height);
|
virtual bool open(const char *font_path, const char *name, int &height);
|
||||||
virtual void close();
|
virtual void close();
|
||||||
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
bool osd_font_none::open(const char *font_path, const char *_name, int &height)
|
bool osd_font_none::open(const char *font_path, const char *_name, int &height)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -46,22 +46,21 @@ void osd_font_none::close()
|
|||||||
|
|
||||||
bool osd_font_none::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
bool osd_font_none::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
class font_none : public osd_module, public font_module
|
class font_none : public osd_module, public font_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
font_none()
|
font_none()
|
||||||
: osd_module(OSD_FONT_PROVIDER, "none"), font_module()
|
: osd_module(OSD_FONT_PROVIDER, "none"), font_module()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_font *font_alloc()
|
osd_font *font_alloc()
|
||||||
{
|
{
|
||||||
return global_alloc(osd_font_none);
|
return global_alloc(osd_font_none);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_DEFINITION(FONT_NONE, font_none)
|
MODULE_DEFINITION(FONT_NONE, font_none)
|
||||||
|
|
||||||
|
@ -26,71 +26,71 @@
|
|||||||
class osd_font_osx : public osd_font
|
class osd_font_osx : public osd_font
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~osd_font_osx() {};
|
virtual ~osd_font_osx() {};
|
||||||
|
|
||||||
virtual bool open(const char *font_path, const char *name, int &height);
|
virtual bool open(const char *font_path, const char *name, int &height);
|
||||||
virtual void close();
|
virtual void close();
|
||||||
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
||||||
private:
|
private:
|
||||||
CTFontRef m_font;
|
CTFontRef m_font;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
|
bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
|
||||||
{
|
{
|
||||||
CFStringRef font_name = NULL;
|
CFStringRef font_name = NULL;
|
||||||
CTFontRef ct_font = NULL;
|
CTFontRef ct_font = NULL;
|
||||||
CTFontDescriptorRef font_descriptor;
|
CTFontDescriptorRef font_descriptor;
|
||||||
CGAffineTransform affine_transform = CGAffineTransformIdentity;
|
CGAffineTransform affine_transform = CGAffineTransformIdentity;
|
||||||
|
|
||||||
m_font = NULL;
|
m_font = NULL;
|
||||||
astring name(_name);
|
astring name(_name);
|
||||||
printf("FONT NAME %s\n", _name);
|
printf("FONT NAME %s\n", _name);
|
||||||
#if 0
|
#if 0
|
||||||
if (name == "default")
|
if (name == "default")
|
||||||
{
|
{
|
||||||
name = "LucidaGrande";
|
name = "LucidaGrande";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* handle bdf fonts in the core */
|
/* handle bdf fonts in the core */
|
||||||
if (name.len() > 4)
|
if (name.len() > 4)
|
||||||
if (name.makeupper().substr(name.len()-4,4) == ".BDF" )
|
if (name.makeupper().substr(name.len()-4,4) == ".BDF" )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
font_name = CFStringCreateWithCString( NULL, name.cstr(), kCFStringEncodingUTF8 );
|
font_name = CFStringCreateWithCString( NULL, name.cstr(), kCFStringEncodingUTF8 );
|
||||||
if( font_name != NULL )
|
if( font_name != NULL )
|
||||||
{
|
{
|
||||||
font_descriptor = CTFontDescriptorCreateWithNameAndSize( font_name, 0.0); //POINT_SIZE );
|
font_descriptor = CTFontDescriptorCreateWithNameAndSize( font_name, 0.0); //POINT_SIZE );
|
||||||
|
|
||||||
if( font_descriptor != NULL )
|
if( font_descriptor != NULL )
|
||||||
{
|
{
|
||||||
ct_font = CTFontCreateWithFontDescriptor( font_descriptor, POINT_SIZE, &affine_transform );
|
ct_font = CTFontCreateWithFontDescriptor( font_descriptor, POINT_SIZE, &affine_transform );
|
||||||
|
|
||||||
CFRelease( font_descriptor );
|
CFRelease( font_descriptor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease( font_name );
|
CFRelease( font_name );
|
||||||
|
|
||||||
if (!ct_font)
|
if (!ct_font)
|
||||||
{
|
{
|
||||||
osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.cstr());
|
osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.cstr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFStringRef real_name = CTFontCopyPostScriptName( ct_font );
|
CFStringRef real_name = CTFontCopyPostScriptName( ct_font );
|
||||||
char real_name_c_string[255];
|
char real_name_c_string[255];
|
||||||
CFStringGetCString ( real_name, real_name_c_string, 255, kCFStringEncodingUTF8 );
|
CFStringGetCString ( real_name, real_name_c_string, 255, kCFStringEncodingUTF8 );
|
||||||
osd_printf_verbose("Matching font: %s\n", real_name_c_string);
|
osd_printf_verbose("Matching font: %s\n", real_name_c_string);
|
||||||
CFRelease( real_name );
|
CFRelease( real_name );
|
||||||
|
|
||||||
CGFloat line_height = 0.0;
|
CGFloat line_height = 0.0;
|
||||||
line_height += CTFontGetAscent(ct_font);
|
line_height += CTFontGetAscent(ct_font);
|
||||||
line_height += CTFontGetDescent(ct_font);
|
line_height += CTFontGetDescent(ct_font);
|
||||||
line_height += CTFontGetLeading(ct_font);
|
line_height += CTFontGetLeading(ct_font);
|
||||||
height = ceilf(line_height * EXTRA_HEIGHT);
|
height = ceilf(line_height * EXTRA_HEIGHT);
|
||||||
|
|
||||||
m_font = ct_font;
|
m_font = ct_font;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -100,10 +100,10 @@ bool osd_font_osx::open(const char *font_path, const char *_name, int &height)
|
|||||||
|
|
||||||
void osd_font_osx::close()
|
void osd_font_osx::close()
|
||||||
{
|
{
|
||||||
if( m_font != NULL )
|
if( m_font != NULL )
|
||||||
{
|
{
|
||||||
CFRelease( m_font );
|
CFRelease( m_font );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -116,88 +116,88 @@ void osd_font_osx::close()
|
|||||||
|
|
||||||
bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
||||||
{
|
{
|
||||||
UniChar uni_char;
|
UniChar uni_char;
|
||||||
CGGlyph glyph;
|
CGGlyph glyph;
|
||||||
CTFontRef ct_font = m_font;
|
CTFontRef ct_font = m_font;
|
||||||
const CFIndex count = 1;
|
const CFIndex count = 1;
|
||||||
CGRect bounding_rect, success_rect;
|
CGRect bounding_rect, success_rect;
|
||||||
CGContextRef context_ref;
|
CGContextRef context_ref;
|
||||||
|
|
||||||
if( chnum == ' ' )
|
if( chnum == ' ' )
|
||||||
{
|
{
|
||||||
uni_char = 'n';
|
uni_char = 'n';
|
||||||
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
||||||
success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count );
|
success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count );
|
||||||
uni_char = chnum;
|
uni_char = chnum;
|
||||||
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uni_char = chnum;
|
uni_char = chnum;
|
||||||
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count );
|
||||||
success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count );
|
success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( CGRectEqualToRect( success_rect, CGRectNull ) == false )
|
if( CGRectEqualToRect( success_rect, CGRectNull ) == false )
|
||||||
{
|
{
|
||||||
size_t bitmap_width;
|
size_t bitmap_width;
|
||||||
size_t bitmap_height;
|
size_t bitmap_height;
|
||||||
|
|
||||||
bitmap_width = ceilf(bounding_rect.size.width * EXTRA_WIDTH);
|
bitmap_width = ceilf(bounding_rect.size.width * EXTRA_WIDTH);
|
||||||
bitmap_width = bitmap_width == 0 ? 1 : bitmap_width;
|
bitmap_width = bitmap_width == 0 ? 1 : bitmap_width;
|
||||||
|
|
||||||
bitmap_height = ceilf( (CTFontGetAscent(ct_font) + CTFontGetDescent(ct_font) + CTFontGetLeading(ct_font)) * EXTRA_HEIGHT);
|
bitmap_height = ceilf( (CTFontGetAscent(ct_font) + CTFontGetDescent(ct_font) + CTFontGetLeading(ct_font)) * EXTRA_HEIGHT);
|
||||||
|
|
||||||
xoffs = yoffs = 0;
|
xoffs = yoffs = 0;
|
||||||
width = bitmap_width;
|
width = bitmap_width;
|
||||||
|
|
||||||
size_t bits_per_component;
|
size_t bits_per_component;
|
||||||
CGColorSpaceRef color_space;
|
CGColorSpaceRef color_space;
|
||||||
CGBitmapInfo bitmap_info = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst;
|
CGBitmapInfo bitmap_info = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst;
|
||||||
|
|
||||||
color_space = CGColorSpaceCreateDeviceRGB();
|
color_space = CGColorSpaceCreateDeviceRGB();
|
||||||
bits_per_component = 8;
|
bits_per_component = 8;
|
||||||
|
|
||||||
bitmap.allocate(bitmap_width, bitmap_height);
|
bitmap.allocate(bitmap_width, bitmap_height);
|
||||||
|
|
||||||
context_ref = CGBitmapContextCreate( bitmap.raw_pixptr(0), bitmap_width, bitmap_height, bits_per_component, bitmap.rowpixels()*4, color_space, bitmap_info );
|
context_ref = CGBitmapContextCreate( bitmap.raw_pixptr(0), bitmap_width, bitmap_height, bits_per_component, bitmap.rowpixels()*4, color_space, bitmap_info );
|
||||||
|
|
||||||
if( context_ref != NULL )
|
if( context_ref != NULL )
|
||||||
{
|
{
|
||||||
CGFontRef font_ref;
|
CGFontRef font_ref;
|
||||||
font_ref = CTFontCopyGraphicsFont( ct_font, NULL );
|
font_ref = CTFontCopyGraphicsFont( ct_font, NULL );
|
||||||
CGContextSetTextPosition(context_ref, -bounding_rect.origin.x*EXTRA_WIDTH, CTFontGetDescent(ct_font)+CTFontGetLeading(ct_font) );
|
CGContextSetTextPosition(context_ref, -bounding_rect.origin.x*EXTRA_WIDTH, CTFontGetDescent(ct_font)+CTFontGetLeading(ct_font) );
|
||||||
CGContextSetRGBFillColor(context_ref, 1.0, 1.0, 1.0, 1.0);
|
CGContextSetRGBFillColor(context_ref, 1.0, 1.0, 1.0, 1.0);
|
||||||
CGContextSetFont( context_ref, font_ref );
|
CGContextSetFont( context_ref, font_ref );
|
||||||
CGContextSetFontSize( context_ref, POINT_SIZE );
|
CGContextSetFontSize( context_ref, POINT_SIZE );
|
||||||
CGContextShowGlyphs( context_ref, &glyph, count );
|
CGContextShowGlyphs( context_ref, &glyph, count );
|
||||||
CGFontRelease( font_ref );
|
CGFontRelease( font_ref );
|
||||||
CGContextRelease( context_ref );
|
CGContextRelease( context_ref );
|
||||||
}
|
}
|
||||||
|
|
||||||
CGColorSpaceRelease( color_space );
|
CGColorSpaceRelease( color_space );
|
||||||
}
|
}
|
||||||
|
|
||||||
return bitmap.valid();
|
return bitmap.valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class font_osx : public osd_module, public font_module
|
class font_osx : public osd_module, public font_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
font_osx()
|
font_osx()
|
||||||
: osd_module(OSD_FONT_PROVIDER, "osx"), font_module()
|
: osd_module(OSD_FONT_PROVIDER, "osx"), font_module()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_font *font_alloc()
|
osd_font *font_alloc()
|
||||||
{
|
{
|
||||||
return global_alloc(osd_font_osx);
|
return global_alloc(osd_font_osx);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
#else /* SDLMAME_UNIX */
|
#else /* SDLMAME_UNIX */
|
||||||
MODULE_NOT_SUPPORTED(font_osx, OSD_FONT_PROVIDER, "osx")
|
MODULE_NOT_SUPPORTED(font_osx, OSD_FONT_PROVIDER, "osx")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_DEFINITION(FONT_OSX, font_osx)
|
MODULE_DEFINITION(FONT_OSX, font_osx)
|
||||||
|
@ -32,95 +32,95 @@
|
|||||||
class osd_font_sdl : public osd_font
|
class osd_font_sdl : public osd_font
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~osd_font_sdl() {};
|
virtual ~osd_font_sdl() {};
|
||||||
|
|
||||||
virtual bool open(const char *font_path, const char *name, int &height);
|
virtual bool open(const char *font_path, const char *name, int &height);
|
||||||
virtual void close();
|
virtual void close();
|
||||||
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
||||||
private:
|
private:
|
||||||
#ifndef SDLMAME_HAIKU
|
#ifndef SDLMAME_HAIKU
|
||||||
TTF_Font *search_font_config(astring name, bool bold, bool italic, bool underline, bool &bakedstyles);
|
TTF_Font *search_font_config(astring name, bool bold, bool italic, bool underline, bool &bakedstyles);
|
||||||
#endif
|
#endif
|
||||||
bool BDF_Check_Magic(astring name);
|
bool BDF_Check_Magic(astring name);
|
||||||
TTF_Font * TTF_OpenFont_Magic(astring name, int fsize);
|
TTF_Font * TTF_OpenFont_Magic(astring name, int fsize);
|
||||||
TTF_Font *m_font;
|
TTF_Font *m_font;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
||||||
{
|
{
|
||||||
TTF_Font *font = (TTF_Font *)NULL;
|
TTF_Font *font = (TTF_Font *)NULL;
|
||||||
bool bakedstyles = false;
|
bool bakedstyles = false;
|
||||||
int style = 0;
|
int style = 0;
|
||||||
|
|
||||||
// accept qualifiers from the name
|
// accept qualifiers from the name
|
||||||
astring name(_name);
|
astring name(_name);
|
||||||
|
|
||||||
if (name == "default")
|
if (name == "default")
|
||||||
{
|
{
|
||||||
name = "Liberation Sans";
|
name = "Liberation Sans";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
||||||
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
||||||
bool underline = (name.replace(0, "[U]", "") + name.replace(0, "[u]", "") > 0);
|
bool underline = (name.replace(0, "[U]", "") + name.replace(0, "[u]", "") > 0);
|
||||||
bool strike = (name.replace(0, "[S]", "") + name.replace(0, "[s]", "") > 0);
|
bool strike = (name.replace(0, "[S]", "") + name.replace(0, "[s]", "") > 0);
|
||||||
|
|
||||||
// first up, try it as a filename
|
// first up, try it as a filename
|
||||||
font = TTF_OpenFont_Magic(name, POINT_SIZE);
|
font = TTF_OpenFont_Magic(name, POINT_SIZE);
|
||||||
|
|
||||||
// if no success, try the font path
|
// if no success, try the font path
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
osd_printf_verbose("Searching font %s in -%s\n", name.cstr(), OPTION_FONTPATH);
|
osd_printf_verbose("Searching font %s in -%s\n", name.cstr(), OPTION_FONTPATH);
|
||||||
//emu_file file(options().font_path(), OPEN_FLAG_READ);
|
//emu_file file(options().font_path(), OPEN_FLAG_READ);
|
||||||
emu_file file(font_path, OPEN_FLAG_READ);
|
emu_file file(font_path, OPEN_FLAG_READ);
|
||||||
if (file.open(name) == FILERR_NONE)
|
if (file.open(name) == FILERR_NONE)
|
||||||
{
|
{
|
||||||
astring full_name = file.fullpath();
|
astring full_name = file.fullpath();
|
||||||
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
|
font = TTF_OpenFont_Magic(full_name, POINT_SIZE);
|
||||||
if (font)
|
if (font)
|
||||||
osd_printf_verbose("Found font %s\n", full_name.cstr());
|
osd_printf_verbose("Found font %s\n", full_name.cstr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if that didn't work, crank up the FontConfig database
|
// if that didn't work, crank up the FontConfig database
|
||||||
#ifndef SDLMAME_HAIKU
|
#ifndef SDLMAME_HAIKU
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
font = search_font_config(name, bold, italic, underline, bakedstyles);
|
font = search_font_config(name, bold, italic, underline, bakedstyles);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
if (!BDF_Check_Magic(name))
|
if (!BDF_Check_Magic(name))
|
||||||
{
|
{
|
||||||
osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.cstr());
|
osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.cstr());
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
if (!bakedstyles)
|
if (!bakedstyles)
|
||||||
{
|
{
|
||||||
style |= bold ? TTF_STYLE_BOLD : 0;
|
style |= bold ? TTF_STYLE_BOLD : 0;
|
||||||
style |= italic ? TTF_STYLE_ITALIC : 0;
|
style |= italic ? TTF_STYLE_ITALIC : 0;
|
||||||
}
|
}
|
||||||
style |= underline ? TTF_STYLE_UNDERLINE : 0;
|
style |= underline ? TTF_STYLE_UNDERLINE : 0;
|
||||||
// SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH
|
// SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH
|
||||||
#if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9)
|
#if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9)
|
||||||
style |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
|
style |= strike ? TTF_STYLE_STRIKETHROUGH : 0;
|
||||||
#else
|
#else
|
||||||
if (strike)
|
if (strike)
|
||||||
osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n");
|
osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n");
|
||||||
#endif // PATCHLEVEL
|
#endif // PATCHLEVEL
|
||||||
TTF_SetFontStyle(font, style);
|
TTF_SetFontStyle(font, style);
|
||||||
|
|
||||||
height = TTF_FontLineSkip(font);
|
height = TTF_FontLineSkip(font);
|
||||||
|
|
||||||
m_font = font;
|
m_font = font;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -130,7 +130,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height)
|
|||||||
|
|
||||||
void osd_font_sdl::close()
|
void osd_font_sdl::close()
|
||||||
{
|
{
|
||||||
TTF_CloseFont(this->m_font);
|
TTF_CloseFont(this->m_font);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -143,184 +143,184 @@ void osd_font_sdl::close()
|
|||||||
|
|
||||||
bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
||||||
{
|
{
|
||||||
TTF_Font *ttffont;
|
TTF_Font *ttffont;
|
||||||
SDL_Surface *drawsurf;
|
SDL_Surface *drawsurf;
|
||||||
SDL_Color fcol = { 0xff, 0xff, 0xff };
|
SDL_Color fcol = { 0xff, 0xff, 0xff };
|
||||||
UINT16 ustr[16];
|
UINT16 ustr[16];
|
||||||
|
|
||||||
ttffont = m_font;
|
ttffont = m_font;
|
||||||
|
|
||||||
memset(ustr,0,sizeof(ustr));
|
memset(ustr,0,sizeof(ustr));
|
||||||
ustr[0] = (UINT16)chnum;
|
ustr[0] = (UINT16)chnum;
|
||||||
drawsurf = TTF_RenderUNICODE_Solid(ttffont, ustr, fcol);
|
drawsurf = TTF_RenderUNICODE_Solid(ttffont, ustr, fcol);
|
||||||
|
|
||||||
// was nothing returned?
|
// was nothing returned?
|
||||||
if (drawsurf)
|
if (drawsurf)
|
||||||
{
|
{
|
||||||
// allocate a MAME destination bitmap
|
// allocate a MAME destination bitmap
|
||||||
bitmap.allocate(drawsurf->w, drawsurf->h);
|
bitmap.allocate(drawsurf->w, drawsurf->h);
|
||||||
|
|
||||||
// copy the rendered character image into it
|
// copy the rendered character image into it
|
||||||
for (int y = 0; y < bitmap.height(); y++)
|
for (int y = 0; y < bitmap.height(); y++)
|
||||||
{
|
{
|
||||||
UINT32 *dstrow = &bitmap.pix32(y);
|
UINT32 *dstrow = &bitmap.pix32(y);
|
||||||
UINT8 *srcrow = (UINT8 *)drawsurf->pixels;
|
UINT8 *srcrow = (UINT8 *)drawsurf->pixels;
|
||||||
|
|
||||||
srcrow += (y * drawsurf->pitch);
|
srcrow += (y * drawsurf->pitch);
|
||||||
|
|
||||||
for (int x = 0; x < drawsurf->w; x++)
|
for (int x = 0; x < drawsurf->w; x++)
|
||||||
{
|
{
|
||||||
dstrow[x] = srcrow[x] ? rgb_t(0xff,0xff,0xff,0xff) : rgb_t(0x00,0xff,0xff,0xff);
|
dstrow[x] = srcrow[x] ? rgb_t(0xff,0xff,0xff,0xff) : rgb_t(0x00,0xff,0xff,0xff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// what are these?
|
// what are these?
|
||||||
xoffs = yoffs = 0;
|
xoffs = yoffs = 0;
|
||||||
width = drawsurf->w;
|
width = drawsurf->w;
|
||||||
|
|
||||||
SDL_FreeSurface(drawsurf);
|
SDL_FreeSurface(drawsurf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bitmap.valid();
|
return bitmap.valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(astring name, int fsize)
|
TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(astring name, int fsize)
|
||||||
{
|
{
|
||||||
emu_file file(OPEN_FLAG_READ);
|
emu_file file(OPEN_FLAG_READ);
|
||||||
if (file.open(name) == FILERR_NONE)
|
if (file.open(name) == FILERR_NONE)
|
||||||
{
|
{
|
||||||
unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff };
|
unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||||
unsigned char magic[5] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
|
unsigned char magic[5] = { 0x00, 0x01, 0x00, 0x00, 0x00 };
|
||||||
file.read(buffer,5);
|
file.read(buffer,5);
|
||||||
if (memcmp(buffer, magic, 5))
|
if (memcmp(buffer, magic, 5))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return TTF_OpenFont(name.cstr(), POINT_SIZE);
|
return TTF_OpenFont(name.cstr(), POINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osd_font_sdl::BDF_Check_Magic(astring name)
|
bool osd_font_sdl::BDF_Check_Magic(astring name)
|
||||||
{
|
{
|
||||||
emu_file file(OPEN_FLAG_READ);
|
emu_file file(OPEN_FLAG_READ);
|
||||||
if (file.open(name) == FILERR_NONE)
|
if (file.open(name) == FILERR_NONE)
|
||||||
{
|
{
|
||||||
unsigned char buffer[9];
|
unsigned char buffer[9];
|
||||||
unsigned char magic[9] = { 'S', 'T', 'A', 'R', 'T', 'F', 'O', 'N', 'T' };
|
unsigned char magic[9] = { 'S', 'T', 'A', 'R', 'T', 'F', 'O', 'N', 'T' };
|
||||||
file.read(buffer, 9);
|
file.read(buffer, 9);
|
||||||
file.close();
|
file.close();
|
||||||
if (!memcmp(buffer, magic, 9))
|
if (!memcmp(buffer, magic, 9))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SDLMAME_HAIKU
|
#ifndef SDLMAME_HAIKU
|
||||||
TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic, bool underline, bool &bakedstyles)
|
TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic, bool underline, bool &bakedstyles)
|
||||||
{
|
{
|
||||||
TTF_Font *font = (TTF_Font *)NULL;
|
TTF_Font *font = (TTF_Font *)NULL;
|
||||||
FcConfig *config;
|
FcConfig *config;
|
||||||
FcPattern *pat;
|
FcPattern *pat;
|
||||||
FcObjectSet *os;
|
FcObjectSet *os;
|
||||||
FcFontSet *fontset;
|
FcFontSet *fontset;
|
||||||
FcValue val;
|
FcValue val;
|
||||||
|
|
||||||
config = FcConfigGetCurrent();
|
config = FcConfigGetCurrent();
|
||||||
pat = FcPatternCreate();
|
pat = FcPatternCreate();
|
||||||
os = FcObjectSetCreate();
|
os = FcObjectSetCreate();
|
||||||
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
||||||
|
|
||||||
// try and get a font with the requested styles baked-in
|
// try and get a font with the requested styles baked-in
|
||||||
if (bold)
|
if (bold)
|
||||||
{
|
{
|
||||||
if (italic)
|
if (italic)
|
||||||
{
|
{
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold Italic");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold Italic");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (italic)
|
else if (italic)
|
||||||
{
|
{
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Italic");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Italic");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
||||||
}
|
}
|
||||||
|
|
||||||
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
||||||
|
|
||||||
FcObjectSetAdd(os, FC_FILE);
|
FcObjectSetAdd(os, FC_FILE);
|
||||||
fontset = FcFontList(config, pat, os);
|
fontset = FcFontList(config, pat, os);
|
||||||
|
|
||||||
for (int i = 0; i < fontset->nfont; i++)
|
for (int i = 0; i < fontset->nfont; i++)
|
||||||
{
|
{
|
||||||
if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch)
|
if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.type != FcTypeString)
|
if (val.type != FcTypeString)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_verbose("Matching font: %s\n", val.u.s);
|
osd_printf_verbose("Matching font: %s\n", val.u.s);
|
||||||
{
|
{
|
||||||
astring match_name((const char*)val.u.s);
|
astring match_name((const char*)val.u.s);
|
||||||
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
|
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font)
|
if (font)
|
||||||
{
|
{
|
||||||
bakedstyles = true;
|
bakedstyles = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// didn't get a font above? try again with no baked-in styles
|
// didn't get a font above? try again with no baked-in styles
|
||||||
if (!font)
|
if (!font)
|
||||||
{
|
{
|
||||||
FcPatternDestroy(pat);
|
FcPatternDestroy(pat);
|
||||||
FcFontSetDestroy(fontset);
|
FcFontSetDestroy(fontset);
|
||||||
|
|
||||||
pat = FcPatternCreate();
|
pat = FcPatternCreate();
|
||||||
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr());
|
||||||
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular");
|
||||||
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType");
|
||||||
fontset = FcFontList(config, pat, os);
|
fontset = FcFontList(config, pat, os);
|
||||||
|
|
||||||
for (int i = 0; i < fontset->nfont; i++)
|
for (int i = 0; i < fontset->nfont; i++)
|
||||||
{
|
{
|
||||||
if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch)
|
if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.type != FcTypeString)
|
if (val.type != FcTypeString)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_printf_verbose("Matching unstyled font: %s\n", val.u.s);
|
osd_printf_verbose("Matching unstyled font: %s\n", val.u.s);
|
||||||
{
|
{
|
||||||
astring match_name((const char*)val.u.s);
|
astring match_name((const char*)val.u.s);
|
||||||
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
|
font = TTF_OpenFont_Magic(match_name, POINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font)
|
if (font)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FcPatternDestroy(pat);
|
FcPatternDestroy(pat);
|
||||||
FcObjectSetDestroy(os);
|
FcObjectSetDestroy(os);
|
||||||
FcFontSetDestroy(fontset);
|
FcFontSetDestroy(fontset);
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -328,35 +328,33 @@ TTF_Font *osd_font_sdl::search_font_config(astring name, bool bold, bool italic,
|
|||||||
class font_sdl : public osd_module, public font_module
|
class font_sdl : public osd_module, public font_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
font_sdl()
|
font_sdl()
|
||||||
: osd_module(OSD_FONT_PROVIDER, "sdl"), font_module()
|
: osd_module(OSD_FONT_PROVIDER, "sdl"), font_module()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_font *font_alloc()
|
osd_font *font_alloc()
|
||||||
{
|
{
|
||||||
return global_alloc(osd_font_sdl);
|
return global_alloc(osd_font_sdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
int init()
|
int init()
|
||||||
{
|
{
|
||||||
if (TTF_Init() == -1)
|
if (TTF_Init() == -1)
|
||||||
{
|
{
|
||||||
osd_printf_error("SDL_ttf failed: %s\n", TTF_GetError());
|
osd_printf_error("SDL_ttf failed: %s\n", TTF_GetError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void exit()
|
virtual void exit()
|
||||||
{
|
{
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else /* SDLMAME_UNIX */
|
#else /* SDLMAME_UNIX */
|
||||||
MODULE_NOT_SUPPORTED(font_sdl, OSD_FONT_PROVIDER, "sdl")
|
MODULE_NOT_SUPPORTED(font_sdl, OSD_FONT_PROVIDER, "sdl")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_DEFINITION(FONT_SDL, font_sdl)
|
MODULE_DEFINITION(FONT_SDL, font_sdl)
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,72 +34,72 @@
|
|||||||
class osd_font_windows : public osd_font
|
class osd_font_windows : public osd_font
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~osd_font_windows() {};
|
virtual ~osd_font_windows() {};
|
||||||
|
|
||||||
virtual bool open(const char *font_path, const char *name, int &height);
|
virtual bool open(const char *font_path, const char *name, int &height);
|
||||||
virtual void close();
|
virtual void close();
|
||||||
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
|
||||||
private:
|
private:
|
||||||
HGDIOBJ m_font;
|
HGDIOBJ m_font;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool osd_font_windows::open(const char *font_path, const char *_name, int &height)
|
bool osd_font_windows::open(const char *font_path, const char *_name, int &height)
|
||||||
{
|
{
|
||||||
// accept qualifiers from the name
|
// accept qualifiers from the name
|
||||||
astring name(_name);
|
astring name(_name);
|
||||||
if (name == "default") name = "Tahoma";
|
if (name == "default") name = "Tahoma";
|
||||||
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0);
|
||||||
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0);
|
||||||
|
|
||||||
// build a basic LOGFONT description of what we want
|
// build a basic LOGFONT description of what we want
|
||||||
LOGFONT logfont;
|
LOGFONT logfont;
|
||||||
logfont.lfHeight = DEFAULT_FONT_HEIGHT;
|
logfont.lfHeight = DEFAULT_FONT_HEIGHT;
|
||||||
logfont.lfWidth = 0;
|
logfont.lfWidth = 0;
|
||||||
logfont.lfEscapement = 0;
|
logfont.lfEscapement = 0;
|
||||||
logfont.lfOrientation = 0;
|
logfont.lfOrientation = 0;
|
||||||
logfont.lfWeight = bold ? FW_BOLD : FW_MEDIUM;
|
logfont.lfWeight = bold ? FW_BOLD : FW_MEDIUM;
|
||||||
logfont.lfItalic = italic;
|
logfont.lfItalic = italic;
|
||||||
logfont.lfUnderline = FALSE;
|
logfont.lfUnderline = FALSE;
|
||||||
logfont.lfStrikeOut = FALSE;
|
logfont.lfStrikeOut = FALSE;
|
||||||
logfont.lfCharSet = ANSI_CHARSET;
|
logfont.lfCharSet = ANSI_CHARSET;
|
||||||
logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
|
logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
|
||||||
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||||
logfont.lfQuality = NONANTIALIASED_QUALITY;
|
logfont.lfQuality = NONANTIALIASED_QUALITY;
|
||||||
logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
|
logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
|
||||||
|
|
||||||
// copy in the face name
|
// copy in the face name
|
||||||
TCHAR *face = tstring_from_utf8(name);
|
TCHAR *face = tstring_from_utf8(name);
|
||||||
_tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR));
|
_tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR));
|
||||||
logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR)-1] = 0;
|
logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR)-1] = 0;
|
||||||
osd_free(face);
|
osd_free(face);
|
||||||
|
|
||||||
// create the font
|
// create the font
|
||||||
height = logfont.lfHeight;
|
height = logfont.lfHeight;
|
||||||
m_font = CreateFontIndirect(&logfont);
|
m_font = CreateFontIndirect(&logfont);
|
||||||
if (m_font == NULL)
|
if (m_font == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// select it into a temp DC and get the real font name
|
// select it into a temp DC and get the real font name
|
||||||
HDC dummyDC = CreateCompatibleDC(NULL);
|
HDC dummyDC = CreateCompatibleDC(NULL);
|
||||||
HGDIOBJ oldfont = SelectObject(dummyDC, m_font);
|
HGDIOBJ oldfont = SelectObject(dummyDC, m_font);
|
||||||
TCHAR realname[100];
|
TCHAR realname[100];
|
||||||
GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname);
|
GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname);
|
||||||
SelectObject(dummyDC, oldfont);
|
SelectObject(dummyDC, oldfont);
|
||||||
DeleteDC(dummyDC);
|
DeleteDC(dummyDC);
|
||||||
|
|
||||||
// if it doesn't match our request, fail
|
// if it doesn't match our request, fail
|
||||||
char *utf = utf8_from_tstring(realname);
|
char *utf = utf8_from_tstring(realname);
|
||||||
int result = core_stricmp(utf, name);
|
int result = core_stricmp(utf, name);
|
||||||
osd_free(utf);
|
osd_free(utf);
|
||||||
|
|
||||||
// if we didn't match, nuke our font and fall back
|
// if we didn't match, nuke our font and fall back
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
DeleteObject(m_font);
|
DeleteObject(m_font);
|
||||||
m_font = NULL;
|
m_font = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -109,9 +109,9 @@ bool osd_font_windows::open(const char *font_path, const char *_name, int &heigh
|
|||||||
|
|
||||||
void osd_font_windows::close()
|
void osd_font_windows::close()
|
||||||
{
|
{
|
||||||
// delete the font ojbect
|
// delete the font ojbect
|
||||||
if (m_font != NULL)
|
if (m_font != NULL)
|
||||||
DeleteObject(m_font);
|
DeleteObject(m_font);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,155 +125,155 @@ void osd_font_windows::close()
|
|||||||
|
|
||||||
bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
|
||||||
{
|
{
|
||||||
// create a dummy DC to work with
|
// create a dummy DC to work with
|
||||||
HDC dummyDC = CreateCompatibleDC(NULL);
|
HDC dummyDC = CreateCompatibleDC(NULL);
|
||||||
HGDIOBJ oldfont = SelectObject(dummyDC, m_font);
|
HGDIOBJ oldfont = SelectObject(dummyDC, m_font);
|
||||||
|
|
||||||
// get the text metrics
|
// get the text metrics
|
||||||
TEXTMETRIC metrics = { 0 };
|
TEXTMETRIC metrics = { 0 };
|
||||||
GetTextMetrics(dummyDC, &metrics);
|
GetTextMetrics(dummyDC, &metrics);
|
||||||
|
|
||||||
// get the width of this character
|
// get the width of this character
|
||||||
ABC abc;
|
ABC abc;
|
||||||
if (!GetCharABCWidths(dummyDC, chnum, chnum, &abc))
|
if (!GetCharABCWidths(dummyDC, chnum, chnum, &abc))
|
||||||
{
|
{
|
||||||
abc.abcA = 0;
|
abc.abcA = 0;
|
||||||
abc.abcC = 0;
|
abc.abcC = 0;
|
||||||
GetCharWidth32(dummyDC, chnum, chnum, reinterpret_cast<LPINT>(&abc.abcB));
|
GetCharWidth32(dummyDC, chnum, chnum, reinterpret_cast<LPINT>(&abc.abcB));
|
||||||
}
|
}
|
||||||
width = abc.abcA + abc.abcB + abc.abcC;
|
width = abc.abcA + abc.abcB + abc.abcC;
|
||||||
|
|
||||||
// determine desired bitmap size
|
// determine desired bitmap size
|
||||||
int bmwidth = (50 + abc.abcA + abc.abcB + abc.abcC + 50 + 31) & ~31;
|
int bmwidth = (50 + abc.abcA + abc.abcB + abc.abcC + 50 + 31) & ~31;
|
||||||
int bmheight = 50 + metrics.tmHeight + 50;
|
int bmheight = 50 + metrics.tmHeight + 50;
|
||||||
|
|
||||||
// describe the bitmap we want
|
// describe the bitmap we want
|
||||||
BYTE bitmapinfodata[sizeof(BITMAPINFOHEADER)+2 * sizeof(RGBQUAD)] = { 0 };
|
BYTE bitmapinfodata[sizeof(BITMAPINFOHEADER)+2 * sizeof(RGBQUAD)] = { 0 };
|
||||||
BITMAPINFO &info = *reinterpret_cast<BITMAPINFO *>(bitmapinfodata);
|
BITMAPINFO &info = *reinterpret_cast<BITMAPINFO *>(bitmapinfodata);
|
||||||
info.bmiHeader.biSize = sizeof(info.bmiHeader);
|
info.bmiHeader.biSize = sizeof(info.bmiHeader);
|
||||||
info.bmiHeader.biWidth = bmwidth;
|
info.bmiHeader.biWidth = bmwidth;
|
||||||
info.bmiHeader.biHeight = -bmheight;
|
info.bmiHeader.biHeight = -bmheight;
|
||||||
info.bmiHeader.biPlanes = 1;
|
info.bmiHeader.biPlanes = 1;
|
||||||
info.bmiHeader.biBitCount = 1;
|
info.bmiHeader.biBitCount = 1;
|
||||||
info.bmiHeader.biCompression = BI_RGB;
|
info.bmiHeader.biCompression = BI_RGB;
|
||||||
info.bmiHeader.biSizeImage = 0;
|
info.bmiHeader.biSizeImage = 0;
|
||||||
info.bmiHeader.biXPelsPerMeter = GetDeviceCaps(dummyDC, HORZRES) / GetDeviceCaps(dummyDC, HORZSIZE);
|
info.bmiHeader.biXPelsPerMeter = GetDeviceCaps(dummyDC, HORZRES) / GetDeviceCaps(dummyDC, HORZSIZE);
|
||||||
info.bmiHeader.biYPelsPerMeter = GetDeviceCaps(dummyDC, VERTRES) / GetDeviceCaps(dummyDC, VERTSIZE);
|
info.bmiHeader.biYPelsPerMeter = GetDeviceCaps(dummyDC, VERTRES) / GetDeviceCaps(dummyDC, VERTSIZE);
|
||||||
info.bmiHeader.biClrUsed = 0;
|
info.bmiHeader.biClrUsed = 0;
|
||||||
info.bmiHeader.biClrImportant = 0;
|
info.bmiHeader.biClrImportant = 0;
|
||||||
RGBQUAD col1 = info.bmiColors[0];
|
RGBQUAD col1 = info.bmiColors[0];
|
||||||
RGBQUAD col2 = info.bmiColors[1];
|
RGBQUAD col2 = info.bmiColors[1];
|
||||||
col1.rgbBlue = col1.rgbGreen = col1.rgbRed = 0x00;
|
col1.rgbBlue = col1.rgbGreen = col1.rgbRed = 0x00;
|
||||||
col2.rgbBlue = col2.rgbGreen = col2.rgbRed = 0xff;
|
col2.rgbBlue = col2.rgbGreen = col2.rgbRed = 0xff;
|
||||||
|
|
||||||
// create a DIB to render to
|
// create a DIB to render to
|
||||||
BYTE *bits;
|
BYTE *bits;
|
||||||
HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0);
|
HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0);
|
||||||
HGDIOBJ oldbitmap = SelectObject(dummyDC, dib);
|
HGDIOBJ oldbitmap = SelectObject(dummyDC, dib);
|
||||||
|
|
||||||
// clear the bitmap
|
// clear the bitmap
|
||||||
int rowbytes = bmwidth / 8;
|
int rowbytes = bmwidth / 8;
|
||||||
memset(bits, 0, rowbytes * bmheight);
|
memset(bits, 0, rowbytes * bmheight);
|
||||||
|
|
||||||
// now draw the character
|
// now draw the character
|
||||||
WCHAR tempchar = chnum;
|
WCHAR tempchar = chnum;
|
||||||
SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff));
|
SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff));
|
||||||
SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00));
|
SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00));
|
||||||
ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL);
|
ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL);
|
||||||
|
|
||||||
// characters are expected to be full-height
|
// characters are expected to be full-height
|
||||||
rectangle actbounds;
|
rectangle actbounds;
|
||||||
actbounds.min_y = 50;
|
actbounds.min_y = 50;
|
||||||
actbounds.max_y = 50 + metrics.tmHeight - 1;
|
actbounds.max_y = 50 + metrics.tmHeight - 1;
|
||||||
|
|
||||||
// determine the actual left of the character
|
// determine the actual left of the character
|
||||||
for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++)
|
for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++)
|
||||||
{
|
{
|
||||||
BYTE *offs = bits + actbounds.min_x;
|
BYTE *offs = bits + actbounds.min_x;
|
||||||
UINT8 summary = 0;
|
UINT8 summary = 0;
|
||||||
for (int y = 0; y < bmheight; y++)
|
for (int y = 0; y < bmheight; y++)
|
||||||
summary |= offs[y * rowbytes];
|
summary |= offs[y * rowbytes];
|
||||||
if (summary != 0)
|
if (summary != 0)
|
||||||
{
|
{
|
||||||
actbounds.min_x *= 8;
|
actbounds.min_x *= 8;
|
||||||
if (!(summary & 0x80)) actbounds.min_x++;
|
if (!(summary & 0x80)) actbounds.min_x++;
|
||||||
if (!(summary & 0xc0)) actbounds.min_x++;
|
if (!(summary & 0xc0)) actbounds.min_x++;
|
||||||
if (!(summary & 0xe0)) actbounds.min_x++;
|
if (!(summary & 0xe0)) actbounds.min_x++;
|
||||||
if (!(summary & 0xf0)) actbounds.min_x++;
|
if (!(summary & 0xf0)) actbounds.min_x++;
|
||||||
if (!(summary & 0xf8)) actbounds.min_x++;
|
if (!(summary & 0xf8)) actbounds.min_x++;
|
||||||
if (!(summary & 0xfc)) actbounds.min_x++;
|
if (!(summary & 0xfc)) actbounds.min_x++;
|
||||||
if (!(summary & 0xfe)) actbounds.min_x++;
|
if (!(summary & 0xfe)) actbounds.min_x++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine the actual right of the character
|
// determine the actual right of the character
|
||||||
for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--)
|
for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--)
|
||||||
{
|
{
|
||||||
BYTE *offs = bits + actbounds.max_x;
|
BYTE *offs = bits + actbounds.max_x;
|
||||||
UINT8 summary = 0;
|
UINT8 summary = 0;
|
||||||
for (int y = 0; y < bmheight; y++)
|
for (int y = 0; y < bmheight; y++)
|
||||||
summary |= offs[y * rowbytes];
|
summary |= offs[y * rowbytes];
|
||||||
if (summary != 0)
|
if (summary != 0)
|
||||||
{
|
{
|
||||||
actbounds.max_x *= 8;
|
actbounds.max_x *= 8;
|
||||||
if (summary & 0x7f) actbounds.max_x++;
|
if (summary & 0x7f) actbounds.max_x++;
|
||||||
if (summary & 0x3f) actbounds.max_x++;
|
if (summary & 0x3f) actbounds.max_x++;
|
||||||
if (summary & 0x1f) actbounds.max_x++;
|
if (summary & 0x1f) actbounds.max_x++;
|
||||||
if (summary & 0x0f) actbounds.max_x++;
|
if (summary & 0x0f) actbounds.max_x++;
|
||||||
if (summary & 0x07) actbounds.max_x++;
|
if (summary & 0x07) actbounds.max_x++;
|
||||||
if (summary & 0x03) actbounds.max_x++;
|
if (summary & 0x03) actbounds.max_x++;
|
||||||
if (summary & 0x01) actbounds.max_x++;
|
if (summary & 0x01) actbounds.max_x++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate a new bitmap
|
// allocate a new bitmap
|
||||||
if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y)
|
if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y)
|
||||||
{
|
{
|
||||||
bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y);
|
bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y);
|
||||||
|
|
||||||
// copy the bits into it
|
// copy the bits into it
|
||||||
for (int y = 0; y < bitmap.height(); y++)
|
for (int y = 0; y < bitmap.height(); y++)
|
||||||
{
|
{
|
||||||
UINT32 *dstrow = &bitmap.pix32(y);
|
UINT32 *dstrow = &bitmap.pix32(y);
|
||||||
UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes];
|
UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes];
|
||||||
for (int x = 0; x < bitmap.width(); x++)
|
for (int x = 0; x < bitmap.width(); x++)
|
||||||
{
|
{
|
||||||
int effx = x + actbounds.min_x;
|
int effx = x + actbounds.min_x;
|
||||||
dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff);
|
dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the final offset values
|
// set the final offset values
|
||||||
xoffs = actbounds.min_x - (50 + abc.abcA);
|
xoffs = actbounds.min_x - (50 + abc.abcA);
|
||||||
yoffs = actbounds.max_y - (50 + metrics.tmAscent);
|
yoffs = actbounds.max_y - (50 + metrics.tmAscent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// de-select the font and release the DC
|
// de-select the font and release the DC
|
||||||
SelectObject(dummyDC, oldbitmap);
|
SelectObject(dummyDC, oldbitmap);
|
||||||
DeleteObject(dib);
|
DeleteObject(dib);
|
||||||
SelectObject(dummyDC, oldfont);
|
SelectObject(dummyDC, oldfont);
|
||||||
DeleteDC(dummyDC);
|
DeleteDC(dummyDC);
|
||||||
return bitmap.valid();
|
return bitmap.valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
class font_win : public osd_module, public font_module
|
class font_win : public osd_module, public font_module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
font_win()
|
font_win()
|
||||||
: osd_module(OSD_FONT_PROVIDER, "win"), font_module()
|
: osd_module(OSD_FONT_PROVIDER, "win"), font_module()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
osd_font *font_alloc()
|
osd_font *font_alloc()
|
||||||
{
|
{
|
||||||
return global_alloc(osd_font_windows);
|
return global_alloc(osd_font_windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
#else /* SDLMAME_UNIX */
|
#else /* SDLMAME_UNIX */
|
||||||
MODULE_NOT_SUPPORTED(font_win, OSD_FONT_PROVIDER, "win")
|
MODULE_NOT_SUPPORTED(font_win, OSD_FONT_PROVIDER, "win")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_DEFINITION(FONT_WINDOWS, font_win)
|
MODULE_DEFINITION(FONT_WINDOWS, font_win)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user